From cdc2e9b5f1aebb251172ea531a73f33956ef343e Mon Sep 17 00:00:00 2001 From: Florent Viel Date: Thu, 10 Oct 2024 10:13:49 +0200 Subject: [PATCH 1/3] feat: update sdk to latest version --- package-lock.json | 25 +++++++++++++------------ package.json | 2 +- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index aff4f18..3a13871 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "Apache-2.0", "dependencies": { "@actions/core": "^1.11.1", - "@scaleway/sdk": "^1.37.0", + "@scaleway/sdk": "^2.49.0", "cross-fetch": "^4.0.0" }, "devDependencies": { @@ -229,25 +229,26 @@ } }, "node_modules/@scaleway/sdk": { - "version": "1.37.0", - "resolved": "https://registry.npmjs.org/@scaleway/sdk/-/sdk-1.37.0.tgz", - "integrity": "sha512-bOwdI4GyEOit+evL+ZAIY0AkpEMVkVQKdxSUooRRsBUxfCwBKzOYa1fICTqruBftkyboqY+bhZvMlKXvsb9LRA==", + "version": "2.49.1", + "resolved": "https://registry.npmjs.org/@scaleway/sdk/-/sdk-2.49.1.tgz", + "integrity": "sha512-IXGIIoMQEtveXbhsY4YtJM8QaICHfG+bgHyEQLMn9CM6Pm3De/kyO01w2gWsON9RsSmkiJrPSaJpfjHvbAF+uw==", "bundleDependencies": [ "@scaleway/random-name" ], + "license": "Apache-2.0", "dependencies": { - "@scaleway/random-name": "^4.0.2" + "@scaleway/random-name": "5.1.0" }, "engines": { "node": ">=18.0" } }, "node_modules/@scaleway/sdk/node_modules/@scaleway/random-name": { - "version": "4.0.2", + "version": "5.1.0", "inBundle": true, "license": "MIT", "engines": { - "node": ">=14.x" + "node": ">=20.x" } }, "node_modules/@tsconfig/node10": { @@ -2468,15 +2469,15 @@ } }, "@scaleway/sdk": { - "version": "1.37.0", - "resolved": "https://registry.npmjs.org/@scaleway/sdk/-/sdk-1.37.0.tgz", - "integrity": "sha512-bOwdI4GyEOit+evL+ZAIY0AkpEMVkVQKdxSUooRRsBUxfCwBKzOYa1fICTqruBftkyboqY+bhZvMlKXvsb9LRA==", + "version": "2.49.1", + "resolved": "https://registry.npmjs.org/@scaleway/sdk/-/sdk-2.49.1.tgz", + "integrity": "sha512-IXGIIoMQEtveXbhsY4YtJM8QaICHfG+bgHyEQLMn9CM6Pm3De/kyO01w2gWsON9RsSmkiJrPSaJpfjHvbAF+uw==", "requires": { - "@scaleway/random-name": "^4.0.2" + "@scaleway/random-name": "5.1.0" }, "dependencies": { "@scaleway/random-name": { - "version": "4.0.2", + "version": "5.1.0", "bundled": true } } diff --git a/package.json b/package.json index 896c289..c4af3d8 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "license": "Apache-2.0", "dependencies": { "@actions/core": "^1.11.1", - "@scaleway/sdk": "^1.37.0", + "@scaleway/sdk": "^2.49.0", "cross-fetch": "^4.0.0" }, "devDependencies": { From 976c4070a32fef507d1d3bd4652af10b47084928 Mon Sep 17 00:00:00 2001 From: Florent Viel Date: Thu, 10 Oct 2024 10:14:09 +0200 Subject: [PATCH 2/3] feat: use v1beta1 namespace for secret api --- src/index.ts | 2 +- src/utils.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 470cf1f..65d977a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -14,7 +14,7 @@ export async function run(): Promise { defaultZone: core.getInput("default-zone"), }); - const api = new Secret.v1alpha1.API(client); + const api = new Secret.v1beta1.API(client); const secretConfigInputs: string[] = [ ...new Set(core.getMultilineInput("secret-names")), diff --git a/src/utils.ts b/src/utils.ts index ee15ee4..e9b95cb 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -56,7 +56,7 @@ export function splitNameAndPath(ref: string): [string, string] { } export async function getSecretValue( - api: Secret.v1alpha1.API, + api: Secret.v1beta1.API, secret: Secret, ): Promise { const secretList = await api.listSecrets({ From a8f08fbe20d6d482577b58252f72d8cd6b64c3eb Mon Sep 17 00:00:00 2001 From: Florent Viel Date: Thu, 10 Oct 2024 10:14:57 +0200 Subject: [PATCH 3/3] chore: package --- dist/index.js | 65296 +++++++++++++++++++++++++++++--------------- dist/index.js.map | 2 +- dist/licenses.txt | 25 + 3 files changed, 43841 insertions(+), 21482 deletions(-) diff --git a/dist/index.js b/dist/index.js index 5d2028c..22845bf 100644 --- a/dist/index.js +++ b/dist/index.js @@ -40,10 +40,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.run = void 0; -const core = __importStar(__nccwpck_require__(484)); +const core = __importStar(__nccwpck_require__(7484)); __nccwpck_require__(90); -const sdk_1 = __nccwpck_require__(526); -const utils_1 = __nccwpck_require__(855); +const sdk_1 = __nccwpck_require__(1526); +const utils_1 = __nccwpck_require__(9236); function run() { return __awaiter(this, void 0, void 0, function* () { try { @@ -55,7 +55,7 @@ function run() { defaultRegion: core.getInput("default-region"), defaultZone: core.getInput("default-zone"), }); - const api = new sdk_1.Secret.v1alpha1.API(client); + const api = new sdk_1.Secret.v1beta1.API(client); const secretConfigInputs = [ ...new Set(core.getMultilineInput("secret-names")), ]; @@ -84,7 +84,7 @@ run(); /***/ }), -/***/ 855: +/***/ 9236: /***/ (function(__unused_webpack_module, exports) { "use strict"; @@ -166,7 +166,7 @@ exports.getSecretValue = getSecretValue; /***/ }), -/***/ 914: +/***/ 4914: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -269,7 +269,7 @@ function escapeProperty(s) { /***/ }), -/***/ 484: +/***/ 7484: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -308,12 +308,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.platform = exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = exports.markdownSummary = exports.summary = exports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0; -const command_1 = __nccwpck_require__(914); -const file_command_1 = __nccwpck_require__(753); +const command_1 = __nccwpck_require__(4914); +const file_command_1 = __nccwpck_require__(4753); const utils_1 = __nccwpck_require__(302); const os = __importStar(__nccwpck_require__(857)); -const path = __importStar(__nccwpck_require__(928)); -const oidc_utils_1 = __nccwpck_require__(306); +const path = __importStar(__nccwpck_require__(6928)); +const oidc_utils_1 = __nccwpck_require__(5306); /** * The code to exit an action */ @@ -598,29 +598,29 @@ exports.getIDToken = getIDToken; /** * Summary exports */ -var summary_1 = __nccwpck_require__(847); +var summary_1 = __nccwpck_require__(1847); Object.defineProperty(exports, "summary", ({ enumerable: true, get: function () { return summary_1.summary; } })); /** * @deprecated use core.summary */ -var summary_2 = __nccwpck_require__(847); +var summary_2 = __nccwpck_require__(1847); Object.defineProperty(exports, "markdownSummary", ({ enumerable: true, get: function () { return summary_2.markdownSummary; } })); /** * Path exports */ -var path_utils_1 = __nccwpck_require__(976); +var path_utils_1 = __nccwpck_require__(1976); Object.defineProperty(exports, "toPosixPath", ({ enumerable: true, get: function () { return path_utils_1.toPosixPath; } })); Object.defineProperty(exports, "toWin32Path", ({ enumerable: true, get: function () { return path_utils_1.toWin32Path; } })); Object.defineProperty(exports, "toPlatformPath", ({ enumerable: true, get: function () { return path_utils_1.toPlatformPath; } })); /** * Platform utilities exports */ -exports.platform = __importStar(__nccwpck_require__(968)); +exports.platform = __importStar(__nccwpck_require__(8968)); //# sourceMappingURL=core.js.map /***/ }), -/***/ 753: +/***/ 4753: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -653,8 +653,8 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.prepareKeyValueMessage = exports.issueFileCommand = void 0; // We use any as a valid input type /* eslint-disable @typescript-eslint/no-explicit-any */ -const crypto = __importStar(__nccwpck_require__(982)); -const fs = __importStar(__nccwpck_require__(896)); +const crypto = __importStar(__nccwpck_require__(6982)); +const fs = __importStar(__nccwpck_require__(9896)); const os = __importStar(__nccwpck_require__(857)); const utils_1 = __nccwpck_require__(302); function issueFileCommand(command, message) { @@ -689,7 +689,7 @@ exports.prepareKeyValueMessage = prepareKeyValueMessage; /***/ }), -/***/ 306: +/***/ 5306: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -705,9 +705,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.OidcClient = void 0; -const http_client_1 = __nccwpck_require__(844); -const auth_1 = __nccwpck_require__(552); -const core_1 = __nccwpck_require__(484); +const http_client_1 = __nccwpck_require__(4844); +const auth_1 = __nccwpck_require__(4552); +const core_1 = __nccwpck_require__(7484); class OidcClient { static createHttpClient(allowRetry = true, maxRetry = 10) { const requestOptions = { @@ -773,7 +773,7 @@ exports.OidcClient = OidcClient; /***/ }), -/***/ 976: +/***/ 1976: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -803,7 +803,7 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0; -const path = __importStar(__nccwpck_require__(928)); +const path = __importStar(__nccwpck_require__(6928)); /** * toPosixPath converts the given path to the posix form. On Windows, \\ will be * replaced with /. @@ -842,7 +842,7 @@ exports.toPlatformPath = toPlatformPath; /***/ }), -/***/ 968: +/***/ 8968: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -885,7 +885,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getDetails = exports.isLinux = exports.isMacOS = exports.isWindows = exports.arch = exports.platform = void 0; const os_1 = __importDefault(__nccwpck_require__(857)); -const exec = __importStar(__nccwpck_require__(236)); +const exec = __importStar(__nccwpck_require__(5236)); const getWindowsInfo = () => __awaiter(void 0, void 0, void 0, function* () { const { stdout: version } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', undefined, { silent: true @@ -943,7 +943,7 @@ exports.getDetails = getDetails; /***/ }), -/***/ 847: +/***/ 1847: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -960,7 +960,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge Object.defineProperty(exports, "__esModule", ({ value: true })); exports.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0; const os_1 = __nccwpck_require__(857); -const fs_1 = __nccwpck_require__(896); +const fs_1 = __nccwpck_require__(9896); const { access, appendFile, writeFile } = fs_1.promises; exports.SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY'; exports.SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary'; @@ -1280,7 +1280,7 @@ exports.toCommandProperties = toCommandProperties; /***/ }), -/***/ 236: +/***/ 5236: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -1315,8 +1315,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getExecOutput = exports.exec = void 0; -const string_decoder_1 = __nccwpck_require__(193); -const tr = __importStar(__nccwpck_require__(665)); +const string_decoder_1 = __nccwpck_require__(3193); +const tr = __importStar(__nccwpck_require__(6665)); /** * Exec a command. * Output will be streamed to the live console. @@ -1390,7 +1390,7 @@ exports.getExecOutput = getExecOutput; /***/ }), -/***/ 665: +/***/ 6665: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -1426,12 +1426,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge Object.defineProperty(exports, "__esModule", ({ value: true })); exports.argStringToArray = exports.ToolRunner = void 0; const os = __importStar(__nccwpck_require__(857)); -const events = __importStar(__nccwpck_require__(434)); -const child = __importStar(__nccwpck_require__(317)); -const path = __importStar(__nccwpck_require__(928)); -const io = __importStar(__nccwpck_require__(994)); -const ioUtil = __importStar(__nccwpck_require__(207)); -const timers_1 = __nccwpck_require__(557); +const events = __importStar(__nccwpck_require__(4434)); +const child = __importStar(__nccwpck_require__(5317)); +const path = __importStar(__nccwpck_require__(6928)); +const io = __importStar(__nccwpck_require__(4994)); +const ioUtil = __importStar(__nccwpck_require__(5207)); +const timers_1 = __nccwpck_require__(3557); /* eslint-disable @typescript-eslint/unbound-method */ const IS_WINDOWS = process.platform === 'win32'; /* @@ -2015,7 +2015,7 @@ class ExecState extends events.EventEmitter { /***/ }), -/***/ 552: +/***/ 4552: /***/ (function(__unused_webpack_module, exports) { "use strict"; @@ -2103,7 +2103,7 @@ exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHand /***/ }), -/***/ 844: +/***/ 4844: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -2139,9 +2139,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0; -const http = __importStar(__nccwpck_require__(611)); -const https = __importStar(__nccwpck_require__(692)); -const pm = __importStar(__nccwpck_require__(988)); +const http = __importStar(__nccwpck_require__(8611)); +const https = __importStar(__nccwpck_require__(5692)); +const pm = __importStar(__nccwpck_require__(4988)); const tunnel = __importStar(__nccwpck_require__(770)); var HttpCodes; (function (HttpCodes) { @@ -2715,7 +2715,7 @@ const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCa /***/ }), -/***/ 988: +/***/ 4988: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -2798,7 +2798,7 @@ function isLoopbackAddress(host) { /***/ }), -/***/ 207: +/***/ 5207: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -2834,8 +2834,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge var _a; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getCmdPath = exports.tryGetExecutablePath = exports.isRooted = exports.isDirectory = exports.exists = exports.READONLY = exports.UV_FS_O_EXLOCK = exports.IS_WINDOWS = exports.unlink = exports.symlink = exports.stat = exports.rmdir = exports.rm = exports.rename = exports.readlink = exports.readdir = exports.open = exports.mkdir = exports.lstat = exports.copyFile = exports.chmod = void 0; -const fs = __importStar(__nccwpck_require__(896)); -const path = __importStar(__nccwpck_require__(928)); +const fs = __importStar(__nccwpck_require__(9896)); +const path = __importStar(__nccwpck_require__(6928)); _a = fs.promises // export const {open} = 'fs' , exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.open = _a.open, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rm = _a.rm, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink; @@ -2988,7 +2988,7 @@ exports.getCmdPath = getCmdPath; /***/ }), -/***/ 994: +/***/ 4994: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -3023,9 +3023,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.findInPath = exports.which = exports.mkdirP = exports.rmRF = exports.mv = exports.cp = void 0; -const assert_1 = __nccwpck_require__(613); -const path = __importStar(__nccwpck_require__(928)); -const ioUtil = __importStar(__nccwpck_require__(207)); +const assert_1 = __nccwpck_require__(2613); +const path = __importStar(__nccwpck_require__(6928)); +const ioUtil = __importStar(__nccwpck_require__(5207)); /** * Copies a file or folder. * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js @@ -3297,7 +3297,7 @@ function copyFile(srcFile, destFile, force) { /***/ 90: /***/ ((__unused_webpack_module, __unused_webpack_exports, __nccwpck_require__) => { -const fetchNode = __nccwpck_require__(304) +const fetchNode = __nccwpck_require__(3304) if (!global.fetch) { const fetch = fetchNode.fetch.bind({}) @@ -3312,10 +3312,10 @@ if (!global.fetch) { /***/ }), -/***/ 304: +/***/ 3304: /***/ ((module, exports, __nccwpck_require__) => { -const nodeFetch = __nccwpck_require__(705) +const nodeFetch = __nccwpck_require__(6705) const realFetch = nodeFetch.default || nodeFetch const fetch = function (url, options) { @@ -3341,7 +3341,7 @@ exports["default"] = fetch /***/ }), -/***/ 705: +/***/ 6705: /***/ ((module, exports, __nccwpck_require__) => { "use strict"; @@ -3351,12 +3351,12 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } -var Stream = _interopDefault(__nccwpck_require__(203)); -var http = _interopDefault(__nccwpck_require__(611)); -var Url = _interopDefault(__nccwpck_require__(16)); -var whatwgUrl = _interopDefault(__nccwpck_require__(686)); -var https = _interopDefault(__nccwpck_require__(692)); -var zlib = _interopDefault(__nccwpck_require__(106)); +var Stream = _interopDefault(__nccwpck_require__(2203)); +var http = _interopDefault(__nccwpck_require__(8611)); +var Url = _interopDefault(__nccwpck_require__(7016)); +var whatwgUrl = _interopDefault(__nccwpck_require__(2686)); +var https = _interopDefault(__nccwpck_require__(5692)); +var zlib = _interopDefault(__nccwpck_require__(3106)); // Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js @@ -3507,7 +3507,7 @@ FetchError.prototype.name = 'FetchError'; let convert; try { - convert = (__nccwpck_require__(78).convert); + convert = (__nccwpck_require__(2078).convert); } catch (e) {} const INTERNALS = Symbol('Body internals'); @@ -5139,14 +5139,14 @@ exports.FetchError = FetchError; /***/ }), -/***/ 171: +/***/ 1552: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -var punycode = __nccwpck_require__(876); -var mappingTable = __nccwpck_require__(472); +var punycode = __nccwpck_require__(4876); +var mappingTable = __nccwpck_require__(2472); var PROCESSING_OPTIONS = { TRANSITIONAL: 0, @@ -5354,13 +5354,13 @@ module.exports = __nccwpck_require__(218); "use strict"; -var net = __nccwpck_require__(278); -var tls = __nccwpck_require__(756); -var http = __nccwpck_require__(611); -var https = __nccwpck_require__(692); -var events = __nccwpck_require__(434); -var assert = __nccwpck_require__(613); -var util = __nccwpck_require__(23); +var net = __nccwpck_require__(9278); +var tls = __nccwpck_require__(4756); +var http = __nccwpck_require__(8611); +var https = __nccwpck_require__(5692); +var events = __nccwpck_require__(4434); +var assert = __nccwpck_require__(2613); +var util = __nccwpck_require__(9023); exports.httpOverHttp = httpOverHttp; @@ -5620,7 +5620,7 @@ exports.debug = debug; // for test /***/ }), -/***/ 125: +/***/ 7125: /***/ ((module) => { "use strict"; @@ -5817,7 +5817,7 @@ conversions["RegExp"] = function (V, opts) { /***/ }), -/***/ 184: +/***/ 3184: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -6025,15 +6025,15 @@ exports.implementation = class URLImpl { /***/ }), -/***/ 633: +/***/ 6633: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; -const conversions = __nccwpck_require__(125); -const utils = __nccwpck_require__(238); -const Impl = __nccwpck_require__(184); +const conversions = __nccwpck_require__(7125); +const utils = __nccwpck_require__(9857); +const Impl = __nccwpck_require__(3184); const impl = utils.implSymbol; @@ -6229,13 +6229,13 @@ module.exports = { /***/ }), -/***/ 686: +/***/ 2686: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -exports.URL = __nccwpck_require__(633)["interface"]; +exports.URL = __nccwpck_require__(6633)["interface"]; exports.serializeURL = __nccwpck_require__(905).serializeURL; exports.serializeURLOrigin = __nccwpck_require__(905).serializeURLOrigin; exports.basicURLParse = __nccwpck_require__(905).basicURLParse; @@ -6253,8 +6253,8 @@ exports.parseURL = __nccwpck_require__(905).parseURL; "use strict"; -const punycode = __nccwpck_require__(876); -const tr46 = __nccwpck_require__(171); +const punycode = __nccwpck_require__(4876); +const tr46 = __nccwpck_require__(1552); const specialSchemes = { ftp: 21, @@ -7553,7 +7553,7 @@ module.exports.parseURL = function (input, options) { /***/ }), -/***/ 238: +/***/ 9857: /***/ ((module) => { "use strict"; @@ -7581,7 +7581,7 @@ module.exports.implForWrapper = function (wrapper) { /***/ }), -/***/ 78: +/***/ 2078: /***/ ((module) => { module.exports = eval("require")("encoding"); @@ -7589,7 +7589,7 @@ module.exports = eval("require")("encoding"); /***/ }), -/***/ 613: +/***/ 2613: /***/ ((module) => { "use strict"; @@ -7597,7 +7597,7 @@ module.exports = require("assert"); /***/ }), -/***/ 317: +/***/ 5317: /***/ ((module) => { "use strict"; @@ -7605,7 +7605,7 @@ module.exports = require("child_process"); /***/ }), -/***/ 982: +/***/ 6982: /***/ ((module) => { "use strict"; @@ -7613,7 +7613,7 @@ module.exports = require("crypto"); /***/ }), -/***/ 434: +/***/ 4434: /***/ ((module) => { "use strict"; @@ -7621,7 +7621,7 @@ module.exports = require("events"); /***/ }), -/***/ 896: +/***/ 9896: /***/ ((module) => { "use strict"; @@ -7629,7 +7629,7 @@ module.exports = require("fs"); /***/ }), -/***/ 611: +/***/ 8611: /***/ ((module) => { "use strict"; @@ -7637,7 +7637,7 @@ module.exports = require("http"); /***/ }), -/***/ 692: +/***/ 5692: /***/ ((module) => { "use strict"; @@ -7645,7 +7645,7 @@ module.exports = require("https"); /***/ }), -/***/ 278: +/***/ 9278: /***/ ((module) => { "use strict"; @@ -7661,7 +7661,7 @@ module.exports = require("os"); /***/ }), -/***/ 928: +/***/ 6928: /***/ ((module) => { "use strict"; @@ -7669,7 +7669,7 @@ module.exports = require("path"); /***/ }), -/***/ 876: +/***/ 4876: /***/ ((module) => { "use strict"; @@ -7677,7 +7677,7 @@ module.exports = require("punycode"); /***/ }), -/***/ 203: +/***/ 2203: /***/ ((module) => { "use strict"; @@ -7685,7 +7685,7 @@ module.exports = require("stream"); /***/ }), -/***/ 193: +/***/ 3193: /***/ ((module) => { "use strict"; @@ -7693,7 +7693,7 @@ module.exports = require("string_decoder"); /***/ }), -/***/ 557: +/***/ 3557: /***/ ((module) => { "use strict"; @@ -7701,7 +7701,7 @@ module.exports = require("timers"); /***/ }), -/***/ 756: +/***/ 4756: /***/ ((module) => { "use strict"; @@ -7709,7 +7709,7 @@ module.exports = require("tls"); /***/ }), -/***/ 16: +/***/ 7016: /***/ ((module) => { "use strict"; @@ -7717,7 +7717,7 @@ module.exports = require("url"); /***/ }), -/***/ 23: +/***/ 9023: /***/ ((module) => { "use strict"; @@ -7725,7 +7725,7 @@ module.exports = require("util"); /***/ }), -/***/ 106: +/***/ 3106: /***/ ((module) => { "use strict"; @@ -7733,4283 +7733,5684 @@ module.exports = require("zlib"); /***/ }), -/***/ 526: -/***/ ((__unused_webpack_module, exports) => { +/***/ 5939: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const index_gen = __nccwpck_require__(456); +const index_gen$1 = __nccwpck_require__(3577); +exports.v2 = index_gen; +exports.v3 = index_gen$1; -// eslint-disable-next-line eslint-comments/disable-enable-pair -/* eslint-disable @typescript-eslint/naming-convention */ -let LevelResolver = /*#__PURE__*/function (LevelResolver) { - LevelResolver[LevelResolver["silent"] = 0] = "silent"; - LevelResolver[LevelResolver["error"] = 1] = "error"; - LevelResolver[LevelResolver["warn"] = 2] = "warn"; - LevelResolver[LevelResolver["info"] = 3] = "info"; - LevelResolver[LevelResolver["debug"] = 4] = "debug"; - return LevelResolver; -}({}); -const shouldLog = (currentLevel, level) => LevelResolver[level] <= currentLevel; - -/** - * A Logger using console output. - * - * @param logLevel - The logger level name - * @param prefix - An optional logger message prefix - * @param output - The output to print logs, using by default the global console object - * - * @internal - */ -class ConsoleLogger { - constructor(logLevel, prefix = '', output = console) { - this.logLevel = logLevel; - this.prefix = prefix; - this.output = output; - this.level = LevelResolver[this.logLevel]; - } - makeMethod(method) { - return message => { - if (shouldLog(this.level, method)) { - this.output[method](this.prefix ? `${this.prefix} ${message}` : message); - } - }; - } - debug = this.makeMethod('debug'); - error = this.makeMethod('error'); - info = this.makeMethod('info'); - warn = this.makeMethod('warn'); -} - -let sdkLogger = /*#__PURE__*/new ConsoleLogger('silent'); -/** - * Sets a logger to be used within the SDK. - * - * @param logger - The Logger instance - * - * @public - */ -const setLogger = logger => { - sdkLogger = logger; -}; +/***/ }), -/** - * Sets the logger to console logger with given logLevel (log is disabled by default). - * - * @param logLevel - The Log level (default to 'warn') - * @param prefix - A Log message prefix (default to 'scaleway-sdk-js:') - * - * @public - */ -const enableConsoleLogger = (logLevel = 'warn', prefix = 'scaleway-sdk-js:') => setLogger(new ConsoleLogger(logLevel, prefix)); +/***/ 5556: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/** - * Returns the active SDK logger. - * - * @internal - */ -const getLogger = () => sdkLogger; +"use strict"; -/** - * Adds an header to a request through an interceptor. - * - * @param key - The header key - * @param value - The header value - * @returns The Request interceptor - * - * @internal - */ -const addHeaderInterceptor = (key, value) => ({ - request -}) => { - const clone = request.clone(); - if (value !== undefined) { - clone.headers.append(key, value); - } - return clone; +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api = __nccwpck_require__(3042); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const resourcePaginator = __nccwpck_require__(4983); +const marshalling_gen = __nccwpck_require__(8374); +const jsonContentHeaders = { + "Content-Type": "application/json; charset=utf-8" }; +class API extends api.API { + /** + * Create a new Project for an Organization. Deprecated in favor of Account + * API v3. Generate a new Project for an Organization, specifying its + * configuration including name and description. + * + * @deprecated + * @param request - The request {@link CreateProjectRequest} + * @returns A Promise of Project + */ + createProject = (request = {}) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateProjectRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/account/v2/projects` + }, + marshalling_gen.unmarshalProject + ); + pageOfListProjects = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/account/v2/projects`, + urlParams: marshalling.urlParams( + ["name", request.name], + ["order_by", request.orderBy], + [ + "organization_id", + request.organizationId ?? this.client.settings.defaultOrganizationId + ], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_ids", request.projectIds] + ) + }, + marshalling_gen.unmarshalListProjectsResponse + ); + /** + * List all Projects of an Organization. Deprecated in favor of Account API + * v3. List all Projects of an Organization. The response will include the + * total number of Projects as well as their associated Organizations, names + * and IDs. Other information include the creation and update date of the + * Project. + * + * @deprecated + * @param request - The request {@link ListProjectsRequest} + * @returns A Promise of ListProjectsResponse + */ + listProjects = (request = {}) => resourcePaginator.enrichForPagination("projects", this.pageOfListProjects, request); + /** + * Get an existing Project. Deprecated in favor of Account API v3. Retrieve + * information about an existing Project, specified by its Project ID. Its + * full details, including ID, name and description, are returned in the + * response object. + * + * @deprecated + * @param request - The request {@link GetProjectRequest} + * @returns A Promise of Project + */ + getProject = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/account/v2/projects/${marshalling.validatePathParam("projectId", request.projectId ?? this.client.settings.defaultProjectId)}` + }, + marshalling_gen.unmarshalProject + ); + /** + * Delete an existing Project. Deprecated in favor of Account API v3. Delete + * an existing Project, specified by its Project ID. The Project needs to be + * empty (meaning there are no resources left in it) to be deleted + * effectively. Note that deleting a Project is permanent, and cannot be + * undone. + * + * @deprecated + * @param request - The request {@link DeleteProjectRequest} + */ + deleteProject = (request = {}) => this.client.fetch({ + method: "DELETE", + path: `/account/v2/projects/${marshalling.validatePathParam("projectId", request.projectId ?? this.client.settings.defaultProjectId)}` + }); + /** + * Update Project. Deprecated in favor of Account API v3. Update the + * parameters of an existing Project, specified by its Project ID. These + * parameters include the name and description. + * + * @deprecated + * @param request - The request {@link UpdateProjectRequest} + * @returns A Promise of Project + */ + updateProject = (request = {}) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateProjectRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/account/v2/projects/${marshalling.validatePathParam("projectId", request.projectId ?? this.client.settings.defaultProjectId)}` + }, + marshalling_gen.unmarshalProject + ); +} +exports.API = API; -/** - * Adds asynchronously an header to a request through an interceptor. - * - * @param key - The header key - * @param value - The header value as a Promise - * @returns The Request interceptor - * - * @internal - */ -const addAsyncHeaderInterceptor = (key, getter) => async request => addHeaderInterceptor(key, await getter())(request); -const isAccessKeyRegex = /^SCW[A-Z0-9]{17}$/i; -const isRegionRegex = /^[a-z]{2}-[a-z]{3}$/i; -const isUUIDRegex = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/i; -const isZoneRegex = /^[a-z]{2}-[a-z]{3}-[1-9]$/i; +/***/ }), -/** Returns true if the given string has a valid UUID format. */ -const isUUID = str => isUUIDRegex.test(str); +/***/ 456: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/** Returns true if the given string has a valid Scaleway access key format. */ -const isAccessKey = str => isAccessKeyRegex.test(str); +"use strict"; -/** Returns true if the given string has a valid Scaleway secret key format. */ -const isSecretKey = str => isUUID(str); +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api_gen = __nccwpck_require__(5556); +exports.API = api_gen.API; -/** Returns true if the given string has a valid Scaleway organization ID format. */ -const isOrganizationId = str => isUUID(str); -/** Returns true if the given string has a valid Scaleway project ID format. */ -const isProjectId = str => isUUID(str); +/***/ }), -/** Returns true if the given string has a valid region format. */ -const isRegion = str => isRegionRegex.test(str); +/***/ 8374: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/** Returns true if the given string has a valid zone format. */ -const isZone = str => isZoneRegex.test(str); +"use strict"; -/** Returns true if the given string has a valid URL format and starts by `http(s):`. */ -const isURL = str => { - let url; - try { - url = new URL(str); - } catch { - return false; +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const randomName = __nccwpck_require__(8141); +const json = __nccwpck_require__(3746); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const unmarshalProject = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Project' failed as data isn't a dictionary.` + ); + } + return { + createdAt: marshalling.unmarshalDate(data.created_at), + description: data.description, + id: data.id, + name: data.name, + organizationId: data.organization_id, + updatedAt: marshalling.unmarshalDate(data.updated_at) + }; +}; +const unmarshalListProjectsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListProjectsResponse' failed as data isn't a dictionary.` + ); } - return url.protocol === 'http:' || url.protocol === 'https:'; + return { + projects: marshalling.unmarshalArrayOfObject(data.projects, unmarshalProject), + totalCount: data.total_count + }; }; +const marshalCreateProjectRequest = (request, defaults) => ({ + description: request.description, + name: request.name || randomName("proj"), + organization_id: request.organizationId ?? defaults.defaultOrganizationId +}); +const marshalUpdateProjectRequest = (request, defaults) => ({ + description: request.description, + name: request.name +}); +exports.marshalCreateProjectRequest = marshalCreateProjectRequest; +exports.marshalUpdateProjectRequest = marshalUpdateProjectRequest; +exports.unmarshalListProjectsResponse = unmarshalListProjectsResponse; +exports.unmarshalProject = unmarshalProject; -/** - * Holds access key and secret key. - * - * @public - */ -/** - * Holds default values of a Scaleway profile. - * - * @public - */ +/***/ }), -/** - * Holds values of a Scaleway profile. - * - * @public - */ +/***/ 5938: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/** - * Verifies that the payload contains both the accessKey and the secretKey. - * - * @param obj - The secrets - * @returns Whether the secrets are not empty. - * - * @internal - */ -const hasAuthenticationSecrets = obj => typeof obj.accessKey === 'string' && obj.accessKey !== '' && typeof obj.secretKey === 'string' && obj.secretKey !== ''; +"use strict"; -/** - * Asserts the format of secrets. - * - * @param obj - The secrets - * @returns Whether the secrets use a valid format - * - * @throws Error - * Thrown if either the accessKey or the secretKey has en invalid format. - * - * @internal - */ -function assertValidAuthenticationSecrets(obj) { - if (!(obj.accessKey && obj.secretKey)) { - throw new Error(`Invalid secrets, accessKey & secretKey must be defined. See https://www.scaleway.com/en/docs/identity-and-access-management/iam/how-to/create-api-keys/`); - } - if (!isAccessKey(obj.accessKey)) { - throw new Error(`Invalid access key format '${obj.accessKey}', expected SCWXXXXXXXXXXXXXXXXX format. See https://www.scaleway.com/en/docs/identity-and-access-management/iam/how-to/create-api-keys/`); - } - if (!isSecretKey(obj.secretKey)) { - throw new Error(`Invalid secret key format '${obj.secretKey}', expected a UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. See https://www.scaleway.com/en/docs/identity-and-access-management/iam/how-to/create-api-keys/`); - } +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api = __nccwpck_require__(3042); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const resourcePaginator = __nccwpck_require__(4983); +const marshalling_gen = __nccwpck_require__(4771); +const jsonContentHeaders = { + "Content-Type": "application/json; charset=utf-8" +}; +class ProjectAPI extends api.API { + /** + * Create a new Project for an Organization. Generate a new Project for an + * Organization, specifying its configuration including name and description. + * + * @param request - The request {@link ProjectApiCreateProjectRequest} + * @returns A Promise of Project + */ + createProject = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalProjectApiCreateProjectRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/account/v3/projects` + }, + marshalling_gen.unmarshalProject + ); + pageOfListProjects = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/account/v3/projects`, + urlParams: marshalling.urlParams( + ["name", request.name], + ["order_by", request.orderBy], + [ + "organization_id", + request.organizationId ?? this.client.settings.defaultOrganizationId + ], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_ids", request.projectIds] + ) + }, + marshalling_gen.unmarshalListProjectsResponse + ); + /** + * List all Projects of an Organization. List all Projects of an Organization. + * The response will include the total number of Projects as well as their + * associated Organizations, names, and IDs. Other information includes the + * creation and update date of the Project. + * + * @param request - The request {@link ProjectApiListProjectsRequest} + * @returns A Promise of ListProjectsResponse + */ + listProjects = (request = {}) => resourcePaginator.enrichForPagination("projects", this.pageOfListProjects, request); + /** + * Get an existing Project. Retrieve information about an existing Project, + * specified by its Project ID. Its full details, including ID, name and + * description, are returned in the response object. + * + * @param request - The request {@link ProjectApiGetProjectRequest} + * @returns A Promise of Project + */ + getProject = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/account/v3/projects/${marshalling.validatePathParam("projectId", request.projectId ?? this.client.settings.defaultProjectId)}` + }, + marshalling_gen.unmarshalProject + ); + /** + * Delete an existing Project. Delete an existing Project, specified by its + * Project ID. The Project needs to be empty (meaning there are no resources + * left in it) to be deleted effectively. Note that deleting a Project is + * permanent, and cannot be undone. + * + * @param request - The request {@link ProjectApiDeleteProjectRequest} + */ + deleteProject = (request = {}) => this.client.fetch({ + method: "DELETE", + path: `/account/v3/projects/${marshalling.validatePathParam("projectId", request.projectId ?? this.client.settings.defaultProjectId)}` + }); + /** + * Update Project. Update the parameters of an existing Project, specified by + * its Project ID. These parameters include the name and description. + * + * @param request - The request {@link ProjectApiUpdateProjectRequest} + * @returns A Promise of Project + */ + updateProject = (request = {}) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalProjectApiUpdateProjectRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/account/v3/projects/${marshalling.validatePathParam("projectId", request.projectId ?? this.client.settings.defaultProjectId)}` + }, + marshalling_gen.unmarshalProject + ); } +exports.ProjectAPI = ProjectAPI; -const SESSION_HEADER_KEY = 'x-session-token'; -const AUTH_HEADER_KEY = 'x-auth-token'; -/** - * Authenticates with a session token. - * - * @param getToken - The token accessor - * @returns The request interceptor - * - * @deprecated Please use addAsyncHeaderInterceptor instead. - * - * @internal - */ -const authenticateWithSessionToken = getToken => addAsyncHeaderInterceptor(SESSION_HEADER_KEY, getToken); -/** - * Authenticates with a secrets. - * - * @param getToken - The secrets - * @returns The request interceptor - * - * @throws Error - * Thrown if the secrets are invalid. - * - * @internal - */ -const authenticateWithSecrets = secrets => { - assertValidAuthenticationSecrets(secrets); - return addHeaderInterceptor(AUTH_HEADER_KEY, secrets.secretKey); -}; +/***/ }), -/** - * Obfuscates a token. - * - * @param key - The token - * @returns The obfuscated token - * - * @internal - */ -const obfuscateToken = key => `${key.substring(0, 5)}xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`; +/***/ 3577: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/** - * Obfuscates an UUID. - * - * @param key - The UUID - * @returns The obfuscated UUID - * - * @internal - */ -const obfuscateUUID = key => `${key.substring(0, 8)}-xxxx-xxxx-xxxx-xxxxxxxxxxxx`; -/** - * Obfuscates headers entry. - * - * @param array - The header entry - * @returns The obfuscated entry - * - * @internal - */ -const obfuscateAuthHeadersEntry = ([name, value]) => { - if (name === SESSION_HEADER_KEY) return [name, obfuscateToken(value)]; - if (name === AUTH_HEADER_KEY) return [name, obfuscateUUID(value)]; - return [name, value]; -}; +"use strict"; -/** - * A factory to build {@link Settings}. - * - * @public - */ +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api_gen = __nccwpck_require__(5938); +const validationRules_gen = __nccwpck_require__(1696); +exports.ProjectAPI = api_gen.ProjectAPI; +exports.ValidationRules = validationRules_gen; -/** - * Instantiates the SDK from a configuration {@link Profile}. - * - * @param profile - The profile - * @returns A factory {@link ClientConfig} - * - * @remarks This method should be used in conjunction with the initializer `createAdvancedClient`. - * - * @public - */ -const withProfile = profile => settings => { - const newSettings = { - ...settings - }; - if (profile.apiURL) { - newSettings.apiURL = profile.apiURL; - } - if (profile.defaultOrganizationId) { - newSettings.defaultOrganizationId = profile.defaultOrganizationId; - } - if (profile.defaultProjectId) { - newSettings.defaultProjectId = profile.defaultProjectId; - } - if (profile.defaultRegion) { - newSettings.defaultRegion = profile.defaultRegion; - } - if (profile.defaultZone) { - newSettings.defaultZone = profile.defaultZone; - } - if (hasAuthenticationSecrets(profile)) { - newSettings.interceptors = [{ - request: authenticateWithSecrets(profile) - }, ...newSettings.interceptors]; - } - return newSettings; -}; - -/** - * Instantiates the SDK with a different HTTP client. - * - * @param httpClient - A fetch compatible HTTP client - * @returns A factory {@link ClientConfig} - * - * @remarks This method should be used in conjunction with the initializer `createAdvancedClient`. - * - * @public - */ -const withHTTPClient = httpClient => settings => ({ - ...settings, - httpClient -}); - -/** - * Instantiates the SDK with a default page size. - * - * @param defaultPageSize - The default page size - * @returns A factory {@link ClientConfig} - * - * @remarks This method should be used in conjunction with the initializer `createAdvancedClient`. - * - * @public - */ -const withDefaultPageSize = defaultPageSize => settings => ({ - ...settings, - defaultPageSize -}); -/** - * Instantiates the SDK with a different default user agent. - * - * @param userAgent - The default user agent - * @returns A factory {@link ClientConfig} - * - * @remarks This method should be used in conjunction with the initializer `createAdvancedClient`. - * - * @public - */ -const withUserAgent = userAgent => settings => ({ - ...settings, - userAgent -}); +/***/ }), -/** - * Instantiates the SDK with an additional user agent. - * - * @param userAgent - The suffix to append to default user agent - * @returns A factory {@link ClientConfig} - * - * @remarks This method should be used in conjunction with the initializer `createAdvancedClient`. - * - * @public - */ -const withUserAgentSuffix = userAgent => settings => ({ - ...settings, - userAgent: settings.userAgent ? `${settings.userAgent} ${userAgent}` : userAgent -}); +/***/ 4771: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/** - * Instantiates the SDK with additional interceptors. - * - * @param interceptors - The additional {@link NetworkInterceptors} interceptors - * @returns A factory {@link ClientConfig} - * - * @remarks - * It doesn't override the existing interceptors, but instead push more to the list. - * This method should be used in conjunction with the initializer `createAdvancedClient`. - * - * @example - * ``` - * withAdditionalInterceptors([ - * { - * request: ({ request }) => { - * console.log(`Do something with ${JSON.stringify(request)}`) - * return request - * }, - * response: ({ response }) => { - * console.log(`Do something with ${JSON.stringify(response)}`) - * return response - * }, - * responseError: async ({ - * request, - * error, - * }: { - * request: Request - * error: unknown - * }) => { - * console.log( - * `Do something with ${JSON.stringify(request)} and ${JSON.stringify( - * error, - * )}`, - * ) - * throw error // or return Promise.resolve(someData) - * }, - * }, - * ]) - * ``` - * - * @public - */ -const withAdditionalInterceptors = interceptors => settings => ({ - ...settings, - interceptors: settings.interceptors.concat(interceptors) -}); +"use strict"; -/** - * Instantiates the SDK with legacy interceptors. - */ -/* eslint-disable deprecation/deprecation */ -const withLegacyInterceptors = () => settings => { - if (!settings.requestInterceptors && !settings.responseInterceptors) { - return settings; +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const randomName = __nccwpck_require__(8141); +const json = __nccwpck_require__(3746); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const unmarshalProject = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Project' failed as data isn't a dictionary.` + ); } - const allInterceptors = settings.interceptors.concat((settings.requestInterceptors ?? []).map(obj => ({ - request: obj - })), (settings.responseInterceptors ?? []).map(obj => ({ - response: obj - }))); return { - ...settings, - interceptors: allInterceptors + createdAt: marshalling.unmarshalDate(data.created_at), + description: data.description, + id: data.id, + name: data.name, + organizationId: data.organization_id, + updatedAt: marshalling.unmarshalDate(data.updated_at) }; }; -/* eslint-enable deprecation/deprecation */ - -/** - * Holds default values of settings. - * - * @public - */ - -/** - * Settings hold the values of all client options. - * - * @public - */ - -/** - * Validates the content of a {@link Settings} object. - * - * @throws Error - * Thrown if {@link Settings} aren't valid. - * - * @internal - */ -const assertValidSettings = obj => { - // Default Organization ID. - if (obj.defaultOrganizationId !== undefined) { - if (typeof obj.defaultOrganizationId !== 'string' || obj.defaultOrganizationId.length === 0) { - throw new Error('Default organization ID cannot be empty'); - } - if (!isOrganizationId(obj.defaultOrganizationId)) { - throw new Error(`Invalid organization ID format '${obj.defaultOrganizationId}', expected a UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`); - } - } - - // Default Project ID. - if (obj.defaultProjectId !== undefined) { - if (typeof obj.defaultProjectId !== 'string' || obj.defaultProjectId.length === 0) { - throw new Error('Default project ID cannot be empty'); - } - if (!isProjectId(obj.defaultProjectId)) { - throw new Error(`Invalid project ID format '${obj.defaultProjectId}', expected a UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`); - } +const unmarshalListProjectsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListProjectsResponse' failed as data isn't a dictionary.` + ); } + return { + projects: marshalling.unmarshalArrayOfObject(data.projects, unmarshalProject), + totalCount: data.total_count + }; +}; +const marshalProjectApiCreateProjectRequest = (request, defaults) => ({ + description: request.description, + name: request.name || randomName("proj"), + organization_id: request.organizationId ?? defaults.defaultOrganizationId +}); +const marshalProjectApiUpdateProjectRequest = (request, defaults) => ({ + description: request.description, + name: request.name +}); +exports.marshalProjectApiCreateProjectRequest = marshalProjectApiCreateProjectRequest; +exports.marshalProjectApiUpdateProjectRequest = marshalProjectApiUpdateProjectRequest; +exports.unmarshalListProjectsResponse = unmarshalListProjectsResponse; +exports.unmarshalProject = unmarshalProject; - // Default Region. - if (obj.defaultRegion && !isRegion(obj.defaultRegion)) { - throw new Error(`Invalid default region format '${obj.defaultRegion}'`); - } - // Default Zone. - if (obj.defaultZone && !isZone(obj.defaultZone)) { - throw new Error(`Invalid default zone format '${obj.defaultZone}'`); - } +/***/ }), - // API URL. - if (!isURL(obj.apiURL)) { - throw new Error(`Invalid URL ${obj.apiURL}`); - } - if (obj.apiURL.endsWith('/')) { - throw new Error(`Invalid URL ${obj.apiURL}: it should not have a trailing slash`); - } +/***/ 1696: +/***/ ((__unused_webpack_module, exports) => { - // HTTP Client. - if (typeof obj.httpClient !== typeof fetch) { - throw new Error(`Invalid HTTP Client`); - } +"use strict"; - // Default Page Size. - if (obj.defaultPageSize !== undefined && (typeof obj.defaultPageSize !== 'number' || Number.isNaN(obj.defaultPageSize) || obj.defaultPageSize <= 0)) { - throw new Error(`Invalid defaultPageSize ${obj.defaultPageSize}: it should be a number above 0`); +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const ProjectApiCreateProjectRequest = { + description: { + maxLength: 200 + }, + name: { + maxLength: 64, + minLength: 1, + pattern: /^[a-zA-Z0-9\._\- ]+$/ } - - // User Agent. - if (typeof obj.userAgent !== 'string') { - throw new Error(`Invalid User-Agent`); +}; +const ProjectApiListProjectsRequest = { + name: { + maxLength: 64, + minLength: 1, + pattern: /^[a-zA-Z0-9\._\- ]+$/ + }, + page: { + greaterThan: 0 + }, + pageSize: { + greaterThanOrEqual: 1, + lessThanOrEqual: 100 } }; - -const version = 'v1.36.0'; -const userAgent = `scaleway-sdk-js/${version}`; - -const isBrowser = () => -// eslint-disable-next-line @typescript-eslint/prefer-optional-chain -typeof window !== 'undefined' && typeof window.document !== 'undefined'; - -/** - * Composes request interceptors. - * - * @param interceptors - A list of request interceptors - * @returns An async composed interceptor - * - * @internal - */ -const composeRequestInterceptors = interceptors => async request => interceptors.reduce(async (asyncResult, interceptor) => interceptor({ - request: await asyncResult -}), Promise.resolve(request)); - -/** - * Composes response interceptors. - * - * @param interceptors - A list of response interceptors - * @returns An async composed interceptor - * - * @internal - */ -const composeResponseInterceptors = interceptors => async response => interceptors.reduce(async (asyncResult, interceptor) => interceptor({ - response: await asyncResult -}), Promise.resolve(response)); - -/** - * Compose response error interceptors. - * - * @internal - */ -const composeResponseErrorInterceptors = interceptors => async (request, error) => { - let prevError = error; - for (const interceptor of interceptors) { - try { - const res = await interceptor({ - request, - error: prevError - }); - return res; - } catch (err) { - prevError = err; - } +const ProjectApiUpdateProjectRequest = { + description: { + maxLength: 200 + }, + name: { + maxLength: 64, + minLength: 1, + pattern: /^[a-zA-Z0-9\._\- ]+$/ } - throw prevError; }; +exports.ProjectApiCreateProjectRequest = ProjectApiCreateProjectRequest; +exports.ProjectApiListProjectsRequest = ProjectApiListProjectsRequest; +exports.ProjectApiUpdateProjectRequest = ProjectApiUpdateProjectRequest; -/** - * Converts a string to PascalCase. - * - * @param str - The input string - * @returns The string in PascalCase - * - * @internal - */ -const toPascalCase = str => str.replace(/\w+/g, word => `${word[0].toUpperCase()}${word.slice(1).toLowerCase()}`); - -/** - * Converts a Headers entry to string. - * - * @param entry - The header entry as a string tuple - * @returns A serialized string - * - * @internal - */ -const serializeHeadersEntry = ([name, value]) => `${toPascalCase(name)}: ${value}`; - -/** - * Converts Headers to safe to log strings (with obfuscated auth secrets). - * - * @param headers - The Headers - * @returns Serialized headers strings - * - * @internal - */ -const serializeHeaders = headers => Array.from(headers.entries(), serializeHeadersEntry); -/** - * Dumps a Request into a readable string. - * - * @param request - The request - * @returns The readable string - * - * @internal - */ -const dumpRequest = async request => [`${request.method.toUpperCase()}: ${request.url}`, ...serializeHeaders(request.headers), await request.clone().text()].join('\r\n'); +/***/ }), -/** - * Dumps a Response into a readable string. - * - * @param response - The response - * @returns The readable string - * - * @internal - */ -const dumpResponse = async response => [`HTTP ${response.status} ${response.ok ? 'OK' : 'NOK'}`, ...serializeHeaders(response.headers), await response.clone().text()].join('\r\n'); +/***/ 271: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/** - * Mapper of an header entry. - * - * @internal - */ +"use strict"; -/** - * HTTP Request with obfuscated secrets. - * - * @internal - */ -class ObfuscatedRequest extends Request { - constructor(request, obfuscate) { - super(request); - this.request = request; - this.obfuscate = obfuscate; - } - get headers() { - return new Headers(Array.from(this.request.headers, this.obfuscate)); - } - clone() { - return new ObfuscatedRequest(this.request, this.obfuscate); - } -} +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const index_gen = __nccwpck_require__(5662); +exports.v1alpha1 = index_gen; -/** - * Creates an interceptor to obfuscate the requests. - * - * @param obfuscate - The Header entries obfuscator mapper - * @returns The obfuscated Request - * - * @internal - */ -const obfuscateInterceptor = obfuscate => ({ - request -}) => new ObfuscatedRequest(request, obfuscate); -const identity = ({ - request -}) => request; -/** - * Creates an interceptor to log the requests. - * - * @param identifier - The request identifier - * @param obfuscate - The obfuscation interceptor - * @returns The interceptor - * - * @internal - */ -const logRequest = (identifier, obfuscate = identity) => async ({ - request -}) => { - if (shouldLog(LevelResolver[getLogger().logLevel], 'debug')) { - getLogger().debug(`--------------- Scaleway SDK REQUEST ${identifier} --------------- -${await dumpRequest(await obfuscate({ - request - }))} ----------------------------------------------------------`); - } - return request; -}; +/***/ }), -/** - * Creates an interceptor to log the responses. - * - * @param identifier - The request identifier - * @returns The interceptor - * - * @internal - */ -const logResponse = identifier => async ({ - response -}) => { - if (shouldLog(LevelResolver[getLogger().logLevel], 'debug')) { - getLogger().debug(`--------------- Scaleway SDK RESPONSE ${identifier} --------------- -${await dumpResponse(response)} ----------------------------------------------------------`); - } - return response; -}; +/***/ 3630: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/** - * Validates an object is of type Response without using `instanceof`. - * - * @remarks Check issue #509 for more context. - * - * @internal - */ -const isResponse = obj => obj !== null && obj !== undefined && typeof obj === 'object' && 'status' in obj && typeof obj.status === 'number' && 'statusText' in obj && typeof obj.statusText === 'string' && 'headers' in obj && typeof obj.headers === 'object' && 'body' in obj && typeof obj.body !== 'undefined'; +"use strict"; -/** - * Validates an unknown object is a JSON Object. - * - * @internal - */ -const isJSONObject = obj => { - const objT = typeof obj; - return obj !== undefined && obj !== null && objT !== 'string' && objT !== 'number' && objT !== 'boolean' && !Array.isArray(obj) && objT === 'object'; -}; - -/** - * Verifies the object is a record of string to string[]. - * - * @param obj - The object - * @returns Whether the object is of the expected type - * - * @internal - */ -const isRecordOfStringArray = obj => { - if (!isJSONObject(obj)) { - return false; - } - for (const elt of Object.values(obj)) { - if (!Array.isArray(elt) || Object.values(elt).find(x => typeof x !== 'string') !== undefined) { - return false; - } - } - return true; +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const intervalRetrier = __nccwpck_require__(9052); +const api = __nccwpck_require__(3042); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const resourcePaginator = __nccwpck_require__(4983); +const content_gen = __nccwpck_require__(9697); +const marshalling_gen = __nccwpck_require__(3208); +const jsonContentHeaders = { + "Content-Type": "application/json; charset=utf-8" }; +class API extends api.API { + /** Lists the available zones of the API. */ + static LOCALITIES = ["fr-par-3"]; + /** + * List server types. List all technical details about Apple silicon server + * types available in the specified zone. Since there is only one Availability + * Zone for Apple silicon servers, the targeted value is `fr-par-3`. + * + * @param request - The request {@link ListServerTypesRequest} + * @returns A Promise of ListServerTypesResponse + */ + listServerTypes = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/apple-silicon/v1alpha1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/server-types` + }, + marshalling_gen.unmarshalListServerTypesResponse + ); + /** + * Get a server type. Get technical details (CPU, disk size etc.) of a server + * type. + * + * @param request - The request {@link GetServerTypeRequest} + * @returns A Promise of ServerType + */ + getServerType = (request) => this.client.fetch( + { + method: "GET", + path: `/apple-silicon/v1alpha1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/server-type/${marshalling.validatePathParam("serverType", request.serverType)}` + }, + marshalling_gen.unmarshalServerType + ); + /** + * Create a server. Create a new server in the targeted zone, specifying its + * configuration including name and type. + * + * @param request - The request {@link CreateServerRequest} + * @returns A Promise of Server + */ + createServer = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateServerRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/apple-silicon/v1alpha1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers` + }, + marshalling_gen.unmarshalServer + ); + pageOfListServers = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/apple-silicon/v1alpha1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId] + ) + }, + marshalling_gen.unmarshalListServersResponse + ); + /** + * List all servers. List all servers in the specified zone. By default, + * returned servers in the list are ordered by creation date in ascending + * order, though this can be modified via the `order_by` field. + * + * @param request - The request {@link ListServersRequest} + * @returns A Promise of ListServersResponse + */ + listServers = (request = {}) => resourcePaginator.enrichForPagination("servers", this.pageOfListServers, request); + pageOfListOS = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/apple-silicon/v1alpha1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/os`, + urlParams: marshalling.urlParams( + ["name", request.name], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["server_type", request.serverType] + ) + }, + marshalling_gen.unmarshalListOSResponse + ); + /** + * List all Operating Systems (OS). List all Operating Systems (OS). The + * response will include the total number of OS as well as their associated + * IDs, names and labels. + * + * @param request - The request {@link ListOSRequest} + * @returns A Promise of ListOSResponse + */ + listOS = (request = {}) => resourcePaginator.enrichForPagination("os", this.pageOfListOS, request); + /** + * Get an Operating System (OS). Get an Operating System (OS). The response + * will include the OS's unique ID as well as its name and label. + * + * @param request - The request {@link GetOSRequest} + * @returns A Promise of OS + */ + getOS = (request) => this.client.fetch( + { + method: "GET", + path: `/apple-silicon/v1alpha1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/os/${marshalling.validatePathParam("osId", request.osId)}` + }, + marshalling_gen.unmarshalOS + ); + /** + * Get a server. Retrieve information about an existing Apple silicon server, + * specified by its server ID. Its full details, including name, status and IP + * address, are returned in the response object. + * + * @param request - The request {@link GetServerRequest} + * @returns A Promise of Server + */ + getServer = (request) => this.client.fetch( + { + method: "GET", + path: `/apple-silicon/v1alpha1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}` + }, + marshalling_gen.unmarshalServer + ); + /** + * Waits for {@link Server} to be in a final state. + * + * @param request - The request {@link GetServerRequest} + * @param options - The waiting options + * @returns A Promise of Server + */ + waitForServer = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve(!content_gen.SERVER_TRANSIENT_STATUSES.includes(res.status))), + this.getServer, + request, + options + ); + /** + * Update a server. Update the parameters of an existing Apple silicon server, + * specified by its server ID. + * + * @param request - The request {@link UpdateServerRequest} + * @returns A Promise of Server + */ + updateServer = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateServerRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/apple-silicon/v1alpha1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}` + }, + marshalling_gen.unmarshalServer + ); + /** + * Delete a server. Delete an existing Apple silicon server, specified by its + * server ID. Deleting a server is permanent, and cannot be undone. Note that + * the minimum allocation period for Apple silicon-as-a-service is 24 hours, + * meaning you cannot delete your server prior to that. + * + * @param request - The request {@link DeleteServerRequest} + */ + deleteServer = (request) => this.client.fetch({ + method: "DELETE", + path: `/apple-silicon/v1alpha1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}` + }); + /** + * Reboot a server. Reboot an existing Apple silicon server, specified by its + * server ID. + * + * @param request - The request {@link RebootServerRequest} + * @returns A Promise of Server + */ + rebootServer = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/apple-silicon/v1alpha1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/reboot` + }, + marshalling_gen.unmarshalServer + ); + /** + * Reinstall a server. Reinstall an existing Apple silicon server (specified + * by its server ID) from a new image (OS). All the data on the disk is + * deleted and all configuration is reset to the defailt configuration values + * of the image (OS). + * + * @param request - The request {@link ReinstallServerRequest} + * @returns A Promise of Server + */ + reinstallServer = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalReinstallServerRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/apple-silicon/v1alpha1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/reinstall` + }, + marshalling_gen.unmarshalServer + ); +} +exports.API = API; -/** - * Builds the default message for {@link ScalewayError}. - * - * @param status - The response code - * @param body - The response body - * @returns The error message - * - * @internal - */ -const buildDefaultMessage = (status, body) => { - const message = [`http error ${status}`]; - if (typeof body === 'string') { - message.push(body); - } else if (isJSONObject(body)) { - if (typeof body.resource === 'string') { - message.push(`resource ${body.resource}`); - } - if (typeof body.message === 'string') { - message.push(body.message); - } - if (body.fields && isRecordOfStringArray(body.fields)) { - message.push(Object.entries(body.fields).map(([name, list]) => `${name} (${list.join(', ')})`).join(', ')); - } - } - return message.join(': '); -}; -/** - * Scaleway error. - * - * @public - */ -class ScalewayError extends Error { - /** The message originating from the payload. */ +/***/ }), - constructor( /** The response status. */ - status, /** The response payload. */ - body, /** The augmented message. */ - message = buildDefaultMessage(status, body)) { - super(message); // 'Error' breaks prototype chain here - this.status = status; - this.body = body; - this.message = message; - this.name = 'ScalewayError'; - this.rawMessage = typeof body === 'object' && typeof body.message === 'string' ? body.message : undefined; - Object.setPrototypeOf(this, new.target.prototype); // restore prototype chain - } +/***/ 9697: +/***/ ((__unused_webpack_module, exports) => { - static fromJSON(status, obj) { - return new ScalewayError(status, obj); - } - toString() { - return `${this.name}: ${this.message}`; - } -} +"use strict"; -/** - * Details of an {@link InvalidArgumentsError} error. - * - * @public - */ +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const SERVER_TRANSIENT_STATUSES = [ + "starting", + "rebooting", + "updating", + "locking", + "unlocking", + "reinstalling" +]; +exports.SERVER_TRANSIENT_STATUSES = SERVER_TRANSIENT_STATUSES; -/** - * Build the default message for {@link InvalidArgumentsError}. - * - * @param list - The list of {@link InvalidArgumentsErrorDetails} - * @returns The error message - * - * @internal - */ -const buildMessage$5 = list => { - const invalidArgs = list.reduce((acc, details) => { - let readableReason = ''; - switch (details.reason) { - case 'required': - readableReason = `is required`; - break; - case 'format': - readableReason = `is wrongly formatted`; - break; - case 'constraint': - readableReason = `does not respect constraint`; - break; - default: - readableReason = `is invalid for unexpected reason`; - break; - } - if (details.helpMessage && details.helpMessage.length > 0) { - readableReason = readableReason.concat(`, `, details.helpMessage); - } - acc.push(`${details.argumentName} ${readableReason}`); - return acc; - }, []); - return `invalid argument(s): ${invalidArgs.join('; ')}`; -}; -/** - * InvalidArguments error happens when one or many fields are invalid in the request message. - * - * @public - */ -class InvalidArgumentsError extends ScalewayError { - constructor(status, body, details) { - super(status, body, buildMessage$5(details)); - this.status = status; - this.body = body; - this.details = details; - this.name = 'InvalidArgumentsError'; - } - static fromJSON(status, obj) { - if (!Array.isArray(obj.details)) return null; - return new InvalidArgumentsError(status, obj, obj.details.reduce((list, detail) => isJSONObject(detail) && typeof detail.argument_name === 'string' && typeof detail.reason === 'string' ? list.concat({ - argumentName: detail.argument_name, - helpMessage: typeof detail.help_message === 'string' ? detail.help_message : undefined, - reason: detail.reason - }) : list, [])); - } -} +/***/ }), -/** - * Scope of an {@link QuotasExceededErrorDetails} error. - * - * @public - */ +/***/ 5662: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/** - * Details of an {@link QuotasExceededError} error. - * - * @public - */ +"use strict"; -/** - * Build the default message for {@link QuotasExceededError}. - * - * @param list - The list of {@link QuotasExceededErrorDetails} - * @returns The error message - * - * @internal - */ -const buildMessage$4 = list => `quota(s) exceeded: ${list.map(details => { - const message = `${details.resource} has reached its quota (${details.current}/${details.quota})`; - return details.scope ? `${message} for ${details.scope.kind} '${details.scope.id}'` : message; -}).join('; ')}`; -const buildScope = detail => { - if (typeof detail.organization_id === 'string' && detail.organization_id.length) { - return { - id: detail.organization_id, - kind: 'organization' - }; +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api_gen = __nccwpck_require__(3630); +const content_gen = __nccwpck_require__(9697); +exports.API = api_gen.API; +exports.SERVER_TRANSIENT_STATUSES = content_gen.SERVER_TRANSIENT_STATUSES; + + +/***/ }), + +/***/ 3208: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const randomName = __nccwpck_require__(8141); +const json = __nccwpck_require__(3746); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const unmarshalOS = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'OS' failed as data isn't a dictionary.` + ); } - if (typeof detail.project_id === 'string' && detail.project_id.length) { - return { - id: detail.project_id, - kind: 'project' - }; + return { + compatibleServerTypes: data.compatible_server_types, + family: data.family, + id: data.id, + imageUrl: data.image_url, + isBeta: data.is_beta, + label: data.label, + name: data.name, + version: data.version, + xcodeVersion: data.xcode_version + }; +}; +const unmarshalServerTypeCPU = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ServerTypeCPU' failed as data isn't a dictionary.` + ); } - return undefined; + return { + coreCount: data.core_count, + frequency: data.frequency, + name: data.name + }; }; - -/** - * QuotasExceeded error happens when one or many resource exceed quotas during the creation of a resource. - * - * @public - */ -class QuotasExceededError extends ScalewayError { - constructor(status, body, list) { - super(status, body, buildMessage$4(list)); - this.status = status; - this.body = body; - this.list = list; - this.name = 'QuotasExceededError'; +const unmarshalServerTypeDisk = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ServerTypeDisk' failed as data isn't a dictionary.` + ); } - static fromJSON(status, obj) { - if (!Array.isArray(obj.details)) return null; - return new QuotasExceededError(status, obj, obj.details.reduce((list, detail) => isJSONObject(detail) && typeof detail.resource === 'string' && typeof detail.quota === 'number' && typeof detail.current === 'number' ? list.concat({ - current: detail.current, - quota: detail.quota, - resource: detail.resource, - scope: buildScope(detail) - }) : list, [])); + return { + capacity: data.capacity, + type: data.type + }; +}; +const unmarshalServerTypeGPU = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ServerTypeGPU' failed as data isn't a dictionary.` + ); } -} - -/** - * InvalidRequest error is only returned by the instance API. - * - * @public - */ -class InvalidRequestMapper { - static fromJSON(status, obj) { - if (typeof obj.message === 'string' && obj.message.toLowerCase().includes('quota exceeded for this resource')) { - return new QuotasExceededError(status, obj, [{ - current: 0, - quota: 0, - resource: typeof obj.resource === 'string' ? obj.resource : '' - }]); - } - const fields = obj.fields && isRecordOfStringArray(obj.fields) ? obj.fields : {}; - const fieldsMessages = Object.entries(fields); - if (fieldsMessages.length) { - return new InvalidArgumentsError(status, obj, fieldsMessages.map(([argumentName, messages]) => messages.map(helpMessage => ({ - argumentName, - helpMessage, - reason: 'constraint' - }))).flat()); - } - return new ScalewayError(status, obj); + return { + count: data.count + }; +}; +const unmarshalServerTypeMemory = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ServerTypeMemory' failed as data isn't a dictionary.` + ); } -} - -/** - * ResourceNotFound error happens when getting a resource that does not exist anymore. - * - * @public - */ -class ResourceNotFoundError extends ScalewayError { - constructor(status, body, resource, resourceId) { - super(status, body, `resource ${resource} with ID ${resourceId} is not found`); - this.status = status; - this.body = body; - this.resource = resource; - this.resourceId = resourceId; - this.name = 'ResourceNotFoundError'; - } - static fromJSON(status, obj) { - if (typeof obj.resource !== 'string' || typeof obj.resource_id !== 'string') { - return null; - } - return new ResourceNotFoundError(status, obj, obj.resource, obj.resource_id); - } -} - -/** - * UnknownResource error is only returned by the instance API. - * - * @public - */ -class UnknownResourceMapper { - static fromJSON(status, obj) { - // Split the message - // Note: some errors uses ' and not " - // Examples: `"111..." not found` or `Security Group '111...' not found` - const messageParts = typeof obj.message === 'string' ? obj.message.split(/"|'/) : []; - if (messageParts.length === 3 && isUUID(messageParts[1])) { - return new ResourceNotFoundError(status, obj, - // transform `Security group ` to `security_group` - // `.replaceAll()` may be too recent to use yet. - // that's why we're using `.split(' ').join('_')` for now. - messageParts[0].trim().toLowerCase().split(' ').join('_'), messageParts[1]); - } - return new ScalewayError(status, obj); + return { + capacity: data.capacity, + type: data.type + }; +}; +const unmarshalServerTypeNetwork = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ServerTypeNetwork' failed as data isn't a dictionary.` + ); } -} - -/** - * AlreadyExists error is used when a resource already exists. - * - * @public - */ -class AlreadyExistsError extends ScalewayError { - constructor(status, body, resource, resourceId, helpMessage) { - super(status, body, `resource ${resource} with ID ${resourceId} already exists: ${helpMessage}`); - this.status = status; - this.body = body; - this.resource = resource; - this.resourceId = resourceId; - this.helpMessage = helpMessage; - this.name = 'AlreadyExistsError'; + return { + publicBandwidthBps: data.public_bandwidth_bps + }; +}; +const unmarshalServerType = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ServerType' failed as data isn't a dictionary.` + ); } - static fromJSON(status, obj) { - if (typeof obj.resource !== 'string' || typeof obj.resource_id !== 'string' || typeof obj.help_message !== 'string') { - return null; - } - return new AlreadyExistsError(status, obj, obj.resource, obj.resource_id, obj.help_message); + return { + cpu: data.cpu ? unmarshalServerTypeCPU(data.cpu) : void 0, + defaultOs: data.default_os ? unmarshalOS(data.default_os) : void 0, + disk: data.disk ? unmarshalServerTypeDisk(data.disk) : void 0, + gpu: data.gpu ? unmarshalServerTypeGPU(data.gpu) : void 0, + memory: data.memory ? unmarshalServerTypeMemory(data.memory) : void 0, + minimumLeaseDuration: data.minimum_lease_duration, + name: data.name, + network: data.network ? unmarshalServerTypeNetwork(data.network) : void 0, + stock: data.stock + }; +}; +const unmarshalServer = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Server' failed as data isn't a dictionary.` + ); } -} - -/** - * Build the default message for {@link DeniedAuthenticationError}. - * - * @param method - The authentication method - * @param reason - The deny reason - * @returns The error message - * - * @internal - */ -const buildMessage$3 = (method, reason) => { - let reasonDesc; - switch (reason) { - case 'invalid_argument': - reasonDesc = `invalid ${method} format or empty value`; - break; - case 'not_found': - reasonDesc = `${method} does not exist`; - break; - case 'expired': - reasonDesc = `${method} is expired`; - break; - default: - reasonDesc = `unknown reason for ${method}`; + return { + createdAt: marshalling.unmarshalDate(data.created_at), + deletableAt: marshalling.unmarshalDate(data.deletable_at), + deletionScheduled: data.deletion_scheduled, + id: data.id, + ip: data.ip, + name: data.name, + organizationId: data.organization_id, + os: data.os ? unmarshalOS(data.os) : void 0, + projectId: data.project_id, + sshUsername: data.ssh_username, + status: data.status, + sudoPassword: data.sudo_password, + type: data.type, + updatedAt: marshalling.unmarshalDate(data.updated_at), + vncUrl: data.vnc_url, + zone: data.zone + }; +}; +const unmarshalListOSResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListOSResponse' failed as data isn't a dictionary.` + ); } - return `denied authentication: ${reasonDesc}`; + return { + os: marshalling.unmarshalArrayOfObject(data.os, unmarshalOS), + totalCount: data.total_count + }; }; - -/** - * DeniedAuthentication error is used by the API Gateway auth service to deny a request. - * - * @public - */ -class DeniedAuthenticationError extends ScalewayError { - constructor(status, body, method, reason) { - super(status, body, buildMessage$3(method, reason)); - this.status = status; - this.body = body; - this.method = method; - this.reason = reason; - this.name = 'DeniedAuthenticationError'; +const unmarshalListServerTypesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListServerTypesResponse' failed as data isn't a dictionary.` + ); } - static fromJSON(status, obj) { - if (typeof obj.method !== 'string' || typeof obj.reason !== 'string') { - return null; - } - return new DeniedAuthenticationError(status, obj, obj.method, obj.reason); + return { + serverTypes: marshalling.unmarshalArrayOfObject(data.server_types, unmarshalServerType) + }; +}; +const unmarshalListServersResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListServersResponse' failed as data isn't a dictionary.` + ); } -} + return { + servers: marshalling.unmarshalArrayOfObject(data.servers, unmarshalServer), + totalCount: data.total_count + }; +}; +const marshalCreateServerRequest = (request, defaults) => ({ + name: request.name || randomName("as"), + os_id: request.osId, + project_id: request.projectId ?? defaults.defaultProjectId, + type: request.type +}); +const marshalReinstallServerRequest = (request, defaults) => ({ + os_id: request.osId +}); +const marshalUpdateServerRequest = (request, defaults) => ({ + name: request.name, + schedule_deletion: request.scheduleDeletion +}); +exports.marshalCreateServerRequest = marshalCreateServerRequest; +exports.marshalReinstallServerRequest = marshalReinstallServerRequest; +exports.marshalUpdateServerRequest = marshalUpdateServerRequest; +exports.unmarshalListOSResponse = unmarshalListOSResponse; +exports.unmarshalListServerTypesResponse = unmarshalListServerTypesResponse; +exports.unmarshalListServersResponse = unmarshalListServersResponse; +exports.unmarshalOS = unmarshalOS; +exports.unmarshalServer = unmarshalServer; +exports.unmarshalServerType = unmarshalServerType; -/** - * OutOfStock error happens when stocks are empty for the resource. - * - * @public - */ -class OutOfStockError extends ScalewayError { - constructor(status, body, resource) { - super(status, body, `resource ${resource} is out of stock`); - this.status = status; - this.body = body; - this.resource = resource; - this.name = 'OutOfStockError'; - } - static fromJSON(status, obj) { - if (typeof obj.resource !== 'string') return null; - return new OutOfStockError(status, obj, obj.resource); - } -} -/** - * Details of an {@link PermissionsDeniedError} error. - * - * @public - */ +/***/ }), -/** - * Build the default message for {@link PermissionsDeniedError}. - * - * @param list - The list of {@link PermissionsDeniedErrorDetails} - * @returns The error message - * - * @internal - */ -const buildMessage$2 = list => `insufficient permissions: ${list.map(({ - action, - resource -}) => `${action} ${resource}`).join('; ')}`; +/***/ 8147: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/** - * PermissionsDenied error happens when one or many permissions are not accorded to the user making the request. - * - * @public - */ -class PermissionsDeniedError extends ScalewayError { - constructor(status, body, list) { - super(status, body, buildMessage$2(list)); - this.status = status; - this.body = body; - this.list = list; - this.name = 'PermissionsDeniedError'; - } - static fromJSON(status, obj) { - if (!Array.isArray(obj.details)) return null; - return new PermissionsDeniedError(status, obj, obj.details.reduce((list, detail) => isJSONObject(detail) && typeof detail.resource === 'string' && typeof detail.action === 'string' ? list.concat({ - action: detail.action, - resource: detail.resource - }) : list, [])); - } -} +"use strict"; -/** - * Build the default message for {@link PreconditionFailedError}. - * - * @param precondition - The precondition - * @param helpMessage - The message which should help the user to fix the root cause - * @returns The error message - * - * @internal - */ -const buildMessage$1 = (precondition, helpMessage) => { - let message = `precondition failed: ${precondition}`; - if (typeof helpMessage === 'string' && helpMessage.length > 0) { - message = message.concat(', ', helpMessage); - } - return message; -}; +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const index = __nccwpck_require__(4603); +const index_gen = __nccwpck_require__(9513); +exports.v1 = index; +exports.v3 = index_gen; -/** - * PreconditionFailed error is used when a precondition is not respected. - * - * @public - */ -class PreconditionFailedError extends ScalewayError { - constructor(status, body, precondition, helpMessage) { - super(status, body, buildMessage$1(precondition, helpMessage)); - this.status = status; - this.body = body; - this.precondition = precondition; - this.helpMessage = helpMessage; - this.name = 'PreconditionFailedError'; - } - static fromJSON(status, obj) { - if (typeof obj.precondition !== 'string' || typeof obj.help_message !== 'string') { - return null; - } - return new PreconditionFailedError(status, obj, obj.precondition, obj.help_message); - } -} -/** - * ResourceExpired error happens when trying to access a resource that has expired. - * - * @public - */ -class ResourceExpiredError extends ScalewayError { - constructor(status, body, resource, resourceId, expiredSince) { - super(status, body, `resource ${resource} with ID ${resourceId} expired since ${expiredSince.toISOString()}`); - this.status = status; - this.body = body; - this.resource = resource; - this.resourceId = resourceId; - this.expiredSince = expiredSince; - this.name = 'ResourceExpiredError'; - } - static fromJSON(status, obj) { - if (typeof obj.resource !== 'string' || typeof obj.resource_id !== 'string' || typeof obj.expired_since !== 'string') { - return null; - } - return new ResourceExpiredError(status, obj, obj.resource, obj.resource_id, new Date(obj.expired_since)); - } -} +/***/ }), -/** - * ResourceLocked error happens when a resource is locked by trust and safety. - * - * @public - */ -class ResourceLockedError extends ScalewayError { - constructor(status, body, resource, resourceId) { - super(status, body, `resource ${resource} with ID ${resourceId} is locked`); - this.status = status; - this.body = body; - this.resource = resource; - this.resourceId = resourceId; - this.name = 'ResourceLockedError'; - } - static fromJSON(status, obj) { - if (typeof obj.resource !== 'string' || typeof obj.resource_id !== 'string') { - return null; - } - return new ResourceLockedError(status, obj, obj.resource, obj.resource_id); - } -} +/***/ 2831: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/** - * Quota policy of {@link TooManyRequestsError}. - * - * @public - */ +"use strict"; -/** - * Build the default message for {@link TooManyRequestsError}. - * - * @internal - */ -const buildMessage = (helpMessage, limit, resetSeconds, resetAt) => { - const details = []; - if (limit) { - if (limit.windowSeconds) { - details.push(`quota is ${limit.quota} for ${limit.windowSeconds}s`); - } else { - details.push(`quota is ${limit.quota}`); - } - } - if (resetSeconds) { - details.push(`resets in ${resetSeconds}s`); - } else if (resetAt) { - details.push(`resets at ${resetAt.toISOString()}`); - } - let output = `too many requests`; - if (details.length > 0) { - output += ` (${details.join(', ')})`; - } - if (helpMessage.length > 0) { - output += `: ${helpMessage}`; - } - return output; +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const intervalRetrier = __nccwpck_require__(9052); +const api = __nccwpck_require__(3042); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const resourcePaginator = __nccwpck_require__(4983); +const content_gen = __nccwpck_require__(1268); +const marshalling_gen = __nccwpck_require__(7685); +const jsonContentHeaders = { + "Content-Type": "application/json; charset=utf-8" }; - -/** - * TooManyRequestsError error happens when fetching too many times a resource. - * - * @public - */ -class TooManyRequestsError extends ScalewayError { - constructor(status, body, helpMessage, limit, /** The number of seconds until the quota resets */ - resetSeconds, /** The timestamp when the quota resets */ - resetAt) { - super(status, body, buildMessage(helpMessage, limit, resetSeconds, resetAt)); - this.status = status; - this.body = body; - this.helpMessage = helpMessage; - this.limit = limit; - this.resetSeconds = resetSeconds; - this.resetAt = resetAt; - this.name = 'TooManyRequestsError'; - } - static fromJSON(status, obj) { - if (typeof obj.help_message !== 'string') return null; - let limit; - if (isJSONObject(obj.limit) && typeof obj.limit.quota === 'number') { - limit = { - quota: obj.limit.quota, - windowSeconds: typeof obj.limit.window_seconds === 'number' ? obj.limit.window_seconds : undefined - }; - } - return new TooManyRequestsError(status, obj, obj.help_message, limit, typeof obj.reset_seconds === 'number' ? obj.reset_seconds : undefined, typeof obj.reset_at === 'string' ? new Date(obj.reset_at) : undefined); - } -} - -/** - * TransientState error happens when trying to perform an action on a resource in a transient state. - * - * @public - */ -class TransientStateError extends ScalewayError { - constructor(status, body, resource, resourceId, currentState) { - super(status, body, `resource ${resource} with ID ${resourceId} is in a transient state: ${currentState}`); - this.status = status; - this.body = body; - this.resource = resource; - this.resourceId = resourceId; - this.currentState = currentState; - this.name = 'TransientStateError'; - } - static fromJSON(status, obj) { - if (typeof obj.resource !== 'string' || typeof obj.resource_id !== 'string' || typeof obj.current_state !== 'string') { - return null; - } - return new TransientStateError(status, obj, obj.resource, obj.resource_id, obj.current_state); - } -} - -/** - * Unmarshals a standard error from raw body. - * - * @param type - The error type - * @param status - The status code - * @param body - The error response - * @returns The standard error if found - * - * @internal - */ -const unmarshalStandardError = (type, status, body) => { - let error; - switch (type) { - case 'denied_authentication': - error = DeniedAuthenticationError; - break; - case 'invalid_arguments': - error = InvalidArgumentsError; - break; - case 'out_of_stock': - error = OutOfStockError; - break; - case 'permissions_denied': - error = PermissionsDeniedError; - break; - case 'precondition_failed': - error = PreconditionFailedError; - break; - case 'quotas_exceeded': - error = QuotasExceededError; - break; - case 'expired': - error = ResourceExpiredError; - break; - case 'not_found': - error = ResourceNotFoundError; - break; - case 'locked': - error = ResourceLockedError; - break; - case 'transient_state': - error = TransientStateError; - break; - case 'already_exists': - error = AlreadyExistsError; - break; - case 'too_many_requests': - error = TooManyRequestsError; - break; - default: - return null; - } - return error.fromJSON(status, body); -}; - -/** - * Unmarshals a non-standard error from raw body. - * - * @param type - The error type - * @param status - The status code - * @param body - The error response - * @returns The non-standard error if found - * - * @internal - */ -const unmarshalNonStandardError = (type, status, body) => { - switch (type) { - case 'unknown_resource': - return UnknownResourceMapper.fromJSON(status, body); - case 'invalid_request_error': - return InvalidRequestMapper.fromJSON(status, body); - default: - return null; - } -}; - -/** - * Parses Scaleway error from raw body. - * - * @param status - The status code - * @param body - The error response - * @returns The resolved error - * - * @internal - */ -const parseScalewayError = (status, body) => { - const parsableError = typeof body.type === 'string' && (unmarshalStandardError(body.type, status, body) ?? unmarshalNonStandardError(body.type, status, body)); - return parsableError || new ScalewayError(status, body); -}; - -const X_TOTAL_COUNT_HEADER_KEY = 'x-total-count'; -const TOTAL_COUNT_RES_KEY = 'total_count'; - -/** - * Fixes the totalCount property for old APIs. - * - * @internal - */ -const fixLegacyTotalCount = (obj, headers) => { - const headerVal = headers.get(X_TOTAL_COUNT_HEADER_KEY); - if (!headerVal) { - return obj; - } - const totalCount = parseInt(headerVal, 10); - if (Number.isNaN(totalCount)) { - return obj; - } - if (isJSONObject(obj) && !(TOTAL_COUNT_RES_KEY in obj)) { - return Object.assign(obj, { - [TOTAL_COUNT_RES_KEY]: totalCount - }); - } - return obj; -}; - -/** - * Makes response parser. - * - * @param unmarshaller - The response payload unmarshaller - * @returns An async converter of HTTP Response to desired result - * - * @throws {@link ScalewayError} - * Thrown by the API if the request couldn't be completed. - * - * @throws TypeError - * Thrown if the response parameter isn't of the expected type. - * - * @throws Error - * JSON parsing could trigger an error. - * - * @internal - */ -const responseParser = (unmarshaller, responseType) => async response => { - if (!isResponse(response)) { - throw new TypeError('Invalid response object'); - } - if (response.ok) { - if (response.status === 204) return unmarshaller(undefined); - const contentType = response.headers.get('Content-Type'); - try { - if (responseType === 'json' && contentType === 'application/json') { - return unmarshaller(fixLegacyTotalCount(await response.json(), response.headers)); - } - if (responseType === 'blob') { - return unmarshaller(await response.blob()); - } - return unmarshaller(await response.text()); - } catch (err) { - throw new ScalewayError(response.status, `could not parse '${contentType ?? ''}' response${err instanceof Error ? `: ${err.message}` : ''}`); - } - } - const error = await response.clone().json().catch(() => response.text()); - if (isJSONObject(error)) throw parseScalewayError(response.status, error); - throw new ScalewayError(response.status, typeof error === 'string' ? error : 'cannot read error response body'); -}; - -/** - * Builds Request from {@link ScwRequest} & {@link Settings}. - * - * @param request - A scaleway request - * @param settings - The settings - * @returns A fetch Request - * - * @internal - */ -const buildRequest = (request, settings) => { - let { - path - } = request; - if (request.urlParams instanceof URLSearchParams) { - path = path.concat(`?${request.urlParams.toString()}`); - } - return new Request(`${settings.apiURL}${path}`, { - body: request.body, - headers: { - Accept: 'application/json', - ...( /* istanbul ignore next */!isBrowser() ? { - 'User-Agent': settings.userAgent - } : {}), - ...request.headers +class API extends api.API { + /** Lists the available zones of the API. */ + static LOCALITIES = [ + "fr-par-1", + "fr-par-2", + "nl-ams-1", + "nl-ams-2", + "pl-waw-2", + "pl-waw-3" + ]; + pageOfListServers = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/baremetal/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers`, + urlParams: marshalling.urlParams( + ["name", request.name], + ["option_id", request.optionId], + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId], + ["status", request.status], + ["tags", request.tags] + ) }, - method: request.method + marshalling_gen.unmarshalListServersResponse + ); + /** + * List Elastic Metal servers for an Organization. List Elastic Metal servers + * for a specific Organization. + * + * @param request - The request {@link ListServersRequest} + * @returns A Promise of ListServersResponse + */ + listServers = (request = {}) => resourcePaginator.enrichForPagination("servers", this.pageOfListServers, request); + /** + * Get a specific Elastic Metal server. Get full details of an existing + * Elastic Metal server associated with the ID. + * + * @param request - The request {@link GetServerRequest} + * @returns A Promise of Server + */ + getServer = (request) => this.client.fetch( + { + method: "GET", + path: `/baremetal/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}` + }, + marshalling_gen.unmarshalServer + ); + /** + * Waits for {@link Server} to be in a final state. + * + * @param request - The request {@link GetServerRequest} + * @param options - The waiting options + * @returns A Promise of Server + */ + waitForServer = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve(!content_gen.SERVER_TRANSIENT_STATUSES.includes(res.status))), + this.getServer, + request, + options + ); + /** + * Create an Elastic Metal server. Create a new Elastic Metal server. Once the + * server is created, proceed with the [installation of an OS](#post-3e949e). + * + * @param request - The request {@link CreateServerRequest} + * @returns A Promise of Server + */ + createServer = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateServerRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/baremetal/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers` + }, + marshalling_gen.unmarshalServer + ); + /** + * Update an Elastic Metal server. Update the server associated with the ID. + * You can update parameters such as the server's name, tags and description. + * Any parameters left null in the request body are not updated. + * + * @param request - The request {@link UpdateServerRequest} + * @returns A Promise of Server + */ + updateServer = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateServerRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/baremetal/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}` + }, + marshalling_gen.unmarshalServer + ); + /** + * Install an Elastic Metal server. Install an Operating System (OS) on the + * Elastic Metal server with a specific ID. + * + * @param request - The request {@link InstallServerRequest} + * @returns A Promise of Server + */ + installServer = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalInstallServerRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/baremetal/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/install` + }, + marshalling_gen.unmarshalServer + ); + /** + * Return server metrics. Get the ping status of the server associated with + * the ID. + * + * @param request - The request {@link GetServerMetricsRequest} + * @returns A Promise of GetServerMetricsResponse + */ + getServerMetrics = (request) => this.client.fetch( + { + method: "GET", + path: `/baremetal/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/metrics` + }, + marshalling_gen.unmarshalGetServerMetricsResponse + ); + /** + * Delete an Elastic Metal server. Delete the server associated with the ID. + * + * @param request - The request {@link DeleteServerRequest} + * @returns A Promise of Server + */ + deleteServer = (request) => this.client.fetch( + { + method: "DELETE", + path: `/baremetal/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}` + }, + marshalling_gen.unmarshalServer + ); + /** + * Reboot an Elastic Metal server. Reboot the Elastic Metal server associated + * with the ID, use the `boot_type` `rescue` to reboot the server in rescue + * mode. + * + * @param request - The request {@link RebootServerRequest} + * @returns A Promise of Server + */ + rebootServer = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalRebootServerRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/baremetal/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/reboot` + }, + marshalling_gen.unmarshalServer + ); + /** + * Start an Elastic Metal server. Start the server associated with the ID. + * + * @param request - The request {@link StartServerRequest} + * @returns A Promise of Server + */ + startServer = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalStartServerRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/baremetal/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/start` + }, + marshalling_gen.unmarshalServer + ); + /** + * Stop an Elastic Metal server. Stop the server associated with the ID. The + * server remains allocated to your account and all data remains on the local + * storage of the server. + * + * @param request - The request {@link StopServerRequest} + * @returns A Promise of Server + */ + stopServer = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/baremetal/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/stop` + }, + marshalling_gen.unmarshalServer + ); + pageOfListServerEvents = (request) => this.client.fetch( + { + method: "GET", + path: `/baremetal/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/events`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListServerEventsResponse + ); + /** + * List server events. List event (i.e. start/stop/reboot) associated to the + * server ID. + * + * @param request - The request {@link ListServerEventsRequest} + * @returns A Promise of ListServerEventsResponse + */ + listServerEvents = (request) => resourcePaginator.enrichForPagination("events", this.pageOfListServerEvents, request); + /** + * Get default partitioning schema. Get the default partitioning schema for + * the given offer ID and OS ID. + * + * @param request - The request {@link GetDefaultPartitioningSchemaRequest} + * @returns A Promise of Schema + */ + getDefaultPartitioningSchema = (request) => this.client.fetch( + { + method: "GET", + path: `/baremetal/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/partitioning-schemas/default`, + urlParams: marshalling.urlParams( + ["offer_id", request.offerId], + ["os_id", request.osId] + ) + }, + marshalling_gen.unmarshalSchema + ); + /** + * Validate client partitioning schema. Validate the incoming partitioning + * schema from a user before installing the server. Return default ErrorCode + * if invalid. + * + * @param request - The request {@link ValidatePartitioningSchemaRequest} + */ + validatePartitioningSchema = (request) => this.client.fetch({ + body: JSON.stringify( + marshalling_gen.marshalValidatePartitioningSchemaRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/baremetal/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/partitioning-schemas/validate` }); -}; -const asIs = response => response; -/** - * Builds a resource fetcher. - * - * @param settings - The {@link Settings} object - * @param httpClient - The HTTP client that should be used to call the API - * @returns The fetcher - * - * @internal - */ -const buildFetcher = (settings, httpClient) => { - let requestNumber = 0; - const prepareRequest = requestId => composeRequestInterceptors([...settings.interceptors.map(obj => obj.request).filter(obj => obj), logRequest(requestId, obfuscateInterceptor(obfuscateAuthHeadersEntry))]); - const prepareResponse = requestId => composeResponseInterceptors([...settings.interceptors.map(obj => obj.response).filter(obj => obj), logResponse(requestId)]); - const prepareResponseErrors = () => composeResponseErrorInterceptors(settings.interceptors.map(obj => obj.responseError).filter(obj => obj)); - return async (request, unwrapper = asIs) => { - const requestId = `${requestNumber += 1}`; - const reqInterceptors = prepareRequest(requestId); - const finalRequest = await reqInterceptors(buildRequest(request, settings)); - try { - const response = await httpClient(finalRequest); - const resInterceptors = prepareResponse(requestId); - const finalResponse = await resInterceptors(response); - const resUnmarshaller = responseParser(unwrapper, request.responseType ?? 'json'); - const unmarshaledResponse = await resUnmarshaller(finalResponse); - return unmarshaledResponse; - } catch (err) { - const resErrorInterceptors = prepareResponseErrors(); - const handledError = await resErrorInterceptors(finalRequest, err); - return unwrapper(handledError); - } - }; -}; - -/** Default {@link Settings} values. */ -const DEFAULT_SETTINGS = { - apiURL: 'https://api.scaleway.com', - httpClient: fetch, - interceptors: [], - userAgent -}; - -/** - * Scaleway client. - */ - -/** - * Creates a Scaleway client with advanced options. - * You can either use existing factories - * (like `withProfile`, `withUserAgentSuffix`, etc) - * or write your own using the interface `ClientConfig`. - * - * @example - * Creates a client with factories: - * ``` - * createAdvancedClient( - * (obj: Settings) => ({ - * ...obj, - * defaultPageSize: 100 , - * httpClient: myFetchWrapper, - * }), - * withUserAgentSuffix('bot-name/1.0'), - * ) - * ``` - * - * @throws Error - * Thrown if the setup fails. - * - * @public - */ -const createAdvancedClient = (...configs) => { - const settings = configs.concat([withLegacyInterceptors()]).reduce((currentSettings, config) => config(currentSettings), DEFAULT_SETTINGS); - assertValidSettings(settings); - getLogger().info(`init Scaleway SDK version ${version}`); - return { - fetch: buildFetcher(settings, settings.httpClient), - settings - }; -}; - -/** - * Creates a Scaleway client with a profile. - * - * @example - * Creates a client with credentials & default values (see https://www.scaleway.com/en/docs/identity-and-access-management/iam/how-to/create-api-keys/): - * ``` - * import { createClient } from '@scaleway/sdk' - * - * createClient({ - * accessKey: 'SCWXXXXXXXXXXXXXXXXX', - * secretKey: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', - * defaultProjectId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', - * defaultRegion: 'fr-par', - * defaultZone: 'fr-par-1', - * }) - * ``` - * - * @example - * Creates a client by loading values from the environment (see https://www.scaleway.com/en/docs/identity-and-access-management/iam/how-to/create-api-keys/) - * or the config file created by CLI `scw init` (see https://www.scaleway.com/en/cli/): - * ``` - * import { loadProfileFromConfigurationFile } from '@scaleway/configuration-loader' - * import { createClient } from '@scaleway/sdk' - * - * createClient({ - * ...await loadProfileFromConfigurationFile(), - * defaultZone: 'fr-par-3', - * }) - * ``` - * - * @throws Error - * Thrown if the setup fails. - * - * @public - */ -const createClient = (profile = {}) => createAdvancedClient(withProfile(profile)); - -var index$w = /*#__PURE__*/Object.freeze({ - __proto__: null, - AlreadyExistsError: AlreadyExistsError, - DeniedAuthenticationError: DeniedAuthenticationError, - InvalidArgumentsError: InvalidArgumentsError, - OutOfStockError: OutOfStockError, - PermissionsDeniedError: PermissionsDeniedError, - PreconditionFailedError: PreconditionFailedError, - QuotasExceededError: QuotasExceededError, - ResourceExpiredError: ResourceExpiredError, - ResourceLockedError: ResourceLockedError, - ResourceNotFoundError: ResourceNotFoundError, - ScalewayError: ScalewayError, - TooManyRequestsError: TooManyRequestsError, - TransientStateError: TransientStateError -}); + /** + * Start BMC access. Start BMC (Baseboard Management Controller) access + * associated with the ID. The BMC (Baseboard Management Controller) access is + * available one hour after the installation of the server. You need first to + * create an option Remote Access. You will find the ID and the price with a + * call to listOffers + * (https://developers.scaleway.com/en/products/baremetal/api/#get-78db92). + * Then add the option + * https://developers.scaleway.com/en/products/baremetal/api/#post-b14abd. + * After adding the BMC option, you need to Get Remote Access to get the + * login/password + * https://developers.scaleway.com/en/products/baremetal/api/#get-cefc0f. Do + * not forget to delete the Option after use. + * + * @param request - The request {@link StartBMCAccessRequest} + * @returns A Promise of BMCAccess + */ + startBMCAccess = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalStartBMCAccessRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/baremetal/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/bmc-access` + }, + marshalling_gen.unmarshalBMCAccess + ); + /** + * Get BMC access. Get the BMC (Baseboard Management Controller) access + * associated with the ID, including the URL and login information needed to + * connect. + * + * @param request - The request {@link GetBMCAccessRequest} + * @returns A Promise of BMCAccess + */ + getBMCAccess = (request) => this.client.fetch( + { + method: "GET", + path: `/baremetal/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/bmc-access` + }, + marshalling_gen.unmarshalBMCAccess + ); + /** + * Stop BMC access. Stop BMC (Baseboard Management Controller) access + * associated with the ID. + * + * @param request - The request {@link StopBMCAccessRequest} + */ + stopBMCAccess = (request) => this.client.fetch({ + method: "DELETE", + path: `/baremetal/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/bmc-access` + }); + /** + * Update IP. Configure the IP address associated with the server ID and IP + * ID. You can use this method to set a reverse DNS for an IP address. + * + * @param request - The request {@link UpdateIPRequest} + * @returns A Promise of IP + */ + updateIP = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateIPRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/baremetal/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/ips/${marshalling.validatePathParam("ipId", request.ipId)}` + }, + marshalling_gen.unmarshalIP + ); + /** + * Add server option. Add an option, such as Private Networks, to a specific + * server. + * + * @param request - The request {@link AddOptionServerRequest} + * @returns A Promise of Server + */ + addOptionServer = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalAddOptionServerRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/baremetal/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/options/${marshalling.validatePathParam("optionId", request.optionId)}` + }, + marshalling_gen.unmarshalServer + ); + /** + * Delete server option. Delete an option from a specific server. + * + * @param request - The request {@link DeleteOptionServerRequest} + * @returns A Promise of Server + */ + deleteOptionServer = (request) => this.client.fetch( + { + method: "DELETE", + path: `/baremetal/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/options/${marshalling.validatePathParam("optionId", request.optionId)}` + }, + marshalling_gen.unmarshalServer + ); + pageOfListOffers = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/baremetal/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/offers`, + urlParams: marshalling.urlParams( + ["name", request.name], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["subscription_period", request.subscriptionPeriod] + ) + }, + marshalling_gen.unmarshalListOffersResponse + ); + /** + * List offers. List all available Elastic Metal server configurations. + * + * @param request - The request {@link ListOffersRequest} + * @returns A Promise of ListOffersResponse + */ + listOffers = (request = {}) => resourcePaginator.enrichForPagination("offers", this.pageOfListOffers, request); + /** + * Get offer. Get details of an offer identified by its offer ID. + * + * @param request - The request {@link GetOfferRequest} + * @returns A Promise of Offer + */ + getOffer = (request) => this.client.fetch( + { + method: "GET", + path: `/baremetal/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/offers/${marshalling.validatePathParam("offerId", request.offerId)}` + }, + marshalling_gen.unmarshalOffer + ); + /** + * Get option. Return specific option for the ID. + * + * @param request - The request {@link GetOptionRequest} + * @returns A Promise of Option + */ + getOption = (request) => this.client.fetch( + { + method: "GET", + path: `/baremetal/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/options/${marshalling.validatePathParam("optionId", request.optionId)}` + }, + marshalling_gen.unmarshalOption + ); + pageOfListOptions = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/baremetal/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/options`, + urlParams: marshalling.urlParams( + ["name", request.name], + ["offer_id", request.offerId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListOptionsResponse + ); + /** + * List options. List all options matching with filters. + * + * @param request - The request {@link ListOptionsRequest} + * @returns A Promise of ListOptionsResponse + */ + listOptions = (request = {}) => resourcePaginator.enrichForPagination("options", this.pageOfListOptions, request); + pageOfListSettings = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/baremetal/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/settings`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + [ + "project_id", + request.projectId ?? this.client.settings.defaultProjectId + ] + ) + }, + marshalling_gen.unmarshalListSettingsResponse + ); + /** + * List all settings. Return all settings for a Project ID. + * + * @param request - The request {@link ListSettingsRequest} + * @returns A Promise of ListSettingsResponse + */ + listSettings = (request = {}) => resourcePaginator.enrichForPagination("settings", this.pageOfListSettings, request); + /** + * Update setting. Update a setting for a Project ID (enable or disable). + * + * @param request - The request {@link UpdateSettingRequest} + * @returns A Promise of Setting + */ + updateSetting = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateSettingRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/baremetal/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/settings/${marshalling.validatePathParam("settingId", request.settingId)}` + }, + marshalling_gen.unmarshalSetting + ); + pageOfListOS = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/baremetal/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/os`, + urlParams: marshalling.urlParams( + ["offer_id", request.offerId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListOSResponse + ); + /** + * List available OSes. List all OSes that are available for installation on + * Elastic Metal servers. + * + * @param request - The request {@link ListOSRequest} + * @returns A Promise of ListOSResponse + */ + listOS = (request = {}) => resourcePaginator.enrichForPagination("os", this.pageOfListOS, request); + /** + * Get OS with an ID. Return the specific OS for the ID. + * + * @param request - The request {@link GetOSRequest} + * @returns A Promise of OS + */ + getOS = (request) => this.client.fetch( + { + method: "GET", + path: `/baremetal/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/os/${marshalling.validatePathParam("osId", request.osId)}` + }, + marshalling_gen.unmarshalOS + ); +} +class PrivateNetworkAPI extends api.API { + /** Lists the available zones of the API. */ + static LOCALITIES = ["fr-par-2"]; + /** + * Add a server to a Private Network. + * + * @param request - The request + * {@link PrivateNetworkApiAddServerPrivateNetworkRequest} + * @returns A Promise of ServerPrivateNetwork + */ + addServerPrivateNetwork = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalPrivateNetworkApiAddServerPrivateNetworkRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/baremetal/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/private-networks` + }, + marshalling_gen.unmarshalServerPrivateNetwork + ); + /** + * Set multiple Private Networks on a server. + * + * @param request - The request + * {@link PrivateNetworkApiSetServerPrivateNetworksRequest} + * @returns A Promise of SetServerPrivateNetworksResponse + */ + setServerPrivateNetworks = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalPrivateNetworkApiSetServerPrivateNetworksRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "PUT", + path: `/baremetal/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/private-networks` + }, + marshalling_gen.unmarshalSetServerPrivateNetworksResponse + ); + pageOfListServerPrivateNetworks = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/baremetal/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/server-private-networks`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["private_network_id", request.privateNetworkId], + ["project_id", request.projectId], + ["server_id", request.serverId] + ) + }, + marshalling_gen.unmarshalListServerPrivateNetworksResponse + ); + /** + * List the Private Networks of a server. + * + * @param request - The request + * {@link PrivateNetworkApiListServerPrivateNetworksRequest} + * @returns A Promise of ListServerPrivateNetworksResponse + */ + listServerPrivateNetworks = (request = {}) => resourcePaginator.enrichForPagination( + "serverPrivateNetworks", + this.pageOfListServerPrivateNetworks, + request + ); + /** + * Delete a Private Network. + * + * @param request - The request + * {@link PrivateNetworkApiDeleteServerPrivateNetworkRequest} + */ + deleteServerPrivateNetwork = (request) => this.client.fetch({ + method: "DELETE", + path: `/baremetal/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/private-networks/${marshalling.validatePathParam("privateNetworkId", request.privateNetworkId)}` + }); +} +exports.API = API; +exports.PrivateNetworkAPI = PrivateNetworkAPI; -/** - * Sleep for a specified number of time. - * - * @param ms - The number of milliseconds - * @returns The sleep promise - * - * @internal - */ -const sleep = ms => new Promise(resolve => { - setTimeout(resolve, ms); -}); -const DEFAULT_TIMEOUT_SECONDS = 300; -const DEFAULT_MIN_DELAY_SECONDS = 1; -const DEFAULT_MAX_DELAY_SECONDS = 30; +/***/ }), -/** - * Creates an exponential backoff interval strategy. - * - * @param minDelay - The minimum delay before the next try in seconds - * @param maxDelay - The maximum delay before the next try in seconds - * @returns An exponential backoff generator - * - * @internal - */ -function* createExponentialBackoffStrategy(minDelay, maxDelay) { - if (minDelay < 1 || maxDelay < 1 || minDelay > maxDelay) { - throw new Error('Waiter: minDelay must be >= 1 and maxDelay must be >= minDelay'); - } - let attempt = 1; - const ceiling = Math.log(maxDelay / minDelay) / Math.log(2) + 1; - const randomInRange = (min, max) => min + Math.random() * (max - min); - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - while (true) { - if (attempt > ceiling) { - yield maxDelay; - } else { - yield randomInRange(minDelay, minDelay * 2 ** (attempt - 1)); - } - attempt += 1; - } +/***/ 7594: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const intervalRetrier = __nccwpck_require__(9052); +const api_gen = __nccwpck_require__(2831); +const content_gen = __nccwpck_require__(1268); +class BaremetalV1UtilsAPI extends api_gen.API { + /** + * Waits for {@link ServerInstall} to be in a final state. + * + * @param request - The request {@link GetServerRequest} + * @param options - The waiting options + * @returns A Promise of ServerInstall + */ + waitForServerInstall = (request, options) => intervalRetrier.tryAtIntervals( + async () => { + const value = await this.getServer(request).then((server) => { + if (!server.install) { + throw new Error( + `Server creation has not begun for server ${request.serverId}` + ); + } + return server.install; + }); + return { + done: !content_gen.SERVER_INSTALL_TRANSIENT_STATUSES.includes(value.status), + value + }; + }, + intervalRetrier.createExponentialBackoffStrategy( + options?.minDelay ?? 1, + options?.maxDelay ?? 30 + ), + options?.timeout + ); } +exports.BaremetalV1UtilsAPI = BaremetalV1UtilsAPI; -/** - * Tries a specific logic several times until it succeeds, timeouts, or throws an exception. - * - * @param retry - The function to retry logic between each interval - * @param strategy - A generated interval strategy iterator - * @param timeout - The maximum time elapsed before timeout error - * - * @throws An timeout exception or error thrown by the logic being run - * - * @internal - */ -const tryAtIntervals = async (retry, strategy, timeout = DEFAULT_TIMEOUT_SECONDS) => { - const timeoutTimestamp = Date.now() + timeout * 1000; - let retryCount = 0; - while (Date.now() <= timeoutTimestamp) { - const delay = strategy.next(retryCount += 1).value * 1000; - // Break if timeout has been reached - if (timeoutTimestamp <= Date.now() + delay) break; - // Wait before the next retry - await sleep(delay); - // Retry - const { - value, - done - } = await retry(); - if (done) return value; - } - throw new Error(`Timeout after ${timeout}s`); -}; -/** - * Represents the condition to stop waiting for a resource. - * - * @public - */ +/***/ }), -/** - * The options to wait until a resource is ready. - * - * @public - */ +/***/ 1268: +/***/ ((__unused_webpack_module, exports) => { -/** - * Fetches resource several times until an expected condition is reached, timeouts, or throws an exception. - * - * @param stop - The condition to stop waiting - * @param fetcher - The method to retrieve resource - * @param request - The resource request options - * @param options - The retry strategy options - * @param strategy - An optional custom strategy - * - * @returns A promise of resource - * - * @public - */ -const waitForResource = (stop, fetcher, request, options, strategy = createExponentialBackoffStrategy(options?.minDelay ?? DEFAULT_MIN_DELAY_SECONDS, options?.maxDelay ?? DEFAULT_MAX_DELAY_SECONDS)) => tryAtIntervals(async () => { - const value = await fetcher(request); +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const SERVER_INSTALL_TRANSIENT_STATUSES = [ + "to_install", + "installing" +]; +const SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES = ["attaching", "detaching"]; +const SERVER_TRANSIENT_STATUSES = [ + "delivering", + "stopping", + "starting", + "deleting", + "ordered", + "resetting" +]; +exports.SERVER_INSTALL_TRANSIENT_STATUSES = SERVER_INSTALL_TRANSIENT_STATUSES; +exports.SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES = SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES; +exports.SERVER_TRANSIENT_STATUSES = SERVER_TRANSIENT_STATUSES; + + +/***/ }), + +/***/ 4603: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api_utils = __nccwpck_require__(7594); +const api_gen = __nccwpck_require__(2831); +const content_gen = __nccwpck_require__(1268); +const validationRules_gen = __nccwpck_require__(4306); +exports.API = api_utils.BaremetalV1UtilsAPI; +exports.PrivateNetworkAPI = api_gen.PrivateNetworkAPI; +exports.SERVER_INSTALL_TRANSIENT_STATUSES = content_gen.SERVER_INSTALL_TRANSIENT_STATUSES; +exports.SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES = content_gen.SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES; +exports.SERVER_TRANSIENT_STATUSES = content_gen.SERVER_TRANSIENT_STATUSES; +exports.ValidationRules = validationRules_gen; + + +/***/ }), + +/***/ 7685: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const json = __nccwpck_require__(3746); +const customMarshalling = __nccwpck_require__(7586); +const marshalling = __nccwpck_require__(1162); +const unmarshalSchemaPartition = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SchemaPartition' failed as data isn't a dictionary.` + ); + } return { - done: await stop(value), - value + label: data.label, + number: data.number, + size: data.size }; -}, strategy, options?.timeout); - -/** - * Abstract class to instantiate API from a {@link Client}. - * - * @internal - */ -let API$u = class API { - constructor(client) { - this.client = client; +}; +const unmarshalSchemaPool = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SchemaPool' failed as data isn't a dictionary.` + ); } + return { + devices: data.devices, + filesystemOptions: data.filesystem_options, + name: data.name, + options: data.options, + type: data.type + }; }; - -/** - * Returns the parameter if it's valid as path parameter - * (string and not empty, or number), else throws an exception. - * - * @param name - The parameter name - * @param param - The parameter value - * @returns The parameter value - * - * @throws TypeError - * Thrown if the parameter is invalid. - * - * @internal - */ -function validatePathParam(name, param) { - if (typeof param === 'string' && param.length > 0) return param; - if (typeof param === 'number') return param.toString(); - throw new TypeError(`param ${name} cannot be empty in request`); -} - -/** - * Resolves the ideal parameter and value amongst an optional list. - * - * @param list - The list to be looking into - * @param isRequired - If at least one "one-of" should be found, false by default - * @returns The parameter and value - * - * @throws TypeError - * Thrown if isRequired is true, and no value or default value is specified. - * - * @internal - */ -const resolveOneOf = (list, isRequired = false) => { - const elt = list.find(obj => obj.value !== undefined) ?? list.find(obj => obj.default !== undefined); - const value = elt?.value ?? elt?.default; - if (elt && value !== undefined) { - return { - [elt.param]: value - }; - } - if (isRequired) { - const keyList = list.map(obj => obj.param).join(' or '); - throw new TypeError(`one of ${keyList} must be indicated in the request`); +const unmarshalSchemaDisk = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SchemaDisk' failed as data isn't a dictionary.` + ); } - return {}; + return { + device: data.device, + partitions: marshalling.unmarshalArrayOfObject( + data.partitions, + unmarshalSchemaPartition + ) + }; }; -/** - * Filters defined parameters tuples and converts them to URLSearchParams. - * - * @param paramTuples - The key/value pairs - * @returns URLSearchParams - * - * @internal - */ -const urlParams = (...paramTuples) => { - const params = new URLSearchParams(); - for (const [key, value] of paramTuples) { - if (typeof key === 'string' && value != null) { - if (Array.isArray(value)) { - for (const innerValue of value) { - if (innerValue !== null) { - params.append(key, innerValue instanceof Date ? innerValue.toISOString() : innerValue.toString()); - } - } - } else { - params.append(key, value instanceof Date ? value.toISOString() : value.toString()); - } - } +const unmarshalSchemaFilesystem = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SchemaFilesystem' failed as data isn't a dictionary.` + ); } - return params; + return { + device: data.device, + format: data.format, + mountpoint: data.mountpoint + }; }; - -/** - * Unmarshals data to Date object. - * - * @internal - */ -const unmarshalDate = data => { - if (typeof data !== 'string') { - return undefined; +const unmarshalSchemaRAID = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SchemaRAID' failed as data isn't a dictionary.` + ); } - const date = new Date(data); - if (Number.isNaN(date.getTime())) { - return undefined; + return { + devices: data.devices, + level: data.level, + name: data.name + }; +}; +const unmarshalSchemaZFS = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SchemaZFS' failed as data isn't a dictionary.` + ); } - return date; + return { + pools: marshalling.unmarshalArrayOfObject(data.pools, unmarshalSchemaPool) + }; }; - -/** - * Unmarshals array of object. - * - * @internal - */ -const unmarshalArrayOfObject = (data, unmarshaller, emptyFallback = true) => { - if (!Array.isArray(data)) { - return emptyFallback ? [] : undefined; +const unmarshalSchema = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Schema' failed as data isn't a dictionary.` + ); } - return data.map(elt => unmarshaller(elt)); + return { + disks: marshalling.unmarshalArrayOfObject(data.disks, unmarshalSchemaDisk), + filesystems: marshalling.unmarshalArrayOfObject( + data.filesystems, + unmarshalSchemaFilesystem + ), + raids: marshalling.unmarshalArrayOfObject(data.raids, unmarshalSchemaRAID), + zfs: data.zfs ? unmarshalSchemaZFS(data.zfs) : void 0 + }; }; - -/** - * Unmarshals map of object. - * - * @internal - */ -const unmarshalMapOfObject = (data, unmarshaller, emptyFallback = true) => { - if (!data || typeof data !== 'object' || !(data instanceof Object) || Array.isArray(data)) { - return emptyFallback ? {} : undefined; +const unmarshalIP = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'IP' failed as data isn't a dictionary.` + ); } - return Object.entries(data).reduce((acc, [key, value]) => ({ - ...acc, - [key]: unmarshaller(value) - }), {}); + return { + address: data.address, + id: data.id, + reverse: data.reverse, + reverseStatus: data.reverse_status, + reverseStatusMessage: data.reverse_status_message, + version: data.version + }; }; - -/** - * Unmarshals {@link Money} - * - * @internal - */ -const unmarshalMoney = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Money' failed as data isn't a dictionary.`); +const unmarshalOSOSField = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'OSOSField' failed as data isn't a dictionary.` + ); } return { - currencyCode: data.currency_code, - nanos: data.nanos, - units: data.units + defaultValue: data.default_value, + editable: data.editable, + required: data.required }; }; - -/** - * Unmarshals {@link ServiceInfo}. - * - * @internal - */ -const unmarshalServiceInfo = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ServiceInfo' failed as data isn't a dictionary.`); +const unmarshalOS = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'OS' failed as data isn't a dictionary.` + ); } return { - description: data.description, - documentationUrl: data.documentation_url, + allowed: data.allowed, + customPartitioningSupported: data.custom_partitioning_supported, + enabled: data.enabled, + id: data.id, + licenseRequired: data.license_required, + logoUrl: data.logo_url, name: data.name, + password: data.password ? unmarshalOSOSField(data.password) : void 0, + servicePassword: data.service_password ? unmarshalOSOSField(data.service_password) : void 0, + serviceUser: data.service_user ? unmarshalOSOSField(data.service_user) : void 0, + ssh: data.ssh ? unmarshalOSOSField(data.ssh) : void 0, + user: data.user ? unmarshalOSOSField(data.user) : void 0, version: data.version }; }; - -/** - * Unmarshals {@link ScwFile}. - * - * @internal - */ -const unmarshalScwFile = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ScwFile' failed as data isn't a dictionary.`); +const unmarshalCertificationOption = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'CertificationOption' failed as data isn't a dictionary.` + ); + } + return {}; +}; +const unmarshalLicenseOption = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'LicenseOption' failed as data isn't a dictionary.` + ); } return { - content: data.content, - contentType: data.content_type, - name: data.name + osId: data.os_id }; }; - -/** - * Unmarshals {@link TimeSeriesPoint} - * - * @remarks To optimize the size of this message, - * the JSON is compressed in an array instead of a dictionary. - * Example: `["2019-08-08T15:00:00Z", 0.2]`. - * - * @internal - */ -const unmarshalTimeSeriesPoint = data => { - if (!Array.isArray(data)) { - throw new TypeError(`Unmarshalling the type 'TimeSeriesPoint' failed as data isn't an array.`); +const unmarshalPrivateNetworkOption = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'PrivateNetworkOption' failed as data isn't a dictionary.` + ); + } + return {}; +}; +const unmarshalPublicBandwidthOption = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'PublicBandwidthOption' failed as data isn't a dictionary.` + ); } return { - timestamp: unmarshalDate(data[0]), - value: data[1] + bandwidthInBps: data.bandwidth_in_bps }; }; - -/** - * Unmarshals {@link TimeSeries} - * - * @internal - */ -const unmarshalTimeSeries = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'TimeSeries' failed as data isn't a dictionary.`); +const unmarshalRemoteAccessOption = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'RemoteAccessOption' failed as data isn't a dictionary.` + ); + } + return {}; +}; +const unmarshalCPU = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'CPU' failed as data isn't a dictionary.` + ); } return { - metadata: data.metadata, + benchmark: data.benchmark, + coreCount: data.core_count, + frequency: data.frequency, name: data.name, - points: unmarshalArrayOfObject(data.points, unmarshalTimeSeriesPoint) + threadCount: data.thread_count }; }; - -/** - * Marshals {@link ScwFile}. - * - * @internal - */ -const marshalScwFile = obj => ({ - content: obj.content, - content_type: obj.contentType, - name: obj.name -}); - -/** - * Marshals {@link Money} - * - * @internal - */ -const marshalMoney = obj => ({ - currency_code: obj.currencyCode, - nanos: obj.nanos, - units: obj.units -}); - -/** - * Marshals {@link TimeSeriesPoint} - * - * @internal - */ -const marshalTimeSeriesPoint = obj => ({ - timestamp: obj.timestamp?.toISOString(), - value: obj.value -}); - -/** - * Marshals {@link TimeSeries} - * - * @internal - */ -const marshalTimeSeries = obj => ({ - metadata: obj.metadata, - name: obj.name, - points: obj.points.map(elt => marshalTimeSeriesPoint(elt)) -}); - -const extract = key => result => result[key]; -function* pages(key, fetcher, request, firstPage) { - if (!Array.isArray(firstPage[key])) { - throw new Error(`Property ${key} is not a list in paginated result`); +const unmarshalDisk = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Disk' failed as data isn't a dictionary.` + ); } - const getList = extract(key); - let page = request.page || 1; - if (page === 1) { - yield Promise.resolve(getList(firstPage)); - page += 1; + return { + capacity: data.capacity, + type: data.type + }; +}; +const unmarshalMemory = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Memory' failed as data isn't a dictionary.` + ); } - const { - length - } = firstPage[key]; - if (!length) return; - const { - totalCount - } = firstPage; - while (page <= Math.floor((totalCount + length - 1) / length)) { - yield fetcher({ - ...request, - page - }).then(getList); - page += 1; + return { + capacity: data.capacity, + frequency: data.frequency, + isEcc: data.is_ecc, + type: data.type + }; +}; +const unmarshalOfferOptionOffer = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'OfferOptionOffer' failed as data isn't a dictionary.` + ); } -} - -/** - * Fetches a paginated resource. - * - * @param key - The resource key of values list - * @param fetcher - The method to retrieve paginated resources - * @param request - A request with pagination options - * @param initial - The first page - * @returns An async generator of resources arrays - */ -async function* fetchPaginated(key, fetcher, request, initial = fetcher(request)) { - yield* pages(key, fetcher, request, await initial); -} - -/** - * Fetches all paginated resource. - * - * @param key - The resource key of values list - * @param fetcher - The method to retrieve paginated resources - * @param request - A request with pagination options - * @param initial - The first page - * @returns A resources array Promise - */ -const fetchAll = async (key, fetcher, request, initial = fetcher(request)) => (await Promise.all(Array.from(pages(key, fetcher, request, await initial)))).flat(); - -/** - * Enriches a listing method with helpers. - * - * @param key - The resource key of values list - * @param fetcher - The method to retrieve paginated resources - * @param request - A request with pagination options - * @returns A resource Promise with the pagination helpers - * - * @internal - */ -const enrichForPagination = (key, fetcher, request) => { - const firstPage = fetcher(request); - return Object.assign(firstPage, { - all: () => fetchAll(key, fetcher, request, firstPage), - [Symbol.asyncIterator]: () => fetchPaginated(key, fetcher, request, firstPage) - }); + return { + certification: data.certification ? unmarshalCertificationOption(data.certification) : void 0, + enabled: data.enabled, + id: data.id, + license: data.license ? unmarshalLicenseOption(data.license) : void 0, + manageable: data.manageable, + name: data.name, + osId: data.os_id, + price: data.price ? customMarshalling.unmarshalMoney(data.price) : void 0, + privateNetwork: data.private_network ? unmarshalPrivateNetworkOption(data.private_network) : void 0, + publicBandwidth: data.public_bandwidth ? unmarshalPublicBandwidthOption(data.public_bandwidth) : void 0, + remoteAccess: data.remote_access ? unmarshalRemoteAccessOption(data.remote_access) : void 0, + subscriptionPeriod: data.subscription_period + }; }; - -const ADJECTIVES = ['admiring', 'adoring', 'affectionate', 'agitated', 'amazing', 'angry', 'awesome', 'beautiful', 'blissful', 'bold', 'boring', 'brave', 'busy', 'charming', 'clever', 'cool', 'compassionate', 'competent', 'condescending', 'confident', 'cranky', 'crazy', 'dazzling', 'determined', 'distracted', 'dreamy', 'eager', 'ecstatic', 'elastic', 'elated', 'elegant', 'eloquent', 'epic', 'exciting', 'fervent', 'festive', 'flamboyant', 'focused', 'friendly', 'frosty', 'funny', 'gallant', 'gifted', 'goofy', 'gracious', 'great', 'happy', 'hardcore', 'heuristic', 'hopeful', 'hungry', 'infallible', 'inspiring', 'interesting', 'intelligent', 'jolly', 'jovial', 'keen', 'kind', 'laughing', 'loving', 'lucid', 'magical', 'mystifying', 'modest', 'musing', 'naughty', 'nervous', 'nice', 'nifty', 'nostalgic', 'objective', 'optimistic', 'peaceful', 'pedantic', 'pensive', 'practical', 'priceless', 'quirky', 'quizzical', 'recursing', 'relaxed', 'reverent', 'romantic', 'sad', 'serene', 'sharp', 'silly', 'sleepy', 'stoic', 'strange', 'stupefied', 'suspicious', 'sweet', 'tender', 'thirsty', 'trusting', 'unruffled', 'upbeat', 'vibrant', 'vigilant', 'vigorous', 'wizardly', 'wonderful', 'xenodochial', 'youthful', 'zealous', 'zen']; -const NAMES = ['albattani', 'allen', 'almeida', 'antonelli', 'agnesi', 'archimedes', 'ardinghelli', 'aryabhata', 'austin', 'babbage', 'banach', 'banzai', 'bardeen', 'bartik', 'bassi', 'beaver', 'bell', 'benz', 'bhabha', 'bhaskara', 'black', 'blackburn', 'blackwell', 'bohr', 'booth', 'borg', 'bose', 'bouman', 'boyd', 'brahmagupta', 'brattain', 'brown', 'buck', 'burnell', 'cannon', 'carson', 'cartwright', 'carver', 'cerf', 'chandrasekhar', 'chaplygin', 'chatelet', 'chatterjee', 'chebyshev', 'cohen', 'chaum', 'clarke', 'colden', 'cori', 'cray', 'curran', 'curie', 'darwin', 'davinci', 'dewdney', 'dhawan', 'diffie', 'dijkstra', 'dirac', 'driscoll', 'dubinsky', 'easley', 'edison', 'einstein', 'elbakyan', 'elgamal', 'elion', 'ellis', 'engelbart', 'euclid', 'euler', 'faraday', 'feistel', 'fermat', 'fermi', 'feynman', 'franklin', 'gagarin', 'galileo', 'galois', 'ganguly', 'gates', 'gauss', 'germain', 'goldberg', 'goldstine', 'goldwasser', 'golick', 'goodall', 'gould', 'greider', 'grothendieck', 'haibt', 'hamilton', 'haslett', 'hawking', 'hellman', 'heisenberg', 'hermann', 'herschel', 'hertz', 'heyrovsky', 'hodgkin', 'hofstadter', 'hoover', 'hopper', 'hugle', 'hypatia', 'ishizaka', 'jackson', 'jang', 'jemison', 'jennings', 'jepsen', 'johnson', 'joliot', 'jones', 'kalam', 'kapitsa', 'kare', 'keldysh', 'keller', 'kepler', 'khayyam', 'khorana', 'kilby', 'kirch', 'knuth', 'kowalevski', 'lalande', 'lamarr', 'lamport', 'leakey', 'leavitt', 'lederberg', 'lehmann', 'lewin', 'lichterman', 'liskov', 'lovelace', 'lumiere', 'mahavira', 'margulis', 'matsumoto', 'maxwell', 'mayer', 'mccarthy', 'mcclintock', 'mclaren', 'mclean', 'mcnulty', 'mendel', 'mendeleev', 'meitner', 'meninsky', 'merkle', 'mestorf', 'mirzakhani', 'montalcini', 'moore', 'morse', 'murdock', 'moser', 'napier', 'nash', 'neumann', 'newton', 'nightingale', 'nobel', 'noether', 'northcutt', 'noyce', 'panini', 'pare', 'pascal', 'pasteur', 'payne', 'perlman', 'pike', 'poincare', 'poitras', 'proskuriakova', 'ptolemy', 'raman', 'ramanujan', 'ride', 'ritchie', 'rhodes', 'robinson', 'roentgen', 'rosalind', 'rubin', 'saha', 'sammet', 'sanderson', 'satoshi', 'shamir', 'shannon', 'shaw', 'shirley', 'shockley', 'shtern', 'sinoussi', 'snyder', 'solomon', 'spence', 'stonebraker', 'sutherland', 'swanson', 'swartz', 'swirles', 'taussig', 'tereshkova', 'tesla', 'tharp', 'thompson', 'torvalds', 'tu', 'turing', 'varahamihira', 'vaughan', 'visvesvaraya', 'volhard', 'villani', 'wescoff', 'wilbur', 'wiles', 'williams', 'williamson', 'wilson', 'wing', 'wozniak', 'wright', 'wu', 'yalow', 'yonath', 'zhukovsky']; -const randomName = function () { - let prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; - let separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '-'; - const name = `${ADJECTIVES[Math.floor(Math.random() * ADJECTIVES.length)] ?? ''}${separator}${NAMES[Math.floor(Math.random() * NAMES.length)] ?? ''}`; - if (name === `boring${separator}wozniak`) { - return randomName(prefix, separator); +const unmarshalPersistentMemory = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'PersistentMemory' failed as data isn't a dictionary.` + ); } - return prefix.length > 0 ? `${prefix}${separator}${name}` : name; + return { + capacity: data.capacity, + frequency: data.frequency, + type: data.type + }; }; - -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const unmarshalProject$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Project' failed as data isn't a dictionary.`); +const unmarshalRaidController = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'RaidController' failed as data isn't a dictionary.` + ); } return { - createdAt: unmarshalDate(data.created_at), - description: data.description, + model: data.model, + raidLevel: data.raid_level + }; +}; +const unmarshalOffer = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Offer' failed as data isn't a dictionary.` + ); + } + return { + bandwidth: data.bandwidth, + commercialRange: data.commercial_range, + cpus: marshalling.unmarshalArrayOfObject(data.cpus, unmarshalCPU), + disks: marshalling.unmarshalArrayOfObject(data.disks, unmarshalDisk), + enable: data.enable, + fee: data.fee ? customMarshalling.unmarshalMoney(data.fee) : void 0, id: data.id, + incompatibleOsIds: data.incompatible_os_ids, + maxBandwidth: data.max_bandwidth, + memories: marshalling.unmarshalArrayOfObject(data.memories, unmarshalMemory), name: data.name, - organizationId: data.organization_id, - updatedAt: unmarshalDate(data.updated_at) + operationPath: data.operation_path, + options: marshalling.unmarshalArrayOfObject(data.options, unmarshalOfferOptionOffer), + persistentMemories: marshalling.unmarshalArrayOfObject( + data.persistent_memories, + unmarshalPersistentMemory + ), + pricePerHour: data.price_per_hour ? customMarshalling.unmarshalMoney(data.price_per_hour) : void 0, + pricePerMonth: data.price_per_month ? customMarshalling.unmarshalMoney(data.price_per_month) : void 0, + privateBandwidth: data.private_bandwidth, + quotaName: data.quota_name, + raidControllers: marshalling.unmarshalArrayOfObject( + data.raid_controllers, + unmarshalRaidController + ), + sharedBandwidth: data.shared_bandwidth, + stock: data.stock, + subscriptionPeriod: data.subscription_period, + tags: data.tags }; }; -const unmarshalListProjectsResponse$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListProjectsResponse' failed as data isn't a dictionary.`); +const unmarshalOption = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Option' failed as data isn't a dictionary.` + ); } return { - projects: unmarshalArrayOfObject(data.projects, unmarshalProject$1), - totalCount: data.total_count + certification: data.certification ? unmarshalCertificationOption(data.certification) : void 0, + id: data.id, + license: data.license ? unmarshalLicenseOption(data.license) : void 0, + manageable: data.manageable, + name: data.name, + privateNetwork: data.private_network ? unmarshalPrivateNetworkOption(data.private_network) : void 0, + publicBandwidth: data.public_bandwidth ? unmarshalPublicBandwidthOption(data.public_bandwidth) : void 0, + remoteAccess: data.remote_access ? unmarshalRemoteAccessOption(data.remote_access) : void 0 }; }; -const marshalCreateProjectRequest = (request, defaults) => ({ - description: request.description, - name: request.name || randomName('proj'), - organization_id: request.organizationId ?? defaults.defaultOrganizationId -}); -const marshalUpdateProjectRequest = (request, defaults) => ({ - description: request.description, - name: request.name -}); - -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const jsonContentHeaders$s = { - 'Content-Type': 'application/json; charset=utf-8' +const unmarshalServerPrivateNetwork = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ServerPrivateNetwork' failed as data isn't a dictionary.` + ); + } + return { + createdAt: marshalling.unmarshalDate(data.created_at), + id: data.id, + privateNetworkId: data.private_network_id, + projectId: data.project_id, + serverId: data.server_id, + status: data.status, + updatedAt: marshalling.unmarshalDate(data.updated_at), + vlan: data.vlan + }; }; - -/** - * Account API. - * - * User related data. This API allows you to manage projects. - */ -let API$t = class API extends API$u { - /** - * Create a new Project for an Organization. Deprecated in favor of Account - * API v3. Generate a new Project for an Organization, specifying its - * configuration including name and description. - * - * @deprecated - * @param request - The request {@link CreateProjectRequest} - * @returns A Promise of Project - */ - createProject = (request = {}) => this.client.fetch({ - body: JSON.stringify(marshalCreateProjectRequest(request, this.client.settings)), - headers: jsonContentHeaders$s, - method: 'POST', - path: `/account/v2/projects` - }, unmarshalProject$1); - pageOfListProjects = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/account/v2/projects`, - urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_ids', request.projectIds]) - }, unmarshalListProjectsResponse$1); - - /** - * List all Projects of an Organization. Deprecated in favor of Account API - * v3. List all Projects of an Organization. The response will include the - * total number of Projects as well as their associated Organizations, names - * and IDs. Other information include the creation and update date of the - * Project. - * - * @deprecated - * @param request - The request {@link ListProjectsRequest} - * @returns A Promise of ListProjectsResponse - */ - listProjects = (request = {}) => enrichForPagination('projects', this.pageOfListProjects, request); - - /** - * Get an existing Project. Deprecated in favor of Account API v3. Retrieve - * information about an existing Project, specified by its Project ID. Its - * full details, including ID, name and description, are returned in the - * response object. - * - * @deprecated - * @param request - The request {@link GetProjectRequest} - * @returns A Promise of Project - */ - getProject = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/account/v2/projects/${validatePathParam('projectId', request.projectId ?? this.client.settings.defaultProjectId)}` - }, unmarshalProject$1); - - /** - * Delete an existing Project. Deprecated in favor of Account API v3. Delete - * an existing Project, specified by its Project ID. The Project needs to be - * empty (meaning there are no resources left in it) to be deleted - * effectively. Note that deleting a Project is permanent, and cannot be - * undone. - * - * @deprecated - * @param request - The request {@link DeleteProjectRequest} - */ - deleteProject = (request = {}) => this.client.fetch({ - method: 'DELETE', - path: `/account/v2/projects/${validatePathParam('projectId', request.projectId ?? this.client.settings.defaultProjectId)}` - }); - - /** - * Update Project. Deprecated in favor of Account API v3. Update the - * parameters of an existing Project, specified by its Project ID. These - * parameters include the name and description. - * - * @deprecated - * @param request - The request {@link UpdateProjectRequest} - * @returns A Promise of Project - */ - updateProject = (request = {}) => this.client.fetch({ - body: JSON.stringify(marshalUpdateProjectRequest(request, this.client.settings)), - headers: jsonContentHeaders$s, - method: 'PATCH', - path: `/account/v2/projects/${validatePathParam('projectId', request.projectId ?? this.client.settings.defaultProjectId)}` - }, unmarshalProject$1); +const unmarshalServerInstall = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ServerInstall' failed as data isn't a dictionary.` + ); + } + return { + hostname: data.hostname, + osId: data.os_id, + partitioningSchema: data.partitioning_schema ? unmarshalSchema(data.partitioning_schema) : void 0, + serviceUrl: data.service_url, + serviceUser: data.service_user, + sshKeyIds: data.ssh_key_ids, + status: data.status, + user: data.user + }; }; - -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. - -var index_gen$r = /*#__PURE__*/Object.freeze({ - __proto__: null, - API: API$t -}); - -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const unmarshalProject = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Project' failed as data isn't a dictionary.`); +const unmarshalServerOption = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ServerOption' failed as data isn't a dictionary.` + ); } return { - createdAt: unmarshalDate(data.created_at), - description: data.description, + certification: data.certification ? unmarshalCertificationOption(data.certification) : void 0, + expiresAt: marshalling.unmarshalDate(data.expires_at), id: data.id, + license: data.license ? unmarshalLicenseOption(data.license) : void 0, + manageable: data.manageable, name: data.name, - organizationId: data.organization_id, - updatedAt: unmarshalDate(data.updated_at) + privateNetwork: data.private_network ? unmarshalPrivateNetworkOption(data.private_network) : void 0, + publicBandwidth: data.public_bandwidth ? unmarshalPublicBandwidthOption(data.public_bandwidth) : void 0, + remoteAccess: data.remote_access ? unmarshalRemoteAccessOption(data.remote_access) : void 0, + status: data.status }; }; -const unmarshalListProjectsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListProjectsResponse' failed as data isn't a dictionary.`); +const unmarshalServerRescueServer = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ServerRescueServer' failed as data isn't a dictionary.` + ); } return { - projects: unmarshalArrayOfObject(data.projects, unmarshalProject), - totalCount: data.total_count + password: data.password, + user: data.user }; }; -const marshalProjectApiCreateProjectRequest = (request, defaults) => ({ - description: request.description, - name: request.name || randomName('proj'), - organization_id: request.organizationId ?? defaults.defaultOrganizationId -}); -const marshalProjectApiUpdateProjectRequest = (request, defaults) => ({ - description: request.description, - name: request.name -}); - -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const jsonContentHeaders$r = { - 'Content-Type': 'application/json; charset=utf-8' -}; - -/** - * Account API. - * - * This API allows you to manage projects. - */ -class ProjectAPI extends API$u { - /** - * Create a new Project for an Organization. Generate a new Project for an - * Organization, specifying its configuration including name and description. - * - * @param request - The request {@link ProjectApiCreateProjectRequest} - * @returns A Promise of Project - */ - createProject = request => this.client.fetch({ - body: JSON.stringify(marshalProjectApiCreateProjectRequest(request, this.client.settings)), - headers: jsonContentHeaders$r, - method: 'POST', - path: `/account/v3/projects` - }, unmarshalProject); - pageOfListProjects = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/account/v3/projects`, - urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_ids', request.projectIds]) - }, unmarshalListProjectsResponse); - - /** - * List all Projects of an Organization. List all Projects of an Organization. - * The response will include the total number of Projects as well as their - * associated Organizations, names, and IDs. Other information includes the - * creation and update date of the Project. - * - * @param request - The request {@link ProjectApiListProjectsRequest} - * @returns A Promise of ListProjectsResponse - */ - listProjects = (request = {}) => enrichForPagination('projects', this.pageOfListProjects, request); - - /** - * Get an existing Project. Retrieve information about an existing Project, - * specified by its Project ID. Its full details, including ID, name and - * description, are returned in the response object. - * - * @param request - The request {@link ProjectApiGetProjectRequest} - * @returns A Promise of Project - */ - getProject = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/account/v3/projects/${validatePathParam('projectId', request.projectId ?? this.client.settings.defaultProjectId)}` - }, unmarshalProject); - - /** - * Delete an existing Project. Delete an existing Project, specified by its - * Project ID. The Project needs to be empty (meaning there are no resources - * left in it) to be deleted effectively. Note that deleting a Project is - * permanent, and cannot be undone. - * - * @param request - The request {@link ProjectApiDeleteProjectRequest} - */ - deleteProject = (request = {}) => this.client.fetch({ - method: 'DELETE', - path: `/account/v3/projects/${validatePathParam('projectId', request.projectId ?? this.client.settings.defaultProjectId)}` - }); - - /** - * Update Project. Update the parameters of an existing Project, specified by - * its Project ID. These parameters include the name and description. - * - * @param request - The request {@link ProjectApiUpdateProjectRequest} - * @returns A Promise of Project - */ - updateProject = (request = {}) => this.client.fetch({ - body: JSON.stringify(marshalProjectApiUpdateProjectRequest(request, this.client.settings)), - headers: jsonContentHeaders$r, - method: 'PATCH', - path: `/account/v3/projects/${validatePathParam('projectId', request.projectId ?? this.client.settings.defaultProjectId)}` - }, unmarshalProject); -} - -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. - -const ProjectApiCreateProjectRequest = { - description: { - maxLength: 200 - }, - name: { - maxLength: 64, - minLength: 1, - pattern: /^[a-zA-Z0-9\._\- ]+$/ +const unmarshalServer = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Server' failed as data isn't a dictionary.` + ); } + return { + bootType: data.boot_type, + createdAt: marshalling.unmarshalDate(data.created_at), + description: data.description, + domain: data.domain, + id: data.id, + install: data.install ? unmarshalServerInstall(data.install) : void 0, + ips: marshalling.unmarshalArrayOfObject(data.ips, unmarshalIP), + name: data.name, + offerId: data.offer_id, + offerName: data.offer_name, + options: marshalling.unmarshalArrayOfObject(data.options, unmarshalServerOption), + organizationId: data.organization_id, + pingStatus: data.ping_status, + projectId: data.project_id, + rescueServer: data.rescue_server ? unmarshalServerRescueServer(data.rescue_server) : void 0, + status: data.status, + tags: data.tags, + updatedAt: marshalling.unmarshalDate(data.updated_at), + zone: data.zone + }; }; -const ProjectApiListProjectsRequest = { - name: { - maxLength: 64, - minLength: 1, - pattern: /^[a-zA-Z0-9\._\- ]+$/ - }, - page: { - greaterThan: 0 - }, - pageSize: { - greaterThanOrEqual: 1, - lessThanOrEqual: 100 +const unmarshalSetting = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Setting' failed as data isn't a dictionary.` + ); } + return { + enabled: data.enabled, + id: data.id, + projectId: data.project_id, + type: data.type + }; }; -const ProjectApiUpdateProjectRequest = { - description: { - maxLength: 200 - }, - name: { - maxLength: 64, - minLength: 1, - pattern: /^[a-zA-Z0-9\._\- ]+$/ +const unmarshalBMCAccess = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'BMCAccess' failed as data isn't a dictionary.` + ); } + return { + expiresAt: marshalling.unmarshalDate(data.expires_at), + login: data.login, + password: data.password, + url: data.url + }; }; - -var validationRules_gen$9 = /*#__PURE__*/Object.freeze({ - __proto__: null, - ProjectApiCreateProjectRequest: ProjectApiCreateProjectRequest, - ProjectApiListProjectsRequest: ProjectApiListProjectsRequest, - ProjectApiUpdateProjectRequest: ProjectApiUpdateProjectRequest -}); - -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. - -var index_gen$q = /*#__PURE__*/Object.freeze({ - __proto__: null, - ProjectAPI: ProjectAPI, - ValidationRules: validationRules_gen$9 -}); - -var index$v = /*#__PURE__*/Object.freeze({ - __proto__: null, - v2: index_gen$r, - v3: index_gen$q -}); - -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. - -/** Lists transient statutes of the enum {@link ServerStatus}. */ -const SERVER_TRANSIENT_STATUSES$2 = ['starting', 'rebooting', 'updating', 'locking', 'unlocking', 'reinstalling']; - -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const unmarshalServerTypeCPU = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ServerTypeCPU' failed as data isn't a dictionary.`); +const unmarshalGetServerMetricsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'GetServerMetricsResponse' failed as data isn't a dictionary.` + ); } return { - coreCount: data.core_count, - name: data.name + pings: data.pings ? customMarshalling.unmarshalTimeSeries(data.pings) : void 0 }; }; -const unmarshalServerTypeDisk = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ServerTypeDisk' failed as data isn't a dictionary.`); +const unmarshalListOSResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListOSResponse' failed as data isn't a dictionary.` + ); } return { - capacity: data.capacity, - type: data.type + os: marshalling.unmarshalArrayOfObject(data.os, unmarshalOS), + totalCount: data.total_count }; }; -const unmarshalServerTypeMemory = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ServerTypeMemory' failed as data isn't a dictionary.`); +const unmarshalListOffersResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListOffersResponse' failed as data isn't a dictionary.` + ); } return { - capacity: data.capacity, - type: data.type + offers: marshalling.unmarshalArrayOfObject(data.offers, unmarshalOffer), + totalCount: data.total_count }; }; -const unmarshalOS$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'OS' failed as data isn't a dictionary.`); +const unmarshalListOptionsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListOptionsResponse' failed as data isn't a dictionary.` + ); } return { - compatibleServerTypes: data.compatible_server_types, - id: data.id, - imageUrl: data.image_url, - label: data.label, - name: data.name + options: marshalling.unmarshalArrayOfObject(data.options, unmarshalOption), + totalCount: data.total_count }; }; -const unmarshalServer$2 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Server' failed as data isn't a dictionary.`); +const unmarshalServerEvent = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ServerEvent' failed as data isn't a dictionary.` + ); } return { - createdAt: unmarshalDate(data.created_at), - deletableAt: unmarshalDate(data.deletable_at), + action: data.action, + createdAt: marshalling.unmarshalDate(data.created_at), id: data.id, - ip: data.ip, - name: data.name, - organizationId: data.organization_id, - projectId: data.project_id, - status: data.status, - type: data.type, - updatedAt: unmarshalDate(data.updated_at), - vncUrl: data.vnc_url, - zone: data.zone + updatedAt: marshalling.unmarshalDate(data.updated_at) }; }; -const unmarshalServerType$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ServerType' failed as data isn't a dictionary.`); +const unmarshalListServerEventsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListServerEventsResponse' failed as data isn't a dictionary.` + ); } return { - cpu: data.cpu ? unmarshalServerTypeCPU(data.cpu) : undefined, - disk: data.disk ? unmarshalServerTypeDisk(data.disk) : undefined, - memory: data.memory ? unmarshalServerTypeMemory(data.memory) : undefined, - minimumLeaseDuration: data.minimum_lease_duration, - name: data.name, - stock: data.stock + events: marshalling.unmarshalArrayOfObject(data.events, unmarshalServerEvent), + totalCount: data.total_count }; }; -const unmarshalListOSResponse$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListOSResponse' failed as data isn't a dictionary.`); +const unmarshalListServerPrivateNetworksResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListServerPrivateNetworksResponse' failed as data isn't a dictionary.` + ); } return { - os: unmarshalArrayOfObject(data.os, unmarshalOS$1), + serverPrivateNetworks: marshalling.unmarshalArrayOfObject( + data.server_private_networks, + unmarshalServerPrivateNetwork + ), totalCount: data.total_count }; }; -const unmarshalListServerTypesResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListServerTypesResponse' failed as data isn't a dictionary.`); +const unmarshalListServersResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListServersResponse' failed as data isn't a dictionary.` + ); } return { - serverTypes: unmarshalArrayOfObject(data.server_types, unmarshalServerType$1) + servers: marshalling.unmarshalArrayOfObject(data.servers, unmarshalServer), + totalCount: data.total_count }; }; -const unmarshalListServersResponse$2 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListServersResponse' failed as data isn't a dictionary.`); +const unmarshalListSettingsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListSettingsResponse' failed as data isn't a dictionary.` + ); } return { - servers: unmarshalArrayOfObject(data.servers, unmarshalServer$2), + settings: marshalling.unmarshalArrayOfObject(data.settings, unmarshalSetting), totalCount: data.total_count }; }; -const marshalCreateServerRequest$2 = (request, defaults) => ({ - name: request.name || randomName('as'), - project_id: request.projectId ?? defaults.defaultProjectId, - type: request.type -}); -const marshalUpdateServerRequest$2 = (request, defaults) => ({ - name: request.name -}); - -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const jsonContentHeaders$q = { - 'Content-Type': 'application/json; charset=utf-8' +const unmarshalSetServerPrivateNetworksResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SetServerPrivateNetworksResponse' failed as data isn't a dictionary.` + ); + } + return { + serverPrivateNetworks: marshalling.unmarshalArrayOfObject( + data.server_private_networks, + unmarshalServerPrivateNetwork + ) + }; }; +const marshalAddOptionServerRequest = (request, defaults) => ({ + expires_at: request.expiresAt +}); +const marshalSchemaPartition = (request, defaults) => ({ + label: request.label, + number: request.number, + size: request.size +}); +const marshalSchemaPool = (request, defaults) => ({ + devices: request.devices, + filesystem_options: request.filesystemOptions, + name: request.name, + options: request.options, + type: request.type +}); +const marshalSchemaDisk = (request, defaults) => ({ + device: request.device, + partitions: request.partitions.map( + (elt) => marshalSchemaPartition(elt) + ) +}); +const marshalSchemaFilesystem = (request, defaults) => ({ + device: request.device, + format: request.format, + mountpoint: request.mountpoint +}); +const marshalSchemaRAID = (request, defaults) => ({ + devices: request.devices, + level: request.level, + name: request.name +}); +const marshalSchemaZFS = (request, defaults) => ({ + pools: request.pools.map((elt) => marshalSchemaPool(elt)) +}); +const marshalSchema = (request, defaults) => ({ + disks: request.disks.map((elt) => marshalSchemaDisk(elt)), + filesystems: request.filesystems.map( + (elt) => marshalSchemaFilesystem(elt) + ), + raids: request.raids.map((elt) => marshalSchemaRAID(elt)), + zfs: request.zfs !== void 0 ? marshalSchemaZFS(request.zfs) : void 0 +}); +const marshalCreateServerRequestInstall = (request, defaults) => ({ + hostname: request.hostname, + os_id: request.osId, + partitioning_schema: request.partitioningSchema !== void 0 ? marshalSchema(request.partitioningSchema) : void 0, + password: request.password, + service_password: request.servicePassword, + service_user: request.serviceUser, + ssh_key_ids: request.sshKeyIds, + user: request.user +}); +const marshalCreateServerRequest = (request, defaults) => ({ + description: request.description, + install: request.install !== void 0 ? marshalCreateServerRequestInstall(request.install) : void 0, + name: request.name, + offer_id: request.offerId, + option_ids: request.optionIds, + tags: request.tags, + ...marshalling.resolveOneOf([ + { + default: defaults.defaultProjectId, + param: "project_id", + value: request.projectId + }, + { + default: defaults.defaultOrganizationId, + param: "organization_id", + value: request.organizationId + } + ]) +}); +const marshalInstallServerRequest = (request, defaults) => ({ + hostname: request.hostname, + os_id: request.osId, + partitioning_schema: request.partitioningSchema !== void 0 ? marshalSchema(request.partitioningSchema) : void 0, + password: request.password, + service_password: request.servicePassword, + service_user: request.serviceUser, + ssh_key_ids: request.sshKeyIds, + user: request.user +}); +const marshalPrivateNetworkApiAddServerPrivateNetworkRequest = (request, defaults) => ({ + private_network_id: request.privateNetworkId +}); +const marshalPrivateNetworkApiSetServerPrivateNetworksRequest = (request, defaults) => ({ + private_network_ids: request.privateNetworkIds +}); +const marshalRebootServerRequest = (request, defaults) => ({ + boot_type: request.bootType +}); +const marshalStartBMCAccessRequest = (request, defaults) => ({ + ip: request.ip +}); +const marshalStartServerRequest = (request, defaults) => ({ + boot_type: request.bootType +}); +const marshalUpdateIPRequest = (request, defaults) => ({ + reverse: request.reverse +}); +const marshalUpdateServerRequest = (request, defaults) => ({ + description: request.description, + name: request.name, + tags: request.tags +}); +const marshalUpdateSettingRequest = (request, defaults) => ({ + enabled: request.enabled +}); +const marshalValidatePartitioningSchemaRequest = (request, defaults) => ({ + offer_id: request.offerId, + os_id: request.osId, + partitioning_schema: request.partitioningSchema !== void 0 ? marshalSchema(request.partitioningSchema) : void 0 +}); +exports.marshalAddOptionServerRequest = marshalAddOptionServerRequest; +exports.marshalCreateServerRequest = marshalCreateServerRequest; +exports.marshalInstallServerRequest = marshalInstallServerRequest; +exports.marshalPrivateNetworkApiAddServerPrivateNetworkRequest = marshalPrivateNetworkApiAddServerPrivateNetworkRequest; +exports.marshalPrivateNetworkApiSetServerPrivateNetworksRequest = marshalPrivateNetworkApiSetServerPrivateNetworksRequest; +exports.marshalRebootServerRequest = marshalRebootServerRequest; +exports.marshalSchema = marshalSchema; +exports.marshalStartBMCAccessRequest = marshalStartBMCAccessRequest; +exports.marshalStartServerRequest = marshalStartServerRequest; +exports.marshalUpdateIPRequest = marshalUpdateIPRequest; +exports.marshalUpdateServerRequest = marshalUpdateServerRequest; +exports.marshalUpdateSettingRequest = marshalUpdateSettingRequest; +exports.marshalValidatePartitioningSchemaRequest = marshalValidatePartitioningSchemaRequest; +exports.unmarshalBMCAccess = unmarshalBMCAccess; +exports.unmarshalGetServerMetricsResponse = unmarshalGetServerMetricsResponse; +exports.unmarshalIP = unmarshalIP; +exports.unmarshalListOSResponse = unmarshalListOSResponse; +exports.unmarshalListOffersResponse = unmarshalListOffersResponse; +exports.unmarshalListOptionsResponse = unmarshalListOptionsResponse; +exports.unmarshalListServerEventsResponse = unmarshalListServerEventsResponse; +exports.unmarshalListServerPrivateNetworksResponse = unmarshalListServerPrivateNetworksResponse; +exports.unmarshalListServersResponse = unmarshalListServersResponse; +exports.unmarshalListSettingsResponse = unmarshalListSettingsResponse; +exports.unmarshalOS = unmarshalOS; +exports.unmarshalOffer = unmarshalOffer; +exports.unmarshalOption = unmarshalOption; +exports.unmarshalSchema = unmarshalSchema; +exports.unmarshalServer = unmarshalServer; +exports.unmarshalServerPrivateNetwork = unmarshalServerPrivateNetwork; +exports.unmarshalSetServerPrivateNetworksResponse = unmarshalSetServerPrivateNetworksResponse; +exports.unmarshalSetting = unmarshalSetting; -/** Apple silicon API. */ -let API$s = class API extends API$u { - /** Lists the available zones of the API. */ - static LOCALITIES = ['fr-par-3']; - /** - * List server types. List all technical details about Apple silicon server - * types available in the specified zone. Since there is only one Availability - * Zone for Apple silicon servers, the targeted value is `fr-par-3`. - * - * @param request - The request {@link ListServerTypesRequest} - * @returns A Promise of ListServerTypesResponse - */ - listServerTypes = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/server-types` - }, unmarshalListServerTypesResponse); +/***/ }), - /** - * Get a server type. Get technical details (CPU, disk size etc.) of a server - * type. - * - * @param request - The request {@link GetServerTypeRequest} - * @returns A Promise of ServerType - */ - getServerType = request => this.client.fetch({ - method: 'GET', - path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/server-type/${validatePathParam('serverType', request.serverType)}` - }, unmarshalServerType$1); +/***/ 4306: +/***/ ((__unused_webpack_module, exports) => { - /** - * Create a server. Create a new server in the targeted zone, specifying its - * configuration including name and type. - * - * @param request - The request {@link CreateServerRequest} - * @returns A Promise of Server - */ - createServer = request => this.client.fetch({ - body: JSON.stringify(marshalCreateServerRequest$2(request, this.client.settings)), - headers: jsonContentHeaders$q, - method: 'POST', - path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers` - }, unmarshalServer$2); - pageOfListServers = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers`, - urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId]) - }, unmarshalListServersResponse$2); +"use strict"; - /** - * List all servers. List all servers in the specified zone. By default, - * returned servers in the list are ordered by creation date in ascending - * order, though this can be modified via the `order_by` field. - * - * @param request - The request {@link ListServersRequest} - * @returns A Promise of ListServersResponse - */ - listServers = (request = {}) => enrichForPagination('servers', this.pageOfListServers, request); - pageOfListOS = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/os`, - urlParams: urlParams(['name', request.name], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['server_type', request.serverType]) - }, unmarshalListOSResponse$1); +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const CreateServerRequest = { + description: { + maxLength: 255 + }, + name: { + minLength: 1 + } +}; +const CreateServerRequestInstall = { + hostname: { + maxLength: 255 + }, + password: { + maxLength: 255 + }, + servicePassword: { + maxLength: 255 + }, + serviceUser: { + maxLength: 255 + }, + user: { + maxLength: 255 + } +}; +const InstallServerRequest = { + hostname: { + maxLength: 255 + }, + password: { + maxLength: 255 + }, + servicePassword: { + maxLength: 255 + }, + serviceUser: { + maxLength: 255 + }, + user: { + maxLength: 255 + } +}; +const ListOSRequest = { + page: { + greaterThan: 0 + }, + pageSize: { + greaterThan: 0, + lessThanOrEqual: 100 + } +}; +const ListOffersRequest = { + page: { + greaterThan: 0 + }, + pageSize: { + greaterThan: 0, + lessThanOrEqual: 100 + } +}; +const ListOptionsRequest = { + page: { + greaterThan: 0 + }, + pageSize: { + greaterThan: 0, + lessThanOrEqual: 100 + } +}; +const ListServerEventsRequest = { + page: { + greaterThan: 0 + }, + pageSize: { + greaterThan: 0, + lessThanOrEqual: 100 + } +}; +const ListServersRequest = { + page: { + greaterThan: 0 + }, + pageSize: { + greaterThan: 0, + lessThanOrEqual: 100 + } +}; +const ListSettingsRequest = { + page: { + greaterThan: 0 + }, + pageSize: { + greaterThan: 0, + lessThanOrEqual: 100 + } +}; +const UpdateServerRequest = { + description: { + maxLength: 255 + }, + name: { + maxLength: 255 + } +}; +exports.CreateServerRequest = CreateServerRequest; +exports.CreateServerRequestInstall = CreateServerRequestInstall; +exports.InstallServerRequest = InstallServerRequest; +exports.ListOSRequest = ListOSRequest; +exports.ListOffersRequest = ListOffersRequest; +exports.ListOptionsRequest = ListOptionsRequest; +exports.ListServerEventsRequest = ListServerEventsRequest; +exports.ListServersRequest = ListServersRequest; +exports.ListSettingsRequest = ListSettingsRequest; +exports.UpdateServerRequest = UpdateServerRequest; - /** - * List all Operating Systems (OS). List all Operating Systems (OS). The - * response will include the total number of OS as well as their associated - * IDs, names and labels. + +/***/ }), + +/***/ 6197: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api = __nccwpck_require__(3042); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const resourcePaginator = __nccwpck_require__(4983); +const marshalling_gen = __nccwpck_require__(4547); +const jsonContentHeaders = { + "Content-Type": "application/json; charset=utf-8" +}; +class PrivateNetworkAPI extends api.API { + /** Lists the available zones of the API. */ + static LOCALITIES = [ + "fr-par-1", + "fr-par-2", + "nl-ams-1", + "nl-ams-2", + "pl-waw-2", + "pl-waw-3" + ]; + /** + * Add a server to a Private Network. Add an Elastic Metal server to a Private + * Network. * - * @param request - The request {@link ListOSRequest} - * @returns A Promise of ListOSResponse + * @param request - The request + * {@link PrivateNetworkApiAddServerPrivateNetworkRequest} + * @returns A Promise of ServerPrivateNetwork */ - listOS = (request = {}) => enrichForPagination('os', this.pageOfListOS, request); - + addServerPrivateNetwork = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalPrivateNetworkApiAddServerPrivateNetworkRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/baremetal/v3/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/private-networks` + }, + marshalling_gen.unmarshalServerPrivateNetwork + ); /** - * Get an Operating System (OS). Get an Operating System (OS). The response - * will include the OS's unique ID as well as its name and label. + * Set multiple Private Networks on a server. Configure multiple Private + * Networks on an Elastic Metal server. * - * @param request - The request {@link GetOSRequest} - * @returns A Promise of OS + * @param request - The request + * {@link PrivateNetworkApiSetServerPrivateNetworksRequest} + * @returns A Promise of SetServerPrivateNetworksResponse */ - getOS = request => this.client.fetch({ - method: 'GET', - path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/os/${validatePathParam('osId', request.osId)}` - }, unmarshalOS$1); - + setServerPrivateNetworks = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalPrivateNetworkApiSetServerPrivateNetworksRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "PUT", + path: `/baremetal/v3/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/private-networks` + }, + marshalling_gen.unmarshalSetServerPrivateNetworksResponse + ); + pageOfListServerPrivateNetworks = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/baremetal/v3/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/server-private-networks`, + urlParams: marshalling.urlParams( + ["ipam_ip_ids", request.ipamIpIds], + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["private_network_id", request.privateNetworkId], + ["project_id", request.projectId], + ["server_id", request.serverId] + ) + }, + marshalling_gen.unmarshalListServerPrivateNetworksResponse + ); /** - * Get a server. Retrieve information about an existing Apple silicon server, - * specified by its server ID. Its full details, including name, status and IP - * address, are returned in the response object. + * List the Private Networks of a server. List the Private Networks of an + * Elastic Metal server. * - * @param request - The request {@link GetServerRequest} - * @returns A Promise of Server + * @param request - The request + * {@link PrivateNetworkApiListServerPrivateNetworksRequest} + * @returns A Promise of ListServerPrivateNetworksResponse */ - getServer = request => this.client.fetch({ - method: 'GET', - path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}` - }, unmarshalServer$2); - + listServerPrivateNetworks = (request = {}) => resourcePaginator.enrichForPagination( + "serverPrivateNetworks", + this.pageOfListServerPrivateNetworks, + request + ); /** - * Waits for {@link Server} to be in a final state. + * Delete a Private Network. * - * @param request - The request {@link GetServerRequest} - * @param options - The waiting options - * @returns A Promise of Server + * @param request - The request + * {@link PrivateNetworkApiDeleteServerPrivateNetworkRequest} */ - waitForServer = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!SERVER_TRANSIENT_STATUSES$2.includes(res.status))), this.getServer, request, options); - + deleteServerPrivateNetwork = (request) => this.client.fetch({ + method: "DELETE", + path: `/baremetal/v3/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/private-networks/${marshalling.validatePathParam("privateNetworkId", request.privateNetworkId)}` + }); +} +exports.PrivateNetworkAPI = PrivateNetworkAPI; + + +/***/ }), + +/***/ 5746: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES = ["attaching", "detaching"]; +exports.SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES = SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES; + + +/***/ }), + +/***/ 9513: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api_gen = __nccwpck_require__(6197); +const content_gen = __nccwpck_require__(5746); +exports.PrivateNetworkAPI = api_gen.PrivateNetworkAPI; +exports.SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES = content_gen.SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES; + + +/***/ }), + +/***/ 4547: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const json = __nccwpck_require__(3746); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const unmarshalServerPrivateNetwork = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ServerPrivateNetwork' failed as data isn't a dictionary.` + ); + } + return { + createdAt: marshalling.unmarshalDate(data.created_at), + id: data.id, + ipamIpIds: data.ipam_ip_ids, + privateNetworkId: data.private_network_id, + projectId: data.project_id, + serverId: data.server_id, + status: data.status, + updatedAt: marshalling.unmarshalDate(data.updated_at), + vlan: data.vlan + }; +}; +const unmarshalListServerPrivateNetworksResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListServerPrivateNetworksResponse' failed as data isn't a dictionary.` + ); + } + return { + serverPrivateNetworks: marshalling.unmarshalArrayOfObject( + data.server_private_networks, + unmarshalServerPrivateNetwork + ), + totalCount: data.total_count + }; +}; +const unmarshalSetServerPrivateNetworksResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SetServerPrivateNetworksResponse' failed as data isn't a dictionary.` + ); + } + return { + serverPrivateNetworks: marshalling.unmarshalArrayOfObject( + data.server_private_networks, + unmarshalServerPrivateNetwork + ) + }; +}; +const marshalPrivateNetworkApiAddServerPrivateNetworkRequest = (request, defaults) => ({ + ipam_ip_ids: request.ipamIpIds, + private_network_id: request.privateNetworkId +}); +const marshalPrivateNetworkApiSetServerPrivateNetworksRequest = (request, defaults) => ({ + per_private_network_ipam_ip_ids: request.perPrivateNetworkIpamIpIds +}); +exports.marshalPrivateNetworkApiAddServerPrivateNetworkRequest = marshalPrivateNetworkApiAddServerPrivateNetworkRequest; +exports.marshalPrivateNetworkApiSetServerPrivateNetworksRequest = marshalPrivateNetworkApiSetServerPrivateNetworksRequest; +exports.unmarshalListServerPrivateNetworksResponse = unmarshalListServerPrivateNetworksResponse; +exports.unmarshalServerPrivateNetwork = unmarshalServerPrivateNetwork; +exports.unmarshalSetServerPrivateNetworksResponse = unmarshalSetServerPrivateNetworksResponse; + + +/***/ }), + +/***/ 1567: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const index_gen = __nccwpck_require__(3121); +const index_gen$1 = __nccwpck_require__(7133); +exports.v2alpha1 = index_gen; +exports.v2beta1 = index_gen$1; + + +/***/ }), + +/***/ 1293: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api = __nccwpck_require__(3042); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const resourcePaginator = __nccwpck_require__(4983); +const marshalling_gen = __nccwpck_require__(1051); +class API extends api.API { /** - * Update a server. Update the parameters of an existing Apple silicon server, - * specified by its server ID. + * Get current month's consumption. The consumption reflects the amount of + * money you have spent for the products you have used. The consumption value + * is monetary and is not computed in real time. * - * @param request - The request {@link UpdateServerRequest} - * @returns A Promise of Server + * @param request - The request {@link GetConsumptionRequest} + * @returns A Promise of GetConsumptionResponse */ - updateServer = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateServerRequest$2(request, this.client.settings)), - headers: jsonContentHeaders$q, - method: 'PATCH', - path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}` - }, unmarshalServer$2); - + getConsumption = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/billing/v2alpha1/consumption`, + urlParams: marshalling.urlParams([ + "organization_id", + request.organizationId ?? this.client.settings.defaultOrganizationId + ]) + }, + marshalling_gen.unmarshalGetConsumptionResponse + ); + pageOfListInvoices = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/billing/v2alpha1/invoices`, + urlParams: marshalling.urlParams( + ["invoice_type", request.invoiceType], + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["started_after", request.startedAfter], + ["started_before", request.startedBefore] + ) + }, + marshalling_gen.unmarshalListInvoicesResponse + ); /** - * Delete a server. Delete an existing Apple silicon server, specified by its - * server ID. Deleting a server is permanent, and cannot be undone. Note that - * the minimum allocation period for Apple silicon-as-a-service is 24 hours, - * meaning you cannot delete your server prior to that. + * List invoices. List all your invoices, filtering by `start_date` and + * `invoice_type`. Each invoice has its own ID. * - * @param request - The request {@link DeleteServerRequest} + * @param request - The request {@link ListInvoicesRequest} + * @returns A Promise of ListInvoicesResponse */ - deleteServer = request => this.client.fetch({ - method: 'DELETE', - path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}` - }); - + listInvoices = (request = {}) => resourcePaginator.enrichForPagination("invoices", this.pageOfListInvoices, request); /** - * Reboot a server. Reboot an existing Apple silicon server, specified by its - * server ID. + * Download an invoice. Download a specific invoice, specified by its ID. * - * @param request - The request {@link RebootServerRequest} - * @returns A Promise of Server + * @param request - The request {@link DownloadInvoiceRequest} + * @returns A Promise of Blob */ - rebootServer = request => this.client.fetch({ - body: '{}', - headers: jsonContentHeaders$q, - method: 'POST', - path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/reboot` - }, unmarshalServer$2); - + downloadInvoice = (request) => this.client.fetch({ + method: "GET", + path: `/billing/v2alpha1/invoices/${marshalling.validatePathParam("invoiceId", request.invoiceId)}/download`, + urlParams: marshalling.urlParams(["dl", 1], ["file_type", request.fileType]), + responseType: "blob" + }); + pageOfListDiscounts = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/billing/v2alpha1/discounts`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListDiscountsResponse + ); /** - * Reinstall a server. Reinstall an existing Apple silicon server (specified - * by its server ID) from a new image (OS). All the data on the disk is - * deleted and all configuration is reset to the defailt configuration values - * of the image (OS). + * List all user's discounts. List all discounts for an organization and + * usable categories/products/offers/references/regions/zones where the + * discount can be applied. * - * @param request - The request {@link ReinstallServerRequest} - * @returns A Promise of Server + * @param request - The request {@link ListDiscountsRequest} + * @returns A Promise of ListDiscountsResponse */ - reinstallServer = request => this.client.fetch({ - body: '{}', - headers: jsonContentHeaders$q, - method: 'POST', - path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/reinstall` - }, unmarshalServer$2); -}; + listDiscounts = (request = {}) => resourcePaginator.enrichForPagination("discounts", this.pageOfListDiscounts, request); +} +exports.API = API; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -var index_gen$p = /*#__PURE__*/Object.freeze({ - __proto__: null, - API: API$s, - SERVER_TRANSIENT_STATUSES: SERVER_TRANSIENT_STATUSES$2 -}); +/***/ }), -var index$u = /*#__PURE__*/Object.freeze({ - __proto__: null, - v1alpha1: index_gen$p -}); +/***/ 3121: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api_gen = __nccwpck_require__(1293); +exports.API = api_gen.API; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -/** Lists transient statutes of the enum {@link ServerInstallStatus}. */ -const SERVER_INSTALL_TRANSIENT_STATUSES = ['to_install', 'installing']; +/***/ }), -/** Lists transient statutes of the enum {@link ServerPrivateNetworkStatus}. */ -const SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES = ['attaching', 'detaching']; +/***/ 1051: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/** Lists transient statutes of the enum {@link ServerStatus}. */ -const SERVER_TRANSIENT_STATUSES$1 = ['delivering', 'stopping', 'starting', 'deleting', 'ordered', 'resetting']; +"use strict"; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const unmarshalCPU = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'CPU' failed as data isn't a dictionary.`); +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const json = __nccwpck_require__(3746); +const customMarshalling = __nccwpck_require__(7586); +const marshalling = __nccwpck_require__(1162); +const unmarshalGetConsumptionResponseConsumption = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'GetConsumptionResponseConsumption' failed as data isn't a dictionary.` + ); } return { - benchmark: data.benchmark, - coreCount: data.core_count, - frequency: data.frequency, - name: data.name, - threadCount: data.thread_count + category: data.category, + description: data.description, + operationPath: data.operation_path, + projectId: data.project_id, + value: data.value ? customMarshalling.unmarshalMoney(data.value) : void 0 }; }; -const unmarshalDisk = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Disk' failed as data isn't a dictionary.`); +const unmarshalGetConsumptionResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'GetConsumptionResponse' failed as data isn't a dictionary.` + ); } return { - capacity: data.capacity, - type: data.type + consumptions: marshalling.unmarshalArrayOfObject( + data.consumptions, + unmarshalGetConsumptionResponseConsumption + ), + updatedAt: marshalling.unmarshalDate(data.updated_at) }; }; -const unmarshalIP$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'IP' failed as data isn't a dictionary.`); +const unmarshalDiscountCoupon = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DiscountCoupon' failed as data isn't a dictionary.` + ); } return { - address: data.address, - id: data.id, - reverse: data.reverse, - reverseStatus: data.reverse_status, - reverseStatusMessage: data.reverse_status_message, - version: data.version + description: data.description }; }; -const unmarshalMemory = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Memory' failed as data isn't a dictionary.`); +const unmarshalDiscountFilter = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DiscountFilter' failed as data isn't a dictionary.` + ); } return { - capacity: data.capacity, - frequency: data.frequency, - isEcc: data.is_ecc, - type: data.type + exclude: data.exclude, + type: data.type, + value: data.value }; }; -const unmarshalOSOSField = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'OSOSField' failed as data isn't a dictionary.`); +const unmarshalDiscount = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Discount' failed as data isn't a dictionary.` + ); } return { - defaultValue: data.default_value, - editable: data.editable, - required: data.required + coupon: data.coupon ? unmarshalDiscountCoupon(data.coupon) : void 0, + creationDate: marshalling.unmarshalDate(data.creation_date), + description: data.description, + filters: marshalling.unmarshalArrayOfObject(data.filters, unmarshalDiscountFilter), + id: data.id, + mode: data.mode, + organizationId: data.organization_id, + startDate: marshalling.unmarshalDate(data.start_date), + stopDate: marshalling.unmarshalDate(data.stop_date), + value: data.value, + valueRemaining: data.value_remaining, + valueUsed: data.value_used }; }; -const unmarshalOfferOptionOffer = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'OfferOptionOffer' failed as data isn't a dictionary.`); +const unmarshalListDiscountsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListDiscountsResponse' failed as data isn't a dictionary.` + ); } return { - enabled: data.enabled, + discounts: marshalling.unmarshalArrayOfObject(data.discounts, unmarshalDiscount), + totalCount: data.total_count + }; +}; +const unmarshalInvoice = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Invoice' failed as data isn't a dictionary.` + ); + } + return { + dueDate: marshalling.unmarshalDate(data.due_date), id: data.id, - manageable: data.manageable, - name: data.name, - osId: data.os_id, - price: data.price ? unmarshalMoney(data.price) : undefined, - subscriptionPeriod: data.subscription_period + invoiceType: data.invoice_type, + issuedDate: marshalling.unmarshalDate(data.issued_date), + number: data.number, + startDate: marshalling.unmarshalDate(data.start_date), + totalTaxed: data.total_taxed ? customMarshalling.unmarshalMoney(data.total_taxed) : void 0, + totalUntaxed: data.total_untaxed ? customMarshalling.unmarshalMoney(data.total_untaxed) : void 0 }; }; -const unmarshalPersistentMemory = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'PersistentMemory' failed as data isn't a dictionary.`); +const unmarshalListInvoicesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListInvoicesResponse' failed as data isn't a dictionary.` + ); } return { - capacity: data.capacity, - frequency: data.frequency, + invoices: marshalling.unmarshalArrayOfObject(data.invoices, unmarshalInvoice), + totalCount: data.total_count + }; +}; +exports.unmarshalGetConsumptionResponse = unmarshalGetConsumptionResponse; +exports.unmarshalListDiscountsResponse = unmarshalListDiscountsResponse; +exports.unmarshalListInvoicesResponse = unmarshalListInvoicesResponse; + + +/***/ }), + +/***/ 7729: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api = __nccwpck_require__(3042); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const resourcePaginator = __nccwpck_require__(4983); +const marshalling_gen = __nccwpck_require__(1719); +class API extends api.API { + pageOfListConsumptions = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/billing/v2beta1/consumptions`, + urlParams: marshalling.urlParams( + ["billing_period", request.billingPeriod], + ["category_name", request.categoryName], + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ...Object.entries( + marshalling.resolveOneOf([ + { + default: this.client.settings.defaultOrganizationId, + param: "organization_id", + value: request.organizationId + }, + { + default: this.client.settings.defaultProjectId, + param: "project_id", + value: request.projectId + } + ]) + ) + ) + }, + marshalling_gen.unmarshalListConsumptionsResponse + ); + /** + * Get monthly consumption. Consumption allows you to retrieve your past or + * current consumption cost, by project or category. + * + * @param request - The request {@link ListConsumptionsRequest} + * @returns A Promise of ListConsumptionsResponse + */ + listConsumptions = (request = {}) => resourcePaginator.enrichForPagination("consumptions", this.pageOfListConsumptions, request); + pageOfListTaxes = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/billing/v2beta1/taxes`, + urlParams: marshalling.urlParams( + ["billing_period", request.billingPeriod], + ["order_by", request.orderBy], + [ + "organization_id", + request.organizationId ?? this.client.settings.defaultOrganizationId + ], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListTaxesResponse + ); + /** + * Get monthly consumption taxes. Consumption Tax allows you to retrieve your + * past or current tax charges, by project or category. + * + * @param request - The request {@link ListTaxesRequest} + * @returns A Promise of ListTaxesResponse + */ + listTaxes = (request = {}) => resourcePaginator.enrichForPagination("taxes", this.pageOfListTaxes, request); + pageOfListInvoices = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/billing/v2beta1/invoices`, + urlParams: marshalling.urlParams( + ["billing_period_start_after", request.billingPeriodStartAfter], + ["billing_period_start_before", request.billingPeriodStartBefore], + ["invoice_type", request.invoiceType], + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListInvoicesResponse + ); + /** + * List invoices. List all your invoices, filtering by `start_date` and + * `invoice_type`. Each invoice has its own ID. + * + * @param request - The request {@link ListInvoicesRequest} + * @returns A Promise of ListInvoicesResponse + */ + listInvoices = (request = {}) => resourcePaginator.enrichForPagination("invoices", this.pageOfListInvoices, request); + /** + * Export invoices. Export invoices in a CSV file. + * + * @param request - The request {@link ExportInvoicesRequest} + * @returns A Promise of Blob + */ + exportInvoices = (request = {}) => this.client.fetch({ + method: "GET", + path: `/billing/v2beta1/export-invoices`, + urlParams: marshalling.urlParams( + ["dl", 1], + ["billing_period_start_after", request.billingPeriodStartAfter], + ["billing_period_start_before", request.billingPeriodStartBefore], + ["file_type", request.fileType], + ["invoice_type", request.invoiceType], + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + ["page_size", request.pageSize ?? this.client.settings.defaultPageSize] + ), + responseType: "blob" + }); + /** + * Get an invoice. Get a specific invoice, specified by its ID. + * + * @param request - The request {@link GetInvoiceRequest} + * @returns A Promise of Invoice + */ + getInvoice = (request) => this.client.fetch( + { + method: "GET", + path: `/billing/v2beta1/invoices/${marshalling.validatePathParam("invoiceId", request.invoiceId)}` + }, + marshalling_gen.unmarshalInvoice + ); + /** + * Download an invoice. Download a specific invoice, specified by its ID. + * + * @param request - The request {@link DownloadInvoiceRequest} + * @returns A Promise of Blob + */ + downloadInvoice = (request) => this.client.fetch({ + method: "GET", + path: `/billing/v2beta1/invoices/${marshalling.validatePathParam("invoiceId", request.invoiceId)}/download`, + urlParams: marshalling.urlParams(["dl", 1], ["file_type", request.fileType]), + responseType: "blob" + }); + pageOfListDiscounts = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/billing/v2beta1/discounts`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListDiscountsResponse + ); + /** + * List discounts. List all discounts for your organization and usable + * categories, products, offers, references, regions and zones where the + * discount can be applied. + * + * @param request - The request {@link ListDiscountsRequest} + * @returns A Promise of ListDiscountsResponse + */ + listDiscounts = (request = {}) => resourcePaginator.enrichForPagination("discounts", this.pageOfListDiscounts, request); +} +exports.API = API; + + +/***/ }), + +/***/ 7133: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api_gen = __nccwpck_require__(7729); +exports.API = api_gen.API; + + +/***/ }), + +/***/ 1719: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const json = __nccwpck_require__(3746); +const customMarshalling = __nccwpck_require__(7586); +const marshalling = __nccwpck_require__(1162); +const unmarshalInvoice = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Invoice' failed as data isn't a dictionary.` + ); + } + return { + billingPeriod: marshalling.unmarshalDate(data.billing_period), + dueDate: marshalling.unmarshalDate(data.due_date), + id: data.id, + issuedDate: marshalling.unmarshalDate(data.issued_date), + number: data.number, + organizationId: data.organization_id, + organizationName: data.organization_name, + sellerName: data.seller_name, + startDate: marshalling.unmarshalDate(data.start_date), + state: data.state, + stopDate: marshalling.unmarshalDate(data.stop_date), + totalDiscount: data.total_discount ? customMarshalling.unmarshalMoney(data.total_discount) : void 0, + totalTax: data.total_tax ? customMarshalling.unmarshalMoney(data.total_tax) : void 0, + totalTaxed: data.total_taxed ? customMarshalling.unmarshalMoney(data.total_taxed) : void 0, + totalUndiscount: data.total_undiscount ? customMarshalling.unmarshalMoney(data.total_undiscount) : void 0, + totalUntaxed: data.total_untaxed ? customMarshalling.unmarshalMoney(data.total_untaxed) : void 0, type: data.type }; }; -const unmarshalRaidController = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'RaidController' failed as data isn't a dictionary.`); +const unmarshalListConsumptionsResponseConsumption = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListConsumptionsResponseConsumption' failed as data isn't a dictionary.` + ); } return { - model: data.model, - raidLevel: data.raid_level + billedQuantity: data.billed_quantity, + categoryName: data.category_name, + productName: data.product_name, + projectId: data.project_id, + resourceName: data.resource_name, + sku: data.sku, + unit: data.unit, + value: data.value ? customMarshalling.unmarshalMoney(data.value) : void 0 }; }; -const unmarshalServerInstall = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ServerInstall' failed as data isn't a dictionary.`); +const unmarshalListConsumptionsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListConsumptionsResponse' failed as data isn't a dictionary.` + ); } return { - hostname: data.hostname, - osId: data.os_id, - serviceUrl: data.service_url, - serviceUser: data.service_user, - sshKeyIds: data.ssh_key_ids, - status: data.status, - user: data.user + consumptions: marshalling.unmarshalArrayOfObject( + data.consumptions, + unmarshalListConsumptionsResponseConsumption + ), + totalCount: data.total_count, + totalDiscountUntaxedValue: data.total_discount_untaxed_value, + updatedAt: marshalling.unmarshalDate(data.updated_at) }; }; -const unmarshalServerOption = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ServerOption' failed as data isn't a dictionary.`); +const unmarshalDiscountCoupon = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DiscountCoupon' failed as data isn't a dictionary.` + ); } return { - expiresAt: unmarshalDate(data.expires_at), - id: data.id, - manageable: data.manageable, - name: data.name, - status: data.status + description: data.description }; }; -const unmarshalServerRescueServer = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ServerRescueServer' failed as data isn't a dictionary.`); +const unmarshalDiscountFilter = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DiscountFilter' failed as data isn't a dictionary.` + ); } return { - password: data.password, - user: data.user + exclude: data.exclude, + type: data.type, + value: data.value }; }; -const unmarshalOS = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'OS' failed as data isn't a dictionary.`); +const unmarshalDiscount = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Discount' failed as data isn't a dictionary.` + ); } return { - allowed: data.allowed, - enabled: data.enabled, + coupon: data.coupon ? unmarshalDiscountCoupon(data.coupon) : void 0, + creationDate: marshalling.unmarshalDate(data.creation_date), + description: data.description, + filters: marshalling.unmarshalArrayOfObject(data.filters, unmarshalDiscountFilter), id: data.id, - licenseRequired: data.license_required, - logoUrl: data.logo_url, - name: data.name, - password: data.password ? unmarshalOSOSField(data.password) : undefined, - servicePassword: data.service_password ? unmarshalOSOSField(data.service_password) : undefined, - serviceUser: data.service_user ? unmarshalOSOSField(data.service_user) : undefined, - ssh: data.ssh ? unmarshalOSOSField(data.ssh) : undefined, - user: data.user ? unmarshalOSOSField(data.user) : undefined, - version: data.version + mode: data.mode, + organizationId: data.organization_id, + startDate: marshalling.unmarshalDate(data.start_date), + stopDate: marshalling.unmarshalDate(data.stop_date), + value: data.value, + valueRemaining: data.value_remaining, + valueUsed: data.value_used }; }; -const unmarshalOffer$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Offer' failed as data isn't a dictionary.`); +const unmarshalListDiscountsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListDiscountsResponse' failed as data isn't a dictionary.` + ); } return { - bandwidth: data.bandwidth, - commercialRange: data.commercial_range, - cpus: unmarshalArrayOfObject(data.cpus, unmarshalCPU), - disks: unmarshalArrayOfObject(data.disks, unmarshalDisk), - enable: data.enable, - fee: data.fee ? unmarshalMoney(data.fee) : undefined, - id: data.id, - incompatibleOsIds: data.incompatible_os_ids, - memories: unmarshalArrayOfObject(data.memories, unmarshalMemory), - name: data.name, - operationPath: data.operation_path, - options: unmarshalArrayOfObject(data.options, unmarshalOfferOptionOffer), - persistentMemories: unmarshalArrayOfObject(data.persistent_memories, unmarshalPersistentMemory), - pricePerHour: data.price_per_hour ? unmarshalMoney(data.price_per_hour) : undefined, - pricePerMonth: data.price_per_month ? unmarshalMoney(data.price_per_month) : undefined, - privateBandwidth: data.private_bandwidth, - quotaName: data.quota_name, - raidControllers: unmarshalArrayOfObject(data.raid_controllers, unmarshalRaidController), - sharedBandwidth: data.shared_bandwidth, - stock: data.stock, - subscriptionPeriod: data.subscription_period, - tags: data.tags + discounts: marshalling.unmarshalArrayOfObject(data.discounts, unmarshalDiscount), + totalCount: data.total_count }; }; -const unmarshalOption = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Option' failed as data isn't a dictionary.`); +const unmarshalListInvoicesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListInvoicesResponse' failed as data isn't a dictionary.` + ); } return { - id: data.id, - manageable: data.manageable, - name: data.name + invoices: marshalling.unmarshalArrayOfObject(data.invoices, unmarshalInvoice), + totalCount: data.total_count }; }; -const unmarshalServer$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Server' failed as data isn't a dictionary.`); +const unmarshalListTaxesResponseTax = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListTaxesResponseTax' failed as data isn't a dictionary.` + ); } return { - bootType: data.boot_type, - createdAt: unmarshalDate(data.created_at), + currency: data.currency, description: data.description, - domain: data.domain, - id: data.id, - install: data.install ? unmarshalServerInstall(data.install) : undefined, - ips: unmarshalArrayOfObject(data.ips, unmarshalIP$1), - name: data.name, - offerId: data.offer_id, - offerName: data.offer_name, - options: unmarshalArrayOfObject(data.options, unmarshalServerOption), - organizationId: data.organization_id, - pingStatus: data.ping_status, - projectId: data.project_id, - rescueServer: data.rescue_server ? unmarshalServerRescueServer(data.rescue_server) : undefined, - status: data.status, - tags: data.tags, - updatedAt: unmarshalDate(data.updated_at), - zone: data.zone + rate: data.rate, + totalTaxValue: data.total_tax_value }; }; -const unmarshalServerEvent = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ServerEvent' failed as data isn't a dictionary.`); +const unmarshalListTaxesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListTaxesResponse' failed as data isn't a dictionary.` + ); } return { - action: data.action, - createdAt: unmarshalDate(data.created_at), - id: data.id, - updatedAt: unmarshalDate(data.updated_at) + taxes: marshalling.unmarshalArrayOfObject(data.taxes, unmarshalListTaxesResponseTax), + totalCount: data.total_count, + updatedAt: marshalling.unmarshalDate(data.updated_at) }; }; -const unmarshalServerPrivateNetwork = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ServerPrivateNetwork' failed as data isn't a dictionary.`); +exports.unmarshalInvoice = unmarshalInvoice; +exports.unmarshalListConsumptionsResponse = unmarshalListConsumptionsResponse; +exports.unmarshalListDiscountsResponse = unmarshalListDiscountsResponse; +exports.unmarshalListInvoicesResponse = unmarshalListInvoicesResponse; +exports.unmarshalListTaxesResponse = unmarshalListTaxesResponse; + + +/***/ }), + +/***/ 3937: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const index_gen = __nccwpck_require__(1692); +exports.v1alpha1 = index_gen; + + +/***/ }), + +/***/ 4336: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const intervalRetrier = __nccwpck_require__(9052); +const api = __nccwpck_require__(3042); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const resourcePaginator = __nccwpck_require__(4983); +const content_gen = __nccwpck_require__(4563); +const marshalling_gen = __nccwpck_require__(1354); +const jsonContentHeaders = { + "Content-Type": "application/json; charset=utf-8" +}; +class API extends api.API { + /** Lists the available zones of the API. */ + static LOCALITIES = [ + "fr-par-1", + "fr-par-2", + "nl-ams-1", + "nl-ams-2", + "nl-ams-3", + "pl-waw-3" + ]; + pageOfListVolumeTypes = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/block/v1alpha1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/volume-types`, + urlParams: marshalling.urlParams( + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListVolumeTypesResponse + ); + /** + * List volume types. List all available volume types in a specified zone. The + * volume types listed are ordered by name in ascending order. + * + * @param request - The request {@link ListVolumeTypesRequest} + * @returns A Promise of ListVolumeTypesResponse + */ + listVolumeTypes = (request = {}) => resourcePaginator.enrichForPagination("volumeTypes", this.pageOfListVolumeTypes, request); + pageOfListVolumes = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/block/v1alpha1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/volumes`, + urlParams: marshalling.urlParams( + ["name", request.name], + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["product_resource_id", request.productResourceId], + ["project_id", request.projectId] + ) + }, + marshalling_gen.unmarshalListVolumesResponse + ); + /** + * List volumes. List all existing volumes in a specified zone. By default, + * the volumes listed are ordered by creation date in ascending order. This + * can be modified via the `order_by` field. + * + * @param request - The request {@link ListVolumesRequest} + * @returns A Promise of ListVolumesResponse + */ + listVolumes = (request = {}) => resourcePaginator.enrichForPagination("volumes", this.pageOfListVolumes, request); + /** + * Create a volume. To create a new volume from scratch, you must specify + * `from_empty` and the `size`. To create a volume from an existing snapshot, + * specify `from_snapshot` and the `snapshot_id` in the request payload + * instead, size is optional and can be specified if you need to extend the + * original size. The volume will take on the same volume class and underlying + * IOPS limitations as the original snapshot. + * + * @param request - The request {@link CreateVolumeRequest} + * @returns A Promise of Volume + */ + createVolume = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateVolumeRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/block/v1alpha1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/volumes` + }, + marshalling_gen.unmarshalVolume + ); + /** + * Get a volume. Retrieve technical information about a specific volume. + * Details such as size, type, and status are returned in the response. + * + * @param request - The request {@link GetVolumeRequest} + * @returns A Promise of Volume + */ + getVolume = (request) => this.client.fetch( + { + method: "GET", + path: `/block/v1alpha1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/volumes/${marshalling.validatePathParam("volumeId", request.volumeId)}` + }, + marshalling_gen.unmarshalVolume + ); + /** + * Waits for {@link Volume} to be in a final state. + * + * @param request - The request {@link GetVolumeRequest} + * @param options - The waiting options + * @returns A Promise of Volume + */ + waitForVolume = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve(!content_gen.VOLUME_TRANSIENT_STATUSES.includes(res.status))), + this.getVolume, + request, + options + ); + /** + * Delete a detached volume. You must specify the `volume_id` of the volume + * you want to delete. The volume must not be in the `in_use` status. + * + * @param request - The request {@link DeleteVolumeRequest} + */ + deleteVolume = (request) => this.client.fetch({ + method: "DELETE", + path: `/block/v1alpha1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/volumes/${marshalling.validatePathParam("volumeId", request.volumeId)}` + }); + /** + * Update a volume. Update the technical details of a volume, such as its + * name, tags, or its new size and `volume_type` (within the same Block + * Storage class). You can only resize a volume to a larger size. It is + * currently not possible to change your Block Storage Class. + * + * @param request - The request {@link UpdateVolumeRequest} + * @returns A Promise of Volume + */ + updateVolume = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateVolumeRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/block/v1alpha1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/volumes/${marshalling.validatePathParam("volumeId", request.volumeId)}` + }, + marshalling_gen.unmarshalVolume + ); + pageOfListSnapshots = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/block/v1alpha1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots`, + urlParams: marshalling.urlParams( + ["name", request.name], + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId], + ["volume_id", request.volumeId] + ) + }, + marshalling_gen.unmarshalListSnapshotsResponse + ); + /** + * List all snapshots. List all available snapshots in a specified zone. By + * default, the snapshots listed are ordered by creation date in ascending + * order. This can be modified via the `order_by` field. + * + * @param request - The request {@link ListSnapshotsRequest} + * @returns A Promise of ListSnapshotsResponse + */ + listSnapshots = (request = {}) => resourcePaginator.enrichForPagination("snapshots", this.pageOfListSnapshots, request); + /** + * Get a snapshot. Retrieve technical information about a specific snapshot. + * Details such as size, volume type, and status are returned in the + * response. + * + * @param request - The request {@link GetSnapshotRequest} + * @returns A Promise of Snapshot + */ + getSnapshot = (request) => this.client.fetch( + { + method: "GET", + path: `/block/v1alpha1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots/${marshalling.validatePathParam("snapshotId", request.snapshotId)}` + }, + marshalling_gen.unmarshalSnapshot + ); + /** + * Waits for {@link Snapshot} to be in a final state. + * + * @param request - The request {@link GetSnapshotRequest} + * @param options - The waiting options + * @returns A Promise of Snapshot + */ + waitForSnapshot = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve(!content_gen.SNAPSHOT_TRANSIENT_STATUSES.includes(res.status))), + this.getSnapshot, + request, + options + ); + /** + * Create a snapshot of a volume. To create a snapshot, the volume must be in + * the `in_use` or the `available` status. If your volume is in a transient + * state, you need to wait until the end of the current operation. + * + * @param request - The request {@link CreateSnapshotRequest} + * @returns A Promise of Snapshot + */ + createSnapshot = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateSnapshotRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/block/v1alpha1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots` + }, + marshalling_gen.unmarshalSnapshot + ); + /** + * (Deprecated in favor of `ImportSnapshotFromObjectStorage`). Import a + * snapshot from a Scaleway Object Storage bucket The bucket must contain a + * QCOW2 image. The bucket can be imported into any Availability Zone as long + * as it is in the same region as the bucket. + * + * @deprecated + * @param request - The request {@link ImportSnapshotFromS3Request} + * @returns A Promise of Snapshot + */ + importSnapshotFromS3 = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalImportSnapshotFromS3Request(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/block/v1alpha1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots/import-from-s3` + }, + marshalling_gen.unmarshalSnapshot + ); + /** + * Import a snapshot from a Scaleway Object Storage bucket. The bucket must + * contain a QCOW2 image. The bucket can be imported into any Availability + * Zone as long as it is in the same region as the bucket. + * + * @param request - The request {@link ImportSnapshotFromObjectStorageRequest} + * @returns A Promise of Snapshot + */ + importSnapshotFromObjectStorage = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalImportSnapshotFromObjectStorageRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/block/v1alpha1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots/import-from-object-storage` + }, + marshalling_gen.unmarshalSnapshot + ); + /** + * Export a snapshot to a Scaleway Object Storage bucket. The snapshot is + * exported in QCOW2 format. The snapshot must not be in transient state. + * + * @param request - The request {@link ExportSnapshotToObjectStorageRequest} + * @returns A Promise of Snapshot + */ + exportSnapshotToObjectStorage = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalExportSnapshotToObjectStorageRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/block/v1alpha1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots/${marshalling.validatePathParam("snapshotId", request.snapshotId)}/export-to-object-storage` + }, + marshalling_gen.unmarshalSnapshot + ); + /** + * Delete a snapshot. You must specify the `snapshot_id` of the snapshot you + * want to delete. The snapshot must not be in use. + * + * @param request - The request {@link DeleteSnapshotRequest} + */ + deleteSnapshot = (request) => this.client.fetch({ + method: "DELETE", + path: `/block/v1alpha1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots/${marshalling.validatePathParam("snapshotId", request.snapshotId)}` + }); + /** + * Update a snapshot. Update the name or tags of the snapshot. + * + * @param request - The request {@link UpdateSnapshotRequest} + * @returns A Promise of Snapshot + */ + updateSnapshot = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateSnapshotRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/block/v1alpha1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots/${marshalling.validatePathParam("snapshotId", request.snapshotId)}` + }, + marshalling_gen.unmarshalSnapshot + ); +} +exports.API = API; + + +/***/ }), + +/***/ 4563: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const REFERENCE_TRANSIENT_STATUSES = [ + "attaching", + "detaching", + "creating" +]; +const SNAPSHOT_TRANSIENT_STATUSES = [ + "creating", + "deleting", + "exporting" +]; +const VOLUME_TRANSIENT_STATUSES = [ + "creating", + "deleting", + "resizing", + "snapshotting", + "updating" +]; +exports.REFERENCE_TRANSIENT_STATUSES = REFERENCE_TRANSIENT_STATUSES; +exports.SNAPSHOT_TRANSIENT_STATUSES = SNAPSHOT_TRANSIENT_STATUSES; +exports.VOLUME_TRANSIENT_STATUSES = VOLUME_TRANSIENT_STATUSES; + + +/***/ }), + +/***/ 1692: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api_gen = __nccwpck_require__(4336); +const content_gen = __nccwpck_require__(4563); +const validationRules_gen = __nccwpck_require__(9771); +exports.API = api_gen.API; +exports.REFERENCE_TRANSIENT_STATUSES = content_gen.REFERENCE_TRANSIENT_STATUSES; +exports.SNAPSHOT_TRANSIENT_STATUSES = content_gen.SNAPSHOT_TRANSIENT_STATUSES; +exports.VOLUME_TRANSIENT_STATUSES = content_gen.VOLUME_TRANSIENT_STATUSES; +exports.ValidationRules = validationRules_gen; + + +/***/ }), + +/***/ 1354: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const json = __nccwpck_require__(3746); +const customMarshalling = __nccwpck_require__(7586); +const marshalling = __nccwpck_require__(1162); +const unmarshalReference = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Reference' failed as data isn't a dictionary.` + ); } return { - createdAt: unmarshalDate(data.created_at), + createdAt: marshalling.unmarshalDate(data.created_at), id: data.id, - privateNetworkId: data.private_network_id, - projectId: data.project_id, - serverId: data.server_id, + productResourceId: data.product_resource_id, + productResourceType: data.product_resource_type, status: data.status, - updatedAt: unmarshalDate(data.updated_at), - vlan: data.vlan + type: data.type }; }; -const unmarshalSetting = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Setting' failed as data isn't a dictionary.`); +const unmarshalSnapshotParentVolume = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SnapshotParentVolume' failed as data isn't a dictionary.` + ); } return { - enabled: data.enabled, id: data.id, - projectId: data.project_id, + name: data.name, + status: data.status, type: data.type }; }; -const unmarshalBMCAccess = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'BMCAccess' failed as data isn't a dictionary.`); - } - return { - expiresAt: unmarshalDate(data.expires_at), - login: data.login, - password: data.password, - url: data.url - }; -}; -const unmarshalGetServerMetricsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'GetServerMetricsResponse' failed as data isn't a dictionary.`); - } - return { - pings: data.pings ? unmarshalTimeSeries(data.pings) : undefined - }; -}; -const unmarshalListOSResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListOSResponse' failed as data isn't a dictionary.`); +const unmarshalSnapshot = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Snapshot' failed as data isn't a dictionary.` + ); } return { - os: unmarshalArrayOfObject(data.os, unmarshalOS), - totalCount: data.total_count + class: data.class, + createdAt: marshalling.unmarshalDate(data.created_at), + id: data.id, + name: data.name, + parentVolume: data.parent_volume ? unmarshalSnapshotParentVolume(data.parent_volume) : void 0, + projectId: data.project_id, + references: marshalling.unmarshalArrayOfObject(data.references, unmarshalReference), + size: data.size, + status: data.status, + tags: data.tags, + updatedAt: marshalling.unmarshalDate(data.updated_at), + zone: data.zone }; }; -const unmarshalListOffersResponse$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListOffersResponse' failed as data isn't a dictionary.`); +const unmarshalVolumeSpecifications = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'VolumeSpecifications' failed as data isn't a dictionary.` + ); } return { - offers: unmarshalArrayOfObject(data.offers, unmarshalOffer$1), - totalCount: data.total_count + class: data.class, + perfIops: data.perf_iops }; }; -const unmarshalListOptionsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListOptionsResponse' failed as data isn't a dictionary.`); +const unmarshalVolume = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Volume' failed as data isn't a dictionary.` + ); } return { - options: unmarshalArrayOfObject(data.options, unmarshalOption), - totalCount: data.total_count + createdAt: marshalling.unmarshalDate(data.created_at), + id: data.id, + lastDetachedAt: marshalling.unmarshalDate(data.last_detached_at), + name: data.name, + parentSnapshotId: data.parent_snapshot_id, + projectId: data.project_id, + references: marshalling.unmarshalArrayOfObject(data.references, unmarshalReference), + size: data.size, + specs: data.specs ? unmarshalVolumeSpecifications(data.specs) : void 0, + status: data.status, + tags: data.tags, + type: data.type, + updatedAt: marshalling.unmarshalDate(data.updated_at), + zone: data.zone }; }; -const unmarshalListServerEventsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListServerEventsResponse' failed as data isn't a dictionary.`); +const unmarshalListSnapshotsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListSnapshotsResponse' failed as data isn't a dictionary.` + ); } return { - events: unmarshalArrayOfObject(data.events, unmarshalServerEvent), + snapshots: marshalling.unmarshalArrayOfObject(data.snapshots, unmarshalSnapshot), totalCount: data.total_count }; }; -const unmarshalListServerPrivateNetworksResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListServerPrivateNetworksResponse' failed as data isn't a dictionary.`); +const unmarshalVolumeType = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'VolumeType' failed as data isn't a dictionary.` + ); } return { - serverPrivateNetworks: unmarshalArrayOfObject(data.server_private_networks, unmarshalServerPrivateNetwork), - totalCount: data.total_count + pricing: data.pricing ? customMarshalling.unmarshalMoney(data.pricing) : void 0, + snapshotPricing: data.snapshot_pricing ? customMarshalling.unmarshalMoney(data.snapshot_pricing) : void 0, + specs: data.specs ? unmarshalVolumeSpecifications(data.specs) : void 0, + type: data.type }; }; -const unmarshalListServersResponse$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListServersResponse' failed as data isn't a dictionary.`); +const unmarshalListVolumeTypesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListVolumeTypesResponse' failed as data isn't a dictionary.` + ); } return { - servers: unmarshalArrayOfObject(data.servers, unmarshalServer$1), - totalCount: data.total_count + totalCount: data.total_count, + volumeTypes: marshalling.unmarshalArrayOfObject(data.volume_types, unmarshalVolumeType) }; }; -const unmarshalListSettingsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListSettingsResponse' failed as data isn't a dictionary.`); +const unmarshalListVolumesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListVolumesResponse' failed as data isn't a dictionary.` + ); } return { - settings: unmarshalArrayOfObject(data.settings, unmarshalSetting), - totalCount: data.total_count + totalCount: data.total_count, + volumes: marshalling.unmarshalArrayOfObject(data.volumes, unmarshalVolume) }; }; -const unmarshalSetServerPrivateNetworksResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'SetServerPrivateNetworksResponse' failed as data isn't a dictionary.`); - } - return { - serverPrivateNetworks: unmarshalArrayOfObject(data.server_private_networks, unmarshalServerPrivateNetwork) - }; -}; -const marshalCreateServerRequestInstall = (request, defaults) => ({ - hostname: request.hostname, - os_id: request.osId, - password: request.password, - service_password: request.servicePassword, - service_user: request.serviceUser, - ssh_key_ids: request.sshKeyIds, - user: request.user -}); -const marshalAddOptionServerRequest = (request, defaults) => ({ - expires_at: request.expiresAt -}); -const marshalCreateServerRequest$1 = (request, defaults) => ({ - description: request.description, - install: request.install ? marshalCreateServerRequestInstall(request.install) : undefined, +const marshalCreateSnapshotRequest = (request, defaults) => ({ name: request.name, - offer_id: request.offerId, - option_ids: request.optionIds, + project_id: request.projectId ?? defaults.defaultProjectId, tags: request.tags, - ...resolveOneOf([{ - default: defaults.defaultProjectId, - param: 'project_id', - value: request.projectId - }, { - default: defaults.defaultOrganizationId, - param: 'organization_id', - value: request.organizationId - }]) -}); -const marshalInstallServerRequest = (request, defaults) => ({ - hostname: request.hostname, - os_id: request.osId, - password: request.password, - service_password: request.servicePassword, - service_user: request.serviceUser, - ssh_key_ids: request.sshKeyIds, - user: request.user + volume_id: request.volumeId }); -const marshalPrivateNetworkApiAddServerPrivateNetworkRequest = (request, defaults) => ({ - private_network_id: request.privateNetworkId +const marshalCreateVolumeRequestFromEmpty = (request, defaults) => ({ + size: request.size }); -const marshalPrivateNetworkApiSetServerPrivateNetworksRequest = (request, defaults) => ({ - private_network_ids: request.privateNetworkIds +const marshalCreateVolumeRequestFromSnapshot = (request, defaults) => ({ + size: request.size, + snapshot_id: request.snapshotId }); -const marshalRebootServerRequest = (request, defaults) => ({ - boot_type: request.bootType ?? 'unknown_boot_type' +const marshalCreateVolumeRequest = (request, defaults) => ({ + name: request.name, + project_id: request.projectId ?? defaults.defaultProjectId, + tags: request.tags, + ...marshalling.resolveOneOf([ + { + param: "from_empty", + value: request.fromEmpty !== void 0 ? marshalCreateVolumeRequestFromEmpty(request.fromEmpty) : void 0 + }, + { + param: "from_snapshot", + value: request.fromSnapshot !== void 0 ? marshalCreateVolumeRequestFromSnapshot( + request.fromSnapshot + ) : void 0 + } + ]), + ...marshalling.resolveOneOf([{ param: "perf_iops", value: request.perfIops }]) }); -const marshalStartBMCAccessRequest = (request, defaults) => ({ - ip: request.ip +const marshalExportSnapshotToObjectStorageRequest = (request, defaults) => ({ + bucket: request.bucket, + key: request.key }); -const marshalStartServerRequest = (request, defaults) => ({ - boot_type: request.bootType ?? 'unknown_boot_type' +const marshalImportSnapshotFromObjectStorageRequest = (request, defaults) => ({ + bucket: request.bucket, + key: request.key, + name: request.name, + project_id: request.projectId ?? defaults.defaultProjectId, + size: request.size, + tags: request.tags }); -const marshalUpdateIPRequest$1 = (request, defaults) => ({ - reverse: request.reverse +const marshalImportSnapshotFromS3Request = (request, defaults) => ({ + bucket: request.bucket, + key: request.key, + name: request.name, + project_id: request.projectId ?? defaults.defaultProjectId, + size: request.size, + tags: request.tags }); -const marshalUpdateServerRequest$1 = (request, defaults) => ({ - description: request.description, +const marshalUpdateSnapshotRequest = (request, defaults) => ({ name: request.name, tags: request.tags }); -const marshalUpdateSettingRequest = (request, defaults) => ({ - enabled: request.enabled +const marshalUpdateVolumeRequest = (request, defaults) => ({ + name: request.name, + perf_iops: request.perfIops, + size: request.size, + tags: request.tags }); +exports.marshalCreateSnapshotRequest = marshalCreateSnapshotRequest; +exports.marshalCreateVolumeRequest = marshalCreateVolumeRequest; +exports.marshalExportSnapshotToObjectStorageRequest = marshalExportSnapshotToObjectStorageRequest; +exports.marshalImportSnapshotFromObjectStorageRequest = marshalImportSnapshotFromObjectStorageRequest; +exports.marshalImportSnapshotFromS3Request = marshalImportSnapshotFromS3Request; +exports.marshalUpdateSnapshotRequest = marshalUpdateSnapshotRequest; +exports.marshalUpdateVolumeRequest = marshalUpdateVolumeRequest; +exports.unmarshalListSnapshotsResponse = unmarshalListSnapshotsResponse; +exports.unmarshalListVolumeTypesResponse = unmarshalListVolumeTypesResponse; +exports.unmarshalListVolumesResponse = unmarshalListVolumesResponse; +exports.unmarshalReference = unmarshalReference; +exports.unmarshalSnapshot = unmarshalSnapshot; +exports.unmarshalVolume = unmarshalVolume; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const jsonContentHeaders$p = { - 'Content-Type': 'application/json; charset=utf-8' + +/***/ }), + +/***/ 9771: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const CreateSnapshotRequest = { + name: { + minLength: 1 + } +}; +const CreateVolumeRequest = { + name: { + minLength: 1 + } +}; +const ImportSnapshotFromObjectStorageRequest = { + name: { + minLength: 1 + } +}; +const ImportSnapshotFromS3Request = { + name: { + minLength: 1 + } +}; +const ListSnapshotsRequest = { + page: { + greaterThan: 0 + }, + pageSize: { + greaterThan: 0, + lessThanOrEqual: 100 + } +}; +const ListVolumeTypesRequest = { + page: { + greaterThan: 0 + }, + pageSize: { + greaterThan: 0, + lessThanOrEqual: 100 + } +}; +const ListVolumesRequest = { + page: { + greaterThan: 0 + }, + pageSize: { + greaterThan: 0, + lessThanOrEqual: 100 + } }; +const Reference = { + productResourceType: { + minLength: 1 + } +}; +exports.CreateSnapshotRequest = CreateSnapshotRequest; +exports.CreateVolumeRequest = CreateVolumeRequest; +exports.ImportSnapshotFromObjectStorageRequest = ImportSnapshotFromObjectStorageRequest; +exports.ImportSnapshotFromS3Request = ImportSnapshotFromS3Request; +exports.ListSnapshotsRequest = ListSnapshotsRequest; +exports.ListVolumeTypesRequest = ListVolumeTypesRequest; +exports.ListVolumesRequest = ListVolumesRequest; +exports.Reference = Reference; -/** - * Elastic Metal API. - * - * This API allows to manage your Elastic Metal server. Elastic Metal API. - */ -let API$r = class API extends API$u { - /** Lists the available zones of the API. */ - static LOCALITIES = ['fr-par-1', 'fr-par-2', 'nl-ams-1', 'nl-ams-2']; - pageOfListServers = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers`, - urlParams: urlParams(['name', request.name], ['option_id', request.optionId], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId], ['status', request.status], ['tags', request.tags]) - }, unmarshalListServersResponse$1); +/***/ }), + +/***/ 7169: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const index_gen = __nccwpck_require__(5409); +const index_gen$1 = __nccwpck_require__(5606); +exports.v1 = index_gen; +exports.v1beta1 = index_gen$1; + + +/***/ }), + +/***/ 4925: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api = __nccwpck_require__(3042); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const resourcePaginator = __nccwpck_require__(4983); +const marshalling_gen = __nccwpck_require__(8427); +const jsonContentHeaders = { + "Content-Type": "application/json; charset=utf-8" +}; +class GlobalAPI extends api.API { /** - * List Elastic Metal servers for an Organization. List Elastic Metal servers - * for a specific Organization. + * Get your Cockpit's Grafana. Retrieve information on your Cockpit's Grafana, + * specified by the ID of the Project the Cockpit belongs to. The output + * returned displays the URL to access your Cockpit's Grafana. * - * @param request - The request {@link ListServersRequest} - * @returns A Promise of ListServersResponse + * @param request - The request {@link GlobalApiGetGrafanaRequest} + * @returns A Promise of Grafana */ - listServers = (request = {}) => enrichForPagination('servers', this.pageOfListServers, request); - + getGrafana = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/cockpit/v1/grafana`, + urlParams: marshalling.urlParams([ + "project_id", + request.projectId ?? this.client.settings.defaultProjectId + ]) + }, + marshalling_gen.unmarshalGrafana + ); /** - * Get a specific Elastic Metal server. Get full details of an existing - * Elastic Metal server associated with the ID. + * Synchronize Grafana data sources. Trigger the synchronization of all your + * data sources and the alert manager in the relevant regions. The alert + * manager will only be synchronized if you have enabled it. * - * @param request - The request {@link GetServerRequest} - * @returns A Promise of Server + * @param request - The request {@link GlobalApiSyncGrafanaDataSourcesRequest} */ - getServer = request => this.client.fetch({ - method: 'GET', - path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}` - }, unmarshalServer$1); - + syncGrafanaDataSources = (request = {}) => this.client.fetch({ + body: JSON.stringify( + marshalling_gen.marshalGlobalApiSyncGrafanaDataSourcesRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/cockpit/v1/grafana/sync-data-sources` + }); /** - * Waits for {@link Server} to be in a final state. + * Create a Grafana user. Create a Grafana user to connect to your Cockpit's + * Grafana. Upon creation, your user password displays only once, so make sure + * that you save it. Each Grafana user is associated with a role: viewer or + * editor. A viewer can only view dashboards, whereas an editor can create and + * edit dashboards. Note that the `admin` username is not available for + * creation. * - * @param request - The request {@link GetServerRequest} - * @param options - The waiting options - * @returns A Promise of Server + * @param request - The request {@link GlobalApiCreateGrafanaUserRequest} + * @returns A Promise of GrafanaUser */ - waitForServer = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!SERVER_TRANSIENT_STATUSES$1.includes(res.status))), this.getServer, request, options); - + createGrafanaUser = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalGlobalApiCreateGrafanaUserRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/cockpit/v1/grafana/users` + }, + marshalling_gen.unmarshalGrafanaUser + ); + pageOfListGrafanaUsers = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/cockpit/v1/grafana/users`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + [ + "project_id", + request.projectId ?? this.client.settings.defaultProjectId + ] + ) + }, + marshalling_gen.unmarshalListGrafanaUsersResponse + ); /** - * Create an Elastic Metal server. Create a new Elastic Metal server. Once the - * server is created, proceed with the [installation of an OS](#post-3e949e). + * List Grafana users. List all Grafana users created in your Cockpit's + * Grafana. By default, the Grafana users returned in the list are ordered in + * ascending order. * - * @param request - The request {@link CreateServerRequest} - * @returns A Promise of Server + * @param request - The request {@link GlobalApiListGrafanaUsersRequest} + * @returns A Promise of ListGrafanaUsersResponse */ - createServer = request => this.client.fetch({ - body: JSON.stringify(marshalCreateServerRequest$1(request, this.client.settings)), - headers: jsonContentHeaders$p, - method: 'POST', - path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers` - }, unmarshalServer$1); - + listGrafanaUsers = (request = {}) => resourcePaginator.enrichForPagination("grafanaUsers", this.pageOfListGrafanaUsers, request); /** - * Update an Elastic Metal server. Update the server associated with the ID. - * You can update parameters such as the server's name, tags and description. - * Any parameters left null in the request body are not updated. + * Delete a Grafana user. Delete a Grafana user from your Cockpit's Grafana, + * specified by the ID of the Project the Cockpit belongs to, and the ID of + * the Grafana user. * - * @param request - The request {@link UpdateServerRequest} - * @returns A Promise of Server + * @param request - The request {@link GlobalApiDeleteGrafanaUserRequest} */ - updateServer = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateServerRequest$1(request, this.client.settings)), - headers: jsonContentHeaders$p, - method: 'PATCH', - path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}` - }, unmarshalServer$1); - + deleteGrafanaUser = (request) => this.client.fetch({ + method: "DELETE", + path: `/cockpit/v1/grafana/users/${marshalling.validatePathParam("grafanaUserId", request.grafanaUserId)}`, + urlParams: marshalling.urlParams([ + "project_id", + request.projectId ?? this.client.settings.defaultProjectId + ]) + }); /** - * Install an Elastic Metal server. Install an Operating System (OS) on the - * Elastic Metal server with a specific ID. + * Reset a Grafana user password. Reset the password of a Grafana user, + * specified by the ID of the Project the Cockpit belongs to, and the ID of + * the Grafana user. A new password regenerates and only displays once. Make + * sure that you save it. * - * @param request - The request {@link InstallServerRequest} - * @returns A Promise of Server + * @param request - The request + * {@link GlobalApiResetGrafanaUserPasswordRequest} + * @returns A Promise of GrafanaUser */ - installServer = request => this.client.fetch({ - body: JSON.stringify(marshalInstallServerRequest(request, this.client.settings)), - headers: jsonContentHeaders$p, - method: 'POST', - path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/install` - }, unmarshalServer$1); - + resetGrafanaUserPassword = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalGlobalApiResetGrafanaUserPasswordRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/cockpit/v1/grafana/users/${marshalling.validatePathParam("grafanaUserId", request.grafanaUserId)}/reset-password` + }, + marshalling_gen.unmarshalGrafanaUser + ); + pageOfListGrafanaProductDashboards = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/cockpit/v1/grafana/product-dashboards`, + urlParams: marshalling.urlParams( + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + [ + "project_id", + request.projectId ?? this.client.settings.defaultProjectId + ], + ["tags", request.tags] + ) + }, + marshalling_gen.unmarshalListGrafanaProductDashboardsResponse + ); /** - * Return server metrics. Get the ping status of the server associated with - * the ID. + * List Scaleway resources dashboards. Retrieve a list of available dashboards + * in Grafana, for all Scaleway resources which are integrated with Cockpit. * - * @param request - The request {@link GetServerMetricsRequest} - * @returns A Promise of GetServerMetricsResponse + * @param request - The request + * {@link GlobalApiListGrafanaProductDashboardsRequest} + * @returns A Promise of ListGrafanaProductDashboardsResponse */ - getServerMetrics = request => this.client.fetch({ - method: 'GET', - path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/metrics` - }, unmarshalGetServerMetricsResponse); - + listGrafanaProductDashboards = (request = {}) => resourcePaginator.enrichForPagination( + "dashboards", + this.pageOfListGrafanaProductDashboards, + request + ); /** - * Delete an Elastic Metal server. Delete the server associated with the ID. + * Get Scaleway resource dashboard. Retrieve information about the dashboard + * of a Scaleway resource in Grafana, specified by the ID of the Project the + * Cockpit belongs to, and the name of the dashboard. * - * @param request - The request {@link DeleteServerRequest} - * @returns A Promise of Server + * @param request - The request + * {@link GlobalApiGetGrafanaProductDashboardRequest} + * @returns A Promise of GrafanaProductDashboard */ - deleteServer = request => this.client.fetch({ - method: 'DELETE', - path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}` - }, unmarshalServer$1); - + getGrafanaProductDashboard = (request) => this.client.fetch( + { + method: "GET", + path: `/cockpit/v1/grafana/product-dashboards/${marshalling.validatePathParam("dashboardName", request.dashboardName)}`, + urlParams: marshalling.urlParams([ + "project_id", + request.projectId ?? this.client.settings.defaultProjectId + ]) + }, + marshalling_gen.unmarshalGrafanaProductDashboard + ); + pageOfListPlans = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/cockpit/v1/plans`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListPlansResponse + ); /** - * Reboot an Elastic Metal server. Reboot the Elastic Metal server associated - * with the ID, use the `boot_type` `rescue` to reboot the server in rescue - * mode. + * List plan types. Retrieve a list of available pricing plan types. * - * @param request - The request {@link RebootServerRequest} - * @returns A Promise of Server + * @param request - The request {@link GlobalApiListPlansRequest} + * @returns A Promise of ListPlansResponse */ - rebootServer = request => this.client.fetch({ - body: JSON.stringify(marshalRebootServerRequest(request, this.client.settings)), - headers: jsonContentHeaders$p, - method: 'POST', - path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/reboot` - }, unmarshalServer$1); - + listPlans = (request = {}) => resourcePaginator.enrichForPagination("plans", this.pageOfListPlans, request); /** - * Start an Elastic Metal server. Start the server associated with the ID. + * Apply a pricing plan. Apply a pricing plan on a given Project. You must + * specify the ID of the pricing plan type. Note that you will be billed for + * the plan you apply. * - * @param request - The request {@link StartServerRequest} - * @returns A Promise of Server + * @param request - The request {@link GlobalApiSelectPlanRequest} + * @returns A Promise of Plan */ - startServer = request => this.client.fetch({ - body: JSON.stringify(marshalStartServerRequest(request, this.client.settings)), - headers: jsonContentHeaders$p, - method: 'POST', - path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/start` - }, unmarshalServer$1); - + selectPlan = (request = {}) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalGlobalApiSelectPlanRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/cockpit/v1/plans` + }, + marshalling_gen.unmarshalPlan + ); + /** + * Get current plan. Retrieve a pricing plan for the given Project, specified + * by the ID of the Project. + * + * @param request - The request {@link GlobalApiGetCurrentPlanRequest} + * @returns A Promise of Plan + */ + getCurrentPlan = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/cockpit/v1/current-plan`, + urlParams: marshalling.urlParams([ + "project_id", + request.projectId ?? this.client.settings.defaultProjectId + ]) + }, + marshalling_gen.unmarshalPlan + ); +} +class RegionalAPI extends api.API { + /** Lists the available regions of the API. */ + static LOCALITIES = ["fr-par", "nl-ams", "pl-waw"]; + /** + * Create a data source. You must specify the data source type upon creation. + * Available data source types include: + * + * - Metrics + * - Logs + * - Traces The name of the data source will then be used as reference to name + * the associated Grafana data source. + * + * @param request - The request {@link RegionalApiCreateDataSourceRequest} + * @returns A Promise of DataSource + */ + createDataSource = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalRegionalApiCreateDataSourceRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/cockpit/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/data-sources` + }, + marshalling_gen.unmarshalDataSource + ); /** - * Stop an Elastic Metal server. Stop the server associated with the ID. The - * server remains allocated to your account and all data remains on the local - * storage of the server. + * Get a data source. Retrieve information about a given data source, + * specified by the data source ID. The data source's information such as its + * name, type, URL, origin, and retention period, is returned. * - * @param request - The request {@link StopServerRequest} - * @returns A Promise of Server + * @param request - The request {@link RegionalApiGetDataSourceRequest} + * @returns A Promise of DataSource */ - stopServer = request => this.client.fetch({ - body: '{}', - headers: jsonContentHeaders$p, - method: 'POST', - path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/stop` - }, unmarshalServer$1); - pageOfListServerEvents = request => this.client.fetch({ - method: 'GET', - path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/events`, - urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]) - }, unmarshalListServerEventsResponse); - + getDataSource = (request) => this.client.fetch( + { + method: "GET", + path: `/cockpit/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/data-sources/${marshalling.validatePathParam("dataSourceId", request.dataSourceId)}` + }, + marshalling_gen.unmarshalDataSource + ); /** - * List server events. List event (i.e. start/stop/reboot) associated to the - * server ID. + * Delete a data source. Delete a given data source, specified by the data + * source ID. Note that deleting a data source is irreversible, and cannot be + * undone. * - * @param request - The request {@link ListServerEventsRequest} - * @returns A Promise of ListServerEventsResponse + * @param request - The request {@link RegionalApiDeleteDataSourceRequest} */ - listServerEvents = request => enrichForPagination('events', this.pageOfListServerEvents, request); - + deleteDataSource = (request) => this.client.fetch({ + method: "DELETE", + path: `/cockpit/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/data-sources/${marshalling.validatePathParam("dataSourceId", request.dataSourceId)}` + }); + pageOfListDataSources = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/cockpit/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/data-sources`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["origin", request.origin], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + [ + "project_id", + request.projectId ?? this.client.settings.defaultProjectId + ], + ["types", request.types] + ) + }, + marshalling_gen.unmarshalListDataSourcesResponse + ); + /** + * List data sources. Retrieve the list of data sources available in the + * specified region. By default, the data sources returned in the list are + * ordered by creation date, in ascending order. You can list data sources by + * Project, type and origin. + * + * @param request - The request {@link RegionalApiListDataSourcesRequest} + * @returns A Promise of ListDataSourcesResponse + */ + listDataSources = (request = {}) => resourcePaginator.enrichForPagination("dataSources", this.pageOfListDataSources, request); + /** + * Update a data source. Update a given data source name, specified by the + * data source ID. + * + * @param request - The request {@link RegionalApiUpdateDataSourceRequest} + * @returns A Promise of DataSource + */ + updateDataSource = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalRegionalApiUpdateDataSourceRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/cockpit/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/data-sources/${marshalling.validatePathParam("dataSourceId", request.dataSourceId)}` + }, + marshalling_gen.unmarshalDataSource + ); + /** + * Get data source usage overview. Retrieve the data source usage overview per + * type for the specified Project. + * + * @param request - The request {@link RegionalApiGetUsageOverviewRequest} + * @returns A Promise of UsageOverview + */ + getUsageOverview = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/cockpit/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/usage-overview`, + urlParams: marshalling.urlParams( + ["interval", request.interval], + [ + "project_id", + request.projectId ?? this.client.settings.defaultProjectId + ] + ) + }, + marshalling_gen.unmarshalUsageOverview + ); /** - * Start BMC access. Start BMC (Baseboard Management Controller) access - * associated with the ID. The BMC (Baseboard Management Controller) access is - * available one hour after the installation of the server. You need first to - * create an option Remote Access. You will find the ID and the price with a - * call to listOffers - * (https://developers.scaleway.com/en/products/baremetal/api/#get-78db92). - * Then add the option - * https://developers.scaleway.com/en/products/baremetal/api/#post-b14abd. - * After adding the BMC option, you need to Get Remote Access to get the - * login/password - * https://developers.scaleway.com/en/products/baremetal/api/#get-cefc0f. Do - * not forget to delete the Option after use. + * Create a token. Give your token the relevant scopes to ensure it has the + * right permissions to interact with your data sources and the Alert manager. + * Make sure that you create your token in the same regions as the data + * sources you want to use it for. Upon creation, your token's secret key + * display only once. Make sure that you save it. * - * @param request - The request {@link StartBMCAccessRequest} - * @returns A Promise of BMCAccess + * @param request - The request {@link RegionalApiCreateTokenRequest} + * @returns A Promise of Token */ - startBMCAccess = request => this.client.fetch({ - body: JSON.stringify(marshalStartBMCAccessRequest(request, this.client.settings)), - headers: jsonContentHeaders$p, - method: 'POST', - path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/bmc-access` - }, unmarshalBMCAccess); - - /** - * Get BMC access. Get the BMC (Baseboard Management Controller) access - * associated with the ID, including the URL and login information needed to - * connect. - * - * @param request - The request {@link GetBMCAccessRequest} - * @returns A Promise of BMCAccess - */ - getBMCAccess = request => this.client.fetch({ - method: 'GET', - path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/bmc-access` - }, unmarshalBMCAccess); - - /** - * Stop BMC access. Stop BMC (Baseboard Management Controller) access - * associated with the ID. - * - * @param request - The request {@link StopBMCAccessRequest} - */ - stopBMCAccess = request => this.client.fetch({ - method: 'DELETE', - path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/bmc-access` - }); - - /** - * Update IP. Configure the IP address associated with the server ID and IP - * ID. You can use this method to set a reverse DNS for an IP address. - * - * @param request - The request {@link UpdateIPRequest} - * @returns A Promise of IP - */ - updateIP = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateIPRequest$1(request, this.client.settings)), - headers: jsonContentHeaders$p, - method: 'PATCH', - path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/ips/${validatePathParam('ipId', request.ipId)}` - }, unmarshalIP$1); - + createToken = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalRegionalApiCreateTokenRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/cockpit/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/tokens` + }, + marshalling_gen.unmarshalToken + ); + pageOfListTokens = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/cockpit/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/tokens`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + [ + "project_id", + request.projectId ?? this.client.settings.defaultProjectId + ], + ["token_scopes", request.tokenScopes] + ) + }, + marshalling_gen.unmarshalListTokensResponse + ); /** - * Add server option. Add an option, such as Private Networks, to a specific - * server. + * List tokens. Retrieve a list of all tokens in the specified region. By + * default, tokens returned in the list are ordered by creation date, in + * ascending order. You can filter tokens by Project ID and token scopes. * - * @param request - The request {@link AddOptionServerRequest} - * @returns A Promise of Server + * @param request - The request {@link RegionalApiListTokensRequest} + * @returns A Promise of ListTokensResponse */ - addOptionServer = request => this.client.fetch({ - body: JSON.stringify(marshalAddOptionServerRequest(request, this.client.settings)), - headers: jsonContentHeaders$p, - method: 'POST', - path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/options/${validatePathParam('optionId', request.optionId)}` - }, unmarshalServer$1); - + listTokens = (request = {}) => resourcePaginator.enrichForPagination("tokens", this.pageOfListTokens, request); /** - * Delete server option. Delete an option from a specific server. + * Get a token. Retrieve information about a given token, specified by the + * token ID. The token's information such as its scopes, is returned. * - * @param request - The request {@link DeleteOptionServerRequest} - * @returns A Promise of Server + * @param request - The request {@link RegionalApiGetTokenRequest} + * @returns A Promise of Token */ - deleteOptionServer = request => this.client.fetch({ - method: 'DELETE', - path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/options/${validatePathParam('optionId', request.optionId)}` - }, unmarshalServer$1); - pageOfListOffers = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/offers`, - urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['subscription_period', request.subscriptionPeriod ?? 'unknown_subscription_period']) - }, unmarshalListOffersResponse$1); - + getToken = (request) => this.client.fetch( + { + method: "GET", + path: `/cockpit/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/tokens/${marshalling.validatePathParam("tokenId", request.tokenId)}` + }, + marshalling_gen.unmarshalToken + ); /** - * List offers. List all available Elastic Metal server configurations. + * Delete a token. Delete a given token, specified by the token ID. Deleting a + * token is irreversible and cannot be undone. * - * @param request - The request {@link ListOffersRequest} - * @returns A Promise of ListOffersResponse + * @param request - The request {@link RegionalApiDeleteTokenRequest} */ - listOffers = (request = {}) => enrichForPagination('offers', this.pageOfListOffers, request); - + deleteToken = (request) => this.client.fetch({ + method: "DELETE", + path: `/cockpit/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/tokens/${marshalling.validatePathParam("tokenId", request.tokenId)}` + }); /** - * Get offer. Get details of an offer identified by its offer ID. - * - * @param request - The request {@link GetOfferRequest} - * @returns A Promise of Offer - */ - getOffer = request => this.client.fetch({ - method: 'GET', - path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/offers/${validatePathParam('offerId', request.offerId)}` - }, unmarshalOffer$1); - + * Get the Alert manager. Retrieve information about the Alert manager which + * is unique per Project and region. By default the Alert manager is disabled. + * The output returned displays a URL to access the Alert manager, and whether + * the Alert manager and managed alerts are enabled. + * + * @param request - The request {@link RegionalApiGetAlertManagerRequest} + * @returns A Promise of AlertManager + */ + getAlertManager = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/cockpit/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/alert-manager`, + urlParams: marshalling.urlParams([ + "project_id", + request.projectId ?? this.client.settings.defaultProjectId + ]) + }, + marshalling_gen.unmarshalAlertManager + ); + /** + * Enable the Alert manager. Enabling the Alert manager allows you to enable + * managed alerts and create contact points in the specified Project and + * region, to be notified when your Scaleway resources may require your + * attention. + * + * @param request - The request {@link RegionalApiEnableAlertManagerRequest} + * @returns A Promise of AlertManager + */ + enableAlertManager = (request = {}) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalRegionalApiEnableAlertManagerRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/cockpit/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/alert-manager/enable` + }, + marshalling_gen.unmarshalAlertManager + ); + /** + * Disable the Alert manager. Disabling the Alert manager deletes the contact + * points you have created and disables managed alerts in the specified + * Project and region. + * + * @param request - The request {@link RegionalApiDisableAlertManagerRequest} + * @returns A Promise of AlertManager + */ + disableAlertManager = (request = {}) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalRegionalApiDisableAlertManagerRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/cockpit/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/alert-manager/disable` + }, + marshalling_gen.unmarshalAlertManager + ); /** - * Get option. Return specific option for the ID. + * Create a contact point. Contact points are email addresses associated with + * the default receiver, that the Alert manager sends alerts to. The source of + * the alerts are data sources within the same Project and region as the Alert + * manager. If you need to receive alerts for other receivers, you can create + * additional contact points and receivers in Grafana. Make sure that you + * select the Scaleway Alert manager. * - * @param request - The request {@link GetOptionRequest} - * @returns A Promise of Option + * @param request - The request {@link RegionalApiCreateContactPointRequest} + * @returns A Promise of ContactPoint */ - getOption = request => this.client.fetch({ - method: 'GET', - path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/options/${validatePathParam('optionId', request.optionId)}` - }, unmarshalOption); - pageOfListOptions = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/options`, - urlParams: urlParams(['name', request.name], ['offer_id', request.offerId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]) - }, unmarshalListOptionsResponse); - + createContactPoint = (request = {}) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalRegionalApiCreateContactPointRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/cockpit/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/alert-manager/contact-points` + }, + marshalling_gen.unmarshalContactPoint + ); + pageOfListContactPoints = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/cockpit/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/alert-manager/contact-points`, + urlParams: marshalling.urlParams( + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + [ + "project_id", + request.projectId ?? this.client.settings.defaultProjectId + ] + ) + }, + marshalling_gen.unmarshalListContactPointsResponse + ); /** - * List options. List all options matching with filters. + * List contact points. Retrieve a list of contact points for the specified + * Project. The response lists all contact points and receivers created in + * Grafana or via the API. * - * @param request - The request {@link ListOptionsRequest} - * @returns A Promise of ListOptionsResponse + * @param request - The request {@link RegionalApiListContactPointsRequest} + * @returns A Promise of ListContactPointsResponse */ - listOptions = (request = {}) => enrichForPagination('options', this.pageOfListOptions, request); - pageOfListSettings = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/settings`, - urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId ?? this.client.settings.defaultProjectId]) - }, unmarshalListSettingsResponse); - + listContactPoints = (request = {}) => resourcePaginator.enrichForPagination("contactPoints", this.pageOfListContactPoints, request); /** - * List all settings. Return all settings for a Project ID. + * Delete a contact point. Delete a contact point associated with the default + * receiver. * - * @param request - The request {@link ListSettingsRequest} - * @returns A Promise of ListSettingsResponse + * @param request - The request {@link RegionalApiDeleteContactPointRequest} */ - listSettings = (request = {}) => enrichForPagination('settings', this.pageOfListSettings, request); - + deleteContactPoint = (request = {}) => this.client.fetch({ + body: JSON.stringify( + marshalling_gen.marshalRegionalApiDeleteContactPointRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/cockpit/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/alert-manager/contact-points/delete` + }); + pageOfListManagedAlerts = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/cockpit/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/managed-alerts`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + [ + "project_id", + request.projectId ?? this.client.settings.defaultProjectId + ] + ) + }, + marshalling_gen.unmarshalListManagedAlertsResponse + ); + /** + * List managed alerts. List all managed alerts for the specified Project. + * + * @param request - The request {@link RegionalApiListManagedAlertsRequest} + * @returns A Promise of ListManagedAlertsResponse + */ + listManagedAlerts = (request = {}) => resourcePaginator.enrichForPagination("alerts", this.pageOfListManagedAlerts, request); + /** + * Enable managed alerts. Enable the sending of managed alerts for the + * specified Project. Managed alerts are predefined alerts that apply to + * Scaleway recources integrated with Cockpit by default. + * + * @param request - The request {@link RegionalApiEnableManagedAlertsRequest} + * @returns A Promise of AlertManager + */ + enableManagedAlerts = (request = {}) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalRegionalApiEnableManagedAlertsRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/cockpit/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/alert-manager/managed-alerts/enable` + }, + marshalling_gen.unmarshalAlertManager + ); + /** + * Disable managed alerts. Disable the sending of managed alerts for the + * specified Project. + * + * @param request - The request {@link RegionalApiDisableManagedAlertsRequest} + * @returns A Promise of AlertManager + */ + disableManagedAlerts = (request = {}) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalRegionalApiDisableManagedAlertsRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/cockpit/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/alert-manager/managed-alerts/disable` + }, + marshalling_gen.unmarshalAlertManager + ); /** - * Update setting. Update a setting for a Project ID (enable or disable). + * Trigger a test alert. Send a test alert to the Alert manager to make sure + * your contact points get notified. * - * @param request - The request {@link UpdateSettingRequest} - * @returns A Promise of Setting + * @param request - The request {@link RegionalApiTriggerTestAlertRequest} */ - updateSetting = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateSettingRequest(request, this.client.settings)), - headers: jsonContentHeaders$p, - method: 'PATCH', - path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/settings/${validatePathParam('settingId', request.settingId)}` - }, unmarshalSetting); - pageOfListOS = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/os`, - urlParams: urlParams(['offer_id', request.offerId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]) - }, unmarshalListOSResponse); + triggerTestAlert = (request = {}) => this.client.fetch({ + body: JSON.stringify( + marshalling_gen.marshalRegionalApiTriggerTestAlertRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/cockpit/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/alert-manager/trigger-test-alert` + }); +} +exports.GlobalAPI = GlobalAPI; +exports.RegionalAPI = RegionalAPI; - /** - * List available OSes. List all OSes that are available for installation on - * Elastic Metal servers. - * - * @param request - The request {@link ListOSRequest} - * @returns A Promise of ListOSResponse - */ - listOS = (request = {}) => enrichForPagination('os', this.pageOfListOS, request); - /** - * Get OS with an ID. Return the specific OS for the ID. - * - * @param request - The request {@link GetOSRequest} - * @returns A Promise of OS - */ - getOS = request => this.client.fetch({ - method: 'GET', - path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/os/${validatePathParam('osId', request.osId)}` - }, unmarshalOS); -}; +/***/ }), -/** Elastic Metal Private Network API. */ -class PrivateNetworkAPI extends API$u { - /** Lists the available zones of the API. */ - static LOCALITIES = ['fr-par-2']; +/***/ 5409: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - /** - * Add a server to a Private Network. - * - * @param request - The request - * {@link PrivateNetworkApiAddServerPrivateNetworkRequest} - * @returns A Promise of ServerPrivateNetwork - */ - addServerPrivateNetwork = request => this.client.fetch({ - body: JSON.stringify(marshalPrivateNetworkApiAddServerPrivateNetworkRequest(request, this.client.settings)), - headers: jsonContentHeaders$p, - method: 'POST', - path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/private-networks` - }, unmarshalServerPrivateNetwork); +"use strict"; - /** - * Set multiple Private Networks on a server. - * - * @param request - The request - * {@link PrivateNetworkApiSetServerPrivateNetworksRequest} - * @returns A Promise of SetServerPrivateNetworksResponse - */ - setServerPrivateNetworks = request => this.client.fetch({ - body: JSON.stringify(marshalPrivateNetworkApiSetServerPrivateNetworksRequest(request, this.client.settings)), - headers: jsonContentHeaders$p, - method: 'PUT', - path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/private-networks` - }, unmarshalSetServerPrivateNetworksResponse); - pageOfListServerPrivateNetworks = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/server-private-networks`, - urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['private_network_id', request.privateNetworkId], ['project_id', request.projectId], ['server_id', request.serverId]) - }, unmarshalListServerPrivateNetworksResponse); +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api_gen = __nccwpck_require__(4925); +const validationRules_gen = __nccwpck_require__(232); +exports.GlobalAPI = api_gen.GlobalAPI; +exports.RegionalAPI = api_gen.RegionalAPI; +exports.ValidationRules = validationRules_gen; - /** - * List the Private Networks of a server. - * - * @param request - The request - * {@link PrivateNetworkApiListServerPrivateNetworksRequest} - * @returns A Promise of ListServerPrivateNetworksResponse - */ - listServerPrivateNetworks = (request = {}) => enrichForPagination('serverPrivateNetworks', this.pageOfListServerPrivateNetworks, request); - /** - * Delete a Private Network. - * - * @param request - The request - * {@link PrivateNetworkApiDeleteServerPrivateNetworkRequest} - */ - deleteServerPrivateNetwork = request => this.client.fetch({ - method: 'DELETE', - path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}` - }); -} +/***/ }), -class BaremetalV1UtilsAPI extends API$r { - /** - * Waits for {@link ServerInstall} to be in a final state. - * - * @param request - The request {@link GetServerRequest} - * @param options - The waiting options - * @returns A Promise of ServerInstall - */ - waitForServerInstall = (request, options) => tryAtIntervals(async () => { - const value = await this.getServer(request).then(server => { - if (!server.install) { - throw new Error(`Server creation has not begun for server ${request.serverId}`); - } - return server.install; - }); - return { - done: !SERVER_INSTALL_TRANSIENT_STATUSES.includes(value.status), - value - }; - }, createExponentialBackoffStrategy(options?.minDelay ?? 1, options?.maxDelay ?? 30), options?.timeout); -} +/***/ 8427: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. +"use strict"; -const CreateServerRequest = { - description: { - maxLength: 255 - }, - name: { - minLength: 1 +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const json = __nccwpck_require__(3746); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const unmarshalContactPointEmail = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ContactPointEmail' failed as data isn't a dictionary.` + ); } + return { + to: data.to + }; }; -const CreateServerRequestInstall = { - hostname: { - maxLength: 255 - }, - password: { - maxLength: 255 - }, - servicePassword: { - maxLength: 255 - }, - serviceUser: { - maxLength: 255 - }, - user: { - maxLength: 255 +const unmarshalContactPoint = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ContactPoint' failed as data isn't a dictionary.` + ); } + return { + email: data.email ? unmarshalContactPointEmail(data.email) : void 0, + region: data.region + }; }; -const InstallServerRequest = { - hostname: { - maxLength: 255 - }, - password: { - maxLength: 255 - }, - servicePassword: { - maxLength: 255 - }, - serviceUser: { - maxLength: 255 - }, - user: { - maxLength: 255 +const unmarshalDataSource = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DataSource' failed as data isn't a dictionary.` + ); } + return { + createdAt: marshalling.unmarshalDate(data.created_at), + id: data.id, + name: data.name, + origin: data.origin, + projectId: data.project_id, + region: data.region, + synchronizedWithGrafana: data.synchronized_with_grafana, + type: data.type, + updatedAt: marshalling.unmarshalDate(data.updated_at), + url: data.url + }; }; -const ListOSRequest = { - page: { - greaterThan: 0 - }, - pageSize: { - greaterThan: 0, - lessThanOrEqual: 100 +const unmarshalGrafanaProductDashboard = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'GrafanaProductDashboard' failed as data isn't a dictionary.` + ); } + return { + name: data.name, + tags: data.tags, + title: data.title, + url: data.url, + variables: data.variables + }; }; -const ListOffersRequest = { - page: { - greaterThan: 0 - }, - pageSize: { - greaterThan: 0, - lessThanOrEqual: 100 +const unmarshalGrafanaUser = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'GrafanaUser' failed as data isn't a dictionary.` + ); } + return { + id: data.id, + login: data.login, + password: data.password, + role: data.role + }; }; -const ListOptionsRequest = { - page: { - greaterThan: 0 - }, - pageSize: { - greaterThan: 0, - lessThanOrEqual: 100 +const unmarshalPlan = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Plan' failed as data isn't a dictionary.` + ); } + return { + logsIngestionPrice: data.logs_ingestion_price, + monthlyPrice: data.monthly_price, + name: data.name, + retentionLogsInterval: data.retention_logs_interval, + retentionMetricsInterval: data.retention_metrics_interval, + retentionTracesInterval: data.retention_traces_interval, + sampleIngestionPrice: data.sample_ingestion_price, + tracesIngestionPrice: data.traces_ingestion_price + }; }; -const ListServerEventsRequest = { - page: { - greaterThan: 0 - }, - pageSize: { - greaterThan: 0, - lessThanOrEqual: 100 +const unmarshalToken = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Token' failed as data isn't a dictionary.` + ); } + return { + createdAt: marshalling.unmarshalDate(data.created_at), + id: data.id, + name: data.name, + projectId: data.project_id, + region: data.region, + scopes: data.scopes, + secretKey: data.secret_key, + updatedAt: marshalling.unmarshalDate(data.updated_at) + }; }; -const ListServersRequest = { - page: { - greaterThan: 0 - }, - pageSize: { - greaterThan: 0, - lessThanOrEqual: 100 - } -}; -const ListSettingsRequest = { - page: { - greaterThan: 0 - }, - pageSize: { - greaterThan: 0, - lessThanOrEqual: 100 - } -}; -const UpdateServerRequest = { - description: { - maxLength: 255 - }, - name: { - maxLength: 255 - } -}; - -var validationRules_gen$8 = /*#__PURE__*/Object.freeze({ - __proto__: null, - CreateServerRequest: CreateServerRequest, - CreateServerRequestInstall: CreateServerRequestInstall, - InstallServerRequest: InstallServerRequest, - ListOSRequest: ListOSRequest, - ListOffersRequest: ListOffersRequest, - ListOptionsRequest: ListOptionsRequest, - ListServerEventsRequest: ListServerEventsRequest, - ListServersRequest: ListServersRequest, - ListSettingsRequest: ListSettingsRequest, - UpdateServerRequest: UpdateServerRequest -}); - -var index$t = /*#__PURE__*/Object.freeze({ - __proto__: null, - API: BaremetalV1UtilsAPI, - PrivateNetworkAPI: PrivateNetworkAPI, - SERVER_INSTALL_TRANSIENT_STATUSES: SERVER_INSTALL_TRANSIENT_STATUSES, - SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES: SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES, - SERVER_TRANSIENT_STATUSES: SERVER_TRANSIENT_STATUSES$1, - ValidationRules: validationRules_gen$8 -}); - -var index$s = /*#__PURE__*/Object.freeze({ - __proto__: null, - v1: index$t -}); - -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const unmarshalGetConsumptionResponseConsumption = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'GetConsumptionResponseConsumption' failed as data isn't a dictionary.`); - } - return { - category: data.category, - description: data.description, - operationPath: data.operation_path, - projectId: data.project_id, - value: data.value ? unmarshalMoney(data.value) : undefined - }; -}; -const unmarshalInvoice = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Invoice' failed as data isn't a dictionary.`); +const unmarshalAlertManager = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'AlertManager' failed as data isn't a dictionary.` + ); } return { - dueDate: unmarshalDate(data.due_date), - id: data.id, - invoiceType: data.invoice_type, - issuedDate: unmarshalDate(data.issued_date), - number: data.number, - startDate: unmarshalDate(data.start_date), - totalTaxed: data.total_taxed ? unmarshalMoney(data.total_taxed) : undefined, - totalUntaxed: data.total_untaxed ? unmarshalMoney(data.total_untaxed) : undefined + alertManagerEnabled: data.alert_manager_enabled, + alertManagerUrl: data.alert_manager_url, + managedAlertsEnabled: data.managed_alerts_enabled, + region: data.region }; }; -const unmarshalGetConsumptionResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'GetConsumptionResponse' failed as data isn't a dictionary.`); +const unmarshalGrafana = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Grafana' failed as data isn't a dictionary.` + ); } return { - consumptions: unmarshalArrayOfObject(data.consumptions, unmarshalGetConsumptionResponseConsumption), - updatedAt: unmarshalDate(data.updated_at) + grafanaUrl: data.grafana_url }; }; -const unmarshalListInvoicesResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListInvoicesResponse' failed as data isn't a dictionary.`); +const unmarshalListContactPointsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListContactPointsResponse' failed as data isn't a dictionary.` + ); } return { - invoices: unmarshalArrayOfObject(data.invoices, unmarshalInvoice), + contactPoints: marshalling.unmarshalArrayOfObject( + data.contact_points, + unmarshalContactPoint + ), + hasAdditionalContactPoints: data.has_additional_contact_points, + hasAdditionalReceivers: data.has_additional_receivers, totalCount: data.total_count }; }; - -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -/** - * Billing API. - * - * This API allows you to query your consumption. Billing API. - */ -let API$q = class API extends API$u { - /** - * Get current month's consumption. The consumption reflects the amount of - * money you have spent for the products you have used. The consumption value - * is monetary and is not computed in real time. - * - * @param request - The request {@link GetConsumptionRequest} - * @returns A Promise of GetConsumptionResponse - */ - getConsumption = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/billing/v2alpha1/consumption`, - urlParams: urlParams(['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId]) - }, unmarshalGetConsumptionResponse); - pageOfListInvoices = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/billing/v2alpha1/invoices`, - urlParams: urlParams(['invoice_type', request.invoiceType ?? 'unknown_type'], ['order_by', request.orderBy ?? 'invoice_number_desc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['started_after', request.startedAfter], ['started_before', request.startedBefore]) - }, unmarshalListInvoicesResponse); - - /** - * List invoices. List all your invoices, filtering by `start_date` and - * `invoice_type`. Each invoice has its own ID. - * - * @param request - The request {@link ListInvoicesRequest} - * @returns A Promise of ListInvoicesResponse - */ - listInvoices = (request = {}) => enrichForPagination('invoices', this.pageOfListInvoices, request); - - /** - * Download an invoice. Download a specific invoice, specified by its ID. - * - * @param request - The request {@link DownloadInvoiceRequest} - * @returns A Promise of Blob - */ - downloadInvoice = request => this.client.fetch({ - method: 'GET', - path: `/billing/v2alpha1/invoices/${validatePathParam('invoiceId', request.invoiceId)}/download`, - urlParams: urlParams(['dl', 1], ['file_type', request.fileType ?? 'pdf']), - responseType: 'blob' - }); -}; - -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. - -var index_gen$o = /*#__PURE__*/Object.freeze({ - __proto__: null, - API: API$q -}); - -var index$r = /*#__PURE__*/Object.freeze({ - __proto__: null, - v2alpha1: index_gen$o -}); - -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. - -/** Lists transient statutes of the enum {@link ReferenceStatus}. */ -const REFERENCE_TRANSIENT_STATUSES = ['attaching', 'detaching', 'snapshotting']; - -/** Lists transient statutes of the enum {@link SnapshotStatus}. */ -const SNAPSHOT_TRANSIENT_STATUSES$3 = ['creating', 'deleting']; - -/** Lists transient statutes of the enum {@link VolumeStatus}. */ -const VOLUME_TRANSIENT_STATUSES$1 = ['creating', 'deleting', 'resizing', 'snapshotting']; - -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const unmarshalReference = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Reference' failed as data isn't a dictionary.`); - } - return { - createdAt: unmarshalDate(data.created_at), - id: data.id, - productResourceId: data.product_resource_id, - productResourceType: data.product_resource_type, - status: data.status, - type: data.type - }; -}; -const unmarshalSnapshotParentVolume = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'SnapshotParentVolume' failed as data isn't a dictionary.`); +const unmarshalListDataSourcesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListDataSourcesResponse' failed as data isn't a dictionary.` + ); } return { - id: data.id, - name: data.name, - status: data.status, - type: data.type + dataSources: marshalling.unmarshalArrayOfObject(data.data_sources, unmarshalDataSource), + totalCount: data.total_count }; }; -const unmarshalVolumeSpecifications = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'VolumeSpecifications' failed as data isn't a dictionary.`); +const unmarshalListGrafanaProductDashboardsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListGrafanaProductDashboardsResponse' failed as data isn't a dictionary.` + ); } return { - class: data.class, - perfIops: data.perf_iops + dashboards: marshalling.unmarshalArrayOfObject( + data.dashboards, + unmarshalGrafanaProductDashboard + ), + totalCount: data.total_count }; }; -const unmarshalSnapshotSummary = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'SnapshotSummary' failed as data isn't a dictionary.`); +const unmarshalListGrafanaUsersResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListGrafanaUsersResponse' failed as data isn't a dictionary.` + ); } return { - class: data.class, - createdAt: unmarshalDate(data.created_at), - id: data.id, - name: data.name, - parentVolume: data.parent_volume ? unmarshalSnapshotParentVolume(data.parent_volume) : undefined, - projectId: data.project_id, - size: data.size, - status: data.status, - tags: data.tags, - updatedAt: unmarshalDate(data.updated_at), - zone: data.zone + grafanaUsers: marshalling.unmarshalArrayOfObject( + data.grafana_users, + unmarshalGrafanaUser + ), + totalCount: data.total_count }; }; -const unmarshalVolume$4 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Volume' failed as data isn't a dictionary.`); +const unmarshalAlert = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Alert' failed as data isn't a dictionary.` + ); } return { - createdAt: unmarshalDate(data.created_at), - id: data.id, + description: data.description, name: data.name, - parentSnapshotId: data.parent_snapshot_id, - projectId: data.project_id, - references: unmarshalArrayOfObject(data.references, unmarshalReference), - size: data.size, - specs: data.specs ? unmarshalVolumeSpecifications(data.specs) : undefined, - status: data.status, - tags: data.tags, - type: data.type, - updatedAt: unmarshalDate(data.updated_at), - zone: data.zone + product: data.product, + productFamily: data.product_family, + rule: data.rule }; }; -const unmarshalVolumeType$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'VolumeType' failed as data isn't a dictionary.`); +const unmarshalListManagedAlertsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListManagedAlertsResponse' failed as data isn't a dictionary.` + ); } return { - pricing: data.pricing ? unmarshalMoney(data.pricing) : undefined, - snapshotPricing: data.snapshot_pricing ? unmarshalMoney(data.snapshot_pricing) : undefined, - specs: data.specs ? unmarshalVolumeSpecifications(data.specs) : undefined, - type: data.type + alerts: marshalling.unmarshalArrayOfObject(data.alerts, unmarshalAlert), + totalCount: data.total_count }; }; -const unmarshalListSnapshotsResponse$3 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListSnapshotsResponse' failed as data isn't a dictionary.`); +const unmarshalListPlansResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListPlansResponse' failed as data isn't a dictionary.` + ); } return { - snapshots: unmarshalArrayOfObject(data.snapshots, unmarshalSnapshotSummary), + plans: marshalling.unmarshalArrayOfObject(data.plans, unmarshalPlan), totalCount: data.total_count }; }; -const unmarshalListVolumeTypesResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListVolumeTypesResponse' failed as data isn't a dictionary.`); +const unmarshalListTokensResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListTokensResponse' failed as data isn't a dictionary.` + ); } return { - totalCount: data.total_count, - volumeTypes: unmarshalArrayOfObject(data.volume_types, unmarshalVolumeType$1) + tokens: marshalling.unmarshalArrayOfObject(data.tokens, unmarshalToken), + totalCount: data.total_count }; }; -const unmarshalListVolumesResponse$2 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListVolumesResponse' failed as data isn't a dictionary.`); +const unmarshalUsage = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Usage' failed as data isn't a dictionary.` + ); } return { - totalCount: data.total_count, - volumes: unmarshalArrayOfObject(data.volumes, unmarshalVolume$4) + dataSourceId: data.data_source_id, + dataSourceOrigin: data.data_source_origin, + dataSourceType: data.data_source_type, + interval: data.interval, + projectId: data.project_id, + quantityOverInterval: data.quantity_over_interval, + region: data.region, + unit: data.unit }; }; -const unmarshalSnapshot$3 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Snapshot' failed as data isn't a dictionary.`); +const unmarshalUsageOverview = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'UsageOverview' failed as data isn't a dictionary.` + ); } return { - class: data.class, - createdAt: unmarshalDate(data.created_at), - id: data.id, - name: data.name, - parentVolume: data.parent_volume ? unmarshalSnapshotParentVolume(data.parent_volume) : undefined, - projectId: data.project_id, - references: unmarshalArrayOfObject(data.references, unmarshalReference), - size: data.size, - status: data.status, - tags: data.tags, - updatedAt: unmarshalDate(data.updated_at), - zone: data.zone + externalLogsUsage: data.external_logs_usage ? unmarshalUsage(data.external_logs_usage) : void 0, + externalMetricsUsage: data.external_metrics_usage ? unmarshalUsage(data.external_metrics_usage) : void 0, + externalTracesUsage: data.external_traces_usage ? unmarshalUsage(data.external_traces_usage) : void 0, + scalewayLogsUsage: data.scaleway_logs_usage ? unmarshalUsage(data.scaleway_logs_usage) : void 0, + scalewayMetricsUsage: data.scaleway_metrics_usage ? unmarshalUsage(data.scaleway_metrics_usage) : void 0 }; }; -const marshalCreateVolumeRequestFromEmpty = (request, defaults) => ({ - size: request.size +const marshalGlobalApiCreateGrafanaUserRequest = (request, defaults) => ({ + login: request.login, + project_id: request.projectId ?? defaults.defaultProjectId, + role: request.role }); -const marshalCreateVolumeRequestFromSnapshot = (request, defaults) => ({ - size: request.size, - snapshot_id: request.snapshotId +const marshalGlobalApiResetGrafanaUserPasswordRequest = (request, defaults) => ({ + project_id: request.projectId ?? defaults.defaultProjectId }); -const marshalCreateSnapshotRequest$3 = (request, defaults) => ({ - name: request.name, +const marshalGlobalApiSelectPlanRequest = (request, defaults) => ({ + plan_name: request.planName, + project_id: request.projectId ?? defaults.defaultProjectId +}); +const marshalGlobalApiSyncGrafanaDataSourcesRequest = (request, defaults) => ({ + project_id: request.projectId ?? defaults.defaultProjectId +}); +const marshalContactPointEmail = (request, defaults) => ({ + to: request.to +}); +const marshalRegionalApiCreateContactPointRequest = (request, defaults) => ({ project_id: request.projectId ?? defaults.defaultProjectId, - tags: request.tags, - volume_id: request.volumeId + ...marshalling.resolveOneOf([ + { + param: "email", + value: request.email !== void 0 ? marshalContactPointEmail(request.email) : void 0 + } + ]) }); -const marshalCreateVolumeRequest$2 = (request, defaults) => ({ +const marshalRegionalApiCreateDataSourceRequest = (request, defaults) => ({ name: request.name, project_id: request.projectId ?? defaults.defaultProjectId, - tags: request.tags, - ...resolveOneOf([{ - param: 'from_empty', - value: request.fromEmpty ? marshalCreateVolumeRequestFromEmpty(request.fromEmpty) : undefined - }, { - param: 'from_snapshot', - value: request.fromSnapshot ? marshalCreateVolumeRequestFromSnapshot(request.fromSnapshot) : undefined - }]), - ...resolveOneOf([{ - param: 'perf_iops', - value: request.perfIops - }], true) + type: request.type }); -const marshalImportSnapshotFromS3Request = (request, defaults) => ({ - bucket: request.bucket, - key: request.key, +const marshalRegionalApiCreateTokenRequest = (request, defaults) => ({ name: request.name, project_id: request.projectId ?? defaults.defaultProjectId, - tags: request.tags + token_scopes: request.tokenScopes !== void 0 ? request.tokenScopes : void 0 }); -const marshalUpdateSnapshotRequest$2 = (request, defaults) => ({ - name: request.name, - tags: request.tags +const marshalRegionalApiDeleteContactPointRequest = (request, defaults) => ({ + project_id: request.projectId ?? defaults.defaultProjectId, + ...marshalling.resolveOneOf([ + { + param: "email", + value: request.email !== void 0 ? marshalContactPointEmail(request.email) : void 0 + } + ]) }); -const marshalUpdateVolumeRequest$2 = (request, defaults) => ({ - name: request.name, - perf_iops: request.perfIops, - size: request.size, - tags: request.tags +const marshalRegionalApiDisableAlertManagerRequest = (request, defaults) => ({ + project_id: request.projectId ?? defaults.defaultProjectId +}); +const marshalRegionalApiDisableManagedAlertsRequest = (request, defaults) => ({ + project_id: request.projectId ?? defaults.defaultProjectId +}); +const marshalRegionalApiEnableAlertManagerRequest = (request, defaults) => ({ + project_id: request.projectId ?? defaults.defaultProjectId +}); +const marshalRegionalApiEnableManagedAlertsRequest = (request, defaults) => ({ + project_id: request.projectId ?? defaults.defaultProjectId +}); +const marshalRegionalApiTriggerTestAlertRequest = (request, defaults) => ({ + project_id: request.projectId ?? defaults.defaultProjectId +}); +const marshalRegionalApiUpdateDataSourceRequest = (request, defaults) => ({ + name: request.name }); +exports.marshalGlobalApiCreateGrafanaUserRequest = marshalGlobalApiCreateGrafanaUserRequest; +exports.marshalGlobalApiResetGrafanaUserPasswordRequest = marshalGlobalApiResetGrafanaUserPasswordRequest; +exports.marshalGlobalApiSelectPlanRequest = marshalGlobalApiSelectPlanRequest; +exports.marshalGlobalApiSyncGrafanaDataSourcesRequest = marshalGlobalApiSyncGrafanaDataSourcesRequest; +exports.marshalRegionalApiCreateContactPointRequest = marshalRegionalApiCreateContactPointRequest; +exports.marshalRegionalApiCreateDataSourceRequest = marshalRegionalApiCreateDataSourceRequest; +exports.marshalRegionalApiCreateTokenRequest = marshalRegionalApiCreateTokenRequest; +exports.marshalRegionalApiDeleteContactPointRequest = marshalRegionalApiDeleteContactPointRequest; +exports.marshalRegionalApiDisableAlertManagerRequest = marshalRegionalApiDisableAlertManagerRequest; +exports.marshalRegionalApiDisableManagedAlertsRequest = marshalRegionalApiDisableManagedAlertsRequest; +exports.marshalRegionalApiEnableAlertManagerRequest = marshalRegionalApiEnableAlertManagerRequest; +exports.marshalRegionalApiEnableManagedAlertsRequest = marshalRegionalApiEnableManagedAlertsRequest; +exports.marshalRegionalApiTriggerTestAlertRequest = marshalRegionalApiTriggerTestAlertRequest; +exports.marshalRegionalApiUpdateDataSourceRequest = marshalRegionalApiUpdateDataSourceRequest; +exports.unmarshalAlertManager = unmarshalAlertManager; +exports.unmarshalContactPoint = unmarshalContactPoint; +exports.unmarshalDataSource = unmarshalDataSource; +exports.unmarshalGrafana = unmarshalGrafana; +exports.unmarshalGrafanaProductDashboard = unmarshalGrafanaProductDashboard; +exports.unmarshalGrafanaUser = unmarshalGrafanaUser; +exports.unmarshalListContactPointsResponse = unmarshalListContactPointsResponse; +exports.unmarshalListDataSourcesResponse = unmarshalListDataSourcesResponse; +exports.unmarshalListGrafanaProductDashboardsResponse = unmarshalListGrafanaProductDashboardsResponse; +exports.unmarshalListGrafanaUsersResponse = unmarshalListGrafanaUsersResponse; +exports.unmarshalListManagedAlertsResponse = unmarshalListManagedAlertsResponse; +exports.unmarshalListPlansResponse = unmarshalListPlansResponse; +exports.unmarshalListTokensResponse = unmarshalListTokensResponse; +exports.unmarshalPlan = unmarshalPlan; +exports.unmarshalToken = unmarshalToken; +exports.unmarshalUsageOverview = unmarshalUsageOverview; + + +/***/ }), + +/***/ 232: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const jsonContentHeaders$o = { - 'Content-Type': 'application/json; charset=utf-8' +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const RegionalApiCreateDataSourceRequest = { + name: { + maxLength: 50, + minLength: 3, + pattern: /^[A-Za-z0-9-_. ]+$/ + } +}; +const RegionalApiCreateTokenRequest = { + name: { + maxLength: 50, + minLength: 3, + pattern: /^[A-Za-z0-9-_]+$/ + } +}; +const RegionalApiListContactPointsRequest = { + page: { + greaterThanOrEqual: 1 + }, + pageSize: { + greaterThanOrEqual: 1, + lessThanOrEqual: 1e3 + } +}; +const RegionalApiListDataSourcesRequest = { + page: { + greaterThanOrEqual: 1 + }, + pageSize: { + greaterThanOrEqual: 1, + lessThanOrEqual: 1e3 + } +}; +const RegionalApiListManagedAlertsRequest = { + page: { + greaterThanOrEqual: 1 + }, + pageSize: { + greaterThanOrEqual: 1, + lessThanOrEqual: 1e3 + } +}; +const RegionalApiListTokensRequest = { + page: { + greaterThanOrEqual: 1 + }, + pageSize: { + greaterThanOrEqual: 1, + lessThanOrEqual: 1e3 + } +}; +const RegionalApiUpdateDataSourceRequest = { + name: { + maxLength: 50, + minLength: 3, + pattern: /^[A-Za-z0-9-_. ]+$/ + } }; +exports.RegionalApiCreateDataSourceRequest = RegionalApiCreateDataSourceRequest; +exports.RegionalApiCreateTokenRequest = RegionalApiCreateTokenRequest; +exports.RegionalApiListContactPointsRequest = RegionalApiListContactPointsRequest; +exports.RegionalApiListDataSourcesRequest = RegionalApiListDataSourcesRequest; +exports.RegionalApiListManagedAlertsRequest = RegionalApiListManagedAlertsRequest; +exports.RegionalApiListTokensRequest = RegionalApiListTokensRequest; +exports.RegionalApiUpdateDataSourceRequest = RegionalApiUpdateDataSourceRequest; -/** - * Scaleway Block Storage API. - * - * This API allows you to use and manage your Block Storage volumes. Scaleway - * Block Storage API. - */ -let API$p = class API extends API$u { - /** Lists the available zones of the API. */ - static LOCALITIES = ['fr-par-1', 'pl-waw-3']; - pageOfListVolumeTypes = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/volume-types`, - urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]) - }, unmarshalListVolumeTypesResponse); - /** - * List volume types. List all available volume types in a specified zone. The - * volume types listed are ordered by name in ascending order. - * - * @param request - The request {@link ListVolumeTypesRequest} - * @returns A Promise of ListVolumeTypesResponse - */ - listVolumeTypes = (request = {}) => enrichForPagination('volumeTypes', this.pageOfListVolumeTypes, request); - pageOfListVolumes = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/volumes`, - urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['product_resource_id', request.productResourceId], ['project_id', request.projectId]) - }, unmarshalListVolumesResponse$2); +/***/ }), + +/***/ 374: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const intervalRetrier = __nccwpck_require__(9052); +const api = __nccwpck_require__(3042); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const resourcePaginator = __nccwpck_require__(4983); +const content_gen = __nccwpck_require__(3625); +const marshalling_gen = __nccwpck_require__(3219); +const jsonContentHeaders = { + "Content-Type": "application/json; charset=utf-8" +}; +class API extends api.API { /** - * List volumes. List all existing volumes in a specified zone. By default, - * the volumes listed are ordered by creation date in ascending order. This - * can be modified via the `order_by` field. + * Activate the Cockpit of a given Project specified by the Project ID. * - * @param request - The request {@link ListVolumesRequest} - * @returns A Promise of ListVolumesResponse + * @param request - The request {@link ActivateCockpitRequest} + * @returns A Promise of Cockpit */ - listVolumes = (request = {}) => enrichForPagination('volumes', this.pageOfListVolumes, request); - + activateCockpit = (request = {}) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalActivateCockpitRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/cockpit/v1beta1/activate` + }, + marshalling_gen.unmarshalCockpit + ); /** - * Create a volume. To create a new volume from scratch, you must specify - * `from_empty` and the `size`. To create a volume from an existing snapshot, - * specify `from_snapshot` and the `snapshot_id` in the request payload - * instead, size is optional and can be specified if you need to extend the - * original size. The volume will take on the same volume class and underlying - * IOPS limitations as the original snapshot. + * Retrieve the Cockpit of a given Project specified by the Project ID. * - * @param request - The request {@link CreateVolumeRequest} - * @returns A Promise of Volume + * @param request - The request {@link GetCockpitRequest} + * @returns A Promise of Cockpit */ - createVolume = request => this.client.fetch({ - body: JSON.stringify(marshalCreateVolumeRequest$2(request, this.client.settings)), - headers: jsonContentHeaders$o, - method: 'POST', - path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/volumes` - }, unmarshalVolume$4); - + getCockpit = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/cockpit/v1beta1/cockpit`, + urlParams: marshalling.urlParams([ + "project_id", + request.projectId ?? this.client.settings.defaultProjectId + ]) + }, + marshalling_gen.unmarshalCockpit + ); /** - * Get a volume. Retrieve technical information about a specific volume. - * Details such as size, type, and status are returned in the response. + * Waits for {@link Cockpit} to be in a final state. * - * @param request - The request {@link GetVolumeRequest} - * @returns A Promise of Volume + * @param request - The request {@link GetCockpitRequest} + * @param options - The waiting options + * @returns A Promise of Cockpit */ - getVolume = request => this.client.fetch({ - method: 'GET', - path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/volumes/${validatePathParam('volumeId', request.volumeId)}` - }, unmarshalVolume$4); - + waitForCockpit = (request = {}, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve(!content_gen.COCKPIT_TRANSIENT_STATUSES.includes(res.status))), + this.getCockpit, + request, + options + ); /** - * Waits for {@link Volume} to be in a final state. + * Retrieve metrics from your Cockpit specified by the ID of the Project the + * Cockpit belongs to. * - * @param request - The request {@link GetVolumeRequest} - * @param options - The waiting options - * @returns A Promise of Volume + * @param request - The request {@link GetCockpitMetricsRequest} + * @returns A Promise of CockpitMetrics */ - waitForVolume = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!VOLUME_TRANSIENT_STATUSES$1.includes(res.status))), this.getVolume, request, options); - + getCockpitMetrics = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/cockpit/v1beta1/cockpit/metrics`, + urlParams: marshalling.urlParams( + ["end_date", request.endDate], + ["metric_name", request.metricName], + [ + "project_id", + request.projectId ?? this.client.settings.defaultProjectId + ], + ["start_date", request.startDate] + ) + }, + marshalling_gen.unmarshalCockpitMetrics + ); /** - * Delete a detached volume. You must specify the `volume_id` of the volume - * you want to delete. The volume must not be in the `in_use` status. + * Deactivate the Cockpit of a given Project specified by the Project ID. * - * @param request - The request {@link DeleteVolumeRequest} + * @param request - The request {@link DeactivateCockpitRequest} + * @returns A Promise of Cockpit + */ + deactivateCockpit = (request = {}) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalDeactivateCockpitRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/cockpit/v1beta1/deactivate` + }, + marshalling_gen.unmarshalCockpit + ); + /** + * Create a data source for a given Project specified by the Project ID and + * the data source type. + * + * @param request - The request {@link CreateDatasourceRequest} + * @returns A Promise of Datasource + */ + createDatasource = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateDatasourceRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/cockpit/v1beta1/datasources` + }, + marshalling_gen.unmarshalDatasource + ); + /** + * Delete a given data source specified by the data source ID. + * + * @param request - The request {@link DeleteDatasourceRequest} */ - deleteVolume = request => this.client.fetch({ - method: 'DELETE', - path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/volumes/${validatePathParam('volumeId', request.volumeId)}` + deleteDatasource = (request) => this.client.fetch({ + method: "DELETE", + path: `/cockpit/v1beta1/datasources/${marshalling.validatePathParam("datasourceId", request.datasourceId)}` }); - + pageOfListDatasources = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/cockpit/v1beta1/datasources`, + urlParams: marshalling.urlParams( + ["is_managed_by_scaleway", request.isManagedByScaleway], + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + [ + "project_id", + request.projectId ?? this.client.settings.defaultProjectId + ], + ["types", request.types] + ) + }, + marshalling_gen.unmarshalListDatasourcesResponse + ); /** - * Update a volume. Update the technical details of a volume, such as its - * name, tags, or its new size and `volume_type` (within the same Block - * Storage class). You can only resize a volume to a larger size. It is - * currently not possible to change your Block Storage Class. + * Get a list of data sources for the specified Project ID. * - * @param request - The request {@link UpdateVolumeRequest} - * @returns A Promise of Volume + * @param request - The request {@link ListDatasourcesRequest} + * @returns A Promise of ListDatasourcesResponse */ - updateVolume = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateVolumeRequest$2(request, this.client.settings)), - headers: jsonContentHeaders$o, - method: 'PATCH', - path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/volumes/${validatePathParam('volumeId', request.volumeId)}` - }, unmarshalVolume$4); - pageOfListSnapshots = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/snapshots`, - urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId], ['volume_id', request.volumeId]) - }, unmarshalListSnapshotsResponse$3); - + listDatasources = (request = {}) => resourcePaginator.enrichForPagination("datasources", this.pageOfListDatasources, request); /** - * List all snapshots. List all available snapshots in a specified zone. By - * default, the snapshots listed are ordered by creation date in ascending - * order. This can be modified via the `order_by` field. + * Create a token in a given Project specified by the Project ID. * - * @param request - The request {@link ListSnapshotsRequest} - * @returns A Promise of ListSnapshotsResponse + * @param request - The request {@link CreateTokenRequest} + * @returns A Promise of Token */ - listSnapshots = (request = {}) => enrichForPagination('snapshots', this.pageOfListSnapshots, request); - + createToken = (request = {}) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateTokenRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/cockpit/v1beta1/tokens` + }, + marshalling_gen.unmarshalToken + ); + pageOfListTokens = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/cockpit/v1beta1/tokens`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + [ + "project_id", + request.projectId ?? this.client.settings.defaultProjectId + ] + ) + }, + marshalling_gen.unmarshalListTokensResponse + ); /** - * Get a snapshot. Retrieve technical information about a specific snapshot. - * Details such as size, volume type, and status are returned in the - * response. + * Get a list of tokens in a given Project specified by the Project ID. * - * @param request - The request {@link GetSnapshotRequest} - * @returns A Promise of Snapshot + * @param request - The request {@link ListTokensRequest} + * @returns A Promise of ListTokensResponse */ - getSnapshot = request => this.client.fetch({ - method: 'GET', - path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam('snapshotId', request.snapshotId)}` - }, unmarshalSnapshot$3); - + listTokens = (request = {}) => resourcePaginator.enrichForPagination("tokens", this.pageOfListTokens, request); /** - * Waits for {@link Snapshot} to be in a final state. + * Retrieve a given token specified by the token ID. * - * @param request - The request {@link GetSnapshotRequest} - * @param options - The waiting options - * @returns A Promise of Snapshot + * @param request - The request {@link GetTokenRequest} + * @returns A Promise of Token */ - waitForSnapshot = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!SNAPSHOT_TRANSIENT_STATUSES$3.includes(res.status))), this.getSnapshot, request, options); - + getToken = (request) => this.client.fetch( + { + method: "GET", + path: `/cockpit/v1beta1/tokens/${marshalling.validatePathParam("tokenId", request.tokenId)}` + }, + marshalling_gen.unmarshalToken + ); /** - * Create a snapshot of a volume. To create a snapshot, the volume must be in - * the `in_use` or the `available` status. If your volume is in a transient - * state, you need to wait until the end of the current operation. + * Delete a given token specified by the token ID. * - * @param request - The request {@link CreateSnapshotRequest} - * @returns A Promise of Snapshot + * @param request - The request {@link DeleteTokenRequest} */ - createSnapshot = request => this.client.fetch({ - body: JSON.stringify(marshalCreateSnapshotRequest$3(request, this.client.settings)), - headers: jsonContentHeaders$o, - method: 'POST', - path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/snapshots` - }, unmarshalSnapshot$3); - importSnapshotFromS3 = request => this.client.fetch({ - body: JSON.stringify(marshalImportSnapshotFromS3Request(request, this.client.settings)), - headers: jsonContentHeaders$o, - method: 'POST', - path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/snapshots/import-from-s3` - }, unmarshalSnapshot$3); - + deleteToken = (request) => this.client.fetch({ + method: "DELETE", + path: `/cockpit/v1beta1/tokens/${marshalling.validatePathParam("tokenId", request.tokenId)}` + }); /** - * Delete a snapshot. You must specify the `snapshot_id` of the snapshot you - * want to delete. The snapshot must not be in use. + * Create a contact point associated with the default receiver, to receive + * alerts. * - * @param request - The request {@link DeleteSnapshotRequest} + * @param request - The request {@link CreateContactPointRequest} + * @returns A Promise of ContactPoint + */ + createContactPoint = (request = {}) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateContactPointRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/cockpit/v1beta1/contact-points` + }, + marshalling_gen.unmarshalContactPoint + ); + pageOfListContactPoints = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/cockpit/v1beta1/contact-points`, + urlParams: marshalling.urlParams( + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + [ + "project_id", + request.projectId ?? this.client.settings.defaultProjectId + ] + ) + }, + marshalling_gen.unmarshalListContactPointsResponse + ); + /** + * Get a list of contact points created for a given Cockpit, specified by the + * ID of the Project the Cockpit belongs to. + * + * @param request - The request {@link ListContactPointsRequest} + * @returns A Promise of ListContactPointsResponse */ - deleteSnapshot = request => this.client.fetch({ - method: 'DELETE', - path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam('snapshotId', request.snapshotId)}` + listContactPoints = (request = {}) => resourcePaginator.enrichForPagination("contactPoints", this.pageOfListContactPoints, request); + /** + * Delete a contact point associated with the default receiver. + * + * @param request - The request {@link DeleteContactPointRequest} + */ + deleteContactPoint = (request = {}) => this.client.fetch({ + body: JSON.stringify( + marshalling_gen.marshalDeleteContactPointRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/cockpit/v1beta1/delete-contact-point` }); - /** - * Update a snapshot. Update the name or tags of the snapshot. + * Enable the sending of managed alerts for a given Cockpit, specified by the + * ID of the Project the Cockpit belongs to. * - * @param request - The request {@link UpdateSnapshotRequest} - * @returns A Promise of Snapshot + * @param request - The request {@link EnableManagedAlertsRequest} */ - updateSnapshot = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateSnapshotRequest$2(request, this.client.settings)), - headers: jsonContentHeaders$o, - method: 'PATCH', - path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam('snapshotId', request.snapshotId)}` - }, unmarshalSnapshot$3); -}; + enableManagedAlerts = (request = {}) => this.client.fetch({ + body: JSON.stringify( + marshalling_gen.marshalEnableManagedAlertsRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/cockpit/v1beta1/enable-managed-alerts` + }); + /** + * Disable the sending of managed alerts for a given Cockpit, specified by the + * ID of the Project the Cockpit belongs to. + * + * @param request - The request {@link DisableManagedAlertsRequest} + */ + disableManagedAlerts = (request = {}) => this.client.fetch({ + body: JSON.stringify( + marshalling_gen.marshalDisableManagedAlertsRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/cockpit/v1beta1/disable-managed-alerts` + }); + /** + * Send a test alert to make sure your contact points get notified when an + * actual alert is triggered. + * + * @param request - The request {@link TriggerTestAlertRequest} + */ + triggerTestAlert = (request = {}) => this.client.fetch({ + body: JSON.stringify( + marshalling_gen.marshalTriggerTestAlertRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/cockpit/v1beta1/trigger-test-alert` + }); + /** + * Create a Grafana user for your Cockpit's Grafana. Make sure you save the + * automatically-generated password and the Grafana user ID. + * + * @param request - The request {@link CreateGrafanaUserRequest} + * @returns A Promise of GrafanaUser + */ + createGrafanaUser = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateGrafanaUserRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/cockpit/v1beta1/grafana-users` + }, + marshalling_gen.unmarshalGrafanaUser + ); + pageOfListGrafanaUsers = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/cockpit/v1beta1/grafana-users`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + [ + "project_id", + request.projectId ?? this.client.settings.defaultProjectId + ] + ) + }, + marshalling_gen.unmarshalListGrafanaUsersResponse + ); + /** + * Get a list of all Grafana users created in your Cockpit's Grafana. + * + * @param request - The request {@link ListGrafanaUsersRequest} + * @returns A Promise of ListGrafanaUsersResponse + */ + listGrafanaUsers = (request = {}) => resourcePaginator.enrichForPagination("grafanaUsers", this.pageOfListGrafanaUsers, request); + /** + * Delete a Grafana user from your Cockpit's Grafana, specified by the ID of + * the Project the Cockpit belongs to, and the ID of the Grafana user. + * + * @param request - The request {@link DeleteGrafanaUserRequest} + */ + deleteGrafanaUser = (request) => this.client.fetch({ + body: JSON.stringify( + marshalling_gen.marshalDeleteGrafanaUserRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/cockpit/v1beta1/grafana-users/${marshalling.validatePathParam("grafanaUserId", request.grafanaUserId)}/delete` + }); + /** + * Reset the password of a Grafana user, specified by the ID of the Project + * the Cockpit belongs to, and the ID of the Grafana user. + * + * @param request - The request {@link ResetGrafanaUserPasswordRequest} + * @returns A Promise of GrafanaUser + */ + resetGrafanaUserPassword = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalResetGrafanaUserPasswordRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/cockpit/v1beta1/grafana-users/${marshalling.validatePathParam("grafanaUserId", request.grafanaUserId)}/reset-password` + }, + marshalling_gen.unmarshalGrafanaUser + ); + pageOfListPlans = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/cockpit/v1beta1/plans`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListPlansResponse + ); + /** + * Get a list of all pricing plans available. + * + * @param request - The request {@link ListPlansRequest} + * @returns A Promise of ListPlansResponse + */ + listPlans = (request = {}) => resourcePaginator.enrichForPagination("plans", this.pageOfListPlans, request); + /** + * Select your chosen pricing plan for your Cockpit, specifying the Cockpit's + * Project ID and the pricing plan's ID in the request. + * + * @param request - The request {@link SelectPlanRequest} + * @returns A Promise of SelectPlanResponse + */ + selectPlan = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalSelectPlanRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/cockpit/v1beta1/select-plan` + }, + marshalling_gen.unmarshalSelectPlanResponse + ); + pageOfListGrafanaProductDashboards = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/cockpit/v1beta1/grafana-product-dashboards`, + urlParams: marshalling.urlParams( + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + [ + "project_id", + request.projectId ?? this.client.settings.defaultProjectId + ], + ["tags", request.tags] + ) + }, + marshalling_gen.unmarshalListGrafanaProductDashboardsResponse + ); + /** + * List product dashboards. Get a list of available product dashboards. + * + * @param request - The request {@link ListGrafanaProductDashboardsRequest} + * @returns A Promise of ListGrafanaProductDashboardsResponse + */ + listGrafanaProductDashboards = (request = {}) => resourcePaginator.enrichForPagination( + "dashboards", + this.pageOfListGrafanaProductDashboards, + request + ); + /** + * Get a product dashboard. Get a product dashboard specified by the dashboard + * ID. + * + * @param request - The request {@link GetGrafanaProductDashboardRequest} + * @returns A Promise of GrafanaProductDashboard + */ + getGrafanaProductDashboard = (request) => this.client.fetch( + { + method: "GET", + path: `/cockpit/v1beta1/grafana-product-dashboards/${marshalling.validatePathParam("dashboardName", request.dashboardName)}`, + urlParams: marshalling.urlParams([ + "project_id", + request.projectId ?? this.client.settings.defaultProjectId + ]) + }, + marshalling_gen.unmarshalGrafanaProductDashboard + ); +} +exports.API = API; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const CreateSnapshotRequest = { - name: { - minLength: 1 - } -}; -const CreateVolumeRequest = { - name: { - minLength: 1 - } -}; -const ImportSnapshotFromS3Request = { - name: { - minLength: 1 - } -}; -const ListSnapshotsRequest = { - page: { - greaterThan: 0 - }, - pageSize: { - greaterThan: 0, - lessThanOrEqual: 100 - } -}; -const ListVolumeTypesRequest = { - page: { - greaterThan: 0 - }, - pageSize: { - greaterThan: 0, - lessThanOrEqual: 100 - } -}; -const ListVolumesRequest = { - page: { - greaterThan: 0 - }, - pageSize: { - greaterThan: 0, - lessThanOrEqual: 100 - } -}; +/***/ }), -var validationRules_gen$7 = /*#__PURE__*/Object.freeze({ - __proto__: null, - CreateSnapshotRequest: CreateSnapshotRequest, - CreateVolumeRequest: CreateVolumeRequest, - ImportSnapshotFromS3Request: ImportSnapshotFromS3Request, - ListSnapshotsRequest: ListSnapshotsRequest, - ListVolumeTypesRequest: ListVolumeTypesRequest, - ListVolumesRequest: ListVolumesRequest -}); +/***/ 3625: +/***/ ((__unused_webpack_module, exports) => { -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. +"use strict"; -var index_gen$n = /*#__PURE__*/Object.freeze({ - __proto__: null, - API: API$p, - REFERENCE_TRANSIENT_STATUSES: REFERENCE_TRANSIENT_STATUSES, - SNAPSHOT_TRANSIENT_STATUSES: SNAPSHOT_TRANSIENT_STATUSES$3, - VOLUME_TRANSIENT_STATUSES: VOLUME_TRANSIENT_STATUSES$1, - ValidationRules: validationRules_gen$7 -}); +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const COCKPIT_TRANSIENT_STATUSES = [ + "creating", + "deleting", + "updating" +]; +exports.COCKPIT_TRANSIENT_STATUSES = COCKPIT_TRANSIENT_STATUSES; -var index$q = /*#__PURE__*/Object.freeze({ - __proto__: null, - v1alpha1: index_gen$n -}); -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. +/***/ }), + +/***/ 5606: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api_gen = __nccwpck_require__(374); +const content_gen = __nccwpck_require__(3625); +exports.API = api_gen.API; +exports.COCKPIT_TRANSIENT_STATUSES = content_gen.COCKPIT_TRANSIENT_STATUSES; + -/** Lists transient statutes of the enum {@link CockpitStatus}. */ -const COCKPIT_TRANSIENT_STATUSES = ['creating', 'deleting', 'updating']; +/***/ }), + +/***/ 3219: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const unmarshalContactPointEmail = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ContactPointEmail' failed as data isn't a dictionary.`); +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const randomName = __nccwpck_require__(8141); +const json = __nccwpck_require__(3746); +const customMarshalling = __nccwpck_require__(7586); +const marshalling = __nccwpck_require__(1162); +const unmarshalContactPointEmail = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ContactPointEmail' failed as data isn't a dictionary.` + ); } return { to: data.to }; }; -const unmarshalTokenScopes = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'TokenScopes' failed as data isn't a dictionary.`); +const unmarshalContactPoint = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ContactPoint' failed as data isn't a dictionary.` + ); } return { - queryLogs: data.query_logs, - queryMetrics: data.query_metrics, - queryTraces: data.query_traces, - setupAlerts: data.setup_alerts, - setupLogsRules: data.setup_logs_rules, - setupMetricsRules: data.setup_metrics_rules, - writeLogs: data.write_logs, - writeMetrics: data.write_metrics, - writeTraces: data.write_traces + email: data.email ? unmarshalContactPointEmail(data.email) : void 0 }; }; -const unmarshalCockpitEndpoints = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'CockpitEndpoints' failed as data isn't a dictionary.`); +const unmarshalDatasource = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Datasource' failed as data isn't a dictionary.` + ); } return { - alertmanagerUrl: data.alertmanager_url, - grafanaUrl: data.grafana_url, - logsUrl: data.logs_url, - metricsUrl: data.metrics_url + id: data.id, + isManagedByScaleway: data.is_managed_by_scaleway, + name: data.name, + projectId: data.project_id, + type: data.type, + url: data.url }; }; -const unmarshalContactPoint = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ContactPoint' failed as data isn't a dictionary.`); - } - return { - email: data.email ? unmarshalContactPointEmail(data.email) : undefined - }; -}; -const unmarshalDatasource = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Datasource' failed as data isn't a dictionary.`); - } - return { - id: data.id, - name: data.name, - projectId: data.project_id, - type: data.type, - url: data.url - }; -}; -const unmarshalGrafanaProductDashboard = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'GrafanaProductDashboard' failed as data isn't a dictionary.`); +const unmarshalGrafanaProductDashboard = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'GrafanaProductDashboard' failed as data isn't a dictionary.` + ); } return { dashboardName: data.dashboard_name, @@ -12019,9 +13420,11 @@ const unmarshalGrafanaProductDashboard = data => { variables: data.variables }; }; -const unmarshalGrafanaUser = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'GrafanaUser' failed as data isn't a dictionary.`); +const unmarshalGrafanaUser = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'GrafanaUser' failed as data isn't a dictionary.` + ); } return { id: data.id, @@ -12030,165 +13433,233 @@ const unmarshalGrafanaUser = data => { role: data.role }; }; -const unmarshalPlan = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Plan' failed as data isn't a dictionary.`); +const unmarshalTokenScopes = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'TokenScopes' failed as data isn't a dictionary.` + ); } return { - id: data.id, - logsIngestionPrice: data.logs_ingestion_price, - name: data.name, - retentionLogsInterval: data.retention_logs_interval, - retentionMetricsInterval: data.retention_metrics_interval, - retentionPrice: data.retention_price, - sampleIngestionPrice: data.sample_ingestion_price + queryLogs: data.query_logs, + queryMetrics: data.query_metrics, + queryTraces: data.query_traces, + setupAlerts: data.setup_alerts, + setupLogsRules: data.setup_logs_rules, + setupMetricsRules: data.setup_metrics_rules, + writeLogs: data.write_logs, + writeMetrics: data.write_metrics, + writeTraces: data.write_traces }; }; -const unmarshalToken$2 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Token' failed as data isn't a dictionary.`); +const unmarshalToken = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Token' failed as data isn't a dictionary.` + ); } return { - createdAt: unmarshalDate(data.created_at), + createdAt: marshalling.unmarshalDate(data.created_at), id: data.id, name: data.name, projectId: data.project_id, - scopes: data.scopes ? unmarshalTokenScopes(data.scopes) : undefined, + scopes: data.scopes ? unmarshalTokenScopes(data.scopes) : void 0, secretKey: data.secret_key, - updatedAt: unmarshalDate(data.updated_at) + updatedAt: marshalling.unmarshalDate(data.updated_at) + }; +}; +const unmarshalCockpitEndpoints = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'CockpitEndpoints' failed as data isn't a dictionary.` + ); + } + return { + alertmanagerUrl: data.alertmanager_url, + grafanaUrl: data.grafana_url, + logsUrl: data.logs_url, + metricsUrl: data.metrics_url, + tracesUrl: data.traces_url + }; +}; +const unmarshalPlan = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Plan' failed as data isn't a dictionary.` + ); + } + return { + id: data.id, + logsIngestionPrice: data.logs_ingestion_price, + name: data.name, + retentionLogsInterval: data.retention_logs_interval, + retentionMetricsInterval: data.retention_metrics_interval, + retentionPrice: data.retention_price, + retentionTracesInterval: data.retention_traces_interval, + sampleIngestionPrice: data.sample_ingestion_price, + tracesIngestionPrice: data.traces_ingestion_price }; }; -const unmarshalCockpit = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Cockpit' failed as data isn't a dictionary.`); +const unmarshalCockpit = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Cockpit' failed as data isn't a dictionary.` + ); } return { - createdAt: unmarshalDate(data.created_at), - endpoints: data.endpoints ? unmarshalCockpitEndpoints(data.endpoints) : undefined, + createdAt: marshalling.unmarshalDate(data.created_at), + endpoints: data.endpoints ? unmarshalCockpitEndpoints(data.endpoints) : void 0, managedAlertsEnabled: data.managed_alerts_enabled, - plan: data.plan ? unmarshalPlan(data.plan) : undefined, + plan: data.plan ? unmarshalPlan(data.plan) : void 0, projectId: data.project_id, status: data.status, - updatedAt: unmarshalDate(data.updated_at) + updatedAt: marshalling.unmarshalDate(data.updated_at) }; }; -const unmarshalCockpitMetrics = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'CockpitMetrics' failed as data isn't a dictionary.`); +const unmarshalCockpitMetrics = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'CockpitMetrics' failed as data isn't a dictionary.` + ); } return { - timeseries: unmarshalArrayOfObject(data.timeseries, unmarshalTimeSeries) + timeseries: marshalling.unmarshalArrayOfObject(data.timeseries, customMarshalling.unmarshalTimeSeries) }; }; -const unmarshalListContactPointsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListContactPointsResponse' failed as data isn't a dictionary.`); +const unmarshalListContactPointsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListContactPointsResponse' failed as data isn't a dictionary.` + ); } return { - contactPoints: unmarshalArrayOfObject(data.contact_points, unmarshalContactPoint), + contactPoints: marshalling.unmarshalArrayOfObject( + data.contact_points, + unmarshalContactPoint + ), hasAdditionalContactPoints: data.has_additional_contact_points, hasAdditionalReceivers: data.has_additional_receivers, totalCount: data.total_count }; }; -const unmarshalListDatasourcesResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListDatasourcesResponse' failed as data isn't a dictionary.`); +const unmarshalListDatasourcesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListDatasourcesResponse' failed as data isn't a dictionary.` + ); } return { - datasources: unmarshalArrayOfObject(data.datasources, unmarshalDatasource), + datasources: marshalling.unmarshalArrayOfObject(data.datasources, unmarshalDatasource), totalCount: data.total_count }; }; -const unmarshalListGrafanaProductDashboardsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListGrafanaProductDashboardsResponse' failed as data isn't a dictionary.`); +const unmarshalListGrafanaProductDashboardsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListGrafanaProductDashboardsResponse' failed as data isn't a dictionary.` + ); } return { - dashboards: unmarshalArrayOfObject(data.dashboards, unmarshalGrafanaProductDashboard), + dashboards: marshalling.unmarshalArrayOfObject( + data.dashboards, + unmarshalGrafanaProductDashboard + ), totalCount: data.total_count }; }; -const unmarshalListGrafanaUsersResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListGrafanaUsersResponse' failed as data isn't a dictionary.`); +const unmarshalListGrafanaUsersResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListGrafanaUsersResponse' failed as data isn't a dictionary.` + ); } return { - grafanaUsers: unmarshalArrayOfObject(data.grafana_users, unmarshalGrafanaUser), + grafanaUsers: marshalling.unmarshalArrayOfObject( + data.grafana_users, + unmarshalGrafanaUser + ), totalCount: data.total_count }; }; -const unmarshalListPlansResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListPlansResponse' failed as data isn't a dictionary.`); +const unmarshalListPlansResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListPlansResponse' failed as data isn't a dictionary.` + ); } return { - plans: unmarshalArrayOfObject(data.plans, unmarshalPlan), + plans: marshalling.unmarshalArrayOfObject(data.plans, unmarshalPlan), totalCount: data.total_count }; }; -const unmarshalListTokensResponse$2 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListTokensResponse' failed as data isn't a dictionary.`); +const unmarshalListTokensResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListTokensResponse' failed as data isn't a dictionary.` + ); } return { - tokens: unmarshalArrayOfObject(data.tokens, unmarshalToken$2), + tokens: marshalling.unmarshalArrayOfObject(data.tokens, unmarshalToken), totalCount: data.total_count }; }; -const unmarshalSelectPlanResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'SelectPlanResponse' failed as data isn't a dictionary.`); +const unmarshalSelectPlanResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SelectPlanResponse' failed as data isn't a dictionary.` + ); } return {}; }; +const marshalActivateCockpitRequest = (request, defaults) => ({ + project_id: request.projectId ?? defaults.defaultProjectId +}); const marshalContactPointEmail = (request, defaults) => ({ to: request.to }); const marshalContactPoint = (request, defaults) => ({ - ...resolveOneOf([{ - param: 'email', - value: request.email ? marshalContactPointEmail(request.email) : undefined - }]) -}); -const marshalTokenScopes = (request, defaults) => ({ - query_logs: request.queryLogs, - query_metrics: request.queryMetrics, - query_traces: request.queryTraces, - setup_alerts: request.setupAlerts, - setup_logs_rules: request.setupLogsRules, - setup_metrics_rules: request.setupMetricsRules, - write_logs: request.writeLogs, - write_metrics: request.writeMetrics, - write_traces: request.writeTraces -}); -const marshalActivateCockpitRequest = (request, defaults) => ({ - project_id: request.projectId ?? defaults.defaultProjectId + ...marshalling.resolveOneOf([ + { + param: "email", + value: request.email !== void 0 ? marshalContactPointEmail(request.email) : void 0 + } + ]) }); const marshalCreateContactPointRequest = (request, defaults) => ({ - contact_point: request.contactPoint ? marshalContactPoint(request.contactPoint) : undefined, + contact_point: request.contactPoint !== void 0 ? marshalContactPoint(request.contactPoint) : void 0, project_id: request.projectId ?? defaults.defaultProjectId }); const marshalCreateDatasourceRequest = (request, defaults) => ({ + is_default: request.isDefault, name: request.name, project_id: request.projectId ?? defaults.defaultProjectId, - type: request.type ?? 'unknown_datasource_type' + type: request.type }); const marshalCreateGrafanaUserRequest = (request, defaults) => ({ login: request.login, project_id: request.projectId ?? defaults.defaultProjectId, - role: request.role ?? 'unknown_role' + role: request.role +}); +const marshalTokenScopes = (request, defaults) => ({ + query_logs: request.queryLogs, + query_metrics: request.queryMetrics, + query_traces: request.queryTraces, + setup_alerts: request.setupAlerts, + setup_logs_rules: request.setupLogsRules, + setup_metrics_rules: request.setupMetricsRules, + write_logs: request.writeLogs, + write_metrics: request.writeMetrics, + write_traces: request.writeTraces }); -const marshalCreateTokenRequest$2 = (request, defaults) => ({ - name: request.name || randomName('token'), +const marshalCreateTokenRequest = (request, defaults) => ({ + name: request.name || randomName("token"), project_id: request.projectId ?? defaults.defaultProjectId, - scopes: request.scopes ? marshalTokenScopes(request.scopes) : undefined + scopes: request.scopes !== void 0 ? marshalTokenScopes(request.scopes) : void 0 }); const marshalDeactivateCockpitRequest = (request, defaults) => ({ project_id: request.projectId ?? defaults.defaultProjectId }); const marshalDeleteContactPointRequest = (request, defaults) => ({ - contact_point: request.contactPoint ? marshalContactPoint(request.contactPoint) : undefined, + contact_point: request.contactPoint !== void 0 ? marshalContactPoint(request.contactPoint) : void 0, project_id: request.projectId ?? defaults.defaultProjectId }); const marshalDeleteGrafanaUserRequest = (request, defaults) => ({ @@ -12200,9 +13671,6 @@ const marshalDisableManagedAlertsRequest = (request, defaults) => ({ const marshalEnableManagedAlertsRequest = (request, defaults) => ({ project_id: request.projectId ?? defaults.defaultProjectId }); -const marshalResetCockpitGrafanaRequest = (request, defaults) => ({ - project_id: request.projectId ?? defaults.defaultProjectId -}); const marshalResetGrafanaUserPasswordRequest = (request, defaults) => ({ project_id: request.projectId ?? defaults.defaultProjectId }); @@ -12213,435 +13681,745 @@ const marshalSelectPlanRequest = (request, defaults) => ({ const marshalTriggerTestAlertRequest = (request, defaults) => ({ project_id: request.projectId ?? defaults.defaultProjectId }); +exports.marshalActivateCockpitRequest = marshalActivateCockpitRequest; +exports.marshalCreateContactPointRequest = marshalCreateContactPointRequest; +exports.marshalCreateDatasourceRequest = marshalCreateDatasourceRequest; +exports.marshalCreateGrafanaUserRequest = marshalCreateGrafanaUserRequest; +exports.marshalCreateTokenRequest = marshalCreateTokenRequest; +exports.marshalDeactivateCockpitRequest = marshalDeactivateCockpitRequest; +exports.marshalDeleteContactPointRequest = marshalDeleteContactPointRequest; +exports.marshalDeleteGrafanaUserRequest = marshalDeleteGrafanaUserRequest; +exports.marshalDisableManagedAlertsRequest = marshalDisableManagedAlertsRequest; +exports.marshalEnableManagedAlertsRequest = marshalEnableManagedAlertsRequest; +exports.marshalResetGrafanaUserPasswordRequest = marshalResetGrafanaUserPasswordRequest; +exports.marshalSelectPlanRequest = marshalSelectPlanRequest; +exports.marshalTriggerTestAlertRequest = marshalTriggerTestAlertRequest; +exports.unmarshalCockpit = unmarshalCockpit; +exports.unmarshalCockpitMetrics = unmarshalCockpitMetrics; +exports.unmarshalContactPoint = unmarshalContactPoint; +exports.unmarshalDatasource = unmarshalDatasource; +exports.unmarshalGrafanaProductDashboard = unmarshalGrafanaProductDashboard; +exports.unmarshalGrafanaUser = unmarshalGrafanaUser; +exports.unmarshalListContactPointsResponse = unmarshalListContactPointsResponse; +exports.unmarshalListDatasourcesResponse = unmarshalListDatasourcesResponse; +exports.unmarshalListGrafanaProductDashboardsResponse = unmarshalListGrafanaProductDashboardsResponse; +exports.unmarshalListGrafanaUsersResponse = unmarshalListGrafanaUsersResponse; +exports.unmarshalListPlansResponse = unmarshalListPlansResponse; +exports.unmarshalListTokensResponse = unmarshalListTokensResponse; +exports.unmarshalSelectPlanResponse = unmarshalSelectPlanResponse; +exports.unmarshalToken = unmarshalToken; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const jsonContentHeaders$n = { - 'Content-Type': 'application/json; charset=utf-8' -}; -/** - * Cockpit API. - * - * Cockpit's API allows you to activate your Cockpit on your Projects. - * Scaleway's Cockpit stores metrics and logs and provides a dedicated Grafana - * for dashboarding to visualize them. Cockpit API. - */ -let API$o = class API extends API$u { +/***/ }), + +/***/ 3523: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const index_gen = __nccwpck_require__(4612); +exports.v1beta1 = index_gen; + + +/***/ }), + +/***/ 3336: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const intervalRetrier = __nccwpck_require__(9052); +const api = __nccwpck_require__(3042); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const resourcePaginator = __nccwpck_require__(4983); +const content_gen = __nccwpck_require__(6219); +const marshalling_gen = __nccwpck_require__(2370); +const jsonContentHeaders = { + "Content-Type": "application/json; charset=utf-8" +}; +class API extends api.API { + /** Lists the available regions of the API. */ + static LOCALITIES = ["fr-par", "nl-ams", "pl-waw"]; + pageOfListNamespaces = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/containers/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/namespaces`, + urlParams: marshalling.urlParams( + ["name", request.name], + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId] + ) + }, + marshalling_gen.unmarshalListNamespacesResponse + ); /** - * Activate the Cockpit of the specified Project ID. + * List all your namespaces. List all namespaces in a specified region. * - * @param request - The request {@link ActivateCockpitRequest} - * @returns A Promise of Cockpit + * @param request - The request {@link ListNamespacesRequest} + * @returns A Promise of ListNamespacesResponse */ - activateCockpit = (request = {}) => this.client.fetch({ - body: JSON.stringify(marshalActivateCockpitRequest(request, this.client.settings)), - headers: jsonContentHeaders$n, - method: 'POST', - path: `/cockpit/v1beta1/activate` - }, unmarshalCockpit); - + listNamespaces = (request = {}) => resourcePaginator.enrichForPagination("namespaces", this.pageOfListNamespaces, request); /** - * Retrieve the Cockpit of the specified Project ID. + * Get a namespace. Get the namespace associated with the specified ID. * - * @param request - The request {@link GetCockpitRequest} - * @returns A Promise of Cockpit + * @param request - The request {@link GetNamespaceRequest} + * @returns A Promise of Namespace */ - getCockpit = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/cockpit/v1beta1/cockpit`, - urlParams: urlParams(['project_id', request.projectId ?? this.client.settings.defaultProjectId]) - }, unmarshalCockpit); - + getNamespace = (request) => this.client.fetch( + { + method: "GET", + path: `/containers/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/namespaces/${marshalling.validatePathParam("namespaceId", request.namespaceId)}` + }, + marshalling_gen.unmarshalNamespace + ); /** - * Waits for {@link Cockpit} to be in a final state. + * Waits for {@link Namespace} to be in a final state. * - * @param request - The request {@link GetCockpitRequest} + * @param request - The request {@link GetNamespaceRequest} * @param options - The waiting options - * @returns A Promise of Cockpit + * @returns A Promise of Namespace */ - waitForCockpit = (request = {}, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!COCKPIT_TRANSIENT_STATUSES.includes(res.status))), this.getCockpit, request, options); - + waitForNamespace = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve(!content_gen.NAMESPACE_TRANSIENT_STATUSES.includes(res.status))), + this.getNamespace, + request, + options + ); /** - * Get metrics from your Cockpit with the specified Project ID. + * Create a new namespace. Create a new namespace in a specified region. * - * @param request - The request {@link GetCockpitMetricsRequest} - * @returns A Promise of CockpitMetrics + * @param request - The request {@link CreateNamespaceRequest} + * @returns A Promise of Namespace */ - getCockpitMetrics = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/cockpit/v1beta1/cockpit/metrics`, - urlParams: urlParams(['end_date', request.endDate], ['metric_name', request.metricName], ['project_id', request.projectId ?? this.client.settings.defaultProjectId], ['start_date', request.startDate]) - }, unmarshalCockpitMetrics); - + createNamespace = (request = {}) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateNamespaceRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/containers/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/namespaces` + }, + marshalling_gen.unmarshalNamespace + ); /** - * Deactivate the Cockpit of the specified Project ID. + * Update an existing namespace. Update the space associated with the + * specified ID. * - * @param request - The request {@link DeactivateCockpitRequest} - * @returns A Promise of Cockpit + * @param request - The request {@link UpdateNamespaceRequest} + * @returns A Promise of Namespace */ - deactivateCockpit = (request = {}) => this.client.fetch({ - body: JSON.stringify(marshalDeactivateCockpitRequest(request, this.client.settings)), - headers: jsonContentHeaders$n, - method: 'POST', - path: `/cockpit/v1beta1/deactivate` - }, unmarshalCockpit); - + updateNamespace = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateNamespaceRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/containers/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/namespaces/${marshalling.validatePathParam("namespaceId", request.namespaceId)}` + }, + marshalling_gen.unmarshalNamespace + ); /** - * Reset your Cockpit's Grafana associated with the specified Project ID. + * Delete an existing namespace. Delete the namespace associated with the + * specified ID. * - * @param request - The request {@link ResetCockpitGrafanaRequest} - * @returns A Promise of Cockpit + * @param request - The request {@link DeleteNamespaceRequest} + * @returns A Promise of Namespace */ - resetCockpitGrafana = (request = {}) => this.client.fetch({ - body: JSON.stringify(marshalResetCockpitGrafanaRequest(request, this.client.settings)), - headers: jsonContentHeaders$n, - method: 'POST', - path: `/cockpit/v1beta1/reset-grafana` - }, unmarshalCockpit); - + deleteNamespace = (request) => this.client.fetch( + { + method: "DELETE", + path: `/containers/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/namespaces/${marshalling.validatePathParam("namespaceId", request.namespaceId)}` + }, + marshalling_gen.unmarshalNamespace + ); + pageOfListContainers = (request) => this.client.fetch( + { + method: "GET", + path: `/containers/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/containers`, + urlParams: marshalling.urlParams( + ["name", request.name], + ["namespace_id", request.namespaceId], + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId] + ) + }, + marshalling_gen.unmarshalListContainersResponse + ); /** - * Create a datasource for the specified Project ID and the given type. + * List all your containers. List all containers for a specified region. * - * @param request - The request {@link CreateDatasourceRequest} - * @returns A Promise of Datasource + * @param request - The request {@link ListContainersRequest} + * @returns A Promise of ListContainersResponse */ - createDatasource = request => this.client.fetch({ - body: JSON.stringify(marshalCreateDatasourceRequest(request, this.client.settings)), - headers: jsonContentHeaders$n, - method: 'POST', - path: `/cockpit/v1beta1/datasources` - }, unmarshalDatasource); - pageOfListDatasources = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/cockpit/v1beta1/datasources`, - urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId ?? this.client.settings.defaultProjectId], ['types', request.types]) - }, unmarshalListDatasourcesResponse); - + listContainers = (request) => resourcePaginator.enrichForPagination("containers", this.pageOfListContainers, request); /** - * Get a list of datasources for the specified Project ID. + * Get a container. Get the container associated with the specified ID. * - * @param request - The request {@link ListDatasourcesRequest} - * @returns A Promise of ListDatasourcesResponse + * @param request - The request {@link GetContainerRequest} + * @returns A Promise of Container */ - listDatasources = (request = {}) => enrichForPagination('datasources', this.pageOfListDatasources, request); - + getContainer = (request) => this.client.fetch( + { + method: "GET", + path: `/containers/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/containers/${marshalling.validatePathParam("containerId", request.containerId)}` + }, + marshalling_gen.unmarshalContainer + ); /** - * Create a token associated with the specified Project ID. + * Waits for {@link Container} to be in a final state. * - * @param request - The request {@link CreateTokenRequest} - * @returns A Promise of Token + * @param request - The request {@link GetContainerRequest} + * @param options - The waiting options + * @returns A Promise of Container */ - createToken = (request = {}) => this.client.fetch({ - body: JSON.stringify(marshalCreateTokenRequest$2(request, this.client.settings)), - headers: jsonContentHeaders$n, - method: 'POST', - path: `/cockpit/v1beta1/tokens` - }, unmarshalToken$2); - pageOfListTokens = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/cockpit/v1beta1/tokens`, - urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId ?? this.client.settings.defaultProjectId]) - }, unmarshalListTokensResponse$2); - + waitForContainer = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve(!content_gen.CONTAINER_TRANSIENT_STATUSES.includes(res.status))), + this.getContainer, + request, + options + ); /** - * Get a list of tokens associated with the specified Project ID. + * Create a new container. Create a new container in the specified region. * - * @param request - The request {@link ListTokensRequest} - * @returns A Promise of ListTokensResponse + * @param request - The request {@link CreateContainerRequest} + * @returns A Promise of Container */ - listTokens = (request = {}) => enrichForPagination('tokens', this.pageOfListTokens, request); - + createContainer = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateContainerRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/containers/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/containers` + }, + marshalling_gen.unmarshalContainer + ); /** - * Retrieve the token associated with the specified token ID. + * Update an existing container. Update the container associated with the + * specified ID. * - * @param request - The request {@link GetTokenRequest} - * @returns A Promise of Token + * @param request - The request {@link UpdateContainerRequest} + * @returns A Promise of Container */ - getToken = request => this.client.fetch({ - method: 'GET', - path: `/cockpit/v1beta1/tokens/${validatePathParam('tokenId', request.tokenId)}` - }, unmarshalToken$2); - + updateContainer = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateContainerRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/containers/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/containers/${marshalling.validatePathParam("containerId", request.containerId)}` + }, + marshalling_gen.unmarshalContainer + ); /** - * Delete the token associated with the specified token ID. + * Delete a container. Delete the container associated with the specified ID. * - * @param request - The request {@link DeleteTokenRequest} + * @param request - The request {@link DeleteContainerRequest} + * @returns A Promise of Container */ - deleteToken = request => this.client.fetch({ - method: 'DELETE', - path: `/cockpit/v1beta1/tokens/${validatePathParam('tokenId', request.tokenId)}` - }); - + deleteContainer = (request) => this.client.fetch( + { + method: "DELETE", + path: `/containers/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/containers/${marshalling.validatePathParam("containerId", request.containerId)}` + }, + marshalling_gen.unmarshalContainer + ); /** - * Create a contact point to receive alerts for the default receiver. + * Deploy a container. Deploy a container associated with the specified ID. * - * @param request - The request {@link CreateContactPointRequest} - * @returns A Promise of ContactPoint + * @param request - The request {@link DeployContainerRequest} + * @returns A Promise of Container */ - createContactPoint = (request = {}) => this.client.fetch({ - body: JSON.stringify(marshalCreateContactPointRequest(request, this.client.settings)), - headers: jsonContentHeaders$n, - method: 'POST', - path: `/cockpit/v1beta1/contact-points` - }, unmarshalContactPoint); - pageOfListContactPoints = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/cockpit/v1beta1/contact-points`, - urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId ?? this.client.settings.defaultProjectId]) - }, unmarshalListContactPointsResponse); - + deployContainer = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/containers/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/containers/${marshalling.validatePathParam("containerId", request.containerId)}/deploy` + }, + marshalling_gen.unmarshalContainer + ); + pageOfListCrons = (request) => this.client.fetch( + { + method: "GET", + path: `/containers/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/crons`, + urlParams: marshalling.urlParams( + ["container_id", request.containerId], + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListCronsResponse + ); /** - * Get a list of contact points for the Cockpit associated with the specified - * Project ID. + * List all your crons. * - * @param request - The request {@link ListContactPointsRequest} - * @returns A Promise of ListContactPointsResponse + * @param request - The request {@link ListCronsRequest} + * @returns A Promise of ListCronsResponse */ - listContactPoints = (request = {}) => enrichForPagination('contactPoints', this.pageOfListContactPoints, request); - + listCrons = (request) => resourcePaginator.enrichForPagination("crons", this.pageOfListCrons, request); /** - * Delete a contact point for the default receiver. + * Get a cron. Get the cron associated with the specified ID. * - * @param request - The request {@link DeleteContactPointRequest} + * @param request - The request {@link GetCronRequest} + * @returns A Promise of Cron */ - deleteContactPoint = (request = {}) => this.client.fetch({ - body: JSON.stringify(marshalDeleteContactPointRequest(request, this.client.settings)), - headers: jsonContentHeaders$n, - method: 'POST', - path: `/cockpit/v1beta1/delete-contact-point` - }); - + getCron = (request) => this.client.fetch( + { + method: "GET", + path: `/containers/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/crons/${marshalling.validatePathParam("cronId", request.cronId)}` + }, + marshalling_gen.unmarshalCron + ); /** - * Enable the sending of managed alerts for the specified Project's Cockpit. + * Waits for {@link Cron} to be in a final state. * - * @param request - The request {@link EnableManagedAlertsRequest} + * @param request - The request {@link GetCronRequest} + * @param options - The waiting options + * @returns A Promise of Cron */ - enableManagedAlerts = (request = {}) => this.client.fetch({ - body: JSON.stringify(marshalEnableManagedAlertsRequest(request, this.client.settings)), - headers: jsonContentHeaders$n, - method: 'POST', - path: `/cockpit/v1beta1/enable-managed-alerts` - }); - + waitForCron = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve(!content_gen.CRON_TRANSIENT_STATUSES.includes(res.status))), + this.getCron, + request, + options + ); /** - * Disable the sending of managed alerts for the specified Project's Cockpit. + * Create a new cron. * - * @param request - The request {@link DisableManagedAlertsRequest} + * @param request - The request {@link CreateCronRequest} + * @returns A Promise of Cron */ - disableManagedAlerts = (request = {}) => this.client.fetch({ - body: JSON.stringify(marshalDisableManagedAlertsRequest(request, this.client.settings)), - headers: jsonContentHeaders$n, - method: 'POST', - path: `/cockpit/v1beta1/disable-managed-alerts` - }); - + createCron = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateCronRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/containers/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/crons` + }, + marshalling_gen.unmarshalCron + ); /** - * Trigger a test alert to all of the Cockpit's receivers. + * Update an existing cron. Update the cron associated with the specified ID. * - * @param request - The request {@link TriggerTestAlertRequest} + * @param request - The request {@link UpdateCronRequest} + * @returns A Promise of Cron */ - triggerTestAlert = (request = {}) => this.client.fetch({ - body: JSON.stringify(marshalTriggerTestAlertRequest(request, this.client.settings)), - headers: jsonContentHeaders$n, - method: 'POST', - path: `/cockpit/v1beta1/trigger-test-alert` - }); - + updateCron = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateCronRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/containers/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/crons/${marshalling.validatePathParam("cronId", request.cronId)}` + }, + marshalling_gen.unmarshalCron + ); /** - * Create a Grafana user for your Cockpit's Grafana instance. Make sure you - * save the automatically-generated password and the Grafana user ID. + * Delete an existing cron. Delete the cron associated with the specified ID. * - * @param request - The request {@link CreateGrafanaUserRequest} - * @returns A Promise of GrafanaUser + * @param request - The request {@link DeleteCronRequest} + * @returns A Promise of Cron */ - createGrafanaUser = request => this.client.fetch({ - body: JSON.stringify(marshalCreateGrafanaUserRequest(request, this.client.settings)), - headers: jsonContentHeaders$n, - method: 'POST', - path: `/cockpit/v1beta1/grafana-users` - }, unmarshalGrafanaUser); - pageOfListGrafanaUsers = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/cockpit/v1beta1/grafana-users`, - urlParams: urlParams(['order_by', request.orderBy ?? 'login_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId ?? this.client.settings.defaultProjectId]) - }, unmarshalListGrafanaUsersResponse); - + deleteCron = (request) => this.client.fetch( + { + method: "DELETE", + path: `/containers/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/crons/${marshalling.validatePathParam("cronId", request.cronId)}` + }, + marshalling_gen.unmarshalCron + ); + pageOfListDomains = (request) => this.client.fetch( + { + method: "GET", + path: `/containers/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains`, + urlParams: marshalling.urlParams( + ["container_id", request.containerId], + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListDomainsResponse + ); /** - * Get a list of Grafana users who are able to connect to the Cockpit's - * Grafana instance. + * List all domain name bindings. List all domain name bindings in a specified + * region. * - * @param request - The request {@link ListGrafanaUsersRequest} - * @returns A Promise of ListGrafanaUsersResponse + * @param request - The request {@link ListDomainsRequest} + * @returns A Promise of ListDomainsResponse */ - listGrafanaUsers = (request = {}) => enrichForPagination('grafanaUsers', this.pageOfListGrafanaUsers, request); - + listDomains = (request) => resourcePaginator.enrichForPagination("domains", this.pageOfListDomains, request); /** - * Delete a Grafana user from a Grafana instance, specified by the Cockpit's - * Project ID and the Grafana user ID. + * Get a domain name binding. Get a domain name binding for the container with + * the specified ID. * - * @param request - The request {@link DeleteGrafanaUserRequest} + * @param request - The request {@link GetDomainRequest} + * @returns A Promise of Domain */ - deleteGrafanaUser = request => this.client.fetch({ - body: JSON.stringify(marshalDeleteGrafanaUserRequest(request, this.client.settings)), - headers: jsonContentHeaders$n, - method: 'POST', - path: `/cockpit/v1beta1/grafana-users/${validatePathParam('grafanaUserId', request.grafanaUserId)}/delete` - }); - + getDomain = (request) => this.client.fetch( + { + method: "GET", + path: `/containers/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${marshalling.validatePathParam("domainId", request.domainId)}` + }, + marshalling_gen.unmarshalDomain + ); /** - * Reset a Grafana user's password specified by the Cockpit's Project ID and - * the Grafana user ID. + * Waits for {@link Domain} to be in a final state. * - * @param request - The request {@link ResetGrafanaUserPasswordRequest} - * @returns A Promise of GrafanaUser + * @param request - The request {@link GetDomainRequest} + * @param options - The waiting options + * @returns A Promise of Domain */ - resetGrafanaUserPassword = request => this.client.fetch({ - body: JSON.stringify(marshalResetGrafanaUserPasswordRequest(request, this.client.settings)), - headers: jsonContentHeaders$n, - method: 'POST', - path: `/cockpit/v1beta1/grafana-users/${validatePathParam('grafanaUserId', request.grafanaUserId)}/reset-password` - }, unmarshalGrafanaUser); - pageOfListPlans = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/cockpit/v1beta1/plans`, - urlParams: urlParams(['order_by', request.orderBy ?? 'name_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]) - }, unmarshalListPlansResponse); - + waitForDomain = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve(!content_gen.DOMAIN_TRANSIENT_STATUSES.includes(res.status))), + this.getDomain, + request, + options + ); /** - * Get a list of all pricing plans available. + * Create a domain name binding. Create a domain name binding for the + * container with the specified ID. * - * @param request - The request {@link ListPlansRequest} - * @returns A Promise of ListPlansResponse + * @param request - The request {@link CreateDomainRequest} + * @returns A Promise of Domain */ - listPlans = (request = {}) => enrichForPagination('plans', this.pageOfListPlans, request); - + createDomain = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateDomainRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/containers/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains` + }, + marshalling_gen.unmarshalDomain + ); /** - * Select your chosen pricing plan for your Cockpit, specifying the Cockpit's - * Project ID and the pricing plan's ID in the request. + * Delete a domain name binding. Delete the domain name binding with the + * specific ID. * - * @param request - The request {@link SelectPlanRequest} - * @returns A Promise of SelectPlanResponse + * @param request - The request {@link DeleteDomainRequest} + * @returns A Promise of Domain */ - selectPlan = request => this.client.fetch({ - body: JSON.stringify(marshalSelectPlanRequest(request, this.client.settings)), - headers: jsonContentHeaders$n, - method: 'POST', - path: `/cockpit/v1beta1/select-plan` - }, unmarshalSelectPlanResponse); - pageOfListGrafanaProductDashboards = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/cockpit/v1beta1/grafana-product-dashboards`, - urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId ?? this.client.settings.defaultProjectId], ['tags', request.tags]) - }, unmarshalListGrafanaProductDashboardsResponse); - + deleteDomain = (request) => this.client.fetch( + { + method: "DELETE", + path: `/containers/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${marshalling.validatePathParam("domainId", request.domainId)}` + }, + marshalling_gen.unmarshalDomain + ); /** - * List product dashboards. Get a list of available product dashboards. + * Create a new revocable token. * - * @param request - The request {@link ListGrafanaProductDashboardsRequest} - * @returns A Promise of ListGrafanaProductDashboardsResponse + * @param request - The request {@link CreateTokenRequest} + * @returns A Promise of Token */ - listGrafanaProductDashboards = (request = {}) => enrichForPagination('dashboards', this.pageOfListGrafanaProductDashboards, request); - + createToken = (request = {}) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateTokenRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/containers/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/tokens` + }, + marshalling_gen.unmarshalToken + ); /** - * Get a product dashboard. Get a product dashboard specified by the dashboard - * ID. + * Get a token. Get a token with a specified ID. * - * @param request - The request {@link GetGrafanaProductDashboardRequest} - * @returns A Promise of GrafanaProductDashboard + * @param request - The request {@link GetTokenRequest} + * @returns A Promise of Token */ - getGrafanaProductDashboard = request => this.client.fetch({ - method: 'GET', - path: `/cockpit/v1beta1/grafana-product-dashboards/${validatePathParam('dashboardName', request.dashboardName)}`, - urlParams: urlParams(['project_id', request.projectId ?? this.client.settings.defaultProjectId]) - }, unmarshalGrafanaProductDashboard); -}; + getToken = (request) => this.client.fetch( + { + method: "GET", + path: `/containers/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/tokens/${marshalling.validatePathParam("tokenId", request.tokenId)}` + }, + marshalling_gen.unmarshalToken + ); + /** + * Waits for {@link Token} to be in a final state. + * + * @param request - The request {@link GetTokenRequest} + * @param options - The waiting options + * @returns A Promise of Token + */ + waitForToken = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve(!content_gen.TOKEN_TRANSIENT_STATUSES.includes(res.status))), + this.getToken, + request, + options + ); + pageOfListTokens = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/containers/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/tokens`, + urlParams: marshalling.urlParams( + ["container_id", request.containerId], + ["namespace_id", request.namespaceId], + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListTokensResponse + ); + /** + * List all tokens. List all tokens belonging to a specified Organization or + * Project. + * + * @param request - The request {@link ListTokensRequest} + * @returns A Promise of ListTokensResponse + */ + listTokens = (request = {}) => resourcePaginator.enrichForPagination("tokens", this.pageOfListTokens, request); + /** + * Delete a token. Delete a token with a specified ID. + * + * @param request - The request {@link DeleteTokenRequest} + * @returns A Promise of Token + */ + deleteToken = (request) => this.client.fetch( + { + method: "DELETE", + path: `/containers/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/tokens/${marshalling.validatePathParam("tokenId", request.tokenId)}` + }, + marshalling_gen.unmarshalToken + ); + /** + * Create a trigger. Create a new trigger for a specified container. + * + * @param request - The request {@link CreateTriggerRequest} + * @returns A Promise of Trigger + */ + createTrigger = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateTriggerRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/containers/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers` + }, + marshalling_gen.unmarshalTrigger + ); + /** + * Get a trigger. Get a trigger with a specified ID. + * + * @param request - The request {@link GetTriggerRequest} + * @returns A Promise of Trigger + */ + getTrigger = (request) => this.client.fetch( + { + method: "GET", + path: `/containers/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers/${marshalling.validatePathParam("triggerId", request.triggerId)}` + }, + marshalling_gen.unmarshalTrigger + ); + /** + * Waits for {@link Trigger} to be in a final state. + * + * @param request - The request {@link GetTriggerRequest} + * @param options - The waiting options + * @returns A Promise of Trigger + */ + waitForTrigger = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve(!content_gen.TRIGGER_TRANSIENT_STATUSES.includes(res.status))), + this.getTrigger, + request, + options + ); + pageOfListTriggers = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/containers/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ...Object.entries( + marshalling.resolveOneOf([ + { param: "container_id", value: request.containerId }, + { param: "namespace_id", value: request.namespaceId }, + { + default: this.client.settings.defaultProjectId, + param: "project_id", + value: request.projectId + } + ]) + ) + ) + }, + marshalling_gen.unmarshalListTriggersResponse + ); + /** + * List all triggers. List all triggers belonging to a specified Organization + * or Project. + * + * @param request - The request {@link ListTriggersRequest} + * @returns A Promise of ListTriggersResponse + */ + listTriggers = (request = {}) => resourcePaginator.enrichForPagination("triggers", this.pageOfListTriggers, request); + /** + * Update a trigger. Update a trigger with a specified ID. + * + * @param request - The request {@link UpdateTriggerRequest} + * @returns A Promise of Trigger + */ + updateTrigger = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateTriggerRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/containers/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers/${marshalling.validatePathParam("triggerId", request.triggerId)}` + }, + marshalling_gen.unmarshalTrigger + ); + /** + * Delete a trigger. Delete a trigger with a specified ID. + * + * @param request - The request {@link DeleteTriggerRequest} + * @returns A Promise of Trigger + */ + deleteTrigger = (request) => this.client.fetch( + { + method: "DELETE", + path: `/containers/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers/${marshalling.validatePathParam("triggerId", request.triggerId)}` + }, + marshalling_gen.unmarshalTrigger + ); +} +exports.API = API; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -var index_gen$m = /*#__PURE__*/Object.freeze({ - __proto__: null, - API: API$o, - COCKPIT_TRANSIENT_STATUSES: COCKPIT_TRANSIENT_STATUSES -}); +/***/ }), + +/***/ 6219: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const CONTAINER_TRANSIENT_STATUSES = [ + "deleting", + "creating", + "pending" +]; +const CRON_TRANSIENT_STATUSES = [ + "deleting", + "creating", + "pending" +]; +const DOMAIN_TRANSIENT_STATUSES = [ + "deleting", + "creating", + "pending" +]; +const NAMESPACE_TRANSIENT_STATUSES = [ + "deleting", + "creating", + "pending" +]; +const TOKEN_TRANSIENT_STATUSES = ["deleting", "creating"]; +const TRIGGER_TRANSIENT_STATUSES = [ + "deleting", + "creating", + "pending" +]; +exports.CONTAINER_TRANSIENT_STATUSES = CONTAINER_TRANSIENT_STATUSES; +exports.CRON_TRANSIENT_STATUSES = CRON_TRANSIENT_STATUSES; +exports.DOMAIN_TRANSIENT_STATUSES = DOMAIN_TRANSIENT_STATUSES; +exports.NAMESPACE_TRANSIENT_STATUSES = NAMESPACE_TRANSIENT_STATUSES; +exports.TOKEN_TRANSIENT_STATUSES = TOKEN_TRANSIENT_STATUSES; +exports.TRIGGER_TRANSIENT_STATUSES = TRIGGER_TRANSIENT_STATUSES; -var index$p = /*#__PURE__*/Object.freeze({ - __proto__: null, - v1beta1: index_gen$m -}); -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. +/***/ }), + +/***/ 4612: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/** Lists transient statutes of the enum {@link ContainerStatus}. */ -const CONTAINER_TRANSIENT_STATUSES = ['deleting', 'creating', 'pending']; +"use strict"; -/** Lists transient statutes of the enum {@link CronStatus}. */ -const CRON_TRANSIENT_STATUSES$1 = ['deleting', 'creating', 'pending']; +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api_gen = __nccwpck_require__(3336); +const content_gen = __nccwpck_require__(6219); +const validationRules_gen = __nccwpck_require__(8451); +exports.API = api_gen.API; +exports.CONTAINER_TRANSIENT_STATUSES = content_gen.CONTAINER_TRANSIENT_STATUSES; +exports.CRON_TRANSIENT_STATUSES = content_gen.CRON_TRANSIENT_STATUSES; +exports.DOMAIN_TRANSIENT_STATUSES = content_gen.DOMAIN_TRANSIENT_STATUSES; +exports.NAMESPACE_TRANSIENT_STATUSES = content_gen.NAMESPACE_TRANSIENT_STATUSES; +exports.TOKEN_TRANSIENT_STATUSES = content_gen.TOKEN_TRANSIENT_STATUSES; +exports.TRIGGER_TRANSIENT_STATUSES = content_gen.TRIGGER_TRANSIENT_STATUSES; +exports.ValidationRules = validationRules_gen; -/** Lists transient statutes of the enum {@link DomainStatus}. */ -const DOMAIN_TRANSIENT_STATUSES$3 = ['deleting', 'creating', 'pending']; -/** Lists transient statutes of the enum {@link NamespaceStatus}. */ -const NAMESPACE_TRANSIENT_STATUSES$2 = ['deleting', 'creating', 'pending']; +/***/ }), -/** Lists transient statutes of the enum {@link TokenStatus}. */ -const TOKEN_TRANSIENT_STATUSES$1 = ['deleting', 'creating']; +/***/ 2370: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/** Lists transient statutes of the enum {@link TriggerStatus}. */ -const TRIGGER_TRANSIENT_STATUSES$1 = ['deleting', 'creating', 'pending']; +"use strict"; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const unmarshalSecretHashedValue$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'SecretHashedValue' failed as data isn't a dictionary.`); +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const randomName = __nccwpck_require__(8141); +const json = __nccwpck_require__(3746); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const unmarshalSecretHashedValue = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SecretHashedValue' failed as data isn't a dictionary.` + ); } return { hashedValue: data.hashed_value, key: data.key }; }; -const unmarshalTriggerMnqNatsClientConfig$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'TriggerMnqNatsClientConfig' failed as data isn't a dictionary.`); - } - return { - mnqCredentialId: data.mnq_credential_id, - mnqNamespaceId: data.mnq_namespace_id, - mnqNatsAccountId: data.mnq_nats_account_id, - mnqProjectId: data.mnq_project_id, - mnqRegion: data.mnq_region, - subject: data.subject - }; -}; -const unmarshalTriggerMnqSqsClientConfig$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'TriggerMnqSqsClientConfig' failed as data isn't a dictionary.`); - } - return { - mnqCredentialId: data.mnq_credential_id, - mnqNamespaceId: data.mnq_namespace_id, - mnqProjectId: data.mnq_project_id, - mnqRegion: data.mnq_region, - queue: data.queue - }; -}; -const unmarshalTriggerSqsClientConfig$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'TriggerSqsClientConfig' failed as data isn't a dictionary.`); - } - return { - accessKey: data.access_key, - endpoint: data.endpoint, - queueUrl: data.queue_url, - secretKey: data.secret_key - }; -}; -const unmarshalContainer = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Container' failed as data isn't a dictionary.`); +const unmarshalContainer = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Container' failed as data isn't a dictionary.` + ); } return { cpuLimit: data.cpu_limit, @@ -12651,6 +14429,7 @@ const unmarshalContainer = data => { errorMessage: data.error_message, httpOption: data.http_option, id: data.id, + localStorageLimit: data.local_storage_limit, maxConcurrency: data.max_concurrency, maxScale: data.max_scale, memoryLimit: data.memory_limit, @@ -12662,14 +14441,20 @@ const unmarshalContainer = data => { protocol: data.protocol, region: data.region, registryImage: data.registry_image, - secretEnvironmentVariables: unmarshalArrayOfObject(data.secret_environment_variables, unmarshalSecretHashedValue$1), + sandbox: data.sandbox, + secretEnvironmentVariables: marshalling.unmarshalArrayOfObject( + data.secret_environment_variables, + unmarshalSecretHashedValue + ), status: data.status, timeout: data.timeout }; }; -const unmarshalCron$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Cron' failed as data isn't a dictionary.`); +const unmarshalCron = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Cron' failed as data isn't a dictionary.` + ); } return { args: data.args, @@ -12680,9 +14465,11 @@ const unmarshalCron$1 = data => { status: data.status }; }; -const unmarshalDomain$3 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Domain' failed as data isn't a dictionary.`); +const unmarshalDomain = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Domain' failed as data isn't a dictionary.` + ); } return { containerId: data.container_id, @@ -12693,22 +14480,11 @@ const unmarshalDomain$3 = data => { url: data.url }; }; -const unmarshalLog$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Log' failed as data isn't a dictionary.`); - } - return { - id: data.id, - level: data.level, - message: data.message, - source: data.source, - stream: data.stream, - timestamp: unmarshalDate(data.timestamp) - }; -}; -const unmarshalNamespace$3 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Namespace' failed as data isn't a dictionary.`); +const unmarshalNamespace = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Namespace' failed as data isn't a dictionary.` + ); } return { description: data.description, @@ -12721,18 +14497,23 @@ const unmarshalNamespace$3 = data => { region: data.region, registryEndpoint: data.registry_endpoint, registryNamespaceId: data.registry_namespace_id, - secretEnvironmentVariables: unmarshalArrayOfObject(data.secret_environment_variables, unmarshalSecretHashedValue$1), + secretEnvironmentVariables: marshalling.unmarshalArrayOfObject( + data.secret_environment_variables, + unmarshalSecretHashedValue + ), status: data.status }; }; -const unmarshalToken$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Token' failed as data isn't a dictionary.`); +const unmarshalToken = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Token' failed as data isn't a dictionary.` + ); } return { containerId: data.container_id, description: data.description, - expiresAt: unmarshalDate(data.expires_at), + expiresAt: marshalling.unmarshalDate(data.expires_at), id: data.id, namespaceId: data.namespace_id, publicKey: data.public_key, @@ -12740,9 +14521,51 @@ const unmarshalToken$1 = data => { token: data.token }; }; -const unmarshalTrigger$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Trigger' failed as data isn't a dictionary.`); +const unmarshalTriggerMnqNatsClientConfig = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'TriggerMnqNatsClientConfig' failed as data isn't a dictionary.` + ); + } + return { + mnqCredentialId: data.mnq_credential_id, + mnqNatsAccountId: data.mnq_nats_account_id, + mnqProjectId: data.mnq_project_id, + mnqRegion: data.mnq_region, + subject: data.subject + }; +}; +const unmarshalTriggerMnqSqsClientConfig = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'TriggerMnqSqsClientConfig' failed as data isn't a dictionary.` + ); + } + return { + mnqCredentialId: data.mnq_credential_id, + mnqProjectId: data.mnq_project_id, + mnqRegion: data.mnq_region, + queue: data.queue + }; +}; +const unmarshalTriggerSqsClientConfig = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'TriggerSqsClientConfig' failed as data isn't a dictionary.` + ); + } + return { + accessKey: data.access_key, + endpoint: data.endpoint, + queueUrl: data.queue_url, + secretKey: data.secret_key + }; +}; +const unmarshalTrigger = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Trigger' failed as data isn't a dictionary.` + ); } return { containerId: data.container_id, @@ -12751,107 +14574,88 @@ const unmarshalTrigger$1 = data => { id: data.id, inputType: data.input_type, name: data.name, - scwNatsConfig: data.scw_nats_config ? unmarshalTriggerMnqNatsClientConfig$1(data.scw_nats_config) : undefined, - scwSqsConfig: data.scw_sqs_config ? unmarshalTriggerMnqSqsClientConfig$1(data.scw_sqs_config) : undefined, - sqsConfig: data.sqs_config ? unmarshalTriggerSqsClientConfig$1(data.sqs_config) : undefined, + scwNatsConfig: data.scw_nats_config ? unmarshalTriggerMnqNatsClientConfig(data.scw_nats_config) : void 0, + scwSqsConfig: data.scw_sqs_config ? unmarshalTriggerMnqSqsClientConfig(data.scw_sqs_config) : void 0, + sqsConfig: data.sqs_config ? unmarshalTriggerSqsClientConfig(data.sqs_config) : void 0, status: data.status }; }; -const unmarshalListContainersResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListContainersResponse' failed as data isn't a dictionary.`); - } - return { - containers: unmarshalArrayOfObject(data.containers, unmarshalContainer), - totalCount: data.total_count - }; -}; -const unmarshalListCronsResponse$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListCronsResponse' failed as data isn't a dictionary.`); +const unmarshalListContainersResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListContainersResponse' failed as data isn't a dictionary.` + ); } return { - crons: unmarshalArrayOfObject(data.crons, unmarshalCron$1), + containers: marshalling.unmarshalArrayOfObject(data.containers, unmarshalContainer), totalCount: data.total_count }; }; -const unmarshalListDomainsResponse$3 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListDomainsResponse' failed as data isn't a dictionary.`); +const unmarshalListCronsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListCronsResponse' failed as data isn't a dictionary.` + ); } return { - domains: unmarshalArrayOfObject(data.domains, unmarshalDomain$3), + crons: marshalling.unmarshalArrayOfObject(data.crons, unmarshalCron), totalCount: data.total_count }; }; -const unmarshalListLogsResponse$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListLogsResponse' failed as data isn't a dictionary.`); +const unmarshalListDomainsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListDomainsResponse' failed as data isn't a dictionary.` + ); } return { - logs: unmarshalArrayOfObject(data.logs, unmarshalLog$1), + domains: marshalling.unmarshalArrayOfObject(data.domains, unmarshalDomain), totalCount: data.total_count }; }; -const unmarshalListNamespacesResponse$3 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListNamespacesResponse' failed as data isn't a dictionary.`); +const unmarshalListNamespacesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListNamespacesResponse' failed as data isn't a dictionary.` + ); } return { - namespaces: unmarshalArrayOfObject(data.namespaces, unmarshalNamespace$3), + namespaces: marshalling.unmarshalArrayOfObject(data.namespaces, unmarshalNamespace), totalCount: data.total_count }; }; -const unmarshalListTokensResponse$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListTokensResponse' failed as data isn't a dictionary.`); +const unmarshalListTokensResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListTokensResponse' failed as data isn't a dictionary.` + ); } return { - tokens: unmarshalArrayOfObject(data.tokens, unmarshalToken$1), + tokens: marshalling.unmarshalArrayOfObject(data.tokens, unmarshalToken), totalCount: data.total_count }; }; -const unmarshalListTriggersResponse$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListTriggersResponse' failed as data isn't a dictionary.`); +const unmarshalListTriggersResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListTriggersResponse' failed as data isn't a dictionary.` + ); } return { totalCount: data.total_count, - triggers: unmarshalArrayOfObject(data.triggers, unmarshalTrigger$1) + triggers: marshalling.unmarshalArrayOfObject(data.triggers, unmarshalTrigger) }; }; -const marshalCreateTriggerRequestMnqNatsClientConfig$1 = (request, defaults) => ({ - mnq_namespace_id: request.mnqNamespaceId, - mnq_nats_account_id: request.mnqNatsAccountId, - mnq_project_id: request.mnqProjectId, - mnq_region: request.mnqRegion, - subject: request.subject -}); -const marshalCreateTriggerRequestMnqSqsClientConfig$1 = (request, defaults) => ({ - mnq_namespace_id: request.mnqNamespaceId, - mnq_project_id: request.mnqProjectId, - mnq_region: request.mnqRegion, - queue: request.queue -}); -const marshalCreateTriggerRequestSqsClientConfig$1 = (request, defaults) => ({ - access_key: request.accessKey, - endpoint: request.endpoint, - queue_url: request.queueUrl, - secret_key: request.secretKey -}); -const marshalSecret$1 = (request, defaults) => ({ +const marshalSecret = (request, defaults) => ({ key: request.key, value: request.value }); -const marshalUpdateTriggerRequestSqsClientConfig$1 = (request, defaults) => ({ - access_key: request.accessKey, - secret_key: request.secretKey -}); const marshalCreateContainerRequest = (request, defaults) => ({ cpu_limit: request.cpuLimit, description: request.description, environment_variables: request.environmentVariables, - http_option: request.httpOption ?? 'unknown_http_option', + http_option: request.httpOption, + local_storage_limit: request.localStorageLimit, max_concurrency: request.maxConcurrency, max_scale: request.maxScale, memory_limit: request.memoryLimit, @@ -12859,21040 +14663,41570 @@ const marshalCreateContainerRequest = (request, defaults) => ({ name: request.name, namespace_id: request.namespaceId, port: request.port, - privacy: request.privacy ?? 'unknown_privacy', - protocol: request.protocol ?? 'unknown_protocol', + privacy: request.privacy, + protocol: request.protocol, registry_image: request.registryImage, - secret_environment_variables: request.secretEnvironmentVariables ? request.secretEnvironmentVariables.map(elt => marshalSecret$1(elt)) : undefined, + sandbox: request.sandbox, + secret_environment_variables: request.secretEnvironmentVariables !== void 0 ? request.secretEnvironmentVariables.map( + (elt) => marshalSecret(elt) + ) : void 0, timeout: request.timeout }); -const marshalCreateCronRequest$1 = (request, defaults) => ({ +const marshalCreateCronRequest = (request, defaults) => ({ args: request.args, container_id: request.containerId, name: request.name, schedule: request.schedule }); -const marshalCreateDomainRequest$2 = (request, defaults) => ({ +const marshalCreateDomainRequest = (request, defaults) => ({ container_id: request.containerId, hostname: request.hostname }); -const marshalCreateNamespaceRequest$3 = (request, defaults) => ({ +const marshalCreateNamespaceRequest = (request, defaults) => ({ description: request.description, environment_variables: request.environmentVariables, - name: request.name || randomName('cns'), + name: request.name || randomName("cns"), project_id: request.projectId ?? defaults.defaultProjectId, - secret_environment_variables: request.secretEnvironmentVariables ? request.secretEnvironmentVariables.map(elt => marshalSecret$1(elt)) : undefined + secret_environment_variables: request.secretEnvironmentVariables !== void 0 ? request.secretEnvironmentVariables.map( + (elt) => marshalSecret(elt) + ) : void 0 }); -const marshalCreateTokenRequest$1 = (request, defaults) => ({ +const marshalCreateTokenRequest = (request, defaults) => ({ description: request.description, expires_at: request.expiresAt, - ...resolveOneOf([{ - param: 'container_id', - value: request.containerId - }, { - param: 'namespace_id', - value: request.namespaceId - }]) -}); -const marshalCreateTriggerRequest$1 = (request, defaults) => ({ + ...marshalling.resolveOneOf([ + { param: "container_id", value: request.containerId }, + { param: "namespace_id", value: request.namespaceId } + ]) +}); +const marshalCreateTriggerRequestMnqNatsClientConfig = (request, defaults) => ({ + mnq_nats_account_id: request.mnqNatsAccountId, + mnq_project_id: request.mnqProjectId, + mnq_region: request.mnqRegion, + subject: request.subject +}); +const marshalCreateTriggerRequestMnqSqsClientConfig = (request, defaults) => ({ + mnq_project_id: request.mnqProjectId, + mnq_region: request.mnqRegion, + queue: request.queue +}); +const marshalCreateTriggerRequestSqsClientConfig = (request, defaults) => ({ + access_key: request.accessKey, + endpoint: request.endpoint, + queue_url: request.queueUrl, + secret_key: request.secretKey +}); +const marshalCreateTriggerRequest = (request, defaults) => ({ container_id: request.containerId, description: request.description, name: request.name, - ...resolveOneOf([{ - param: 'scw_sqs_config', - value: request.scwSqsConfig ? marshalCreateTriggerRequestMnqSqsClientConfig$1(request.scwSqsConfig) : undefined - }, { - param: 'sqs_config', - value: request.sqsConfig ? marshalCreateTriggerRequestSqsClientConfig$1(request.sqsConfig) : undefined - }, { - param: 'scw_nats_config', - value: request.scwNatsConfig ? marshalCreateTriggerRequestMnqNatsClientConfig$1(request.scwNatsConfig) : undefined - }]) + ...marshalling.resolveOneOf([ + { + param: "scw_sqs_config", + value: request.scwSqsConfig !== void 0 ? marshalCreateTriggerRequestMnqSqsClientConfig( + request.scwSqsConfig + ) : void 0 + }, + { + param: "scw_nats_config", + value: request.scwNatsConfig !== void 0 ? marshalCreateTriggerRequestMnqNatsClientConfig( + request.scwNatsConfig + ) : void 0 + }, + { + param: "sqs_config", + value: request.sqsConfig !== void 0 ? marshalCreateTriggerRequestSqsClientConfig( + request.sqsConfig + ) : void 0 + } + ]) }); const marshalUpdateContainerRequest = (request, defaults) => ({ cpu_limit: request.cpuLimit, description: request.description, environment_variables: request.environmentVariables, - http_option: request.httpOption ?? 'unknown_http_option', + http_option: request.httpOption, + local_storage_limit: request.localStorageLimit, max_concurrency: request.maxConcurrency, max_scale: request.maxScale, memory_limit: request.memoryLimit, min_scale: request.minScale, port: request.port, - privacy: request.privacy ?? 'unknown_privacy', - protocol: request.protocol ?? 'unknown_protocol', + privacy: request.privacy, + protocol: request.protocol, redeploy: request.redeploy, registry_image: request.registryImage, - secret_environment_variables: request.secretEnvironmentVariables ? request.secretEnvironmentVariables.map(elt => marshalSecret$1(elt)) : undefined, + sandbox: request.sandbox, + secret_environment_variables: request.secretEnvironmentVariables !== void 0 ? request.secretEnvironmentVariables.map( + (elt) => marshalSecret(elt) + ) : void 0, timeout: request.timeout }); -const marshalUpdateCronRequest$1 = (request, defaults) => ({ +const marshalUpdateCronRequest = (request, defaults) => ({ args: request.args, container_id: request.containerId, name: request.name, schedule: request.schedule }); -const marshalUpdateNamespaceRequest$3 = (request, defaults) => ({ +const marshalUpdateNamespaceRequest = (request, defaults) => ({ description: request.description, environment_variables: request.environmentVariables, - secret_environment_variables: request.secretEnvironmentVariables ? request.secretEnvironmentVariables.map(elt => marshalSecret$1(elt)) : undefined + secret_environment_variables: request.secretEnvironmentVariables !== void 0 ? request.secretEnvironmentVariables.map( + (elt) => marshalSecret(elt) + ) : void 0 +}); +const marshalUpdateTriggerRequestSqsClientConfig = (request, defaults) => ({ + access_key: request.accessKey, + secret_key: request.secretKey }); -const marshalUpdateTriggerRequest$1 = (request, defaults) => ({ +const marshalUpdateTriggerRequest = (request, defaults) => ({ description: request.description, name: request.name, - ...resolveOneOf([{ - param: 'sqs_config', - value: request.sqsConfig ? marshalUpdateTriggerRequestSqsClientConfig$1(request.sqsConfig) : undefined - }]) -}); + ...marshalling.resolveOneOf([ + { + param: "sqs_config", + value: request.sqsConfig !== void 0 ? marshalUpdateTriggerRequestSqsClientConfig( + request.sqsConfig + ) : void 0 + } + ]) +}); +exports.marshalCreateContainerRequest = marshalCreateContainerRequest; +exports.marshalCreateCronRequest = marshalCreateCronRequest; +exports.marshalCreateDomainRequest = marshalCreateDomainRequest; +exports.marshalCreateNamespaceRequest = marshalCreateNamespaceRequest; +exports.marshalCreateTokenRequest = marshalCreateTokenRequest; +exports.marshalCreateTriggerRequest = marshalCreateTriggerRequest; +exports.marshalUpdateContainerRequest = marshalUpdateContainerRequest; +exports.marshalUpdateCronRequest = marshalUpdateCronRequest; +exports.marshalUpdateNamespaceRequest = marshalUpdateNamespaceRequest; +exports.marshalUpdateTriggerRequest = marshalUpdateTriggerRequest; +exports.unmarshalContainer = unmarshalContainer; +exports.unmarshalCron = unmarshalCron; +exports.unmarshalDomain = unmarshalDomain; +exports.unmarshalListContainersResponse = unmarshalListContainersResponse; +exports.unmarshalListCronsResponse = unmarshalListCronsResponse; +exports.unmarshalListDomainsResponse = unmarshalListDomainsResponse; +exports.unmarshalListNamespacesResponse = unmarshalListNamespacesResponse; +exports.unmarshalListTokensResponse = unmarshalListTokensResponse; +exports.unmarshalListTriggersResponse = unmarshalListTriggersResponse; +exports.unmarshalNamespace = unmarshalNamespace; +exports.unmarshalToken = unmarshalToken; +exports.unmarshalTrigger = unmarshalTrigger; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const jsonContentHeaders$m = { - 'Content-Type': 'application/json; charset=utf-8' -}; -/** Serverless Containers API. */ -let API$n = class API extends API$u { - /** Lists the available regions of the API. */ - static LOCALITIES = ['fr-par', 'nl-ams', 'pl-waw']; - pageOfListNamespaces = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces`, - urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId]) - }, unmarshalListNamespacesResponse$3); +/***/ }), - /** - * List all your namespaces. List all namespaces in a specified region. - * - * @param request - The request {@link ListNamespacesRequest} - * @returns A Promise of ListNamespacesResponse - */ - listNamespaces = (request = {}) => enrichForPagination('namespaces', this.pageOfListNamespaces, request); +/***/ 8451: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const CreateTriggerRequest = { + description: { + maxLength: 255 + }, + name: { + maxLength: 50, + minLength: 1 + } +}; +const CreateTriggerRequestMnqNatsClientConfig = { + mnqRegion: { + maxLength: 20, + minLength: 1 + }, + subject: { + maxLength: 100, + minLength: 1, + pattern: /^[^\s]+$/ + } +}; +const CreateTriggerRequestMnqSqsClientConfig = { + mnqRegion: { + maxLength: 20, + minLength: 1 + }, + queue: { + maxLength: 100, + minLength: 1 + } +}; +const UpdateTriggerRequest = { + description: { + maxLength: 255 + }, + name: { + maxLength: 50, + minLength: 1 + } +}; +exports.CreateTriggerRequest = CreateTriggerRequest; +exports.CreateTriggerRequestMnqNatsClientConfig = CreateTriggerRequestMnqNatsClientConfig; +exports.CreateTriggerRequestMnqSqsClientConfig = CreateTriggerRequestMnqSqsClientConfig; +exports.UpdateTriggerRequest = UpdateTriggerRequest; + + +/***/ }), +/***/ 1157: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const index_gen = __nccwpck_require__(3005); +exports.v1 = index_gen; + + +/***/ }), + +/***/ 4721: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const intervalRetrier = __nccwpck_require__(9052); +const api = __nccwpck_require__(3042); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const resourcePaginator = __nccwpck_require__(4983); +const content_gen = __nccwpck_require__(7422); +const marshalling_gen = __nccwpck_require__(4055); +const jsonContentHeaders = { + "Content-Type": "application/json; charset=utf-8" +}; +class API extends api.API { + /** Lists the available zones of the API. */ + static LOCALITIES = [ + "fr-par-1", + "fr-par-2", + "nl-ams-1" + ]; + pageOfListServers = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/dedibox/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + [ + "project_id", + request.projectId ?? this.client.settings.defaultProjectId + ], + ["search", request.search] + ) + }, + marshalling_gen.unmarshalListServersResponse + ); /** - * Get a namespace. Get the namespace associated with the specified ID. + * List baremetal servers for project. * - * @param request - The request {@link GetNamespaceRequest} - * @returns A Promise of Namespace + * @param request - The request {@link ListServersRequest} + * @returns A Promise of ListServersResponse */ - getNamespace = request => this.client.fetch({ - method: 'GET', - path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam('namespaceId', request.namespaceId)}` - }, unmarshalNamespace$3); - + listServers = (request = {}) => resourcePaginator.enrichForPagination("servers", this.pageOfListServers, request); /** - * Waits for {@link Namespace} to be in a final state. + * Get a specific baremetal server. Get the server associated with the given + * ID. * - * @param request - The request {@link GetNamespaceRequest} - * @param options - The waiting options - * @returns A Promise of Namespace + * @param request - The request {@link GetServerRequest} + * @returns A Promise of Server */ - waitForNamespace = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!NAMESPACE_TRANSIENT_STATUSES$2.includes(res.status))), this.getNamespace, request, options); - + getServer = (request) => this.client.fetch( + { + method: "GET", + path: `/dedibox/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}` + }, + marshalling_gen.unmarshalServer + ); /** - * Create a new namespace. Create a new namespace in a specified region. + * Waits for {@link Server} to be in a final state. * - * @param request - The request {@link CreateNamespaceRequest} - * @returns A Promise of Namespace + * @param request - The request {@link GetServerRequest} + * @param options - The waiting options + * @returns A Promise of Server */ - createNamespace = (request = {}) => this.client.fetch({ - body: JSON.stringify(marshalCreateNamespaceRequest$3(request, this.client.settings)), - headers: jsonContentHeaders$m, - method: 'POST', - path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces` - }, unmarshalNamespace$3); - + waitForServer = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve(!content_gen.SERVER_TRANSIENT_STATUSES.includes(res.status))), + this.getServer, + request, + options + ); + getServerBackup = (request) => this.client.fetch( + { + method: "GET", + path: `/dedibox/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/backups` + }, + marshalling_gen.unmarshalBackup + ); + updateServerBackup = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateServerBackupRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/dedibox/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/backups` + }, + marshalling_gen.unmarshalBackup + ); + pageOfListSubscribableServerOptions = (request) => this.client.fetch( + { + method: "GET", + path: `/dedibox/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/subscribable-server-options`, + urlParams: marshalling.urlParams( + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListSubscribableServerOptionsResponse + ); + /** + * List subscribable server options. List subscribable options associated to + * the given server ID. + * + * @param request - The request {@link ListSubscribableServerOptionsRequest} + * @returns A Promise of ListSubscribableServerOptionsResponse + */ + listSubscribableServerOptions = (request) => resourcePaginator.enrichForPagination( + "serverOptions", + this.pageOfListSubscribableServerOptions, + request + ); + /** + * Subscribe server option. Subscribe option for the given server ID. + * + * @param request - The request {@link SubscribeServerOptionRequest} + * @returns A Promise of Service + */ + subscribeServerOption = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalSubscribeServerOptionRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/dedibox/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/subscribe-server-option` + }, + marshalling_gen.unmarshalService + ); /** - * Update an existing namespace. Update the space associated with the - * specified ID. + * Create a baremetal server. Create a new baremetal server. The order return + * you a service ID to follow the provisionning status you could call + * GetService. * - * @param request - The request {@link UpdateNamespaceRequest} - * @returns A Promise of Namespace - */ - updateNamespace = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateNamespaceRequest$3(request, this.client.settings)), - headers: jsonContentHeaders$m, - method: 'PATCH', - path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam('namespaceId', request.namespaceId)}` - }, unmarshalNamespace$3); - + * @param request - The request {@link CreateServerRequest} + * @returns A Promise of Service + */ + createServer = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateServerRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/dedibox/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers` + }, + marshalling_gen.unmarshalService + ); /** - * Delete an existing namespace. Delete the namespace associated with the - * specified ID. + * Subscribe storage server option. Subscribe storage option for the given + * server ID. * - * @param request - The request {@link DeleteNamespaceRequest} - * @returns A Promise of Namespace + * @param request - The request {@link SubscribeStorageOptionsRequest} + * @returns A Promise of SubscribeStorageOptionsResponse + */ + subscribeStorageOptions = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalSubscribeStorageOptionsRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/dedibox/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/subscribe-storage-options` + }, + marshalling_gen.unmarshalSubscribeStorageOptionsResponse + ); + /** + * Update a baremetal server. Update the server associated with the given ID. + * + * @param request - The request {@link UpdateServerRequest} + * @returns A Promise of Server */ - deleteNamespace = request => this.client.fetch({ - method: 'DELETE', - path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam('namespaceId', request.namespaceId)}` - }, unmarshalNamespace$3); - pageOfListContainers = request => this.client.fetch({ - method: 'GET', - path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/containers`, - urlParams: urlParams(['name', request.name], ['namespace_id', request.namespaceId], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId]) - }, unmarshalListContainersResponse); - + updateServer = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateServerRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/dedibox/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}` + }, + marshalling_gen.unmarshalServer + ); + updateServerTags = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateServerTagsRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/dedibox/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/tags` + }, + marshalling_gen.unmarshalServer + ); /** - * List all your containers. List all containers for a specified region. + * Reboot a baremetal server. Reboot the server associated with the given ID, + * use boot param to reboot in rescue. * - * @param request - The request {@link ListContainersRequest} - * @returns A Promise of ListContainersResponse + * @param request - The request {@link RebootServerRequest} */ - listContainers = request => enrichForPagination('containers', this.pageOfListContainers, request); - + rebootServer = (request) => this.client.fetch({ + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/dedibox/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/reboot` + }); /** - * Get a container. Get the container associated with the specified ID. + * Start a baremetal server. Start the server associated with the given ID. * - * @param request - The request {@link GetContainerRequest} - * @returns A Promise of Container + * @param request - The request {@link StartServerRequest} */ - getContainer = request => this.client.fetch({ - method: 'GET', - path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/containers/${validatePathParam('containerId', request.containerId)}` - }, unmarshalContainer); - + startServer = (request) => this.client.fetch({ + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/dedibox/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/start` + }); /** - * Waits for {@link Container} to be in a final state. + * Stop a baremetal server. Stop the server associated with the given ID. * - * @param request - The request {@link GetContainerRequest} - * @param options - The waiting options - * @returns A Promise of Container + * @param request - The request {@link StopServerRequest} */ - waitForContainer = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!CONTAINER_TRANSIENT_STATUSES.includes(res.status))), this.getContainer, request, options); - + stopServer = (request) => this.client.fetch({ + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/dedibox/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/stop` + }); /** - * Create a new container. Create a new container in the specified region. + * Delete a baremetal server. Delete the server associated with the given ID. * - * @param request - The request {@link CreateContainerRequest} - * @returns A Promise of Container + * @param request - The request {@link DeleteServerRequest} */ - createContainer = request => this.client.fetch({ - body: JSON.stringify(marshalCreateContainerRequest(request, this.client.settings)), - headers: jsonContentHeaders$m, - method: 'POST', - path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/containers` - }, unmarshalContainer); - + deleteServer = (request) => this.client.fetch({ + method: "DELETE", + path: `/dedibox/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}` + }); + pageOfListServerEvents = (request) => this.client.fetch( + { + method: "GET", + path: `/dedibox/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/events`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListServerEventsResponse + ); /** - * Update an existing container. Update the container associated with the - * specified ID. + * List server events. List events associated to the given server ID. * - * @param request - The request {@link UpdateContainerRequest} - * @returns A Promise of Container + * @param request - The request {@link ListServerEventsRequest} + * @returns A Promise of ListServerEventsResponse */ - updateContainer = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateContainerRequest(request, this.client.settings)), - headers: jsonContentHeaders$m, - method: 'PATCH', - path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/containers/${validatePathParam('containerId', request.containerId)}` - }, unmarshalContainer); - + listServerEvents = (request) => resourcePaginator.enrichForPagination("events", this.pageOfListServerEvents, request); + pageOfListServerDisks = (request) => this.client.fetch( + { + method: "GET", + path: `/dedibox/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/disks`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListServerDisksResponse + ); /** - * Delete a container. Delete the container associated with the specified ID. + * List server disks. List disks associated to the given server ID. * - * @param request - The request {@link DeleteContainerRequest} - * @returns A Promise of Container + * @param request - The request {@link ListServerDisksRequest} + * @returns A Promise of ListServerDisksResponse */ - deleteContainer = request => this.client.fetch({ - method: 'DELETE', - path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/containers/${validatePathParam('containerId', request.containerId)}` - }, unmarshalContainer); - + listServerDisks = (request) => resourcePaginator.enrichForPagination("disks", this.pageOfListServerDisks, request); + getOrderedService = (request) => this.client.fetch( + { + method: "GET", + path: `/dedibox/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ordered-services/${marshalling.validatePathParam("orderedServiceId", request.orderedServiceId)}` + }, + marshalling_gen.unmarshalService + ); /** - * Deploy a container. Deploy a container associated with the specified ID. + * Get a specific service. Get the service associated with the given ID. * - * @param request - The request {@link DeployContainerRequest} - * @returns A Promise of Container + * @param request - The request {@link GetServiceRequest} + * @returns A Promise of Service */ - deployContainer = request => this.client.fetch({ - body: '{}', - headers: jsonContentHeaders$m, - method: 'POST', - path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/containers/${validatePathParam('containerId', request.containerId)}/deploy` - }, unmarshalContainer); - pageOfListCrons = request => this.client.fetch({ - method: 'GET', - path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/crons`, - urlParams: urlParams(['container_id', request.containerId], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]) - }, unmarshalListCronsResponse$1); - + getService = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "PATCH", + path: `/dedibox/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/services/${marshalling.validatePathParam("serviceId", request.serviceId)}` + }, + marshalling_gen.unmarshalService + ); /** - * List all your crons. + * Delete a specific service. Delete the service associated with the given ID. * - * @param request - The request {@link ListCronsRequest} - * @returns A Promise of ListCronsResponse + * @param request - The request {@link DeleteServiceRequest} + * @returns A Promise of Service */ - listCrons = request => enrichForPagination('crons', this.pageOfListCrons, request); - + deleteService = (request) => this.client.fetch( + { + method: "DELETE", + path: `/dedibox/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/services/${marshalling.validatePathParam("serviceId", request.serviceId)}` + }, + marshalling_gen.unmarshalService + ); + pageOfListServices = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/dedibox/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/services`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId] + ) + }, + marshalling_gen.unmarshalListServicesResponse + ); /** - * Get a cron. Get the cron associated with the specified ID. + * List services. * - * @param request - The request {@link GetCronRequest} - * @returns A Promise of Cron + * @param request - The request {@link ListServicesRequest} + * @returns A Promise of ListServicesResponse */ - getCron = request => this.client.fetch({ - method: 'GET', - path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/crons/${validatePathParam('cronId', request.cronId)}` - }, unmarshalCron$1); - + listServices = (request = {}) => resourcePaginator.enrichForPagination("services", this.pageOfListServices, request); /** - * Waits for {@link Cron} to be in a final state. + * Install a baremetal server. Install an OS on the server associated with the + * given ID. * - * @param request - The request {@link GetCronRequest} - * @param options - The waiting options - * @returns A Promise of Cron + * @param request - The request {@link InstallServerRequest} + * @returns A Promise of ServerInstall */ - waitForCron = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!CRON_TRANSIENT_STATUSES$1.includes(res.status))), this.getCron, request, options); - + installServer = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalInstallServerRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/dedibox/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/install` + }, + marshalling_gen.unmarshalServerInstall + ); /** - * Create a new cron. + * Get a specific server installation status. Get the server installation + * status associated with the given server ID. * - * @param request - The request {@link CreateCronRequest} - * @returns A Promise of Cron + * @param request - The request {@link GetServerInstallRequest} + * @returns A Promise of ServerInstall */ - createCron = request => this.client.fetch({ - body: JSON.stringify(marshalCreateCronRequest$1(request, this.client.settings)), - headers: jsonContentHeaders$m, - method: 'POST', - path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/crons` - }, unmarshalCron$1); - + getServerInstall = (request) => this.client.fetch( + { + method: "GET", + path: `/dedibox/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/install` + }, + marshalling_gen.unmarshalServerInstall + ); /** - * Update an existing cron. Update the cron associated with the specified ID. + * Waits for {@link ServerInstall} to be in a final state. * - * @param request - The request {@link UpdateCronRequest} - * @returns A Promise of Cron + * @param request - The request {@link GetServerInstallRequest} + * @param options - The waiting options + * @returns A Promise of ServerInstall */ - updateCron = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateCronRequest$1(request, this.client.settings)), - headers: jsonContentHeaders$m, - method: 'PATCH', - path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/crons/${validatePathParam('cronId', request.cronId)}` - }, unmarshalCron$1); - + waitForServerInstall = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve( + !content_gen.SERVER_INSTALL_TRANSIENT_STATUSES.includes(res.status) + )), + this.getServerInstall, + request, + options + ); /** - * Delete an existing cron. Delete the cron associated with the specified ID. + * Cancels the current (running) server installation. Cancels the current + * server installation associated with the given server ID. * - * @param request - The request {@link DeleteCronRequest} - * @returns A Promise of Cron + * @param request - The request {@link CancelServerInstallRequest} */ - deleteCron = request => this.client.fetch({ - method: 'DELETE', - path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/crons/${validatePathParam('cronId', request.cronId)}` - }, unmarshalCron$1); - pageOfListLogs = request => this.client.fetch({ - method: 'GET', - path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/containers/${validatePathParam('containerId', request.containerId)}/logs`, - urlParams: urlParams(['order_by', request.orderBy ?? 'timestamp_desc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]) - }, unmarshalListLogsResponse$1); - + cancelServerInstall = (request) => this.client.fetch({ + method: "POST", + path: `/dedibox/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/cancel-install` + }); /** - * List your container logs. List the logs of the container with the specified - * ID. + * Get server default partitioning. Get the server default partitioning schema + * associated with the given server ID and OS ID. * - * @param request - The request {@link ListLogsRequest} - * @returns A Promise of ListLogsResponse + * @param request - The request {@link GetServerDefaultPartitioningRequest} + * @returns A Promise of ServerDefaultPartitioning */ - listLogs = request => enrichForPagination('logs', this.pageOfListLogs, request); - pageOfListDomains = request => this.client.fetch({ - method: 'GET', - path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains`, - urlParams: urlParams(['container_id', request.containerId], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]) - }, unmarshalListDomainsResponse$3); - + getServerDefaultPartitioning = (request) => this.client.fetch( + { + method: "GET", + path: `/dedibox/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/partitioning/${marshalling.validatePathParam("osId", request.osId)}` + }, + marshalling_gen.unmarshalServerDefaultPartitioning + ); /** - * List all domain name bindings. List all domain name bindings in a specified - * region. + * Start BMC (Baseboard Management Controller) access for a given baremetal + * server. Start BMC (Baseboard Management Controller) access associated with + * the given ID. The BMC (Baseboard Management Controller) access is available + * one hour after the installation of the server. * - * @param request - The request {@link ListDomainsRequest} - * @returns A Promise of ListDomainsResponse + * @param request - The request {@link StartBMCAccessRequest} */ - listDomains = request => enrichForPagination('domains', this.pageOfListDomains, request); - + startBMCAccess = (request) => this.client.fetch({ + body: JSON.stringify( + marshalling_gen.marshalStartBMCAccessRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/dedibox/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/bmc-access` + }); /** - * Get a domain name binding. Get a domain name binding for the container with - * the specified ID. + * Get BMC (Baseboard Management Controller) access for a given baremetal + * server. Get the BMC (Baseboard Management Controller) access associated + * with the given ID. * - * @param request - The request {@link GetDomainRequest} - * @returns A Promise of Domain + * @param request - The request {@link GetBMCAccessRequest} + * @returns A Promise of BMCAccess */ - getDomain = request => this.client.fetch({ - method: 'GET', - path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam('domainId', request.domainId)}` - }, unmarshalDomain$3); - + getBMCAccess = (request) => this.client.fetch( + { + method: "GET", + path: `/dedibox/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/bmc-access` + }, + marshalling_gen.unmarshalBMCAccess + ); /** - * Waits for {@link Domain} to be in a final state. + * Waits for {@link BMCAccess} to be in a final state. * - * @param request - The request {@link GetDomainRequest} + * @param request - The request {@link GetBMCAccessRequest} * @param options - The waiting options - * @returns A Promise of Domain + * @returns A Promise of BMCAccess */ - waitForDomain = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!DOMAIN_TRANSIENT_STATUSES$3.includes(res.status))), this.getDomain, request, options); - + waitForBMCAccess = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve(!content_gen.BMC_ACCESS_TRANSIENT_STATUSES.includes(res.status))), + this.getBMCAccess, + request, + options + ); /** - * Create a domain name binding. Create a domain name binding for the - * container with the specified ID. + * Stop BMC (Baseboard Management Controller) access for a given baremetal + * server. Stop BMC (Baseboard Management Controller) access associated with + * the given ID. * - * @param request - The request {@link CreateDomainRequest} - * @returns A Promise of Domain + * @param request - The request {@link StopBMCAccessRequest} */ - createDomain = request => this.client.fetch({ - body: JSON.stringify(marshalCreateDomainRequest$2(request, this.client.settings)), - headers: jsonContentHeaders$m, - method: 'POST', - path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains` - }, unmarshalDomain$3); - + stopBMCAccess = (request) => this.client.fetch({ + method: "DELETE", + path: `/dedibox/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/bmc-access` + }); + pageOfListOffers = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/dedibox/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/offers`, + urlParams: marshalling.urlParams( + ["available_only", request.availableOnly], + ["catalog", request.catalog], + ["commercial_range", request.commercialRange], + ["is_failover_block", request.isFailoverBlock], + ["is_failover_ip", request.isFailoverIp], + ["is_rpn_san", request.isRpnSan], + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId], + [ + "sold_in", + request.soldIn && request.soldIn.length > 0 ? request.soldIn.join(",") : void 0 + ] + ) + }, + marshalling_gen.unmarshalListOffersResponse + ); /** - * Delete a domain name binding. Delete the domain name binding with the - * specific ID. + * List offers. List all available server offers. * - * @param request - The request {@link DeleteDomainRequest} - * @returns A Promise of Domain + * @param request - The request {@link ListOffersRequest} + * @returns A Promise of ListOffersResponse */ - deleteDomain = request => this.client.fetch({ - method: 'DELETE', - path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam('domainId', request.domainId)}` - }, unmarshalDomain$3); - + listOffers = (request = {}) => resourcePaginator.enrichForPagination("offers", this.pageOfListOffers, request); /** - * @deprecated - * @param request - The request {@link IssueJWTRequest} - * @returns A Promise of Token + * Get offer. Return specific offer for the given ID. + * + * @param request - The request {@link GetOfferRequest} + * @returns A Promise of Offer */ - issueJWT = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/issue-jwt`, - urlParams: urlParams(['expires_at', request.expiresAt], ...Object.entries(resolveOneOf([{ - param: 'container_id', - value: request.containerId - }, { - param: 'namespace_id', - value: request.namespaceId - }]))) - }, unmarshalToken$1); - + getOffer = (request) => this.client.fetch( + { + method: "GET", + path: `/dedibox/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/offers/${marshalling.validatePathParam("offerId", request.offerId)}`, + urlParams: marshalling.urlParams(["project_id", request.projectId]) + }, + marshalling_gen.unmarshalOffer + ); + pageOfListOS = (request) => this.client.fetch( + { + method: "GET", + path: `/dedibox/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/os`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId], + ["server_id", request.serverId], + ["type", request.type] + ) + }, + marshalling_gen.unmarshalListOSResponse + ); /** - * Create a new revocable token. + * List all available OS that can be install on a baremetal server. * - * @param request - The request {@link CreateTokenRequest} - * @returns A Promise of Token + * @param request - The request {@link ListOSRequest} + * @returns A Promise of ListOSResponse */ - createToken = (request = {}) => this.client.fetch({ - body: JSON.stringify(marshalCreateTokenRequest$1(request, this.client.settings)), - headers: jsonContentHeaders$m, - method: 'POST', - path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/tokens` - }, unmarshalToken$1); - + listOS = (request) => resourcePaginator.enrichForPagination("os", this.pageOfListOS, request); /** - * Get a token. Get a token with a specified ID. + * Get an OS with a given ID. Return specific OS for the given ID. * - * @param request - The request {@link GetTokenRequest} - * @returns A Promise of Token + * @param request - The request {@link GetOSRequest} + * @returns A Promise of OS */ - getToken = request => this.client.fetch({ - method: 'GET', - path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/tokens/${validatePathParam('tokenId', request.tokenId)}` - }, unmarshalToken$1); - + getOS = (request) => this.client.fetch( + { + method: "GET", + path: `/dedibox/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/os/${marshalling.validatePathParam("osId", request.osId)}`, + urlParams: marshalling.urlParams( + ["project_id", request.projectId], + ["server_id", request.serverId] + ) + }, + marshalling_gen.unmarshalOS + ); /** - * Waits for {@link Token} to be in a final state. + * Update reverse of ip. Update reverse of ip associated with the given ID. * - * @param request - The request {@link GetTokenRequest} - * @param options - The waiting options - * @returns A Promise of Token + * @param request - The request {@link UpdateReverseRequest} + * @returns A Promise of IP */ - waitForToken = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!TOKEN_TRANSIENT_STATUSES$1.includes(res.status))), this.getToken, request, options); - pageOfListTokens = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/tokens`, - urlParams: urlParams(['container_id', request.containerId], ['namespace_id', request.namespaceId], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]) - }, unmarshalListTokensResponse$1); - + updateReverse = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateReverseRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/dedibox/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/reverses/${marshalling.validatePathParam("ipId", request.ipId)}` + }, + marshalling_gen.unmarshalIP + ); + /** + * Order failover IPs. Order X failover IPs. + * + * @param request - The request {@link CreateFailoverIPsRequest} + * @returns A Promise of CreateFailoverIPsResponse + */ + createFailoverIPs = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateFailoverIPsRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/dedibox/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/failover-ips` + }, + marshalling_gen.unmarshalCreateFailoverIPsResponse + ); /** - * List all tokens. List all tokens belonging to a specified Organization or - * Project. + * Attach failovers on baremetal server. Attach failovers on the server + * associated with the given ID. * - * @param request - The request {@link ListTokensRequest} - * @returns A Promise of ListTokensResponse + * @param request - The request {@link AttachFailoverIPsRequest} */ - listTokens = (request = {}) => enrichForPagination('tokens', this.pageOfListTokens, request); - - /** - * Delete a token. Delete a token with a specified ID. + attachFailoverIPs = (request) => this.client.fetch({ + body: JSON.stringify( + marshalling_gen.marshalAttachFailoverIPsRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/dedibox/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/failover-ips/attach` + }); + /** + * Detach failovers on baremetal server. Detach failovers on the server + * associated with the given ID. * - * @param request - The request {@link DeleteTokenRequest} - * @returns A Promise of Token + * @param request - The request {@link DetachFailoverIPsRequest} */ - deleteToken = request => this.client.fetch({ - method: 'DELETE', - path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/tokens/${validatePathParam('tokenId', request.tokenId)}` - }, unmarshalToken$1); - + detachFailoverIPs = (request) => this.client.fetch({ + body: JSON.stringify( + marshalling_gen.marshalDetachFailoverIPsRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/dedibox/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/failover-ips/detach` + }); /** - * Create a trigger. Create a new trigger for a specified container. + * Attach a failover IP to a MAC address. * - * @param request - The request {@link CreateTriggerRequest} - * @returns A Promise of Trigger + * @param request - The request {@link AttachFailoverIPToMacAddressRequest} + * @returns A Promise of IP */ - createTrigger = request => this.client.fetch({ - body: JSON.stringify(marshalCreateTriggerRequest$1(request, this.client.settings)), - headers: jsonContentHeaders$m, - method: 'POST', - path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/triggers` - }, unmarshalTrigger$1); - + attachFailoverIPToMacAddress = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalAttachFailoverIPToMacAddressRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/dedibox/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/failover-ips/${marshalling.validatePathParam("ipId", request.ipId)}/attach-to-mac-address` + }, + marshalling_gen.unmarshalIP + ); /** - * Get a trigger. Get a trigger with a specified ID. + * Detach a failover IP from a MAC address. * - * @param request - The request {@link GetTriggerRequest} - * @returns A Promise of Trigger + * @param request - The request {@link DetachFailoverIPFromMacAddressRequest} + * @returns A Promise of IP */ - getTrigger = request => this.client.fetch({ - method: 'GET', - path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/triggers/${validatePathParam('triggerId', request.triggerId)}` - }, unmarshalTrigger$1); - + detachFailoverIPFromMacAddress = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/dedibox/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/failover-ips/${marshalling.validatePathParam("ipId", request.ipId)}/detach-from-mac-address` + }, + marshalling_gen.unmarshalIP + ); /** - * Waits for {@link Trigger} to be in a final state. + * Delete a failover server. Delete the failover associated with the given ID. * - * @param request - The request {@link GetTriggerRequest} - * @param options - The waiting options - * @returns A Promise of Trigger + * @param request - The request {@link DeleteFailoverIPRequest} */ - waitForTrigger = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!TRIGGER_TRANSIENT_STATUSES$1.includes(res.status))), this.getTrigger, request, options); - pageOfListTriggers = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/triggers`, - urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ...Object.entries(resolveOneOf([{ - default: this.client.settings.defaultProjectId, - param: 'project_id', - value: request.projectId - }, { - param: 'container_id', - value: request.containerId - }, { - param: 'namespace_id', - value: request.namespaceId - }]))) - }, unmarshalListTriggersResponse$1); - + deleteFailoverIP = (request) => this.client.fetch({ + method: "DELETE", + path: `/dedibox/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/failover-ips/${marshalling.validatePathParam("ipId", request.ipId)}` + }); + pageOfListFailoverIPs = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/dedibox/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/failover-ips`, + urlParams: marshalling.urlParams( + ["only_available", request.onlyAvailable], + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + [ + "project_id", + request.projectId ?? this.client.settings.defaultProjectId + ], + ["search", request.search] + ) + }, + marshalling_gen.unmarshalListFailoverIPsResponse + ); /** - * List all triggers. List all triggers belonging to a specified Organization - * or Project. + * List failovers for project. List failovers servers for project. * - * @param request - The request {@link ListTriggersRequest} - * @returns A Promise of ListTriggersResponse + * @param request - The request {@link ListFailoverIPsRequest} + * @returns A Promise of ListFailoverIPsResponse */ - listTriggers = (request = {}) => enrichForPagination('triggers', this.pageOfListTriggers, request); - + listFailoverIPs = (request = {}) => resourcePaginator.enrichForPagination("failoverIps", this.pageOfListFailoverIPs, request); /** - * Update a trigger. Update a trigger with a specified ID. + * Get a specific baremetal server. Get the server associated with the given + * ID. * - * @param request - The request {@link UpdateTriggerRequest} - * @returns A Promise of Trigger + * @param request - The request {@link GetFailoverIPRequest} + * @returns A Promise of FailoverIP */ - updateTrigger = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateTriggerRequest$1(request, this.client.settings)), - headers: jsonContentHeaders$m, - method: 'PATCH', - path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/triggers/${validatePathParam('triggerId', request.triggerId)}` - }, unmarshalTrigger$1); - + getFailoverIP = (request) => this.client.fetch( + { + method: "GET", + path: `/dedibox/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/failover-ips/${marshalling.validatePathParam("ipId", request.ipId)}` + }, + marshalling_gen.unmarshalFailoverIP + ); /** - * Delete a trigger. Delete a trigger with a specified ID. + * Get remaining quota. * - * @param request - The request {@link DeleteTriggerRequest} - * @returns A Promise of Trigger + * @param request - The request {@link GetRemainingQuotaRequest} + * @returns A Promise of GetRemainingQuotaResponse */ - deleteTrigger = request => this.client.fetch({ - method: 'DELETE', - path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/triggers/${validatePathParam('triggerId', request.triggerId)}` - }, unmarshalTrigger$1); -}; + getRemainingQuota = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/dedibox/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/remaining-quota`, + urlParams: marshalling.urlParams(["project_id", request.projectId]) + }, + marshalling_gen.unmarshalGetRemainingQuotaResponse + ); + /** + * Get raid. Return raid for the given server ID. + * + * @param request - The request {@link GetRaidRequest} + * @returns A Promise of Raid + */ + getRaid = (request) => this.client.fetch( + { + method: "GET", + path: `/dedibox/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/raid` + }, + marshalling_gen.unmarshalRaid + ); + /** + * Update RAID. Update RAID associated with the given server ID. + * + * @param request - The request {@link UpdateRaidRequest} + */ + updateRaid = (request) => this.client.fetch({ + body: JSON.stringify( + marshalling_gen.marshalUpdateRaidRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/dedibox/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/update-raid` + }); + /** + * Start in rescue baremetal server. Start in rescue the server associated + * with the given ID. + * + * @param request - The request {@link StartRescueRequest} + * @returns A Promise of Rescue + */ + startRescue = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalStartRescueRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/dedibox/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/rescue` + }, + marshalling_gen.unmarshalRescue + ); + /** + * Get rescue information. Return rescue information for the given server ID. + * + * @param request - The request {@link GetRescueRequest} + * @returns A Promise of Rescue + */ + getRescue = (request) => this.client.fetch( + { + method: "GET", + path: `/dedibox/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/rescue` + }, + marshalling_gen.unmarshalRescue + ); + /** + * Stop rescue on baremetal server. Stop rescue on the server associated with + * the given ID. + * + * @param request - The request {@link StopRescueRequest} + */ + stopRescue = (request) => this.client.fetch({ + method: "DELETE", + path: `/dedibox/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/rescue` + }); +} +class BillingAPI extends api.API { + pageOfListInvoices = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/dedibox/v1/invoices`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId] + ) + }, + marshalling_gen.unmarshalListInvoicesResponse + ); + listInvoices = (request = {}) => resourcePaginator.enrichForPagination("invoices", this.pageOfListInvoices, request); + getInvoice = (request) => this.client.fetch( + { + method: "GET", + path: `/dedibox/v1/invoices/${marshalling.validatePathParam("invoiceId", request.invoiceId)}` + }, + marshalling_gen.unmarshalInvoice + ); + downloadInvoice = (request) => this.client.fetch({ + method: "GET", + path: `/dedibox/v1/invoices/${marshalling.validatePathParam("invoiceId", request.invoiceId)}/download`, + urlParams: marshalling.urlParams(["dl", 1]), + responseType: "blob" + }); + pageOfListRefunds = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/dedibox/v1/refunds`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId] + ) + }, + marshalling_gen.unmarshalListRefundsResponse + ); + listRefunds = (request = {}) => resourcePaginator.enrichForPagination("refunds", this.pageOfListRefunds, request); + getRefund = (request) => this.client.fetch( + { + method: "GET", + path: `/dedibox/v1/refunds/${marshalling.validatePathParam("refundId", request.refundId)}` + }, + marshalling_gen.unmarshalRefund + ); + downloadRefund = (request) => this.client.fetch({ + method: "GET", + path: `/dedibox/v1/refunds/${marshalling.validatePathParam("refundId", request.refundId)}/download`, + urlParams: marshalling.urlParams(["dl", 1]), + responseType: "blob" + }); + canOrder = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/dedibox/v1/can-order`, + urlParams: marshalling.urlParams([ + "project_id", + request.projectId ?? this.client.settings.defaultProjectId + ]) + }, + marshalling_gen.unmarshalCanOrderResponse + ); +} +class IPv6BlockAPI extends api.API { + /** + * Get IPv6 block quota. Get IPv6 block quota with the given project ID. /48 + * one per organization. /56 link to your number of server. /64 link to your + * number of failover IP. + * + * @param request - The request {@link IPv6BlockApiGetIPv6BlockQuotasRequest} + * @returns A Promise of GetIPv6BlockQuotasResponse + */ + getIPv6BlockQuotas = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/dedibox/v1/ipv6-block-quotas`, + urlParams: marshalling.urlParams(["project_id", request.projectId]) + }, + marshalling_gen.unmarshalGetIPv6BlockQuotasResponse + ); + /** + * Create IPv6 block for baremetal server. Create IPv6 block associated with + * the given project ID. + * + * @param request - The request {@link IPv6BlockApiCreateIPv6BlockRequest} + * @returns A Promise of IPv6Block + */ + createIPv6Block = (request = {}) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalIPv6BlockApiCreateIPv6BlockRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/dedibox/v1/ipv6-block` + }, + marshalling_gen.unmarshalIPv6Block + ); + /** + * Get a specific IPv6 block. Get the IPv6 block associated with the given ID. + * + * @param request - The request {@link IPv6BlockApiGetIPv6BlockRequest} + * @returns A Promise of IPv6Block + */ + getIPv6Block = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/dedibox/v1/ipv6-block`, + urlParams: marshalling.urlParams(["project_id", request.projectId]) + }, + marshalling_gen.unmarshalIPv6Block + ); + /** + * Update IPv6 block. Update DNS associated to IPv6 block. If DNS is used, + * minimum of 2 is necessary and maximum of 5 (no duplicate). + * + * @param request - The request {@link IPv6BlockApiUpdateIPv6BlockRequest} + * @returns A Promise of IPv6Block + */ + updateIPv6Block = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalIPv6BlockApiUpdateIPv6BlockRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/dedibox/v1/ipv6-blocks/${marshalling.validatePathParam("blockId", request.blockId)}` + }, + marshalling_gen.unmarshalIPv6Block + ); + /** + * Delete IPv6 block. Delete IPv6 block subnet with the given ID. + * + * @param request - The request {@link IPv6BlockApiDeleteIPv6BlockRequest} + */ + deleteIPv6Block = (request) => this.client.fetch({ + method: "DELETE", + path: `/dedibox/v1/ipv6-blocks/${marshalling.validatePathParam("blockId", request.blockId)}` + }); + /** + * Create IPv6 block subnet. Create IPv6 block subnet for the given IP ID. /48 + * could create subnet in /56 (quota link to your number of server). /56 could + * create subnet in /64 (quota link to your number of failover IP). + * + * @param request - The request + * {@link IPv6BlockApiCreateIPv6BlockSubnetRequest} + * @returns A Promise of IPv6Block + */ + createIPv6BlockSubnet = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalIPv6BlockApiCreateIPv6BlockSubnetRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/dedibox/v1/ipv6-blocks/${marshalling.validatePathParam("blockId", request.blockId)}/subnets` + }, + marshalling_gen.unmarshalIPv6Block + ); + /** + * List available IPv6 block subnets. List all available IPv6 block subnets + * for given IP ID. + * + * @param request - The request + * {@link IPv6BlockApiListIPv6BlockSubnetsAvailableRequest} + * @returns A Promise of ListIPv6BlockSubnetsAvailableResponse + */ + listIPv6BlockSubnetsAvailable = (request) => this.client.fetch( + { + method: "GET", + path: `/dedibox/v1/ipv6-blocks/${marshalling.validatePathParam("blockId", request.blockId)}/subnets` + }, + marshalling_gen.unmarshalListIPv6BlockSubnetsAvailableResponse + ); +} +class RpnAPI extends api.API { + pageOfListRpnServerCapabilities = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/dedibox/v1/rpn/server-capabilities`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId] + ) + }, + marshalling_gen.unmarshalListRpnServerCapabilitiesResponse + ); + listRpnServerCapabilities = (request = {}) => resourcePaginator.enrichForPagination( + "servers", + this.pageOfListRpnServerCapabilities, + request + ); + getRpnStatus = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/dedibox/v1/rpn/status`, + urlParams: marshalling.urlParams( + ["project_id", request.projectId], + ["rpnv1_group_id", request.rpnv1GroupId], + ["rpnv2_group_id", request.rpnv2GroupId] + ) + }, + marshalling_gen.unmarshalGetRpnStatusResponse + ); +} +class RpnSanAPI extends api.API { + pageOfListRpnSans = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/dedibox/v1/rpn-sans`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId] + ) + }, + marshalling_gen.unmarshalListRpnSansResponse + ); + listRpnSans = (request = {}) => resourcePaginator.enrichForPagination("rpnSans", this.pageOfListRpnSans, request); + getRpnSan = (request) => this.client.fetch( + { + method: "GET", + path: `/dedibox/v1/rpn-sans/${marshalling.validatePathParam("rpnSanId", request.rpnSanId)}` + }, + marshalling_gen.unmarshalRpnSan + ); + /** + * Waits for {@link RpnSan} to be in a final state. + * + * @param request - The request {@link RpnSanApiGetRpnSanRequest} + * @param options - The waiting options + * @returns A Promise of RpnSan + */ + waitForRpnSan = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve(!content_gen.RPN_SAN_TRANSIENT_STATUSES.includes(res.status))), + this.getRpnSan, + request, + options + ); + deleteRpnSan = (request) => this.client.fetch({ + method: "DELETE", + path: `/dedibox/v1/rpn-sans/${marshalling.validatePathParam("rpnSanId", request.rpnSanId)}` + }); + createRpnSan = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalRpnSanApiCreateRpnSanRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/dedibox/v1/rpn-sans` + }, + marshalling_gen.unmarshalService + ); + listIps = (request) => this.client.fetch( + { + method: "GET", + path: `/dedibox/v1/rpn-sans/${marshalling.validatePathParam("rpnSanId", request.rpnSanId)}/ips`, + urlParams: marshalling.urlParams(["type", request.type]) + }, + marshalling_gen.unmarshalListIpsResponse + ); + addIp = (request) => this.client.fetch({ + body: JSON.stringify( + marshalling_gen.marshalRpnSanApiAddIpRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/dedibox/v1/rpn-sans/${marshalling.validatePathParam("rpnSanId", request.rpnSanId)}/ips` + }); + removeIp = (request) => this.client.fetch({ + body: JSON.stringify( + marshalling_gen.marshalRpnSanApiRemoveIpRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "DELETE", + path: `/dedibox/v1/rpn-sans/${marshalling.validatePathParam("rpnSanId", request.rpnSanId)}/ips` + }); + listAvailableIps = (request) => this.client.fetch( + { + method: "GET", + path: `/dedibox/v1/rpn-sans/${marshalling.validatePathParam("rpnSanId", request.rpnSanId)}/available-ips`, + urlParams: marshalling.urlParams(["type", request.type]) + }, + marshalling_gen.unmarshalListIpsResponse + ); +} +class RpnV1API extends api.API { + pageOfListRpnGroups = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/dedibox/v1/rpnv1/groups`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId] + ) + }, + marshalling_gen.unmarshalListRpnGroupsResponse + ); + listRpnGroups = (request = {}) => resourcePaginator.enrichForPagination("rpnGroups", this.pageOfListRpnGroups, request); + getRpnGroup = (request) => this.client.fetch( + { + method: "GET", + path: `/dedibox/v1/rpnv1/groups/${marshalling.validatePathParam("groupId", request.groupId)}` + }, + marshalling_gen.unmarshalRpnGroup + ); + createRpnGroup = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalRpnV1ApiCreateRpnGroupRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/dedibox/v1/rpnv1/groups` + }, + marshalling_gen.unmarshalRpnGroup + ); + deleteRpnGroup = (request) => this.client.fetch({ + method: "DELETE", + path: `/dedibox/v1/rpnv1/groups/${marshalling.validatePathParam("groupId", request.groupId)}` + }); + updateRpnGroupName = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalRpnV1ApiUpdateRpnGroupNameRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/dedibox/v1/rpnv1/groups/${marshalling.validatePathParam("groupId", request.groupId)}` + }, + marshalling_gen.unmarshalRpnGroup + ); + pageOfListRpnGroupMembers = (request) => this.client.fetch( + { + method: "GET", + path: `/dedibox/v1/rpnv1/groups/${marshalling.validatePathParam("groupId", request.groupId)}/members`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId] + ) + }, + marshalling_gen.unmarshalListRpnGroupMembersResponse + ); + listRpnGroupMembers = (request) => resourcePaginator.enrichForPagination("members", this.pageOfListRpnGroupMembers, request); + rpnGroupInvite = (request) => this.client.fetch({ + body: JSON.stringify( + marshalling_gen.marshalRpnV1ApiRpnGroupInviteRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/dedibox/v1/rpnv1/groups/${marshalling.validatePathParam("groupId", request.groupId)}/invite` + }); + leaveRpnGroup = (request) => this.client.fetch({ + body: JSON.stringify( + marshalling_gen.marshalRpnV1ApiLeaveRpnGroupRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/dedibox/v1/rpnv1/groups/${marshalling.validatePathParam("groupId", request.groupId)}/leave` + }); + addRpnGroupMembers = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalRpnV1ApiAddRpnGroupMembersRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/dedibox/v1/rpnv1/groups/${marshalling.validatePathParam("groupId", request.groupId)}/members` + }, + marshalling_gen.unmarshalRpnGroup + ); + deleteRpnGroupMembers = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalRpnV1ApiDeleteRpnGroupMembersRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "DELETE", + path: `/dedibox/v1/rpnv1/groups/${marshalling.validatePathParam("groupId", request.groupId)}/members` + }, + marshalling_gen.unmarshalRpnGroup + ); + pageOfListRpnCapableServers = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/dedibox/v1/rpnv1/capable-servers`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId] + ) + }, + marshalling_gen.unmarshalListRpnCapableServersResponse + ); + listRpnCapableServers = (request = {}) => resourcePaginator.enrichForPagination("servers", this.pageOfListRpnCapableServers, request); + pageOfListRpnCapableSanServers = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/dedibox/v1/rpnv1/capable-san-servers`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId] + ) + }, + marshalling_gen.unmarshalListRpnCapableSanServersResponse + ); + listRpnCapableSanServers = (request = {}) => resourcePaginator.enrichForPagination( + "sanServers", + this.pageOfListRpnCapableSanServers, + request + ); + pageOfListRpnInvites = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/dedibox/v1/rpnv1/invites`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + [ + "project_id", + request.projectId ?? this.client.settings.defaultProjectId + ] + ) + }, + marshalling_gen.unmarshalListRpnInvitesResponse + ); + listRpnInvites = (request = {}) => resourcePaginator.enrichForPagination("members", this.pageOfListRpnInvites, request); + acceptRpnInvite = (request) => this.client.fetch({ + method: "POST", + path: `/dedibox/v1/rpnv1/invites/${marshalling.validatePathParam("memberId", request.memberId)}/accept` + }); + refuseRpnInvite = (request) => this.client.fetch({ + method: "POST", + path: `/dedibox/v1/rpnv1/invites/${marshalling.validatePathParam("memberId", request.memberId)}/refuse` + }); +} +class RpnV2API extends api.API { + pageOfListRpnV2Groups = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/dedibox/v1/rpnv2/groups`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId] + ) + }, + marshalling_gen.unmarshalListRpnV2GroupsResponse + ); + listRpnV2Groups = (request = {}) => resourcePaginator.enrichForPagination("rpnGroups", this.pageOfListRpnV2Groups, request); + pageOfListRpnV2Members = (request) => this.client.fetch( + { + method: "GET", + path: `/dedibox/v1/rpnv2/groups/${marshalling.validatePathParam("groupId", request.groupId)}/members`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["type", request.type] + ) + }, + marshalling_gen.unmarshalListRpnV2MembersResponse + ); + listRpnV2Members = (request) => resourcePaginator.enrichForPagination("members", this.pageOfListRpnV2Members, request); + getRpnV2Group = (request) => this.client.fetch( + { + method: "GET", + path: `/dedibox/v1/rpnv2/groups/${marshalling.validatePathParam("groupId", request.groupId)}` + }, + marshalling_gen.unmarshalRpnV2Group + ); + /** + * Waits for {@link RpnV2Group} to be in a final state. + * + * @param request - The request {@link RpnV2ApiGetRpnV2GroupRequest} + * @param options - The waiting options + * @returns A Promise of RpnV2Group + */ + waitForRpnV2Group = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve( + !content_gen.RPN_V2_GROUP_TRANSIENT_STATUSES.includes(res.status) + )), + this.getRpnV2Group, + request, + options + ); + createRpnV2Group = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalRpnV2ApiCreateRpnV2GroupRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/dedibox/v1/rpnv2/groups` + }, + marshalling_gen.unmarshalRpnV2Group + ); + deleteRpnV2Group = (request) => this.client.fetch({ + method: "DELETE", + path: `/dedibox/v1/rpnv2/groups/${marshalling.validatePathParam("groupId", request.groupId)}` + }); + updateRpnV2GroupName = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalRpnV2ApiUpdateRpnV2GroupNameRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/dedibox/v1/rpnv2/groups/${marshalling.validatePathParam("groupId", request.groupId)}` + }, + marshalling_gen.unmarshalRpnV2Group + ); + addRpnV2Members = (request) => this.client.fetch({ + body: JSON.stringify( + marshalling_gen.marshalRpnV2ApiAddRpnV2MembersRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/dedibox/v1/rpnv2/groups/${marshalling.validatePathParam("groupId", request.groupId)}/members` + }); + deleteRpnV2Members = (request) => this.client.fetch({ + body: JSON.stringify( + marshalling_gen.marshalRpnV2ApiDeleteRpnV2MembersRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "DELETE", + path: `/dedibox/v1/rpnv2/groups/${marshalling.validatePathParam("groupId", request.groupId)}/members` + }); + pageOfListRpnV2CapableResources = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/dedibox/v1/rpnv2/groups/capable`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId] + ) + }, + marshalling_gen.unmarshalListRpnV2CapableResourcesResponse + ); + listRpnV2CapableResources = (request = {}) => resourcePaginator.enrichForPagination( + "servers", + this.pageOfListRpnV2CapableResources, + request + ); + pageOfListRpnV2GroupLogs = (request) => this.client.fetch( + { + method: "GET", + path: `/dedibox/v1/rpnv2/groups/${marshalling.validatePathParam("groupId", request.groupId)}/logs`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListRpnV2GroupLogsResponse + ); + listRpnV2GroupLogs = (request) => resourcePaginator.enrichForPagination("logs", this.pageOfListRpnV2GroupLogs, request); + updateRpnV2VlanForMembers = (request) => this.client.fetch({ + body: JSON.stringify( + marshalling_gen.marshalRpnV2ApiUpdateRpnV2VlanForMembersRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/dedibox/v1/rpnv2/groups/${marshalling.validatePathParam("groupId", request.groupId)}/vlan` + }); + enableRpnV2GroupCompatibility = (request) => this.client.fetch({ + body: JSON.stringify( + marshalling_gen.marshalRpnV2ApiEnableRpnV2GroupCompatibilityRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/dedibox/v1/rpnv2/groups/${marshalling.validatePathParam("groupId", request.groupId)}/enable-compatibility` + }); + disableRpnV2GroupCompatibility = (request) => this.client.fetch({ + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/dedibox/v1/rpnv2/groups/${marshalling.validatePathParam("groupId", request.groupId)}/disable-compatibility` + }); +} +exports.API = API; +exports.BillingAPI = BillingAPI; +exports.IPv6BlockAPI = IPv6BlockAPI; +exports.RpnAPI = RpnAPI; +exports.RpnSanAPI = RpnSanAPI; +exports.RpnV1API = RpnV1API; +exports.RpnV2API = RpnV2API; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -var index_gen$l = /*#__PURE__*/Object.freeze({ - __proto__: null, - API: API$n, - CONTAINER_TRANSIENT_STATUSES: CONTAINER_TRANSIENT_STATUSES, - CRON_TRANSIENT_STATUSES: CRON_TRANSIENT_STATUSES$1, - DOMAIN_TRANSIENT_STATUSES: DOMAIN_TRANSIENT_STATUSES$3, - NAMESPACE_TRANSIENT_STATUSES: NAMESPACE_TRANSIENT_STATUSES$2, - TOKEN_TRANSIENT_STATUSES: TOKEN_TRANSIENT_STATUSES$1, - TRIGGER_TRANSIENT_STATUSES: TRIGGER_TRANSIENT_STATUSES$1 -}); +/***/ }), -var index$o = /*#__PURE__*/Object.freeze({ - __proto__: null, - v1beta1: index_gen$l -}); +/***/ 7422: +/***/ ((__unused_webpack_module, exports) => { -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. +"use strict"; -/** Lists transient statutes of the enum {@link InstanceLogStatus}. */ -const INSTANCE_LOG_TRANSIENT_STATUSES$1 = ['creating']; +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const BMC_ACCESS_TRANSIENT_STATUSES = [ + "creating", + "deleting" +]; +const I_PV6_BLOCK_DELEGATION_TRANSIENT_STATUSES = ["updating"]; +const RPN_GROUP_MEMBER_TRANSIENT_STATUSES = [ + "creating", + "deleting" +]; +const RPN_SAN_TRANSIENT_STATUSES = [ + "creating", + "deleting" +]; +const RPN_V2_GROUP_TRANSIENT_STATUSES = [ + "creating", + "updating", + "deleting" +]; +const RPN_V2_MEMBER_TRANSIENT_STATUSES = [ + "creating", + "updating", + "deleting" +]; +const SERVER_INSTALL_TRANSIENT_STATUSES = [ + "booting", + "setting_up_raid", + "partitioning", + "formatting", + "installing", + "configuring", + "configuring_bootloader", + "rebooting" +]; +const SERVER_TRANSIENT_STATUSES = [ + "delivering", + "installing" +]; +const SERVICE_PROVISIONING_TRANSIENT_STATUSES = ["delivering", "expiring"]; +exports.BMC_ACCESS_TRANSIENT_STATUSES = BMC_ACCESS_TRANSIENT_STATUSES; +exports.I_PV6_BLOCK_DELEGATION_TRANSIENT_STATUSES = I_PV6_BLOCK_DELEGATION_TRANSIENT_STATUSES; +exports.RPN_GROUP_MEMBER_TRANSIENT_STATUSES = RPN_GROUP_MEMBER_TRANSIENT_STATUSES; +exports.RPN_SAN_TRANSIENT_STATUSES = RPN_SAN_TRANSIENT_STATUSES; +exports.RPN_V2_GROUP_TRANSIENT_STATUSES = RPN_V2_GROUP_TRANSIENT_STATUSES; +exports.RPN_V2_MEMBER_TRANSIENT_STATUSES = RPN_V2_MEMBER_TRANSIENT_STATUSES; +exports.SERVER_INSTALL_TRANSIENT_STATUSES = SERVER_INSTALL_TRANSIENT_STATUSES; +exports.SERVER_TRANSIENT_STATUSES = SERVER_TRANSIENT_STATUSES; +exports.SERVICE_PROVISIONING_TRANSIENT_STATUSES = SERVICE_PROVISIONING_TRANSIENT_STATUSES; -/** Lists transient statutes of the enum {@link InstanceStatus}. */ -const INSTANCE_TRANSIENT_STATUSES$2 = ['provisioning', 'configuring', 'deleting', 'autohealing', 'initializing', 'backuping', 'snapshotting', 'restarting']; -/** Lists transient statutes of the enum {@link MaintenanceStatus}. */ -const MAINTENANCE_TRANSIENT_STATUSES$1 = ['pending']; +/***/ }), -/** Lists transient statutes of the enum {@link ReadReplicaStatus}. */ -const READ_REPLICA_TRANSIENT_STATUSES$1 = ['provisioning', 'initializing', 'deleting', 'configuring', 'promoting']; +/***/ 3005: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/** Lists transient statutes of the enum {@link SnapshotStatus}. */ -const SNAPSHOT_TRANSIENT_STATUSES$2 = ['creating', 'restoring', 'deleting']; +"use strict"; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const unmarshalEndpointDirectAccessDetails$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'EndpointDirectAccessDetails' failed as data isn't a dictionary.`); - } - return {}; -}; -const unmarshalEndpointLoadBalancerDetails$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'EndpointLoadBalancerDetails' failed as data isn't a dictionary.`); - } - return {}; -}; -const unmarshalEndpointPrivateNetworkDetails$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'EndpointPrivateNetworkDetails' failed as data isn't a dictionary.`); +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api_gen = __nccwpck_require__(4721); +const content_gen = __nccwpck_require__(7422); +const validationRules_gen = __nccwpck_require__(6948); +exports.API = api_gen.API; +exports.BillingAPI = api_gen.BillingAPI; +exports.IPv6BlockAPI = api_gen.IPv6BlockAPI; +exports.RpnAPI = api_gen.RpnAPI; +exports.RpnSanAPI = api_gen.RpnSanAPI; +exports.RpnV1API = api_gen.RpnV1API; +exports.RpnV2API = api_gen.RpnV2API; +exports.BMC_ACCESS_TRANSIENT_STATUSES = content_gen.BMC_ACCESS_TRANSIENT_STATUSES; +exports.I_PV6_BLOCK_DELEGATION_TRANSIENT_STATUSES = content_gen.I_PV6_BLOCK_DELEGATION_TRANSIENT_STATUSES; +exports.RPN_GROUP_MEMBER_TRANSIENT_STATUSES = content_gen.RPN_GROUP_MEMBER_TRANSIENT_STATUSES; +exports.RPN_SAN_TRANSIENT_STATUSES = content_gen.RPN_SAN_TRANSIENT_STATUSES; +exports.RPN_V2_GROUP_TRANSIENT_STATUSES = content_gen.RPN_V2_GROUP_TRANSIENT_STATUSES; +exports.RPN_V2_MEMBER_TRANSIENT_STATUSES = content_gen.RPN_V2_MEMBER_TRANSIENT_STATUSES; +exports.SERVER_INSTALL_TRANSIENT_STATUSES = content_gen.SERVER_INSTALL_TRANSIENT_STATUSES; +exports.SERVER_TRANSIENT_STATUSES = content_gen.SERVER_TRANSIENT_STATUSES; +exports.SERVICE_PROVISIONING_TRANSIENT_STATUSES = content_gen.SERVICE_PROVISIONING_TRANSIENT_STATUSES; +exports.ValidationRules = validationRules_gen; + + +/***/ }), + +/***/ 4055: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const json = __nccwpck_require__(3746); +const customMarshalling = __nccwpck_require__(7586); +const marshalling = __nccwpck_require__(1162); +const unmarshalIP = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'IP' failed as data isn't a dictionary.` + ); } return { - privateNetworkId: data.private_network_id, - serviceIp: data.service_ip, - zone: data.zone + address: data.address, + cidr: data.cidr, + gateway: data.gateway, + ipId: data.ip_id, + netmask: data.netmask, + reverse: data.reverse, + semantic: data.semantic, + status: data.status, + version: data.version }; }; -const unmarshalEndpoint$2 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Endpoint' failed as data isn't a dictionary.`); +const unmarshalCPU = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'CPU' failed as data isn't a dictionary.` + ); } return { - directAccess: data.direct_access ? unmarshalEndpointDirectAccessDetails$1(data.direct_access) : undefined, - hostname: data.hostname, - id: data.id, - ip: data.ip, - loadBalancer: data.load_balancer ? unmarshalEndpointLoadBalancerDetails$1(data.load_balancer) : undefined, + coreCount: data.core_count, + frequency: data.frequency, name: data.name, - port: data.port, - privateNetwork: data.private_network ? unmarshalEndpointPrivateNetworkDetails$1(data.private_network) : undefined + threadCount: data.thread_count }; }; -const unmarshalEngineSetting$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'EngineSetting' failed as data isn't a dictionary.`); +const unmarshalDisk = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Disk' failed as data isn't a dictionary.` + ); } return { - defaultValue: data.default_value, - description: data.description, - floatMax: data.float_max, - floatMin: data.float_min, - hotConfigurable: data.hot_configurable, - intMax: data.int_max, - intMin: data.int_min, - name: data.name, - propertyType: data.property_type, - stringConstraint: data.string_constraint, - unit: data.unit + capacity: data.capacity, + type: data.type }; }; -const unmarshalBackupSchedule$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'BackupSchedule' failed as data isn't a dictionary.`); +const unmarshalMemory = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Memory' failed as data isn't a dictionary.` + ); } return { - disabled: data.disabled, + capacity: data.capacity, frequency: data.frequency, - nextRunAt: unmarshalDate(data.next_run_at), - retention: data.retention + isEcc: data.is_ecc, + type: data.type }; }; -const unmarshalEngineVersion$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'EngineVersion' failed as data isn't a dictionary.`); +const unmarshalPersistentMemory = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'PersistentMemory' failed as data isn't a dictionary.` + ); } return { - availableInitSettings: unmarshalArrayOfObject(data.available_init_settings, unmarshalEngineSetting$1), - availableSettings: unmarshalArrayOfObject(data.available_settings, unmarshalEngineSetting$1), - beta: data.beta, - disabled: data.disabled, - endOfLife: unmarshalDate(data.end_of_life), - name: data.name, - version: data.version + capacity: data.capacity, + frequency: data.frequency, + model: data.model }; }; -const unmarshalInstanceSetting$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'InstanceSetting' failed as data isn't a dictionary.`); +const unmarshalRaidController = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'RaidController' failed as data isn't a dictionary.` + ); } return { - name: data.name, - value: data.value + model: data.model, + raidLevel: data.raid_level }; }; -const unmarshalLogsPolicy$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'LogsPolicy' failed as data isn't a dictionary.`); +const unmarshalOfferAntiDosInfo = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'OfferAntiDosInfo' failed as data isn't a dictionary.` + ); } return { - maxAgeRetention: data.max_age_retention, - totalDiskRetention: data.total_disk_retention + type: data.type }; }; -const unmarshalMaintenance$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Maintenance' failed as data isn't a dictionary.`); +const unmarshalOfferBackupInfo = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'OfferBackupInfo' failed as data isn't a dictionary.` + ); } return { - closedAt: unmarshalDate(data.closed_at), - reason: data.reason, - startsAt: unmarshalDate(data.starts_at), - status: data.status, - stopsAt: unmarshalDate(data.stops_at) + size: data.size }; }; -const unmarshalNodeTypeVolumeConstraintSizes$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'NodeTypeVolumeConstraintSizes' failed as data isn't a dictionary.`); +const unmarshalOfferBandwidthInfo = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'OfferBandwidthInfo' failed as data isn't a dictionary.` + ); } return { - maxSize: data.max_size, - minSize: data.min_size + speed: data.speed }; }; -const unmarshalNodeTypeVolumeType$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'NodeTypeVolumeType' failed as data isn't a dictionary.`); +const unmarshalOfferFailoverBlockInfo = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'OfferFailoverBlockInfo' failed as data isn't a dictionary.` + ); } return { - chunkSize: data.chunk_size, - description: data.description, - maxSize: data.max_size, - minSize: data.min_size, - type: data.type + onetimeFees: data.onetime_fees ? unmarshalOffer(data.onetime_fees) : void 0 }; }; -const unmarshalReadReplica$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ReadReplica' failed as data isn't a dictionary.`); +const unmarshalOfferFailoverIpInfo = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'OfferFailoverIpInfo' failed as data isn't a dictionary.` + ); } return { - endpoints: unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint$2), - id: data.id, - region: data.region, - sameZone: data.same_zone, - status: data.status + onetimeFees: data.onetime_fees ? unmarshalOffer(data.onetime_fees) : void 0 }; }; -const unmarshalUpgradableVersion$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'UpgradableVersion' failed as data isn't a dictionary.`); +const unmarshalOfferLicenseInfo = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'OfferLicenseInfo' failed as data isn't a dictionary.` + ); } return { - id: data.id, - minorVersion: data.minor_version, - name: data.name, - version: data.version + boundToIp: data.bound_to_ip }; }; -const unmarshalVolume$3 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Volume' failed as data isn't a dictionary.`); +const unmarshalOfferRPNInfo = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'OfferRPNInfo' failed as data isn't a dictionary.` + ); } return { - size: data.size, - type: data.type + speed: data.speed }; }; -const unmarshalACLRule$2 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ACLRule' failed as data isn't a dictionary.`); +const unmarshalOfferSANInfo = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'OfferSANInfo' failed as data isn't a dictionary.` + ); } return { - action: data.action, - description: data.description, - direction: data.direction, - ip: data.ip, - port: data.port, - protocol: data.protocol + deviceType: data.device_type, + ha: data.ha, + size: data.size }; }; -const unmarshalDatabase$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Database' failed as data isn't a dictionary.`); +const unmarshalOfferServerInfo = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'OfferServerInfo' failed as data isn't a dictionary.` + ); } return { - managed: data.managed, - name: data.name, - owner: data.owner, + availableOptions: marshalling.unmarshalArrayOfObject( + data.available_options, + unmarshalOffer + ), + bandwidth: data.bandwidth, + commercialRange: data.commercial_range, + connectivity: data.connectivity, + cpus: marshalling.unmarshalArrayOfObject(data.cpus, unmarshalCPU), + disks: marshalling.unmarshalArrayOfObject(data.disks, unmarshalDisk), + memories: marshalling.unmarshalArrayOfObject(data.memories, unmarshalMemory), + onetimeFees: data.onetime_fees ? unmarshalOffer(data.onetime_fees) : void 0, + persistentMemories: marshalling.unmarshalArrayOfObject( + data.persistent_memories, + unmarshalPersistentMemory + ), + raidControllers: marshalling.unmarshalArrayOfObject( + data.raid_controllers, + unmarshalRaidController + ), + rpnVersion: data.rpn_version, + stock: data.stock, + stockByDatacenter: data.stock_by_datacenter + }; +}; +const unmarshalOfferServiceLevelInfo = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'OfferServiceLevelInfo' failed as data isn't a dictionary.` + ); + } + return { + antidos: data.antidos, + availableOptions: marshalling.unmarshalArrayOfObject( + data.available_options, + unmarshalOffer + ), + customization: data.customization, + extraFailoverQuota: data.extra_failover_quota, + git: data.git, + highRpnBandwidth: data.high_rpn_bandwidth, + prioritySupport: data.priority_support, + salesSupport: data.sales_support, + sla: data.sla, + supportPhone: data.support_phone, + supportTicket: data.support_ticket + }; +}; +const unmarshalOfferStorageInfo = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'OfferStorageInfo' failed as data isn't a dictionary.` + ); + } + return { + maxQuota: data.max_quota, size: data.size }; }; -const unmarshalDatabaseEngine$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'DatabaseEngine' failed as data isn't a dictionary.`); +const unmarshalOffer = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Offer' failed as data isn't a dictionary.` + ); } return { - logoUrl: data.logo_url, + antidosInfo: data.antidos_info ? unmarshalOfferAntiDosInfo(data.antidos_info) : void 0, + backupInfo: data.backup_info ? unmarshalOfferBackupInfo(data.backup_info) : void 0, + bandwidthInfo: data.bandwidth_info ? unmarshalOfferBandwidthInfo(data.bandwidth_info) : void 0, + catalog: data.catalog, + failoverBlockInfo: data.failover_block_info ? unmarshalOfferFailoverBlockInfo(data.failover_block_info) : void 0, + failoverIpInfo: data.failover_ip_info ? unmarshalOfferFailoverIpInfo(data.failover_ip_info) : void 0, + id: data.id, + licenseInfo: data.license_info ? unmarshalOfferLicenseInfo(data.license_info) : void 0, name: data.name, - region: data.region, - versions: unmarshalArrayOfObject(data.versions, unmarshalEngineVersion$1) + paymentFrequency: data.payment_frequency, + pricing: data.pricing ? customMarshalling.unmarshalMoney(data.pricing) : void 0, + rpnInfo: data.rpn_info ? unmarshalOfferRPNInfo(data.rpn_info) : void 0, + sanInfo: data.san_info ? unmarshalOfferSANInfo(data.san_info) : void 0, + serverInfo: data.server_info ? unmarshalOfferServerInfo(data.server_info) : void 0, + serviceLevelInfo: data.service_level_info ? unmarshalOfferServiceLevelInfo(data.service_level_info) : void 0, + storageInfo: data.storage_info ? unmarshalOfferStorageInfo(data.storage_info) : void 0, + usbStorageInfo: data.usb_storage_info ? unmarshalOfferStorageInfo(data.usb_storage_info) : void 0 + }; +}; +const unmarshalOS = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'OS' failed as data isn't a dictionary.` + ); + } + return { + allowCustomPartitioning: data.allow_custom_partitioning, + allowSshKeys: data.allow_ssh_keys, + allowedFilesystems: data.allowed_filesystems, + arch: data.arch, + displayName: data.display_name, + hostnameMaxLength: data.hostname_max_length, + hostnameRegex: data.hostname_regex, + id: data.id, + licenseOffers: marshalling.unmarshalArrayOfObject(data.license_offers, unmarshalOffer), + maxPartitions: data.max_partitions, + name: data.name, + panelPasswordRegex: data.panel_password_regex, + passwordRegex: data.password_regex, + releasedAt: marshalling.unmarshalDate(data.released_at), + requiresAdminPassword: data.requires_admin_password, + requiresLicense: data.requires_license, + requiresPanelPassword: data.requires_panel_password, + requiresUser: data.requires_user, + requiresValidHostname: data.requires_valid_hostname, + type: data.type, + version: data.version }; }; -const unmarshalInstance$2 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Instance' failed as data isn't a dictionary.`); +const unmarshalRpnSan = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'RpnSan' failed as data isn't a dictionary.` + ); } return { - backupSameRegion: data.backup_same_region, - backupSchedule: data.backup_schedule ? unmarshalBackupSchedule$1(data.backup_schedule) : undefined, - createdAt: unmarshalDate(data.created_at), - endpoint: data.endpoint ? unmarshalEndpoint$2(data.endpoint) : undefined, - endpoints: unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint$2), - engine: data.engine, + createdAt: marshalling.unmarshalDate(data.created_at), + datacenterName: data.datacenter_name, + deliveredAt: marshalling.unmarshalDate(data.delivered_at), + expiresAt: marshalling.unmarshalDate(data.expires_at), id: data.id, - initSettings: unmarshalArrayOfObject(data.init_settings, unmarshalInstanceSetting$1), - isHaCluster: data.is_ha_cluster, - logsPolicy: data.logs_policy ? unmarshalLogsPolicy$1(data.logs_policy) : undefined, - maintenances: unmarshalArrayOfObject(data.maintenances, unmarshalMaintenance$1), + iqn: data.iqn, + iqnSuffix: data.iqn_suffix, + offer: data.offer ? unmarshalOffer(data.offer) : void 0, + offerId: data.offer_id, + offerName: data.offer_name, + organizationId: data.organization_id, + projectId: data.project_id, + rpnv1Compatible: data.rpnv1_compatible, + rpnv1Implicit: data.rpnv1_implicit, + serverHostname: data.server_hostname, + status: data.status, + storageSize: data.storage_size, + terminatedAt: marshalling.unmarshalDate(data.terminated_at) + }; +}; +const unmarshalRpnGroup = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'RpnGroup' failed as data isn't a dictionary.` + ); + } + return { + active: data.active, + createdAt: marshalling.unmarshalDate(data.created_at), + id: data.id, + membersCount: data.members_count, name: data.name, - nodeType: data.node_type, organizationId: data.organization_id, + owner: data.owner, projectId: data.project_id, - readReplicas: unmarshalArrayOfObject(data.read_replicas, unmarshalReadReplica$1), - region: data.region, - settings: unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting$1), + type: data.type + }; +}; +const unmarshalNetworkInterface = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'NetworkInterface' failed as data isn't a dictionary.` + ); + } + return { + cardId: data.card_id, + deviceId: data.device_id, + ips: marshalling.unmarshalArrayOfObject(data.ips, unmarshalIP), + mac: data.mac, + type: data.type + }; +}; +const unmarshalServerLocation = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ServerLocation' failed as data isn't a dictionary.` + ); + } + return { + datacenterName: data.datacenter_name, + rack: data.rack, + room: data.room + }; +}; +const unmarshalServerOption = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ServerOption' failed as data isn't a dictionary.` + ); + } + return { + createdAt: marshalling.unmarshalDate(data.created_at), + expiredAt: marshalling.unmarshalDate(data.expired_at), + offer: data.offer ? unmarshalOffer(data.offer) : void 0, + options: marshalling.unmarshalArrayOfObject(data.options, unmarshalServerOption), + updatedAt: marshalling.unmarshalDate(data.updated_at) + }; +}; +const unmarshalServiceLevel = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ServiceLevel' failed as data isn't a dictionary.` + ); + } + return { + level: data.level, + offerId: data.offer_id + }; +}; +const unmarshalServer = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Server' failed as data isn't a dictionary.` + ); + } + return { + abuseContact: data.abuse_contact, + createdAt: marshalling.unmarshalDate(data.created_at), + expiredAt: marshalling.unmarshalDate(data.expired_at), + hasBmc: data.has_bmc, + hostname: data.hostname, + id: data.id, + interfaces: marshalling.unmarshalArrayOfObject( + data.interfaces, + unmarshalNetworkInterface + ), + ipv6Slaac: data.ipv6_slaac, + isOutsourced: data.is_outsourced, + isRpnv2Member: data.is_rpnv2_member, + level: data.level ? unmarshalServiceLevel(data.level) : void 0, + location: data.location ? unmarshalServerLocation(data.location) : void 0, + offer: data.offer ? unmarshalOffer(data.offer) : void 0, + options: marshalling.unmarshalArrayOfObject(data.options, unmarshalServerOption), + organizationId: data.organization_id, + os: data.os ? unmarshalOS(data.os) : void 0, + projectId: data.project_id, + qinq: data.qinq, + rebootedAt: marshalling.unmarshalDate(data.rebooted_at), + rescueOs: data.rescue_os ? unmarshalOS(data.rescue_os) : void 0, status: data.status, tags: data.tags, - upgradableVersion: unmarshalArrayOfObject(data.upgradable_version, unmarshalUpgradableVersion$1), - volume: data.volume ? unmarshalVolume$3(data.volume) : undefined + updatedAt: marshalling.unmarshalDate(data.updated_at), + zone: data.zone }; }; -const unmarshalInstanceLog$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'InstanceLog' failed as data isn't a dictionary.`); +const unmarshalRpnV2GroupSubnet = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'RpnV2GroupSubnet' failed as data isn't a dictionary.` + ); } return { - createdAt: unmarshalDate(data.created_at), - downloadUrl: data.download_url, - expiresAt: unmarshalDate(data.expires_at), + address: data.address, + cidr: data.cidr + }; +}; +const unmarshalRpnV2Group = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'RpnV2Group' failed as data isn't a dictionary.` + ); + } + return { + compatibleRpnv1: data.compatible_rpnv1, + gateway: data.gateway, id: data.id, - nodeName: data.node_name, - region: data.region, + membersCount: data.members_count, + name: data.name, + organizationId: data.organization_id, + owner: data.owner, + projectId: data.project_id, + rpnv1Group: data.rpnv1_group ? unmarshalRpnGroup(data.rpnv1_group) : void 0, + status: data.status, + subnet: data.subnet ? unmarshalRpnV2GroupSubnet(data.subnet) : void 0, + type: data.type + }; +}; +const unmarshalService = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Service' failed as data isn't a dictionary.` + ); + } + return { + createdAt: marshalling.unmarshalDate(data.created_at), + deliveredAt: marshalling.unmarshalDate(data.delivered_at), + expiresAt: marshalling.unmarshalDate(data.expires_at), + id: data.id, + offer: data.offer ? unmarshalOffer(data.offer) : void 0, + provisioningStatus: data.provisioning_status, + resourceId: data.resource_id, + terminatedAt: marshalling.unmarshalDate(data.terminated_at), + type: data.type + }; +}; +const unmarshalFailoverBlock = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'FailoverBlock' failed as data isn't a dictionary.` + ); + } + return { + address: data.address, + cidr: data.cidr, + gatewayIp: data.gateway_ip, + id: data.id, + ipVersion: data.ip_version, + nameservers: data.nameservers, + netmask: data.netmask + }; +}; +const unmarshalFailoverIP = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'FailoverIP' failed as data isn't a dictionary.` + ); + } + return { + address: data.address, + block: data.block ? unmarshalFailoverBlock(data.block) : void 0, + cidr: data.cidr, + gatewayIp: data.gateway_ip, + id: data.id, + ipVersion: data.ip_version, + mac: data.mac, + netmask: data.netmask, + reverse: data.reverse, + serverId: data.server_id, + serverZone: data.server_zone, + status: data.status, + type: data.type + }; +}; +const unmarshalBMCAccess = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'BMCAccess' failed as data isn't a dictionary.` + ); + } + return { + expiresAt: marshalling.unmarshalDate(data.expires_at), + login: data.login, + password: data.password, + status: data.status, + url: data.url + }; +}; +const unmarshalBackup = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Backup' failed as data isn't a dictionary.` + ); + } + return { + aclEnabled: data.acl_enabled, + autologin: data.autologin, + id: data.id, + login: data.login, + quotaFiles: data.quota_files, + quotaFilesUsed: data.quota_files_used, + quotaSpace: data.quota_space, + quotaSpaceUsed: data.quota_space_used, + server: data.server, status: data.status }; }; -const unmarshalListInstanceLogsDetailsResponseInstanceLogDetail$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListInstanceLogsDetailsResponseInstanceLogDetail' failed as data isn't a dictionary.`); +const unmarshalCanOrderResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'CanOrderResponse' failed as data isn't a dictionary.` + ); } return { - logName: data.log_name, - size: data.size + billingOk: data.billing_ok, + canOrder: data.can_order, + emailConfirmed: data.email_confirmed, + message: data.message, + paymentMode: data.payment_mode, + phoneConfirmed: data.phone_confirmed, + quotaOk: data.quota_ok, + userConfirmed: data.user_confirmed }; }; -const unmarshalNodeType$2 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'NodeType' failed as data isn't a dictionary.`); +const unmarshalCreateFailoverIPsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'CreateFailoverIPsResponse' failed as data isn't a dictionary.` + ); } return { - availableVolumeTypes: unmarshalArrayOfObject(data.available_volume_types, unmarshalNodeTypeVolumeType$1), - beta: data.beta, - description: data.description, - disabled: data.disabled, - generation: data.generation, - instanceRange: data.instance_range, - isBssdCompatible: data.is_bssd_compatible, - isHaRequired: data.is_ha_required, - memory: data.memory, - name: data.name, - region: data.region, - stockStatus: data.stock_status, - vcpus: data.vcpus, - volumeConstraint: data.volume_constraint ? unmarshalNodeTypeVolumeConstraintSizes$1(data.volume_constraint) : undefined + services: marshalling.unmarshalArrayOfObject(data.services, unmarshalService), + totalCount: data.total_count }; }; -const unmarshalPrivilege$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Privilege' failed as data isn't a dictionary.`); +const unmarshalGetIPv6BlockQuotasResponseQuota = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'GetIPv6BlockQuotasResponseQuota' failed as data isn't a dictionary.` + ); } return { - databaseName: data.database_name, - permission: data.permission, - userName: data.user_name + cidr: data.cidr, + quota: data.quota + }; +}; +const unmarshalGetIPv6BlockQuotasResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'GetIPv6BlockQuotasResponse' failed as data isn't a dictionary.` + ); + } + return { + quotas: marshalling.unmarshalArrayOfObject( + data.quotas, + unmarshalGetIPv6BlockQuotasResponseQuota + ), + totalCount: data.total_count + }; +}; +const unmarshalGetRemainingQuotaResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'GetRemainingQuotaResponse' failed as data isn't a dictionary.` + ); + } + return { + failoverBlockQuota: data.failover_block_quota, + failoverBlockRemainingQuota: data.failover_block_remaining_quota, + failoverIpQuota: data.failover_ip_quota, + failoverIpRemainingQuota: data.failover_ip_remaining_quota }; }; -const unmarshalSnapshot$2 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Snapshot' failed as data isn't a dictionary.`); +const unmarshalGetRpnStatusResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'GetRpnStatusResponse' failed as data isn't a dictionary.` + ); } return { - createdAt: unmarshalDate(data.created_at), - expiresAt: unmarshalDate(data.expires_at), + operationsLeft: data.operations_left, + status: data.status + }; +}; +const unmarshalIPv6Block = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'IPv6Block' failed as data isn't a dictionary.` + ); + } + return { + address: data.address, + cidr: data.cidr, + delegationStatus: data.delegation_status, + duid: data.duid, id: data.id, - instanceId: data.instance_id, - instanceName: data.instance_name, - name: data.name, - nodeType: data.node_type, - region: data.region, - size: data.size, + nameservers: data.nameservers, + subnets: marshalling.unmarshalArrayOfObject(data.subnets, unmarshalIPv6Block) + }; +}; +const unmarshalInvoice = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Invoice' failed as data isn't a dictionary.` + ); + } + return { + content: data.content, + createdAt: marshalling.unmarshalDate(data.created_at), + id: data.id, + paidAt: marshalling.unmarshalDate(data.paid_at), + paymentMethod: data.payment_method, status: data.status, - updatedAt: unmarshalDate(data.updated_at) + totalWithTaxes: data.total_with_taxes ? customMarshalling.unmarshalMoney(data.total_with_taxes) : void 0, + totalWithoutTaxes: data.total_without_taxes ? customMarshalling.unmarshalMoney(data.total_without_taxes) : void 0, + transactionId: data.transaction_id }; }; -const unmarshalUser$2 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'User' failed as data isn't a dictionary.`); +const unmarshalListFailoverIPsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListFailoverIPsResponse' failed as data isn't a dictionary.` + ); } return { - isAdmin: data.is_admin, + failoverIps: marshalling.unmarshalArrayOfObject(data.failover_ips, unmarshalFailoverIP), + totalCount: data.total_count + }; +}; +const unmarshalListIPv6BlockSubnetsAvailableResponseSubnet = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListIPv6BlockSubnetsAvailableResponseSubnet' failed as data isn't a dictionary.` + ); + } + return { + address: data.address, + cidr: data.cidr + }; +}; +const unmarshalListIPv6BlockSubnetsAvailableResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListIPv6BlockSubnetsAvailableResponse' failed as data isn't a dictionary.` + ); + } + return { + subnetAvailables: marshalling.unmarshalArrayOfObject( + data.subnet_availables, + unmarshalListIPv6BlockSubnetsAvailableResponseSubnet + ), + totalCount: data.total_count + }; +}; +const unmarshalInvoiceSummary = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'InvoiceSummary' failed as data isn't a dictionary.` + ); + } + return { + createdAt: marshalling.unmarshalDate(data.created_at), + id: data.id, + paidAt: marshalling.unmarshalDate(data.paid_at), + paymentMethod: data.payment_method, + status: data.status, + totalWithTaxes: data.total_with_taxes ? customMarshalling.unmarshalMoney(data.total_with_taxes) : void 0, + totalWithoutTaxes: data.total_without_taxes ? customMarshalling.unmarshalMoney(data.total_without_taxes) : void 0, + transactionId: data.transaction_id + }; +}; +const unmarshalListInvoicesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListInvoicesResponse' failed as data isn't a dictionary.` + ); + } + return { + invoices: marshalling.unmarshalArrayOfObject(data.invoices, unmarshalInvoiceSummary), + totalCount: data.total_count + }; +}; +const unmarshalRpnSanIpRpnV2Group = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'RpnSanIpRpnV2Group' failed as data isn't a dictionary.` + ); + } + return { + id: data.id, name: data.name }; }; -const unmarshalAddInstanceACLRulesResponse$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'AddInstanceACLRulesResponse' failed as data isn't a dictionary.`); +const unmarshalRpnSanIpServer = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'RpnSanIpServer' failed as data isn't a dictionary.` + ); + } + return { + datacenterName: data.datacenter_name, + hostname: data.hostname, + id: data.id + }; +}; +const unmarshalRpnSanIp = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'RpnSanIp' failed as data isn't a dictionary.` + ); } return { - rules: unmarshalArrayOfObject(data.rules, unmarshalACLRule$2) + ip: data.ip ? unmarshalIP(data.ip) : void 0, + rpnv2Group: data.rpnv2_group ? unmarshalRpnSanIpRpnV2Group(data.rpnv2_group) : void 0, + server: data.server ? unmarshalRpnSanIpServer(data.server) : void 0, + type: data.type }; }; -const unmarshalAddInstanceSettingsResponse$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'AddInstanceSettingsResponse' failed as data isn't a dictionary.`); +const unmarshalListIpsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListIpsResponse' failed as data isn't a dictionary.` + ); } return { - settings: unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting$1) + ips: marshalling.unmarshalArrayOfObject(data.ips, unmarshalRpnSanIp), + totalCount: data.total_count }; }; -const unmarshalDeleteInstanceACLRulesResponse$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'DeleteInstanceACLRulesResponse' failed as data isn't a dictionary.`); +const unmarshalListOSResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListOSResponse' failed as data isn't a dictionary.` + ); } return { - rules: unmarshalArrayOfObject(data.rules, unmarshalACLRule$2) + os: marshalling.unmarshalArrayOfObject(data.os, unmarshalOS), + totalCount: data.total_count }; }; -const unmarshalDeleteInstanceSettingsResponse$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'DeleteInstanceSettingsResponse' failed as data isn't a dictionary.`); +const unmarshalListOffersResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListOffersResponse' failed as data isn't a dictionary.` + ); } return { - settings: unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting$1) + offers: marshalling.unmarshalArrayOfObject(data.offers, unmarshalOffer), + totalCount: data.total_count }; }; -const unmarshalInstanceMetrics$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'InstanceMetrics' failed as data isn't a dictionary.`); +const unmarshalRefundSummary = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'RefundSummary' failed as data isn't a dictionary.` + ); } return { - timeseries: unmarshalArrayOfObject(data.timeseries, unmarshalTimeSeries) + createdAt: marshalling.unmarshalDate(data.created_at), + id: data.id, + method: data.method, + refundedAt: marshalling.unmarshalDate(data.refunded_at), + status: data.status, + totalWithTaxes: data.total_with_taxes ? customMarshalling.unmarshalMoney(data.total_with_taxes) : void 0, + totalWithoutTaxes: data.total_without_taxes ? customMarshalling.unmarshalMoney(data.total_without_taxes) : void 0 }; }; -const unmarshalListDatabaseEnginesResponse$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListDatabaseEnginesResponse' failed as data isn't a dictionary.`); +const unmarshalListRefundsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListRefundsResponse' failed as data isn't a dictionary.` + ); } return { - engines: unmarshalArrayOfObject(data.engines, unmarshalDatabaseEngine$1), + refunds: marshalling.unmarshalArrayOfObject(data.refunds, unmarshalRefundSummary), totalCount: data.total_count }; }; -const unmarshalListDatabasesResponse$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListDatabasesResponse' failed as data isn't a dictionary.`); +const unmarshalRpnSanServer = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'RpnSanServer' failed as data isn't a dictionary.` + ); + } + return { + datacenterName: data.datacenter_name, + hostname: data.hostname, + id: data.id, + sans: marshalling.unmarshalArrayOfObject(data.sans, unmarshalRpnSan), + zone: data.zone + }; +}; +const unmarshalListRpnCapableSanServersResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListRpnCapableSanServersResponse' failed as data isn't a dictionary.` + ); } return { - databases: unmarshalArrayOfObject(data.databases, unmarshalDatabase$1), + sanServers: marshalling.unmarshalArrayOfObject(data.san_servers, unmarshalRpnSanServer), totalCount: data.total_count }; }; -const unmarshalListInstanceACLRulesResponse$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListInstanceACLRulesResponse' failed as data isn't a dictionary.`); +const unmarshalListRpnCapableServersResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListRpnCapableServersResponse' failed as data isn't a dictionary.` + ); } return { - rules: unmarshalArrayOfObject(data.rules, unmarshalACLRule$2), + servers: marshalling.unmarshalArrayOfObject(data.servers, unmarshalServer), totalCount: data.total_count }; }; -const unmarshalListInstanceLogsDetailsResponse$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListInstanceLogsDetailsResponse' failed as data isn't a dictionary.`); +const unmarshalRpnGroupMember = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'RpnGroupMember' failed as data isn't a dictionary.` + ); } return { - details: unmarshalArrayOfObject(data.details, unmarshalListInstanceLogsDetailsResponseInstanceLogDetail$1) + groupId: data.group_id, + groupName: data.group_name, + groupOwner: data.group_owner, + id: data.id, + owner: data.owner, + sanServer: data.san_server ? unmarshalRpnSanServer(data.san_server) : void 0, + server: data.server ? unmarshalServer(data.server) : void 0, + speed: data.speed, + status: data.status }; }; -const unmarshalListInstanceLogsResponse$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListInstanceLogsResponse' failed as data isn't a dictionary.`); +const unmarshalListRpnGroupMembersResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListRpnGroupMembersResponse' failed as data isn't a dictionary.` + ); } return { - instanceLogs: unmarshalArrayOfObject(data.instance_logs, unmarshalInstanceLog$1) + members: marshalling.unmarshalArrayOfObject(data.members, unmarshalRpnGroupMember), + totalCount: data.total_count }; }; -const unmarshalListInstancesResponse$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListInstancesResponse' failed as data isn't a dictionary.`); +const unmarshalListRpnGroupsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListRpnGroupsResponse' failed as data isn't a dictionary.` + ); } return { - instances: unmarshalArrayOfObject(data.instances, unmarshalInstance$2), + rpnGroups: marshalling.unmarshalArrayOfObject(data.rpn_groups, unmarshalRpnGroup), totalCount: data.total_count }; }; -const unmarshalListNodeTypesResponse$2 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListNodeTypesResponse' failed as data isn't a dictionary.`); +const unmarshalListRpnInvitesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListRpnInvitesResponse' failed as data isn't a dictionary.` + ); } return { - nodeTypes: unmarshalArrayOfObject(data.node_types, unmarshalNodeType$2), + members: marshalling.unmarshalArrayOfObject(data.members, unmarshalRpnGroupMember), totalCount: data.total_count }; }; -const unmarshalListPrivilegesResponse$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListPrivilegesResponse' failed as data isn't a dictionary.`); +const unmarshalRpnSanSummary = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'RpnSanSummary' failed as data isn't a dictionary.` + ); + } + return { + createdAt: marshalling.unmarshalDate(data.created_at), + datacenterName: data.datacenter_name, + deliveredAt: marshalling.unmarshalDate(data.delivered_at), + expiresAt: marshalling.unmarshalDate(data.expires_at), + id: data.id, + iqnSuffix: data.iqn_suffix, + offerId: data.offer_id, + offerName: data.offer_name, + organizationId: data.organization_id, + projectId: data.project_id, + rpnv1Compatible: data.rpnv1_compatible, + rpnv1Implicit: data.rpnv1_implicit, + serverHostname: data.server_hostname, + status: data.status, + storageSize: data.storage_size, + terminatedAt: marshalling.unmarshalDate(data.terminated_at) + }; +}; +const unmarshalListRpnSansResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListRpnSansResponse' failed as data isn't a dictionary.` + ); } return { - privileges: unmarshalArrayOfObject(data.privileges, unmarshalPrivilege$1), + rpnSans: marshalling.unmarshalArrayOfObject(data.rpn_sans, unmarshalRpnSanSummary), totalCount: data.total_count }; }; -const unmarshalListSnapshotsResponse$2 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListSnapshotsResponse' failed as data isn't a dictionary.`); +const unmarshalRpnServerCapability = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'RpnServerCapability' failed as data isn't a dictionary.` + ); + } + return { + canJoinQinqGroup: data.can_join_qinq_group, + canJoinRpnv2Group: data.can_join_rpnv2_group, + compatibleQinq: data.compatible_qinq, + datacenterName: data.datacenter_name, + hostname: data.hostname, + id: data.id, + ipAddress: data.ip_address, + rpnVersion: data.rpn_version, + rpnv1GroupCount: data.rpnv1_group_count, + rpnv2GroupCount: data.rpnv2_group_count, + zone: data.zone + }; +}; +const unmarshalListRpnServerCapabilitiesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListRpnServerCapabilitiesResponse' failed as data isn't a dictionary.` + ); } return { - snapshots: unmarshalArrayOfObject(data.snapshots, unmarshalSnapshot$2), + servers: marshalling.unmarshalArrayOfObject(data.servers, unmarshalRpnServerCapability), totalCount: data.total_count }; }; -const unmarshalListUsersResponse$2 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListUsersResponse' failed as data isn't a dictionary.`); +const unmarshalListRpnV2CapableResourcesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListRpnV2CapableResourcesResponse' failed as data isn't a dictionary.` + ); } return { - totalCount: data.total_count, - users: unmarshalArrayOfObject(data.users, unmarshalUser$2) + servers: marshalling.unmarshalArrayOfObject(data.servers, unmarshalServer), + totalCount: data.total_count }; }; -const unmarshalSetInstanceACLRulesResponse$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'SetInstanceACLRulesResponse' failed as data isn't a dictionary.`); +const unmarshalRpnV2Member = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'RpnV2Member' failed as data isn't a dictionary.` + ); } return { - rules: unmarshalArrayOfObject(data.rules, unmarshalACLRule$2) + id: data.id, + rpnv1Group: data.rpnv1_group ? unmarshalRpnGroup(data.rpnv1_group) : void 0, + server: data.server ? unmarshalServer(data.server) : void 0, + speed: data.speed, + status: data.status, + vlan: data.vlan }; }; -const unmarshalSetInstanceSettingsResponse$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'SetInstanceSettingsResponse' failed as data isn't a dictionary.`); +const unmarshalLog = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Log' failed as data isn't a dictionary.` + ); } return { - settings: unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting$1) + action: data.action, + createdAt: marshalling.unmarshalDate(data.created_at), + finishedAt: marshalling.unmarshalDate(data.finished_at), + group: data.group ? unmarshalRpnV2Group(data.group) : void 0, + id: data.id, + member: data.member ? unmarshalRpnV2Member(data.member) : void 0, + status: data.status }; }; -const marshalEndpointSpecPrivateNetworkIpamConfig$1 = (request, defaults) => ({}); -const marshalReadReplicaEndpointSpecPrivateNetworkIpamConfig$1 = (request, defaults) => ({}); -const marshalEndpointSpecLoadBalancer$1 = (request, defaults) => ({}); -const marshalEndpointSpecPrivateNetwork$1 = (request, defaults) => ({ - private_network_id: request.privateNetworkId, - ...resolveOneOf([{ - param: 'service_ip', - value: request.serviceIp - }, { - param: 'ipam_config', - value: request.ipamConfig ? marshalEndpointSpecPrivateNetworkIpamConfig$1(request.ipamConfig) : undefined - }]) -}); -const marshalReadReplicaEndpointSpecDirectAccess$1 = (request, defaults) => ({}); -const marshalReadReplicaEndpointSpecPrivateNetwork$1 = (request, defaults) => ({ - private_network_id: request.privateNetworkId, - ...resolveOneOf([{ - param: 'service_ip', - value: request.serviceIp - }, { - param: 'ipam_config', - value: request.ipamConfig ? marshalReadReplicaEndpointSpecPrivateNetworkIpamConfig$1(request.ipamConfig) : undefined - }]) -}); -const marshalACLRuleRequest$1 = (request, defaults) => ({ - description: request.description, - ip: request.ip -}); -const marshalEndpointSpec$2 = (request, defaults) => ({ - ...resolveOneOf([{ - param: 'load_balancer', - value: request.loadBalancer ? marshalEndpointSpecLoadBalancer$1(request.loadBalancer) : undefined - }, { - param: 'private_network', - value: request.privateNetwork ? marshalEndpointSpecPrivateNetwork$1(request.privateNetwork) : undefined - }]) -}); -const marshalInstanceSetting$1 = (request, defaults) => ({ - name: request.name, - value: request.value +const unmarshalListRpnV2GroupLogsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListRpnV2GroupLogsResponse' failed as data isn't a dictionary.` + ); + } + return { + logs: marshalling.unmarshalArrayOfObject(data.logs, unmarshalLog), + totalCount: data.total_count + }; +}; +const unmarshalListRpnV2GroupsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListRpnV2GroupsResponse' failed as data isn't a dictionary.` + ); + } + return { + rpnGroups: marshalling.unmarshalArrayOfObject(data.rpn_groups, unmarshalRpnV2Group), + totalCount: data.total_count + }; +}; +const unmarshalListRpnV2MembersResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListRpnV2MembersResponse' failed as data isn't a dictionary.` + ); + } + return { + members: marshalling.unmarshalArrayOfObject(data.members, unmarshalRpnV2Member), + totalCount: data.total_count + }; +}; +const unmarshalServerDisk = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ServerDisk' failed as data isn't a dictionary.` + ); + } + return { + capacity: data.capacity, + connector: data.connector, + id: data.id, + isAddon: data.is_addon, + type: data.type + }; +}; +const unmarshalListServerDisksResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListServerDisksResponse' failed as data isn't a dictionary.` + ); + } + return { + disks: marshalling.unmarshalArrayOfObject(data.disks, unmarshalServerDisk), + totalCount: data.total_count + }; +}; +const unmarshalServerEvent = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ServerEvent' failed as data isn't a dictionary.` + ); + } + return { + date: marshalling.unmarshalDate(data.date), + description: data.description, + eventId: data.event_id + }; +}; +const unmarshalListServerEventsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListServerEventsResponse' failed as data isn't a dictionary.` + ); + } + return { + events: marshalling.unmarshalArrayOfObject(data.events, unmarshalServerEvent), + totalCount: data.total_count + }; +}; +const unmarshalServerSummary = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ServerSummary' failed as data isn't a dictionary.` + ); + } + return { + createdAt: marshalling.unmarshalDate(data.created_at), + datacenterName: data.datacenter_name, + expiredAt: marshalling.unmarshalDate(data.expired_at), + hostname: data.hostname, + id: data.id, + interfaces: marshalling.unmarshalArrayOfObject( + data.interfaces, + unmarshalNetworkInterface + ), + isOutsourced: data.is_outsourced, + level: data.level ? unmarshalServiceLevel(data.level) : void 0, + offerId: data.offer_id, + offerName: data.offer_name, + organizationId: data.organization_id, + osId: data.os_id, + projectId: data.project_id, + qinq: data.qinq, + rpnVersion: data.rpn_version, + status: data.status, + updatedAt: marshalling.unmarshalDate(data.updated_at), + zone: data.zone + }; +}; +const unmarshalListServersResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListServersResponse' failed as data isn't a dictionary.` + ); + } + return { + servers: marshalling.unmarshalArrayOfObject(data.servers, unmarshalServerSummary), + totalCount: data.total_count + }; +}; +const unmarshalListServicesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListServicesResponse' failed as data isn't a dictionary.` + ); + } + return { + services: marshalling.unmarshalArrayOfObject(data.services, unmarshalService), + totalCount: data.total_count + }; +}; +const unmarshalListSubscribableServerOptionsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListSubscribableServerOptionsResponse' failed as data isn't a dictionary.` + ); + } + return { + serverOptions: marshalling.unmarshalArrayOfObject(data.server_options, unmarshalOffer), + totalCount: data.total_count + }; +}; +const unmarshalRaidArray = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'RaidArray' failed as data isn't a dictionary.` + ); + } + return { + disks: marshalling.unmarshalArrayOfObject(data.disks, unmarshalServerDisk), + raidLevel: data.raid_level + }; +}; +const unmarshalRaid = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Raid' failed as data isn't a dictionary.` + ); + } + return { + raidArrays: marshalling.unmarshalArrayOfObject(data.raid_arrays, unmarshalRaidArray) + }; +}; +const unmarshalRefund = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Refund' failed as data isn't a dictionary.` + ); + } + return { + content: data.content, + createdAt: marshalling.unmarshalDate(data.created_at), + id: data.id, + method: data.method, + refundedAt: marshalling.unmarshalDate(data.refunded_at), + status: data.status, + totalWithTaxes: data.total_with_taxes ? customMarshalling.unmarshalMoney(data.total_with_taxes) : void 0, + totalWithoutTaxes: data.total_without_taxes ? customMarshalling.unmarshalMoney(data.total_without_taxes) : void 0 + }; +}; +const unmarshalRescue = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Rescue' failed as data isn't a dictionary.` + ); + } + return { + login: data.login, + osId: data.os_id, + password: data.password, + protocol: data.protocol + }; +}; +const unmarshalPartition = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Partition' failed as data isn't a dictionary.` + ); + } + return { + capacity: data.capacity, + connectors: data.connectors, + fileSystem: data.file_system, + mountPoint: data.mount_point, + raidLevel: data.raid_level, + type: data.type + }; +}; +const unmarshalServerDefaultPartitioning = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ServerDefaultPartitioning' failed as data isn't a dictionary.` + ); + } + return { + partitions: marshalling.unmarshalArrayOfObject(data.partitions, unmarshalPartition) + }; +}; +const unmarshalServerInstall = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ServerInstall' failed as data isn't a dictionary.` + ); + } + return { + hostname: data.hostname, + osId: data.os_id, + panelUrl: data.panel_url, + partitions: marshalling.unmarshalArrayOfObject(data.partitions, unmarshalPartition), + sshKeyIds: data.ssh_key_ids, + status: data.status, + userLogin: data.user_login + }; +}; +const unmarshalSubscribeStorageOptionsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SubscribeStorageOptionsResponse' failed as data isn't a dictionary.` + ); + } + return { + services: marshalling.unmarshalArrayOfObject(data.services, unmarshalService) + }; +}; +const marshalAttachFailoverIPToMacAddressRequest = (request, defaults) => ({ + mac: request.mac, + type: request.type }); -const marshalLogsPolicy$1 = (request, defaults) => ({ - max_age_retention: request.maxAgeRetention, - total_disk_retention: request.totalDiskRetention +const marshalAttachFailoverIPsRequest = (request, defaults) => ({ + fips_ids: request.fipsIds, + server_id: request.serverId }); -const marshalReadReplicaEndpointSpec$1 = (request, defaults) => ({ - ...resolveOneOf([{ - param: 'direct_access', - value: request.directAccess ? marshalReadReplicaEndpointSpecDirectAccess$1(request.directAccess) : undefined - }, { - param: 'private_network', - value: request.privateNetwork ? marshalReadReplicaEndpointSpecPrivateNetwork$1(request.privateNetwork) : undefined - }]) +const marshalCreateFailoverIPsRequest = (request, defaults) => ({ + offer_id: request.offerId, + project_id: request.projectId ?? defaults.defaultProjectId, + quantity: request.quantity }); -const marshalAddInstanceACLRulesRequest$1 = (request, defaults) => ({ - rules: request.rules.map(elt => marshalACLRuleRequest$1(elt)) +const marshalCreateServerRequest = (request, defaults) => ({ + datacenter_name: request.datacenterName, + offer_id: request.offerId, + project_id: request.projectId ?? defaults.defaultProjectId, + server_option_ids: request.serverOptionIds }); -const marshalAddInstanceSettingsRequest$1 = (request, defaults) => ({ - settings: request.settings.map(elt => marshalInstanceSetting$1(elt)) +const marshalDetachFailoverIPsRequest = (request, defaults) => ({ + fips_ids: request.fipsIds }); -const marshalCloneInstanceRequest$1 = (request, defaults) => ({ - name: request.name, - node_type: request.nodeType +const marshalIPv6BlockApiCreateIPv6BlockRequest = (request, defaults) => ({ + project_id: request.projectId ?? defaults.defaultProjectId }); -const marshalCreateDatabaseRequest$1 = (request, defaults) => ({ - name: request.name +const marshalIPv6BlockApiCreateIPv6BlockSubnetRequest = (request, defaults) => ({ + address: request.address, + cidr: request.cidr }); -const marshalCreateEndpointRequest$1 = (request, defaults) => ({ - endpoint_spec: request.endpointSpec ? marshalEndpointSpec$2(request.endpointSpec) : undefined +const marshalIPv6BlockApiUpdateIPv6BlockRequest = (request, defaults) => ({ + nameservers: request.nameservers }); -const marshalCreateInstanceFromSnapshotRequest$1 = (request, defaults) => ({ - instance_name: request.instanceName, - is_ha_cluster: request.isHaCluster, - node_type: request.nodeType +const marshalInstallPartition = (request, defaults) => ({ + capacity: request.capacity, + connectors: request.connectors, + file_system: request.fileSystem, + mount_point: request.mountPoint, + raid_level: request.raidLevel }); -const marshalCreateInstanceRequest$1 = (request, defaults) => ({ - backup_same_region: request.backupSameRegion, - disable_backup: request.disableBackup, - engine: request.engine, - init_endpoints: request.initEndpoints ? request.initEndpoints.map(elt => marshalEndpointSpec$2(elt)) : undefined, - init_settings: request.initSettings ? request.initSettings.map(elt => marshalInstanceSetting$1(elt)) : undefined, - is_ha_cluster: request.isHaCluster, - name: request.name || randomName('ins'), - node_type: request.nodeType, - password: request.password, - tags: request.tags, - user_name: request.userName, - volume_size: request.volumeSize, - volume_type: request.volumeType ?? 'lssd', - ...resolveOneOf([{ - default: defaults.defaultProjectId, - param: 'project_id', - value: request.projectId - }, { - default: defaults.defaultOrganizationId, - param: 'organization_id', - value: request.organizationId - }]) -}); -const marshalCreateReadReplicaEndpointRequest$1 = (request, defaults) => ({ - endpoint_spec: request.endpointSpec.map(elt => marshalReadReplicaEndpointSpec$1(elt)) -}); -const marshalCreateReadReplicaRequest$1 = (request, defaults) => ({ - endpoint_spec: request.endpointSpec ? request.endpointSpec.map(elt => marshalReadReplicaEndpointSpec$1(elt)) : undefined, - instance_id: request.instanceId, - same_zone: request.sameZone +const marshalInstallServerRequest = (request, defaults) => ({ + hostname: request.hostname, + ip_id: request.ipId, + license_offer_id: request.licenseOfferId, + os_id: request.osId, + panel_password: request.panelPassword, + partitions: request.partitions !== void 0 ? request.partitions.map((elt) => marshalInstallPartition(elt)) : void 0, + root_password: request.rootPassword, + ssh_key_ids: request.sshKeyIds, + user_login: request.userLogin, + user_password: request.userPassword }); -const marshalCreateSnapshotRequest$2 = (request, defaults) => ({ - expires_at: request.expiresAt, - name: request.name || randomName('snp') +const marshalRpnSanApiAddIpRequest = (request, defaults) => ({ + ip_ids: request.ipIds }); -const marshalCreateUserRequest$2 = (request, defaults) => ({ - is_admin: request.isAdmin, - name: request.name, - password: request.password +const marshalRpnSanApiCreateRpnSanRequest = (request, defaults) => ({ + offer_id: request.offerId, + project_id: request.projectId ?? defaults.defaultProjectId }); -const marshalDeleteInstanceACLRulesRequest$1 = (request, defaults) => ({ - acl_rule_ips: request.aclRuleIps +const marshalRpnSanApiRemoveIpRequest = (request, defaults) => ({ + ip_ids: request.ipIds }); -const marshalDeleteInstanceSettingsRequest$1 = (request, defaults) => ({ - setting_names: request.settingNames +const marshalRpnV1ApiAddRpnGroupMembersRequest = (request, defaults) => ({ + san_server_ids: request.sanServerIds, + server_ids: request.serverIds }); -const marshalMigrateEndpointRequest$1 = (request, defaults) => ({ - instance_id: request.instanceId +const marshalRpnV1ApiCreateRpnGroupRequest = (request, defaults) => ({ + name: request.name, + project_id: request.projectId ?? defaults.defaultProjectId, + san_server_ids: request.sanServerIds, + server_ids: request.serverIds }); -const marshalPurgeInstanceLogsRequest$1 = (request, defaults) => ({ - log_name: request.logName +const marshalRpnV1ApiDeleteRpnGroupMembersRequest = (request, defaults) => ({ + member_ids: request.memberIds }); -const marshalSetInstanceACLRulesRequest$1 = (request, defaults) => ({ - rules: request.rules.map(elt => marshalACLRuleRequest$1(elt)) +const marshalRpnV1ApiLeaveRpnGroupRequest = (request, defaults) => ({ + member_ids: request.memberIds, + project_id: request.projectId ?? defaults.defaultProjectId }); -const marshalSetInstanceSettingsRequest$1 = (request, defaults) => ({ - settings: request.settings.map(elt => marshalInstanceSetting$1(elt)) +const marshalRpnV1ApiRpnGroupInviteRequest = (request, defaults) => ({ + project_id: request.projectId ?? defaults.defaultProjectId, + server_ids: request.serverIds }); -const marshalSetPrivilegeRequest$1 = (request, defaults) => ({ - database_name: request.databaseName, - permission: request.permission ?? 'readonly', - user_name: request.userName +const marshalRpnV1ApiUpdateRpnGroupNameRequest = (request, defaults) => ({ + name: request.name }); -const marshalUpdateInstanceRequest$1 = (request, defaults) => ({ - backup_same_region: request.backupSameRegion, - backup_schedule_frequency: request.backupScheduleFrequency, - backup_schedule_retention: request.backupScheduleRetention, - backup_schedule_start_hour: request.backupScheduleStartHour, - is_backup_schedule_disabled: request.isBackupScheduleDisabled, - logs_policy: request.logsPolicy ? marshalLogsPolicy$1(request.logsPolicy) : undefined, +const marshalRpnV2ApiAddRpnV2MembersRequest = (request, defaults) => ({ + servers: request.servers +}); +const marshalRpnV2ApiCreateRpnV2GroupRequest = (request, defaults) => ({ name: request.name, - tags: request.tags + project_id: request.projectId ?? defaults.defaultProjectId, + servers: request.servers, + type: request.type }); -const marshalUpdateSnapshotRequest$1 = (request, defaults) => ({ - expires_at: request.expiresAt, +const marshalRpnV2ApiDeleteRpnV2MembersRequest = (request, defaults) => ({ + member_ids: request.memberIds +}); +const marshalRpnV2ApiEnableRpnV2GroupCompatibilityRequest = (request, defaults) => ({ + rpnv1_group_id: request.rpnv1GroupId +}); +const marshalRpnV2ApiUpdateRpnV2GroupNameRequest = (request, defaults) => ({ name: request.name }); -const marshalUpdateUserRequest$1 = (request, defaults) => ({ - is_admin: request.isAdmin, +const marshalRpnV2ApiUpdateRpnV2VlanForMembersRequest = (request, defaults) => ({ + member_ids: request.memberIds, + vlan: request.vlan +}); +const marshalStartBMCAccessRequest = (request, defaults) => ({ + ip: request.ip +}); +const marshalStartRescueRequest = (request, defaults) => ({ + os_id: request.osId +}); +const marshalSubscribeServerOptionRequest = (request, defaults) => ({ + option_id: request.optionId +}); +const marshalSubscribeStorageOptionsRequest = (request, defaults) => ({ + options_ids: request.optionsIds +}); +const marshalUpdatableRaidArray = (request, defaults) => ({ + disk_ids: request.diskIds, + raid_level: request.raidLevel +}); +const marshalUpdateRaidRequest = (request, defaults) => ({ + raid_arrays: request.raidArrays.map( + (elt) => marshalUpdatableRaidArray(elt) + ) +}); +const marshalUpdateReverseRequest = (request, defaults) => ({ + reverse: request.reverse +}); +const marshalUpdateServerBackupRequest = (request, defaults) => ({ + acl_enabled: request.aclEnabled, + autologin: request.autologin, password: request.password }); -const marshalUpgradeInstanceRequest$1 = (request, defaults) => ({ - ...resolveOneOf([{ - param: 'node_type', - value: request.nodeType - }, { - param: 'enable_ha', - value: request.enableHa - }, { - param: 'volume_size', - value: request.volumeSize - }, { - param: 'volume_type', - value: request.volumeType - }, { - param: 'upgradable_version_id', - value: request.upgradableVersionId - }]) -}); - -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const jsonContentHeaders$l = { - 'Content-Type': 'application/json; charset=utf-8' -}; - -/** Managed Document Databases API. */ -let API$m = class API extends API$u { - /** Lists the available regions of the API. */ - static LOCALITIES = ['fr-par', 'nl-ams', 'pl-waw']; - pageOfListDatabaseEngines = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/database-engines`, - urlParams: urlParams(['name', request.name], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['version', request.version]) - }, unmarshalListDatabaseEnginesResponse$1); - - /** - * List available database engines. List the FerretDB database engines - * available at Scaleway. - * - * @param request - The request {@link ListDatabaseEnginesRequest} - * @returns A Promise of ListDatabaseEnginesResponse - */ - listDatabaseEngines = (request = {}) => enrichForPagination('engines', this.pageOfListDatabaseEngines, request); - pageOfListNodeTypes = request => this.client.fetch({ - method: 'GET', - path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/node-types`, - urlParams: urlParams(['include_disabled_types', request.includeDisabledTypes], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]) - }, unmarshalListNodeTypesResponse$2); - - /** - * List available node types. List all available node types. By default, the - * node types returned in the list are ordered by creation date in ascending - * order, though this can be modified via the `order_by` field. - * - * @param request - The request {@link ListNodeTypesRequest} - * @returns A Promise of ListNodeTypesResponse - */ - listNodeTypes = request => enrichForPagination('nodeTypes', this.pageOfListNodeTypes, request); +const marshalUpdateServerRequest = (request, defaults) => ({ + enable_ipv6: request.enableIpv6, + hostname: request.hostname +}); +const marshalUpdateServerTagsRequest = (request, defaults) => ({ + tags: request.tags +}); +exports.marshalAttachFailoverIPToMacAddressRequest = marshalAttachFailoverIPToMacAddressRequest; +exports.marshalAttachFailoverIPsRequest = marshalAttachFailoverIPsRequest; +exports.marshalCreateFailoverIPsRequest = marshalCreateFailoverIPsRequest; +exports.marshalCreateServerRequest = marshalCreateServerRequest; +exports.marshalDetachFailoverIPsRequest = marshalDetachFailoverIPsRequest; +exports.marshalIPv6BlockApiCreateIPv6BlockRequest = marshalIPv6BlockApiCreateIPv6BlockRequest; +exports.marshalIPv6BlockApiCreateIPv6BlockSubnetRequest = marshalIPv6BlockApiCreateIPv6BlockSubnetRequest; +exports.marshalIPv6BlockApiUpdateIPv6BlockRequest = marshalIPv6BlockApiUpdateIPv6BlockRequest; +exports.marshalInstallServerRequest = marshalInstallServerRequest; +exports.marshalRpnSanApiAddIpRequest = marshalRpnSanApiAddIpRequest; +exports.marshalRpnSanApiCreateRpnSanRequest = marshalRpnSanApiCreateRpnSanRequest; +exports.marshalRpnSanApiRemoveIpRequest = marshalRpnSanApiRemoveIpRequest; +exports.marshalRpnV1ApiAddRpnGroupMembersRequest = marshalRpnV1ApiAddRpnGroupMembersRequest; +exports.marshalRpnV1ApiCreateRpnGroupRequest = marshalRpnV1ApiCreateRpnGroupRequest; +exports.marshalRpnV1ApiDeleteRpnGroupMembersRequest = marshalRpnV1ApiDeleteRpnGroupMembersRequest; +exports.marshalRpnV1ApiLeaveRpnGroupRequest = marshalRpnV1ApiLeaveRpnGroupRequest; +exports.marshalRpnV1ApiRpnGroupInviteRequest = marshalRpnV1ApiRpnGroupInviteRequest; +exports.marshalRpnV1ApiUpdateRpnGroupNameRequest = marshalRpnV1ApiUpdateRpnGroupNameRequest; +exports.marshalRpnV2ApiAddRpnV2MembersRequest = marshalRpnV2ApiAddRpnV2MembersRequest; +exports.marshalRpnV2ApiCreateRpnV2GroupRequest = marshalRpnV2ApiCreateRpnV2GroupRequest; +exports.marshalRpnV2ApiDeleteRpnV2MembersRequest = marshalRpnV2ApiDeleteRpnV2MembersRequest; +exports.marshalRpnV2ApiEnableRpnV2GroupCompatibilityRequest = marshalRpnV2ApiEnableRpnV2GroupCompatibilityRequest; +exports.marshalRpnV2ApiUpdateRpnV2GroupNameRequest = marshalRpnV2ApiUpdateRpnV2GroupNameRequest; +exports.marshalRpnV2ApiUpdateRpnV2VlanForMembersRequest = marshalRpnV2ApiUpdateRpnV2VlanForMembersRequest; +exports.marshalStartBMCAccessRequest = marshalStartBMCAccessRequest; +exports.marshalStartRescueRequest = marshalStartRescueRequest; +exports.marshalSubscribeServerOptionRequest = marshalSubscribeServerOptionRequest; +exports.marshalSubscribeStorageOptionsRequest = marshalSubscribeStorageOptionsRequest; +exports.marshalUpdateRaidRequest = marshalUpdateRaidRequest; +exports.marshalUpdateReverseRequest = marshalUpdateReverseRequest; +exports.marshalUpdateServerBackupRequest = marshalUpdateServerBackupRequest; +exports.marshalUpdateServerRequest = marshalUpdateServerRequest; +exports.marshalUpdateServerTagsRequest = marshalUpdateServerTagsRequest; +exports.unmarshalBMCAccess = unmarshalBMCAccess; +exports.unmarshalBackup = unmarshalBackup; +exports.unmarshalCanOrderResponse = unmarshalCanOrderResponse; +exports.unmarshalCreateFailoverIPsResponse = unmarshalCreateFailoverIPsResponse; +exports.unmarshalFailoverIP = unmarshalFailoverIP; +exports.unmarshalGetIPv6BlockQuotasResponse = unmarshalGetIPv6BlockQuotasResponse; +exports.unmarshalGetRemainingQuotaResponse = unmarshalGetRemainingQuotaResponse; +exports.unmarshalGetRpnStatusResponse = unmarshalGetRpnStatusResponse; +exports.unmarshalIP = unmarshalIP; +exports.unmarshalIPv6Block = unmarshalIPv6Block; +exports.unmarshalInvoice = unmarshalInvoice; +exports.unmarshalListFailoverIPsResponse = unmarshalListFailoverIPsResponse; +exports.unmarshalListIPv6BlockSubnetsAvailableResponse = unmarshalListIPv6BlockSubnetsAvailableResponse; +exports.unmarshalListInvoicesResponse = unmarshalListInvoicesResponse; +exports.unmarshalListIpsResponse = unmarshalListIpsResponse; +exports.unmarshalListOSResponse = unmarshalListOSResponse; +exports.unmarshalListOffersResponse = unmarshalListOffersResponse; +exports.unmarshalListRefundsResponse = unmarshalListRefundsResponse; +exports.unmarshalListRpnCapableSanServersResponse = unmarshalListRpnCapableSanServersResponse; +exports.unmarshalListRpnCapableServersResponse = unmarshalListRpnCapableServersResponse; +exports.unmarshalListRpnGroupMembersResponse = unmarshalListRpnGroupMembersResponse; +exports.unmarshalListRpnGroupsResponse = unmarshalListRpnGroupsResponse; +exports.unmarshalListRpnInvitesResponse = unmarshalListRpnInvitesResponse; +exports.unmarshalListRpnSansResponse = unmarshalListRpnSansResponse; +exports.unmarshalListRpnServerCapabilitiesResponse = unmarshalListRpnServerCapabilitiesResponse; +exports.unmarshalListRpnV2CapableResourcesResponse = unmarshalListRpnV2CapableResourcesResponse; +exports.unmarshalListRpnV2GroupLogsResponse = unmarshalListRpnV2GroupLogsResponse; +exports.unmarshalListRpnV2GroupsResponse = unmarshalListRpnV2GroupsResponse; +exports.unmarshalListRpnV2MembersResponse = unmarshalListRpnV2MembersResponse; +exports.unmarshalListServerDisksResponse = unmarshalListServerDisksResponse; +exports.unmarshalListServerEventsResponse = unmarshalListServerEventsResponse; +exports.unmarshalListServersResponse = unmarshalListServersResponse; +exports.unmarshalListServicesResponse = unmarshalListServicesResponse; +exports.unmarshalListSubscribableServerOptionsResponse = unmarshalListSubscribableServerOptionsResponse; +exports.unmarshalOS = unmarshalOS; +exports.unmarshalOffer = unmarshalOffer; +exports.unmarshalRaid = unmarshalRaid; +exports.unmarshalRefund = unmarshalRefund; +exports.unmarshalRescue = unmarshalRescue; +exports.unmarshalRpnGroup = unmarshalRpnGroup; +exports.unmarshalRpnSan = unmarshalRpnSan; +exports.unmarshalRpnV2Group = unmarshalRpnV2Group; +exports.unmarshalServer = unmarshalServer; +exports.unmarshalServerDefaultPartitioning = unmarshalServerDefaultPartitioning; +exports.unmarshalServerInstall = unmarshalServerInstall; +exports.unmarshalService = unmarshalService; +exports.unmarshalSubscribeStorageOptionsResponse = unmarshalSubscribeStorageOptionsResponse; - /** - * Upgrade a Database Instance. Upgrade your current Database Instance - * specifications like node type, high availability, volume, or the database - * engine version. Note that upon upgrade the `enable_ha` parameter can only - * be set to `true`. - * - * @param request - The request {@link UpgradeInstanceRequest} - * @returns A Promise of Instance - */ - upgradeInstance = request => this.client.fetch({ - body: JSON.stringify(marshalUpgradeInstanceRequest$1(request, this.client.settings)), - headers: jsonContentHeaders$l, - method: 'POST', - path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/upgrade` - }, unmarshalInstance$2); - pageOfListInstances = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances`, - urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId], ['tags', request.tags]) - }, unmarshalListInstancesResponse$1); - /** - * List Database Instances. List all Database Instances in the specified - * region, for a given Scaleway Organization or Scaleway Project. By default, - * the Database Instances returned in the list are ordered by creation date in - * ascending order, though this can be modified via the order_by field. You - * can define additional parameters for your query, such as `tags` and `name`. - * For the `name` parameter, the value you include will be checked against the - * whole name string to see if it includes the string you put in the - * parameter. - * - * @param request - The request {@link ListInstancesRequest} - * @returns A Promise of ListInstancesResponse - */ - listInstances = (request = {}) => enrichForPagination('instances', this.pageOfListInstances, request); +/***/ }), - /** - * Get a Database Instance. Retrieve information about a given Database - * Instance, specified by the `region` and `instance_id` parameters. Its full - * details, including name, status, IP address and port, are returned in the - * response object. - * - * @param request - The request {@link GetInstanceRequest} - * @returns A Promise of Instance - */ - getInstance = request => this.client.fetch({ - method: 'GET', - path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}` - }, unmarshalInstance$2); +/***/ 6948: +/***/ ((__unused_webpack_module, exports) => { - /** - * Waits for {@link Instance} to be in a final state. - * - * @param request - The request {@link GetInstanceRequest} - * @param options - The waiting options - * @returns A Promise of Instance - */ - waitForInstance = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!INSTANCE_TRANSIENT_STATUSES$2.includes(res.status))), this.getInstance, request, options); +"use strict"; - /** +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const AttachFailoverIPToMacAddressRequest = { + ipId: { + greaterThan: 0 + } +}; +const AttachFailoverIPsRequest = { + serverId: { + greaterThan: 0 + } +}; +const BillingApiDownloadInvoiceRequest = { + invoiceId: { + greaterThan: 0 + } +}; +const BillingApiDownloadRefundRequest = { + refundId: { + greaterThan: 0 + } +}; +const BillingApiGetInvoiceRequest = { + invoiceId: { + greaterThan: 0 + } +}; +const BillingApiGetRefundRequest = { + refundId: { + greaterThan: 0 + } +}; +const BillingApiListInvoicesRequest = { + page: { + greaterThan: 0 + }, + pageSize: { + greaterThan: 0, + lessThanOrEqual: 100 + } +}; +const BillingApiListRefundsRequest = { + page: { + greaterThan: 0 + }, + pageSize: { + greaterThan: 0, + lessThanOrEqual: 100 + } +}; +const CancelServerInstallRequest = { + serverId: { + greaterThan: 0 + } +}; +const DeleteFailoverIPRequest = { + ipId: { + greaterThan: 0 + } +}; +const DeleteServerRequest = { + serverId: { + greaterThan: 0 + } +}; +const DeleteServiceRequest = { + serviceId: { + greaterThan: 0 + } +}; +const DetachFailoverIPFromMacAddressRequest = { + ipId: { + greaterThan: 0 + } +}; +const GetBMCAccessRequest = { + serverId: { + greaterThan: 0 + } +}; +const GetFailoverIPRequest = { + ipId: { + greaterThan: 0 + } +}; +const GetOSRequest = { + osId: { + greaterThan: 0 + }, + serverId: { + greaterThan: 0 + } +}; +const GetOfferRequest = { + offerId: { + greaterThan: 0 + } +}; +const GetOrderedServiceRequest = { + orderedServiceId: { + greaterThan: 0 + } +}; +const GetRaidRequest = { + serverId: { + greaterThan: 0 + } +}; +const GetRescueRequest = { + serverId: { + greaterThan: 0 + } +}; +const GetServerBackupRequest = { + serverId: { + greaterThan: 0 + } +}; +const GetServerInstallRequest = { + serverId: { + greaterThan: 0 + } +}; +const GetServerRequest = { + serverId: { + greaterThan: 0 + } +}; +const GetServiceRequest = { + serviceId: { + greaterThan: 0 + } +}; +const IPv6Block = { + id: { + greaterThan: 0 + } +}; +const IPv6BlockApiCreateIPv6BlockSubnetRequest = { + blockId: { + greaterThan: 0 + } +}; +const IPv6BlockApiDeleteIPv6BlockRequest = { + blockId: { + greaterThan: 0 + } +}; +const IPv6BlockApiListIPv6BlockSubnetsAvailableRequest = { + blockId: { + greaterThan: 0 + } +}; +const IPv6BlockApiUpdateIPv6BlockRequest = { + blockId: { + greaterThan: 0 + } +}; +const InstallServerRequest = { + osId: { + greaterThan: 0 + }, + serverId: { + greaterThan: 0 + } +}; +const ListFailoverIPsRequest = { + page: { + greaterThan: 0 + }, + pageSize: { + greaterThan: 0, + lessThanOrEqual: 100 + } +}; +const ListOSRequest = { + page: { + greaterThan: 0 + }, + pageSize: { + greaterThan: 0, + lessThanOrEqual: 100 + }, + serverId: { + greaterThan: 0 + } +}; +const ListOffersRequest = { + page: { + greaterThan: 0 + }, + pageSize: { + greaterThan: 0, + lessThanOrEqual: 100 + } +}; +const ListServerDisksRequest = { + page: { + greaterThan: 0 + }, + pageSize: { + greaterThan: 0, + lessThanOrEqual: 100 + }, + serverId: { + greaterThan: 0 + } +}; +const ListServerEventsRequest = { + page: { + greaterThan: 0 + }, + pageSize: { + greaterThan: 0, + lessThanOrEqual: 100 + }, + serverId: { + greaterThan: 0 + } +}; +const ListServersRequest = { + page: { + greaterThan: 0 + }, + pageSize: { + greaterThan: 0, + lessThanOrEqual: 100 + } +}; +const ListServicesRequest = { + page: { + greaterThan: 0 + }, + pageSize: { + greaterThan: 0, + lessThanOrEqual: 100 + } +}; +const ListSubscribableServerOptionsRequest = { + page: { + greaterThan: 0 + }, + pageSize: { + greaterThan: 0, + lessThanOrEqual: 100 + }, + serverId: { + greaterThan: 0 + } +}; +const RebootServerRequest = { + serverId: { + greaterThan: 0 + } +}; +const RpnApiListRpnServerCapabilitiesRequest = { + page: { + greaterThan: 0 + }, + pageSize: { + greaterThan: 0, + lessThanOrEqual: 100 + } +}; +const RpnSanApiAddIpRequest = { + rpnSanId: { + greaterThan: 0 + } +}; +const RpnSanApiDeleteRpnSanRequest = { + rpnSanId: { + greaterThan: 0 + } +}; +const RpnSanApiGetRpnSanRequest = { + rpnSanId: { + greaterThan: 0 + } +}; +const RpnSanApiListAvailableIpsRequest = { + rpnSanId: { + greaterThan: 0 + } +}; +const RpnSanApiListIpsRequest = { + rpnSanId: { + greaterThan: 0 + } +}; +const RpnSanApiListRpnSansRequest = { + page: { + greaterThan: 0 + }, + pageSize: { + greaterThan: 0, + lessThanOrEqual: 100 + } +}; +const RpnSanApiRemoveIpRequest = { + rpnSanId: { + greaterThan: 0 + } +}; +const RpnV1ApiAcceptRpnInviteRequest = { + memberId: { + greaterThan: 0 + } +}; +const RpnV1ApiAddRpnGroupMembersRequest = { + groupId: { + greaterThan: 0 + } +}; +const RpnV1ApiDeleteRpnGroupMembersRequest = { + groupId: { + greaterThan: 0 + } +}; +const RpnV1ApiDeleteRpnGroupRequest = { + groupId: { + greaterThan: 0 + } +}; +const RpnV1ApiGetRpnGroupRequest = { + groupId: { + greaterThan: 0 + } +}; +const RpnV1ApiLeaveRpnGroupRequest = { + groupId: { + greaterThan: 0 + } +}; +const RpnV1ApiListRpnCapableSanServersRequest = { + page: { + greaterThan: 0 + }, + pageSize: { + greaterThan: 0, + lessThanOrEqual: 100 + } +}; +const RpnV1ApiListRpnCapableServersRequest = { + page: { + greaterThan: 0 + }, + pageSize: { + greaterThan: 0, + lessThanOrEqual: 100 + } +}; +const RpnV1ApiListRpnGroupMembersRequest = { + groupId: { + greaterThan: 0 + }, + page: { + greaterThan: 0 + }, + pageSize: { + greaterThan: 0, + lessThanOrEqual: 100 + } +}; +const RpnV1ApiListRpnGroupsRequest = { + page: { + greaterThan: 0 + }, + pageSize: { + greaterThan: 0, + lessThanOrEqual: 100 + } +}; +const RpnV1ApiListRpnInvitesRequest = { + page: { + greaterThan: 0 + }, + pageSize: { + greaterThan: 0, + lessThanOrEqual: 100 + } +}; +const RpnV1ApiRefuseRpnInviteRequest = { + memberId: { + greaterThan: 0 + } +}; +const RpnV1ApiRpnGroupInviteRequest = { + groupId: { + greaterThan: 0 + } +}; +const RpnV1ApiUpdateRpnGroupNameRequest = { + groupId: { + greaterThan: 0 + } +}; +const RpnV2ApiAddRpnV2MembersRequest = { + groupId: { + greaterThan: 0 + } +}; +const RpnV2ApiDeleteRpnV2GroupRequest = { + groupId: { + greaterThan: 0 + } +}; +const RpnV2ApiDeleteRpnV2MembersRequest = { + groupId: { + greaterThan: 0 + } +}; +const RpnV2ApiDisableRpnV2GroupCompatibilityRequest = { + groupId: { + greaterThan: 0 + } +}; +const RpnV2ApiEnableRpnV2GroupCompatibilityRequest = { + groupId: { + greaterThan: 0 + } +}; +const RpnV2ApiGetRpnV2GroupRequest = { + groupId: { + greaterThan: 0 + } +}; +const RpnV2ApiListRpnV2CapableResourcesRequest = { + page: { + greaterThan: 0 + }, + pageSize: { + greaterThan: 0, + lessThanOrEqual: 100 + } +}; +const RpnV2ApiListRpnV2GroupLogsRequest = { + groupId: { + greaterThan: 0 + }, + page: { + greaterThan: 0 + }, + pageSize: { + greaterThan: 0, + lessThanOrEqual: 100 + } +}; +const RpnV2ApiListRpnV2GroupsRequest = { + page: { + greaterThan: 0 + }, + pageSize: { + greaterThan: 0, + lessThanOrEqual: 100 + } +}; +const RpnV2ApiListRpnV2MembersRequest = { + groupId: { + greaterThan: 0 + }, + page: { + greaterThan: 0 + }, + pageSize: { + greaterThan: 0, + lessThanOrEqual: 100 + } +}; +const RpnV2ApiUpdateRpnV2GroupNameRequest = { + groupId: { + greaterThan: 0 + } +}; +const RpnV2ApiUpdateRpnV2VlanForMembersRequest = { + groupId: { + greaterThan: 0 + } +}; +const StartRescueRequest = { + serverId: { + greaterThan: 0 + } +}; +const StartServerRequest = { + serverId: { + greaterThan: 0 + } +}; +const StopBMCAccessRequest = { + serverId: { + greaterThan: 0 + } +}; +const StopRescueRequest = { + serverId: { + greaterThan: 0 + } +}; +const StopServerRequest = { + serverId: { + greaterThan: 0 + } +}; +const SubscribeServerOptionRequest = { + optionId: { + greaterThan: 0 + }, + serverId: { + greaterThan: 0 + } +}; +const SubscribeStorageOptionsRequest = { + serverId: { + greaterThan: 0 + } +}; +const UpdateRaidRequest = { + serverId: { + greaterThan: 0 + } +}; +const UpdateReverseRequest = { + ipId: { + greaterThan: 0 + } +}; +const UpdateServerBackupRequest = { + serverId: { + greaterThan: 0 + } +}; +const UpdateServerRequest = { + serverId: { + greaterThan: 0 + } +}; +const UpdateServerTagsRequest = { + serverId: { + greaterThan: 0 + } +}; +exports.AttachFailoverIPToMacAddressRequest = AttachFailoverIPToMacAddressRequest; +exports.AttachFailoverIPsRequest = AttachFailoverIPsRequest; +exports.BillingApiDownloadInvoiceRequest = BillingApiDownloadInvoiceRequest; +exports.BillingApiDownloadRefundRequest = BillingApiDownloadRefundRequest; +exports.BillingApiGetInvoiceRequest = BillingApiGetInvoiceRequest; +exports.BillingApiGetRefundRequest = BillingApiGetRefundRequest; +exports.BillingApiListInvoicesRequest = BillingApiListInvoicesRequest; +exports.BillingApiListRefundsRequest = BillingApiListRefundsRequest; +exports.CancelServerInstallRequest = CancelServerInstallRequest; +exports.DeleteFailoverIPRequest = DeleteFailoverIPRequest; +exports.DeleteServerRequest = DeleteServerRequest; +exports.DeleteServiceRequest = DeleteServiceRequest; +exports.DetachFailoverIPFromMacAddressRequest = DetachFailoverIPFromMacAddressRequest; +exports.GetBMCAccessRequest = GetBMCAccessRequest; +exports.GetFailoverIPRequest = GetFailoverIPRequest; +exports.GetOSRequest = GetOSRequest; +exports.GetOfferRequest = GetOfferRequest; +exports.GetOrderedServiceRequest = GetOrderedServiceRequest; +exports.GetRaidRequest = GetRaidRequest; +exports.GetRescueRequest = GetRescueRequest; +exports.GetServerBackupRequest = GetServerBackupRequest; +exports.GetServerInstallRequest = GetServerInstallRequest; +exports.GetServerRequest = GetServerRequest; +exports.GetServiceRequest = GetServiceRequest; +exports.IPv6Block = IPv6Block; +exports.IPv6BlockApiCreateIPv6BlockSubnetRequest = IPv6BlockApiCreateIPv6BlockSubnetRequest; +exports.IPv6BlockApiDeleteIPv6BlockRequest = IPv6BlockApiDeleteIPv6BlockRequest; +exports.IPv6BlockApiListIPv6BlockSubnetsAvailableRequest = IPv6BlockApiListIPv6BlockSubnetsAvailableRequest; +exports.IPv6BlockApiUpdateIPv6BlockRequest = IPv6BlockApiUpdateIPv6BlockRequest; +exports.InstallServerRequest = InstallServerRequest; +exports.ListFailoverIPsRequest = ListFailoverIPsRequest; +exports.ListOSRequest = ListOSRequest; +exports.ListOffersRequest = ListOffersRequest; +exports.ListServerDisksRequest = ListServerDisksRequest; +exports.ListServerEventsRequest = ListServerEventsRequest; +exports.ListServersRequest = ListServersRequest; +exports.ListServicesRequest = ListServicesRequest; +exports.ListSubscribableServerOptionsRequest = ListSubscribableServerOptionsRequest; +exports.RebootServerRequest = RebootServerRequest; +exports.RpnApiListRpnServerCapabilitiesRequest = RpnApiListRpnServerCapabilitiesRequest; +exports.RpnSanApiAddIpRequest = RpnSanApiAddIpRequest; +exports.RpnSanApiDeleteRpnSanRequest = RpnSanApiDeleteRpnSanRequest; +exports.RpnSanApiGetRpnSanRequest = RpnSanApiGetRpnSanRequest; +exports.RpnSanApiListAvailableIpsRequest = RpnSanApiListAvailableIpsRequest; +exports.RpnSanApiListIpsRequest = RpnSanApiListIpsRequest; +exports.RpnSanApiListRpnSansRequest = RpnSanApiListRpnSansRequest; +exports.RpnSanApiRemoveIpRequest = RpnSanApiRemoveIpRequest; +exports.RpnV1ApiAcceptRpnInviteRequest = RpnV1ApiAcceptRpnInviteRequest; +exports.RpnV1ApiAddRpnGroupMembersRequest = RpnV1ApiAddRpnGroupMembersRequest; +exports.RpnV1ApiDeleteRpnGroupMembersRequest = RpnV1ApiDeleteRpnGroupMembersRequest; +exports.RpnV1ApiDeleteRpnGroupRequest = RpnV1ApiDeleteRpnGroupRequest; +exports.RpnV1ApiGetRpnGroupRequest = RpnV1ApiGetRpnGroupRequest; +exports.RpnV1ApiLeaveRpnGroupRequest = RpnV1ApiLeaveRpnGroupRequest; +exports.RpnV1ApiListRpnCapableSanServersRequest = RpnV1ApiListRpnCapableSanServersRequest; +exports.RpnV1ApiListRpnCapableServersRequest = RpnV1ApiListRpnCapableServersRequest; +exports.RpnV1ApiListRpnGroupMembersRequest = RpnV1ApiListRpnGroupMembersRequest; +exports.RpnV1ApiListRpnGroupsRequest = RpnV1ApiListRpnGroupsRequest; +exports.RpnV1ApiListRpnInvitesRequest = RpnV1ApiListRpnInvitesRequest; +exports.RpnV1ApiRefuseRpnInviteRequest = RpnV1ApiRefuseRpnInviteRequest; +exports.RpnV1ApiRpnGroupInviteRequest = RpnV1ApiRpnGroupInviteRequest; +exports.RpnV1ApiUpdateRpnGroupNameRequest = RpnV1ApiUpdateRpnGroupNameRequest; +exports.RpnV2ApiAddRpnV2MembersRequest = RpnV2ApiAddRpnV2MembersRequest; +exports.RpnV2ApiDeleteRpnV2GroupRequest = RpnV2ApiDeleteRpnV2GroupRequest; +exports.RpnV2ApiDeleteRpnV2MembersRequest = RpnV2ApiDeleteRpnV2MembersRequest; +exports.RpnV2ApiDisableRpnV2GroupCompatibilityRequest = RpnV2ApiDisableRpnV2GroupCompatibilityRequest; +exports.RpnV2ApiEnableRpnV2GroupCompatibilityRequest = RpnV2ApiEnableRpnV2GroupCompatibilityRequest; +exports.RpnV2ApiGetRpnV2GroupRequest = RpnV2ApiGetRpnV2GroupRequest; +exports.RpnV2ApiListRpnV2CapableResourcesRequest = RpnV2ApiListRpnV2CapableResourcesRequest; +exports.RpnV2ApiListRpnV2GroupLogsRequest = RpnV2ApiListRpnV2GroupLogsRequest; +exports.RpnV2ApiListRpnV2GroupsRequest = RpnV2ApiListRpnV2GroupsRequest; +exports.RpnV2ApiListRpnV2MembersRequest = RpnV2ApiListRpnV2MembersRequest; +exports.RpnV2ApiUpdateRpnV2GroupNameRequest = RpnV2ApiUpdateRpnV2GroupNameRequest; +exports.RpnV2ApiUpdateRpnV2VlanForMembersRequest = RpnV2ApiUpdateRpnV2VlanForMembersRequest; +exports.StartRescueRequest = StartRescueRequest; +exports.StartServerRequest = StartServerRequest; +exports.StopBMCAccessRequest = StopBMCAccessRequest; +exports.StopRescueRequest = StopRescueRequest; +exports.StopServerRequest = StopServerRequest; +exports.SubscribeServerOptionRequest = SubscribeServerOptionRequest; +exports.SubscribeStorageOptionsRequest = SubscribeStorageOptionsRequest; +exports.UpdateRaidRequest = UpdateRaidRequest; +exports.UpdateReverseRequest = UpdateReverseRequest; +exports.UpdateServerBackupRequest = UpdateServerBackupRequest; +exports.UpdateServerRequest = UpdateServerRequest; +exports.UpdateServerTagsRequest = UpdateServerTagsRequest; + + +/***/ }), + +/***/ 390: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const index_gen = __nccwpck_require__(5813); +exports.v1beta1 = index_gen; + + +/***/ }), + +/***/ 6041: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const intervalRetrier = __nccwpck_require__(9052); +const api = __nccwpck_require__(3042); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const resourcePaginator = __nccwpck_require__(4983); +const content_gen = __nccwpck_require__(8182); +const marshalling_gen = __nccwpck_require__(9615); +const jsonContentHeaders = { + "Content-Type": "application/json; charset=utf-8" +}; +class API extends api.API { + /** Lists the available regions of the API. */ + static LOCALITIES = ["fr-par", "nl-ams", "pl-waw"]; + pageOfListDatabaseEngines = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/document-db/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/database-engines`, + urlParams: marshalling.urlParams( + ["name", request.name], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["version", request.version] + ) + }, + marshalling_gen.unmarshalListDatabaseEnginesResponse + ); + /** + * List available database engines. List the FerretDB database engines + * available at Scaleway. + * + * @param request - The request {@link ListDatabaseEnginesRequest} + * @returns A Promise of ListDatabaseEnginesResponse + */ + listDatabaseEngines = (request = {}) => resourcePaginator.enrichForPagination("engines", this.pageOfListDatabaseEngines, request); + pageOfListNodeTypes = (request) => this.client.fetch( + { + method: "GET", + path: `/document-db/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/node-types`, + urlParams: marshalling.urlParams( + ["include_disabled_types", request.includeDisabledTypes], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListNodeTypesResponse + ); + /** + * List available node types. List all available node types. By default, the + * node types returned in the list are ordered by creation date in ascending + * order, though this can be modified via the `order_by` field. + * + * @param request - The request {@link ListNodeTypesRequest} + * @returns A Promise of ListNodeTypesResponse + */ + listNodeTypes = (request) => resourcePaginator.enrichForPagination("nodeTypes", this.pageOfListNodeTypes, request); + /** + * Upgrade a Database Instance. Upgrade your current Database Instance + * specifications like node type, high availability, volume, or the database + * engine version. Note that upon upgrade the `enable_ha` parameter can only + * be set to `true`. + * + * @param request - The request {@link UpgradeInstanceRequest} + * @returns A Promise of Instance + */ + upgradeInstance = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpgradeInstanceRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/document-db/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/upgrade` + }, + marshalling_gen.unmarshalInstance + ); + pageOfListInstances = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/document-db/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances`, + urlParams: marshalling.urlParams( + ["name", request.name], + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId], + ["tags", request.tags] + ) + }, + marshalling_gen.unmarshalListInstancesResponse + ); + /** + * List Database Instances. List all Database Instances in the specified + * region, for a given Scaleway Organization or Scaleway Project. By default, + * the Database Instances returned in the list are ordered by creation date in + * ascending order, though this can be modified via the order_by field. You + * can define additional parameters for your query, such as `tags` and `name`. + * For the `name` parameter, the value you include will be checked against the + * whole name string to see if it includes the string you put in the + * parameter. + * + * @param request - The request {@link ListInstancesRequest} + * @returns A Promise of ListInstancesResponse + */ + listInstances = (request = {}) => resourcePaginator.enrichForPagination("instances", this.pageOfListInstances, request); + /** + * Get a Database Instance. Retrieve information about a given Database + * Instance, specified by the `region` and `instance_id` parameters. Its full + * details, including name, status, IP address and port, are returned in the + * response object. + * + * @param request - The request {@link GetInstanceRequest} + * @returns A Promise of Instance + */ + getInstance = (request) => this.client.fetch( + { + method: "GET", + path: `/document-db/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}` + }, + marshalling_gen.unmarshalInstance + ); + /** + * Waits for {@link Instance} to be in a final state. + * + * @param request - The request {@link GetInstanceRequest} + * @param options - The waiting options + * @returns A Promise of Instance + */ + waitForInstance = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve(!content_gen.INSTANCE_TRANSIENT_STATUSES.includes(res.status))), + this.getInstance, + request, + options + ); + /** * Create a Database Instance. Create a new Database Instance. You must set * the `engine`, `user_name`, `password` and `node_type` parameters. * Optionally, you can specify the volume type and size. * - * @param request - The request {@link CreateInstanceRequest} - * @returns A Promise of Instance + * @param request - The request {@link CreateInstanceRequest} + * @returns A Promise of Instance + */ + createInstance = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateInstanceRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/document-db/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances` + }, + marshalling_gen.unmarshalInstance + ); + /** + * Update a Database Instance. Update the parameters of a Database Instance, + * including name, tags and backup schedule details. + * + * @param request - The request {@link UpdateInstanceRequest} + * @returns A Promise of Instance + */ + updateInstance = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateInstanceRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/document-db/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}` + }, + marshalling_gen.unmarshalInstance + ); + /** + * Delete a Database Instance. Delete a given Database Instance, specified by + * the `region` and `instance_id` parameters. Deleting a Database Instance is + * permanent, and cannot be undone. Note that upon deletion all your data will + * be lost. + * + * @param request - The request {@link DeleteInstanceRequest} + * @returns A Promise of Instance + */ + deleteInstance = (request) => this.client.fetch( + { + method: "DELETE", + path: `/document-db/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}` + }, + marshalling_gen.unmarshalInstance + ); + /** + * Clone a Database Instance. Clone a given Database Instance, specified by + * the `region` and `instance_id` parameters. The clone feature allows you to + * create a new Database Instance from an existing one. The clone includes all + * existing databases, users and permissions. You can create a clone on a + * Database Instance bigger than your current one. + * + * @param request - The request {@link CloneInstanceRequest} + * @returns A Promise of Instance + */ + cloneInstance = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCloneInstanceRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/document-db/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/clone` + }, + marshalling_gen.unmarshalInstance + ); + /** + * Restart Database Instance. Restart a given Database Instance, specified by + * the `region` and `instance_id` parameters. The status of the Database + * Instance returned in the response. + * + * @param request - The request {@link RestartInstanceRequest} + * @returns A Promise of Instance + */ + restartInstance = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/document-db/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/restart` + }, + marshalling_gen.unmarshalInstance + ); + /** + * Get the TLS certificate of a Database Instance. Retrieve information about + * the TLS certificate of a given Database Instance. Details like name and + * content are returned in the response. + * + * @param request - The request {@link GetInstanceCertificateRequest} + * @returns A Promise of Blob + */ + getInstanceCertificate = (request) => this.client.fetch({ + method: "GET", + path: `/document-db/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/certificate`, + urlParams: marshalling.urlParams(["dl", 1]), + responseType: "blob" + }); + /** + * Renew the TLS certificate of a Database Instance. Renew a TLS for a + * Database Instance. Renewing a certificate means that you will not be able + * to connect to your Database Instance using the previous certificate. You + * will also need to download and update the new certificate for all database + * clients. + * + * @param request - The request {@link RenewInstanceCertificateRequest} + */ + renewInstanceCertificate = (request) => this.client.fetch({ + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/document-db/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/renew-certificate` + }); + /** + * Get Database Instance metrics. Retrieve the time series metrics of a given + * Database Instance. You can define the period from which to retrieve metrics + * by specifying the `start_date` and `end_date`. + * + * @param request - The request {@link GetInstanceMetricsRequest} + * @returns A Promise of InstanceMetrics + */ + getInstanceMetrics = (request) => this.client.fetch( + { + method: "GET", + path: `/document-db/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/metrics`, + urlParams: marshalling.urlParams( + ["end_date", request.endDate], + ["metric_name", request.metricName], + ["start_date", request.startDate] + ) + }, + marshalling_gen.unmarshalInstanceMetrics + ); + /** + * Create a Read Replica. Create a new Read Replica of a Database Instance. + * You must specify the `region` and the `instance_id`. You can only create a + * maximum of 3 Read Replicas per Database Instance. + * + * @param request - The request {@link CreateReadReplicaRequest} + * @returns A Promise of ReadReplica + */ + createReadReplica = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateReadReplicaRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/document-db/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/read-replicas` + }, + marshalling_gen.unmarshalReadReplica + ); + /** + * Get a Read Replica. Retrieve information about a Database Instance Read + * Replica. Full details about the Read Replica, like `endpoints`, `status` + * and `region` are returned in the response. + * + * @param request - The request {@link GetReadReplicaRequest} + * @returns A Promise of ReadReplica + */ + getReadReplica = (request) => this.client.fetch( + { + method: "GET", + path: `/document-db/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/read-replicas/${marshalling.validatePathParam("readReplicaId", request.readReplicaId)}` + }, + marshalling_gen.unmarshalReadReplica + ); + /** + * Waits for {@link ReadReplica} to be in a final state. + * + * @param request - The request {@link GetReadReplicaRequest} + * @param options - The waiting options + * @returns A Promise of ReadReplica + */ + waitForReadReplica = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve( + !content_gen.READ_REPLICA_TRANSIENT_STATUSES.includes(res.status) + )), + this.getReadReplica, + request, + options + ); + /** + * Delete a Read Replica. Delete a Read Replica of a Database Instance. You + * must specify the `region` and `read_replica_id` parameters of the Read + * Replica you want to delete. + * + * @param request - The request {@link DeleteReadReplicaRequest} + * @returns A Promise of ReadReplica + */ + deleteReadReplica = (request) => this.client.fetch( + { + method: "DELETE", + path: `/document-db/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/read-replicas/${marshalling.validatePathParam("readReplicaId", request.readReplicaId)}` + }, + marshalling_gen.unmarshalReadReplica + ); + /** + * Resync a Read Replica. When you resync a Read Replica, first it is reset, + * then its data is resynchronized from the primary node. Your Read Replica + * remains unavailable during the resync process. The duration of this process + * is proportional to the size of your Database Instance. The configured + * endpoints do not change. + * + * @param request - The request {@link ResetReadReplicaRequest} + * @returns A Promise of ReadReplica + */ + resetReadReplica = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/document-db/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/read-replicas/${marshalling.validatePathParam("readReplicaId", request.readReplicaId)}/reset` + }, + marshalling_gen.unmarshalReadReplica + ); + /** + * Promote a Read Replica. Promote a Read Replica to Database Instance + * automatically. + * + * @param request - The request {@link PromoteReadReplicaRequest} + * @returns A Promise of Instance + */ + promoteReadReplica = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/document-db/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/read-replicas/${marshalling.validatePathParam("readReplicaId", request.readReplicaId)}/promote` + }, + marshalling_gen.unmarshalInstance + ); + /** + * Create an endpoint for a Read Replica. Create a new endpoint for a Read + * Replica. Read Replicas can have at most one direct access and one Private + * Network endpoint. + * + * @param request - The request {@link CreateReadReplicaEndpointRequest} + * @returns A Promise of ReadReplica + */ + createReadReplicaEndpoint = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateReadReplicaEndpointRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/document-db/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/read-replicas/${marshalling.validatePathParam("readReplicaId", request.readReplicaId)}/endpoints` + }, + marshalling_gen.unmarshalReadReplica + ); + /** + * List available logs of a Database Instance. List the available logs of a + * Database Instance. By default, the logs returned in the list are ordered by + * creation date in ascending order, though this can be modified via the + * order_by field. + * + * @param request - The request {@link ListInstanceLogsRequest} + * @returns A Promise of ListInstanceLogsResponse + */ + listInstanceLogs = (request) => this.client.fetch( + { + method: "GET", + path: `/document-db/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/logs`, + urlParams: marshalling.urlParams(["order_by", request.orderBy]) + }, + marshalling_gen.unmarshalListInstanceLogsResponse + ); + /** + * Get given logs of a Database Instance. Retrieve information about the logs + * of a Database Instance. Specify the `instance_log_id` and `region` in your + * request to get information such as `download_url`, `status`, `expires_at` + * and `created_at` about your logs in the response. + * + * @param request - The request {@link GetInstanceLogRequest} + * @returns A Promise of InstanceLog + */ + getInstanceLog = (request) => this.client.fetch( + { + method: "GET", + path: `/document-db/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/logs/${marshalling.validatePathParam("instanceLogId", request.instanceLogId)}` + }, + marshalling_gen.unmarshalInstanceLog + ); + /** + * Waits for {@link InstanceLog} to be in a final state. + * + * @param request - The request {@link GetInstanceLogRequest} + * @param options - The waiting options + * @returns A Promise of InstanceLog + */ + waitForInstanceLog = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve( + !content_gen.INSTANCE_LOG_TRANSIENT_STATUSES.includes(res.status) + )), + this.getInstanceLog, + request, + options + ); + /** + * Purge remote Database Instance logs. Purge a given remote log from a + * Database Instance. You can specify the `log_name` of the log you wish to + * clean from your Database Instance. + * + * @param request - The request {@link PurgeInstanceLogsRequest} + */ + purgeInstanceLogs = (request) => this.client.fetch({ + body: JSON.stringify( + marshalling_gen.marshalPurgeInstanceLogsRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/document-db/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/purge-logs` + }); + /** + * List remote Database Instance logs details. List remote log details. By + * default, the details returned in the list are ordered by creation date in + * ascending order, though this can be modified via the order_by field. + * + * @param request - The request {@link ListInstanceLogsDetailsRequest} + * @returns A Promise of ListInstanceLogsDetailsResponse + */ + listInstanceLogsDetails = (request) => this.client.fetch( + { + method: "GET", + path: `/document-db/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/logs-details` + }, + marshalling_gen.unmarshalListInstanceLogsDetailsResponse + ); + /** + * Add Database Instance advanced settings. Add an advanced setting to a + * Database Instance. You must set the `name` and the `value` of each + * setting. + * + * @param request - The request {@link AddInstanceSettingsRequest} + * @returns A Promise of AddInstanceSettingsResponse + */ + addInstanceSettings = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalAddInstanceSettingsRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/document-db/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/settings` + }, + marshalling_gen.unmarshalAddInstanceSettingsResponse + ); + /** + * Delete Database Instance advanced settings. Delete an advanced setting in a + * Database Instance. You must specify the names of the settings you want to + * delete in the request. + * + * @param request - The request {@link DeleteInstanceSettingsRequest} + * @returns A Promise of DeleteInstanceSettingsResponse + */ + deleteInstanceSettings = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalDeleteInstanceSettingsRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "DELETE", + path: `/document-db/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/settings` + }, + marshalling_gen.unmarshalDeleteInstanceSettingsResponse + ); + /** + * Set Database Instance advanced settings. Update an advanced setting for a + * Database Instance. Settings added upon database engine initalization can + * only be defined once, and cannot, therefore, be updated. + * + * @param request - The request {@link SetInstanceSettingsRequest} + * @returns A Promise of SetInstanceSettingsResponse + */ + setInstanceSettings = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalSetInstanceSettingsRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PUT", + path: `/document-db/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/settings` + }, + marshalling_gen.unmarshalSetInstanceSettingsResponse + ); + pageOfListInstanceACLRules = (request) => this.client.fetch( + { + method: "GET", + path: `/document-db/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/acls`, + urlParams: marshalling.urlParams( + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListInstanceACLRulesResponse + ); + /** + * List ACL rules of a Database Instance. List the ACL rules for a given + * Database Instance. The response is an array of ACL objects, each one + * representing an ACL that denies, allows or redirects traffic based on + * certain conditions. + * + * @param request - The request {@link ListInstanceACLRulesRequest} + * @returns A Promise of ListInstanceACLRulesResponse + */ + listInstanceACLRules = (request) => resourcePaginator.enrichForPagination("rules", this.pageOfListInstanceACLRules, request); + /** + * Add an ACL rule to a Database Instance. Add an additional ACL rule to a + * Database Instance. + * + * @param request - The request {@link AddInstanceACLRulesRequest} + * @returns A Promise of AddInstanceACLRulesResponse + */ + addInstanceACLRules = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalAddInstanceACLRulesRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/document-db/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/acls` + }, + marshalling_gen.unmarshalAddInstanceACLRulesResponse + ); + /** + * Set ACL rules for a Database Instance. Replace all the ACL rules of a + * Database Instance. + * + * @param request - The request {@link SetInstanceACLRulesRequest} + * @returns A Promise of SetInstanceACLRulesResponse + */ + setInstanceACLRules = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalSetInstanceACLRulesRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PUT", + path: `/document-db/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/acls` + }, + marshalling_gen.unmarshalSetInstanceACLRulesResponse + ); + /** + * Delete ACL rules of a Database Instance. Delete one or more ACL rules of a + * Database Instance. + * + * @param request - The request {@link DeleteInstanceACLRulesRequest} + * @returns A Promise of DeleteInstanceACLRulesResponse + */ + deleteInstanceACLRules = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalDeleteInstanceACLRulesRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "DELETE", + path: `/document-db/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/acls` + }, + marshalling_gen.unmarshalDeleteInstanceACLRulesResponse + ); + pageOfListUsers = (request) => this.client.fetch( + { + method: "GET", + path: `/document-db/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/users`, + urlParams: marshalling.urlParams( + ["name", request.name], + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListUsersResponse + ); + /** + * List users of a Database Instance. List all users of a given Database + * Instance. By default, the users returned in the list are ordered by + * creation date in ascending order, though this can be modified via the + * order_by field. + * + * @param request - The request {@link ListUsersRequest} + * @returns A Promise of ListUsersResponse + */ + listUsers = (request) => resourcePaginator.enrichForPagination("users", this.pageOfListUsers, request); + /** + * Create a user for a Database Instance. Create a new user for a Database + * Instance. You must define the `name`, `password` and `is_admin` + * parameters. + * + * @param request - The request {@link CreateUserRequest} + * @returns A Promise of User + */ + createUser = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateUserRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/document-db/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/users` + }, + marshalling_gen.unmarshalUser + ); + /** + * Update a user on a Database Instance. Update the parameters of a user on a + * Database Instance. You can update the `password` and `is_admin` parameters, + * but you cannot change the name of the user. + * + * @param request - The request {@link UpdateUserRequest} + * @returns A Promise of User + */ + updateUser = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateUserRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/document-db/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/users/${marshalling.validatePathParam("name", request.name)}` + }, + marshalling_gen.unmarshalUser + ); + /** + * Delete a user on a Database Instance. Delete a given user on a Database + * Instance. You must specify, in the endpoint, the `region`, `instance_id` + * and `name` parameters of the user you want to delete. + * + * @param request - The request {@link DeleteUserRequest} + */ + deleteUser = (request) => this.client.fetch({ + method: "DELETE", + path: `/document-db/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/users/${marshalling.validatePathParam("name", request.name)}` + }); + pageOfListDatabases = (request) => this.client.fetch( + { + method: "GET", + path: `/document-db/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/databases`, + urlParams: marshalling.urlParams( + ["managed", request.managed], + ["name", request.name], + ["order_by", request.orderBy], + ["owner", request.owner], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListDatabasesResponse + ); + /** + * List databases in a Database Instance. List all databases of a given + * Database Instance. By default, the databases returned in the list are + * ordered by creation date in ascending order, though this can be modified + * via the order_by field. You can define additional parameters for your + * query, such as `name`, `managed` and `owner`. + * + * @param request - The request {@link ListDatabasesRequest} + * @returns A Promise of ListDatabasesResponse + */ + listDatabases = (request) => resourcePaginator.enrichForPagination("databases", this.pageOfListDatabases, request); + /** + * Create a database in a Database Instance. Create a new database. You must + * define the `name` parameter in the request. + * + * @param request - The request {@link CreateDatabaseRequest} + * @returns A Promise of Database + */ + createDatabase = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateDatabaseRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/document-db/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/databases` + }, + marshalling_gen.unmarshalDatabase + ); + /** + * Delete a database in a Database Instance. Delete a given database on a + * Database Instance. You must specify, in the endpoint, the `region`, + * `instance_id` and `name` parameters of the database you want to delete. + * + * @param request - The request {@link DeleteDatabaseRequest} + */ + deleteDatabase = (request) => this.client.fetch({ + method: "DELETE", + path: `/document-db/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/databases/${marshalling.validatePathParam("name", request.name)}` + }); + pageOfListPrivileges = (request) => this.client.fetch( + { + method: "GET", + path: `/document-db/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/privileges`, + urlParams: marshalling.urlParams( + ["database_name", request.databaseName], + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["user_name", request.userName] + ) + }, + marshalling_gen.unmarshalListPrivilegesResponse + ); + /** + * List user privileges for a database. List privileges of a user on a + * database. By default, the details returned in the list are ordered by + * creation date in ascending order, though this can be modified via the + * order_by field. You can define additional parameters for your query, such + * as `database_name` and `user_name`. + * + * @param request - The request {@link ListPrivilegesRequest} + * @returns A Promise of ListPrivilegesResponse + */ + listPrivileges = (request) => resourcePaginator.enrichForPagination("privileges", this.pageOfListPrivileges, request); + /** + * Set user privileges for a database. Set the privileges of a user on a + * database. You must define `database_name`, `user_name` and `permission` in + * the request body. + * + * @param request - The request {@link SetPrivilegeRequest} + * @returns A Promise of Privilege + */ + setPrivilege = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalSetPrivilegeRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PUT", + path: `/document-db/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/privileges` + }, + marshalling_gen.unmarshalPrivilege + ); + pageOfListSnapshots = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/document-db/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/snapshots`, + urlParams: marshalling.urlParams( + ["instance_id", request.instanceId], + ["name", request.name], + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId] + ) + }, + marshalling_gen.unmarshalListSnapshotsResponse + ); + /** + * List snapshots. List snapshots. You can include the `instance_id` or + * `project_id` in your query to get the list of snapshots for specific + * Database Instances and/or Projects. By default, the details returned in the + * list are ordered by creation date in ascending order, though this can be + * modified via the `order_by` field. + * + * @param request - The request {@link ListSnapshotsRequest} + * @returns A Promise of ListSnapshotsResponse + */ + listSnapshots = (request = {}) => resourcePaginator.enrichForPagination("snapshots", this.pageOfListSnapshots, request); + /** + * Get a Database Instance snapshot. Retrieve information about a given + * snapshot, specified by its `snapshot_id` and `region`. Full details about + * the snapshot, like size and expiration date, are returned in the response. + * + * @param request - The request {@link GetSnapshotRequest} + * @returns A Promise of Snapshot + */ + getSnapshot = (request) => this.client.fetch( + { + method: "GET", + path: `/document-db/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/snapshots/${marshalling.validatePathParam("snapshotId", request.snapshotId)}` + }, + marshalling_gen.unmarshalSnapshot + ); + /** + * Waits for {@link Snapshot} to be in a final state. + * + * @param request - The request {@link GetSnapshotRequest} + * @param options - The waiting options + * @returns A Promise of Snapshot + */ + waitForSnapshot = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve(!content_gen.SNAPSHOT_TRANSIENT_STATUSES.includes(res.status))), + this.getSnapshot, + request, + options + ); + /** + * Create a Database Instance snapshot. Create a new snapshot of a Database + * Instance. You must define the `name` parameter in the request. + * + * @param request - The request {@link CreateSnapshotRequest} + * @returns A Promise of Snapshot + */ + createSnapshot = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateSnapshotRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/document-db/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/snapshots` + }, + marshalling_gen.unmarshalSnapshot + ); + /** + * Update a Database Instance snapshot. Update the parameters of a snapshot of + * a Database Instance. You can update the `name` and `expires_at` + * parameters. + * + * @param request - The request {@link UpdateSnapshotRequest} + * @returns A Promise of Snapshot + */ + updateSnapshot = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateSnapshotRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/document-db/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/snapshots/${marshalling.validatePathParam("snapshotId", request.snapshotId)}` + }, + marshalling_gen.unmarshalSnapshot + ); + /** + * Delete a Database Instance snapshot. Delete a given snapshot of a Database + * Instance. You must specify, in the endpoint, the `region` and `snapshot_id` + * parameters of the snapshot you want to delete. + * + * @param request - The request {@link DeleteSnapshotRequest} + * @returns A Promise of Snapshot + */ + deleteSnapshot = (request) => this.client.fetch( + { + method: "DELETE", + path: `/document-db/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/snapshots/${marshalling.validatePathParam("snapshotId", request.snapshotId)}` + }, + marshalling_gen.unmarshalSnapshot + ); + /** + * Create a new Database Instance from a snapshot. Restore a snapshot. When + * you restore a snapshot, a new Instance is created and billed to your + * account. Note that is possible to select a larger node type for your new + * Database Instance. However, the Block volume size will be the same as the + * size of the restored snapshot. All Instance settings will be restored if + * you chose a node type with the same or more memory size than the initial + * Instance. Settings will be reset to the default if your node type has less + * memory. + * + * @param request - The request {@link CreateInstanceFromSnapshotRequest} + * @returns A Promise of Instance + */ + createInstanceFromSnapshot = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateInstanceFromSnapshotRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/document-db/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/snapshots/${marshalling.validatePathParam("snapshotId", request.snapshotId)}/create-instance` + }, + marshalling_gen.unmarshalInstance + ); + /** + * Create a new Database Instance endpoint. Create a new endpoint for a + * Database Instance. You can add `load_balancer` and `private_network` + * specifications to the body of the request. + * + * @param request - The request {@link CreateEndpointRequest} + * @returns A Promise of Endpoint + */ + createEndpoint = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateEndpointRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/document-db/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/endpoints` + }, + marshalling_gen.unmarshalEndpoint + ); + /** + * Delete a Database Instance endpoint. Delete the endpoint of a Database + * Instance. You must specify the `region` and `endpoint_id` parameters of the + * endpoint you want to delete. Note that might need to update any environment + * configurations that point to the deleted endpoint. + * + * @param request - The request {@link DeleteEndpointRequest} + */ + deleteEndpoint = (request) => this.client.fetch({ + method: "DELETE", + path: `/document-db/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/endpoints/${marshalling.validatePathParam("endpointId", request.endpointId)}` + }); + /** + * Get a Database Instance endpoint. Retrieve information about a Database + * Instance endpoint. Full details about the endpoint, like `ip`, `port`, + * `private_network` and `load_balancer` specifications are returned in the + * response. + * + * @param request - The request {@link GetEndpointRequest} + * @returns A Promise of Endpoint + */ + getEndpoint = (request) => this.client.fetch( + { + method: "GET", + path: `/document-db/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/endpoints/${marshalling.validatePathParam("endpointId", request.endpointId)}` + }, + marshalling_gen.unmarshalEndpoint + ); + /** + * Migrate Database Instance endpoint. Migrate an existing Database Instance + * endpoint to another Database Instance. + * + * @param request - The request {@link MigrateEndpointRequest} + * @returns A Promise of Endpoint + */ + migrateEndpoint = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalMigrateEndpointRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/document-db/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/endpoints/${marshalling.validatePathParam("endpointId", request.endpointId)}/migrate` + }, + marshalling_gen.unmarshalEndpoint + ); + /** + * Apply an instance maintenance. Apply a pending instance maintenance on your + * instance. This action can generate some service interruption. + * + * @param request - The request {@link ApplyInstanceMaintenanceRequest} + * @returns A Promise of Maintenance + */ + applyInstanceMaintenance = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/document-db/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/apply-maintenance` + }, + marshalling_gen.unmarshalMaintenance + ); +} +exports.API = API; + + +/***/ }), + +/***/ 8182: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const INSTANCE_LOG_TRANSIENT_STATUSES = ["creating"]; +const INSTANCE_TRANSIENT_STATUSES = [ + "provisioning", + "configuring", + "deleting", + "autohealing", + "initializing", + "backuping", + "snapshotting", + "restarting" +]; +const MAINTENANCE_TRANSIENT_STATUSES = ["ongoing"]; +const READ_REPLICA_TRANSIENT_STATUSES = [ + "provisioning", + "initializing", + "deleting", + "configuring", + "promoting" +]; +const SNAPSHOT_TRANSIENT_STATUSES = [ + "creating", + "restoring", + "deleting" +]; +exports.INSTANCE_LOG_TRANSIENT_STATUSES = INSTANCE_LOG_TRANSIENT_STATUSES; +exports.INSTANCE_TRANSIENT_STATUSES = INSTANCE_TRANSIENT_STATUSES; +exports.MAINTENANCE_TRANSIENT_STATUSES = MAINTENANCE_TRANSIENT_STATUSES; +exports.READ_REPLICA_TRANSIENT_STATUSES = READ_REPLICA_TRANSIENT_STATUSES; +exports.SNAPSHOT_TRANSIENT_STATUSES = SNAPSHOT_TRANSIENT_STATUSES; + + +/***/ }), + +/***/ 5813: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api_gen = __nccwpck_require__(6041); +const content_gen = __nccwpck_require__(8182); +const validationRules_gen = __nccwpck_require__(6940); +exports.API = api_gen.API; +exports.INSTANCE_LOG_TRANSIENT_STATUSES = content_gen.INSTANCE_LOG_TRANSIENT_STATUSES; +exports.INSTANCE_TRANSIENT_STATUSES = content_gen.INSTANCE_TRANSIENT_STATUSES; +exports.MAINTENANCE_TRANSIENT_STATUSES = content_gen.MAINTENANCE_TRANSIENT_STATUSES; +exports.READ_REPLICA_TRANSIENT_STATUSES = content_gen.READ_REPLICA_TRANSIENT_STATUSES; +exports.SNAPSHOT_TRANSIENT_STATUSES = content_gen.SNAPSHOT_TRANSIENT_STATUSES; +exports.ValidationRules = validationRules_gen; + + +/***/ }), + +/***/ 9615: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const randomName = __nccwpck_require__(8141); +const json = __nccwpck_require__(3746); +const customMarshalling = __nccwpck_require__(7586); +const marshalling = __nccwpck_require__(1162); +const unmarshalEndpointDirectAccessDetails = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'EndpointDirectAccessDetails' failed as data isn't a dictionary.` + ); + } + return {}; +}; +const unmarshalEndpointLoadBalancerDetails = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'EndpointLoadBalancerDetails' failed as data isn't a dictionary.` + ); + } + return {}; +}; +const unmarshalEndpointPrivateNetworkDetails = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'EndpointPrivateNetworkDetails' failed as data isn't a dictionary.` + ); + } + return { + privateNetworkId: data.private_network_id, + serviceIp: data.service_ip, + zone: data.zone + }; +}; +const unmarshalEndpoint = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Endpoint' failed as data isn't a dictionary.` + ); + } + return { + directAccess: data.direct_access ? unmarshalEndpointDirectAccessDetails(data.direct_access) : void 0, + hostname: data.hostname, + id: data.id, + ip: data.ip, + loadBalancer: data.load_balancer ? unmarshalEndpointLoadBalancerDetails(data.load_balancer) : void 0, + name: data.name, + port: data.port, + privateNetwork: data.private_network ? unmarshalEndpointPrivateNetworkDetails(data.private_network) : void 0 + }; +}; +const unmarshalMaintenance = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Maintenance' failed as data isn't a dictionary.` + ); + } + return { + closedAt: marshalling.unmarshalDate(data.closed_at), + forcedAt: marshalling.unmarshalDate(data.forced_at), + reason: data.reason, + startsAt: marshalling.unmarshalDate(data.starts_at), + status: data.status, + stopsAt: marshalling.unmarshalDate(data.stops_at) + }; +}; +const unmarshalReadReplica = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ReadReplica' failed as data isn't a dictionary.` + ); + } + return { + endpoints: marshalling.unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint), + id: data.id, + region: data.region, + sameZone: data.same_zone, + status: data.status + }; +}; +const unmarshalDatabase = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Database' failed as data isn't a dictionary.` + ); + } + return { + managed: data.managed, + name: data.name, + owner: data.owner, + size: data.size + }; +}; +const unmarshalInstanceLog = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'InstanceLog' failed as data isn't a dictionary.` + ); + } + return { + createdAt: marshalling.unmarshalDate(data.created_at), + downloadUrl: data.download_url, + expiresAt: marshalling.unmarshalDate(data.expires_at), + id: data.id, + nodeName: data.node_name, + region: data.region, + status: data.status + }; +}; +const unmarshalBackupSchedule = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'BackupSchedule' failed as data isn't a dictionary.` + ); + } + return { + disabled: data.disabled, + frequency: data.frequency, + nextRunAt: marshalling.unmarshalDate(data.next_run_at), + retention: data.retention + }; +}; +const unmarshalInstanceSetting = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'InstanceSetting' failed as data isn't a dictionary.` + ); + } + return { + name: data.name, + value: data.value + }; +}; +const unmarshalLogsPolicy = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'LogsPolicy' failed as data isn't a dictionary.` + ); + } + return { + maxAgeRetention: data.max_age_retention, + totalDiskRetention: data.total_disk_retention + }; +}; +const unmarshalUpgradableVersion = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'UpgradableVersion' failed as data isn't a dictionary.` + ); + } + return { + id: data.id, + minorVersion: data.minor_version, + name: data.name, + version: data.version + }; +}; +const unmarshalVolume = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Volume' failed as data isn't a dictionary.` + ); + } + return { + class: data.class, + size: data.size, + type: data.type + }; +}; +const unmarshalInstance = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Instance' failed as data isn't a dictionary.` + ); + } + return { + backupSameRegion: data.backup_same_region, + backupSchedule: data.backup_schedule ? unmarshalBackupSchedule(data.backup_schedule) : void 0, + createdAt: marshalling.unmarshalDate(data.created_at), + endpoint: data.endpoint ? unmarshalEndpoint(data.endpoint) : void 0, + endpoints: marshalling.unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint), + engine: data.engine, + id: data.id, + initSettings: marshalling.unmarshalArrayOfObject( + data.init_settings, + unmarshalInstanceSetting + ), + isHaCluster: data.is_ha_cluster, + logsPolicy: data.logs_policy ? unmarshalLogsPolicy(data.logs_policy) : void 0, + maintenances: marshalling.unmarshalArrayOfObject( + data.maintenances, + unmarshalMaintenance + ), + name: data.name, + nodeType: data.node_type, + organizationId: data.organization_id, + projectId: data.project_id, + readReplicas: marshalling.unmarshalArrayOfObject( + data.read_replicas, + unmarshalReadReplica + ), + region: data.region, + settings: marshalling.unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting), + status: data.status, + tags: data.tags, + upgradableVersion: marshalling.unmarshalArrayOfObject( + data.upgradable_version, + unmarshalUpgradableVersion + ), + volume: data.volume ? unmarshalVolume(data.volume) : void 0 + }; +}; +const unmarshalPrivilege = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Privilege' failed as data isn't a dictionary.` + ); + } + return { + databaseName: data.database_name, + permission: data.permission, + userName: data.user_name + }; +}; +const unmarshalSnapshotVolumeType = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SnapshotVolumeType' failed as data isn't a dictionary.` + ); + } + return { + class: data.class, + type: data.type + }; +}; +const unmarshalSnapshot = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Snapshot' failed as data isn't a dictionary.` + ); + } + return { + createdAt: marshalling.unmarshalDate(data.created_at), + expiresAt: marshalling.unmarshalDate(data.expires_at), + id: data.id, + instanceId: data.instance_id, + instanceName: data.instance_name, + name: data.name, + nodeType: data.node_type, + region: data.region, + size: data.size, + status: data.status, + updatedAt: marshalling.unmarshalDate(data.updated_at), + volumeType: data.volume_type ? unmarshalSnapshotVolumeType(data.volume_type) : void 0 + }; +}; +const unmarshalUser = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'User' failed as data isn't a dictionary.` + ); + } + return { + isAdmin: data.is_admin, + name: data.name + }; +}; +const unmarshalACLRule = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ACLRule' failed as data isn't a dictionary.` + ); + } + return { + action: data.action, + description: data.description, + direction: data.direction, + ip: data.ip, + port: data.port, + protocol: data.protocol + }; +}; +const unmarshalAddInstanceACLRulesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'AddInstanceACLRulesResponse' failed as data isn't a dictionary.` + ); + } + return { + rules: marshalling.unmarshalArrayOfObject(data.rules, unmarshalACLRule) + }; +}; +const unmarshalAddInstanceSettingsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'AddInstanceSettingsResponse' failed as data isn't a dictionary.` + ); + } + return { + settings: marshalling.unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting) + }; +}; +const unmarshalDeleteInstanceACLRulesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DeleteInstanceACLRulesResponse' failed as data isn't a dictionary.` + ); + } + return { + rules: marshalling.unmarshalArrayOfObject(data.rules, unmarshalACLRule) + }; +}; +const unmarshalDeleteInstanceSettingsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DeleteInstanceSettingsResponse' failed as data isn't a dictionary.` + ); + } + return { + settings: marshalling.unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting) + }; +}; +const unmarshalInstanceMetrics = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'InstanceMetrics' failed as data isn't a dictionary.` + ); + } + return { + timeseries: marshalling.unmarshalArrayOfObject(data.timeseries, customMarshalling.unmarshalTimeSeries) + }; +}; +const unmarshalEngineSetting = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'EngineSetting' failed as data isn't a dictionary.` + ); + } + return { + defaultValue: data.default_value, + description: data.description, + floatMax: data.float_max, + floatMin: data.float_min, + hotConfigurable: data.hot_configurable, + intMax: data.int_max, + intMin: data.int_min, + name: data.name, + propertyType: data.property_type, + stringConstraint: data.string_constraint, + unit: data.unit + }; +}; +const unmarshalEngineVersion = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'EngineVersion' failed as data isn't a dictionary.` + ); + } + return { + availableInitSettings: marshalling.unmarshalArrayOfObject( + data.available_init_settings, + unmarshalEngineSetting + ), + availableSettings: marshalling.unmarshalArrayOfObject( + data.available_settings, + unmarshalEngineSetting + ), + beta: data.beta, + disabled: data.disabled, + endOfLife: marshalling.unmarshalDate(data.end_of_life), + name: data.name, + version: data.version + }; +}; +const unmarshalDatabaseEngine = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DatabaseEngine' failed as data isn't a dictionary.` + ); + } + return { + logoUrl: data.logo_url, + name: data.name, + region: data.region, + versions: marshalling.unmarshalArrayOfObject(data.versions, unmarshalEngineVersion) + }; +}; +const unmarshalListDatabaseEnginesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListDatabaseEnginesResponse' failed as data isn't a dictionary.` + ); + } + return { + engines: marshalling.unmarshalArrayOfObject(data.engines, unmarshalDatabaseEngine), + totalCount: data.total_count + }; +}; +const unmarshalListDatabasesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListDatabasesResponse' failed as data isn't a dictionary.` + ); + } + return { + databases: marshalling.unmarshalArrayOfObject(data.databases, unmarshalDatabase), + totalCount: data.total_count + }; +}; +const unmarshalListInstanceACLRulesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListInstanceACLRulesResponse' failed as data isn't a dictionary.` + ); + } + return { + rules: marshalling.unmarshalArrayOfObject(data.rules, unmarshalACLRule), + totalCount: data.total_count + }; +}; +const unmarshalListInstanceLogsDetailsResponseInstanceLogDetail = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListInstanceLogsDetailsResponseInstanceLogDetail' failed as data isn't a dictionary.` + ); + } + return { + logName: data.log_name, + size: data.size + }; +}; +const unmarshalListInstanceLogsDetailsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListInstanceLogsDetailsResponse' failed as data isn't a dictionary.` + ); + } + return { + details: marshalling.unmarshalArrayOfObject( + data.details, + unmarshalListInstanceLogsDetailsResponseInstanceLogDetail + ) + }; +}; +const unmarshalListInstanceLogsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListInstanceLogsResponse' failed as data isn't a dictionary.` + ); + } + return { + instanceLogs: marshalling.unmarshalArrayOfObject( + data.instance_logs, + unmarshalInstanceLog + ) + }; +}; +const unmarshalListInstancesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListInstancesResponse' failed as data isn't a dictionary.` + ); + } + return { + instances: marshalling.unmarshalArrayOfObject(data.instances, unmarshalInstance), + totalCount: data.total_count + }; +}; +const unmarshalNodeTypeVolumeConstraintSizes = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'NodeTypeVolumeConstraintSizes' failed as data isn't a dictionary.` + ); + } + return { + maxSize: data.max_size, + minSize: data.min_size + }; +}; +const unmarshalNodeTypeVolumeType = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'NodeTypeVolumeType' failed as data isn't a dictionary.` + ); + } + return { + chunkSize: data.chunk_size, + class: data.class, + description: data.description, + maxSize: data.max_size, + minSize: data.min_size, + type: data.type + }; +}; +const unmarshalNodeType = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'NodeType' failed as data isn't a dictionary.` + ); + } + return { + availableVolumeTypes: marshalling.unmarshalArrayOfObject( + data.available_volume_types, + unmarshalNodeTypeVolumeType + ), + beta: data.beta, + description: data.description, + disabled: data.disabled, + generation: data.generation, + instanceRange: data.instance_range, + isBssdCompatible: data.is_bssd_compatible, + isHaRequired: data.is_ha_required, + memory: data.memory, + name: data.name, + region: data.region, + stockStatus: data.stock_status, + vcpus: data.vcpus, + volumeConstraint: data.volume_constraint ? unmarshalNodeTypeVolumeConstraintSizes(data.volume_constraint) : void 0 + }; +}; +const unmarshalListNodeTypesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListNodeTypesResponse' failed as data isn't a dictionary.` + ); + } + return { + nodeTypes: marshalling.unmarshalArrayOfObject(data.node_types, unmarshalNodeType), + totalCount: data.total_count + }; +}; +const unmarshalListPrivilegesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListPrivilegesResponse' failed as data isn't a dictionary.` + ); + } + return { + privileges: marshalling.unmarshalArrayOfObject(data.privileges, unmarshalPrivilege), + totalCount: data.total_count + }; +}; +const unmarshalListSnapshotsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListSnapshotsResponse' failed as data isn't a dictionary.` + ); + } + return { + snapshots: marshalling.unmarshalArrayOfObject(data.snapshots, unmarshalSnapshot), + totalCount: data.total_count + }; +}; +const unmarshalListUsersResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListUsersResponse' failed as data isn't a dictionary.` + ); + } + return { + totalCount: data.total_count, + users: marshalling.unmarshalArrayOfObject(data.users, unmarshalUser) + }; +}; +const unmarshalSetInstanceACLRulesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SetInstanceACLRulesResponse' failed as data isn't a dictionary.` + ); + } + return { + rules: marshalling.unmarshalArrayOfObject(data.rules, unmarshalACLRule) + }; +}; +const unmarshalSetInstanceSettingsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SetInstanceSettingsResponse' failed as data isn't a dictionary.` + ); + } + return { + settings: marshalling.unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting) + }; +}; +const marshalACLRuleRequest = (request, defaults) => ({ + description: request.description, + ip: request.ip +}); +const marshalAddInstanceACLRulesRequest = (request, defaults) => ({ + rules: request.rules.map((elt) => marshalACLRuleRequest(elt)) +}); +const marshalInstanceSetting = (request, defaults) => ({ + name: request.name, + value: request.value +}); +const marshalAddInstanceSettingsRequest = (request, defaults) => ({ + settings: request.settings.map((elt) => marshalInstanceSetting(elt)) +}); +const marshalCloneInstanceRequest = (request, defaults) => ({ + name: request.name, + node_type: request.nodeType +}); +const marshalCreateDatabaseRequest = (request, defaults) => ({ + name: request.name +}); +const marshalEndpointSpecPrivateNetworkIpamConfig = (request, defaults) => ({}); +const marshalEndpointSpecLoadBalancer = (request, defaults) => ({}); +const marshalEndpointSpecPrivateNetwork = (request, defaults) => ({ + private_network_id: request.privateNetworkId, + ...marshalling.resolveOneOf([ + { param: "service_ip", value: request.serviceIp }, + { + param: "ipam_config", + value: request.ipamConfig !== void 0 ? marshalEndpointSpecPrivateNetworkIpamConfig( + request.ipamConfig + ) : void 0 + } + ]) +}); +const marshalEndpointSpec = (request, defaults) => ({ + ...marshalling.resolveOneOf([ + { + param: "load_balancer", + value: request.loadBalancer !== void 0 ? marshalEndpointSpecLoadBalancer(request.loadBalancer) : void 0 + }, + { + param: "private_network", + value: request.privateNetwork !== void 0 ? marshalEndpointSpecPrivateNetwork(request.privateNetwork) : void 0 + } + ]) +}); +const marshalCreateEndpointRequest = (request, defaults) => ({ + endpoint_spec: request.endpointSpec !== void 0 ? marshalEndpointSpec(request.endpointSpec) : void 0 +}); +const marshalCreateInstanceFromSnapshotRequest = (request, defaults) => ({ + instance_name: request.instanceName, + is_ha_cluster: request.isHaCluster, + node_type: request.nodeType +}); +const marshalCreateInstanceRequest = (request, defaults) => ({ + backup_same_region: request.backupSameRegion, + disable_backup: request.disableBackup, + engine: request.engine, + init_endpoints: request.initEndpoints !== void 0 ? request.initEndpoints.map((elt) => marshalEndpointSpec(elt)) : void 0, + init_settings: request.initSettings !== void 0 ? request.initSettings.map((elt) => marshalInstanceSetting(elt)) : void 0, + is_ha_cluster: request.isHaCluster, + name: request.name || randomName("ins"), + node_type: request.nodeType, + password: request.password, + tags: request.tags, + user_name: request.userName, + volume_size: request.volumeSize, + volume_type: request.volumeType, + ...marshalling.resolveOneOf([ + { + default: defaults.defaultOrganizationId, + param: "organization_id", + value: request.organizationId + }, + { + default: defaults.defaultProjectId, + param: "project_id", + value: request.projectId + } + ]) +}); +const marshalReadReplicaEndpointSpecPrivateNetworkIpamConfig = (request, defaults) => ({}); +const marshalReadReplicaEndpointSpecDirectAccess = (request, defaults) => ({}); +const marshalReadReplicaEndpointSpecPrivateNetwork = (request, defaults) => ({ + private_network_id: request.privateNetworkId, + ...marshalling.resolveOneOf([ + { param: "service_ip", value: request.serviceIp }, + { + param: "ipam_config", + value: request.ipamConfig !== void 0 ? marshalReadReplicaEndpointSpecPrivateNetworkIpamConfig( + request.ipamConfig + ) : void 0 + } + ]) +}); +const marshalReadReplicaEndpointSpec = (request, defaults) => ({ + ...marshalling.resolveOneOf([ + { + param: "direct_access", + value: request.directAccess !== void 0 ? marshalReadReplicaEndpointSpecDirectAccess( + request.directAccess + ) : void 0 + }, + { + param: "private_network", + value: request.privateNetwork !== void 0 ? marshalReadReplicaEndpointSpecPrivateNetwork( + request.privateNetwork + ) : void 0 + } + ]) +}); +const marshalCreateReadReplicaEndpointRequest = (request, defaults) => ({ + endpoint_spec: request.endpointSpec.map( + (elt) => marshalReadReplicaEndpointSpec(elt) + ) +}); +const marshalCreateReadReplicaRequest = (request, defaults) => ({ + endpoint_spec: request.endpointSpec !== void 0 ? request.endpointSpec.map( + (elt) => marshalReadReplicaEndpointSpec(elt) + ) : void 0, + instance_id: request.instanceId, + same_zone: request.sameZone +}); +const marshalCreateSnapshotRequest = (request, defaults) => ({ + expires_at: request.expiresAt, + name: request.name || randomName("snp") +}); +const marshalCreateUserRequest = (request, defaults) => ({ + is_admin: request.isAdmin, + name: request.name, + password: request.password +}); +const marshalDeleteInstanceACLRulesRequest = (request, defaults) => ({ + acl_rule_ips: request.aclRuleIps +}); +const marshalDeleteInstanceSettingsRequest = (request, defaults) => ({ + setting_names: request.settingNames +}); +const marshalMigrateEndpointRequest = (request, defaults) => ({ + instance_id: request.instanceId +}); +const marshalPurgeInstanceLogsRequest = (request, defaults) => ({ + log_name: request.logName +}); +const marshalSetInstanceACLRulesRequest = (request, defaults) => ({ + rules: request.rules.map((elt) => marshalACLRuleRequest(elt)) +}); +const marshalSetInstanceSettingsRequest = (request, defaults) => ({ + settings: request.settings.map((elt) => marshalInstanceSetting(elt)) +}); +const marshalSetPrivilegeRequest = (request, defaults) => ({ + database_name: request.databaseName, + permission: request.permission, + user_name: request.userName +}); +const marshalLogsPolicy = (request, defaults) => ({ + max_age_retention: request.maxAgeRetention, + total_disk_retention: request.totalDiskRetention +}); +const marshalUpdateInstanceRequest = (request, defaults) => ({ + backup_same_region: request.backupSameRegion, + backup_schedule_frequency: request.backupScheduleFrequency, + backup_schedule_retention: request.backupScheduleRetention, + backup_schedule_start_hour: request.backupScheduleStartHour, + is_backup_schedule_disabled: request.isBackupScheduleDisabled, + logs_policy: request.logsPolicy !== void 0 ? marshalLogsPolicy(request.logsPolicy) : void 0, + name: request.name, + tags: request.tags +}); +const marshalUpdateSnapshotRequest = (request, defaults) => ({ + expires_at: request.expiresAt, + name: request.name +}); +const marshalUpdateUserRequest = (request, defaults) => ({ + is_admin: request.isAdmin, + password: request.password +}); +const marshalUpgradeInstanceRequestMajorUpgradeWorkflow = (request, defaults) => ({ + upgradable_version_id: request.upgradableVersionId, + with_endpoints: request.withEndpoints +}); +const marshalUpgradeInstanceRequest = (request, defaults) => ({ + ...marshalling.resolveOneOf([ + { param: "node_type", value: request.nodeType }, + { param: "enable_ha", value: request.enableHa }, + { param: "volume_size", value: request.volumeSize }, + { param: "volume_type", value: request.volumeType }, + { param: "upgradable_version_id", value: request.upgradableVersionId }, + { + param: "major_upgrade_workflow", + value: request.majorUpgradeWorkflow !== void 0 ? marshalUpgradeInstanceRequestMajorUpgradeWorkflow( + request.majorUpgradeWorkflow + ) : void 0 + } + ]) +}); +exports.marshalAddInstanceACLRulesRequest = marshalAddInstanceACLRulesRequest; +exports.marshalAddInstanceSettingsRequest = marshalAddInstanceSettingsRequest; +exports.marshalCloneInstanceRequest = marshalCloneInstanceRequest; +exports.marshalCreateDatabaseRequest = marshalCreateDatabaseRequest; +exports.marshalCreateEndpointRequest = marshalCreateEndpointRequest; +exports.marshalCreateInstanceFromSnapshotRequest = marshalCreateInstanceFromSnapshotRequest; +exports.marshalCreateInstanceRequest = marshalCreateInstanceRequest; +exports.marshalCreateReadReplicaEndpointRequest = marshalCreateReadReplicaEndpointRequest; +exports.marshalCreateReadReplicaRequest = marshalCreateReadReplicaRequest; +exports.marshalCreateSnapshotRequest = marshalCreateSnapshotRequest; +exports.marshalCreateUserRequest = marshalCreateUserRequest; +exports.marshalDeleteInstanceACLRulesRequest = marshalDeleteInstanceACLRulesRequest; +exports.marshalDeleteInstanceSettingsRequest = marshalDeleteInstanceSettingsRequest; +exports.marshalMigrateEndpointRequest = marshalMigrateEndpointRequest; +exports.marshalPurgeInstanceLogsRequest = marshalPurgeInstanceLogsRequest; +exports.marshalSetInstanceACLRulesRequest = marshalSetInstanceACLRulesRequest; +exports.marshalSetInstanceSettingsRequest = marshalSetInstanceSettingsRequest; +exports.marshalSetPrivilegeRequest = marshalSetPrivilegeRequest; +exports.marshalUpdateInstanceRequest = marshalUpdateInstanceRequest; +exports.marshalUpdateSnapshotRequest = marshalUpdateSnapshotRequest; +exports.marshalUpdateUserRequest = marshalUpdateUserRequest; +exports.marshalUpgradeInstanceRequest = marshalUpgradeInstanceRequest; +exports.unmarshalAddInstanceACLRulesResponse = unmarshalAddInstanceACLRulesResponse; +exports.unmarshalAddInstanceSettingsResponse = unmarshalAddInstanceSettingsResponse; +exports.unmarshalDatabase = unmarshalDatabase; +exports.unmarshalDeleteInstanceACLRulesResponse = unmarshalDeleteInstanceACLRulesResponse; +exports.unmarshalDeleteInstanceSettingsResponse = unmarshalDeleteInstanceSettingsResponse; +exports.unmarshalEndpoint = unmarshalEndpoint; +exports.unmarshalInstance = unmarshalInstance; +exports.unmarshalInstanceLog = unmarshalInstanceLog; +exports.unmarshalInstanceMetrics = unmarshalInstanceMetrics; +exports.unmarshalListDatabaseEnginesResponse = unmarshalListDatabaseEnginesResponse; +exports.unmarshalListDatabasesResponse = unmarshalListDatabasesResponse; +exports.unmarshalListInstanceACLRulesResponse = unmarshalListInstanceACLRulesResponse; +exports.unmarshalListInstanceLogsDetailsResponse = unmarshalListInstanceLogsDetailsResponse; +exports.unmarshalListInstanceLogsResponse = unmarshalListInstanceLogsResponse; +exports.unmarshalListInstancesResponse = unmarshalListInstancesResponse; +exports.unmarshalListNodeTypesResponse = unmarshalListNodeTypesResponse; +exports.unmarshalListPrivilegesResponse = unmarshalListPrivilegesResponse; +exports.unmarshalListSnapshotsResponse = unmarshalListSnapshotsResponse; +exports.unmarshalListUsersResponse = unmarshalListUsersResponse; +exports.unmarshalMaintenance = unmarshalMaintenance; +exports.unmarshalPrivilege = unmarshalPrivilege; +exports.unmarshalReadReplica = unmarshalReadReplica; +exports.unmarshalSetInstanceACLRulesResponse = unmarshalSetInstanceACLRulesResponse; +exports.unmarshalSetInstanceSettingsResponse = unmarshalSetInstanceSettingsResponse; +exports.unmarshalSnapshot = unmarshalSnapshot; +exports.unmarshalUser = unmarshalUser; + + +/***/ }), + +/***/ 6940: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const UpdateInstanceRequest = { + backupScheduleStartHour: { + lessThanOrEqual: 23 + } +}; +exports.UpdateInstanceRequest = UpdateInstanceRequest; + + +/***/ }), + +/***/ 3728: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const index_gen = __nccwpck_require__(2778); +exports.v2beta1 = index_gen; + + +/***/ }), + +/***/ 5378: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const intervalRetrier = __nccwpck_require__(9052); +const api = __nccwpck_require__(3042); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const resourcePaginator = __nccwpck_require__(4983); +const content_gen = __nccwpck_require__(7765); +const marshalling_gen = __nccwpck_require__(4244); +const jsonContentHeaders = { + "Content-Type": "application/json; charset=utf-8" +}; +class API extends api.API { + pageOfListDNSZones = (request) => this.client.fetch( + { + method: "GET", + path: `/domain/v2beta1/dns-zones`, + urlParams: marshalling.urlParams( + ["created_after", request.createdAfter], + ["created_before", request.createdBefore], + ["dns_zone", request.dnsZone], + ["dns_zones", request.dnsZones], + ["domain", request.domain], + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId], + ["updated_after", request.updatedAfter], + ["updated_before", request.updatedBefore] + ) + }, + marshalling_gen.unmarshalListDNSZonesResponse + ); + /** + * List DNS zones. Retrieve the list of DNS zones you can manage and filter + * DNS zones associated with specific domain names. + * + * @param request - The request {@link ListDNSZonesRequest} + * @returns A Promise of ListDNSZonesResponse + */ + listDNSZones = (request) => resourcePaginator.enrichForPagination("dnsZones", this.pageOfListDNSZones, request); + /** + * Create a DNS zone. Create a new DNS zone specified by the domain name, the + * subdomain and the Project ID. + * + * @param request - The request {@link CreateDNSZoneRequest} + * @returns A Promise of DNSZone + */ + createDNSZone = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateDNSZoneRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/domain/v2beta1/dns-zones` + }, + marshalling_gen.unmarshalDNSZone + ); + /** + * Update a DNS zone. Update the name and/or the Organizations for a DNS zone. + * + * @param request - The request {@link UpdateDNSZoneRequest} + * @returns A Promise of DNSZone + */ + updateDNSZone = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateDNSZoneRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/domain/v2beta1/dns-zones/${marshalling.validatePathParam("dnsZone", request.dnsZone)}` + }, + marshalling_gen.unmarshalDNSZone + ); + /** + * Clone a DNS zone. Clone an existing DNS zone with all its records into a + * new DNS zone. + * + * @param request - The request {@link CloneDNSZoneRequest} + * @returns A Promise of DNSZone + */ + cloneDNSZone = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCloneDNSZoneRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/domain/v2beta1/dns-zones/${marshalling.validatePathParam("dnsZone", request.dnsZone)}/clone` + }, + marshalling_gen.unmarshalDNSZone + ); + /** + * Delete a DNS zone. Delete a DNS zone and all its records. + * + * @param request - The request {@link DeleteDNSZoneRequest} + * @returns A Promise of DeleteDNSZoneResponse + */ + deleteDNSZone = (request) => this.client.fetch( + { + method: "DELETE", + path: `/domain/v2beta1/dns-zones/${marshalling.validatePathParam("dnsZone", request.dnsZone)}`, + urlParams: marshalling.urlParams([ + "project_id", + request.projectId ?? this.client.settings.defaultProjectId + ]) + }, + marshalling_gen.unmarshalDeleteDNSZoneResponse + ); + pageOfListDNSZoneRecords = (request) => this.client.fetch( + { + method: "GET", + path: `/domain/v2beta1/dns-zones/${marshalling.validatePathParam("dnsZone", request.dnsZone)}/records`, + urlParams: marshalling.urlParams( + ["id", request.id], + ["name", request.name], + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId], + ["type", request.type] + ) + }, + marshalling_gen.unmarshalListDNSZoneRecordsResponse + ); + /** + * List records within a DNS zone. Retrieve a list of DNS records within a DNS + * zone that has default name servers. You can filter records by type and + * name. + * + * @param request - The request {@link ListDNSZoneRecordsRequest} + * @returns A Promise of ListDNSZoneRecordsResponse + */ + listDNSZoneRecords = (request) => resourcePaginator.enrichForPagination("records", this.pageOfListDNSZoneRecords, request); + /** + * Update records within a DNS zone. Update records within a DNS zone that has + * default name servers and perform several actions on your records. + * + * Actions include: + * + * - Add: allows you to add a new record or add a new IP to an existing A + * record, for example + * - Set: allows you to edit a record or edit an IP from an existing A record, + * for example + * - Delete: allows you to delete a record or delete an IP from an existing A + * record, for example + * - Clear: allows you to delete all records from a DNS zone + * + * All edits will be versioned. + * + * @param request - The request {@link UpdateDNSZoneRecordsRequest} + * @returns A Promise of UpdateDNSZoneRecordsResponse + */ + updateDNSZoneRecords = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateDNSZoneRecordsRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/domain/v2beta1/dns-zones/${marshalling.validatePathParam("dnsZone", request.dnsZone)}/records` + }, + marshalling_gen.unmarshalUpdateDNSZoneRecordsResponse + ); + /** + * List name servers within a DNS zone. Retrieve a list of name servers within + * a DNS zone and their optional glue records. + * + * @param request - The request {@link ListDNSZoneNameserversRequest} + * @returns A Promise of ListDNSZoneNameserversResponse + */ + listDNSZoneNameservers = (request) => this.client.fetch( + { + method: "GET", + path: `/domain/v2beta1/dns-zones/${marshalling.validatePathParam("dnsZone", request.dnsZone)}/nameservers`, + urlParams: marshalling.urlParams(["project_id", request.projectId]) + }, + marshalling_gen.unmarshalListDNSZoneNameserversResponse + ); + /** + * Update name servers within a DNS zone. Update name servers within a DNS + * zone and set optional glue records. + * + * @param request - The request {@link UpdateDNSZoneNameserversRequest} + * @returns A Promise of UpdateDNSZoneNameserversResponse + */ + updateDNSZoneNameservers = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateDNSZoneNameserversRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PUT", + path: `/domain/v2beta1/dns-zones/${marshalling.validatePathParam("dnsZone", request.dnsZone)}/nameservers` + }, + marshalling_gen.unmarshalUpdateDNSZoneNameserversResponse + ); + /** + * Clear records within a DNS zone. Delete all records within a DNS zone that + * has default name servers.
All edits will be versioned. + * + * @param request - The request {@link ClearDNSZoneRecordsRequest} + * @returns A Promise of ClearDNSZoneRecordsResponse + */ + clearDNSZoneRecords = (request) => this.client.fetch( + { + method: "DELETE", + path: `/domain/v2beta1/dns-zones/${marshalling.validatePathParam("dnsZone", request.dnsZone)}/records` + }, + marshalling_gen.unmarshalClearDNSZoneRecordsResponse + ); + /** + * Export a raw DNS zone. Export a DNS zone with default name servers, in a + * specific format. + * + * @param request - The request {@link ExportRawDNSZoneRequest} + * @returns A Promise of Blob + */ + exportRawDNSZone = (request) => this.client.fetch({ + method: "GET", + path: `/domain/v2beta1/dns-zones/${marshalling.validatePathParam("dnsZone", request.dnsZone)}/raw`, + urlParams: marshalling.urlParams(["dl", 1], ["format", request.format]), + responseType: "blob" + }); + /** + * Import a raw DNS zone. Import and replace the format of records from a + * given provider, with default name servers. + * + * @param request - The request {@link ImportRawDNSZoneRequest} + * @returns A Promise of ImportRawDNSZoneResponse + */ + importRawDNSZone = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalImportRawDNSZoneRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/domain/v2beta1/dns-zones/${marshalling.validatePathParam("dnsZone", request.dnsZone)}/raw` + }, + marshalling_gen.unmarshalImportRawDNSZoneResponse + ); + /** + * Import a DNS zone from another provider. Import and replace the format of + * records from a given provider, with default name servers. + * + * @param request - The request {@link ImportProviderDNSZoneRequest} + * @returns A Promise of ImportProviderDNSZoneResponse + */ + importProviderDNSZone = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalImportProviderDNSZoneRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/domain/v2beta1/dns-zones/${marshalling.validatePathParam("dnsZone", request.dnsZone)}/import-provider` + }, + marshalling_gen.unmarshalImportProviderDNSZoneResponse + ); + /** + * Refresh a DNS zone. Refresh an SOA DNS zone to reload the records in the + * DNS zone and update the SOA serial. You can recreate the given DNS zone and + * its sub DNS zone if needed. + * + * @param request - The request {@link RefreshDNSZoneRequest} + * @returns A Promise of RefreshDNSZoneResponse + */ + refreshDNSZone = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalRefreshDNSZoneRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/domain/v2beta1/dns-zones/${marshalling.validatePathParam("dnsZone", request.dnsZone)}/refresh` + }, + marshalling_gen.unmarshalRefreshDNSZoneResponse + ); + pageOfListDNSZoneVersions = (request) => this.client.fetch( + { + method: "GET", + path: `/domain/v2beta1/dns-zones/${marshalling.validatePathParam("dnsZone", request.dnsZone)}/versions`, + urlParams: marshalling.urlParams( + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListDNSZoneVersionsResponse + ); + /** + * List versions of a DNS zone. Retrieve a list of a DNS zone's versions.
+ * The maximum version count is 100. If the count reaches this limit, the + * oldest version will be deleted after each new modification. + * + * @param request - The request {@link ListDNSZoneVersionsRequest} + * @returns A Promise of ListDNSZoneVersionsResponse + */ + listDNSZoneVersions = (request) => resourcePaginator.enrichForPagination("versions", this.pageOfListDNSZoneVersions, request); + pageOfListDNSZoneVersionRecords = (request) => this.client.fetch( + { + method: "GET", + path: `/domain/v2beta1/dns-zones/version/${marshalling.validatePathParam("dnsZoneVersionId", request.dnsZoneVersionId)}`, + urlParams: marshalling.urlParams( + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListDNSZoneVersionRecordsResponse + ); + /** + * List records from a given version of a specific DNS zone. Retrieve a list + * of records from a specific DNS zone version. + * + * @param request - The request {@link ListDNSZoneVersionRecordsRequest} + * @returns A Promise of ListDNSZoneVersionRecordsResponse + */ + listDNSZoneVersionRecords = (request) => resourcePaginator.enrichForPagination( + "records", + this.pageOfListDNSZoneVersionRecords, + request + ); + /** + * Access differences from a specific DNS zone version. Access a previous DNS + * zone version to see the differences from another specific version. + * + * @param request - The request {@link GetDNSZoneVersionDiffRequest} + * @returns A Promise of GetDNSZoneVersionDiffResponse + */ + getDNSZoneVersionDiff = (request) => this.client.fetch( + { + method: "GET", + path: `/domain/v2beta1/dns-zones/version/${marshalling.validatePathParam("dnsZoneVersionId", request.dnsZoneVersionId)}/diff` + }, + marshalling_gen.unmarshalGetDNSZoneVersionDiffResponse + ); + /** + * Restore a DNS zone version. Restore and activate a version of a specific + * DNS zone. + * + * @param request - The request {@link RestoreDNSZoneVersionRequest} + * @returns A Promise of RestoreDNSZoneVersionResponse + */ + restoreDNSZoneVersion = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/domain/v2beta1/dns-zones/version/${marshalling.validatePathParam("dnsZoneVersionId", request.dnsZoneVersionId)}/restore` + }, + marshalling_gen.unmarshalRestoreDNSZoneVersionResponse + ); + /** + * Get a DNS zone's TLS certificate. Get the DNS zone's TLS certificate. If + * you do not have a certificate, the ouptut returns `no certificate found`. + * + * @param request - The request {@link GetSSLCertificateRequest} + * @returns A Promise of SSLCertificate + */ + getSSLCertificate = (request) => this.client.fetch( + { + method: "GET", + path: `/domain/v2beta1/ssl-certificates/${marshalling.validatePathParam("dnsZone", request.dnsZone)}` + }, + marshalling_gen.unmarshalSSLCertificate + ); + /** + * Waits for {@link SSLCertificate} to be in a final state. + * + * @param request - The request {@link GetSSLCertificateRequest} + * @param options - The waiting options + * @returns A Promise of SSLCertificate + */ + waitForSSLCertificate = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve( + !content_gen.SSL_CERTIFICATE_TRANSIENT_STATUSES.includes(res.status) + )), + this.getSSLCertificate, + request, + options + ); + /** + * Create or get the DNS zone's TLS certificate. Create a new TLS certificate + * or retrieve information about an existing TLS certificate. + * + * @param request - The request {@link CreateSSLCertificateRequest} + * @returns A Promise of SSLCertificate + */ + createSSLCertificate = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateSSLCertificateRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/domain/v2beta1/ssl-certificates` + }, + marshalling_gen.unmarshalSSLCertificate + ); + pageOfListSSLCertificates = (request) => this.client.fetch( + { + method: "GET", + path: `/domain/v2beta1/ssl-certificates`, + urlParams: marshalling.urlParams( + ["dns_zone", request.dnsZone], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId] + ) + }, + marshalling_gen.unmarshalListSSLCertificatesResponse + ); + /** + * List a user's TLS certificates. List all the TLS certificates a user has + * created, specified by the user's Project ID and the DNS zone. + * + * @param request - The request {@link ListSSLCertificatesRequest} + * @returns A Promise of ListSSLCertificatesResponse + */ + listSSLCertificates = (request) => resourcePaginator.enrichForPagination("certificates", this.pageOfListSSLCertificates, request); + /** + * Delete a TLS certificate. Delete an existing TLS certificate specified by + * its DNS zone. Deleting a TLS certificate is permanent and cannot be + * undone. + * + * @param request - The request {@link DeleteSSLCertificateRequest} + * @returns A Promise of DeleteSSLCertificateResponse + */ + deleteSSLCertificate = (request) => this.client.fetch( + { + method: "DELETE", + path: `/domain/v2beta1/ssl-certificates/${marshalling.validatePathParam("dnsZone", request.dnsZone)}` + }, + marshalling_gen.unmarshalDeleteSSLCertificateResponse + ); + /** + * Get the DNS zone's TSIG key. Retrieve information about the TSIG key of a + * given DNS zone to allow AXFR requests. + * + * @param request - The request {@link GetDNSZoneTsigKeyRequest} + * @returns A Promise of GetDNSZoneTsigKeyResponse + */ + getDNSZoneTsigKey = (request) => this.client.fetch( + { + method: "GET", + path: `/domain/v2beta1/dns-zones/${marshalling.validatePathParam("dnsZone", request.dnsZone)}/tsig-key` + }, + marshalling_gen.unmarshalGetDNSZoneTsigKeyResponse + ); + /** + * Delete the DNS zone's TSIG key. Delete an existing TSIG key specified by + * its DNS zone. Deleting a TSIG key is permanent and cannot be undone. + * + * @param request - The request {@link DeleteDNSZoneTsigKeyRequest} + */ + deleteDNSZoneTsigKey = (request) => this.client.fetch({ + method: "DELETE", + path: `/domain/v2beta1/dns-zones/${marshalling.validatePathParam("dnsZone", request.dnsZone)}/tsig-key` + }); +} +class RegistrarAPI extends api.API { + pageOfListTasks = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/domain/v2beta1/tasks`, + urlParams: marshalling.urlParams( + ["domain", request.domain], + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId], + ["statuses", request.statuses], + ["types", request.types] + ) + }, + marshalling_gen.unmarshalListTasksResponse + ); + /** + * List tasks. List all operations performed on the account. You can filter + * the list of tasks by domain name. + * + * @param request - The request {@link RegistrarApiListTasksRequest} + * @returns A Promise of ListTasksResponse + */ + listTasks = (request = {}) => resourcePaginator.enrichForPagination("tasks", this.pageOfListTasks, request); + /** + * Purchase domains. Request the registration of domain names. You can provide + * a domain's already existing contact or a new contact. + * + * @param request - The request {@link RegistrarApiBuyDomainsRequest} + * @returns A Promise of OrderResponse + */ + buyDomains = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalRegistrarApiBuyDomainsRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/domain/v2beta1/buy-domains` + }, + marshalling_gen.unmarshalOrderResponse + ); + /** + * Renew domains. Request the renewal of one or more domain names. + * + * @param request - The request {@link RegistrarApiRenewDomainsRequest} + * @returns A Promise of OrderResponse + */ + renewDomains = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalRegistrarApiRenewDomainsRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/domain/v2beta1/renew-domains` + }, + marshalling_gen.unmarshalOrderResponse + ); + /** + * Transfer a domain. Request the transfer of a domain from another registrar + * to Scaleway Domains and DNS. + * + * @param request - The request {@link RegistrarApiTransferInDomainRequest} + * @returns A Promise of OrderResponse + */ + transferInDomain = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalRegistrarApiTransferInDomainRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/domain/v2beta1/domains/transfer-domains` + }, + marshalling_gen.unmarshalOrderResponse + ); + /** + * Trade a domain's contact. Request to change a domain's contact owner.
+ * If you specify the `organization_id` of the domain's new owner, the contact + * will change from the current owner's Scaleway account to the new owner's + * Scaleway account.
If the new owner's current contact information is + * not available, the first ever contact they have created for previous + * domains is taken into account to operate the change.
If the new owner + * has never created a contact to register domains before, an error message + * displays. + * + * @param request - The request {@link RegistrarApiTradeDomainRequest} + * @returns A Promise of OrderResponse */ - createInstance = request => this.client.fetch({ - body: JSON.stringify(marshalCreateInstanceRequest$1(request, this.client.settings)), - headers: jsonContentHeaders$l, - method: 'POST', - path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances` - }, unmarshalInstance$2); - + tradeDomain = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalRegistrarApiTradeDomainRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/domain/v2beta1/domains/${marshalling.validatePathParam("domain", request.domain)}/trade` + }, + marshalling_gen.unmarshalOrderResponse + ); /** - * Update a Database Instance. Update the parameters of a Database Instance, - * including name, tags and backup schedule details. + * Register an external domain. Request the registration of an external domain + * name. * - * @param request - The request {@link UpdateInstanceRequest} - * @returns A Promise of Instance + * @param request - The request + * {@link RegistrarApiRegisterExternalDomainRequest} + * @returns A Promise of RegisterExternalDomainResponse */ - updateInstance = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateInstanceRequest$1(request, this.client.settings)), - headers: jsonContentHeaders$l, - method: 'PATCH', - path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}` - }, unmarshalInstance$2); - + registerExternalDomain = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalRegistrarApiRegisterExternalDomainRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/domain/v2beta1/external-domains` + }, + marshalling_gen.unmarshalRegisterExternalDomainResponse + ); /** - * Delete a Database Instance. Delete a given Database Instance, specified by - * the `region` and `instance_id` parameters. Deleting a Database Instance is - * permanent, and cannot be undone. Note that upon deletion all your data will - * be lost. + * Delete an external domain. Delete an external domain name. * - * @param request - The request {@link DeleteInstanceRequest} - * @returns A Promise of Instance + * @param request - The request {@link RegistrarApiDeleteExternalDomainRequest} + * @returns A Promise of DeleteExternalDomainResponse */ - deleteInstance = request => this.client.fetch({ - method: 'DELETE', - path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}` - }, unmarshalInstance$2); - + deleteExternalDomain = (request) => this.client.fetch( + { + method: "DELETE", + path: `/domain/v2beta1/external-domains/${marshalling.validatePathParam("domain", request.domain)}` + }, + marshalling_gen.unmarshalDeleteExternalDomainResponse + ); /** - * Clone a Database Instance. Clone a given Database Instance, specified by - * the `region` and `instance_id` parameters. The clone feature allows you to - * create a new Database Instance from an existing one. The clone includes all - * existing databases, users and permissions. You can create a clone on a - * Database Instance bigger than your current one. + * Check if contacts are compatible with a domain or a TLD. Check whether + * contacts are compatible with a domain or a TLD. If contacts are not + * compatible with either the domain or the TLD, the information that needs to + * be corrected is returned. * - * @param request - The request {@link CloneInstanceRequest} - * @returns A Promise of Instance + * @param request - The request + * {@link RegistrarApiCheckContactsCompatibilityRequest} + * @returns A Promise of CheckContactsCompatibilityResponse */ - cloneInstance = request => this.client.fetch({ - body: JSON.stringify(marshalCloneInstanceRequest$1(request, this.client.settings)), - headers: jsonContentHeaders$l, - method: 'POST', - path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/clone` - }, unmarshalInstance$2); - + checkContactsCompatibility = (request = {}) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalRegistrarApiCheckContactsCompatibilityRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/domain/v2beta1/check-contacts-compatibility` + }, + marshalling_gen.unmarshalCheckContactsCompatibilityResponse + ); + pageOfListContacts = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/domain/v2beta1/contacts`, + urlParams: marshalling.urlParams( + ["domain", request.domain], + ["email_status", request.emailStatus], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId], + ["role", request.role] + ) + }, + marshalling_gen.unmarshalListContactsResponse + ); /** - * Restart Database Instance. Restart a given Database Instance, specified by - * the `region` and `instance_id` parameters. The status of the Database - * Instance returned in the response. + * List contacts. Retrieve the list of contacts and their associated domains + * and roles. You can filter the list by domain name. * - * @param request - The request {@link RestartInstanceRequest} - * @returns A Promise of Instance + * @param request - The request {@link RegistrarApiListContactsRequest} + * @returns A Promise of ListContactsResponse */ - restartInstance = request => this.client.fetch({ - body: '{}', - headers: jsonContentHeaders$l, - method: 'POST', - path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/restart` - }, unmarshalInstance$2); - + listContacts = (request = {}) => resourcePaginator.enrichForPagination("contacts", this.pageOfListContacts, request); /** - * Get the TLS certificate of a Database Instance. Retrieve information about - * the TLS certificate of a given Database Instance. Details like name and - * content are returned in the response. + * Get a contact. Retrieve a contact's details from the registrar using the + * given contact's ID. * - * @param request - The request {@link GetInstanceCertificateRequest} - * @returns A Promise of Blob + * @param request - The request {@link RegistrarApiGetContactRequest} + * @returns A Promise of Contact */ - getInstanceCertificate = request => this.client.fetch({ - method: 'GET', - path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/certificate`, - urlParams: urlParams(['dl', 1]), - responseType: 'blob' - }); - + getContact = (request) => this.client.fetch( + { + method: "GET", + path: `/domain/v2beta1/contacts/${marshalling.validatePathParam("contactId", request.contactId)}` + }, + marshalling_gen.unmarshalContact + ); /** - * Renew the TLS certificate of a Database Instance. Renew a TLS for a - * Database Instance. Renewing a certificate means that you will not be able - * to connect to your Database Instance using the previous certificate. You - * will also need to download and update the new certificate for all database - * clients. + * Update contact. Edit the contact's information. * - * @param request - The request {@link RenewInstanceCertificateRequest} + * @param request - The request {@link RegistrarApiUpdateContactRequest} + * @returns A Promise of Contact */ - renewInstanceCertificate = request => this.client.fetch({ - body: '{}', - headers: jsonContentHeaders$l, - method: 'POST', - path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/renew-certificate` - }); - + updateContact = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalRegistrarApiUpdateContactRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/domain/v2beta1/contacts/${marshalling.validatePathParam("contactId", request.contactId)}` + }, + marshalling_gen.unmarshalContact + ); + pageOfListDomains = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/domain/v2beta1/domains`, + urlParams: marshalling.urlParams( + ["domain", request.domain], + ["is_external", request.isExternal], + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId], + ["registrar", request.registrar], + ["status", request.status] + ) + }, + marshalling_gen.unmarshalListDomainsResponse + ); /** - * Get Database Instance metrics. Retrieve the time series metrics of a given - * Database Instance. You can define the period from which to retrieve metrics - * by specifying the `start_date` and `end_date`. + * List domains. Retrieve the list of domains you own. * - * @param request - The request {@link GetInstanceMetricsRequest} - * @returns A Promise of InstanceMetrics + * @param request - The request {@link RegistrarApiListDomainsRequest} + * @returns A Promise of ListDomainsResponse */ - getInstanceMetrics = request => this.client.fetch({ - method: 'GET', - path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/metrics`, - urlParams: urlParams(['end_date', request.endDate], ['metric_name', request.metricName], ['start_date', request.startDate]) - }, unmarshalInstanceMetrics$1); - + listDomains = (request = {}) => resourcePaginator.enrichForPagination("domains", this.pageOfListDomains, request); + pageOfListRenewableDomains = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/domain/v2beta1/renewable-domains`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId] + ) + }, + marshalling_gen.unmarshalListRenewableDomainsResponse + ); /** - * Create a Read Replica. Create a new Read Replica of a Database Instance. - * You must specify the `region` and the `instance_id`. You can only create a - * maximum of 3 Read Replicas per Database Instance. + * List domains that can be renewed. Retrieve the list of domains you own that + * can be renewed. You can also see the maximum renewal duration in years for + * your domains that are renewable. * - * @param request - The request {@link CreateReadReplicaRequest} - * @returns A Promise of ReadReplica + * @param request - The request {@link RegistrarApiListRenewableDomainsRequest} + * @returns A Promise of ListRenewableDomainsResponse */ - createReadReplica = request => this.client.fetch({ - body: JSON.stringify(marshalCreateReadReplicaRequest$1(request, this.client.settings)), - headers: jsonContentHeaders$l, - method: 'POST', - path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/read-replicas` - }, unmarshalReadReplica$1); - + listRenewableDomains = (request = {}) => resourcePaginator.enrichForPagination("domains", this.pageOfListRenewableDomains, request); /** - * Get a Read Replica. Retrieve information about a Database Instance Read - * Replica. Full details about the Read Replica, like `endpoints`, `status` - * and `region` are returned in the response. + * Get domain. Retrieve a specific domain and display the domain's + * information. * - * @param request - The request {@link GetReadReplicaRequest} - * @returns A Promise of ReadReplica + * @param request - The request {@link RegistrarApiGetDomainRequest} + * @returns A Promise of Domain */ - getReadReplica = request => this.client.fetch({ - method: 'GET', - path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/read-replicas/${validatePathParam('readReplicaId', request.readReplicaId)}` - }, unmarshalReadReplica$1); - + getDomain = (request) => this.client.fetch( + { + method: "GET", + path: `/domain/v2beta1/domains/${marshalling.validatePathParam("domain", request.domain)}` + }, + marshalling_gen.unmarshalDomain + ); /** - * Waits for {@link ReadReplica} to be in a final state. + * Waits for {@link Domain} to be in a final state. * - * @param request - The request {@link GetReadReplicaRequest} + * @param request - The request {@link RegistrarApiGetDomainRequest} * @param options - The waiting options - * @returns A Promise of ReadReplica + * @returns A Promise of Domain */ - waitForReadReplica = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!READ_REPLICA_TRANSIENT_STATUSES$1.includes(res.status))), this.getReadReplica, request, options); - + waitForDomain = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve(!content_gen.DOMAIN_TRANSIENT_STATUSES.includes(res.status))), + this.getDomain, + request, + options + ); /** - * Delete a Read Replica. Delete a Read Replica of a Database Instance. You - * must specify the `region` and `read_replica_id` parameters of the Read - * Replica you want to delete. + * Update a domain's contacts. Update contacts for a specific domain or create + * a new contact.
If you add the same contact for multiple roles (owner, + * administrative, technical), only one ID will be created and used for all of + * the roles. * - * @param request - The request {@link DeleteReadReplicaRequest} - * @returns A Promise of ReadReplica + * @param request - The request {@link RegistrarApiUpdateDomainRequest} + * @returns A Promise of Domain */ - deleteReadReplica = request => this.client.fetch({ - method: 'DELETE', - path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/read-replicas/${validatePathParam('readReplicaId', request.readReplicaId)}` - }, unmarshalReadReplica$1); + updateDomain = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalRegistrarApiUpdateDomainRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/domain/v2beta1/domains/${marshalling.validatePathParam("domain", request.domain)}` + }, + marshalling_gen.unmarshalDomain + ); + /** + * Lock the transfer of a domain. Lock the transfer of a domain. This means + * that the domain cannot be transferred and the authorization code cannot be + * requested to your current registrar. + * + * @param request - The request {@link RegistrarApiLockDomainTransferRequest} + * @returns A Promise of Domain + */ + lockDomainTransfer = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/domain/v2beta1/domains/${marshalling.validatePathParam("domain", request.domain)}/lock-transfer` + }, + marshalling_gen.unmarshalDomain + ); + /** + * Unlock the transfer of a domain. Unlock the transfer of a domain. This + * means that the domain can be transferred and the authorization code can be + * requested to your current registrar. + * + * @param request - The request {@link RegistrarApiUnlockDomainTransferRequest} + * @returns A Promise of Domain + */ + unlockDomainTransfer = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/domain/v2beta1/domains/${marshalling.validatePathParam("domain", request.domain)}/unlock-transfer` + }, + marshalling_gen.unmarshalDomain + ); + /** + * Enable auto renew. Enable the `auto renew` feature for a domain. This means + * the domain will be automatically renewed before its expiry date. + * + * @param request - The request + * {@link RegistrarApiEnableDomainAutoRenewRequest} + * @returns A Promise of Domain + */ + enableDomainAutoRenew = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/domain/v2beta1/domains/${marshalling.validatePathParam("domain", request.domain)}/enable-auto-renew` + }, + marshalling_gen.unmarshalDomain + ); + /** + * Disable auto renew. Disable the `auto renew` feature for a domain. This + * means the domain will not be renewed before its expiry date. + * + * @param request - The request + * {@link RegistrarApiDisableDomainAutoRenewRequest} + * @returns A Promise of Domain + */ + disableDomainAutoRenew = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/domain/v2beta1/domains/${marshalling.validatePathParam("domain", request.domain)}/disable-auto-renew` + }, + marshalling_gen.unmarshalDomain + ); + /** + * Get a domain's authorization code. Retrieve the authorization code to + * tranfer an unlocked domain. The output returns an error if the domain is + * locked. Some TLDs may have a different procedure to retrieve the + * authorization code. In that case, the information displays in the message + * field. + * + * @param request - The request {@link RegistrarApiGetDomainAuthCodeRequest} + * @returns A Promise of GetDomainAuthCodeResponse + */ + getDomainAuthCode = (request) => this.client.fetch( + { + method: "GET", + path: `/domain/v2beta1/domains/${marshalling.validatePathParam("domain", request.domain)}/auth-code` + }, + marshalling_gen.unmarshalGetDomainAuthCodeResponse + ); + /** + * Update domain DNSSEC. If your domain uses another registrar and has the + * default Scaleway NS, you have to **update the DS record at your + * registrar**. + * + * @param request - The request {@link RegistrarApiEnableDomainDNSSECRequest} + * @returns A Promise of Domain + */ + enableDomainDNSSEC = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalRegistrarApiEnableDomainDNSSECRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/domain/v2beta1/domains/${marshalling.validatePathParam("domain", request.domain)}/enable-dnssec` + }, + marshalling_gen.unmarshalDomain + ); + /** + * Disable a domain's DNSSEC. Disable DNSSEC for a domain. + * + * @param request - The request {@link RegistrarApiDisableDomainDNSSECRequest} + * @returns A Promise of Domain + */ + disableDomainDNSSEC = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/domain/v2beta1/domains/${marshalling.validatePathParam("domain", request.domain)}/disable-dnssec` + }, + marshalling_gen.unmarshalDomain + ); + /** + * Search available domains. Search a domain or a maximum of 10 domains that + * are available. + * + * If the TLD list is empty or not set, the search returns the results from + * the most popular TLDs. + * + * @param request - The request + * {@link RegistrarApiSearchAvailableDomainsRequest} + * @returns A Promise of SearchAvailableDomainsResponse + */ + searchAvailableDomains = (request) => this.client.fetch( + { + method: "GET", + path: `/domain/v2beta1/search-domains`, + urlParams: marshalling.urlParams( + ["domains", request.domains], + ["strict_search", request.strictSearch], + ["tlds", request.tlds] + ) + }, + marshalling_gen.unmarshalSearchAvailableDomainsResponse + ); + pageOfListTlds = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/domain/v2beta1/tlds`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["tlds", request.tlds] + ) + }, + marshalling_gen.unmarshalListTldsResponse + ); + /** + * List TLD offers. Retrieve the list of TLDs and offers associated with them. + * + * @param request - The request {@link RegistrarApiListTldsRequest} + * @returns A Promise of ListTldsResponse + */ + listTlds = (request = {}) => resourcePaginator.enrichForPagination("tlds", this.pageOfListTlds, request); + /** + * Create a hostname for a domain. Create a hostname for a domain with glue + * IPs. + * + * @param request - The request {@link RegistrarApiCreateDomainHostRequest} + * @returns A Promise of Host + */ + createDomainHost = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalRegistrarApiCreateDomainHostRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/domain/v2beta1/domains/${marshalling.validatePathParam("domain", request.domain)}/hosts` + }, + marshalling_gen.unmarshalHost + ); + pageOfListDomainHosts = (request) => this.client.fetch( + { + method: "GET", + path: `/domain/v2beta1/domains/${marshalling.validatePathParam("domain", request.domain)}/hosts`, + urlParams: marshalling.urlParams( + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListDomainHostsResponse + ); + /** + * List a domain's hostnames. List a domain's hostnames using their glue IPs. + * + * @param request - The request {@link RegistrarApiListDomainHostsRequest} + * @returns A Promise of ListDomainHostsResponse + */ + listDomainHosts = (request) => resourcePaginator.enrichForPagination("hosts", this.pageOfListDomainHosts, request); + /** + * Update a domain's hostname. Update a domain's hostname with glue IPs. + * + * @param request - The request {@link RegistrarApiUpdateDomainHostRequest} + * @returns A Promise of Host + */ + updateDomainHost = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalRegistrarApiUpdateDomainHostRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/domain/v2beta1/domains/${marshalling.validatePathParam("domain", request.domain)}/hosts/${marshalling.validatePathParam("name", request.name)}` + }, + marshalling_gen.unmarshalHost + ); + /** + * Delete a domain's hostname. + * + * @param request - The request {@link RegistrarApiDeleteDomainHostRequest} + * @returns A Promise of Host + */ + deleteDomainHost = (request) => this.client.fetch( + { + method: "DELETE", + path: `/domain/v2beta1/domains/${marshalling.validatePathParam("domain", request.domain)}/hosts/${marshalling.validatePathParam("name", request.name)}` + }, + marshalling_gen.unmarshalHost + ); +} +exports.API = API; +exports.RegistrarAPI = RegistrarAPI; + + +/***/ }), + +/***/ 7765: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const DNS_ZONE_TRANSIENT_STATUSES = ["pending"]; +const DOMAIN_FEATURE_TRANSIENT_STATUSES = [ + "enabling", + "disabling" +]; +const DOMAIN_REGISTRATION_STATUS_TRANSFER_TRANSIENT_STATUSES = ["pending", "processing"]; +const DOMAIN_TRANSIENT_STATUSES = [ + "creating", + "renewing", + "xfering", + "expiring", + "updating", + "checking", + "deleting" +]; +const HOST_TRANSIENT_STATUSES = ["updating", "deleting"]; +const SSL_CERTIFICATE_TRANSIENT_STATUSES = [ + "pending" +]; +const TASK_TRANSIENT_STATUSES = ["pending"]; +exports.DNS_ZONE_TRANSIENT_STATUSES = DNS_ZONE_TRANSIENT_STATUSES; +exports.DOMAIN_FEATURE_TRANSIENT_STATUSES = DOMAIN_FEATURE_TRANSIENT_STATUSES; +exports.DOMAIN_REGISTRATION_STATUS_TRANSFER_TRANSIENT_STATUSES = DOMAIN_REGISTRATION_STATUS_TRANSFER_TRANSIENT_STATUSES; +exports.DOMAIN_TRANSIENT_STATUSES = DOMAIN_TRANSIENT_STATUSES; +exports.HOST_TRANSIENT_STATUSES = HOST_TRANSIENT_STATUSES; +exports.SSL_CERTIFICATE_TRANSIENT_STATUSES = SSL_CERTIFICATE_TRANSIENT_STATUSES; +exports.TASK_TRANSIENT_STATUSES = TASK_TRANSIENT_STATUSES; + + +/***/ }), + +/***/ 2778: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api_gen = __nccwpck_require__(5378); +const content_gen = __nccwpck_require__(7765); +exports.API = api_gen.API; +exports.RegistrarAPI = api_gen.RegistrarAPI; +exports.DNS_ZONE_TRANSIENT_STATUSES = content_gen.DNS_ZONE_TRANSIENT_STATUSES; +exports.DOMAIN_FEATURE_TRANSIENT_STATUSES = content_gen.DOMAIN_FEATURE_TRANSIENT_STATUSES; +exports.DOMAIN_REGISTRATION_STATUS_TRANSFER_TRANSIENT_STATUSES = content_gen.DOMAIN_REGISTRATION_STATUS_TRANSFER_TRANSIENT_STATUSES; +exports.DOMAIN_TRANSIENT_STATUSES = content_gen.DOMAIN_TRANSIENT_STATUSES; +exports.HOST_TRANSIENT_STATUSES = content_gen.HOST_TRANSIENT_STATUSES; +exports.SSL_CERTIFICATE_TRANSIENT_STATUSES = content_gen.SSL_CERTIFICATE_TRANSIENT_STATUSES; +exports.TASK_TRANSIENT_STATUSES = content_gen.TASK_TRANSIENT_STATUSES; - /** - * Resync a Read Replica. When you resync a Read Replica, first it is reset, - * then its data is resynchronized from the primary node. Your Read Replica - * remains unavailable during the resync process. The duration of this process - * is proportional to the size of your Database Instance. The configured - * endpoints do not change. - * - * @param request - The request {@link ResetReadReplicaRequest} - * @returns A Promise of ReadReplica - */ - resetReadReplica = request => this.client.fetch({ - body: '{}', - headers: jsonContentHeaders$l, - method: 'POST', - path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/read-replicas/${validatePathParam('readReplicaId', request.readReplicaId)}/reset` - }, unmarshalReadReplica$1); - /** - * Promote a Read Replica. Promote a Read Replica to Database Instance - * automatically. - * - * @param request - The request {@link PromoteReadReplicaRequest} - * @returns A Promise of Instance - */ - promoteReadReplica = request => this.client.fetch({ - body: '{}', - headers: jsonContentHeaders$l, - method: 'POST', - path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/read-replicas/${validatePathParam('readReplicaId', request.readReplicaId)}/promote` - }, unmarshalInstance$2); +/***/ }), - /** - * Create an endpoint for a Read Replica. Create a new endpoint for a Read - * Replica. Read Replicas can have at most one direct access and one Private - * Network endpoint. - * - * @param request - The request {@link CreateReadReplicaEndpointRequest} - * @returns A Promise of ReadReplica - */ - createReadReplicaEndpoint = request => this.client.fetch({ - body: JSON.stringify(marshalCreateReadReplicaEndpointRequest$1(request, this.client.settings)), - headers: jsonContentHeaders$l, - method: 'POST', - path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/read-replicas/${validatePathParam('readReplicaId', request.readReplicaId)}/endpoints` - }, unmarshalReadReplica$1); +/***/ 4244: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - /** - * List available logs of a Database Instance. List the available logs of a - * Database Instance. By default, the logs returned in the list are ordered by - * creation date in ascending order, though this can be modified via the - * order_by field. - * - * @param request - The request {@link ListInstanceLogsRequest} - * @returns A Promise of ListInstanceLogsResponse - */ - listInstanceLogs = request => this.client.fetch({ - method: 'GET', - path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/logs`, - urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc']) - }, unmarshalListInstanceLogsResponse$1); +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const json = __nccwpck_require__(3746); +const customMarshalling = __nccwpck_require__(7586); +const marshalling = __nccwpck_require__(1162); +const unmarshalContactExtensionFRAssociationInfo = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ContactExtensionFRAssociationInfo' failed as data isn't a dictionary.` + ); + } + return { + publicationJo: marshalling.unmarshalDate(data.publication_jo), + publicationJoPage: data.publication_jo_page + }; +}; +const unmarshalContactExtensionFRCodeAuthAfnicInfo = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ContactExtensionFRCodeAuthAfnicInfo' failed as data isn't a dictionary.` + ); + } + return { + codeAuthAfnic: data.code_auth_afnic + }; +}; +const unmarshalContactExtensionFRDunsInfo = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ContactExtensionFRDunsInfo' failed as data isn't a dictionary.` + ); + } + return { + dunsId: data.duns_id, + localId: data.local_id + }; +}; +const unmarshalContactExtensionFRIndividualInfo = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ContactExtensionFRIndividualInfo' failed as data isn't a dictionary.` + ); + } + return { + whoisOptIn: data.whois_opt_in + }; +}; +const unmarshalContactExtensionFRTrademarkInfo = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ContactExtensionFRTrademarkInfo' failed as data isn't a dictionary.` + ); + } + return { + trademarkInpi: data.trademark_inpi + }; +}; +const unmarshalContactExtensionEU = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ContactExtensionEU' failed as data isn't a dictionary.` + ); + } + return { + europeanCitizenship: data.european_citizenship + }; +}; +const unmarshalContactExtensionFR = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ContactExtensionFR' failed as data isn't a dictionary.` + ); + } + return { + associationInfo: data.association_info ? unmarshalContactExtensionFRAssociationInfo(data.association_info) : void 0, + codeAuthAfnicInfo: data.code_auth_afnic_info ? unmarshalContactExtensionFRCodeAuthAfnicInfo(data.code_auth_afnic_info) : void 0, + dunsInfo: data.duns_info ? unmarshalContactExtensionFRDunsInfo(data.duns_info) : void 0, + individualInfo: data.individual_info ? unmarshalContactExtensionFRIndividualInfo(data.individual_info) : void 0, + mode: data.mode, + trademarkInfo: data.trademark_info ? unmarshalContactExtensionFRTrademarkInfo(data.trademark_info) : void 0 + }; +}; +const unmarshalContactExtensionNL = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ContactExtensionNL' failed as data isn't a dictionary.` + ); + } + return { + legalForm: data.legal_form, + legalFormRegistrationNumber: data.legal_form_registration_number + }; +}; +const unmarshalContactQuestion = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ContactQuestion' failed as data isn't a dictionary.` + ); + } + return { + answer: data.answer, + question: data.question + }; +}; +const unmarshalContact = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Contact' failed as data isn't a dictionary.` + ); + } + return { + addressLine1: data.address_line_1, + addressLine2: data.address_line_2, + city: data.city, + companyIdentificationCode: data.company_identification_code, + companyName: data.company_name, + country: data.country, + email: data.email, + emailAlt: data.email_alt, + emailStatus: data.email_status, + extensionEu: data.extension_eu ? unmarshalContactExtensionEU(data.extension_eu) : void 0, + extensionFr: data.extension_fr ? unmarshalContactExtensionFR(data.extension_fr) : void 0, + extensionNl: data.extension_nl ? unmarshalContactExtensionNL(data.extension_nl) : void 0, + faxNumber: data.fax_number, + firstname: data.firstname, + id: data.id, + lang: data.lang, + lastname: data.lastname, + legalForm: data.legal_form, + phoneNumber: data.phone_number, + questions: data.questions ? marshalling.unmarshalArrayOfObject(data.questions, unmarshalContactQuestion) : void 0, + resale: data.resale, + state: data.state, + status: data.status, + vatIdentificationCode: data.vat_identification_code, + whoisOptIn: data.whois_opt_in, + zip: data.zip + }; +}; +const unmarshalDNSZone = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DNSZone' failed as data isn't a dictionary.` + ); + } + return { + domain: data.domain, + linkedProducts: data.linked_products, + message: data.message, + ns: data.ns, + nsDefault: data.ns_default, + nsMaster: data.ns_master, + projectId: data.project_id, + status: data.status, + subdomain: data.subdomain, + updatedAt: marshalling.unmarshalDate(data.updated_at) + }; +}; +const unmarshalHost = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Host' failed as data isn't a dictionary.` + ); + } + return { + domain: data.domain, + ips: data.ips, + name: data.name, + status: data.status + }; +}; +const unmarshalSSLCertificate = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SSLCertificate' failed as data isn't a dictionary.` + ); + } + return { + alternativeDnsZones: data.alternative_dns_zones, + certificateChain: data.certificate_chain, + createdAt: marshalling.unmarshalDate(data.created_at), + dnsZone: data.dns_zone, + expiredAt: marshalling.unmarshalDate(data.expired_at), + privateKey: data.private_key, + status: data.status + }; +}; +const unmarshalCheckContactsCompatibilityResponseContactCheckResult = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'CheckContactsCompatibilityResponseContactCheckResult' failed as data isn't a dictionary.` + ); + } + return { + compatible: data.compatible, + errorMessage: data.error_message + }; +}; +const unmarshalCheckContactsCompatibilityResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'CheckContactsCompatibilityResponse' failed as data isn't a dictionary.` + ); + } + return { + administrativeCheckResult: data.administrative_check_result ? unmarshalCheckContactsCompatibilityResponseContactCheckResult( + data.administrative_check_result + ) : void 0, + compatible: data.compatible, + ownerCheckResult: data.owner_check_result ? unmarshalCheckContactsCompatibilityResponseContactCheckResult( + data.owner_check_result + ) : void 0, + technicalCheckResult: data.technical_check_result ? unmarshalCheckContactsCompatibilityResponseContactCheckResult( + data.technical_check_result + ) : void 0 + }; +}; +const unmarshalClearDNSZoneRecordsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ClearDNSZoneRecordsResponse' failed as data isn't a dictionary.` + ); + } + return {}; +}; +const unmarshalDeleteDNSZoneResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DeleteDNSZoneResponse' failed as data isn't a dictionary.` + ); + } + return {}; +}; +const unmarshalDeleteExternalDomainResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DeleteExternalDomainResponse' failed as data isn't a dictionary.` + ); + } + return {}; +}; +const unmarshalDeleteSSLCertificateResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DeleteSSLCertificateResponse' failed as data isn't a dictionary.` + ); + } + return {}; +}; +const unmarshalDSRecordPublicKey = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DSRecordPublicKey' failed as data isn't a dictionary.` + ); + } + return { + key: data.key + }; +}; +const unmarshalDSRecordDigest = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DSRecordDigest' failed as data isn't a dictionary.` + ); + } + return { + digest: data.digest, + publicKey: data.public_key ? unmarshalDSRecordPublicKey(data.public_key) : void 0, + type: data.type + }; +}; +const unmarshalDSRecord = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DSRecord' failed as data isn't a dictionary.` + ); + } + return { + algorithm: data.algorithm, + digest: data.digest ? unmarshalDSRecordDigest(data.digest) : void 0, + keyId: data.key_id, + publicKey: data.public_key ? unmarshalDSRecordPublicKey(data.public_key) : void 0 + }; +}; +const unmarshalTldOffer = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'TldOffer' failed as data isn't a dictionary.` + ); + } + return { + action: data.action, + operationPath: data.operation_path, + price: data.price ? customMarshalling.unmarshalMoney(data.price) : void 0 + }; +}; +const unmarshalDomainDNSSEC = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DomainDNSSEC' failed as data isn't a dictionary.` + ); + } + return { + dsRecords: marshalling.unmarshalArrayOfObject(data.ds_records, unmarshalDSRecord), + status: data.status + }; +}; +const unmarshalDomainRegistrationStatusExternalDomain = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DomainRegistrationStatusExternalDomain' failed as data isn't a dictionary.` + ); + } + return { + validationToken: data.validation_token + }; +}; +const unmarshalDomainRegistrationStatusTransfer = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DomainRegistrationStatusTransfer' failed as data isn't a dictionary.` + ); + } + return { + status: data.status, + voteCurrentOwner: data.vote_current_owner, + voteNewOwner: data.vote_new_owner + }; +}; +const unmarshalTld = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Tld' failed as data isn't a dictionary.` + ); + } + return { + dnssecSupport: data.dnssec_support, + durationInYearsMax: data.duration_in_years_max, + durationInYearsMin: data.duration_in_years_min, + idnSupport: data.idn_support, + name: data.name, + offers: marshalling.unmarshalMapOfObject(data.offers, unmarshalTldOffer), + specifications: data.specifications + }; +}; +const unmarshalDomain = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Domain' failed as data isn't a dictionary.` + ); + } + return { + administrativeContact: data.administrative_contact ? unmarshalContact(data.administrative_contact) : void 0, + autoRenewStatus: data.auto_renew_status, + dnsZones: marshalling.unmarshalArrayOfObject(data.dns_zones, unmarshalDNSZone), + dnssec: data.dnssec ? unmarshalDomainDNSSEC(data.dnssec) : void 0, + domain: data.domain, + eppCode: data.epp_code, + expiredAt: marshalling.unmarshalDate(data.expired_at), + externalDomainRegistrationStatus: data.external_domain_registration_status ? unmarshalDomainRegistrationStatusExternalDomain( + data.external_domain_registration_status + ) : void 0, + isExternal: data.is_external, + linkedProducts: data.linked_products, + organizationId: data.organization_id, + ownerContact: data.owner_contact ? unmarshalContact(data.owner_contact) : void 0, + pendingTrade: data.pending_trade, + projectId: data.project_id, + registrar: data.registrar, + status: data.status, + technicalContact: data.technical_contact ? unmarshalContact(data.technical_contact) : void 0, + tld: data.tld ? unmarshalTld(data.tld) : void 0, + transferRegistrationStatus: data.transfer_registration_status ? unmarshalDomainRegistrationStatusTransfer( + data.transfer_registration_status + ) : void 0, + updatedAt: marshalling.unmarshalDate(data.updated_at) + }; +}; +const unmarshalGetDNSZoneTsigKeyResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'GetDNSZoneTsigKeyResponse' failed as data isn't a dictionary.` + ); + } + return { + algorithm: data.algorithm, + key: data.key, + name: data.name + }; +}; +const unmarshalDomainRecordGeoIPConfigMatch = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DomainRecordGeoIPConfigMatch' failed as data isn't a dictionary.` + ); + } + return { + continents: data.continents, + countries: data.countries, + data: data.data + }; +}; +const unmarshalDomainRecordViewConfigView = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DomainRecordViewConfigView' failed as data isn't a dictionary.` + ); + } + return { + data: data.data, + subnet: data.subnet + }; +}; +const unmarshalDomainRecordWeightedConfigWeightedIP = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DomainRecordWeightedConfigWeightedIP' failed as data isn't a dictionary.` + ); + } + return { + ip: data.ip, + weight: data.weight + }; +}; +const unmarshalDomainRecordGeoIPConfig = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DomainRecordGeoIPConfig' failed as data isn't a dictionary.` + ); + } + return { + default: data.default, + matches: marshalling.unmarshalArrayOfObject( + data.matches, + unmarshalDomainRecordGeoIPConfigMatch + ) + }; +}; +const unmarshalDomainRecordHTTPServiceConfig = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DomainRecordHTTPServiceConfig' failed as data isn't a dictionary.` + ); + } + return { + ips: data.ips, + mustContain: data.must_contain, + strategy: data.strategy, + url: data.url, + userAgent: data.user_agent + }; +}; +const unmarshalDomainRecordViewConfig = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DomainRecordViewConfig' failed as data isn't a dictionary.` + ); + } + return { + views: marshalling.unmarshalArrayOfObject( + data.views, + unmarshalDomainRecordViewConfigView + ) + }; +}; +const unmarshalDomainRecordWeightedConfig = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DomainRecordWeightedConfig' failed as data isn't a dictionary.` + ); + } + return { + weightedIps: marshalling.unmarshalArrayOfObject( + data.weighted_ips, + unmarshalDomainRecordWeightedConfigWeightedIP + ) + }; +}; +const unmarshalDomainRecord = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DomainRecord' failed as data isn't a dictionary.` + ); + } + return { + comment: data.comment, + data: data.data, + geoIpConfig: data.geo_ip_config ? unmarshalDomainRecordGeoIPConfig(data.geo_ip_config) : void 0, + httpServiceConfig: data.http_service_config ? unmarshalDomainRecordHTTPServiceConfig(data.http_service_config) : void 0, + id: data.id, + name: data.name, + priority: data.priority, + ttl: data.ttl, + type: data.type, + viewConfig: data.view_config ? unmarshalDomainRecordViewConfig(data.view_config) : void 0, + weightedConfig: data.weighted_config ? unmarshalDomainRecordWeightedConfig(data.weighted_config) : void 0 + }; +}; +const unmarshalRecordIdentifier = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'RecordIdentifier' failed as data isn't a dictionary.` + ); + } + return { + data: data.data, + name: data.name, + ttl: data.ttl, + type: data.type + }; +}; +const unmarshalRecordChangeAdd = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'RecordChangeAdd' failed as data isn't a dictionary.` + ); + } + return { + records: marshalling.unmarshalArrayOfObject(data.records, unmarshalDomainRecord) + }; +}; +const unmarshalRecordChangeClear = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'RecordChangeClear' failed as data isn't a dictionary.` + ); + } + return {}; +}; +const unmarshalRecordChangeDelete = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'RecordChangeDelete' failed as data isn't a dictionary.` + ); + } + return { + id: data.id, + idFields: data.id_fields ? unmarshalRecordIdentifier(data.id_fields) : void 0 + }; +}; +const unmarshalRecordChangeSet = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'RecordChangeSet' failed as data isn't a dictionary.` + ); + } + return { + id: data.id, + idFields: data.id_fields ? unmarshalRecordIdentifier(data.id_fields) : void 0, + records: marshalling.unmarshalArrayOfObject(data.records, unmarshalDomainRecord) + }; +}; +const unmarshalRecordChange = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'RecordChange' failed as data isn't a dictionary.` + ); + } + return { + add: data.add ? unmarshalRecordChangeAdd(data.add) : void 0, + clear: data.clear ? unmarshalRecordChangeClear(data.clear) : void 0, + delete: data.delete ? unmarshalRecordChangeDelete(data.delete) : void 0, + set: data.set ? unmarshalRecordChangeSet(data.set) : void 0 + }; +}; +const unmarshalGetDNSZoneVersionDiffResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'GetDNSZoneVersionDiffResponse' failed as data isn't a dictionary.` + ); + } + return { + changes: marshalling.unmarshalArrayOfObject(data.changes, unmarshalRecordChange) + }; +}; +const unmarshalGetDomainAuthCodeResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'GetDomainAuthCodeResponse' failed as data isn't a dictionary.` + ); + } + return { + authCode: data.auth_code + }; +}; +const unmarshalImportProviderDNSZoneResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ImportProviderDNSZoneResponse' failed as data isn't a dictionary.` + ); + } + return { + records: marshalling.unmarshalArrayOfObject(data.records, unmarshalDomainRecord) + }; +}; +const unmarshalImportRawDNSZoneResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ImportRawDNSZoneResponse' failed as data isn't a dictionary.` + ); + } + return { + records: marshalling.unmarshalArrayOfObject(data.records, unmarshalDomainRecord) + }; +}; +const unmarshalContactRolesRoles = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ContactRolesRoles' failed as data isn't a dictionary.` + ); + } + return { + isAdministrative: data.is_administrative, + isOwner: data.is_owner, + isTechnical: data.is_technical + }; +}; +const unmarshalContactRoles = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ContactRoles' failed as data isn't a dictionary.` + ); + } + return { + contact: data.contact ? unmarshalContact(data.contact) : void 0, + roles: marshalling.unmarshalMapOfObject(data.roles, unmarshalContactRolesRoles) + }; +}; +const unmarshalListContactsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListContactsResponse' failed as data isn't a dictionary.` + ); + } + return { + contacts: marshalling.unmarshalArrayOfObject(data.contacts, unmarshalContactRoles), + totalCount: data.total_count + }; +}; +const unmarshalNameserver = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Nameserver' failed as data isn't a dictionary.` + ); + } + return { + ip: data.ip, + name: data.name + }; +}; +const unmarshalListDNSZoneNameserversResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListDNSZoneNameserversResponse' failed as data isn't a dictionary.` + ); + } + return { + ns: marshalling.unmarshalArrayOfObject(data.ns, unmarshalNameserver) + }; +}; +const unmarshalListDNSZoneRecordsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListDNSZoneRecordsResponse' failed as data isn't a dictionary.` + ); + } + return { + records: marshalling.unmarshalArrayOfObject(data.records, unmarshalDomainRecord), + totalCount: data.total_count + }; +}; +const unmarshalListDNSZoneVersionRecordsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListDNSZoneVersionRecordsResponse' failed as data isn't a dictionary.` + ); + } + return { + records: marshalling.unmarshalArrayOfObject(data.records, unmarshalDomainRecord), + totalCount: data.total_count + }; +}; +const unmarshalDNSZoneVersion = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DNSZoneVersion' failed as data isn't a dictionary.` + ); + } + return { + createdAt: marshalling.unmarshalDate(data.created_at), + id: data.id + }; +}; +const unmarshalListDNSZoneVersionsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListDNSZoneVersionsResponse' failed as data isn't a dictionary.` + ); + } + return { + totalCount: data.total_count, + versions: marshalling.unmarshalArrayOfObject(data.versions, unmarshalDNSZoneVersion) + }; +}; +const unmarshalListDNSZonesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListDNSZonesResponse' failed as data isn't a dictionary.` + ); + } + return { + dnsZones: marshalling.unmarshalArrayOfObject(data.dns_zones, unmarshalDNSZone), + totalCount: data.total_count + }; +}; +const unmarshalListDomainHostsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListDomainHostsResponse' failed as data isn't a dictionary.` + ); + } + return { + hosts: marshalling.unmarshalArrayOfObject(data.hosts, unmarshalHost), + totalCount: data.total_count + }; +}; +const unmarshalDomainSummary = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DomainSummary' failed as data isn't a dictionary.` + ); + } + return { + autoRenewStatus: data.auto_renew_status, + createdAt: marshalling.unmarshalDate(data.created_at), + dnssecStatus: data.dnssec_status, + domain: data.domain, + eppCode: data.epp_code, + expiredAt: marshalling.unmarshalDate(data.expired_at), + externalDomainRegistrationStatus: data.external_domain_registration_status ? unmarshalDomainRegistrationStatusExternalDomain( + data.external_domain_registration_status + ) : void 0, + isExternal: data.is_external, + organizationId: data.organization_id, + pendingTrade: data.pending_trade, + projectId: data.project_id, + registrar: data.registrar, + status: data.status, + transferRegistrationStatus: data.transfer_registration_status ? unmarshalDomainRegistrationStatusTransfer( + data.transfer_registration_status + ) : void 0, + updatedAt: marshalling.unmarshalDate(data.updated_at) + }; +}; +const unmarshalListDomainsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListDomainsResponse' failed as data isn't a dictionary.` + ); + } + return { + domains: marshalling.unmarshalArrayOfObject(data.domains, unmarshalDomainSummary), + totalCount: data.total_count + }; +}; +const unmarshalRenewableDomain = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'RenewableDomain' failed as data isn't a dictionary.` + ); + } + return { + domain: data.domain, + estimatedDeleteAt: marshalling.unmarshalDate(data.estimated_delete_at), + expiredAt: marshalling.unmarshalDate(data.expired_at), + limitRedemptionAt: marshalling.unmarshalDate(data.limit_redemption_at), + limitRenewAt: marshalling.unmarshalDate(data.limit_renew_at), + organizationId: data.organization_id, + projectId: data.project_id, + renewableDurationInYears: data.renewable_duration_in_years, + status: data.status, + tld: data.tld ? unmarshalTld(data.tld) : void 0 + }; +}; +const unmarshalListRenewableDomainsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListRenewableDomainsResponse' failed as data isn't a dictionary.` + ); + } + return { + domains: marshalling.unmarshalArrayOfObject(data.domains, unmarshalRenewableDomain), + totalCount: data.total_count + }; +}; +const unmarshalListSSLCertificatesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListSSLCertificatesResponse' failed as data isn't a dictionary.` + ); + } + return { + certificates: marshalling.unmarshalArrayOfObject( + data.certificates, + unmarshalSSLCertificate + ), + totalCount: data.total_count + }; +}; +const unmarshalTask = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Task' failed as data isn't a dictionary.` + ); + } + return { + contactIdentifier: data.contact_identifier, + domain: data.domain, + id: data.id, + message: data.message, + organizationId: data.organization_id, + projectId: data.project_id, + startedAt: marshalling.unmarshalDate(data.started_at), + status: data.status, + type: data.type, + updatedAt: marshalling.unmarshalDate(data.updated_at) + }; +}; +const unmarshalListTasksResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListTasksResponse' failed as data isn't a dictionary.` + ); + } + return { + tasks: marshalling.unmarshalArrayOfObject(data.tasks, unmarshalTask), + totalCount: data.total_count + }; +}; +const unmarshalListTldsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListTldsResponse' failed as data isn't a dictionary.` + ); + } + return { + tlds: marshalling.unmarshalArrayOfObject(data.tlds, unmarshalTld), + totalCount: data.total_count + }; +}; +const unmarshalOrderResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'OrderResponse' failed as data isn't a dictionary.` + ); + } + return { + createdAt: marshalling.unmarshalDate(data.created_at), + domains: data.domains, + organizationId: data.organization_id, + projectId: data.project_id, + taskId: data.task_id + }; +}; +const unmarshalRefreshDNSZoneResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'RefreshDNSZoneResponse' failed as data isn't a dictionary.` + ); + } + return { + dnsZones: marshalling.unmarshalArrayOfObject(data.dns_zones, unmarshalDNSZone) + }; +}; +const unmarshalRegisterExternalDomainResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'RegisterExternalDomainResponse' failed as data isn't a dictionary.` + ); + } + return { + createdAt: marshalling.unmarshalDate(data.created_at), + domain: data.domain, + organizationId: data.organization_id, + projectId: data.project_id, + validationToken: data.validation_token + }; +}; +const unmarshalRestoreDNSZoneVersionResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'RestoreDNSZoneVersionResponse' failed as data isn't a dictionary.` + ); + } + return {}; +}; +const unmarshalAvailableDomain = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'AvailableDomain' failed as data isn't a dictionary.` + ); + } + return { + available: data.available, + domain: data.domain, + tld: data.tld ? unmarshalTld(data.tld) : void 0 + }; +}; +const unmarshalSearchAvailableDomainsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SearchAvailableDomainsResponse' failed as data isn't a dictionary.` + ); + } + return { + availableDomains: marshalling.unmarshalArrayOfObject( + data.available_domains, + unmarshalAvailableDomain + ) + }; +}; +const unmarshalUpdateDNSZoneNameserversResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'UpdateDNSZoneNameserversResponse' failed as data isn't a dictionary.` + ); + } + return { + ns: marshalling.unmarshalArrayOfObject(data.ns, unmarshalNameserver) + }; +}; +const unmarshalUpdateDNSZoneRecordsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'UpdateDNSZoneRecordsResponse' failed as data isn't a dictionary.` + ); + } + return { + records: marshalling.unmarshalArrayOfObject(data.records, unmarshalDomainRecord) + }; +}; +const marshalCloneDNSZoneRequest = (request, defaults) => ({ + dest_dns_zone: request.destDnsZone, + overwrite: request.overwrite, + project_id: request.projectId ?? defaults.defaultProjectId +}); +const marshalCreateDNSZoneRequest = (request, defaults) => ({ + domain: request.domain, + project_id: request.projectId ?? defaults.defaultProjectId, + subdomain: request.subdomain +}); +const marshalCreateSSLCertificateRequest = (request, defaults) => ({ + alternative_dns_zones: request.alternativeDnsZones, + dns_zone: request.dnsZone +}); +const marshalImportProviderDNSZoneRequestOnlineV1 = (request, defaults) => ({ + token: request.token +}); +const marshalImportProviderDNSZoneRequest = (request, defaults) => ({ + ...marshalling.resolveOneOf([ + { + param: "online_v1", + value: request.onlineV1 !== void 0 ? marshalImportProviderDNSZoneRequestOnlineV1( + request.onlineV1 + ) : void 0 + } + ]) +}); +const marshalImportRawDNSZoneRequestTsigKey = (request, defaults) => ({ + algorithm: request.algorithm, + key: request.key, + name: request.name +}); +const marshalImportRawDNSZoneRequestAXFRSource = (request, defaults) => ({ + name_server: request.nameServer, + tsig_key: request.tsigKey !== void 0 ? marshalImportRawDNSZoneRequestTsigKey(request.tsigKey) : void 0 +}); +const marshalImportRawDNSZoneRequestBindSource = (request, defaults) => ({ + content: request.content +}); +const marshalImportRawDNSZoneRequest = (request, defaults) => ({ + content: request.content, + format: request.format, + project_id: request.projectId ?? defaults.defaultProjectId, + ...marshalling.resolveOneOf([ + { + param: "bind_source", + value: request.bindSource !== void 0 ? marshalImportRawDNSZoneRequestBindSource( + request.bindSource + ) : void 0 + }, + { + param: "axfr_source", + value: request.axfrSource !== void 0 ? marshalImportRawDNSZoneRequestAXFRSource( + request.axfrSource + ) : void 0 + } + ]) +}); +const marshalRefreshDNSZoneRequest = (request, defaults) => ({ + recreate_dns_zone: request.recreateDnsZone, + recreate_sub_dns_zone: request.recreateSubDnsZone +}); +const marshalContactExtensionFRAssociationInfo = (request, defaults) => ({ + publication_jo: request.publicationJo, + publication_jo_page: request.publicationJoPage +}); +const marshalContactExtensionFRCodeAuthAfnicInfo = (request, defaults) => ({ + code_auth_afnic: request.codeAuthAfnic +}); +const marshalContactExtensionFRDunsInfo = (request, defaults) => ({ + duns_id: request.dunsId, + local_id: request.localId +}); +const marshalContactExtensionFRIndividualInfo = (request, defaults) => ({ + whois_opt_in: request.whoisOptIn +}); +const marshalContactExtensionFRTrademarkInfo = (request, defaults) => ({ + trademark_inpi: request.trademarkInpi +}); +const marshalContactExtensionEU = (request, defaults) => ({ + european_citizenship: request.europeanCitizenship +}); +const marshalContactExtensionFR = (request, defaults) => ({ + mode: request.mode, + ...marshalling.resolveOneOf([ + { + param: "individual_info", + value: request.individualInfo !== void 0 ? marshalContactExtensionFRIndividualInfo( + request.individualInfo + ) : void 0 + }, + { + param: "duns_info", + value: request.dunsInfo !== void 0 ? marshalContactExtensionFRDunsInfo(request.dunsInfo) : void 0 + }, + { + param: "association_info", + value: request.associationInfo !== void 0 ? marshalContactExtensionFRAssociationInfo( + request.associationInfo + ) : void 0 + }, + { + param: "trademark_info", + value: request.trademarkInfo !== void 0 ? marshalContactExtensionFRTrademarkInfo( + request.trademarkInfo + ) : void 0 + }, + { + param: "code_auth_afnic_info", + value: request.codeAuthAfnicInfo !== void 0 ? marshalContactExtensionFRCodeAuthAfnicInfo( + request.codeAuthAfnicInfo + ) : void 0 + } + ]) +}); +const marshalContactExtensionNL = (request, defaults) => ({ + legal_form: request.legalForm, + legal_form_registration_number: request.legalFormRegistrationNumber +}); +const marshalContactQuestion = (request, defaults) => ({ + answer: request.answer, + question: request.question +}); +const marshalNewContact = (request, defaults) => ({ + address_line_1: request.addressLine1, + address_line_2: request.addressLine2, + city: request.city, + company_identification_code: request.companyIdentificationCode, + company_name: request.companyName, + country: request.country, + email: request.email, + email_alt: request.emailAlt, + extension_eu: request.extensionEu !== void 0 ? marshalContactExtensionEU(request.extensionEu) : void 0, + extension_fr: request.extensionFr !== void 0 ? marshalContactExtensionFR(request.extensionFr) : void 0, + extension_nl: request.extensionNl !== void 0 ? marshalContactExtensionNL(request.extensionNl) : void 0, + fax_number: request.faxNumber, + firstname: request.firstname, + lang: request.lang, + lastname: request.lastname, + legal_form: request.legalForm, + phone_number: request.phoneNumber, + questions: request.questions !== void 0 ? request.questions.map((elt) => marshalContactQuestion(elt)) : void 0, + resale: request.resale, + state: request.state, + vat_identification_code: request.vatIdentificationCode, + whois_opt_in: request.whoisOptIn, + zip: request.zip +}); +const marshalRegistrarApiBuyDomainsRequest = (request, defaults) => ({ + domains: request.domains, + duration_in_years: request.durationInYears, + project_id: request.projectId ?? defaults.defaultProjectId, + ...marshalling.resolveOneOf([ + { param: "owner_contact_id", value: request.ownerContactId }, + { + param: "owner_contact", + value: request.ownerContact !== void 0 ? marshalNewContact(request.ownerContact) : void 0 + } + ]), + ...marshalling.resolveOneOf([ + { + param: "administrative_contact_id", + value: request.administrativeContactId + }, + { + param: "administrative_contact", + value: request.administrativeContact !== void 0 ? marshalNewContact(request.administrativeContact) : void 0 + } + ]), + ...marshalling.resolveOneOf([ + { param: "technical_contact_id", value: request.technicalContactId }, + { + param: "technical_contact", + value: request.technicalContact !== void 0 ? marshalNewContact(request.technicalContact) : void 0 + } + ]) +}); +const marshalRegistrarApiCheckContactsCompatibilityRequest = (request, defaults) => ({ + domains: request.domains, + tlds: request.tlds, + ...marshalling.resolveOneOf([ + { param: "owner_contact_id", value: request.ownerContactId }, + { + param: "owner_contact", + value: request.ownerContact !== void 0 ? marshalNewContact(request.ownerContact) : void 0 + } + ]), + ...marshalling.resolveOneOf([ + { + param: "administrative_contact_id", + value: request.administrativeContactId + }, + { + param: "administrative_contact", + value: request.administrativeContact !== void 0 ? marshalNewContact(request.administrativeContact) : void 0 + } + ]), + ...marshalling.resolveOneOf([ + { param: "technical_contact_id", value: request.technicalContactId }, + { + param: "technical_contact", + value: request.technicalContact !== void 0 ? marshalNewContact(request.technicalContact) : void 0 + } + ]) +}); +const marshalRegistrarApiCreateDomainHostRequest = (request, defaults) => ({ + ips: request.ips, + name: request.name +}); +const marshalDSRecordPublicKey = (request, defaults) => ({ + key: request.key +}); +const marshalDSRecordDigest = (request, defaults) => ({ + digest: request.digest, + public_key: request.publicKey !== void 0 ? marshalDSRecordPublicKey(request.publicKey) : void 0, + type: request.type +}); +const marshalDSRecord = (request, defaults) => ({ + algorithm: request.algorithm, + key_id: request.keyId, + ...marshalling.resolveOneOf([ + { + param: "digest", + value: request.digest !== void 0 ? marshalDSRecordDigest(request.digest) : void 0 + }, + { + param: "public_key", + value: request.publicKey !== void 0 ? marshalDSRecordPublicKey(request.publicKey) : void 0 + } + ]) +}); +const marshalRegistrarApiEnableDomainDNSSECRequest = (request, defaults) => ({ + ds_record: request.dsRecord !== void 0 ? marshalDSRecord(request.dsRecord) : void 0 +}); +const marshalRegistrarApiRegisterExternalDomainRequest = (request, defaults) => ({ + domain: request.domain, + project_id: request.projectId ?? defaults.defaultProjectId +}); +const marshalRegistrarApiRenewDomainsRequest = (request, defaults) => ({ + domains: request.domains, + duration_in_years: request.durationInYears, + force_late_renewal: request.forceLateRenewal +}); +const marshalRegistrarApiTradeDomainRequest = (request, defaults) => ({ + project_id: request.projectId ?? defaults.defaultProjectId, + ...marshalling.resolveOneOf([ + { param: "new_owner_contact_id", value: request.newOwnerContactId }, + { + param: "new_owner_contact", + value: request.newOwnerContact !== void 0 ? marshalNewContact(request.newOwnerContact) : void 0 + } + ]) +}); +const marshalTransferInDomainRequestTransferRequest = (request, defaults) => ({ + auth_code: request.authCode, + domain: request.domain +}); +const marshalRegistrarApiTransferInDomainRequest = (request, defaults) => ({ + domains: request.domains.map( + (elt) => marshalTransferInDomainRequestTransferRequest(elt) + ), + project_id: request.projectId ?? defaults.defaultProjectId, + ...marshalling.resolveOneOf([ + { param: "owner_contact_id", value: request.ownerContactId }, + { + param: "owner_contact", + value: request.ownerContact !== void 0 ? marshalNewContact(request.ownerContact) : void 0 + } + ]), + ...marshalling.resolveOneOf([ + { + param: "administrative_contact_id", + value: request.administrativeContactId + }, + { + param: "administrative_contact", + value: request.administrativeContact !== void 0 ? marshalNewContact(request.administrativeContact) : void 0 + } + ]), + ...marshalling.resolveOneOf([ + { param: "technical_contact_id", value: request.technicalContactId }, + { + param: "technical_contact", + value: request.technicalContact !== void 0 ? marshalNewContact(request.technicalContact) : void 0 + } + ]) +}); +const marshalUpdateContactRequestQuestion = (request, defaults) => ({ + answer: request.answer, + question: request.question +}); +const marshalRegistrarApiUpdateContactRequest = (request, defaults) => ({ + address_line_1: request.addressLine1, + address_line_2: request.addressLine2, + city: request.city, + company_identification_code: request.companyIdentificationCode, + country: request.country, + email: request.email, + email_alt: request.emailAlt, + extension_eu: request.extensionEu !== void 0 ? marshalContactExtensionEU(request.extensionEu) : void 0, + extension_fr: request.extensionFr !== void 0 ? marshalContactExtensionFR(request.extensionFr) : void 0, + extension_nl: request.extensionNl !== void 0 ? marshalContactExtensionNL(request.extensionNl) : void 0, + fax_number: request.faxNumber, + lang: request.lang, + phone_number: request.phoneNumber, + questions: request.questions !== void 0 ? request.questions.map( + (elt) => marshalUpdateContactRequestQuestion(elt) + ) : void 0, + resale: request.resale, + state: request.state, + vat_identification_code: request.vatIdentificationCode, + whois_opt_in: request.whoisOptIn, + zip: request.zip +}); +const marshalRegistrarApiUpdateDomainHostRequest = (request, defaults) => ({ + ips: request.ips +}); +const marshalRegistrarApiUpdateDomainRequest = (request, defaults) => ({ + ...marshalling.resolveOneOf([ + { param: "technical_contact_id", value: request.technicalContactId }, + { + param: "technical_contact", + value: request.technicalContact !== void 0 ? marshalNewContact(request.technicalContact) : void 0 + } + ]), + ...marshalling.resolveOneOf([ + { param: "owner_contact_id", value: request.ownerContactId }, + { + param: "owner_contact", + value: request.ownerContact !== void 0 ? marshalNewContact(request.ownerContact) : void 0 + } + ]), + ...marshalling.resolveOneOf([ + { + param: "administrative_contact_id", + value: request.administrativeContactId + }, + { + param: "administrative_contact", + value: request.administrativeContact !== void 0 ? marshalNewContact(request.administrativeContact) : void 0 + } + ]) +}); +const marshalNameserver = (request, defaults) => ({ + ip: request.ip, + name: request.name +}); +const marshalUpdateDNSZoneNameserversRequest = (request, defaults) => ({ + ns: request.ns.map((elt) => marshalNameserver(elt)) +}); +const marshalDomainRecordGeoIPConfigMatch = (request, defaults) => ({ + continents: request.continents, + countries: request.countries, + data: request.data +}); +const marshalDomainRecordViewConfigView = (request, defaults) => ({ + data: request.data, + subnet: request.subnet +}); +const marshalDomainRecordWeightedConfigWeightedIP = (request, defaults) => ({ + ip: request.ip, + weight: request.weight +}); +const marshalDomainRecordGeoIPConfig = (request, defaults) => ({ + default: request.default, + matches: request.matches.map( + (elt) => marshalDomainRecordGeoIPConfigMatch(elt) + ) +}); +const marshalDomainRecordHTTPServiceConfig = (request, defaults) => ({ + ips: request.ips, + must_contain: request.mustContain, + strategy: request.strategy, + url: request.url, + user_agent: request.userAgent +}); +const marshalDomainRecordViewConfig = (request, defaults) => ({ + views: request.views.map( + (elt) => marshalDomainRecordViewConfigView(elt) + ) +}); +const marshalDomainRecordWeightedConfig = (request, defaults) => ({ + weighted_ips: request.weightedIps.map( + (elt) => marshalDomainRecordWeightedConfigWeightedIP(elt) + ) +}); +const marshalDomainRecord = (request, defaults) => ({ + comment: request.comment, + data: request.data, + id: request.id, + name: request.name, + priority: request.priority, + ttl: request.ttl, + type: request.type, + ...marshalling.resolveOneOf([ + { + param: "geo_ip_config", + value: request.geoIpConfig !== void 0 ? marshalDomainRecordGeoIPConfig(request.geoIpConfig) : void 0 + }, + { + param: "http_service_config", + value: request.httpServiceConfig !== void 0 ? marshalDomainRecordHTTPServiceConfig( + request.httpServiceConfig + ) : void 0 + }, + { + param: "weighted_config", + value: request.weightedConfig !== void 0 ? marshalDomainRecordWeightedConfig(request.weightedConfig) : void 0 + }, + { + param: "view_config", + value: request.viewConfig !== void 0 ? marshalDomainRecordViewConfig(request.viewConfig) : void 0 + } + ]) +}); +const marshalRecordIdentifier = (request, defaults) => ({ + data: request.data, + name: request.name, + ttl: request.ttl, + type: request.type +}); +const marshalRecordChangeAdd = (request, defaults) => ({ + records: request.records.map((elt) => marshalDomainRecord(elt)) +}); +const marshalRecordChangeClear = (request, defaults) => ({}); +const marshalRecordChangeDelete = (request, defaults) => ({ + ...marshalling.resolveOneOf([ + { param: "id", value: request.id }, + { + param: "id_fields", + value: request.idFields !== void 0 ? marshalRecordIdentifier(request.idFields) : void 0 + } + ]) +}); +const marshalRecordChangeSet = (request, defaults) => ({ + records: request.records.map((elt) => marshalDomainRecord(elt)), + ...marshalling.resolveOneOf([ + { param: "id", value: request.id }, + { + param: "id_fields", + value: request.idFields !== void 0 ? marshalRecordIdentifier(request.idFields) : void 0 + } + ]) +}); +const marshalRecordChange = (request, defaults) => ({ + ...marshalling.resolveOneOf([ + { + param: "add", + value: request.add !== void 0 ? marshalRecordChangeAdd(request.add) : void 0 + }, + { + param: "set", + value: request.set !== void 0 ? marshalRecordChangeSet(request.set) : void 0 + }, + { + param: "delete", + value: request.delete !== void 0 ? marshalRecordChangeDelete(request.delete) : void 0 + }, + { + param: "clear", + value: request.clear !== void 0 ? marshalRecordChangeClear(request.clear) : void 0 + } + ]) +}); +const marshalUpdateDNSZoneRecordsRequest = (request, defaults) => ({ + changes: request.changes.map((elt) => marshalRecordChange(elt)), + disallow_new_zone_creation: request.disallowNewZoneCreation, + return_all_records: request.returnAllRecords, + serial: request.serial +}); +const marshalUpdateDNSZoneRequest = (request, defaults) => ({ + new_dns_zone: request.newDnsZone, + project_id: request.projectId ?? defaults.defaultProjectId +}); +exports.marshalCloneDNSZoneRequest = marshalCloneDNSZoneRequest; +exports.marshalCreateDNSZoneRequest = marshalCreateDNSZoneRequest; +exports.marshalCreateSSLCertificateRequest = marshalCreateSSLCertificateRequest; +exports.marshalDSRecord = marshalDSRecord; +exports.marshalImportProviderDNSZoneRequest = marshalImportProviderDNSZoneRequest; +exports.marshalImportRawDNSZoneRequest = marshalImportRawDNSZoneRequest; +exports.marshalRefreshDNSZoneRequest = marshalRefreshDNSZoneRequest; +exports.marshalRegistrarApiBuyDomainsRequest = marshalRegistrarApiBuyDomainsRequest; +exports.marshalRegistrarApiCheckContactsCompatibilityRequest = marshalRegistrarApiCheckContactsCompatibilityRequest; +exports.marshalRegistrarApiCreateDomainHostRequest = marshalRegistrarApiCreateDomainHostRequest; +exports.marshalRegistrarApiEnableDomainDNSSECRequest = marshalRegistrarApiEnableDomainDNSSECRequest; +exports.marshalRegistrarApiRegisterExternalDomainRequest = marshalRegistrarApiRegisterExternalDomainRequest; +exports.marshalRegistrarApiRenewDomainsRequest = marshalRegistrarApiRenewDomainsRequest; +exports.marshalRegistrarApiTradeDomainRequest = marshalRegistrarApiTradeDomainRequest; +exports.marshalRegistrarApiTransferInDomainRequest = marshalRegistrarApiTransferInDomainRequest; +exports.marshalRegistrarApiUpdateContactRequest = marshalRegistrarApiUpdateContactRequest; +exports.marshalRegistrarApiUpdateDomainHostRequest = marshalRegistrarApiUpdateDomainHostRequest; +exports.marshalRegistrarApiUpdateDomainRequest = marshalRegistrarApiUpdateDomainRequest; +exports.marshalUpdateDNSZoneNameserversRequest = marshalUpdateDNSZoneNameserversRequest; +exports.marshalUpdateDNSZoneRecordsRequest = marshalUpdateDNSZoneRecordsRequest; +exports.marshalUpdateDNSZoneRequest = marshalUpdateDNSZoneRequest; +exports.unmarshalCheckContactsCompatibilityResponse = unmarshalCheckContactsCompatibilityResponse; +exports.unmarshalClearDNSZoneRecordsResponse = unmarshalClearDNSZoneRecordsResponse; +exports.unmarshalContact = unmarshalContact; +exports.unmarshalDNSZone = unmarshalDNSZone; +exports.unmarshalDSRecord = unmarshalDSRecord; +exports.unmarshalDeleteDNSZoneResponse = unmarshalDeleteDNSZoneResponse; +exports.unmarshalDeleteExternalDomainResponse = unmarshalDeleteExternalDomainResponse; +exports.unmarshalDeleteSSLCertificateResponse = unmarshalDeleteSSLCertificateResponse; +exports.unmarshalDomain = unmarshalDomain; +exports.unmarshalGetDNSZoneTsigKeyResponse = unmarshalGetDNSZoneTsigKeyResponse; +exports.unmarshalGetDNSZoneVersionDiffResponse = unmarshalGetDNSZoneVersionDiffResponse; +exports.unmarshalGetDomainAuthCodeResponse = unmarshalGetDomainAuthCodeResponse; +exports.unmarshalHost = unmarshalHost; +exports.unmarshalImportProviderDNSZoneResponse = unmarshalImportProviderDNSZoneResponse; +exports.unmarshalImportRawDNSZoneResponse = unmarshalImportRawDNSZoneResponse; +exports.unmarshalListContactsResponse = unmarshalListContactsResponse; +exports.unmarshalListDNSZoneNameserversResponse = unmarshalListDNSZoneNameserversResponse; +exports.unmarshalListDNSZoneRecordsResponse = unmarshalListDNSZoneRecordsResponse; +exports.unmarshalListDNSZoneVersionRecordsResponse = unmarshalListDNSZoneVersionRecordsResponse; +exports.unmarshalListDNSZoneVersionsResponse = unmarshalListDNSZoneVersionsResponse; +exports.unmarshalListDNSZonesResponse = unmarshalListDNSZonesResponse; +exports.unmarshalListDomainHostsResponse = unmarshalListDomainHostsResponse; +exports.unmarshalListDomainsResponse = unmarshalListDomainsResponse; +exports.unmarshalListRenewableDomainsResponse = unmarshalListRenewableDomainsResponse; +exports.unmarshalListSSLCertificatesResponse = unmarshalListSSLCertificatesResponse; +exports.unmarshalListTasksResponse = unmarshalListTasksResponse; +exports.unmarshalListTldsResponse = unmarshalListTldsResponse; +exports.unmarshalOrderResponse = unmarshalOrderResponse; +exports.unmarshalRefreshDNSZoneResponse = unmarshalRefreshDNSZoneResponse; +exports.unmarshalRegisterExternalDomainResponse = unmarshalRegisterExternalDomainResponse; +exports.unmarshalRestoreDNSZoneVersionResponse = unmarshalRestoreDNSZoneVersionResponse; +exports.unmarshalSSLCertificate = unmarshalSSLCertificate; +exports.unmarshalSearchAvailableDomainsResponse = unmarshalSearchAvailableDomainsResponse; +exports.unmarshalTask = unmarshalTask; +exports.unmarshalUpdateDNSZoneNameserversResponse = unmarshalUpdateDNSZoneNameserversResponse; +exports.unmarshalUpdateDNSZoneRecordsResponse = unmarshalUpdateDNSZoneRecordsResponse; - /** - * Get given logs of a Database Instance. Retrieve information about the logs - * of a Database Instance. Specify the `instance_log_id` and `region` in your - * request to get information such as `download_url`, `status`, `expires_at` - * and `created_at` about your logs in the response. - * - * @param request - The request {@link GetInstanceLogRequest} - * @returns A Promise of InstanceLog - */ - getInstanceLog = request => this.client.fetch({ - method: 'GET', - path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/logs/${validatePathParam('instanceLogId', request.instanceLogId)}` - }, unmarshalInstanceLog$1); - /** - * Waits for {@link InstanceLog} to be in a final state. - * - * @param request - The request {@link GetInstanceLogRequest} - * @param options - The waiting options - * @returns A Promise of InstanceLog - */ - waitForInstanceLog = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!INSTANCE_LOG_TRANSIENT_STATUSES$1.includes(res.status))), this.getInstanceLog, request, options); +/***/ }), - /** - * Purge remote Database Instance logs. Purge a given remote log from a - * Database Instance. You can specify the `log_name` of the log you wish to - * clean from your Database Instance. - * - * @param request - The request {@link PurgeInstanceLogsRequest} - */ - purgeInstanceLogs = request => this.client.fetch({ - body: JSON.stringify(marshalPurgeInstanceLogsRequest$1(request, this.client.settings)), - headers: jsonContentHeaders$l, - method: 'POST', - path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/purge-logs` - }); +/***/ 7520: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - /** - * List remote Database Instance logs details. List remote log details. By - * default, the details returned in the list are ordered by creation date in - * ascending order, though this can be modified via the order_by field. - * - * @param request - The request {@link ListInstanceLogsDetailsRequest} - * @returns A Promise of ListInstanceLogsDetailsResponse - */ - listInstanceLogsDetails = request => this.client.fetch({ - method: 'GET', - path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/logs-details` - }, unmarshalListInstanceLogsDetailsResponse$1); +"use strict"; - /** - * Add Database Instance advanced settings. Add an advanced setting to a - * Database Instance. You must set the `name` and the `value` of each - * setting. - * - * @param request - The request {@link AddInstanceSettingsRequest} - * @returns A Promise of AddInstanceSettingsResponse - */ - addInstanceSettings = request => this.client.fetch({ - body: JSON.stringify(marshalAddInstanceSettingsRequest$1(request, this.client.settings)), - headers: jsonContentHeaders$l, - method: 'POST', - path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/settings` - }, unmarshalAddInstanceSettingsResponse$1); +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const index_gen = __nccwpck_require__(9415); +exports.v1alpha1 = index_gen; - /** - * Delete Database Instance advanced settings. Delete an advanced setting in a - * Database Instance. You must specify the names of the settings you want to - * delete in the request. - * - * @param request - The request {@link DeleteInstanceSettingsRequest} - * @returns A Promise of DeleteInstanceSettingsResponse - */ - deleteInstanceSettings = request => this.client.fetch({ - body: JSON.stringify(marshalDeleteInstanceSettingsRequest$1(request, this.client.settings)), - headers: jsonContentHeaders$l, - method: 'DELETE', - path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/settings` - }, unmarshalDeleteInstanceSettingsResponse$1); +/***/ }), + +/***/ 2223: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const intervalRetrier = __nccwpck_require__(9052); +const api = __nccwpck_require__(3042); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const resourcePaginator = __nccwpck_require__(4983); +const content_gen = __nccwpck_require__(2932); +const marshalling_gen = __nccwpck_require__(389); +const jsonContentHeaders = { + "Content-Type": "application/json; charset=utf-8" +}; +class API extends api.API { + pageOfListPipelines = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/edge-services/v1alpha1/pipelines`, + urlParams: marshalling.urlParams( + ["has_backend_stage_lb", request.hasBackendStageLb], + ["name", request.name], + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId] + ) + }, + marshalling_gen.unmarshalListPipelinesResponse + ); /** - * Set Database Instance advanced settings. Update an advanced setting for a - * Database Instance. Settings added upon database engine initalization can - * only be defined once, and cannot, therefore, be updated. + * List pipelines. List all pipelines, for a Scaleway Organization or Scaleway + * Project. By default, the pipelines returned in the list are ordered by + * creation date in ascending order, though this can be modified via the + * `order_by` field. * - * @param request - The request {@link SetInstanceSettingsRequest} - * @returns A Promise of SetInstanceSettingsResponse + * @param request - The request {@link ListPipelinesRequest} + * @returns A Promise of ListPipelinesResponse */ - setInstanceSettings = request => this.client.fetch({ - body: JSON.stringify(marshalSetInstanceSettingsRequest$1(request, this.client.settings)), - headers: jsonContentHeaders$l, - method: 'PUT', - path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/settings` - }, unmarshalSetInstanceSettingsResponse$1); - pageOfListInstanceACLRules = request => this.client.fetch({ - method: 'GET', - path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/acls`, - urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]) - }, unmarshalListInstanceACLRulesResponse$1); - + listPipelines = (request = {}) => resourcePaginator.enrichForPagination("pipelines", this.pageOfListPipelines, request); /** - * List ACL rules of a Database Instance. List the ACL rules for a given - * Database Instance. The response is an array of ACL objects, each one - * representing an ACL that denies, allows or redirects traffic based on - * certain conditions. + * Create pipeline. Create a new pipeline. You must specify a `dns_stage_id` + * to form a stage-chain that goes all the way to the backend stage (origin), + * so the HTTP request will be processed according to the stages you created. * - * @param request - The request {@link ListInstanceACLRulesRequest} - * @returns A Promise of ListInstanceACLRulesResponse + * @param request - The request {@link CreatePipelineRequest} + * @returns A Promise of Pipeline */ - listInstanceACLRules = request => enrichForPagination('rules', this.pageOfListInstanceACLRules, request); - + createPipeline = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreatePipelineRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/edge-services/v1alpha1/pipelines` + }, + marshalling_gen.unmarshalPipeline + ); /** - * Add an ACL rule to a Database Instance. Add an additional ACL rule to a - * Database Instance. + * Get pipeline. Retrieve information about an existing pipeline, specified by + * its `pipeline_id`. Its full details, including errors, are returned in the + * response object. * - * @param request - The request {@link AddInstanceACLRulesRequest} - * @returns A Promise of AddInstanceACLRulesResponse + * @param request - The request {@link GetPipelineRequest} + * @returns A Promise of Pipeline */ - addInstanceACLRules = request => this.client.fetch({ - body: JSON.stringify(marshalAddInstanceACLRulesRequest$1(request, this.client.settings)), - headers: jsonContentHeaders$l, - method: 'POST', - path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/acls` - }, unmarshalAddInstanceACLRulesResponse$1); - + getPipeline = (request) => this.client.fetch( + { + method: "GET", + path: `/edge-services/v1alpha1/pipelines/${marshalling.validatePathParam("pipelineId", request.pipelineId)}` + }, + marshalling_gen.unmarshalPipeline + ); /** - * Set ACL rules for a Database Instance. Replace all the ACL rules of a - * Database Instance. + * Waits for {@link Pipeline} to be in a final state. * - * @param request - The request {@link SetInstanceACLRulesRequest} - * @returns A Promise of SetInstanceACLRulesResponse - */ - setInstanceACLRules = request => this.client.fetch({ - body: JSON.stringify(marshalSetInstanceACLRulesRequest$1(request, this.client.settings)), - headers: jsonContentHeaders$l, - method: 'PUT', - path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/acls` - }, unmarshalSetInstanceACLRulesResponse$1); - + * @param request - The request {@link GetPipelineRequest} + * @param options - The waiting options + * @returns A Promise of Pipeline + */ + waitForPipeline = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve(!content_gen.PIPELINE_TRANSIENT_STATUSES.includes(res.status))), + this.getPipeline, + request, + options + ); + /** + * Update pipeline. Update the parameters of an existing pipeline, specified + * by its `pipeline_id`. Parameters which can be updated include the `name`, + * `description` and `dns_stage_id`. + * + * @param request - The request {@link UpdatePipelineRequest} + * @returns A Promise of Pipeline + */ + updatePipeline = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdatePipelineRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/edge-services/v1alpha1/pipelines/${marshalling.validatePathParam("pipelineId", request.pipelineId)}` + }, + marshalling_gen.unmarshalPipeline + ); /** - * Delete ACL rules of a Database Instance. Delete one or more ACL rules of a - * Database Instance. + * Delete pipeline. Delete an existing pipeline, specified by its + * `pipeline_id`. Deleting a pipeline is permanent, and cannot be undone. Note + * that all stages linked to the pipeline are also deleted. * - * @param request - The request {@link DeleteInstanceACLRulesRequest} - * @returns A Promise of DeleteInstanceACLRulesResponse + * @param request - The request {@link DeletePipelineRequest} */ - deleteInstanceACLRules = request => this.client.fetch({ - body: JSON.stringify(marshalDeleteInstanceACLRulesRequest$1(request, this.client.settings)), - headers: jsonContentHeaders$l, - method: 'DELETE', - path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/acls` - }, unmarshalDeleteInstanceACLRulesResponse$1); - pageOfListUsers = request => this.client.fetch({ - method: 'GET', - path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/users`, - urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'name_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]) - }, unmarshalListUsersResponse$2); - + deletePipeline = (request) => this.client.fetch({ + method: "DELETE", + path: `/edge-services/v1alpha1/pipelines/${marshalling.validatePathParam("pipelineId", request.pipelineId)}` + }); + pageOfListDNSStages = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/edge-services/v1alpha1/dns-stages`, + urlParams: marshalling.urlParams( + ["fqdn", request.fqdn], + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["pipeline_id", request.pipelineId], + ["project_id", request.projectId] + ) + }, + marshalling_gen.unmarshalListDNSStagesResponse + ); /** - * List users of a Database Instance. List all users of a given Database - * Instance. By default, the users returned in the list are ordered by - * creation date in ascending order, though this can be modified via the - * order_by field. + * List DNS stages. List all DNS stages, for a Scaleway Organization or + * Scaleway Project. By default, the DNS stages returned in the list are + * ordered by creation date in ascending order, though this can be modified + * via the `order_by` field. * - * @param request - The request {@link ListUsersRequest} - * @returns A Promise of ListUsersResponse + * @param request - The request {@link ListDNSStagesRequest} + * @returns A Promise of ListDNSStagesResponse */ - listUsers = request => enrichForPagination('users', this.pageOfListUsers, request); - + listDNSStages = (request = {}) => resourcePaginator.enrichForPagination("stages", this.pageOfListDNSStages, request); /** - * Create a user for a Database Instance. Create a new user for a Database - * Instance. You must define the `name`, `password` and `is_admin` - * parameters. + * Create DNS stage. Create a new DNS stage. You must specify the `fqdns` + * field to customize the domain endpoint, using a domain you already own. * - * @param request - The request {@link CreateUserRequest} - * @returns A Promise of User + * @param request - The request {@link CreateDNSStageRequest} + * @returns A Promise of DNSStage */ - createUser = request => this.client.fetch({ - body: JSON.stringify(marshalCreateUserRequest$2(request, this.client.settings)), - headers: jsonContentHeaders$l, - method: 'POST', - path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/users` - }, unmarshalUser$2); - + createDNSStage = (request = {}) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateDNSStageRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/edge-services/v1alpha1/dns-stages` + }, + marshalling_gen.unmarshalDNSStage + ); /** - * Update a user on a Database Instance. Update the parameters of a user on a - * Database Instance. You can update the `password` and `is_admin` parameters, - * but you cannot change the name of the user. + * Get DNS stage. Retrieve information about an existing DNS stage, specified + * by its `dns_stage_id`. Its full details, including FQDNs, are returned in + * the response object. * - * @param request - The request {@link UpdateUserRequest} - * @returns A Promise of User + * @param request - The request {@link GetDNSStageRequest} + * @returns A Promise of DNSStage */ - updateUser = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateUserRequest$1(request, this.client.settings)), - headers: jsonContentHeaders$l, - method: 'PATCH', - path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/users/${validatePathParam('name', request.name)}` - }, unmarshalUser$2); - + getDNSStage = (request) => this.client.fetch( + { + method: "GET", + path: `/edge-services/v1alpha1/dns-stages/${marshalling.validatePathParam("dnsStageId", request.dnsStageId)}` + }, + marshalling_gen.unmarshalDNSStage + ); + /** + * Update DNS stage. Update the parameters of an existing DNS stage, specified + * by its `dns_stage_id`. + * + * @param request - The request {@link UpdateDNSStageRequest} + * @returns A Promise of DNSStage + */ + updateDNSStage = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateDNSStageRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/edge-services/v1alpha1/dns-stages/${marshalling.validatePathParam("dnsStageId", request.dnsStageId)}` + }, + marshalling_gen.unmarshalDNSStage + ); /** - * Delete a user on a Database Instance. Delete a given user on a Database - * Instance. You must specify, in the endpoint, the `region`, `instance_id` - * and `name` parameters of the user you want to delete. + * Delete DNS stage. Delete an existing DNS stage, specified by its + * `dns_stage_id`. Deleting a DNS stage is permanent, and cannot be undone. * - * @param request - The request {@link DeleteUserRequest} + * @param request - The request {@link DeleteDNSStageRequest} */ - deleteUser = request => this.client.fetch({ - method: 'DELETE', - path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/users/${validatePathParam('name', request.name)}` + deleteDNSStage = (request) => this.client.fetch({ + method: "DELETE", + path: `/edge-services/v1alpha1/dns-stages/${marshalling.validatePathParam("dnsStageId", request.dnsStageId)}` }); - pageOfListDatabases = request => this.client.fetch({ - method: 'GET', - path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/databases`, - urlParams: urlParams(['managed', request.managed], ['name', request.name], ['order_by', request.orderBy ?? 'name_asc'], ['owner', request.owner], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]) - }, unmarshalListDatabasesResponse$1); - + pageOfListTLSStages = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/edge-services/v1alpha1/tls-stages`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["pipeline_id", request.pipelineId], + ["project_id", request.projectId], + ["secret_id", request.secretId], + ["secret_region", request.secretRegion] + ) + }, + marshalling_gen.unmarshalListTLSStagesResponse + ); /** - * List databases in a Database Instance. List all databases of a given - * Database Instance. By default, the databases returned in the list are + * List TLS stages. List all TLS stages, for a Scaleway Organization or + * Scaleway Project. By default, the TLS stages returned in the list are * ordered by creation date in ascending order, though this can be modified - * via the order_by field. You can define additional parameters for your - * query, such as `name`, `managed` and `owner`. - * - * @param request - The request {@link ListDatabasesRequest} - * @returns A Promise of ListDatabasesResponse - */ - listDatabases = request => enrichForPagination('databases', this.pageOfListDatabases, request); - + * via the `order_by` field. + * + * @param request - The request {@link ListTLSStagesRequest} + * @returns A Promise of ListTLSStagesResponse + */ + listTLSStages = (request = {}) => resourcePaginator.enrichForPagination("stages", this.pageOfListTLSStages, request); + /** + * Create TLS stage. Create a new TLS stage. You must specify either the + * `secrets` or `managed_certificate` fields to customize the SSL/TLS + * certificate of your endpoint. Choose `secrets` if you are using a + * pre-existing certificate held in Scaleway Secret Manager, or + * `managed_certificate` to let Scaleway generate and manage a Let's Encrypt + * certificate for your customized endpoint. + * + * @param request - The request {@link CreateTLSStageRequest} + * @returns A Promise of TLSStage + */ + createTLSStage = (request = {}) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateTLSStageRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/edge-services/v1alpha1/tls-stages` + }, + marshalling_gen.unmarshalTLSStage + ); /** - * Create a database in a Database Instance. Create a new database. You must - * define the `name` parameter in the request. + * Get TLS stage. Retrieve information about an existing TLS stage, specified + * by its `tls_stage_id`. Its full details, including secrets and certificate + * expiration date are returned in the response object. * - * @param request - The request {@link CreateDatabaseRequest} - * @returns A Promise of Database + * @param request - The request {@link GetTLSStageRequest} + * @returns A Promise of TLSStage */ - createDatabase = request => this.client.fetch({ - body: JSON.stringify(marshalCreateDatabaseRequest$1(request, this.client.settings)), - headers: jsonContentHeaders$l, - method: 'POST', - path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/databases` - }, unmarshalDatabase$1); - + getTLSStage = (request) => this.client.fetch( + { + method: "GET", + path: `/edge-services/v1alpha1/tls-stages/${marshalling.validatePathParam("tlsStageId", request.tlsStageId)}` + }, + marshalling_gen.unmarshalTLSStage + ); + /** + * Update TLS stage. Update the parameters of an existing TLS stage, specified + * by its `tls_stage_id`. Both `tls_secrets_config` and `managed_certificate` + * parameters can be updated. + * + * @param request - The request {@link UpdateTLSStageRequest} + * @returns A Promise of TLSStage + */ + updateTLSStage = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateTLSStageRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/edge-services/v1alpha1/tls-stages/${marshalling.validatePathParam("tlsStageId", request.tlsStageId)}` + }, + marshalling_gen.unmarshalTLSStage + ); /** - * Delete a database in a Database Instance. Delete a given database on a - * Database Instance. You must specify, in the endpoint, the `region`, - * `instance_id` and `name` parameters of the database you want to delete. + * Delete TLS stage. Delete an existing TLS stage, specified by its + * `tls_stage_id`. Deleting a TLS stage is permanent, and cannot be undone. * - * @param request - The request {@link DeleteDatabaseRequest} + * @param request - The request {@link DeleteTLSStageRequest} */ - deleteDatabase = request => this.client.fetch({ - method: 'DELETE', - path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/databases/${validatePathParam('name', request.name)}` + deleteTLSStage = (request) => this.client.fetch({ + method: "DELETE", + path: `/edge-services/v1alpha1/tls-stages/${marshalling.validatePathParam("tlsStageId", request.tlsStageId)}` }); - pageOfListPrivileges = request => this.client.fetch({ - method: 'GET', - path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/privileges`, - urlParams: urlParams(['database_name', request.databaseName], ['order_by', request.orderBy ?? 'user_name_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['user_name', request.userName]) - }, unmarshalListPrivilegesResponse$1); - - /** - * List user privileges for a database. List privileges of a user on a - * database. By default, the details returned in the list are ordered by - * creation date in ascending order, though this can be modified via the - * order_by field. You can define additional parameters for your query, such - * as `database_name` and `user_name`. - * - * @param request - The request {@link ListPrivilegesRequest} - * @returns A Promise of ListPrivilegesResponse - */ - listPrivileges = request => enrichForPagination('privileges', this.pageOfListPrivileges, request); - + pageOfListCacheStages = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/edge-services/v1alpha1/cache-stages`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["pipeline_id", request.pipelineId], + ["project_id", request.projectId] + ) + }, + marshalling_gen.unmarshalListCacheStagesResponse + ); /** - * Set user privileges for a database. Set the privileges of a user on a - * database. You must define `database_name`, `user_name` and `permission` in - * the request body. + * List cache stages. List all cache stages, for a Scaleway Organization or + * Scaleway Project. By default, the cache stages returned in the list are + * ordered by creation date in ascending order, though this can be modified + * via the `order_by` field. * - * @param request - The request {@link SetPrivilegeRequest} - * @returns A Promise of Privilege + * @param request - The request {@link ListCacheStagesRequest} + * @returns A Promise of ListCacheStagesResponse */ - setPrivilege = request => this.client.fetch({ - body: JSON.stringify(marshalSetPrivilegeRequest$1(request, this.client.settings)), - headers: jsonContentHeaders$l, - method: 'PUT', - path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/privileges` - }, unmarshalPrivilege$1); - pageOfListSnapshots = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/snapshots`, - urlParams: urlParams(['instance_id', request.instanceId], ['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId]) - }, unmarshalListSnapshotsResponse$2); - + listCacheStages = (request = {}) => resourcePaginator.enrichForPagination("stages", this.pageOfListCacheStages, request); /** - * List snapshots. List snapshots. You can include the `instance_id` or - * `project_id` in your query to get the list of snapshots for specific - * Database Instances and/or Projects. By default, the details returned in the - * list are ordered by creation date in ascending order, though this can be - * modified via the `order_by` field. + * Create cache stage. Create a new cache stage. You must specify the + * `fallback_ttl` field to customize the TTL of the cache. * - * @param request - The request {@link ListSnapshotsRequest} - * @returns A Promise of ListSnapshotsResponse + * @param request - The request {@link CreateCacheStageRequest} + * @returns A Promise of CacheStage */ - listSnapshots = (request = {}) => enrichForPagination('snapshots', this.pageOfListSnapshots, request); - + createCacheStage = (request = {}) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateCacheStageRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/edge-services/v1alpha1/cache-stages` + }, + marshalling_gen.unmarshalCacheStage + ); /** - * Get a Database Instance snapshot. Retrieve information about a given - * snapshot, specified by its `snapshot_id` and `region`. Full details about - * the snapshot, like size and expiration date, are returned in the response. + * Get cache stage. Retrieve information about an existing cache stage, + * specified by its `cache_stage_id`. Its full details, including Time To Live + * (TTL), are returned in the response object. * - * @param request - The request {@link GetSnapshotRequest} - * @returns A Promise of Snapshot + * @param request - The request {@link GetCacheStageRequest} + * @returns A Promise of CacheStage */ - getSnapshot = request => this.client.fetch({ - method: 'GET', - path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/snapshots/${validatePathParam('snapshotId', request.snapshotId)}` - }, unmarshalSnapshot$2); - + getCacheStage = (request) => this.client.fetch( + { + method: "GET", + path: `/edge-services/v1alpha1/cache-stages/${marshalling.validatePathParam("cacheStageId", request.cacheStageId)}` + }, + marshalling_gen.unmarshalCacheStage + ); + /** + * Update cache stage. Update the parameters of an existing cache stage, + * specified by its `cache_stage_id`. Parameters which can be updated include + * the `fallback_ttl` and `backend_stage_id`. + * + * @param request - The request {@link UpdateCacheStageRequest} + * @returns A Promise of CacheStage + */ + updateCacheStage = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateCacheStageRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/edge-services/v1alpha1/cache-stages/${marshalling.validatePathParam("cacheStageId", request.cacheStageId)}` + }, + marshalling_gen.unmarshalCacheStage + ); /** - * Waits for {@link Snapshot} to be in a final state. + * Delete cache stage. Delete an existing cache stage, specified by its + * `cache_stage_id`. Deleting a cache stage is permanent, and cannot be + * undone. * - * @param request - The request {@link GetSnapshotRequest} - * @param options - The waiting options - * @returns A Promise of Snapshot + * @param request - The request {@link DeleteCacheStageRequest} */ - waitForSnapshot = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!SNAPSHOT_TRANSIENT_STATUSES$2.includes(res.status))), this.getSnapshot, request, options); - + deleteCacheStage = (request) => this.client.fetch({ + method: "DELETE", + path: `/edge-services/v1alpha1/cache-stages/${marshalling.validatePathParam("cacheStageId", request.cacheStageId)}` + }); + pageOfListBackendStages = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/edge-services/v1alpha1/backend-stages`, + urlParams: marshalling.urlParams( + ["bucket_name", request.bucketName], + ["bucket_region", request.bucketRegion], + ["lb_id", request.lbId], + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["pipeline_id", request.pipelineId], + ["project_id", request.projectId] + ) + }, + marshalling_gen.unmarshalListBackendStagesResponse + ); /** - * Create a Database Instance snapshot. Create a new snapshot of a Database - * Instance. You must define the `name` parameter in the request. + * List backend stages. List all backend stages, for a Scaleway Organization + * or Scaleway Project. By default, the backend stages returned in the list + * are ordered by creation date in ascending order, though this can be + * modified via the `order_by` field. * - * @param request - The request {@link CreateSnapshotRequest} - * @returns A Promise of Snapshot + * @param request - The request {@link ListBackendStagesRequest} + * @returns A Promise of ListBackendStagesResponse */ - createSnapshot = request => this.client.fetch({ - body: JSON.stringify(marshalCreateSnapshotRequest$2(request, this.client.settings)), - headers: jsonContentHeaders$l, - method: 'POST', - path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/snapshots` - }, unmarshalSnapshot$2); - + listBackendStages = (request = {}) => resourcePaginator.enrichForPagination("stages", this.pageOfListBackendStages, request); /** - * Update a Database Instance snapshot. Update the parameters of a snapshot of - * a Database Instance. You can update the `name` and `expires_at` - * parameters. + * Create backend stage. Create a new backend stage. You must specify either a + * `scaleway_s3` (for a Scaleway Object Storage bucket) or `scaleway_lb` (for + * a Scaleway Load Balancer) field to configure the origin. * - * @param request - The request {@link UpdateSnapshotRequest} - * @returns A Promise of Snapshot + * @param request - The request {@link CreateBackendStageRequest} + * @returns A Promise of BackendStage */ - updateSnapshot = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateSnapshotRequest$1(request, this.client.settings)), - headers: jsonContentHeaders$l, - method: 'PATCH', - path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/snapshots/${validatePathParam('snapshotId', request.snapshotId)}` - }, unmarshalSnapshot$2); - + createBackendStage = (request = {}) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateBackendStageRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/edge-services/v1alpha1/backend-stages` + }, + marshalling_gen.unmarshalBackendStage + ); /** - * Delete a Database Instance snapshot. Delete a given snapshot of a Database - * Instance. You must specify, in the endpoint, the `region` and `snapshot_id` - * parameters of the snapshot you want to delete. + * Get backend stage. Retrieve information about an existing backend stage, + * specified by its `backend_stage_id`. Its full details, including + * `scaleway_s3` or `scaleway_lb`, are returned in the response object. * - * @param request - The request {@link DeleteSnapshotRequest} - * @returns A Promise of Snapshot + * @param request - The request {@link GetBackendStageRequest} + * @returns A Promise of BackendStage */ - deleteSnapshot = request => this.client.fetch({ - method: 'DELETE', - path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/snapshots/${validatePathParam('snapshotId', request.snapshotId)}` - }, unmarshalSnapshot$2); - + getBackendStage = (request) => this.client.fetch( + { + method: "GET", + path: `/edge-services/v1alpha1/backend-stages/${marshalling.validatePathParam("backendStageId", request.backendStageId)}` + }, + marshalling_gen.unmarshalBackendStage + ); + /** + * Update backend stage. Update the parameters of an existing backend stage, + * specified by its `backend_stage_id`. + * + * @param request - The request {@link UpdateBackendStageRequest} + * @returns A Promise of BackendStage + */ + updateBackendStage = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateBackendStageRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/edge-services/v1alpha1/backend-stages/${marshalling.validatePathParam("backendStageId", request.backendStageId)}` + }, + marshalling_gen.unmarshalBackendStage + ); /** - * Create a new Database Instance from a snapshot. Restore a snapshot. When - * you restore a snapshot, a new Instance is created and billed to your - * account. Note that is possible to select a larger node type for your new - * Database Instance. However, the Block volume size will be the same as the - * size of the restored snapshot. All Instance settings will be restored if - * you chose a node type with the same or more memory size than the initial - * Instance. Settings will be reset to the default if your node type has less - * memory. + * Delete backend stage. Delete an existing backend stage, specified by its + * `backend_stage_id`. Deleting a backend stage is permanent, and cannot be + * undone. * - * @param request - The request {@link CreateInstanceFromSnapshotRequest} - * @returns A Promise of Instance + * @param request - The request {@link DeleteBackendStageRequest} */ - createInstanceFromSnapshot = request => this.client.fetch({ - body: JSON.stringify(marshalCreateInstanceFromSnapshotRequest$1(request, this.client.settings)), - headers: jsonContentHeaders$l, - method: 'POST', - path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/snapshots/${validatePathParam('snapshotId', request.snapshotId)}/create-instance` - }, unmarshalInstance$2); - + deleteBackendStage = (request) => this.client.fetch({ + method: "DELETE", + path: `/edge-services/v1alpha1/backend-stages/${marshalling.validatePathParam("backendStageId", request.backendStageId)}` + }); + checkDomain = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCheckDomainRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/edge-services/v1alpha1/check-domain` + }, + marshalling_gen.unmarshalCheckDomainResponse + ); + checkPEMChain = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCheckPEMChainRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/edge-services/v1alpha1/check-pem-chain` + }, + marshalling_gen.unmarshalCheckPEMChainResponse + ); + pageOfListPurgeRequests = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/edge-services/v1alpha1/purge-requests`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["pipeline_id", request.pipelineId], + ["project_id", request.projectId] + ) + }, + marshalling_gen.unmarshalListPurgeRequestsResponse + ); /** - * Create a new Database Instance endpoint. Create a new endpoint for a - * Database Instance. You can add `load_balancer` and `private_network` - * specifications to the body of the request. + * List purge requests. List all purge requests, for a Scaleway Organization + * or Scaleway Project. This enables you to retrieve a history of all + * previously-made purge requests. By default, the purge requests returned in + * the list are ordered by creation date in ascending order, though this can + * be modified via the `order_by` field. * - * @param request - The request {@link CreateEndpointRequest} - * @returns A Promise of Endpoint + * @param request - The request {@link ListPurgeRequestsRequest} + * @returns A Promise of ListPurgeRequestsResponse */ - createEndpoint = request => this.client.fetch({ - body: JSON.stringify(marshalCreateEndpointRequest$1(request, this.client.settings)), - headers: jsonContentHeaders$l, - method: 'POST', - path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/endpoints` - }, unmarshalEndpoint$2); - + listPurgeRequests = (request = {}) => resourcePaginator.enrichForPagination("purgeRequests", this.pageOfListPurgeRequests, request); /** - * Delete a Database Instance endpoint. Delete the endpoint of a Database - * Instance. You must specify the `region` and `endpoint_id` parameters of the - * endpoint you want to delete. Note that might need to update any environment - * configurations that point to the deleted endpoint. + * Create purge request. Create a new purge request. You must specify either + * the `all` field (to purge all content) or a list of `assets` (to define the + * precise assets to purge). * - * @param request - The request {@link DeleteEndpointRequest} + * @param request - The request {@link CreatePurgeRequestRequest} + * @returns A Promise of PurgeRequest */ - deleteEndpoint = request => this.client.fetch({ - method: 'DELETE', - path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/endpoints/${validatePathParam('endpointId', request.endpointId)}` - }); - + createPurgeRequest = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreatePurgeRequestRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/edge-services/v1alpha1/purge-requests` + }, + marshalling_gen.unmarshalPurgeRequest + ); /** - * Get a Database Instance endpoint. Retrieve information about a Database - * Instance endpoint. Full details about the endpoint, like `ip`, `port`, - * `private_network` and `load_balancer` specifications are returned in the - * response. + * Get purge request. Retrieve information about a purge request, specified by + * its `purge_request_id`. Its full details, including `status` and `target`, + * are returned in the response object. * - * @param request - The request {@link GetEndpointRequest} - * @returns A Promise of Endpoint + * @param request - The request {@link GetPurgeRequestRequest} + * @returns A Promise of PurgeRequest */ - getEndpoint = request => this.client.fetch({ - method: 'GET', - path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/endpoints/${validatePathParam('endpointId', request.endpointId)}` - }, unmarshalEndpoint$2); - + getPurgeRequest = (request) => this.client.fetch( + { + method: "GET", + path: `/edge-services/v1alpha1/purge-requests/${marshalling.validatePathParam("purgeRequestId", request.purgeRequestId)}` + }, + marshalling_gen.unmarshalPurgeRequest + ); /** - * Migrate Database Instance endpoint. Migrate an existing Database Instance - * endpoint to another Database Instance. + * Waits for {@link PurgeRequest} to be in a final state. * - * @param request - The request {@link MigrateEndpointRequest} - * @returns A Promise of Endpoint - */ - migrateEndpoint = request => this.client.fetch({ - body: JSON.stringify(marshalMigrateEndpointRequest$1(request, this.client.settings)), - headers: jsonContentHeaders$l, - method: 'POST', - path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/endpoints/${validatePathParam('endpointId', request.endpointId)}/migrate` - }, unmarshalEndpoint$2); -}; + * @param request - The request {@link GetPurgeRequestRequest} + * @param options - The waiting options + * @returns A Promise of PurgeRequest + */ + waitForPurgeRequest = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve( + !content_gen.PURGE_REQUEST_TRANSIENT_STATUSES.includes(res.status) + )), + this.getPurgeRequest, + request, + options + ); + checkLbOrigin = (request = {}) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCheckLbOriginRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/edge-services/v1alpha1/check-lb-origin` + }, + marshalling_gen.unmarshalCheckLbOriginResponse + ); + listPlans = () => this.client.fetch( + { + method: "GET", + path: `/edge-services/v1alpha1/plans` + }, + marshalling_gen.unmarshalListPlansResponse + ); + selectPlan = (request = {}) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalSelectPlanRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/edge-services/v1alpha1/current-plan` + }, + marshalling_gen.unmarshalPlan + ); + getCurrentPlan = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/edge-services/v1alpha1/current-plan/${marshalling.validatePathParam("projectId", request.projectId ?? this.client.settings.defaultProjectId)}` + }, + marshalling_gen.unmarshalPlan + ); + deleteCurrentPlan = (request = {}) => this.client.fetch({ + method: "DELETE", + path: `/edge-services/v1alpha1/current-plan/${marshalling.validatePathParam("projectId", request.projectId ?? this.client.settings.defaultProjectId)}` + }); +} +exports.API = API; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const UpdateInstanceRequest$1 = { - backupScheduleStartHour: { - lessThanOrEqual: 23 - } -}; +/***/ }), -var validationRules_gen$6 = /*#__PURE__*/Object.freeze({ - __proto__: null, - UpdateInstanceRequest: UpdateInstanceRequest$1 -}); +/***/ 2932: +/***/ ((__unused_webpack_module, exports) => { -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. +"use strict"; -var index_gen$k = /*#__PURE__*/Object.freeze({ - __proto__: null, - API: API$m, - INSTANCE_LOG_TRANSIENT_STATUSES: INSTANCE_LOG_TRANSIENT_STATUSES$1, - INSTANCE_TRANSIENT_STATUSES: INSTANCE_TRANSIENT_STATUSES$2, - MAINTENANCE_TRANSIENT_STATUSES: MAINTENANCE_TRANSIENT_STATUSES$1, - READ_REPLICA_TRANSIENT_STATUSES: READ_REPLICA_TRANSIENT_STATUSES$1, - SNAPSHOT_TRANSIENT_STATUSES: SNAPSHOT_TRANSIENT_STATUSES$2, - ValidationRules: validationRules_gen$6 -}); +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const PIPELINE_TRANSIENT_STATUSES = ["pending"]; +const PURGE_REQUEST_TRANSIENT_STATUSES = [ + "pending" +]; +exports.PIPELINE_TRANSIENT_STATUSES = PIPELINE_TRANSIENT_STATUSES; +exports.PURGE_REQUEST_TRANSIENT_STATUSES = PURGE_REQUEST_TRANSIENT_STATUSES; -var index$n = /*#__PURE__*/Object.freeze({ - __proto__: null, - v1beta1: index_gen$k -}); -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. +/***/ }), -/** Lists transient statutes of the enum {@link DNSZoneStatus}. */ -const DNS_ZONE_TRANSIENT_STATUSES = ['pending']; +/***/ 9415: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/** Lists transient statutes of the enum {@link DomainFeatureStatus}. */ -const DOMAIN_FEATURE_TRANSIENT_STATUSES = ['enabling', 'disabling']; +"use strict"; -/** - * Lists transient statutes of the enum - * {@link DomainRegistrationStatusTransferStatus}. - */ -const DOMAIN_REGISTRATION_STATUS_TRANSFER_TRANSIENT_STATUSES = ['pending', 'processing']; +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api_gen = __nccwpck_require__(2223); +const content_gen = __nccwpck_require__(2932); +exports.API = api_gen.API; +exports.PIPELINE_TRANSIENT_STATUSES = content_gen.PIPELINE_TRANSIENT_STATUSES; +exports.PURGE_REQUEST_TRANSIENT_STATUSES = content_gen.PURGE_REQUEST_TRANSIENT_STATUSES; -/** Lists transient statutes of the enum {@link DomainStatus}. */ -const DOMAIN_TRANSIENT_STATUSES$2 = ['creating', 'renewing', 'xfering', 'expiring', 'updating', 'checking', 'deleting']; -/** Lists transient statutes of the enum {@link HostStatus}. */ -const HOST_TRANSIENT_STATUSES = ['updating', 'deleting']; +/***/ }), -/** Lists transient statutes of the enum {@link SSLCertificateStatus}. */ -const SSL_CERTIFICATE_TRANSIENT_STATUSES = ['pending']; +/***/ 389: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/** Lists transient statutes of the enum {@link TaskStatus}. */ -const TASK_TRANSIENT_STATUSES$1 = ['pending']; +"use strict"; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const unmarshalDomainRecordGeoIPConfigMatch = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'DomainRecordGeoIPConfigMatch' failed as data isn't a dictionary.`); +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const json = __nccwpck_require__(3746); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const unmarshalScalewayLb = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ScalewayLb' failed as data isn't a dictionary.` + ); } return { - continents: data.continents, - countries: data.countries, - data: data.data + domainName: data.domain_name, + frontendId: data.frontend_id, + id: data.id, + isSsl: data.is_ssl, + zone: data.zone }; }; -const unmarshalDomainRecordViewConfigView = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'DomainRecordViewConfigView' failed as data isn't a dictionary.`); +const unmarshalScalewayLbBackendConfig = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ScalewayLbBackendConfig' failed as data isn't a dictionary.` + ); } return { - data: data.data, - subnet: data.subnet + lbs: marshalling.unmarshalArrayOfObject(data.lbs, unmarshalScalewayLb) }; }; -const unmarshalDomainRecordWeightedConfigWeightedIP = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'DomainRecordWeightedConfigWeightedIP' failed as data isn't a dictionary.`); +const unmarshalScalewayS3BackendConfig = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ScalewayS3BackendConfig' failed as data isn't a dictionary.` + ); } return { - ip: data.ip, - weight: data.weight + bucketName: data.bucket_name, + bucketRegion: data.bucket_region, + isWebsite: data.is_website }; }; -const unmarshalContactExtensionFRAssociationInfo = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ContactExtensionFRAssociationInfo' failed as data isn't a dictionary.`); +const unmarshalBackendStage = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'BackendStage' failed as data isn't a dictionary.` + ); } return { - publicationJo: unmarshalDate(data.publication_jo), - publicationJoPage: data.publication_jo_page + createdAt: marshalling.unmarshalDate(data.created_at), + id: data.id, + pipelineId: data.pipeline_id, + projectId: data.project_id, + scalewayLb: data.scaleway_lb ? unmarshalScalewayLbBackendConfig(data.scaleway_lb) : void 0, + scalewayS3: data.scaleway_s3 ? unmarshalScalewayS3BackendConfig(data.scaleway_s3) : void 0, + updatedAt: marshalling.unmarshalDate(data.updated_at) }; }; -const unmarshalContactExtensionFRCodeAuthAfnicInfo = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ContactExtensionFRCodeAuthAfnicInfo' failed as data isn't a dictionary.`); +const unmarshalCacheStage = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'CacheStage' failed as data isn't a dictionary.` + ); } return { - codeAuthAfnic: data.code_auth_afnic + backendStageId: data.backend_stage_id, + createdAt: marshalling.unmarshalDate(data.created_at), + fallbackTtl: data.fallback_ttl, + id: data.id, + pipelineId: data.pipeline_id, + projectId: data.project_id, + updatedAt: marshalling.unmarshalDate(data.updated_at) }; }; -const unmarshalContactExtensionFRDunsInfo = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ContactExtensionFRDunsInfo' failed as data isn't a dictionary.`); +const unmarshalDNSStage = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DNSStage' failed as data isn't a dictionary.` + ); } return { - dunsId: data.duns_id, - localId: data.local_id + backendStageId: data.backend_stage_id, + cacheStageId: data.cache_stage_id, + createdAt: marshalling.unmarshalDate(data.created_at), + fqdns: data.fqdns, + id: data.id, + pipelineId: data.pipeline_id, + projectId: data.project_id, + tlsStageId: data.tls_stage_id, + type: data.type, + updatedAt: marshalling.unmarshalDate(data.updated_at) }; }; -const unmarshalContactExtensionFRIndividualInfo = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ContactExtensionFRIndividualInfo' failed as data isn't a dictionary.`); +const unmarshalPipelineError = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'PipelineError' failed as data isn't a dictionary.` + ); } return { - whoisOptIn: data.whois_opt_in + code: data.code, + message: data.message, + severity: data.severity, + stage: data.stage, + type: data.type }; }; -const unmarshalContactExtensionFRTrademarkInfo = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ContactExtensionFRTrademarkInfo' failed as data isn't a dictionary.`); +const unmarshalPipeline = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Pipeline' failed as data isn't a dictionary.` + ); } return { - trademarkInpi: data.trademark_inpi + createdAt: marshalling.unmarshalDate(data.created_at), + description: data.description, + dnsStageId: data.dns_stage_id, + errors: marshalling.unmarshalArrayOfObject(data.errors, unmarshalPipelineError), + id: data.id, + name: data.name, + projectId: data.project_id, + status: data.status, + updatedAt: marshalling.unmarshalDate(data.updated_at) }; }; -const unmarshalDSRecordPublicKey = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'DSRecordPublicKey' failed as data isn't a dictionary.`); +const unmarshalTLSSecret = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'TLSSecret' failed as data isn't a dictionary.` + ); } return { - key: data.key + region: data.region, + secretId: data.secret_id }; }; -const unmarshalDomainRecordGeoIPConfig = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'DomainRecordGeoIPConfig' failed as data isn't a dictionary.`); +const unmarshalTLSStage = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'TLSStage' failed as data isn't a dictionary.` + ); } return { - default: data.default, - matches: unmarshalArrayOfObject(data.matches, unmarshalDomainRecordGeoIPConfigMatch) + backendStageId: data.backend_stage_id, + cacheStageId: data.cache_stage_id, + certificateExpiresAt: marshalling.unmarshalDate(data.certificate_expires_at), + createdAt: marshalling.unmarshalDate(data.created_at), + id: data.id, + managedCertificate: data.managed_certificate, + pipelineId: data.pipeline_id, + projectId: data.project_id, + secrets: marshalling.unmarshalArrayOfObject(data.secrets, unmarshalTLSSecret), + updatedAt: marshalling.unmarshalDate(data.updated_at) }; }; -const unmarshalDomainRecordHTTPServiceConfig = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'DomainRecordHTTPServiceConfig' failed as data isn't a dictionary.`); +const unmarshalPurgeRequest = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'PurgeRequest' failed as data isn't a dictionary.` + ); } return { - ips: data.ips, - mustContain: data.must_contain, - strategy: data.strategy, - url: data.url, - userAgent: data.user_agent + all: data.all, + assets: data.assets, + createdAt: marshalling.unmarshalDate(data.created_at), + id: data.id, + pipelineId: data.pipeline_id, + status: data.status, + updatedAt: marshalling.unmarshalDate(data.updated_at) }; }; -const unmarshalDomainRecordViewConfig = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'DomainRecordViewConfig' failed as data isn't a dictionary.`); +const unmarshalCheckDomainResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'CheckDomainResponse' failed as data isn't a dictionary.` + ); } return { - views: unmarshalArrayOfObject(data.views, unmarshalDomainRecordViewConfigView) + isValid: data.is_valid }; }; -const unmarshalDomainRecordWeightedConfig = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'DomainRecordWeightedConfig' failed as data isn't a dictionary.`); +const unmarshalCheckLbOriginResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'CheckLbOriginResponse' failed as data isn't a dictionary.` + ); } return { - weightedIps: unmarshalArrayOfObject(data.weighted_ips, unmarshalDomainRecordWeightedConfigWeightedIP) + errorType: data.error_type, + isValid: data.is_valid }; }; -const unmarshalContactExtensionEU = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ContactExtensionEU' failed as data isn't a dictionary.`); +const unmarshalCheckPEMChainResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'CheckPEMChainResponse' failed as data isn't a dictionary.` + ); } return { - europeanCitizenship: data.european_citizenship + isValid: data.is_valid }; }; -const unmarshalContactExtensionFR = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ContactExtensionFR' failed as data isn't a dictionary.`); +const unmarshalListBackendStagesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListBackendStagesResponse' failed as data isn't a dictionary.` + ); } return { - associationInfo: data.association_info ? unmarshalContactExtensionFRAssociationInfo(data.association_info) : undefined, - codeAuthAfnicInfo: data.code_auth_afnic_info ? unmarshalContactExtensionFRCodeAuthAfnicInfo(data.code_auth_afnic_info) : undefined, - dunsInfo: data.duns_info ? unmarshalContactExtensionFRDunsInfo(data.duns_info) : undefined, - individualInfo: data.individual_info ? unmarshalContactExtensionFRIndividualInfo(data.individual_info) : undefined, - mode: data.mode, - trademarkInfo: data.trademark_info ? unmarshalContactExtensionFRTrademarkInfo(data.trademark_info) : undefined + stages: marshalling.unmarshalArrayOfObject(data.stages, unmarshalBackendStage), + totalCount: data.total_count }; }; -const unmarshalContactExtensionNL = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ContactExtensionNL' failed as data isn't a dictionary.`); +const unmarshalListCacheStagesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListCacheStagesResponse' failed as data isn't a dictionary.` + ); } return { - legalForm: data.legal_form, - legalFormRegistrationNumber: data.legal_form_registration_number + stages: marshalling.unmarshalArrayOfObject(data.stages, unmarshalCacheStage), + totalCount: data.total_count }; }; -const unmarshalContactQuestion = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ContactQuestion' failed as data isn't a dictionary.`); +const unmarshalListDNSStagesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListDNSStagesResponse' failed as data isn't a dictionary.` + ); } return { - answer: data.answer, - question: data.question + stages: marshalling.unmarshalArrayOfObject(data.stages, unmarshalDNSStage), + totalCount: data.total_count }; }; -const unmarshalDSRecordDigest = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'DSRecordDigest' failed as data isn't a dictionary.`); +const unmarshalListPipelinesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListPipelinesResponse' failed as data isn't a dictionary.` + ); } return { - digest: data.digest, - publicKey: data.public_key ? unmarshalDSRecordPublicKey(data.public_key) : undefined, - type: data.type + pipelines: marshalling.unmarshalArrayOfObject(data.pipelines, unmarshalPipeline), + totalCount: data.total_count }; }; -const unmarshalDomainRecord = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'DomainRecord' failed as data isn't a dictionary.`); +const unmarshalPlanDetails = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'PlanDetails' failed as data isn't a dictionary.` + ); } return { - comment: data.comment, - data: data.data, - geoIpConfig: data.geo_ip_config ? unmarshalDomainRecordGeoIPConfig(data.geo_ip_config) : undefined, - httpServiceConfig: data.http_service_config ? unmarshalDomainRecordHTTPServiceConfig(data.http_service_config) : undefined, - id: data.id, - name: data.name, - priority: data.priority, - ttl: data.ttl, - type: data.type, - viewConfig: data.view_config ? unmarshalDomainRecordViewConfig(data.view_config) : undefined, - weightedConfig: data.weighted_config ? unmarshalDomainRecordWeightedConfig(data.weighted_config) : undefined + packageGb: data.package_gb, + pipelineLimit: data.pipeline_limit, + planName: data.plan_name }; }; -const unmarshalRecordIdentifier = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'RecordIdentifier' failed as data isn't a dictionary.`); +const unmarshalListPlansResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListPlansResponse' failed as data isn't a dictionary.` + ); } return { - data: data.data, - name: data.name, - ttl: data.ttl, - type: data.type + plans: marshalling.unmarshalArrayOfObject(data.plans, unmarshalPlanDetails), + totalCount: data.total_count }; }; -const unmarshalTldOffer = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'TldOffer' failed as data isn't a dictionary.`); +const unmarshalListPurgeRequestsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListPurgeRequestsResponse' failed as data isn't a dictionary.` + ); } return { - action: data.action, - operationPath: data.operation_path, - price: data.price ? unmarshalMoney(data.price) : undefined + purgeRequests: marshalling.unmarshalArrayOfObject( + data.purge_requests, + unmarshalPurgeRequest + ), + totalCount: data.total_count + }; +}; +const unmarshalListTLSStagesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListTLSStagesResponse' failed as data isn't a dictionary.` + ); + } + return { + stages: marshalling.unmarshalArrayOfObject(data.stages, unmarshalTLSStage), + totalCount: data.total_count + }; +}; +const unmarshalPlan = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Plan' failed as data isn't a dictionary.` + ); + } + return { + planName: data.plan_name }; }; -const unmarshalContact = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Contact' failed as data isn't a dictionary.`); +const marshalCheckDomainRequest = (request, defaults) => ({ + cname: request.cname, + fqdn: request.fqdn, + project_id: request.projectId ?? defaults.defaultProjectId +}); +const marshalScalewayLb = (request, defaults) => ({ + domain_name: request.domainName, + frontend_id: request.frontendId, + id: request.id, + is_ssl: request.isSsl, + zone: request.zone +}); +const marshalCheckLbOriginRequest = (request, defaults) => ({ + lb: request.lb !== void 0 ? marshalScalewayLb(request.lb) : void 0 +}); +const marshalCheckPEMChainRequestSecretChain = (request, defaults) => ({ + secret_id: request.secretId, + secret_region: request.secretRegion +}); +const marshalCheckPEMChainRequest = (request, defaults) => ({ + fqdn: request.fqdn, + project_id: request.projectId ?? defaults.defaultProjectId, + ...marshalling.resolveOneOf([ + { + param: "secret", + value: request.secret !== void 0 ? marshalCheckPEMChainRequestSecretChain(request.secret) : void 0 + }, + { param: "raw", value: request.raw } + ]) +}); +const marshalScalewayLbBackendConfig = (request, defaults) => ({ + lbs: request.lbs.map((elt) => marshalScalewayLb(elt)) +}); +const marshalScalewayS3BackendConfig = (request, defaults) => ({ + bucket_name: request.bucketName, + bucket_region: request.bucketRegion, + is_website: request.isWebsite +}); +const marshalCreateBackendStageRequest = (request, defaults) => ({ + project_id: request.projectId ?? defaults.defaultProjectId, + ...marshalling.resolveOneOf([ + { + param: "scaleway_s3", + value: request.scalewayS3 !== void 0 ? marshalScalewayS3BackendConfig(request.scalewayS3) : void 0 + }, + { + param: "scaleway_lb", + value: request.scalewayLb !== void 0 ? marshalScalewayLbBackendConfig(request.scalewayLb) : void 0 + } + ]) +}); +const marshalCreateCacheStageRequest = (request, defaults) => ({ + fallback_ttl: request.fallbackTtl, + project_id: request.projectId ?? defaults.defaultProjectId, + ...marshalling.resolveOneOf([ + { param: "backend_stage_id", value: request.backendStageId } + ]) +}); +const marshalCreateDNSStageRequest = (request, defaults) => ({ + fqdns: request.fqdns, + project_id: request.projectId ?? defaults.defaultProjectId, + ...marshalling.resolveOneOf([ + { param: "tls_stage_id", value: request.tlsStageId }, + { param: "cache_stage_id", value: request.cacheStageId }, + { param: "backend_stage_id", value: request.backendStageId } + ]) +}); +const marshalCreatePipelineRequest = (request, defaults) => ({ + description: request.description, + name: request.name, + project_id: request.projectId ?? defaults.defaultProjectId, + ...marshalling.resolveOneOf([{ param: "dns_stage_id", value: request.dnsStageId }]) +}); +const marshalCreatePurgeRequestRequest = (request, defaults) => ({ + pipeline_id: request.pipelineId, + ...marshalling.resolveOneOf([ + { param: "assets", value: request.assets }, + { param: "all", value: request.all } + ]) +}); +const marshalTLSSecret = (request, defaults) => ({ + region: request.region, + secret_id: request.secretId +}); +const marshalCreateTLSStageRequest = (request, defaults) => ({ + managed_certificate: request.managedCertificate, + project_id: request.projectId ?? defaults.defaultProjectId, + secrets: request.secrets !== void 0 ? request.secrets.map((elt) => marshalTLSSecret(elt)) : void 0, + ...marshalling.resolveOneOf([ + { param: "cache_stage_id", value: request.cacheStageId }, + { param: "backend_stage_id", value: request.backendStageId } + ]) +}); +const marshalSelectPlanRequest = (request, defaults) => ({ + plan_name: request.planName, + project_id: request.projectId ?? defaults.defaultProjectId +}); +const marshalUpdateBackendStageRequest = (request, defaults) => ({ + ...marshalling.resolveOneOf([ + { + param: "scaleway_s3", + value: request.scalewayS3 !== void 0 ? marshalScalewayS3BackendConfig(request.scalewayS3) : void 0 + }, + { + param: "scaleway_lb", + value: request.scalewayLb !== void 0 ? marshalScalewayLbBackendConfig(request.scalewayLb) : void 0 + } + ]) +}); +const marshalUpdateCacheStageRequest = (request, defaults) => ({ + fallback_ttl: request.fallbackTtl, + ...marshalling.resolveOneOf([ + { param: "backend_stage_id", value: request.backendStageId } + ]) +}); +const marshalUpdateDNSStageRequest = (request, defaults) => ({ + fqdns: request.fqdns, + ...marshalling.resolveOneOf([ + { param: "tls_stage_id", value: request.tlsStageId }, + { param: "cache_stage_id", value: request.cacheStageId }, + { param: "backend_stage_id", value: request.backendStageId } + ]) +}); +const marshalUpdatePipelineRequest = (request, defaults) => ({ + description: request.description, + name: request.name, + ...marshalling.resolveOneOf([{ param: "dns_stage_id", value: request.dnsStageId }]) +}); +const marshalTLSSecretsConfig = (request, defaults) => ({ + tls_secrets: request.tlsSecrets.map((elt) => marshalTLSSecret(elt)) +}); +const marshalUpdateTLSStageRequest = (request, defaults) => ({ + managed_certificate: request.managedCertificate, + tls_secrets_config: request.tlsSecretsConfig !== void 0 ? marshalTLSSecretsConfig(request.tlsSecretsConfig) : void 0, + ...marshalling.resolveOneOf([ + { param: "cache_stage_id", value: request.cacheStageId }, + { param: "backend_stage_id", value: request.backendStageId } + ]) +}); +exports.marshalCheckDomainRequest = marshalCheckDomainRequest; +exports.marshalCheckLbOriginRequest = marshalCheckLbOriginRequest; +exports.marshalCheckPEMChainRequest = marshalCheckPEMChainRequest; +exports.marshalCreateBackendStageRequest = marshalCreateBackendStageRequest; +exports.marshalCreateCacheStageRequest = marshalCreateCacheStageRequest; +exports.marshalCreateDNSStageRequest = marshalCreateDNSStageRequest; +exports.marshalCreatePipelineRequest = marshalCreatePipelineRequest; +exports.marshalCreatePurgeRequestRequest = marshalCreatePurgeRequestRequest; +exports.marshalCreateTLSStageRequest = marshalCreateTLSStageRequest; +exports.marshalSelectPlanRequest = marshalSelectPlanRequest; +exports.marshalUpdateBackendStageRequest = marshalUpdateBackendStageRequest; +exports.marshalUpdateCacheStageRequest = marshalUpdateCacheStageRequest; +exports.marshalUpdateDNSStageRequest = marshalUpdateDNSStageRequest; +exports.marshalUpdatePipelineRequest = marshalUpdatePipelineRequest; +exports.marshalUpdateTLSStageRequest = marshalUpdateTLSStageRequest; +exports.unmarshalBackendStage = unmarshalBackendStage; +exports.unmarshalCacheStage = unmarshalCacheStage; +exports.unmarshalCheckDomainResponse = unmarshalCheckDomainResponse; +exports.unmarshalCheckLbOriginResponse = unmarshalCheckLbOriginResponse; +exports.unmarshalCheckPEMChainResponse = unmarshalCheckPEMChainResponse; +exports.unmarshalDNSStage = unmarshalDNSStage; +exports.unmarshalListBackendStagesResponse = unmarshalListBackendStagesResponse; +exports.unmarshalListCacheStagesResponse = unmarshalListCacheStagesResponse; +exports.unmarshalListDNSStagesResponse = unmarshalListDNSStagesResponse; +exports.unmarshalListPipelinesResponse = unmarshalListPipelinesResponse; +exports.unmarshalListPlansResponse = unmarshalListPlansResponse; +exports.unmarshalListPurgeRequestsResponse = unmarshalListPurgeRequestsResponse; +exports.unmarshalListTLSStagesResponse = unmarshalListTLSStagesResponse; +exports.unmarshalPipeline = unmarshalPipeline; +exports.unmarshalPlan = unmarshalPlan; +exports.unmarshalPurgeRequest = unmarshalPurgeRequest; +exports.unmarshalTLSStage = unmarshalTLSStage; + + +/***/ }), + +/***/ 8262: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const index_gen = __nccwpck_require__(6713); +exports.v1alpha1 = index_gen; + + +/***/ }), + +/***/ 6821: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const intervalRetrier = __nccwpck_require__(9052); +const api = __nccwpck_require__(3042); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const resourcePaginator = __nccwpck_require__(4983); +const content_gen = __nccwpck_require__(3282); +const marshalling_gen = __nccwpck_require__(7059); +const jsonContentHeaders = { + "Content-Type": "application/json; charset=utf-8" +}; +class API extends api.API { + /** Lists the available zones of the API. */ + static LOCALITIES = [ + "fr-par-1", + "fr-par-2", + "nl-ams-1" + ]; + /** + * Create a new flexible IP. Generate a new flexible IP within a given zone, + * specifying its configuration including Project ID and description. + * + * @param request - The request {@link CreateFlexibleIPRequest} + * @returns A Promise of FlexibleIP + */ + createFlexibleIP = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateFlexibleIPRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/flexible-ip/v1alpha1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/fips` + }, + marshalling_gen.unmarshalFlexibleIP + ); + /** + * Get an existing flexible IP. Retrieve information about an existing + * flexible IP, specified by its ID and zone. Its full details, including + * Project ID, description and status, are returned in the response object. + * + * @param request - The request {@link GetFlexibleIPRequest} + * @returns A Promise of FlexibleIP + */ + getFlexibleIP = (request) => this.client.fetch( + { + method: "GET", + path: `/flexible-ip/v1alpha1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/fips/${marshalling.validatePathParam("fipId", request.fipId)}` + }, + marshalling_gen.unmarshalFlexibleIP + ); + /** + * Waits for {@link FlexibleIP} to be in a final state. + * + * @param request - The request {@link GetFlexibleIPRequest} + * @param options - The waiting options + * @returns A Promise of FlexibleIP + */ + waitForFlexibleIP = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve( + !content_gen.FLEXIBLE_IP_TRANSIENT_STATUSES.includes(res.status) + )), + this.getFlexibleIP, + request, + options + ); + pageOfListFlexibleIPs = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/flexible-ip/v1alpha1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/fips`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId], + ["server_ids", request.serverIds], + ["status", request.status], + ["tags", request.tags] + ) + }, + marshalling_gen.unmarshalListFlexibleIPsResponse + ); + /** + * List flexible IPs. List all flexible IPs within a given zone. + * + * @param request - The request {@link ListFlexibleIPsRequest} + * @returns A Promise of ListFlexibleIPsResponse + */ + listFlexibleIPs = (request = {}) => resourcePaginator.enrichForPagination("flexibleIps", this.pageOfListFlexibleIPs, request); + /** + * Update an existing flexible IP. Update the parameters of an existing + * flexible IP, specified by its ID and zone. These parameters include tags + * and description. + * + * @param request - The request {@link UpdateFlexibleIPRequest} + * @returns A Promise of FlexibleIP + */ + updateFlexibleIP = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateFlexibleIPRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/flexible-ip/v1alpha1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/fips/${marshalling.validatePathParam("fipId", request.fipId)}` + }, + marshalling_gen.unmarshalFlexibleIP + ); + /** + * Delete an existing flexible IP. Delete an existing flexible IP, specified + * by its ID and zone. Note that deleting a flexible IP is permanent and + * cannot be undone. + * + * @param request - The request {@link DeleteFlexibleIPRequest} + */ + deleteFlexibleIP = (request) => this.client.fetch({ + method: "DELETE", + path: `/flexible-ip/v1alpha1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/fips/${marshalling.validatePathParam("fipId", request.fipId)}` + }); + /** + * Attach an existing flexible IP to a server. Attach an existing flexible IP + * to a specified Elastic Metal server. + * + * @param request - The request {@link AttachFlexibleIPRequest} + * @returns A Promise of AttachFlexibleIPsResponse + */ + attachFlexibleIP = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalAttachFlexibleIPRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/flexible-ip/v1alpha1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/fips/attach` + }, + marshalling_gen.unmarshalAttachFlexibleIPsResponse + ); + /** + * Detach an existing flexible IP from a server. Detach an existing flexible + * IP from a specified Elastic Metal server. + * + * @param request - The request {@link DetachFlexibleIPRequest} + * @returns A Promise of DetachFlexibleIPsResponse + */ + detachFlexibleIP = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalDetachFlexibleIPRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/flexible-ip/v1alpha1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/fips/detach` + }, + marshalling_gen.unmarshalDetachFlexibleIPsResponse + ); + /** + * Generate a virtual MAC address on an existing flexible IP. Generate a + * virtual MAC (Media Access Control) address on an existing flexible IP. + * + * @param request - The request {@link GenerateMACAddrRequest} + * @returns A Promise of FlexibleIP + */ + generateMACAddr = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalGenerateMACAddrRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/flexible-ip/v1alpha1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/fips/${marshalling.validatePathParam("fipId", request.fipId)}/mac` + }, + marshalling_gen.unmarshalFlexibleIP + ); + /** + * Duplicate a virtual MAC address to another flexible IP. Duplicate a virtual + * MAC address from a given flexible IP to another flexible IP attached to the + * same server. + * + * @param request - The request {@link DuplicateMACAddrRequest} + * @returns A Promise of FlexibleIP + */ + duplicateMACAddr = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalDuplicateMACAddrRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/flexible-ip/v1alpha1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/fips/${marshalling.validatePathParam("fipId", request.fipId)}/mac/duplicate` + }, + marshalling_gen.unmarshalFlexibleIP + ); + /** + * Relocate an existing virtual MAC address to a different flexible IP. + * Relocate a virtual MAC (Media Access Control) address from an existing + * flexible IP to a different flexible IP. + * + * @param request - The request {@link MoveMACAddrRequest} + * @returns A Promise of FlexibleIP + */ + moveMACAddr = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalMoveMACAddrRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/flexible-ip/v1alpha1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/fips/${marshalling.validatePathParam("fipId", request.fipId)}/mac/move` + }, + marshalling_gen.unmarshalFlexibleIP + ); + /** + * Detach a given virtual MAC address from an existing flexible IP. Detach a + * given MAC (Media Access Control) address from an existing flexible IP. + * + * @param request - The request {@link DeleteMACAddrRequest} + */ + deleteMACAddr = (request) => this.client.fetch({ + method: "DELETE", + path: `/flexible-ip/v1alpha1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/fips/${marshalling.validatePathParam("fipId", request.fipId)}/mac` + }); +} +exports.API = API; + + +/***/ }), + +/***/ 3282: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const FLEXIBLE_IP_TRANSIENT_STATUSES = [ + "updating", + "detaching" +]; +const MAC_ADDRESS_TRANSIENT_STATUSES = [ + "updating", + "deleting" +]; +exports.FLEXIBLE_IP_TRANSIENT_STATUSES = FLEXIBLE_IP_TRANSIENT_STATUSES; +exports.MAC_ADDRESS_TRANSIENT_STATUSES = MAC_ADDRESS_TRANSIENT_STATUSES; + + +/***/ }), + +/***/ 6713: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api_gen = __nccwpck_require__(6821); +const content_gen = __nccwpck_require__(3282); +const validationRules_gen = __nccwpck_require__(6352); +exports.API = api_gen.API; +exports.FLEXIBLE_IP_TRANSIENT_STATUSES = content_gen.FLEXIBLE_IP_TRANSIENT_STATUSES; +exports.MAC_ADDRESS_TRANSIENT_STATUSES = content_gen.MAC_ADDRESS_TRANSIENT_STATUSES; +exports.ValidationRules = validationRules_gen; + + +/***/ }), + +/***/ 7059: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const json = __nccwpck_require__(3746); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const unmarshalMACAddress = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'MACAddress' failed as data isn't a dictionary.` + ); } return { - addressLine1: data.address_line_1, - addressLine2: data.address_line_2, - city: data.city, - companyIdentificationCode: data.company_identification_code, - companyName: data.company_name, - country: data.country, - email: data.email, - emailAlt: data.email_alt, - emailStatus: data.email_status, - extensionEu: data.extension_eu ? unmarshalContactExtensionEU(data.extension_eu) : undefined, - extensionFr: data.extension_fr ? unmarshalContactExtensionFR(data.extension_fr) : undefined, - extensionNl: data.extension_nl ? unmarshalContactExtensionNL(data.extension_nl) : undefined, - faxNumber: data.fax_number, - firstname: data.firstname, + createdAt: marshalling.unmarshalDate(data.created_at), id: data.id, - lang: data.lang, - lastname: data.lastname, - legalForm: data.legal_form, - phoneNumber: data.phone_number, - questions: unmarshalArrayOfObject(data.questions, unmarshalContactQuestion, false), - resale: data.resale, - state: data.state, - vatIdentificationCode: data.vat_identification_code, - whoisOptIn: data.whois_opt_in, - zip: data.zip - }; -}; -const unmarshalContactRolesRoles = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ContactRolesRoles' failed as data isn't a dictionary.`); - } - return { - isAdministrative: data.is_administrative, - isOwner: data.is_owner, - isTechnical: data.is_technical - }; -}; -const unmarshalDSRecord = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'DSRecord' failed as data isn't a dictionary.`); - } - return { - algorithm: data.algorithm, - digest: data.digest ? unmarshalDSRecordDigest(data.digest) : undefined, - keyId: data.key_id, - publicKey: data.public_key ? unmarshalDSRecordPublicKey(data.public_key) : undefined - }; -}; -const unmarshalDomainRegistrationStatusExternalDomain = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'DomainRegistrationStatusExternalDomain' failed as data isn't a dictionary.`); - } - return { - validationToken: data.validation_token - }; -}; -const unmarshalDomainRegistrationStatusTransfer = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'DomainRegistrationStatusTransfer' failed as data isn't a dictionary.`); - } - return { + macAddress: data.mac_address, + macType: data.mac_type, status: data.status, - voteCurrentOwner: data.vote_current_owner, - voteNewOwner: data.vote_new_owner - }; -}; -const unmarshalRecordChangeAdd = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'RecordChangeAdd' failed as data isn't a dictionary.`); - } - return { - records: unmarshalArrayOfObject(data.records, unmarshalDomainRecord) - }; -}; -const unmarshalRecordChangeClear = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'RecordChangeClear' failed as data isn't a dictionary.`); - } - return {}; -}; -const unmarshalRecordChangeDelete = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'RecordChangeDelete' failed as data isn't a dictionary.`); - } - return { - id: data.id, - idFields: data.id_fields ? unmarshalRecordIdentifier(data.id_fields) : undefined + updatedAt: marshalling.unmarshalDate(data.updated_at), + zone: data.zone }; }; -const unmarshalRecordChangeSet = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'RecordChangeSet' failed as data isn't a dictionary.`); +const unmarshalFlexibleIP = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'FlexibleIP' failed as data isn't a dictionary.` + ); } return { + createdAt: marshalling.unmarshalDate(data.created_at), + description: data.description, id: data.id, - idFields: data.id_fields ? unmarshalRecordIdentifier(data.id_fields) : undefined, - records: unmarshalArrayOfObject(data.records, unmarshalDomainRecord) - }; -}; -const unmarshalTld = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Tld' failed as data isn't a dictionary.`); - } - return { - dnssecSupport: data.dnssec_support, - durationInYearsMax: data.duration_in_years_max, - durationInYearsMin: data.duration_in_years_min, - idnSupport: data.idn_support, - name: data.name, - offers: unmarshalMapOfObject(data.offers, unmarshalTldOffer), - specifications: data.specifications - }; -}; -const unmarshalAvailableDomain = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'AvailableDomain' failed as data isn't a dictionary.`); - } - return { - available: data.available, - domain: data.domain, - tld: data.tld ? unmarshalTld(data.tld) : undefined - }; -}; -const unmarshalCheckContactsCompatibilityResponseContactCheckResult = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'CheckContactsCompatibilityResponseContactCheckResult' failed as data isn't a dictionary.`); - } - return { - compatible: data.compatible, - errorMessage: data.error_message - }; -}; -const unmarshalContactRoles = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ContactRoles' failed as data isn't a dictionary.`); - } - return { - contact: data.contact ? unmarshalContact(data.contact) : undefined, - roles: unmarshalMapOfObject(data.roles, unmarshalContactRolesRoles) - }; -}; -const unmarshalDNSZone = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'DNSZone' failed as data isn't a dictionary.`); - } - return { - domain: data.domain, - message: data.message, - ns: data.ns, - nsDefault: data.ns_default, - nsMaster: data.ns_master, + ipAddress: data.ip_address, + macAddress: data.mac_address ? unmarshalMACAddress(data.mac_address) : void 0, + organizationId: data.organization_id, projectId: data.project_id, + reverse: data.reverse, + serverId: data.server_id, status: data.status, - subdomain: data.subdomain, - updatedAt: unmarshalDate(data.updated_at) + tags: data.tags, + updatedAt: marshalling.unmarshalDate(data.updated_at), + zone: data.zone }; }; -const unmarshalDNSZoneVersion = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'DNSZoneVersion' failed as data isn't a dictionary.`); +const unmarshalAttachFlexibleIPsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'AttachFlexibleIPsResponse' failed as data isn't a dictionary.` + ); } return { - createdAt: unmarshalDate(data.created_at), - id: data.id + flexibleIps: marshalling.unmarshalArrayOfObject(data.flexible_ips, unmarshalFlexibleIP), + totalCount: data.total_count }; }; -const unmarshalDomainDNSSEC = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'DomainDNSSEC' failed as data isn't a dictionary.`); +const unmarshalDetachFlexibleIPsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DetachFlexibleIPsResponse' failed as data isn't a dictionary.` + ); } return { - dsRecords: unmarshalArrayOfObject(data.ds_records, unmarshalDSRecord), - status: data.status + flexibleIps: marshalling.unmarshalArrayOfObject(data.flexible_ips, unmarshalFlexibleIP), + totalCount: data.total_count }; }; -const unmarshalDomainSummary = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'DomainSummary' failed as data isn't a dictionary.`); +const unmarshalListFlexibleIPsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListFlexibleIPsResponse' failed as data isn't a dictionary.` + ); } return { - autoRenewStatus: data.auto_renew_status, - dnssecStatus: data.dnssec_status, - domain: data.domain, - eppCode: data.epp_code, - expiredAt: unmarshalDate(data.expired_at), - externalDomainRegistrationStatus: data.external_domain_registration_status ? unmarshalDomainRegistrationStatusExternalDomain(data.external_domain_registration_status) : undefined, - isExternal: data.is_external, - organizationId: data.organization_id, - projectId: data.project_id, - registrar: data.registrar, - status: data.status, - transferRegistrationStatus: data.transfer_registration_status ? unmarshalDomainRegistrationStatusTransfer(data.transfer_registration_status) : undefined, - updatedAt: unmarshalDate(data.updated_at) + flexibleIps: marshalling.unmarshalArrayOfObject(data.flexible_ips, unmarshalFlexibleIP), + totalCount: data.total_count }; }; -const unmarshalHost = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Host' failed as data isn't a dictionary.`); +const marshalAttachFlexibleIPRequest = (request, defaults) => ({ + fips_ids: request.fipsIds, + server_id: request.serverId +}); +const marshalCreateFlexibleIPRequest = (request, defaults) => ({ + description: request.description, + is_ipv6: request.isIpv6, + project_id: request.projectId ?? defaults.defaultProjectId, + reverse: request.reverse, + server_id: request.serverId, + tags: request.tags +}); +const marshalDetachFlexibleIPRequest = (request, defaults) => ({ + fips_ids: request.fipsIds +}); +const marshalDuplicateMACAddrRequest = (request, defaults) => ({ + duplicate_from_fip_id: request.duplicateFromFipId +}); +const marshalGenerateMACAddrRequest = (request, defaults) => ({ + mac_type: request.macType +}); +const marshalMoveMACAddrRequest = (request, defaults) => ({ + dst_fip_id: request.dstFipId +}); +const marshalUpdateFlexibleIPRequest = (request, defaults) => ({ + description: request.description, + reverse: request.reverse, + tags: request.tags +}); +exports.marshalAttachFlexibleIPRequest = marshalAttachFlexibleIPRequest; +exports.marshalCreateFlexibleIPRequest = marshalCreateFlexibleIPRequest; +exports.marshalDetachFlexibleIPRequest = marshalDetachFlexibleIPRequest; +exports.marshalDuplicateMACAddrRequest = marshalDuplicateMACAddrRequest; +exports.marshalGenerateMACAddrRequest = marshalGenerateMACAddrRequest; +exports.marshalMoveMACAddrRequest = marshalMoveMACAddrRequest; +exports.marshalUpdateFlexibleIPRequest = marshalUpdateFlexibleIPRequest; +exports.unmarshalAttachFlexibleIPsResponse = unmarshalAttachFlexibleIPsResponse; +exports.unmarshalDetachFlexibleIPsResponse = unmarshalDetachFlexibleIPsResponse; +exports.unmarshalFlexibleIP = unmarshalFlexibleIP; +exports.unmarshalListFlexibleIPsResponse = unmarshalListFlexibleIPsResponse; + + +/***/ }), + +/***/ 6352: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const ListFlexibleIPsRequest = { + page: { + greaterThan: 0 + }, + pageSize: { + greaterThan: 0, + lessThanOrEqual: 100 } - return { - domain: data.domain, - ips: data.ips, - name: data.name, - status: data.status - }; }; -const unmarshalNameserver$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Nameserver' failed as data isn't a dictionary.`); - } - return { - ip: data.ip, - name: data.name - }; +exports.ListFlexibleIPsRequest = ListFlexibleIPsRequest; + + +/***/ }), + +/***/ 8556: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const index_gen = __nccwpck_require__(2935); +exports.v1beta1 = index_gen; + + +/***/ }), + +/***/ 6239: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const intervalRetrier = __nccwpck_require__(9052); +const api = __nccwpck_require__(3042); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const resourcePaginator = __nccwpck_require__(4983); +const content_gen = __nccwpck_require__(2212); +const marshalling_gen = __nccwpck_require__(1541); +const jsonContentHeaders = { + "Content-Type": "application/json; charset=utf-8" }; -const unmarshalRecordChange = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'RecordChange' failed as data isn't a dictionary.`); +class API extends api.API { + /** Lists the available regions of the API. */ + static LOCALITIES = ["fr-par", "nl-ams", "pl-waw"]; + pageOfListNamespaces = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/functions/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/namespaces`, + urlParams: marshalling.urlParams( + ["name", request.name], + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId] + ) + }, + marshalling_gen.unmarshalListNamespacesResponse + ); + /** + * List all your namespaces. List all existing namespaces in the specified + * region. + * + * @param request - The request {@link ListNamespacesRequest} + * @returns A Promise of ListNamespacesResponse + */ + listNamespaces = (request = {}) => resourcePaginator.enrichForPagination("namespaces", this.pageOfListNamespaces, request); + /** + * Get a namespace. Get the namespace associated with the specified ID. + * + * @param request - The request {@link GetNamespaceRequest} + * @returns A Promise of Namespace + */ + getNamespace = (request) => this.client.fetch( + { + method: "GET", + path: `/functions/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/namespaces/${marshalling.validatePathParam("namespaceId", request.namespaceId)}` + }, + marshalling_gen.unmarshalNamespace + ); + /** + * Waits for {@link Namespace} to be in a final state. + * + * @param request - The request {@link GetNamespaceRequest} + * @param options - The waiting options + * @returns A Promise of Namespace + */ + waitForNamespace = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve(!content_gen.NAMESPACE_TRANSIENT_STATUSES.includes(res.status))), + this.getNamespace, + request, + options + ); + /** + * Create a new namespace. Create a new namespace in a specified Organization + * or Project. + * + * @param request - The request {@link CreateNamespaceRequest} + * @returns A Promise of Namespace + */ + createNamespace = (request = {}) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateNamespaceRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/functions/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/namespaces` + }, + marshalling_gen.unmarshalNamespace + ); + /** + * Update an existing namespace. Update the namespace associated with the + * specified ID. + * + * @param request - The request {@link UpdateNamespaceRequest} + * @returns A Promise of Namespace + */ + updateNamespace = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateNamespaceRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/functions/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/namespaces/${marshalling.validatePathParam("namespaceId", request.namespaceId)}` + }, + marshalling_gen.unmarshalNamespace + ); + /** + * Delete an existing namespace. Delete the namespace associated with the + * specified ID. + * + * @param request - The request {@link DeleteNamespaceRequest} + * @returns A Promise of Namespace + */ + deleteNamespace = (request) => this.client.fetch( + { + method: "DELETE", + path: `/functions/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/namespaces/${marshalling.validatePathParam("namespaceId", request.namespaceId)}` + }, + marshalling_gen.unmarshalNamespace + ); + pageOfListFunctions = (request) => this.client.fetch( + { + method: "GET", + path: `/functions/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/functions`, + urlParams: marshalling.urlParams( + ["name", request.name], + ["namespace_id", request.namespaceId], + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId] + ) + }, + marshalling_gen.unmarshalListFunctionsResponse + ); + /** + * List all your functions. + * + * @param request - The request {@link ListFunctionsRequest} + * @returns A Promise of ListFunctionsResponse + */ + listFunctions = (request) => resourcePaginator.enrichForPagination("functions", this.pageOfListFunctions, request); + /** + * Get a function. Get the function associated with the specified ID. + * + * @param request - The request {@link GetFunctionRequest} + * @returns A Promise of Function + */ + getFunction = (request) => this.client.fetch( + { + method: "GET", + path: `/functions/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/functions/${marshalling.validatePathParam("functionId", request.functionId)}` + }, + marshalling_gen.unmarshalFunction + ); + /** + * Waits for {@link Function} to be in a final state. + * + * @param request - The request {@link GetFunctionRequest} + * @param options - The waiting options + * @returns A Promise of Function + */ + waitForFunction = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve(!content_gen.FUNCTION_TRANSIENT_STATUSES.includes(res.status))), + this.getFunction, + request, + options + ); + /** + * Create a new function. Create a new function in the specified region for a + * specified Organization or Project. + * + * @param request - The request {@link CreateFunctionRequest} + * @returns A Promise of Function + */ + createFunction = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateFunctionRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/functions/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/functions` + }, + marshalling_gen.unmarshalFunction + ); + /** + * Update an existing function. Update the function associated with the + * specified ID. + * + * @param request - The request {@link UpdateFunctionRequest} + * @returns A Promise of Function + */ + updateFunction = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateFunctionRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/functions/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/functions/${marshalling.validatePathParam("functionId", request.functionId)}` + }, + marshalling_gen.unmarshalFunction + ); + /** + * Delete a function. Delete the function associated with the specified ID. + * + * @param request - The request {@link DeleteFunctionRequest} + * @returns A Promise of Function + */ + deleteFunction = (request) => this.client.fetch( + { + method: "DELETE", + path: `/functions/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/functions/${marshalling.validatePathParam("functionId", request.functionId)}` + }, + marshalling_gen.unmarshalFunction + ); + /** + * Deploy a function. Deploy a function associated with the specified ID. + * + * @param request - The request {@link DeployFunctionRequest} + * @returns A Promise of Function + */ + deployFunction = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/functions/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/functions/${marshalling.validatePathParam("functionId", request.functionId)}/deploy` + }, + marshalling_gen.unmarshalFunction + ); + /** + * List function runtimes. List available function runtimes. + * + * @param request - The request {@link ListFunctionRuntimesRequest} + * @returns A Promise of ListFunctionRuntimesResponse + */ + listFunctionRuntimes = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/functions/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/runtimes` + }, + marshalling_gen.unmarshalListFunctionRuntimesResponse + ); + /** + * Get an upload URL of a function. Get an upload URL of a function associated + * with the specified ID. + * + * @param request - The request {@link GetFunctionUploadURLRequest} + * @returns A Promise of UploadURL + */ + getFunctionUploadURL = (request) => this.client.fetch( + { + method: "GET", + path: `/functions/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/functions/${marshalling.validatePathParam("functionId", request.functionId)}/upload-url`, + urlParams: marshalling.urlParams(["content_length", request.contentLength]) + }, + marshalling_gen.unmarshalUploadURL + ); + /** + * Get a download URL of a function. Get a download URL for a function + * associated with the specified ID. + * + * @param request - The request {@link GetFunctionDownloadURLRequest} + * @returns A Promise of DownloadURL + */ + getFunctionDownloadURL = (request) => this.client.fetch( + { + method: "GET", + path: `/functions/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/functions/${marshalling.validatePathParam("functionId", request.functionId)}/download-url` + }, + marshalling_gen.unmarshalDownloadURL + ); + pageOfListCrons = (request) => this.client.fetch( + { + method: "GET", + path: `/functions/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/crons`, + urlParams: marshalling.urlParams( + ["function_id", request.functionId], + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListCronsResponse + ); + /** + * List all crons. List all the cronjobs in a specified region. + * + * @param request - The request {@link ListCronsRequest} + * @returns A Promise of ListCronsResponse + */ + listCrons = (request) => resourcePaginator.enrichForPagination("crons", this.pageOfListCrons, request); + /** + * Get a cron. Get the cron associated with the specified ID. + * + * @param request - The request {@link GetCronRequest} + * @returns A Promise of Cron + */ + getCron = (request) => this.client.fetch( + { + method: "GET", + path: `/functions/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/crons/${marshalling.validatePathParam("cronId", request.cronId)}` + }, + marshalling_gen.unmarshalCron + ); + /** + * Waits for {@link Cron} to be in a final state. + * + * @param request - The request {@link GetCronRequest} + * @param options - The waiting options + * @returns A Promise of Cron + */ + waitForCron = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve(!content_gen.CRON_TRANSIENT_STATUSES.includes(res.status))), + this.getCron, + request, + options + ); + /** + * Create a new cron. Create a new cronjob for a function with the specified + * ID. + * + * @param request - The request {@link CreateCronRequest} + * @returns A Promise of Cron + */ + createCron = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateCronRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/functions/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/crons` + }, + marshalling_gen.unmarshalCron + ); + /** + * Update an existing cron. Update the cron associated with the specified ID. + * + * @param request - The request {@link UpdateCronRequest} + * @returns A Promise of Cron + */ + updateCron = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateCronRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/functions/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/crons/${marshalling.validatePathParam("cronId", request.cronId)}` + }, + marshalling_gen.unmarshalCron + ); + /** + * Delete an existing cron. Delete the cron associated with the specified ID. + * + * @param request - The request {@link DeleteCronRequest} + * @returns A Promise of Cron + */ + deleteCron = (request) => this.client.fetch( + { + method: "DELETE", + path: `/functions/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/crons/${marshalling.validatePathParam("cronId", request.cronId)}` + }, + marshalling_gen.unmarshalCron + ); + pageOfListDomains = (request) => this.client.fetch( + { + method: "GET", + path: `/functions/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains`, + urlParams: marshalling.urlParams( + ["function_id", request.functionId], + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListDomainsResponse + ); + /** + * List all domain name bindings. List all domain name bindings in a specified + * region. + * + * @param request - The request {@link ListDomainsRequest} + * @returns A Promise of ListDomainsResponse + */ + listDomains = (request) => resourcePaginator.enrichForPagination("domains", this.pageOfListDomains, request); + /** + * Get a domain name binding. Get a domain name binding for the function with + * the specified ID. + * + * @param request - The request {@link GetDomainRequest} + * @returns A Promise of Domain + */ + getDomain = (request) => this.client.fetch( + { + method: "GET", + path: `/functions/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${marshalling.validatePathParam("domainId", request.domainId)}` + }, + marshalling_gen.unmarshalDomain + ); + /** + * Waits for {@link Domain} to be in a final state. + * + * @param request - The request {@link GetDomainRequest} + * @param options - The waiting options + * @returns A Promise of Domain + */ + waitForDomain = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve(!content_gen.DOMAIN_TRANSIENT_STATUSES.includes(res.status))), + this.getDomain, + request, + options + ); + /** + * Create a domain name binding. Create a domain name binding for the function + * with the specified ID. + * + * @param request - The request {@link CreateDomainRequest} + * @returns A Promise of Domain + */ + createDomain = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateDomainRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/functions/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains` + }, + marshalling_gen.unmarshalDomain + ); + /** + * Delete a domain name binding. Delete a domain name binding for the function + * with the specified ID. + * + * @param request - The request {@link DeleteDomainRequest} + * @returns A Promise of Domain + */ + deleteDomain = (request) => this.client.fetch( + { + method: "DELETE", + path: `/functions/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${marshalling.validatePathParam("domainId", request.domainId)}` + }, + marshalling_gen.unmarshalDomain + ); + /** + * Create a new revocable token. + * + * @param request - The request {@link CreateTokenRequest} + * @returns A Promise of Token + */ + createToken = (request = {}) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateTokenRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/functions/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/tokens` + }, + marshalling_gen.unmarshalToken + ); + /** + * Get a token. + * + * @param request - The request {@link GetTokenRequest} + * @returns A Promise of Token + */ + getToken = (request) => this.client.fetch( + { + method: "GET", + path: `/functions/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/tokens/${marshalling.validatePathParam("tokenId", request.tokenId)}` + }, + marshalling_gen.unmarshalToken + ); + /** + * Waits for {@link Token} to be in a final state. + * + * @param request - The request {@link GetTokenRequest} + * @param options - The waiting options + * @returns A Promise of Token + */ + waitForToken = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve(!content_gen.TOKEN_TRANSIENT_STATUSES.includes(res.status))), + this.getToken, + request, + options + ); + pageOfListTokens = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/functions/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/tokens`, + urlParams: marshalling.urlParams( + ["function_id", request.functionId], + ["namespace_id", request.namespaceId], + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListTokensResponse + ); + /** + * List all tokens. + * + * @param request - The request {@link ListTokensRequest} + * @returns A Promise of ListTokensResponse + */ + listTokens = (request = {}) => resourcePaginator.enrichForPagination("tokens", this.pageOfListTokens, request); + /** + * Delete a token. + * + * @param request - The request {@link DeleteTokenRequest} + * @returns A Promise of Token + */ + deleteToken = (request) => this.client.fetch( + { + method: "DELETE", + path: `/functions/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/tokens/${marshalling.validatePathParam("tokenId", request.tokenId)}` + }, + marshalling_gen.unmarshalToken + ); + /** + * Create a trigger. Create a new trigger for a specified function. + * + * @param request - The request {@link CreateTriggerRequest} + * @returns A Promise of Trigger + */ + createTrigger = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateTriggerRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/functions/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers` + }, + marshalling_gen.unmarshalTrigger + ); + /** + * Get a trigger. Get a trigger with a specified ID. + * + * @param request - The request {@link GetTriggerRequest} + * @returns A Promise of Trigger + */ + getTrigger = (request) => this.client.fetch( + { + method: "GET", + path: `/functions/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers/${marshalling.validatePathParam("triggerId", request.triggerId)}` + }, + marshalling_gen.unmarshalTrigger + ); + /** + * Waits for {@link Trigger} to be in a final state. + * + * @param request - The request {@link GetTriggerRequest} + * @param options - The waiting options + * @returns A Promise of Trigger + */ + waitForTrigger = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve(!content_gen.TRIGGER_TRANSIENT_STATUSES.includes(res.status))), + this.getTrigger, + request, + options + ); + pageOfListTriggers = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/functions/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ...Object.entries( + marshalling.resolveOneOf([ + { param: "function_id", value: request.functionId }, + { param: "namespace_id", value: request.namespaceId }, + { + default: this.client.settings.defaultProjectId, + param: "project_id", + value: request.projectId + } + ]) + ) + ) + }, + marshalling_gen.unmarshalListTriggersResponse + ); + /** + * List all triggers. List all triggers belonging to a specified Organization + * or Project. + * + * @param request - The request {@link ListTriggersRequest} + * @returns A Promise of ListTriggersResponse + */ + listTriggers = (request = {}) => resourcePaginator.enrichForPagination("triggers", this.pageOfListTriggers, request); + /** + * Update a trigger. Update a trigger with a specified ID. + * + * @param request - The request {@link UpdateTriggerRequest} + * @returns A Promise of Trigger + */ + updateTrigger = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateTriggerRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/functions/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers/${marshalling.validatePathParam("triggerId", request.triggerId)}` + }, + marshalling_gen.unmarshalTrigger + ); + /** + * Delete a trigger. Delete a trigger with a specified ID. + * + * @param request - The request {@link DeleteTriggerRequest} + * @returns A Promise of Trigger + */ + deleteTrigger = (request) => this.client.fetch( + { + method: "DELETE", + path: `/functions/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/triggers/${marshalling.validatePathParam("triggerId", request.triggerId)}` + }, + marshalling_gen.unmarshalTrigger + ); +} +exports.API = API; + + +/***/ }), + +/***/ 2212: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const CRON_TRANSIENT_STATUSES = [ + "deleting", + "creating", + "pending" +]; +const DOMAIN_TRANSIENT_STATUSES = [ + "deleting", + "creating", + "pending" +]; +const FUNCTION_TRANSIENT_STATUSES = [ + "deleting", + "creating", + "pending" +]; +const NAMESPACE_TRANSIENT_STATUSES = [ + "deleting", + "creating", + "pending" +]; +const TOKEN_TRANSIENT_STATUSES = ["deleting", "creating"]; +const TRIGGER_TRANSIENT_STATUSES = [ + "deleting", + "creating", + "pending" +]; +exports.CRON_TRANSIENT_STATUSES = CRON_TRANSIENT_STATUSES; +exports.DOMAIN_TRANSIENT_STATUSES = DOMAIN_TRANSIENT_STATUSES; +exports.FUNCTION_TRANSIENT_STATUSES = FUNCTION_TRANSIENT_STATUSES; +exports.NAMESPACE_TRANSIENT_STATUSES = NAMESPACE_TRANSIENT_STATUSES; +exports.TOKEN_TRANSIENT_STATUSES = TOKEN_TRANSIENT_STATUSES; +exports.TRIGGER_TRANSIENT_STATUSES = TRIGGER_TRANSIENT_STATUSES; + + +/***/ }), + +/***/ 2935: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api_gen = __nccwpck_require__(6239); +const content_gen = __nccwpck_require__(2212); +const validationRules_gen = __nccwpck_require__(3090); +exports.API = api_gen.API; +exports.CRON_TRANSIENT_STATUSES = content_gen.CRON_TRANSIENT_STATUSES; +exports.DOMAIN_TRANSIENT_STATUSES = content_gen.DOMAIN_TRANSIENT_STATUSES; +exports.FUNCTION_TRANSIENT_STATUSES = content_gen.FUNCTION_TRANSIENT_STATUSES; +exports.NAMESPACE_TRANSIENT_STATUSES = content_gen.NAMESPACE_TRANSIENT_STATUSES; +exports.TOKEN_TRANSIENT_STATUSES = content_gen.TOKEN_TRANSIENT_STATUSES; +exports.TRIGGER_TRANSIENT_STATUSES = content_gen.TRIGGER_TRANSIENT_STATUSES; +exports.ValidationRules = validationRules_gen; + + +/***/ }), + +/***/ 1541: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const randomName = __nccwpck_require__(8141); +const json = __nccwpck_require__(3746); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const unmarshalCron = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Cron' failed as data isn't a dictionary.` + ); } return { - add: data.add ? unmarshalRecordChangeAdd(data.add) : undefined, - clear: data.clear ? unmarshalRecordChangeClear(data.clear) : undefined, - delete: data.delete ? unmarshalRecordChangeDelete(data.delete) : undefined, - set: data.set ? unmarshalRecordChangeSet(data.set) : undefined + args: data.args, + functionId: data.function_id, + id: data.id, + name: data.name, + schedule: data.schedule, + status: data.status }; }; -const unmarshalRenewableDomain = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'RenewableDomain' failed as data isn't a dictionary.`); +const unmarshalDomain = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Domain' failed as data isn't a dictionary.` + ); } return { - domain: data.domain, - estimatedDeleteAt: unmarshalDate(data.estimated_delete_at), - expiredAt: unmarshalDate(data.expired_at), - limitRedemptionAt: unmarshalDate(data.limit_redemption_at), - limitRenewAt: unmarshalDate(data.limit_renew_at), - organizationId: data.organization_id, - projectId: data.project_id, - renewableDurationInYears: data.renewable_duration_in_years, + errorMessage: data.error_message, + functionId: data.function_id, + hostname: data.hostname, + id: data.id, status: data.status, - tld: data.tld ? unmarshalTld(data.tld) : undefined + url: data.url }; }; -const unmarshalSSLCertificate = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'SSLCertificate' failed as data isn't a dictionary.`); +const unmarshalSecretHashedValue = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SecretHashedValue' failed as data isn't a dictionary.` + ); } return { - alternativeDnsZones: data.alternative_dns_zones, - certificateChain: data.certificate_chain, - createdAt: unmarshalDate(data.created_at), - dnsZone: data.dns_zone, - expiredAt: unmarshalDate(data.expired_at), - privateKey: data.private_key, - status: data.status + hashedValue: data.hashed_value, + key: data.key }; }; -const unmarshalTask$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Task' failed as data isn't a dictionary.`); +const unmarshalFunction = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Function' failed as data isn't a dictionary.` + ); } return { - domain: data.domain, + buildMessage: data.build_message, + cpuLimit: data.cpu_limit, + description: data.description, + domainName: data.domain_name, + environmentVariables: data.environment_variables, + errorMessage: data.error_message, + handler: data.handler, + httpOption: data.http_option, id: data.id, - message: data.message, - organizationId: data.organization_id, - projectId: data.project_id, - startedAt: unmarshalDate(data.started_at), + maxScale: data.max_scale, + memoryLimit: data.memory_limit, + minScale: data.min_scale, + name: data.name, + namespaceId: data.namespace_id, + privacy: data.privacy, + region: data.region, + runtime: data.runtime, + runtimeMessage: data.runtime_message, + sandbox: data.sandbox, + secretEnvironmentVariables: marshalling.unmarshalArrayOfObject( + data.secret_environment_variables, + unmarshalSecretHashedValue + ), status: data.status, - type: data.type, - updatedAt: unmarshalDate(data.updated_at) - }; -}; -const unmarshalCheckContactsCompatibilityResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'CheckContactsCompatibilityResponse' failed as data isn't a dictionary.`); - } - return { - administrativeCheckResult: data.administrative_check_result ? unmarshalCheckContactsCompatibilityResponseContactCheckResult(data.administrative_check_result) : undefined, - compatible: data.compatible, - ownerCheckResult: data.owner_check_result ? unmarshalCheckContactsCompatibilityResponseContactCheckResult(data.owner_check_result) : undefined, - technicalCheckResult: data.technical_check_result ? unmarshalCheckContactsCompatibilityResponseContactCheckResult(data.technical_check_result) : undefined + timeout: data.timeout }; }; -const unmarshalClearDNSZoneRecordsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ClearDNSZoneRecordsResponse' failed as data isn't a dictionary.`); - } - return {}; -}; -const unmarshalDeleteDNSZoneResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'DeleteDNSZoneResponse' failed as data isn't a dictionary.`); - } - return {}; -}; -const unmarshalDeleteExternalDomainResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'DeleteExternalDomainResponse' failed as data isn't a dictionary.`); - } - return {}; -}; -const unmarshalDeleteSSLCertificateResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'DeleteSSLCertificateResponse' failed as data isn't a dictionary.`); - } - return {}; -}; -const unmarshalDomain$2 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Domain' failed as data isn't a dictionary.`); +const unmarshalNamespace = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Namespace' failed as data isn't a dictionary.` + ); } return { - administrativeContact: data.administrative_contact ? unmarshalContact(data.administrative_contact) : undefined, - autoRenewStatus: data.auto_renew_status, - dnssec: data.dnssec ? unmarshalDomainDNSSEC(data.dnssec) : undefined, - dnsZones: unmarshalArrayOfObject(data.dns_zones, unmarshalDNSZone), - domain: data.domain, - eppCode: data.epp_code, - expiredAt: unmarshalDate(data.expired_at), - externalDomainRegistrationStatus: data.external_domain_registration_status ? unmarshalDomainRegistrationStatusExternalDomain(data.external_domain_registration_status) : undefined, - isExternal: data.is_external, + description: data.description, + environmentVariables: data.environment_variables, + errorMessage: data.error_message, + id: data.id, + name: data.name, organizationId: data.organization_id, - ownerContact: data.owner_contact ? unmarshalContact(data.owner_contact) : undefined, projectId: data.project_id, - registrar: data.registrar, - status: data.status, - technicalContact: data.technical_contact ? unmarshalContact(data.technical_contact) : undefined, - tld: data.tld ? unmarshalTld(data.tld) : undefined, - transferRegistrationStatus: data.transfer_registration_status ? unmarshalDomainRegistrationStatusTransfer(data.transfer_registration_status) : undefined, - updatedAt: unmarshalDate(data.updated_at) - }; -}; -const unmarshalGetDNSZoneTsigKeyResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'GetDNSZoneTsigKeyResponse' failed as data isn't a dictionary.`); - } - return { - algorithm: data.algorithm, - key: data.key, - name: data.name - }; -}; -const unmarshalGetDNSZoneVersionDiffResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'GetDNSZoneVersionDiffResponse' failed as data isn't a dictionary.`); - } - return { - changes: unmarshalArrayOfObject(data.changes, unmarshalRecordChange) - }; -}; -const unmarshalGetDomainAuthCodeResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'GetDomainAuthCodeResponse' failed as data isn't a dictionary.`); - } - return { - authCode: data.auth_code - }; -}; -const unmarshalImportProviderDNSZoneResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ImportProviderDNSZoneResponse' failed as data isn't a dictionary.`); - } - return { - records: unmarshalArrayOfObject(data.records, unmarshalDomainRecord) + region: data.region, + registryEndpoint: data.registry_endpoint, + registryNamespaceId: data.registry_namespace_id, + secretEnvironmentVariables: marshalling.unmarshalArrayOfObject( + data.secret_environment_variables, + unmarshalSecretHashedValue + ), + status: data.status }; }; -const unmarshalImportRawDNSZoneResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ImportRawDNSZoneResponse' failed as data isn't a dictionary.`); +const unmarshalToken = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Token' failed as data isn't a dictionary.` + ); } return { - records: unmarshalArrayOfObject(data.records, unmarshalDomainRecord) + description: data.description, + expiresAt: marshalling.unmarshalDate(data.expires_at), + functionId: data.function_id, + id: data.id, + namespaceId: data.namespace_id, + publicKey: data.public_key, + status: data.status, + token: data.token }; }; -const unmarshalListContactsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListContactsResponse' failed as data isn't a dictionary.`); +const unmarshalTriggerMnqNatsClientConfig = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'TriggerMnqNatsClientConfig' failed as data isn't a dictionary.` + ); } return { - contacts: unmarshalArrayOfObject(data.contacts, unmarshalContactRoles), - totalCount: data.total_count + mnqCredentialId: data.mnq_credential_id, + mnqNatsAccountId: data.mnq_nats_account_id, + mnqProjectId: data.mnq_project_id, + mnqRegion: data.mnq_region, + subject: data.subject }; }; -const unmarshalListDNSZoneNameserversResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListDNSZoneNameserversResponse' failed as data isn't a dictionary.`); +const unmarshalTriggerMnqSqsClientConfig = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'TriggerMnqSqsClientConfig' failed as data isn't a dictionary.` + ); } return { - ns: unmarshalArrayOfObject(data.ns, unmarshalNameserver$1) + mnqCredentialId: data.mnq_credential_id, + mnqProjectId: data.mnq_project_id, + mnqRegion: data.mnq_region, + queue: data.queue }; }; -const unmarshalListDNSZoneRecordsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListDNSZoneRecordsResponse' failed as data isn't a dictionary.`); +const unmarshalTriggerSqsClientConfig = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'TriggerSqsClientConfig' failed as data isn't a dictionary.` + ); } return { - records: unmarshalArrayOfObject(data.records, unmarshalDomainRecord), - totalCount: data.total_count + accessKey: data.access_key, + endpoint: data.endpoint, + queueUrl: data.queue_url, + secretKey: data.secret_key }; }; -const unmarshalListDNSZoneVersionRecordsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListDNSZoneVersionRecordsResponse' failed as data isn't a dictionary.`); +const unmarshalTrigger = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Trigger' failed as data isn't a dictionary.` + ); } return { - records: unmarshalArrayOfObject(data.records, unmarshalDomainRecord), - totalCount: data.total_count + description: data.description, + errorMessage: data.error_message, + functionId: data.function_id, + id: data.id, + inputType: data.input_type, + name: data.name, + scwNatsConfig: data.scw_nats_config ? unmarshalTriggerMnqNatsClientConfig(data.scw_nats_config) : void 0, + scwSqsConfig: data.scw_sqs_config ? unmarshalTriggerMnqSqsClientConfig(data.scw_sqs_config) : void 0, + sqsConfig: data.sqs_config ? unmarshalTriggerSqsClientConfig(data.sqs_config) : void 0, + status: data.status }; }; -const unmarshalListDNSZoneVersionsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListDNSZoneVersionsResponse' failed as data isn't a dictionary.`); +const unmarshalDownloadURL = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DownloadURL' failed as data isn't a dictionary.` + ); } return { - totalCount: data.total_count, - versions: unmarshalArrayOfObject(data.versions, unmarshalDNSZoneVersion) + headers: data.headers, + url: data.url }; }; -const unmarshalListDNSZonesResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListDNSZonesResponse' failed as data isn't a dictionary.`); +const unmarshalListCronsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListCronsResponse' failed as data isn't a dictionary.` + ); } return { - dnsZones: unmarshalArrayOfObject(data.dns_zones, unmarshalDNSZone), + crons: marshalling.unmarshalArrayOfObject(data.crons, unmarshalCron), totalCount: data.total_count }; }; -const unmarshalListDomainHostsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListDomainHostsResponse' failed as data isn't a dictionary.`); +const unmarshalListDomainsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListDomainsResponse' failed as data isn't a dictionary.` + ); } return { - hosts: unmarshalArrayOfObject(data.hosts, unmarshalHost), + domains: marshalling.unmarshalArrayOfObject(data.domains, unmarshalDomain), totalCount: data.total_count }; }; -const unmarshalListDomainsResponse$2 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListDomainsResponse' failed as data isn't a dictionary.`); +const unmarshalRuntime = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Runtime' failed as data isn't a dictionary.` + ); } return { - domains: unmarshalArrayOfObject(data.domains, unmarshalDomainSummary), - totalCount: data.total_count + codeSample: data.code_sample, + defaultHandler: data.default_handler, + extension: data.extension, + implementation: data.implementation, + language: data.language, + logoUrl: data.logo_url, + name: data.name, + status: data.status, + statusMessage: data.status_message, + version: data.version }; }; -const unmarshalListRenewableDomainsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListRenewableDomainsResponse' failed as data isn't a dictionary.`); +const unmarshalListFunctionRuntimesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListFunctionRuntimesResponse' failed as data isn't a dictionary.` + ); } return { - domains: unmarshalArrayOfObject(data.domains, unmarshalRenewableDomain), + runtimes: marshalling.unmarshalArrayOfObject(data.runtimes, unmarshalRuntime), totalCount: data.total_count }; }; -const unmarshalListSSLCertificatesResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListSSLCertificatesResponse' failed as data isn't a dictionary.`); +const unmarshalListFunctionsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListFunctionsResponse' failed as data isn't a dictionary.` + ); } return { - certificates: unmarshalArrayOfObject(data.certificates, unmarshalSSLCertificate), + functions: marshalling.unmarshalArrayOfObject(data.functions, unmarshalFunction), totalCount: data.total_count }; }; -const unmarshalListTasksResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListTasksResponse' failed as data isn't a dictionary.`); +const unmarshalListNamespacesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListNamespacesResponse' failed as data isn't a dictionary.` + ); } return { - tasks: unmarshalArrayOfObject(data.tasks, unmarshalTask$1), + namespaces: marshalling.unmarshalArrayOfObject(data.namespaces, unmarshalNamespace), totalCount: data.total_count }; }; -const unmarshalListTldsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListTldsResponse' failed as data isn't a dictionary.`); +const unmarshalListTokensResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListTokensResponse' failed as data isn't a dictionary.` + ); } return { - tlds: unmarshalArrayOfObject(data.tlds, unmarshalTld), + tokens: marshalling.unmarshalArrayOfObject(data.tokens, unmarshalToken), totalCount: data.total_count }; }; -const unmarshalOrderResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'OrderResponse' failed as data isn't a dictionary.`); - } - return { - createdAt: unmarshalDate(data.created_at), - domains: data.domains, - organizationId: data.organization_id, - projectId: data.project_id, - taskId: data.task_id - }; -}; -const unmarshalRefreshDNSZoneResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'RefreshDNSZoneResponse' failed as data isn't a dictionary.`); - } - return { - dnsZones: unmarshalArrayOfObject(data.dns_zones, unmarshalDNSZone) - }; -}; -const unmarshalRegisterExternalDomainResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'RegisterExternalDomainResponse' failed as data isn't a dictionary.`); - } - return { - createdAt: unmarshalDate(data.created_at), - domain: data.domain, - organizationId: data.organization_id, - projectId: data.project_id, - validationToken: data.validation_token - }; -}; -const unmarshalRestoreDNSZoneVersionResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'RestoreDNSZoneVersionResponse' failed as data isn't a dictionary.`); - } - return {}; -}; -const unmarshalSearchAvailableDomainsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'SearchAvailableDomainsResponse' failed as data isn't a dictionary.`); - } - return { - availableDomains: unmarshalArrayOfObject(data.available_domains, unmarshalAvailableDomain) - }; -}; -const unmarshalUpdateDNSZoneNameserversResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'UpdateDNSZoneNameserversResponse' failed as data isn't a dictionary.`); +const unmarshalListTriggersResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListTriggersResponse' failed as data isn't a dictionary.` + ); } return { - ns: unmarshalArrayOfObject(data.ns, unmarshalNameserver$1) + totalCount: data.total_count, + triggers: marshalling.unmarshalArrayOfObject(data.triggers, unmarshalTrigger) }; }; -const unmarshalUpdateDNSZoneRecordsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'UpdateDNSZoneRecordsResponse' failed as data isn't a dictionary.`); +const unmarshalUploadURL = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'UploadURL' failed as data isn't a dictionary.` + ); } return { - records: unmarshalArrayOfObject(data.records, unmarshalDomainRecord) + headers: data.headers, + url: data.url }; }; -const marshalDomainRecordGeoIPConfigMatch = (request, defaults) => ({ - continents: request.continents, - countries: request.countries, - data: request.data -}); -const marshalDomainRecordViewConfigView = (request, defaults) => ({ - data: request.data, - subnet: request.subnet -}); -const marshalDomainRecordWeightedConfigWeightedIP = (request, defaults) => ({ - ip: request.ip, - weight: request.weight -}); -const marshalDomainRecordGeoIPConfig = (request, defaults) => ({ - default: request.default, - matches: request.matches.map(elt => marshalDomainRecordGeoIPConfigMatch(elt)) -}); -const marshalDomainRecordHTTPServiceConfig = (request, defaults) => ({ - ips: request.ips, - must_contain: request.mustContain, - strategy: request.strategy, - url: request.url, - user_agent: request.userAgent -}); -const marshalDomainRecordViewConfig = (request, defaults) => ({ - views: request.views.map(elt => marshalDomainRecordViewConfigView(elt)) -}); -const marshalDomainRecordWeightedConfig = (request, defaults) => ({ - weighted_ips: request.weightedIps.map(elt => marshalDomainRecordWeightedConfigWeightedIP(elt)) -}); -const marshalContactExtensionFRAssociationInfo = (request, defaults) => ({ - publication_jo: request.publicationJo, - publication_jo_page: request.publicationJoPage -}); -const marshalContactExtensionFRCodeAuthAfnicInfo = (request, defaults) => ({ - code_auth_afnic: request.codeAuthAfnic -}); -const marshalContactExtensionFRDunsInfo = (request, defaults) => ({ - duns_id: request.dunsId, - local_id: request.localId -}); -const marshalContactExtensionFRIndividualInfo = (request, defaults) => ({ - whois_opt_in: request.whoisOptIn -}); -const marshalContactExtensionFRTrademarkInfo = (request, defaults) => ({ - trademark_inpi: request.trademarkInpi -}); -const marshalDSRecordPublicKey = (request, defaults) => ({ - key: request.key -}); -const marshalDomainRecord = (request, defaults) => ({ - comment: request.comment, - data: request.data, - id: request.id, - name: request.name, - priority: request.priority, - ttl: request.ttl, - type: request.type, - ...resolveOneOf([{ - param: 'geo_ip_config', - value: request.geoIpConfig ? marshalDomainRecordGeoIPConfig(request.geoIpConfig) : undefined - }, { - param: 'http_service_config', - value: request.httpServiceConfig ? marshalDomainRecordHTTPServiceConfig(request.httpServiceConfig) : undefined - }, { - param: 'weighted_config', - value: request.weightedConfig ? marshalDomainRecordWeightedConfig(request.weightedConfig) : undefined - }, { - param: 'view_config', - value: request.viewConfig ? marshalDomainRecordViewConfig(request.viewConfig) : undefined - }]) -}); -const marshalRecordIdentifier = (request, defaults) => ({ - data: request.data, +const marshalCreateCronRequest = (request, defaults) => ({ + args: request.args, + function_id: request.functionId, name: request.name, - ttl: request.ttl, - type: request.type -}); -const marshalContactExtensionEU = (request, defaults) => ({ - european_citizenship: request.europeanCitizenship -}); -const marshalContactExtensionFR = (request, defaults) => ({ - mode: request.mode, - ...resolveOneOf([{ - param: 'individual_info', - value: request.individualInfo ? marshalContactExtensionFRIndividualInfo(request.individualInfo) : undefined - }, { - param: 'duns_info', - value: request.dunsInfo ? marshalContactExtensionFRDunsInfo(request.dunsInfo) : undefined - }, { - param: 'association_info', - value: request.associationInfo ? marshalContactExtensionFRAssociationInfo(request.associationInfo) : undefined - }, { - param: 'trademark_info', - value: request.trademarkInfo ? marshalContactExtensionFRTrademarkInfo(request.trademarkInfo) : undefined - }, { - param: 'code_auth_afnic_info', - value: request.codeAuthAfnicInfo ? marshalContactExtensionFRCodeAuthAfnicInfo(request.codeAuthAfnicInfo) : undefined - }]) -}); -const marshalContactExtensionNL = (request, defaults) => ({ - legal_form: request.legalForm, - legal_form_registration_number: request.legalFormRegistrationNumber -}); -const marshalContactQuestion = (request, defaults) => ({ - answer: request.answer, - question: request.question + schedule: request.schedule }); -const marshalDSRecordDigest = (request, defaults) => ({ - digest: request.digest, - public_key: request.publicKey ? marshalDSRecordPublicKey(request.publicKey) : undefined, - type: request.type +const marshalCreateDomainRequest = (request, defaults) => ({ + function_id: request.functionId, + hostname: request.hostname }); -const marshalImportRawDNSZoneRequestTsigKey = (request, defaults) => ({ - algorithm: request.algorithm, +const marshalSecret = (request, defaults) => ({ key: request.key, - name: request.name -}); -const marshalRecordChangeAdd = (request, defaults) => ({ - records: request.records.map(elt => marshalDomainRecord(elt)) -}); -const marshalRecordChangeClear = (request, defaults) => ({}); -const marshalRecordChangeDelete = (request, defaults) => ({ - ...resolveOneOf([{ - param: 'id', - value: request.id - }, { - param: 'id_fields', - value: request.idFields ? marshalRecordIdentifier(request.idFields) : undefined - }]) -}); -const marshalRecordChangeSet = (request, defaults) => ({ - records: request.records.map(elt => marshalDomainRecord(elt)), - ...resolveOneOf([{ - param: 'id', - value: request.id - }, { - param: 'id_fields', - value: request.idFields ? marshalRecordIdentifier(request.idFields) : undefined - }]) -}); -const marshalDSRecord = (request, defaults) => ({ - algorithm: request.algorithm, - key_id: request.keyId, - ...resolveOneOf([{ - param: 'digest', - value: request.digest ? marshalDSRecordDigest(request.digest) : undefined - }, { - param: 'public_key', - value: request.publicKey ? marshalDSRecordPublicKey(request.publicKey) : undefined - }]) -}); -const marshalImportProviderDNSZoneRequestOnlineV1 = (request, defaults) => ({ - token: request.token -}); -const marshalImportRawDNSZoneRequestAXFRSource = (request, defaults) => ({ - name_server: request.nameServer, - tsig_key: request.tsigKey ? marshalImportRawDNSZoneRequestTsigKey(request.tsigKey) : undefined -}); -const marshalImportRawDNSZoneRequestBindSource = (request, defaults) => ({ - content: request.content -}); -const marshalNameserver = (request, defaults) => ({ - ip: request.ip, - name: request.name -}); -const marshalNewContact = (request, defaults) => ({ - address_line_1: request.addressLine1, - address_line_2: request.addressLine2, - city: request.city, - company_identification_code: request.companyIdentificationCode, - company_name: request.companyName, - country: request.country, - email: request.email, - email_alt: request.emailAlt, - extension_eu: request.extensionEu ? marshalContactExtensionEU(request.extensionEu) : undefined, - extension_fr: request.extensionFr ? marshalContactExtensionFR(request.extensionFr) : undefined, - extension_nl: request.extensionNl ? marshalContactExtensionNL(request.extensionNl) : undefined, - fax_number: request.faxNumber, - firstname: request.firstname, - lang: request.lang, - lastname: request.lastname, - legal_form: request.legalForm, - phone_number: request.phoneNumber, - questions: request.questions ? request.questions.map(elt => marshalContactQuestion(elt)) : undefined, - resale: request.resale, - state: request.state, - vat_identification_code: request.vatIdentificationCode, - whois_opt_in: request.whoisOptIn, - zip: request.zip -}); -const marshalRecordChange = (request, defaults) => ({ - ...resolveOneOf([{ - param: 'add', - value: request.add ? marshalRecordChangeAdd(request.add) : undefined - }, { - param: 'set', - value: request.set ? marshalRecordChangeSet(request.set) : undefined - }, { - param: 'delete', - value: request.delete ? marshalRecordChangeDelete(request.delete) : undefined - }, { - param: 'clear', - value: request.clear ? marshalRecordChangeClear(request.clear) : undefined - }]) -}); -const marshalTransferInDomainRequestTransferRequest = (request, defaults) => ({ - auth_code: request.authCode, - domain: request.domain -}); -const marshalUpdateContactRequestQuestion = (request, defaults) => ({ - answer: request.answer, - question: request.question -}); -const marshalCloneDNSZoneRequest = (request, defaults) => ({ - dest_dns_zone: request.destDnsZone, - overwrite: request.overwrite, - project_id: request.projectId -}); -const marshalCreateDNSZoneRequest = (request, defaults) => ({ - domain: request.domain, - project_id: request.projectId ?? defaults.defaultProjectId, - subdomain: request.subdomain -}); -const marshalCreateSSLCertificateRequest = (request, defaults) => ({ - alternative_dns_zones: request.alternativeDnsZones, - dns_zone: request.dnsZone -}); -const marshalImportProviderDNSZoneRequest = (request, defaults) => ({ - ...resolveOneOf([{ - param: 'online_v1', - value: request.onlineV1 ? marshalImportProviderDNSZoneRequestOnlineV1(request.onlineV1) : undefined - }]) -}); -const marshalImportRawDNSZoneRequest = (request, defaults) => ({ - content: request.content, - format: request.format, - project_id: request.projectId ?? defaults.defaultProjectId, - ...resolveOneOf([{ - param: 'bind_source', - value: request.bindSource ? marshalImportRawDNSZoneRequestBindSource(request.bindSource) : undefined - }, { - param: 'axfr_source', - value: request.axfrSource ? marshalImportRawDNSZoneRequestAXFRSource(request.axfrSource) : undefined - }]) + value: request.value }); -const marshalRefreshDNSZoneRequest = (request, defaults) => ({ - recreate_dns_zone: request.recreateDnsZone, - recreate_sub_dns_zone: request.recreateSubDnsZone +const marshalCreateFunctionRequest = (request, defaults) => ({ + description: request.description, + environment_variables: request.environmentVariables, + handler: request.handler, + http_option: request.httpOption, + max_scale: request.maxScale, + memory_limit: request.memoryLimit, + min_scale: request.minScale, + name: request.name || randomName("fn"), + namespace_id: request.namespaceId, + privacy: request.privacy, + runtime: request.runtime, + sandbox: request.sandbox, + secret_environment_variables: request.secretEnvironmentVariables !== void 0 ? request.secretEnvironmentVariables.map( + (elt) => marshalSecret(elt) + ) : void 0, + timeout: request.timeout }); -const marshalRegistrarApiBuyDomainsRequest = (request, defaults) => ({ - domains: request.domains, - duration_in_years: request.durationInYears, +const marshalCreateNamespaceRequest = (request, defaults) => ({ + description: request.description, + environment_variables: request.environmentVariables, + name: request.name || randomName("ns"), project_id: request.projectId ?? defaults.defaultProjectId, - ...resolveOneOf([{ - param: 'administrative_contact_id', - value: request.administrativeContactId - }, { - param: 'administrative_contact', - value: request.administrativeContact ? marshalNewContact(request.administrativeContact) : undefined - }]), - ...resolveOneOf([{ - param: 'owner_contact_id', - value: request.ownerContactId - }, { - param: 'owner_contact', - value: request.ownerContact ? marshalNewContact(request.ownerContact) : undefined - }]), - ...resolveOneOf([{ - param: 'technical_contact_id', - value: request.technicalContactId - }, { - param: 'technical_contact', - value: request.technicalContact ? marshalNewContact(request.technicalContact) : undefined - }]) -}); -const marshalRegistrarApiCheckContactsCompatibilityRequest = (request, defaults) => ({ - domains: request.domains, - tlds: request.tlds, - ...resolveOneOf([{ - param: 'administrative_contact_id', - value: request.administrativeContactId - }, { - param: 'administrative_contact', - value: request.administrativeContact ? marshalNewContact(request.administrativeContact) : undefined - }]), - ...resolveOneOf([{ - param: 'owner_contact_id', - value: request.ownerContactId - }, { - param: 'owner_contact', - value: request.ownerContact ? marshalNewContact(request.ownerContact) : undefined - }]), - ...resolveOneOf([{ - param: 'technical_contact_id', - value: request.technicalContactId - }, { - param: 'technical_contact', - value: request.technicalContact ? marshalNewContact(request.technicalContact) : undefined - }]) -}); -const marshalRegistrarApiCreateDomainHostRequest = (request, defaults) => ({ - ips: request.ips, - name: request.name -}); -const marshalRegistrarApiEnableDomainDNSSECRequest = (request, defaults) => ({ - ds_record: request.dsRecord ? marshalDSRecord(request.dsRecord) : undefined -}); -const marshalRegistrarApiRegisterExternalDomainRequest = (request, defaults) => ({ - domain: request.domain, - project_id: request.projectId ?? defaults.defaultProjectId + secret_environment_variables: request.secretEnvironmentVariables !== void 0 ? request.secretEnvironmentVariables.map( + (elt) => marshalSecret(elt) + ) : void 0 }); -const marshalRegistrarApiRenewDomainsRequest = (request, defaults) => ({ - domains: request.domains, - duration_in_years: request.durationInYears, - force_late_renewal: request.forceLateRenewal +const marshalCreateTokenRequest = (request, defaults) => ({ + description: request.description, + expires_at: request.expiresAt, + ...marshalling.resolveOneOf([ + { param: "function_id", value: request.functionId }, + { param: "namespace_id", value: request.namespaceId } + ]) }); -const marshalRegistrarApiTradeDomainRequest = (request, defaults) => ({ - project_id: request.projectId, - ...resolveOneOf([{ - param: 'new_owner_contact_id', - value: request.newOwnerContactId - }, { - param: 'new_owner_contact', - value: request.newOwnerContact ? marshalNewContact(request.newOwnerContact) : undefined - }]) +const marshalCreateTriggerRequestMnqNatsClientConfig = (request, defaults) => ({ + mnq_nats_account_id: request.mnqNatsAccountId, + mnq_project_id: request.mnqProjectId, + mnq_region: request.mnqRegion, + subject: request.subject }); -const marshalRegistrarApiTransferInDomainRequest = (request, defaults) => ({ - domains: request.domains.map(elt => marshalTransferInDomainRequestTransferRequest(elt)), - project_id: request.projectId ?? defaults.defaultProjectId, - ...resolveOneOf([{ - param: 'administrative_contact_id', - value: request.administrativeContactId - }, { - param: 'administrative_contact', - value: request.administrativeContact ? marshalNewContact(request.administrativeContact) : undefined - }]), - ...resolveOneOf([{ - param: 'owner_contact_id', - value: request.ownerContactId - }, { - param: 'owner_contact', - value: request.ownerContact ? marshalNewContact(request.ownerContact) : undefined - }]), - ...resolveOneOf([{ - param: 'technical_contact_id', - value: request.technicalContactId - }, { - param: 'technical_contact', - value: request.technicalContact ? marshalNewContact(request.technicalContact) : undefined - }]) +const marshalCreateTriggerRequestMnqSqsClientConfig = (request, defaults) => ({ + mnq_project_id: request.mnqProjectId, + mnq_region: request.mnqRegion, + queue: request.queue }); -const marshalRegistrarApiUpdateContactRequest = (request, defaults) => ({ - address_line_1: request.addressLine1, - address_line_2: request.addressLine2, - city: request.city, - company_identification_code: request.companyIdentificationCode, - country: request.country, - email: request.email, - email_alt: request.emailAlt, - extension_eu: request.extensionEu ? marshalContactExtensionEU(request.extensionEu) : undefined, - extension_fr: request.extensionFr ? marshalContactExtensionFR(request.extensionFr) : undefined, - extension_nl: request.extensionNl ? marshalContactExtensionNL(request.extensionNl) : undefined, - fax_number: request.faxNumber, - lang: request.lang ?? 'unknown_language_code', - phone_number: request.phoneNumber, - questions: request.questions ? request.questions.map(elt => marshalUpdateContactRequestQuestion(elt)) : undefined, - resale: request.resale, - state: request.state, - vat_identification_code: request.vatIdentificationCode, - whois_opt_in: request.whoisOptIn, - zip: request.zip +const marshalCreateTriggerRequestSqsClientConfig = (request, defaults) => ({ + access_key: request.accessKey, + endpoint: request.endpoint, + queue_url: request.queueUrl, + secret_key: request.secretKey }); -const marshalRegistrarApiUpdateDomainHostRequest = (request, defaults) => ({ - ips: request.ips +const marshalCreateTriggerRequest = (request, defaults) => ({ + description: request.description, + function_id: request.functionId, + name: request.name, + ...marshalling.resolveOneOf([ + { + param: "scw_sqs_config", + value: request.scwSqsConfig !== void 0 ? marshalCreateTriggerRequestMnqSqsClientConfig( + request.scwSqsConfig + ) : void 0 + }, + { + param: "scw_nats_config", + value: request.scwNatsConfig !== void 0 ? marshalCreateTriggerRequestMnqNatsClientConfig( + request.scwNatsConfig + ) : void 0 + }, + { + param: "sqs_config", + value: request.sqsConfig !== void 0 ? marshalCreateTriggerRequestSqsClientConfig( + request.sqsConfig + ) : void 0 + } + ]) }); -const marshalRegistrarApiUpdateDomainRequest = (request, defaults) => ({ - ...resolveOneOf([{ - param: 'administrative_contact_id', - value: request.administrativeContactId - }, { - param: 'administrative_contact', - value: request.administrativeContact ? marshalNewContact(request.administrativeContact) : undefined - }]), - ...resolveOneOf([{ - param: 'owner_contact_id', - value: request.ownerContactId - }, { - param: 'owner_contact', - value: request.ownerContact ? marshalNewContact(request.ownerContact) : undefined - }]), - ...resolveOneOf([{ - param: 'technical_contact_id', - value: request.technicalContactId - }, { - param: 'technical_contact', - value: request.technicalContact ? marshalNewContact(request.technicalContact) : undefined - }]) +const marshalUpdateCronRequest = (request, defaults) => ({ + args: request.args, + function_id: request.functionId, + name: request.name, + schedule: request.schedule }); -const marshalUpdateDNSZoneNameserversRequest = (request, defaults) => ({ - ns: request.ns.map(elt => marshalNameserver(elt)) +const marshalUpdateFunctionRequest = (request, defaults) => ({ + description: request.description, + environment_variables: request.environmentVariables, + handler: request.handler, + http_option: request.httpOption, + max_scale: request.maxScale, + memory_limit: request.memoryLimit, + min_scale: request.minScale, + privacy: request.privacy, + redeploy: request.redeploy, + runtime: request.runtime, + sandbox: request.sandbox, + secret_environment_variables: request.secretEnvironmentVariables !== void 0 ? request.secretEnvironmentVariables.map( + (elt) => marshalSecret(elt) + ) : void 0, + timeout: request.timeout }); -const marshalUpdateDNSZoneRecordsRequest = (request, defaults) => ({ - changes: request.changes.map(elt => marshalRecordChange(elt)), - disallow_new_zone_creation: request.disallowNewZoneCreation, - return_all_records: request.returnAllRecords, - serial: request.serial +const marshalUpdateNamespaceRequest = (request, defaults) => ({ + description: request.description, + environment_variables: request.environmentVariables, + secret_environment_variables: request.secretEnvironmentVariables !== void 0 ? request.secretEnvironmentVariables.map( + (elt) => marshalSecret(elt) + ) : void 0 }); -const marshalUpdateDNSZoneRequest = (request, defaults) => ({ - new_dns_zone: request.newDnsZone, - project_id: request.projectId ?? defaults.defaultProjectId +const marshalUpdateTriggerRequestSqsClientConfig = (request, defaults) => ({ + access_key: request.accessKey, + secret_key: request.secretKey }); +const marshalUpdateTriggerRequest = (request, defaults) => ({ + description: request.description, + name: request.name, + ...marshalling.resolveOneOf([ + { + param: "sqs_config", + value: request.sqsConfig !== void 0 ? marshalUpdateTriggerRequestSqsClientConfig( + request.sqsConfig + ) : void 0 + } + ]) +}); +exports.marshalCreateCronRequest = marshalCreateCronRequest; +exports.marshalCreateDomainRequest = marshalCreateDomainRequest; +exports.marshalCreateFunctionRequest = marshalCreateFunctionRequest; +exports.marshalCreateNamespaceRequest = marshalCreateNamespaceRequest; +exports.marshalCreateTokenRequest = marshalCreateTokenRequest; +exports.marshalCreateTriggerRequest = marshalCreateTriggerRequest; +exports.marshalUpdateCronRequest = marshalUpdateCronRequest; +exports.marshalUpdateFunctionRequest = marshalUpdateFunctionRequest; +exports.marshalUpdateNamespaceRequest = marshalUpdateNamespaceRequest; +exports.marshalUpdateTriggerRequest = marshalUpdateTriggerRequest; +exports.unmarshalCron = unmarshalCron; +exports.unmarshalDomain = unmarshalDomain; +exports.unmarshalDownloadURL = unmarshalDownloadURL; +exports.unmarshalFunction = unmarshalFunction; +exports.unmarshalListCronsResponse = unmarshalListCronsResponse; +exports.unmarshalListDomainsResponse = unmarshalListDomainsResponse; +exports.unmarshalListFunctionRuntimesResponse = unmarshalListFunctionRuntimesResponse; +exports.unmarshalListFunctionsResponse = unmarshalListFunctionsResponse; +exports.unmarshalListNamespacesResponse = unmarshalListNamespacesResponse; +exports.unmarshalListTokensResponse = unmarshalListTokensResponse; +exports.unmarshalListTriggersResponse = unmarshalListTriggersResponse; +exports.unmarshalNamespace = unmarshalNamespace; +exports.unmarshalToken = unmarshalToken; +exports.unmarshalTrigger = unmarshalTrigger; +exports.unmarshalUploadURL = unmarshalUploadURL; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const jsonContentHeaders$k = { - 'Content-Type': 'application/json; charset=utf-8' -}; -/** - * Domains and DNS API. - * - * Domains and DNS API. Manage your domains, DNS zones and records with the - * Domains and DNS API. - */ -let API$l = class API extends API$u { - pageOfListDNSZones = request => this.client.fetch({ - method: 'GET', - path: `/domain/v2beta1/dns-zones`, - urlParams: urlParams(['created_after', request.createdAfter], ['created_before', request.createdBefore], ['dns_zone', request.dnsZone], ['dns_zones', request.dnsZones], ['domain', request.domain], ['order_by', request.orderBy ?? 'domain_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId], ['updated_after', request.updatedAfter], ['updated_before', request.updatedBefore]) - }, unmarshalListDNSZonesResponse); +/***/ }), - /** - * List DNS zones. Retrieve the list of DNS zones you can manage and filter - * DNS zones associated with specific domain names. - * - * @param request - The request {@link ListDNSZonesRequest} - * @returns A Promise of ListDNSZonesResponse - */ - listDNSZones = request => enrichForPagination('dnsZones', this.pageOfListDNSZones, request); +/***/ 3090: +/***/ ((__unused_webpack_module, exports) => { - /** - * Create a DNS zone. Create a new DNS zone specified by the domain name, the - * subdomain and the Project ID. - * - * @param request - The request {@link CreateDNSZoneRequest} - * @returns A Promise of DNSZone - */ - createDNSZone = request => this.client.fetch({ - body: JSON.stringify(marshalCreateDNSZoneRequest(request, this.client.settings)), - headers: jsonContentHeaders$k, - method: 'POST', - path: `/domain/v2beta1/dns-zones` - }, unmarshalDNSZone); +"use strict"; - /** - * Update a DNS zone. Update the name and/or the Organizations for a DNS zone. - * - * @param request - The request {@link UpdateDNSZoneRequest} - * @returns A Promise of DNSZone - */ - updateDNSZone = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateDNSZoneRequest(request, this.client.settings)), - headers: jsonContentHeaders$k, - method: 'PATCH', - path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}` - }, unmarshalDNSZone); +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const CreateTriggerRequest = { + description: { + maxLength: 255 + }, + name: { + maxLength: 50, + minLength: 1 + } +}; +const CreateTriggerRequestMnqNatsClientConfig = { + mnqRegion: { + maxLength: 20, + minLength: 1 + }, + subject: { + maxLength: 100, + minLength: 1, + pattern: /^[^\s]+$/ + } +}; +const CreateTriggerRequestMnqSqsClientConfig = { + mnqRegion: { + maxLength: 20, + minLength: 1 + }, + queue: { + maxLength: 100, + minLength: 1 + } +}; +const UpdateTriggerRequest = { + description: { + maxLength: 255 + }, + name: { + maxLength: 50, + minLength: 1 + } +}; +exports.CreateTriggerRequest = CreateTriggerRequest; +exports.CreateTriggerRequestMnqNatsClientConfig = CreateTriggerRequestMnqNatsClientConfig; +exports.CreateTriggerRequestMnqSqsClientConfig = CreateTriggerRequestMnqSqsClientConfig; +exports.UpdateTriggerRequest = UpdateTriggerRequest; + + +/***/ }), + +/***/ 9453: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - /** - * Clone a DNS zone. Clone an existing DNS zone with all its records into a - * new DNS zone. - * - * @param request - The request {@link CloneDNSZoneRequest} - * @returns A Promise of DNSZone - */ - cloneDNSZone = request => this.client.fetch({ - body: JSON.stringify(marshalCloneDNSZoneRequest(request, this.client.settings)), - headers: jsonContentHeaders$k, - method: 'POST', - path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/clone` - }, unmarshalDNSZone); +"use strict"; - /** - * Delete a DNS zone. Delete a DNS zone and all its records. - * - * @param request - The request {@link DeleteDNSZoneRequest} - * @returns A Promise of DeleteDNSZoneResponse - */ - deleteDNSZone = request => this.client.fetch({ - method: 'DELETE', - path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}`, - urlParams: urlParams(['project_id', request.projectId ?? this.client.settings.defaultProjectId]) - }, unmarshalDeleteDNSZoneResponse); - pageOfListDNSZoneRecords = request => this.client.fetch({ - method: 'GET', - path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/records`, - urlParams: urlParams(['id', request.id], ['name', request.name], ['order_by', request.orderBy ?? 'name_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId], ['type', request.type ?? 'unknown']) - }, unmarshalListDNSZoneRecordsResponse); +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const index_gen = __nccwpck_require__(7000); +exports.v1alpha1 = index_gen; - /** - * List records within a DNS zone. Retrieve a list of DNS records within a DNS - * zone that has default name servers. You can filter records by type and - * name. - * - * @param request - The request {@link ListDNSZoneRecordsRequest} - * @returns A Promise of ListDNSZoneRecordsResponse - */ - listDNSZoneRecords = request => enrichForPagination('records', this.pageOfListDNSZoneRecords, request); - /** - * Update records within a DNS zone. Update records within a DNS zone that has - * default name servers and perform several actions on your records. - * - * Actions include: - * - * - Add: allows you to add a new record or add a new IP to an existing A - * record, for example - * - Set: allows you to edit a record or edit an IP from an existing A record, - * for example - * - Delete: allows you to delete a record or delete an IP from an existing A - * record, for example - * - Clear: allows you to delete all records from a DNS zone - * - * All edits will be versioned. - * - * @param request - The request {@link UpdateDNSZoneRecordsRequest} - * @returns A Promise of UpdateDNSZoneRecordsResponse - */ - updateDNSZoneRecords = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateDNSZoneRecordsRequest(request, this.client.settings)), - headers: jsonContentHeaders$k, - method: 'PATCH', - path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/records` - }, unmarshalUpdateDNSZoneRecordsResponse); +/***/ }), - /** - * List name servers within a DNS zone. Retrieve a list of name servers within - * a DNS zone and their optional glue records. - * - * @param request - The request {@link ListDNSZoneNameserversRequest} - * @returns A Promise of ListDNSZoneNameserversResponse - */ - listDNSZoneNameservers = request => this.client.fetch({ - method: 'GET', - path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/nameservers`, - urlParams: urlParams(['project_id', request.projectId]) - }, unmarshalListDNSZoneNameserversResponse); +/***/ 5924: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api = __nccwpck_require__(3042); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const resourcePaginator = __nccwpck_require__(4983); +const marshalling_gen = __nccwpck_require__(790); +const jsonContentHeaders = { + "Content-Type": "application/json; charset=utf-8" +}; +class API extends api.API { + pageOfListSSHKeys = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/iam/v1alpha1/ssh-keys`, + urlParams: marshalling.urlParams( + ["disabled", request.disabled], + ["name", request.name], + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId] + ) + }, + marshalling_gen.unmarshalListSSHKeysResponse + ); /** - * Update name servers within a DNS zone. Update name servers within a DNS - * zone and set optional glue records. + * List SSH keys. List SSH keys. By default, the SSH keys listed are ordered + * by creation date in ascending order. This can be modified via the + * `order_by` field. You can define additional parameters for your query such + * as `organization_id`, `name`, `project_id` and `disabled`. * - * @param request - The request {@link UpdateDNSZoneNameserversRequest} - * @returns A Promise of UpdateDNSZoneNameserversResponse + * @param request - The request {@link ListSSHKeysRequest} + * @returns A Promise of ListSSHKeysResponse */ - updateDNSZoneNameservers = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateDNSZoneNameserversRequest(request, this.client.settings)), - headers: jsonContentHeaders$k, - method: 'PUT', - path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/nameservers` - }, unmarshalUpdateDNSZoneNameserversResponse); - + listSSHKeys = (request = {}) => resourcePaginator.enrichForPagination("sshKeys", this.pageOfListSSHKeys, request); /** - * Clear records within a DNS zone. Delete all records within a DNS zone that - * has default name servers.
All edits will be versioned. + * Create an SSH key. Add a new SSH key to a Scaleway Project. You must + * specify the `name`, `public_key` and `project_id`. * - * @param request - The request {@link ClearDNSZoneRecordsRequest} - * @returns A Promise of ClearDNSZoneRecordsResponse + * @param request - The request {@link CreateSSHKeyRequest} + * @returns A Promise of SSHKey */ - clearDNSZoneRecords = request => this.client.fetch({ - method: 'DELETE', - path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/records` - }, unmarshalClearDNSZoneRecordsResponse); - + createSSHKey = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateSSHKeyRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/iam/v1alpha1/ssh-keys` + }, + marshalling_gen.unmarshalSSHKey + ); /** - * Export a raw DNS zone. Export a DNS zone with default name servers, in a - * specific format. + * Get an SSH key. Retrieve information about a given SSH key, specified by + * the `ssh_key_id` parameter. The SSH key's full details, including `id`, + * `name`, `public_key`, and `project_id` are returned in the response. * - * @param request - The request {@link ExportRawDNSZoneRequest} - * @returns A Promise of Blob + * @param request - The request {@link GetSSHKeyRequest} + * @returns A Promise of SSHKey */ - exportRawDNSZone = request => this.client.fetch({ - method: 'GET', - path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/raw`, - urlParams: urlParams(['dl', 1], ['format', request.format ?? 'unknown_raw_format']), - responseType: 'blob' - }); - + getSSHKey = (request) => this.client.fetch( + { + method: "GET", + path: `/iam/v1alpha1/ssh-keys/${marshalling.validatePathParam("sshKeyId", request.sshKeyId)}` + }, + marshalling_gen.unmarshalSSHKey + ); /** - * Import a raw DNS zone. Import and replace the format of records from a - * given provider, with default name servers. + * Update an SSH key. Update the parameters of an SSH key, including `name` + * and `disable`. * - * @param request - The request {@link ImportRawDNSZoneRequest} - * @returns A Promise of ImportRawDNSZoneResponse + * @param request - The request {@link UpdateSSHKeyRequest} + * @returns A Promise of SSHKey */ - importRawDNSZone = request => this.client.fetch({ - body: JSON.stringify(marshalImportRawDNSZoneRequest(request, this.client.settings)), - headers: jsonContentHeaders$k, - method: 'POST', - path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/raw` - }, unmarshalImportRawDNSZoneResponse); - + updateSSHKey = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateSSHKeyRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/iam/v1alpha1/ssh-keys/${marshalling.validatePathParam("sshKeyId", request.sshKeyId)}` + }, + marshalling_gen.unmarshalSSHKey + ); /** - * Import a DNS zone from another provider. Import and replace the format of - * records from a given provider, with default name servers. + * Delete an SSH key. Delete a given SSH key, specified by the `ssh_key_id`. + * Deleting an SSH is permanent, and cannot be undone. Note that you might + * need to update any configurations that used the SSH key. * - * @param request - The request {@link ImportProviderDNSZoneRequest} - * @returns A Promise of ImportProviderDNSZoneResponse + * @param request - The request {@link DeleteSSHKeyRequest} */ - importProviderDNSZone = request => this.client.fetch({ - body: JSON.stringify(marshalImportProviderDNSZoneRequest(request, this.client.settings)), - headers: jsonContentHeaders$k, - method: 'POST', - path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/import-provider` - }, unmarshalImportProviderDNSZoneResponse); - + deleteSSHKey = (request) => this.client.fetch({ + method: "DELETE", + path: `/iam/v1alpha1/ssh-keys/${marshalling.validatePathParam("sshKeyId", request.sshKeyId)}` + }); + pageOfListUsers = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/iam/v1alpha1/users`, + urlParams: marshalling.urlParams( + ["mfa", request.mfa], + ["order_by", request.orderBy], + [ + "organization_id", + request.organizationId ?? this.client.settings.defaultOrganizationId + ], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["tag", request.tag], + ["user_ids", request.userIds] + ) + }, + marshalling_gen.unmarshalListUsersResponse + ); /** - * Refresh a DNS zone. Refresh an SOA DNS zone to reload the records in the - * DNS zone and update the SOA serial. You can recreate the given DNS zone and - * its sub DNS zone if needed. + * List users of an Organization. List the users of an Organization. By + * default, the users listed are ordered by creation date in ascending order. + * This can be modified via the `order_by` field. You must define the + * `organization_id` in the query path of your request. You can also define + * additional parameters for your query such as `user_ids`. * - * @param request - The request {@link RefreshDNSZoneRequest} - * @returns A Promise of RefreshDNSZoneResponse + * @param request - The request {@link ListUsersRequest} + * @returns A Promise of ListUsersResponse */ - refreshDNSZone = request => this.client.fetch({ - body: JSON.stringify(marshalRefreshDNSZoneRequest(request, this.client.settings)), - headers: jsonContentHeaders$k, - method: 'POST', - path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/refresh` - }, unmarshalRefreshDNSZoneResponse); - pageOfListDNSZoneVersions = request => this.client.fetch({ - method: 'GET', - path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/versions`, - urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]) - }, unmarshalListDNSZoneVersionsResponse); - + listUsers = (request = {}) => resourcePaginator.enrichForPagination("users", this.pageOfListUsers, request); /** - * List versions of a DNS zone. Retrieve a list of a DNS zone's versions.
- * The maximum version count is 100. If the count reaches this limit, the - * oldest version will be deleted after each new modification. + * Get a given user. Retrieve information about a user, specified by the + * `user_id` parameter. The user's full details, including `id`, `email`, + * `organization_id`, `status` and `mfa` are returned in the response. * - * @param request - The request {@link ListDNSZoneVersionsRequest} - * @returns A Promise of ListDNSZoneVersionsResponse + * @param request - The request {@link GetUserRequest} + * @returns A Promise of User */ - listDNSZoneVersions = request => enrichForPagination('versions', this.pageOfListDNSZoneVersions, request); - pageOfListDNSZoneVersionRecords = request => this.client.fetch({ - method: 'GET', - path: `/domain/v2beta1/dns-zones/version/${validatePathParam('dnsZoneVersionId', request.dnsZoneVersionId)}`, - urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]) - }, unmarshalListDNSZoneVersionRecordsResponse); - + getUser = (request) => this.client.fetch( + { + method: "GET", + path: `/iam/v1alpha1/users/${marshalling.validatePathParam("userId", request.userId)}` + }, + marshalling_gen.unmarshalUser + ); /** - * List records from a given version of a specific DNS zone. Retrieve a list - * of records from a specific DNS zone version. + * Update a user. Update the parameters of a user, including `tags`. * - * @param request - The request {@link ListDNSZoneVersionRecordsRequest} - * @returns A Promise of ListDNSZoneVersionRecordsResponse + * @param request - The request {@link UpdateUserRequest} + * @returns A Promise of User */ - listDNSZoneVersionRecords = request => enrichForPagination('records', this.pageOfListDNSZoneVersionRecords, request); - + updateUser = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateUserRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/iam/v1alpha1/users/${marshalling.validatePathParam("userId", request.userId)}` + }, + marshalling_gen.unmarshalUser + ); /** - * Access differences from a specific DNS zone version. Access a previous DNS - * zone version to see the differences from another specific version. + * Delete a guest user from an Organization. Remove a user from an + * Organization in which they are a guest. You must define the `user_id` in + * your request. Note that removing a user from an Organization automatically + * deletes their API keys, and any policies directly attached to them become + * orphaned. * - * @param request - The request {@link GetDNSZoneVersionDiffRequest} - * @returns A Promise of GetDNSZoneVersionDiffResponse + * @param request - The request {@link DeleteUserRequest} */ - getDNSZoneVersionDiff = request => this.client.fetch({ - method: 'GET', - path: `/domain/v2beta1/dns-zones/version/${validatePathParam('dnsZoneVersionId', request.dnsZoneVersionId)}/diff` - }, unmarshalGetDNSZoneVersionDiffResponse); - + deleteUser = (request) => this.client.fetch({ + method: "DELETE", + path: `/iam/v1alpha1/users/${marshalling.validatePathParam("userId", request.userId)}` + }); /** - * Restore a DNS zone version. Restore and activate a version of a specific - * DNS zone. + * Create a new user. Create a new user. You must define the `organization_id` + * and the `email` in your request. * - * @param request - The request {@link RestoreDNSZoneVersionRequest} - * @returns A Promise of RestoreDNSZoneVersionResponse + * @param request - The request {@link CreateUserRequest} + * @returns A Promise of User */ - restoreDNSZoneVersion = request => this.client.fetch({ - body: '{}', - headers: jsonContentHeaders$k, - method: 'POST', - path: `/domain/v2beta1/dns-zones/version/${validatePathParam('dnsZoneVersionId', request.dnsZoneVersionId)}/restore` - }, unmarshalRestoreDNSZoneVersionResponse); - + createUser = (request = {}) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateUserRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/iam/v1alpha1/users` + }, + marshalling_gen.unmarshalUser + ); + pageOfListApplications = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/iam/v1alpha1/applications`, + urlParams: marshalling.urlParams( + ["application_ids", request.applicationIds], + ["editable", request.editable], + ["name", request.name], + ["order_by", request.orderBy], + [ + "organization_id", + request.organizationId ?? this.client.settings.defaultOrganizationId + ], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["tag", request.tag] + ) + }, + marshalling_gen.unmarshalListApplicationsResponse + ); /** - * Get a DNS zone's TLS certificate. Get the DNS zone's TLS certificate. If - * you do not have a certificate, the ouptut returns `no certificate found`. + * List applications of an Organization. List the applications of an + * Organization. By default, the applications listed are ordered by creation + * date in ascending order. This can be modified via the `order_by` field. You + * must define the `organization_id` in the query path of your request. You + * can also define additional parameters for your query such as + * `application_ids`. * - * @param request - The request {@link GetSSLCertificateRequest} - * @returns A Promise of SSLCertificate + * @param request - The request {@link ListApplicationsRequest} + * @returns A Promise of ListApplicationsResponse */ - getSSLCertificate = request => this.client.fetch({ - method: 'GET', - path: `/domain/v2beta1/ssl-certificates/${validatePathParam('dnsZone', request.dnsZone)}` - }, unmarshalSSLCertificate); - + listApplications = (request = {}) => resourcePaginator.enrichForPagination("applications", this.pageOfListApplications, request); /** - * Waits for {@link SSLCertificate} to be in a final state. + * Create a new application. Create a new application. You must define the + * `name` parameter in the request. * - * @param request - The request {@link GetSSLCertificateRequest} - * @param options - The waiting options - * @returns A Promise of SSLCertificate + * @param request - The request {@link CreateApplicationRequest} + * @returns A Promise of Application */ - waitForSSLCertificate = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!SSL_CERTIFICATE_TRANSIENT_STATUSES.includes(res.status))), this.getSSLCertificate, request, options); - + createApplication = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateApplicationRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/iam/v1alpha1/applications` + }, + marshalling_gen.unmarshalApplication + ); /** - * Create or get the DNS zone's TLS certificate. Create a new TLS certificate - * or retrieve information about an existing TLS certificate. + * Get a given application. Retrieve information about an application, + * specified by the `application_id` parameter. The application's full + * details, including `id`, `email`, `organization_id`, `status` and + * `two_factor_enabled` are returned in the response. * - * @param request - The request {@link CreateSSLCertificateRequest} - * @returns A Promise of SSLCertificate + * @param request - The request {@link GetApplicationRequest} + * @returns A Promise of Application */ - createSSLCertificate = request => this.client.fetch({ - body: JSON.stringify(marshalCreateSSLCertificateRequest(request, this.client.settings)), - headers: jsonContentHeaders$k, - method: 'POST', - path: `/domain/v2beta1/ssl-certificates` - }, unmarshalSSLCertificate); - pageOfListSSLCertificates = request => this.client.fetch({ - method: 'GET', - path: `/domain/v2beta1/ssl-certificates`, - urlParams: urlParams(['dns_zone', request.dnsZone], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId]) - }, unmarshalListSSLCertificatesResponse); - + getApplication = (request) => this.client.fetch( + { + method: "GET", + path: `/iam/v1alpha1/applications/${marshalling.validatePathParam("applicationId", request.applicationId)}` + }, + marshalling_gen.unmarshalApplication + ); /** - * List a user's TLS certificates. List all the TLS certificates a user has - * created, specified by the user's Project ID and the DNS zone. + * Update an application. Update the parameters of an application, including + * `name` and `description`. * - * @param request - The request {@link ListSSLCertificatesRequest} - * @returns A Promise of ListSSLCertificatesResponse + * @param request - The request {@link UpdateApplicationRequest} + * @returns A Promise of Application */ - listSSLCertificates = request => enrichForPagination('certificates', this.pageOfListSSLCertificates, request); - + updateApplication = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateApplicationRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/iam/v1alpha1/applications/${marshalling.validatePathParam("applicationId", request.applicationId)}` + }, + marshalling_gen.unmarshalApplication + ); /** - * Delete a TLS certificate. Delete an existing TLS certificate specified by - * its DNS zone. Deleting a TLS certificate is permanent and cannot be - * undone. + * Delete an application. Delete an application. Note that this action is + * irreversible and will automatically delete the application's API keys. + * Policies attached to users and applications via this group will no longer + * apply. * - * @param request - The request {@link DeleteSSLCertificateRequest} - * @returns A Promise of DeleteSSLCertificateResponse + * @param request - The request {@link DeleteApplicationRequest} */ - deleteSSLCertificate = request => this.client.fetch({ - method: 'DELETE', - path: `/domain/v2beta1/ssl-certificates/${validatePathParam('dnsZone', request.dnsZone)}` - }, unmarshalDeleteSSLCertificateResponse); - + deleteApplication = (request) => this.client.fetch({ + method: "DELETE", + path: `/iam/v1alpha1/applications/${marshalling.validatePathParam("applicationId", request.applicationId)}` + }); + pageOfListGroups = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/iam/v1alpha1/groups`, + urlParams: marshalling.urlParams( + ["application_ids", request.applicationIds], + ["group_ids", request.groupIds], + ["name", request.name], + ["order_by", request.orderBy], + [ + "organization_id", + request.organizationId ?? this.client.settings.defaultOrganizationId + ], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["tag", request.tag], + ["user_ids", request.userIds] + ) + }, + marshalling_gen.unmarshalListGroupsResponse + ); /** - * Get the DNS zone's TSIG key. Retrieve information about the TSIG key of a - * given DNS zone to allow AXFR requests. + * List groups. List groups. By default, the groups listed are ordered by + * creation date in ascending order. This can be modified via the `order_by` + * field. You can define additional parameters to filter your query. Use + * `user_ids` or `application_ids` to list all groups certain users or + * applications belong to. * - * @param request - The request {@link GetDNSZoneTsigKeyRequest} - * @returns A Promise of GetDNSZoneTsigKeyResponse + * @param request - The request {@link ListGroupsRequest} + * @returns A Promise of ListGroupsResponse */ - getDNSZoneTsigKey = request => this.client.fetch({ - method: 'GET', - path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/tsig-key` - }, unmarshalGetDNSZoneTsigKeyResponse); - + listGroups = (request = {}) => resourcePaginator.enrichForPagination("groups", this.pageOfListGroups, request); /** - * Delete the DNS zone's TSIG key. Delete an existing TSIG key specified by - * its DNS zone. Deleting a TSIG key is permanent and cannot be undone. + * Create a group. Create a new group. You must define the `name` and + * `organization_id` parameters in the request. * - * @param request - The request {@link DeleteDNSZoneTsigKeyRequest} + * @param request - The request {@link CreateGroupRequest} + * @returns A Promise of Group */ - deleteDNSZoneTsigKey = request => this.client.fetch({ - method: 'DELETE', - path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/tsig-key` - }); -}; - -/** - * Domains and DNS - Registrar API. - * - * Domains and DNS - Registrar API. Manage your domains and contacts. - */ -class RegistrarAPI extends API$u { - pageOfListTasks = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/domain/v2beta1/tasks`, - urlParams: urlParams(['domain', request.domain], ['order_by', request.orderBy ?? 'domain_desc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId], ['statuses', request.statuses], ['types', request.types]) - }, unmarshalListTasksResponse); - + createGroup = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateGroupRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/iam/v1alpha1/groups` + }, + marshalling_gen.unmarshalGroup + ); /** - * List tasks. List all operations performed on the account. You can filter - * the list of tasks by domain name. + * Get a group. Retrive information about a given group, specified by the + * `group_id` parameter. The group's full details, including `user_ids` and + * `application_ids` are returned in the response. * - * @param request - The request {@link RegistrarApiListTasksRequest} - * @returns A Promise of ListTasksResponse + * @param request - The request {@link GetGroupRequest} + * @returns A Promise of Group */ - listTasks = (request = {}) => enrichForPagination('tasks', this.pageOfListTasks, request); - + getGroup = (request) => this.client.fetch( + { + method: "GET", + path: `/iam/v1alpha1/groups/${marshalling.validatePathParam("groupId", request.groupId)}` + }, + marshalling_gen.unmarshalGroup + ); /** - * Purchase domains. Request the registration of domain names. You can provide - * a domain's already existing contact or a new contact. + * Update a group. Update the parameters of group, including `name` and + * `description`. * - * @param request - The request {@link RegistrarApiBuyDomainsRequest} - * @returns A Promise of OrderResponse + * @param request - The request {@link UpdateGroupRequest} + * @returns A Promise of Group */ - buyDomains = request => this.client.fetch({ - body: JSON.stringify(marshalRegistrarApiBuyDomainsRequest(request, this.client.settings)), - headers: jsonContentHeaders$k, - method: 'POST', - path: `/domain/v2beta1/buy-domains` - }, unmarshalOrderResponse); - + updateGroup = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateGroupRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/iam/v1alpha1/groups/${marshalling.validatePathParam("groupId", request.groupId)}` + }, + marshalling_gen.unmarshalGroup + ); /** - * Renew domains. Request the renewal of one or more domain names. + * Overwrite users and applications of a group. Overwrite users and + * applications configuration in a group. Any information that you add using + * this command will overwrite the previous configuration. * - * @param request - The request {@link RegistrarApiRenewDomainsRequest} - * @returns A Promise of OrderResponse + * @param request - The request {@link SetGroupMembersRequest} + * @returns A Promise of Group */ - renewDomains = request => this.client.fetch({ - body: JSON.stringify(marshalRegistrarApiRenewDomainsRequest(request, this.client.settings)), - headers: jsonContentHeaders$k, - method: 'POST', - path: `/domain/v2beta1/renew-domains` - }, unmarshalOrderResponse); - + setGroupMembers = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalSetGroupMembersRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PUT", + path: `/iam/v1alpha1/groups/${marshalling.validatePathParam("groupId", request.groupId)}/members` + }, + marshalling_gen.unmarshalGroup + ); /** - * Transfer a domain. Request the transfer of a domain from another registrar - * to Scaleway Domains and DNS. + * Add a user or an application to a group. Add a user or an application to a + * group. You can specify a `user_id` and and `application_id` in the body of + * your request. Note that you can only add one of each per request. * - * @param request - The request {@link RegistrarApiTransferInDomainRequest} - * @returns A Promise of OrderResponse + * @param request - The request {@link AddGroupMemberRequest} + * @returns A Promise of Group */ - transferInDomain = request => this.client.fetch({ - body: JSON.stringify(marshalRegistrarApiTransferInDomainRequest(request, this.client.settings)), - headers: jsonContentHeaders$k, - method: 'POST', - path: `/domain/v2beta1/domains/transfer-domains` - }, unmarshalOrderResponse); - + addGroupMember = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalAddGroupMemberRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/iam/v1alpha1/groups/${marshalling.validatePathParam("groupId", request.groupId)}/add-member` + }, + marshalling_gen.unmarshalGroup + ); /** - * Trade a domain's contact. Request to change a domain's contact owner.
- * If you specify the `organization_id` of the domain's new owner, the contact - * will change from the current owner's Scaleway account to the new owner's - * Scaleway account.
If the new owner's current contact information is - * not available, the first ever contact they have created for previous - * domains is taken into account to operate the change.
If the new owner - * has never created a contact to register domains before, an error message - * displays. + * Add multiple users and applications to a group. Add multiple users and + * applications to a group in a single call. You can specify an array of + * `user_id`s and `application_id`s. Note that any existing users and + * applications in the group will remain. To add new users/applications and + * delete pre-existing ones, use the [Overwrite users and applications of a + * group](#path-groups-overwrite-users-and-applications-of-a-group) method. * - * @param request - The request {@link RegistrarApiTradeDomainRequest} - * @returns A Promise of OrderResponse + * @param request - The request {@link AddGroupMembersRequest} + * @returns A Promise of Group */ - tradeDomain = request => this.client.fetch({ - body: JSON.stringify(marshalRegistrarApiTradeDomainRequest(request, this.client.settings)), - headers: jsonContentHeaders$k, - method: 'POST', - path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/trade` - }, unmarshalOrderResponse); - + addGroupMembers = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalAddGroupMembersRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/iam/v1alpha1/groups/${marshalling.validatePathParam("groupId", request.groupId)}/add-members` + }, + marshalling_gen.unmarshalGroup + ); /** - * Register an external domain. Request the registration of an external domain - * name. + * Remove a user or an application from a group. Remove a user or an + * application from a group. You can specify a `user_id` and and + * `application_id` in the body of your request. Note that you can only remove + * one of each per request. Removing a user from a group means that any + * permissions given to them via the group (i.e. from an attached policy) will + * no longer apply. Be sure you want to remove these permissions from the user + * before proceeding. * - * @param request - The request - * {@link RegistrarApiRegisterExternalDomainRequest} - * @returns A Promise of RegisterExternalDomainResponse + * @param request - The request {@link RemoveGroupMemberRequest} + * @returns A Promise of Group */ - registerExternalDomain = request => this.client.fetch({ - body: JSON.stringify(marshalRegistrarApiRegisterExternalDomainRequest(request, this.client.settings)), - headers: jsonContentHeaders$k, - method: 'POST', - path: `/domain/v2beta1/external-domains` - }, unmarshalRegisterExternalDomainResponse); - + removeGroupMember = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalRemoveGroupMemberRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/iam/v1alpha1/groups/${marshalling.validatePathParam("groupId", request.groupId)}/remove-member` + }, + marshalling_gen.unmarshalGroup + ); /** - * Delete an external domain. Delete an external domain name. + * Delete a group. Delete a group. Note that this action is irreversible and + * could delete permissions for group members. Policies attached to users and + * applications via this group will no longer apply. * - * @param request - The request {@link RegistrarApiDeleteExternalDomainRequest} - * @returns A Promise of DeleteExternalDomainResponse + * @param request - The request {@link DeleteGroupRequest} */ - deleteExternalDomain = request => this.client.fetch({ - method: 'DELETE', - path: `/domain/v2beta1/external-domains/${validatePathParam('domain', request.domain)}` - }, unmarshalDeleteExternalDomainResponse); - + deleteGroup = (request) => this.client.fetch({ + method: "DELETE", + path: `/iam/v1alpha1/groups/${marshalling.validatePathParam("groupId", request.groupId)}` + }); + pageOfListPolicies = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/iam/v1alpha1/policies`, + urlParams: marshalling.urlParams( + ["application_ids", request.applicationIds], + ["editable", request.editable], + ["group_ids", request.groupIds], + ["no_principal", request.noPrincipal], + ["order_by", request.orderBy], + [ + "organization_id", + request.organizationId ?? this.client.settings.defaultOrganizationId + ], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["policy_ids", request.policyIds], + ["policy_name", request.policyName], + ["tag", request.tag], + ["user_ids", request.userIds] + ) + }, + marshalling_gen.unmarshalListPoliciesResponse + ); /** - * Check if contacts are compatible with a domain or a TLD. Check whether - * contacts are compatible with a domain or a TLD. If contacts are not - * compatible with either the domain or the TLD, the information that needs to - * be corrected is returned. + * List policies of an Organization. List the policies of an Organization. By + * default, the policies listed are ordered by creation date in ascending + * order. This can be modified via the `order_by` field. You must define the + * `organization_id` in the query path of your request. You can also define + * additional parameters to filter your query, such as `user_ids`, + * `groups_ids`, `application_ids`, and `policy_name`. * - * @param request - The request - * {@link RegistrarApiCheckContactsCompatibilityRequest} - * @returns A Promise of CheckContactsCompatibilityResponse + * @param request - The request {@link ListPoliciesRequest} + * @returns A Promise of ListPoliciesResponse */ - checkContactsCompatibility = (request = {}) => this.client.fetch({ - body: JSON.stringify(marshalRegistrarApiCheckContactsCompatibilityRequest(request, this.client.settings)), - headers: jsonContentHeaders$k, - method: 'POST', - path: `/domain/v2beta1/check-contacts-compatibility` - }, unmarshalCheckContactsCompatibilityResponse); - pageOfListContacts = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/domain/v2beta1/contacts`, - urlParams: urlParams(['domain', request.domain], ['email_status', request.emailStatus ?? 'email_status_unknown'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId], ['role', request.role ?? 'unknown_role']) - }, unmarshalListContactsResponse); - + listPolicies = (request = {}) => resourcePaginator.enrichForPagination("policies", this.pageOfListPolicies, request); /** - * List contacts. Retrieve the list of contacts and their associated domains - * and roles. You can filter the list by domain name. + * Create a new policy. Create a new application. You must define the `name` + * parameter in the request. You can specify parameters such as `user_id`, + * `groups_id`, `application_id`, `no_principal`, `rules` and its child + * attributes. * - * @param request - The request {@link RegistrarApiListContactsRequest} - * @returns A Promise of ListContactsResponse + * @param request - The request {@link CreatePolicyRequest} + * @returns A Promise of Policy */ - listContacts = (request = {}) => enrichForPagination('contacts', this.pageOfListContacts, request); - + createPolicy = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreatePolicyRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/iam/v1alpha1/policies` + }, + marshalling_gen.unmarshalPolicy + ); /** - * Get a contact. Retrieve a contact's details from the registrar using the - * given contact's ID. + * Get an existing policy. Retrieve information about a policy, speficified by + * the `policy_id` parameter. The policy's full details, including `id`, + * `name`, `organization_id`, `nb_rules` and `nb_scopes`, `nb_permission_sets` + * are returned in the response. * - * @param request - The request {@link RegistrarApiGetContactRequest} - * @returns A Promise of Contact + * @param request - The request {@link GetPolicyRequest} + * @returns A Promise of Policy */ - getContact = request => this.client.fetch({ - method: 'GET', - path: `/domain/v2beta1/contacts/${validatePathParam('contactId', request.contactId)}` - }, unmarshalContact); - + getPolicy = (request) => this.client.fetch( + { + method: "GET", + path: `/iam/v1alpha1/policies/${marshalling.validatePathParam("policyId", request.policyId)}` + }, + marshalling_gen.unmarshalPolicy + ); /** - * Update contact. Edit the contact's information. + * Update an existing policy. Update the parameters of a policy, including + * `name`, `description`, `user_id`, `group_id`, `application_id` and + * `no_principal`. * - * @param request - The request {@link RegistrarApiUpdateContactRequest} - * @returns A Promise of Contact + * @param request - The request {@link UpdatePolicyRequest} + * @returns A Promise of Policy */ - updateContact = request => this.client.fetch({ - body: JSON.stringify(marshalRegistrarApiUpdateContactRequest(request, this.client.settings)), - headers: jsonContentHeaders$k, - method: 'PATCH', - path: `/domain/v2beta1/contacts/${validatePathParam('contactId', request.contactId)}` - }, unmarshalContact); - pageOfListDomains = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/domain/v2beta1/domains`, - urlParams: urlParams(['domain', request.domain], ['is_external', request.isExternal], ['order_by', request.orderBy ?? 'domain_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId], ['registrar', request.registrar], ['status', request.status ?? 'status_unknown']) - }, unmarshalListDomainsResponse$2); - + updatePolicy = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdatePolicyRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/iam/v1alpha1/policies/${marshalling.validatePathParam("policyId", request.policyId)}` + }, + marshalling_gen.unmarshalPolicy + ); /** - * List domains. Retrieve the list of domains you own. + * Delete a policy. Delete a policy. You must define specify the `policy_id` + * parameter in your request. Note that when deleting a policy, all + * permissions it gives to its principal (user, group or application) will be + * revoked. * - * @param request - The request {@link RegistrarApiListDomainsRequest} - * @returns A Promise of ListDomainsResponse + * @param request - The request {@link DeletePolicyRequest} */ - listDomains = (request = {}) => enrichForPagination('domains', this.pageOfListDomains, request); - pageOfListRenewableDomains = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/domain/v2beta1/renewable-domains`, - urlParams: urlParams(['order_by', request.orderBy ?? 'domain_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId]) - }, unmarshalListRenewableDomainsResponse); - + deletePolicy = (request) => this.client.fetch({ + method: "DELETE", + path: `/iam/v1alpha1/policies/${marshalling.validatePathParam("policyId", request.policyId)}` + }); /** - * List domains that can be renewed. Retrieve the list of domains you own that - * can be renewed. You can also see the maximum renewal duration in years for - * your domains that are renewable. + * Clone a policy. Clone a policy. You must define specify the `policy_id` + * parameter in your request. * - * @param request - The request {@link RegistrarApiListRenewableDomainsRequest} - * @returns A Promise of ListRenewableDomainsResponse + * @param request - The request {@link ClonePolicyRequest} + * @returns A Promise of Policy */ - listRenewableDomains = (request = {}) => enrichForPagination('domains', this.pageOfListRenewableDomains, request); - + clonePolicy = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/iam/v1alpha1/policies/${marshalling.validatePathParam("policyId", request.policyId)}/clone` + }, + marshalling_gen.unmarshalPolicy + ); /** - * Get domain. Retrieve a specific domain and display the domain's - * information. + * Set rules of a given policy. Overwrite the rules of a given policy. Any + * information that you add using this command will overwrite the previous + * configuration. If you include some of the rules you already had in your + * previous configuration in your new one, but you change their order, the new + * order of display will apply. While policy rules are ordered, they have no + * impact on the access logic of IAM because rules are allow-only. * - * @param request - The request {@link RegistrarApiGetDomainRequest} - * @returns A Promise of Domain + * @param request - The request {@link SetRulesRequest} + * @returns A Promise of SetRulesResponse */ - getDomain = request => this.client.fetch({ - method: 'GET', - path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}` - }, unmarshalDomain$2); - + setRules = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalSetRulesRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PUT", + path: `/iam/v1alpha1/rules` + }, + marshalling_gen.unmarshalSetRulesResponse + ); + pageOfListRules = (request) => this.client.fetch( + { + method: "GET", + path: `/iam/v1alpha1/rules`, + urlParams: marshalling.urlParams( + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["policy_id", request.policyId] + ) + }, + marshalling_gen.unmarshalListRulesResponse + ); /** - * Waits for {@link Domain} to be in a final state. + * List rules of a given policy. List the rules of a given policy. By default, + * the rules listed are ordered by creation date in ascending order. This can + * be modified via the `order_by` field. You must define the `policy_id` in + * the query path of your request. * - * @param request - The request {@link GetDomainRequest} - * @param options - The waiting options - * @returns A Promise of Domain + * @param request - The request {@link ListRulesRequest} + * @returns A Promise of ListRulesResponse */ - waitForDomain = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!DOMAIN_TRANSIENT_STATUSES$2.includes(res.status))), this.getDomain, request, options); - + listRules = (request) => resourcePaginator.enrichForPagination("rules", this.pageOfListRules, request); + pageOfListPermissionSets = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/iam/v1alpha1/permission-sets`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + [ + "organization_id", + request.organizationId ?? this.client.settings.defaultOrganizationId + ], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListPermissionSetsResponse + ); /** - * Update a domain's contacts. Update contacts for a specific domain or create - * a new contact.
If you add the same contact for multiple roles (owner, - * administrative, technical), only one ID will be created and used for all of - * the roles. + * List permission sets. List permission sets available for given + * Organization. You must define the `organization_id` in the query path of + * your request. * - * @param request - The request {@link RegistrarApiUpdateDomainRequest} - * @returns A Promise of Domain + * @param request - The request {@link ListPermissionSetsRequest} + * @returns A Promise of ListPermissionSetsResponse */ - updateDomain = request => this.client.fetch({ - body: JSON.stringify(marshalRegistrarApiUpdateDomainRequest(request, this.client.settings)), - headers: jsonContentHeaders$k, - method: 'PATCH', - path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}` - }, unmarshalDomain$2); - + listPermissionSets = (request = {}) => resourcePaginator.enrichForPagination( + "permissionSets", + this.pageOfListPermissionSets, + request + ); + pageOfListAPIKeys = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/iam/v1alpha1/api-keys`, + urlParams: marshalling.urlParams( + ["access_key", request.accessKey], + ["access_keys", request.accessKeys], + ["bearer_id", request.bearerId], + ["bearer_type", request.bearerType], + ["description", request.description], + ["editable", request.editable], + ["expired", request.expired], + ["order_by", request.orderBy], + [ + "organization_id", + request.organizationId ?? this.client.settings.defaultOrganizationId + ], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ...Object.entries( + marshalling.resolveOneOf([ + { param: "application_id", value: request.applicationId }, + { param: "user_id", value: request.userId } + ]) + ) + ) + }, + marshalling_gen.unmarshalListAPIKeysResponse + ); /** - * Lock the transfer of a domain. Lock the transfer of a domain. This means - * that the domain cannot be transferred and the authorization code cannot be - * requested to your current registrar. + * List API keys. List API keys. By default, the API keys listed are ordered + * by creation date in ascending order. This can be modified via the + * `order_by` field. You can define additional parameters for your query such + * as `editable`, `expired`, `access_key` and `bearer_id`. * - * @param request - The request {@link RegistrarApiLockDomainTransferRequest} - * @returns A Promise of Domain + * @param request - The request {@link ListAPIKeysRequest} + * @returns A Promise of ListAPIKeysResponse */ - lockDomainTransfer = request => this.client.fetch({ - body: '{}', - headers: jsonContentHeaders$k, - method: 'POST', - path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/lock-transfer` - }, unmarshalDomain$2); - + listAPIKeys = (request = {}) => resourcePaginator.enrichForPagination("apiKeys", this.pageOfListAPIKeys, request); /** - * Unlock the transfer of a domain. Unlock the transfer of a domain. This - * means that the domain can be transferred and the authorization code can be - * requested to your current registrar. + * Create an API key. Create an API key. You must specify the `application_id` + * or the `user_id` and the description. You can also specify the + * `default_project_id` which is the Project ID of your preferred Project, to + * use with Object Storage. The `access_key` and `secret_key` values are + * returned in the response. Note that he secret key is only showed once. Make + * sure that you copy and store both keys somewhere safe. * - * @param request - The request {@link RegistrarApiUnlockDomainTransferRequest} - * @returns A Promise of Domain + * @param request - The request {@link CreateAPIKeyRequest} + * @returns A Promise of APIKey */ - unlockDomainTransfer = request => this.client.fetch({ - body: '{}', - headers: jsonContentHeaders$k, - method: 'POST', - path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/unlock-transfer` - }, unmarshalDomain$2); - + createAPIKey = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateAPIKeyRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/iam/v1alpha1/api-keys` + }, + marshalling_gen.unmarshalAPIKey + ); /** - * Enable auto renew. Enable the `auto renew` feature for a domain. This means - * the domain will be automatically renewed before its expiry date. + * Get an API key. Retrive information about an API key, specified by the + * `access_key` parameter. The API key's details, including either the + * `user_id` or `application_id` of its bearer are returned in the response. + * Note that the string value for the `secret_key` is nullable, and therefore + * is not displayed in the response. The `secret_key` value is only displayed + * upon API key creation. * - * @param request - The request - * {@link RegistrarApiEnableDomainAutoRenewRequest} - * @returns A Promise of Domain + * @param request - The request {@link GetAPIKeyRequest} + * @returns A Promise of APIKey */ - enableDomainAutoRenew = request => this.client.fetch({ - body: '{}', - headers: jsonContentHeaders$k, - method: 'POST', - path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/enable-auto-renew` - }, unmarshalDomain$2); - + getAPIKey = (request) => this.client.fetch( + { + method: "GET", + path: `/iam/v1alpha1/api-keys/${marshalling.validatePathParam("accessKey", request.accessKey)}` + }, + marshalling_gen.unmarshalAPIKey + ); /** - * Disable auto renew. Disable the `auto renew` feature for a domain. This - * means the domain will not be renewed before its expiry date. + * Update an API key. Update the parameters of an API key, including + * `default_project_id` and `description`. * - * @param request - The request - * {@link RegistrarApiDisableDomainAutoRenewRequest} - * @returns A Promise of Domain + * @param request - The request {@link UpdateAPIKeyRequest} + * @returns A Promise of APIKey */ - disableDomainAutoRenew = request => this.client.fetch({ - body: '{}', - headers: jsonContentHeaders$k, - method: 'POST', - path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/disable-auto-renew` - }, unmarshalDomain$2); - + updateAPIKey = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateAPIKeyRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/iam/v1alpha1/api-keys/${marshalling.validatePathParam("accessKey", request.accessKey)}` + }, + marshalling_gen.unmarshalAPIKey + ); /** - * Get a domain's authorization code. Retrieve the authorization code to - * tranfer an unlocked domain. The output returns an error if the domain is - * locked. Some TLDs may have a different procedure to retrieve the - * authorization code. In that case, the information displays in the message - * field. + * Delete an API key. Delete an API key. Note that this action is irreversible + * and cannot be undone. Make sure you update any configurations using the API + * keys you delete. * - * @param request - The request {@link RegistrarApiGetDomainAuthCodeRequest} - * @returns A Promise of GetDomainAuthCodeResponse + * @param request - The request {@link DeleteAPIKeyRequest} */ - getDomainAuthCode = request => this.client.fetch({ - method: 'GET', - path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/auth-code` - }, unmarshalGetDomainAuthCodeResponse); - + deleteAPIKey = (request) => this.client.fetch({ + method: "DELETE", + path: `/iam/v1alpha1/api-keys/${marshalling.validatePathParam("accessKey", request.accessKey)}` + }); + pageOfListQuota = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/iam/v1alpha1/quota`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + [ + "organization_id", + request.organizationId ?? this.client.settings.defaultOrganizationId + ], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["quotum_names", request.quotumNames] + ) + }, + marshalling_gen.unmarshalListQuotaResponse + ); /** - * Update domain DNSSEC. If your domain has the default Scaleway NS and uses - * another registrar, you have to update the DS record manually. + * List all quotas in the Organization. List all product and features quota + * for an Organization, with their associated limits. By default, the quota + * listed are ordered by creation date in ascending order. This can be + * modified via the `order_by` field. You must define the `organization_id` in + * the query path of your request. * - * @param request - The request {@link RegistrarApiEnableDomainDNSSECRequest} - * @returns A Promise of Domain + * @param request - The request {@link ListQuotaRequest} + * @returns A Promise of ListQuotaResponse */ - enableDomainDNSSEC = request => this.client.fetch({ - body: JSON.stringify(marshalRegistrarApiEnableDomainDNSSECRequest(request, this.client.settings)), - headers: jsonContentHeaders$k, - method: 'POST', - path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/enable-dnssec` - }, unmarshalDomain$2); - + listQuota = (request = {}) => resourcePaginator.enrichForPagination("quota", this.pageOfListQuota, request); /** - * Disable a domain's DNSSEC. Disable DNSSEC for a domain. + * Get a quota in the Organization. Retrieve information about a resource + * quota, specified by the `quotum_name` parameter. The quota's `limit`, or + * whether it is unlimited, is returned in the response. * - * @param request - The request {@link RegistrarApiDisableDomainDNSSECRequest} - * @returns A Promise of Domain + * @param request - The request {@link GetQuotumRequest} + * @returns A Promise of Quotum */ - disableDomainDNSSEC = request => this.client.fetch({ - body: '{}', - headers: jsonContentHeaders$k, - method: 'POST', - path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/disable-dnssec` - }, unmarshalDomain$2); - + getQuotum = (request) => this.client.fetch( + { + method: "GET", + path: `/iam/v1alpha1/quota/${marshalling.validatePathParam("quotumName", request.quotumName)}`, + urlParams: marshalling.urlParams([ + "organization_id", + request.organizationId ?? this.client.settings.defaultOrganizationId + ]) + }, + marshalling_gen.unmarshalQuotum + ); + pageOfListJWTs = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/iam/v1alpha1/jwts`, + urlParams: marshalling.urlParams( + ["audience_id", request.audienceId], + ["expired", request.expired], + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListJWTsResponse + ); /** - * Search available domains. Search a domain or a maximum of 10 domains that - * are available. - * - * If the TLD list is empty or not set, the search returns the results from - * the most popular TLDs. + * List JWTs. * - * @param request - The request - * {@link RegistrarApiSearchAvailableDomainsRequest} - * @returns A Promise of SearchAvailableDomainsResponse + * @param request - The request {@link ListJWTsRequest} + * @returns A Promise of ListJWTsResponse */ - searchAvailableDomains = request => this.client.fetch({ - method: 'GET', - path: `/domain/v2beta1/search-domains`, - urlParams: urlParams(['domains', request.domains], ['strict_search', request.strictSearch], ['tlds', request.tlds]) - }, unmarshalSearchAvailableDomainsResponse); - pageOfListTlds = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/domain/v2beta1/tlds`, - urlParams: urlParams(['order_by', request.orderBy ?? 'name_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['tlds', request.tlds]) - }, unmarshalListTldsResponse); - + listJWTs = (request = {}) => resourcePaginator.enrichForPagination("jwts", this.pageOfListJWTs, request); /** - * List TLD offers. Retrieve the list of TLDs and offers associated with them. + * Create a JWT. * - * @param request - The request {@link RegistrarApiListTldsRequest} - * @returns A Promise of ListTldsResponse + * @param request - The request {@link CreateJWTRequest} + * @returns A Promise of EncodedJWT */ - listTlds = (request = {}) => enrichForPagination('tlds', this.pageOfListTlds, request); - + createJWT = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateJWTRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/iam/v1alpha1/jwts` + }, + marshalling_gen.unmarshalEncodedJWT + ); /** - * Create a hostname for a domain. Create a hostname for a domain with glue - * IPs. + * Get a JWT. * - * @param request - The request {@link RegistrarApiCreateDomainHostRequest} - * @returns A Promise of Host + * @param request - The request {@link GetJWTRequest} + * @returns A Promise of JWT */ - createDomainHost = request => this.client.fetch({ - body: JSON.stringify(marshalRegistrarApiCreateDomainHostRequest(request, this.client.settings)), - headers: jsonContentHeaders$k, - method: 'POST', - path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/hosts` - }, unmarshalHost); - pageOfListDomainHosts = request => this.client.fetch({ - method: 'GET', - path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/hosts`, - urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]) - }, unmarshalListDomainHostsResponse); - + getJWT = (request) => this.client.fetch( + { + method: "GET", + path: `/iam/v1alpha1/jwts/${marshalling.validatePathParam("jti", request.jti)}` + }, + marshalling_gen.unmarshalJWT + ); /** - * List a domain's hostnames. List a domain's hostnames using their glue IPs. + * Delete a JWT. * - * @param request - The request {@link RegistrarApiListDomainHostsRequest} - * @returns A Promise of ListDomainHostsResponse + * @param request - The request {@link DeleteJWTRequest} */ - listDomainHosts = request => enrichForPagination('hosts', this.pageOfListDomainHosts, request); - + deleteJWT = (request) => this.client.fetch({ + method: "DELETE", + path: `/iam/v1alpha1/jwts/${marshalling.validatePathParam("jti", request.jti)}` + }); + pageOfListLogs = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/iam/v1alpha1/logs`, + urlParams: marshalling.urlParams( + ["action", request.action], + ["created_after", request.createdAfter], + ["created_before", request.createdBefore], + ["order_by", request.orderBy], + [ + "organization_id", + request.organizationId ?? this.client.settings.defaultOrganizationId + ], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["resource_type", request.resourceType], + ["search", request.search] + ) + }, + marshalling_gen.unmarshalListLogsResponse + ); /** - * Update a domain's hostname. Update a domain's hostname with glue IPs. + * List logs. List logs available for given Organization. You must define the + * `organization_id` in the query path of your request. * - * @param request - The request {@link RegistrarApiUpdateDomainHostRequest} - * @returns A Promise of Host + * @param request - The request {@link ListLogsRequest} + * @returns A Promise of ListLogsResponse */ - updateDomainHost = request => this.client.fetch({ - body: JSON.stringify(marshalRegistrarApiUpdateDomainHostRequest(request, this.client.settings)), - headers: jsonContentHeaders$k, - method: 'PATCH', - path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/hosts/${validatePathParam('name', request.name)}` - }, unmarshalHost); - + listLogs = (request = {}) => resourcePaginator.enrichForPagination("logs", this.pageOfListLogs, request); /** - * Delete a domain's hostname. Delete a domain's hostname. + * Get a log. Retrieve information about a log, specified by the `log_id` + * parameter. The log's full details, including `id`, `ip`, `user_agent`, + * `action`, `bearer_id`, `resource_type` and `resource_id` are returned in + * the response. * - * @param request - The request {@link RegistrarApiDeleteDomainHostRequest} - * @returns A Promise of Host + * @param request - The request {@link GetLogRequest} + * @returns A Promise of Log */ - deleteDomainHost = request => this.client.fetch({ - method: 'DELETE', - path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/hosts/${validatePathParam('name', request.name)}` - }, unmarshalHost); + getLog = (request) => this.client.fetch( + { + method: "GET", + path: `/iam/v1alpha1/logs/${marshalling.validatePathParam("logId", request.logId)}` + }, + marshalling_gen.unmarshalLog + ); } +exports.API = API; + + +/***/ }), + +/***/ 7000: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api_gen = __nccwpck_require__(5924); +const validationRules_gen = __nccwpck_require__(8343); +exports.API = api_gen.API; +exports.ValidationRules = validationRules_gen; + + +/***/ }), + +/***/ 790: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. +"use strict"; -var index_gen$j = /*#__PURE__*/Object.freeze({ - __proto__: null, - API: API$l, - DNS_ZONE_TRANSIENT_STATUSES: DNS_ZONE_TRANSIENT_STATUSES, - DOMAIN_FEATURE_TRANSIENT_STATUSES: DOMAIN_FEATURE_TRANSIENT_STATUSES, - DOMAIN_REGISTRATION_STATUS_TRANSFER_TRANSIENT_STATUSES: DOMAIN_REGISTRATION_STATUS_TRANSFER_TRANSIENT_STATUSES, - DOMAIN_TRANSIENT_STATUSES: DOMAIN_TRANSIENT_STATUSES$2, - HOST_TRANSIENT_STATUSES: HOST_TRANSIENT_STATUSES, - RegistrarAPI: RegistrarAPI, - SSL_CERTIFICATE_TRANSIENT_STATUSES: SSL_CERTIFICATE_TRANSIENT_STATUSES, - TASK_TRANSIENT_STATUSES: TASK_TRANSIENT_STATUSES$1 +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const randomName = __nccwpck_require__(8141); +const json = __nccwpck_require__(3746); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const unmarshalJWT = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'JWT' failed as data isn't a dictionary.` + ); + } + return { + audienceId: data.audience_id, + createdAt: marshalling.unmarshalDate(data.created_at), + expiresAt: marshalling.unmarshalDate(data.expires_at), + ip: data.ip, + issuerId: data.issuer_id, + jti: data.jti, + updatedAt: marshalling.unmarshalDate(data.updated_at), + userAgent: data.user_agent + }; +}; +const unmarshalAPIKey = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'APIKey' failed as data isn't a dictionary.` + ); + } + return { + accessKey: data.access_key, + applicationId: data.application_id, + createdAt: marshalling.unmarshalDate(data.created_at), + creationIp: data.creation_ip, + defaultProjectId: data.default_project_id, + description: data.description, + editable: data.editable, + expiresAt: marshalling.unmarshalDate(data.expires_at), + secretKey: data.secret_key, + updatedAt: marshalling.unmarshalDate(data.updated_at), + userId: data.user_id + }; +}; +const unmarshalApplication = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Application' failed as data isn't a dictionary.` + ); + } + return { + createdAt: marshalling.unmarshalDate(data.created_at), + description: data.description, + editable: data.editable, + id: data.id, + name: data.name, + nbApiKeys: data.nb_api_keys, + organizationId: data.organization_id, + tags: data.tags, + updatedAt: marshalling.unmarshalDate(data.updated_at) + }; +}; +const unmarshalGroup = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Group' failed as data isn't a dictionary.` + ); + } + return { + applicationIds: data.application_ids, + createdAt: marshalling.unmarshalDate(data.created_at), + description: data.description, + id: data.id, + name: data.name, + organizationId: data.organization_id, + tags: data.tags, + updatedAt: marshalling.unmarshalDate(data.updated_at), + userIds: data.user_ids + }; +}; +const unmarshalLog = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Log' failed as data isn't a dictionary.` + ); + } + return { + action: data.action, + bearerId: data.bearer_id, + createdAt: marshalling.unmarshalDate(data.created_at), + id: data.id, + ip: data.ip, + organizationId: data.organization_id, + resourceId: data.resource_id, + resourceType: data.resource_type, + userAgent: data.user_agent + }; +}; +const unmarshalPolicy = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Policy' failed as data isn't a dictionary.` + ); + } + return { + applicationId: data.application_id, + createdAt: marshalling.unmarshalDate(data.created_at), + description: data.description, + editable: data.editable, + groupId: data.group_id, + id: data.id, + name: data.name, + nbPermissionSets: data.nb_permission_sets, + nbRules: data.nb_rules, + nbScopes: data.nb_scopes, + noPrincipal: data.no_principal, + organizationId: data.organization_id, + tags: data.tags, + updatedAt: marshalling.unmarshalDate(data.updated_at), + userId: data.user_id + }; +}; +const unmarshalQuotum = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Quotum' failed as data isn't a dictionary.` + ); + } + return { + description: data.description, + limit: data.limit, + name: data.name, + prettyName: data.pretty_name, + unit: data.unit, + unlimited: data.unlimited + }; +}; +const unmarshalSSHKey = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SSHKey' failed as data isn't a dictionary.` + ); + } + return { + createdAt: marshalling.unmarshalDate(data.created_at), + disabled: data.disabled, + fingerprint: data.fingerprint, + id: data.id, + name: data.name, + organizationId: data.organization_id, + projectId: data.project_id, + publicKey: data.public_key, + updatedAt: marshalling.unmarshalDate(data.updated_at) + }; +}; +const unmarshalUser = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'User' failed as data isn't a dictionary.` + ); + } + return { + accountRootUserId: data.account_root_user_id, + createdAt: marshalling.unmarshalDate(data.created_at), + deletable: data.deletable, + email: data.email, + id: data.id, + lastLoginAt: marshalling.unmarshalDate(data.last_login_at), + locked: data.locked, + mfa: data.mfa, + organizationId: data.organization_id, + status: data.status, + tags: data.tags, + twoFactorEnabled: data.two_factor_enabled, + type: data.type, + updatedAt: marshalling.unmarshalDate(data.updated_at), + username: data.username + }; +}; +const unmarshalEncodedJWT = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'EncodedJWT' failed as data isn't a dictionary.` + ); + } + return { + jwt: data.jwt ? unmarshalJWT(data.jwt) : void 0, + renewToken: data.renew_token, + token: data.token + }; +}; +const unmarshalListAPIKeysResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListAPIKeysResponse' failed as data isn't a dictionary.` + ); + } + return { + apiKeys: marshalling.unmarshalArrayOfObject(data.api_keys, unmarshalAPIKey), + totalCount: data.total_count + }; +}; +const unmarshalListApplicationsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListApplicationsResponse' failed as data isn't a dictionary.` + ); + } + return { + applications: marshalling.unmarshalArrayOfObject( + data.applications, + unmarshalApplication + ), + totalCount: data.total_count + }; +}; +const unmarshalListGroupsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListGroupsResponse' failed as data isn't a dictionary.` + ); + } + return { + groups: marshalling.unmarshalArrayOfObject(data.groups, unmarshalGroup), + totalCount: data.total_count + }; +}; +const unmarshalListJWTsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListJWTsResponse' failed as data isn't a dictionary.` + ); + } + return { + jwts: marshalling.unmarshalArrayOfObject(data.jwts, unmarshalJWT), + totalCount: data.total_count + }; +}; +const unmarshalListLogsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListLogsResponse' failed as data isn't a dictionary.` + ); + } + return { + logs: marshalling.unmarshalArrayOfObject(data.logs, unmarshalLog), + totalCount: data.total_count + }; +}; +const unmarshalPermissionSet = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'PermissionSet' failed as data isn't a dictionary.` + ); + } + return { + categories: data.categories, + description: data.description, + id: data.id, + name: data.name, + scopeType: data.scope_type + }; +}; +const unmarshalListPermissionSetsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListPermissionSetsResponse' failed as data isn't a dictionary.` + ); + } + return { + permissionSets: marshalling.unmarshalArrayOfObject( + data.permission_sets, + unmarshalPermissionSet + ), + totalCount: data.total_count + }; +}; +const unmarshalListPoliciesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListPoliciesResponse' failed as data isn't a dictionary.` + ); + } + return { + policies: marshalling.unmarshalArrayOfObject(data.policies, unmarshalPolicy), + totalCount: data.total_count + }; +}; +const unmarshalListQuotaResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListQuotaResponse' failed as data isn't a dictionary.` + ); + } + return { + quota: marshalling.unmarshalArrayOfObject(data.quota, unmarshalQuotum), + totalCount: data.total_count + }; +}; +const unmarshalRule = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Rule' failed as data isn't a dictionary.` + ); + } + return { + accountRootUserId: data.account_root_user_id, + condition: data.condition, + id: data.id, + organizationId: data.organization_id, + permissionSetNames: data.permission_set_names, + permissionSetsScopeType: data.permission_sets_scope_type, + projectIds: data.project_ids + }; +}; +const unmarshalListRulesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListRulesResponse' failed as data isn't a dictionary.` + ); + } + return { + rules: marshalling.unmarshalArrayOfObject(data.rules, unmarshalRule), + totalCount: data.total_count + }; +}; +const unmarshalListSSHKeysResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListSSHKeysResponse' failed as data isn't a dictionary.` + ); + } + return { + sshKeys: marshalling.unmarshalArrayOfObject(data.ssh_keys, unmarshalSSHKey), + totalCount: data.total_count + }; +}; +const unmarshalListUsersResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListUsersResponse' failed as data isn't a dictionary.` + ); + } + return { + totalCount: data.total_count, + users: marshalling.unmarshalArrayOfObject(data.users, unmarshalUser) + }; +}; +const unmarshalSetRulesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SetRulesResponse' failed as data isn't a dictionary.` + ); + } + return { + rules: marshalling.unmarshalArrayOfObject(data.rules, unmarshalRule) + }; +}; +const marshalAddGroupMemberRequest = (request, defaults) => ({ + ...marshalling.resolveOneOf([ + { param: "user_id", value: request.userId }, + { param: "application_id", value: request.applicationId } + ]) }); - -var index$m = /*#__PURE__*/Object.freeze({ - __proto__: null, - v2beta1: index_gen$j +const marshalAddGroupMembersRequest = (request, defaults) => ({ + application_ids: request.applicationIds, + user_ids: request.userIds +}); +const marshalCreateAPIKeyRequest = (request, defaults) => ({ + default_project_id: request.defaultProjectId, + description: request.description, + expires_at: request.expiresAt, + ...marshalling.resolveOneOf([ + { param: "application_id", value: request.applicationId }, + { param: "user_id", value: request.userId } + ]) +}); +const marshalCreateApplicationRequest = (request, defaults) => ({ + description: request.description, + name: request.name || randomName("app"), + organization_id: request.organizationId ?? defaults.defaultOrganizationId, + tags: request.tags +}); +const marshalCreateGroupRequest = (request, defaults) => ({ + description: request.description, + name: request.name || randomName("grp"), + organization_id: request.organizationId ?? defaults.defaultOrganizationId, + tags: request.tags +}); +const marshalCreateJWTRequest = (request, defaults) => ({ + referrer: request.referrer, + user_id: request.userId +}); +const marshalRuleSpecs = (request, defaults) => ({ + condition: request.condition, + permission_set_names: request.permissionSetNames, + ...marshalling.resolveOneOf([ + { param: "project_ids", value: request.projectIds }, + { param: "organization_id", value: request.organizationId } + ]) +}); +const marshalCreatePolicyRequest = (request, defaults) => ({ + description: request.description, + name: request.name || randomName("pol"), + organization_id: request.organizationId ?? defaults.defaultOrganizationId, + rules: request.rules !== void 0 ? request.rules.map((elt) => marshalRuleSpecs(elt)) : void 0, + tags: request.tags, + ...marshalling.resolveOneOf([ + { param: "user_id", value: request.userId }, + { param: "group_id", value: request.groupId }, + { param: "application_id", value: request.applicationId }, + { param: "no_principal", value: request.noPrincipal } + ]) +}); +const marshalCreateSSHKeyRequest = (request, defaults) => ({ + name: request.name || randomName("key"), + project_id: request.projectId ?? defaults.defaultProjectId, + public_key: request.publicKey +}); +const marshalCreateUserRequestMember = (request, defaults) => ({ + email: request.email, + password: request.password, + send_password_email: request.sendPasswordEmail, + username: request.username +}); +const marshalCreateUserRequest = (request, defaults) => ({ + organization_id: request.organizationId ?? defaults.defaultOrganizationId, + tags: request.tags, + ...marshalling.resolveOneOf([ + { param: "email", value: request.email }, + { + param: "member", + value: request.member !== void 0 ? marshalCreateUserRequestMember(request.member) : void 0 + } + ]) +}); +const marshalRemoveGroupMemberRequest = (request, defaults) => ({ + ...marshalling.resolveOneOf([ + { param: "user_id", value: request.userId }, + { param: "application_id", value: request.applicationId } + ]) +}); +const marshalSetGroupMembersRequest = (request, defaults) => ({ + application_ids: request.applicationIds, + user_ids: request.userIds +}); +const marshalSetRulesRequest = (request, defaults) => ({ + policy_id: request.policyId, + rules: request.rules.map((elt) => marshalRuleSpecs(elt)) +}); +const marshalUpdateAPIKeyRequest = (request, defaults) => ({ + default_project_id: request.defaultProjectId, + description: request.description +}); +const marshalUpdateApplicationRequest = (request, defaults) => ({ + description: request.description, + name: request.name, + tags: request.tags +}); +const marshalUpdateGroupRequest = (request, defaults) => ({ + description: request.description, + name: request.name, + tags: request.tags +}); +const marshalUpdatePolicyRequest = (request, defaults) => ({ + description: request.description, + name: request.name, + tags: request.tags, + ...marshalling.resolveOneOf([ + { param: "user_id", value: request.userId }, + { param: "group_id", value: request.groupId }, + { param: "application_id", value: request.applicationId }, + { param: "no_principal", value: request.noPrincipal } + ]) }); +const marshalUpdateSSHKeyRequest = (request, defaults) => ({ + disabled: request.disabled, + name: request.name +}); +const marshalUpdateUserRequest = (request, defaults) => ({ + tags: request.tags +}); +exports.marshalAddGroupMemberRequest = marshalAddGroupMemberRequest; +exports.marshalAddGroupMembersRequest = marshalAddGroupMembersRequest; +exports.marshalCreateAPIKeyRequest = marshalCreateAPIKeyRequest; +exports.marshalCreateApplicationRequest = marshalCreateApplicationRequest; +exports.marshalCreateGroupRequest = marshalCreateGroupRequest; +exports.marshalCreateJWTRequest = marshalCreateJWTRequest; +exports.marshalCreatePolicyRequest = marshalCreatePolicyRequest; +exports.marshalCreateSSHKeyRequest = marshalCreateSSHKeyRequest; +exports.marshalCreateUserRequest = marshalCreateUserRequest; +exports.marshalRemoveGroupMemberRequest = marshalRemoveGroupMemberRequest; +exports.marshalSetGroupMembersRequest = marshalSetGroupMembersRequest; +exports.marshalSetRulesRequest = marshalSetRulesRequest; +exports.marshalUpdateAPIKeyRequest = marshalUpdateAPIKeyRequest; +exports.marshalUpdateApplicationRequest = marshalUpdateApplicationRequest; +exports.marshalUpdateGroupRequest = marshalUpdateGroupRequest; +exports.marshalUpdatePolicyRequest = marshalUpdatePolicyRequest; +exports.marshalUpdateSSHKeyRequest = marshalUpdateSSHKeyRequest; +exports.marshalUpdateUserRequest = marshalUpdateUserRequest; +exports.unmarshalAPIKey = unmarshalAPIKey; +exports.unmarshalApplication = unmarshalApplication; +exports.unmarshalEncodedJWT = unmarshalEncodedJWT; +exports.unmarshalGroup = unmarshalGroup; +exports.unmarshalJWT = unmarshalJWT; +exports.unmarshalListAPIKeysResponse = unmarshalListAPIKeysResponse; +exports.unmarshalListApplicationsResponse = unmarshalListApplicationsResponse; +exports.unmarshalListGroupsResponse = unmarshalListGroupsResponse; +exports.unmarshalListJWTsResponse = unmarshalListJWTsResponse; +exports.unmarshalListLogsResponse = unmarshalListLogsResponse; +exports.unmarshalListPermissionSetsResponse = unmarshalListPermissionSetsResponse; +exports.unmarshalListPoliciesResponse = unmarshalListPoliciesResponse; +exports.unmarshalListQuotaResponse = unmarshalListQuotaResponse; +exports.unmarshalListRulesResponse = unmarshalListRulesResponse; +exports.unmarshalListSSHKeysResponse = unmarshalListSSHKeysResponse; +exports.unmarshalListUsersResponse = unmarshalListUsersResponse; +exports.unmarshalLog = unmarshalLog; +exports.unmarshalPolicy = unmarshalPolicy; +exports.unmarshalQuotum = unmarshalQuotum; +exports.unmarshalSSHKey = unmarshalSSHKey; +exports.unmarshalSetRulesResponse = unmarshalSetRulesResponse; +exports.unmarshalUser = unmarshalUser; + -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. +/***/ }), -/** Lists transient statutes of the enum {@link FlexibleIPStatus}. */ -const FLEXIBLE_IP_TRANSIENT_STATUSES = ['updating', 'detaching']; +/***/ 8343: +/***/ ((__unused_webpack_module, exports) => { -/** Lists transient statutes of the enum {@link MACAddressStatus}. */ -const MAC_ADDRESS_TRANSIENT_STATUSES = ['updating', 'deleting']; +"use strict"; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const unmarshalMACAddress = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'MACAddress' failed as data isn't a dictionary.`); +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const CreateAPIKeyRequest = { + description: { + ignoreEmpty: true, + maxLength: 200 + } +}; +const CreateApplicationRequest = { + description: { + ignoreEmpty: true, + maxLength: 200 + }, + name: { + maxLength: 64, + minLength: 1, + pattern: /^[a-zA-Z0-9\(\)\._\- ]+$/ + } +}; +const CreateGroupRequest = { + description: { + ignoreEmpty: true, + maxLength: 200 + }, + name: { + maxLength: 64, + minLength: 1, + pattern: /^[a-zA-Z0-9\(\)\._\- ]+$/ + } +}; +const CreatePolicyRequest = { + description: { + ignoreEmpty: true, + maxLength: 200 + }, + name: { + maxLength: 64, + minLength: 1, + pattern: /^[a-zA-Z0-9\(\)\._\- ]+$/ + } +}; +const CreateSSHKeyRequest = { + name: { + ignoreEmpty: true, + maxLength: 1e3 + }, + publicKey: { + maxLength: 65e3, + minLength: 1 + } +}; +const CreateUserRequestMember = { + email: { + ignoreEmpty: true + }, + password: { + ignoreEmpty: true, + maxLength: 72 + }, + username: { + maxLength: 64, + minLength: 2, + pattern: /^[a-zA-Z0-9._-]+$/ + } +}; +const GetQuotumRequest = { + quotumName: { + minLength: 1 + } +}; +const ListAPIKeysRequest = { + description: { + maxLength: 200 + }, + page: { + greaterThan: 0 + }, + pageSize: { + greaterThanOrEqual: 1, + lessThanOrEqual: 100 + } +}; +const ListApplicationsRequest = { + name: { + maxLength: 64, + minLength: 1, + pattern: /^[a-zA-Z0-9\(\)\._\- ]+$/ + }, + page: { + greaterThan: 0 + }, + pageSize: { + greaterThanOrEqual: 1, + lessThanOrEqual: 100 + } +}; +const ListGroupsRequest = { + name: { + minLength: 1 + }, + page: { + greaterThan: 0 + }, + pageSize: { + greaterThanOrEqual: 1, + lessThanOrEqual: 100 + } +}; +const ListJWTsRequest = { + page: { + greaterThan: 0 + }, + pageSize: { + greaterThanOrEqual: 1, + lessThanOrEqual: 100 + } +}; +const ListLogsRequest = { + page: { + greaterThan: 0 + }, + pageSize: { + greaterThanOrEqual: 1, + lessThanOrEqual: 100 + } +}; +const ListPermissionSetsRequest = { + page: { + greaterThan: 0 + }, + pageSize: { + greaterThanOrEqual: 1, + lessThanOrEqual: 100 + } +}; +const ListPoliciesRequest = { + page: { + greaterThan: 0 + }, + pageSize: { + greaterThanOrEqual: 1, + lessThanOrEqual: 100 + }, + policyName: { + minLength: 1 + } +}; +const ListQuotaRequest = { + page: { + greaterThan: 0 + }, + pageSize: { + greaterThanOrEqual: 1, + lessThanOrEqual: 100 + } +}; +const ListRulesRequest = { + page: { + greaterThan: 0 + }, + pageSize: { + greaterThanOrEqual: 1, + lessThanOrEqual: 100 + } +}; +const ListSSHKeysRequest = { + name: { + maxLength: 1e3, + minLength: 1 + }, + page: { + greaterThan: 0 + }, + pageSize: { + greaterThanOrEqual: 1, + lessThanOrEqual: 100 + } +}; +const ListUsersRequest = { + page: { + greaterThan: 0 + }, + pageSize: { + greaterThanOrEqual: 1, + lessThanOrEqual: 100 } - return { - createdAt: unmarshalDate(data.created_at), - id: data.id, - macAddress: data.mac_address, - macType: data.mac_type, - status: data.status, - updatedAt: unmarshalDate(data.updated_at), - zone: data.zone - }; }; -const unmarshalFlexibleIP = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'FlexibleIP' failed as data isn't a dictionary.`); +const RuleSpecs = { + condition: { + maxLength: 255 } - return { - createdAt: unmarshalDate(data.created_at), - description: data.description, - id: data.id, - ipAddress: data.ip_address, - macAddress: data.mac_address ? unmarshalMACAddress(data.mac_address) : undefined, - organizationId: data.organization_id, - projectId: data.project_id, - reverse: data.reverse, - serverId: data.server_id, - status: data.status, - tags: data.tags, - updatedAt: unmarshalDate(data.updated_at), - zone: data.zone - }; }; -const unmarshalAttachFlexibleIPsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'AttachFlexibleIPsResponse' failed as data isn't a dictionary.`); +const UpdateAPIKeyRequest = { + description: { + maxLength: 200 } - return { - flexibleIps: unmarshalArrayOfObject(data.flexible_ips, unmarshalFlexibleIP), - totalCount: data.total_count - }; }; -const unmarshalDetachFlexibleIPsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'DetachFlexibleIPsResponse' failed as data isn't a dictionary.`); +const UpdateApplicationRequest = { + description: { + maxLength: 200 + }, + name: { + maxLength: 64, + minLength: 1, + pattern: /^[a-zA-Z0-9\(\)\._\- ]+$/ } - return { - flexibleIps: unmarshalArrayOfObject(data.flexible_ips, unmarshalFlexibleIP), - totalCount: data.total_count - }; }; -const unmarshalListFlexibleIPsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListFlexibleIPsResponse' failed as data isn't a dictionary.`); +const UpdateGroupRequest = { + description: { + maxLength: 200 + }, + name: { + maxLength: 64, + minLength: 1, + pattern: /^[a-zA-Z0-9\(\)\._\- ]+$/ } - return { - flexibleIps: unmarshalArrayOfObject(data.flexible_ips, unmarshalFlexibleIP), - totalCount: data.total_count - }; }; -const marshalAttachFlexibleIPRequest = (request, defaults) => ({ - fips_ids: request.fipsIds, - server_id: request.serverId -}); -const marshalCreateFlexibleIPRequest = (request, defaults) => ({ - description: request.description, - is_ipv6: request.isIpv6, - project_id: request.projectId ?? defaults.defaultProjectId, - reverse: request.reverse, - server_id: request.serverId, - tags: request.tags -}); -const marshalDetachFlexibleIPRequest = (request, defaults) => ({ - fips_ids: request.fipsIds -}); -const marshalDuplicateMACAddrRequest = (request, defaults) => ({ - duplicate_from_fip_id: request.duplicateFromFipId -}); -const marshalGenerateMACAddrRequest = (request, defaults) => ({ - mac_type: request.macType -}); -const marshalMoveMACAddrRequest = (request, defaults) => ({ - dst_fip_id: request.dstFipId -}); -const marshalUpdateFlexibleIPRequest = (request, defaults) => ({ - description: request.description, - reverse: request.reverse, - tags: request.tags -}); - -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const jsonContentHeaders$j = { - 'Content-Type': 'application/json; charset=utf-8' +const UpdatePolicyRequest = { + description: { + maxLength: 200 + }, + name: { + maxLength: 64, + minLength: 1, + pattern: /^[a-zA-Z0-9\(\)\._\- ]+$/ + } }; +const UpdateSSHKeyRequest = { + name: { + maxLength: 1e3 + } +}; +exports.CreateAPIKeyRequest = CreateAPIKeyRequest; +exports.CreateApplicationRequest = CreateApplicationRequest; +exports.CreateGroupRequest = CreateGroupRequest; +exports.CreatePolicyRequest = CreatePolicyRequest; +exports.CreateSSHKeyRequest = CreateSSHKeyRequest; +exports.CreateUserRequestMember = CreateUserRequestMember; +exports.GetQuotumRequest = GetQuotumRequest; +exports.ListAPIKeysRequest = ListAPIKeysRequest; +exports.ListApplicationsRequest = ListApplicationsRequest; +exports.ListGroupsRequest = ListGroupsRequest; +exports.ListJWTsRequest = ListJWTsRequest; +exports.ListLogsRequest = ListLogsRequest; +exports.ListPermissionSetsRequest = ListPermissionSetsRequest; +exports.ListPoliciesRequest = ListPoliciesRequest; +exports.ListQuotaRequest = ListQuotaRequest; +exports.ListRulesRequest = ListRulesRequest; +exports.ListSSHKeysRequest = ListSSHKeysRequest; +exports.ListUsersRequest = ListUsersRequest; +exports.RuleSpecs = RuleSpecs; +exports.UpdateAPIKeyRequest = UpdateAPIKeyRequest; +exports.UpdateApplicationRequest = UpdateApplicationRequest; +exports.UpdateGroupRequest = UpdateGroupRequest; +exports.UpdatePolicyRequest = UpdatePolicyRequest; +exports.UpdateSSHKeyRequest = UpdateSSHKeyRequest; -/** Elastic Metal - Flexible IP API. */ -let API$k = class API extends API$u { - /** Lists the available zones of the API. */ - static LOCALITIES = ['fr-par-1', 'fr-par-2', 'nl-ams-1']; +/***/ }), + +/***/ 6519: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const index_gen = __nccwpck_require__(9928); +exports.v1beta1 = index_gen; + + +/***/ }), + +/***/ 3268: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const intervalRetrier = __nccwpck_require__(9052); +const api = __nccwpck_require__(3042); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const resourcePaginator = __nccwpck_require__(4983); +const content_gen = __nccwpck_require__(3687); +const marshalling_gen = __nccwpck_require__(6294); +const jsonContentHeaders = { + "Content-Type": "application/json; charset=utf-8" +}; +class API extends api.API { + /** Lists the available regions of the API. */ + static LOCALITIES = ["fr-par"]; + pageOfListDeployments = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/inference/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments`, + urlParams: marshalling.urlParams( + ["name", request.name], + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId], + ["tags", request.tags] + ) + }, + marshalling_gen.unmarshalListDeploymentsResponse + ); /** - * Create a new flexible IP. Generate a new flexible IP within a given zone, - * specifying its configuration including Project ID and description. + * List inference deployments. List all your inference deployments. * - * @param request - The request {@link CreateFlexibleIPRequest} - * @returns A Promise of FlexibleIP + * @param request - The request {@link ListDeploymentsRequest} + * @returns A Promise of ListDeploymentsResponse */ - createFlexibleIP = request => this.client.fetch({ - body: JSON.stringify(marshalCreateFlexibleIPRequest(request, this.client.settings)), - headers: jsonContentHeaders$j, - method: 'POST', - path: `/flexible-ip/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/fips` - }, unmarshalFlexibleIP); - + listDeployments = (request = {}) => resourcePaginator.enrichForPagination("deployments", this.pageOfListDeployments, request); /** - * Get an existing flexible IP. Retrieve information about an existing - * flexible IP, specified by its ID and zone. Its full details, including - * Project ID, description and status, are returned in the response object. + * Get a deployment. Get the deployment for the given ID. * - * @param request - The request {@link GetFlexibleIPRequest} - * @returns A Promise of FlexibleIP + * @param request - The request {@link GetDeploymentRequest} + * @returns A Promise of Deployment */ - getFlexibleIP = request => this.client.fetch({ - method: 'GET', - path: `/flexible-ip/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/fips/${validatePathParam('fipId', request.fipId)}` - }, unmarshalFlexibleIP); - + getDeployment = (request) => this.client.fetch( + { + method: "GET", + path: `/inference/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${marshalling.validatePathParam("deploymentId", request.deploymentId)}` + }, + marshalling_gen.unmarshalDeployment + ); /** - * Waits for {@link FlexibleIP} to be in a final state. + * Waits for {@link Deployment} to be in a final state. * - * @param request - The request {@link GetFlexibleIPRequest} + * @param request - The request {@link GetDeploymentRequest} * @param options - The waiting options - * @returns A Promise of FlexibleIP + * @returns A Promise of Deployment + */ + waitForDeployment = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve(!content_gen.DEPLOYMENT_TRANSIENT_STATUSES.includes(res.status))), + this.getDeployment, + request, + options + ); + /** + * Create a deployment. Create a new inference deployment related to a + * specific model. + * + * @param request - The request {@link CreateDeploymentRequest} + * @returns A Promise of Deployment + */ + createDeployment = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateDeploymentRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/inference/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments` + }, + marshalling_gen.unmarshalDeployment + ); + /** + * Update a deployment. Update an existing inference deployment. + * + * @param request - The request {@link UpdateDeploymentRequest} + * @returns A Promise of Deployment + */ + updateDeployment = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateDeploymentRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/inference/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${marshalling.validatePathParam("deploymentId", request.deploymentId)}` + }, + marshalling_gen.unmarshalDeployment + ); + /** + * Delete a deployment. Delete an existing inference deployment. + * + * @param request - The request {@link DeleteDeploymentRequest} + * @returns A Promise of Deployment */ - waitForFlexibleIP = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!FLEXIBLE_IP_TRANSIENT_STATUSES.includes(res.status))), this.getFlexibleIP, request, options); - pageOfListFlexibleIPs = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/flexible-ip/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/fips`, - urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId], ['server_ids', request.serverIds], ['status', request.status], ['tags', request.tags]) - }, unmarshalListFlexibleIPsResponse); - + deleteDeployment = (request) => this.client.fetch( + { + method: "DELETE", + path: `/inference/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${marshalling.validatePathParam("deploymentId", request.deploymentId)}` + }, + marshalling_gen.unmarshalDeployment + ); /** - * List flexible IPs. List all flexible IPs within a given zone. + * Get the CA certificate. Get the CA certificate used for the deployment of + * private endpoints. The CA certificate will be returned as a PEM file. * - * @param request - The request {@link ListFlexibleIPsRequest} - * @returns A Promise of ListFlexibleIPsResponse + * @param request - The request {@link GetDeploymentCertificateRequest} + * @returns A Promise of Blob */ - listFlexibleIPs = (request = {}) => enrichForPagination('flexibleIps', this.pageOfListFlexibleIPs, request); - + getDeploymentCertificate = (request) => this.client.fetch({ + method: "GET", + path: `/inference/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${marshalling.validatePathParam("deploymentId", request.deploymentId)}/certificate`, + urlParams: marshalling.urlParams(["dl", 1]), + responseType: "blob" + }); /** - * Update an existing flexible IP. Update the parameters of an existing - * flexible IP, specified by its ID and zone. These parameters include tags - * and description. + * Create an endpoint. Create a new Endpoint related to a specific deployment. * - * @param request - The request {@link UpdateFlexibleIPRequest} - * @returns A Promise of FlexibleIP + * @param request - The request {@link CreateEndpointRequest} + * @returns A Promise of Endpoint */ - updateFlexibleIP = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateFlexibleIPRequest(request, this.client.settings)), - headers: jsonContentHeaders$j, - method: 'PATCH', - path: `/flexible-ip/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/fips/${validatePathParam('fipId', request.fipId)}` - }, unmarshalFlexibleIP); - + createEndpoint = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateEndpointRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/inference/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/endpoints` + }, + marshalling_gen.unmarshalEndpoint + ); /** - * Delete an existing flexible IP. Delete an existing flexible IP, specified - * by its ID and zone. Note that deleting a flexible IP is permanent and - * cannot be undone. + * Update an endpoint. Update an existing Endpoint. * - * @param request - The request {@link DeleteFlexibleIPRequest} + * @param request - The request {@link UpdateEndpointRequest} + * @returns A Promise of Endpoint + */ + updateEndpoint = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateEndpointRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/inference/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/endpoints/${marshalling.validatePathParam("endpointId", request.endpointId)}` + }, + marshalling_gen.unmarshalEndpoint + ); + /** + * Delete an endpoint. Delete an existing Endpoint. + * + * @param request - The request {@link DeleteEndpointRequest} */ - deleteFlexibleIP = request => this.client.fetch({ - method: 'DELETE', - path: `/flexible-ip/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/fips/${validatePathParam('fipId', request.fipId)}` + deleteEndpoint = (request) => this.client.fetch({ + method: "DELETE", + path: `/inference/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/endpoints/${marshalling.validatePathParam("endpointId", request.endpointId)}` }); - + pageOfListDeploymentACLRules = (request) => this.client.fetch( + { + method: "GET", + path: `/inference/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${marshalling.validatePathParam("deploymentId", request.deploymentId)}/acls`, + urlParams: marshalling.urlParams( + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListDeploymentACLRulesResponse + ); /** - * Attach an existing flexible IP to a server. Attach an existing flexible IP - * to a specified Elastic Metal server. + * List your ACLs. List ACLs for a specific deployment. * - * @param request - The request {@link AttachFlexibleIPRequest} - * @returns A Promise of AttachFlexibleIPsResponse + * @param request - The request {@link ListDeploymentACLRulesRequest} + * @returns A Promise of ListDeploymentACLRulesResponse */ - attachFlexibleIP = request => this.client.fetch({ - body: JSON.stringify(marshalAttachFlexibleIPRequest(request, this.client.settings)), - headers: jsonContentHeaders$j, - method: 'POST', - path: `/flexible-ip/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/fips/attach` - }, unmarshalAttachFlexibleIPsResponse); - + listDeploymentACLRules = (request) => resourcePaginator.enrichForPagination("rules", this.pageOfListDeploymentACLRules, request); /** - * Detach an existing flexible IP from a server. Detach an existing flexible - * IP from a specified Elastic Metal server. + * Add new ACLs. Add new ACL rules for a specific deployment. * - * @param request - The request {@link DetachFlexibleIPRequest} - * @returns A Promise of DetachFlexibleIPsResponse + * @param request - The request {@link AddDeploymentACLRulesRequest} + * @returns A Promise of AddDeploymentACLRulesResponse */ - detachFlexibleIP = request => this.client.fetch({ - body: JSON.stringify(marshalDetachFlexibleIPRequest(request, this.client.settings)), - headers: jsonContentHeaders$j, - method: 'POST', - path: `/flexible-ip/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/fips/detach` - }, unmarshalDetachFlexibleIPsResponse); - + addDeploymentACLRules = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalAddDeploymentACLRulesRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/inference/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${marshalling.validatePathParam("deploymentId", request.deploymentId)}/acls` + }, + marshalling_gen.unmarshalAddDeploymentACLRulesResponse + ); + /** + * Set new ACL. Set new ACL rules for a specific deployment. + * + * @param request - The request {@link SetDeploymentACLRulesRequest} + * @returns A Promise of SetDeploymentACLRulesResponse + */ + setDeploymentACLRules = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalSetDeploymentACLRulesRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PUT", + path: `/inference/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${marshalling.validatePathParam("deploymentId", request.deploymentId)}/acls` + }, + marshalling_gen.unmarshalSetDeploymentACLRulesResponse + ); /** - * Generate a virtual MAC address on an existing flexible IP. Generate a - * virtual MAC (Media Access Control) address on an existing flexible IP. + * Delete an exising ACL. * - * @param request - The request {@link GenerateMACAddrRequest} - * @returns A Promise of FlexibleIP + * @param request - The request {@link DeleteDeploymentACLRuleRequest} */ - generateMACAddr = request => this.client.fetch({ - body: JSON.stringify(marshalGenerateMACAddrRequest(request, this.client.settings)), - headers: jsonContentHeaders$j, - method: 'POST', - path: `/flexible-ip/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/fips/${validatePathParam('fipId', request.fipId)}/mac` - }, unmarshalFlexibleIP); - + deleteDeploymentACLRule = (request) => this.client.fetch({ + method: "DELETE", + path: `/inference/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/acls/${marshalling.validatePathParam("aclId", request.aclId)}` + }); + pageOfListModels = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/inference/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/models`, + urlParams: marshalling.urlParams( + ["name", request.name], + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId], + ["tags", request.tags] + ) + }, + marshalling_gen.unmarshalListModelsResponse + ); /** - * Duplicate a virtual MAC address to another flexible IP. Duplicate a virtual - * MAC address from a given flexible IP to another flexible IP attached to the - * same server. + * List models. List all available models. * - * @param request - The request {@link DuplicateMACAddrRequest} - * @returns A Promise of FlexibleIP + * @param request - The request {@link ListModelsRequest} + * @returns A Promise of ListModelsResponse */ - duplicateMACAddr = request => this.client.fetch({ - body: JSON.stringify(marshalDuplicateMACAddrRequest(request, this.client.settings)), - headers: jsonContentHeaders$j, - method: 'POST', - path: `/flexible-ip/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/fips/${validatePathParam('fipId', request.fipId)}/mac/duplicate` - }, unmarshalFlexibleIP); - + listModels = (request = {}) => resourcePaginator.enrichForPagination("models", this.pageOfListModels, request); /** - * Relocate an existing virtual MAC address to a different flexible IP. - * Relocate a virtual MAC (Media Access Control) address from an existing - * flexible IP to a different flexible IP. + * Get a model. Get the model for the given ID. * - * @param request - The request {@link MoveMACAddrRequest} - * @returns A Promise of FlexibleIP + * @param request - The request {@link GetModelRequest} + * @returns A Promise of Model */ - moveMACAddr = request => this.client.fetch({ - body: JSON.stringify(marshalMoveMACAddrRequest(request, this.client.settings)), - headers: jsonContentHeaders$j, - method: 'POST', - path: `/flexible-ip/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/fips/${validatePathParam('fipId', request.fipId)}/mac/move` - }, unmarshalFlexibleIP); - + getModel = (request) => this.client.fetch( + { + method: "GET", + path: `/inference/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/models/${marshalling.validatePathParam("modelId", request.modelId)}` + }, + marshalling_gen.unmarshalModel + ); + getModelEula = (request) => this.client.fetch( + { + method: "GET", + path: `/inference/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/models/${marshalling.validatePathParam("modelId", request.modelId)}/eula` + }, + marshalling_gen.unmarshalEula + ); + pageOfListNodeTypes = (request) => this.client.fetch( + { + method: "GET", + path: `/inference/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/node-types`, + urlParams: marshalling.urlParams( + ["include_disabled_types", request.includeDisabledTypes], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListNodeTypesResponse + ); /** - * Detach a given virtual MAC address from an existing flexible IP. Detach a - * given MAC (Media Access Control) address from an existing flexible IP. + * List available node types. List all available node types. By default, the + * node types returned in the list are ordered by creation date in ascending + * order, though this can be modified via the `order_by` field. * - * @param request - The request {@link DeleteMACAddrRequest} + * @param request - The request {@link ListNodeTypesRequest} + * @returns A Promise of ListNodeTypesResponse */ - deleteMACAddr = request => this.client.fetch({ - method: 'DELETE', - path: `/flexible-ip/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/fips/${validatePathParam('fipId', request.fipId)}/mac` - }); -}; - -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. - -const ListFlexibleIPsRequest = { - page: { - greaterThan: 0 - }, - pageSize: { - greaterThan: 0, - lessThanOrEqual: 100 - } -}; - -var validationRules_gen$5 = /*#__PURE__*/Object.freeze({ - __proto__: null, - ListFlexibleIPsRequest: ListFlexibleIPsRequest -}); - -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. - -var index_gen$i = /*#__PURE__*/Object.freeze({ - __proto__: null, - API: API$k, - FLEXIBLE_IP_TRANSIENT_STATUSES: FLEXIBLE_IP_TRANSIENT_STATUSES, - MAC_ADDRESS_TRANSIENT_STATUSES: MAC_ADDRESS_TRANSIENT_STATUSES, - ValidationRules: validationRules_gen$5 -}); - -var index$l = /*#__PURE__*/Object.freeze({ - __proto__: null, - v1alpha1: index_gen$i -}); - -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. - -/** Lists transient statutes of the enum {@link CronStatus}. */ -const CRON_TRANSIENT_STATUSES = ['deleting', 'creating', 'pending']; - -/** Lists transient statutes of the enum {@link DomainStatus}. */ -const DOMAIN_TRANSIENT_STATUSES$1 = ['deleting', 'creating', 'pending']; + listNodeTypes = (request) => resourcePaginator.enrichForPagination("nodeTypes", this.pageOfListNodeTypes, request); +} +exports.API = API; -/** Lists transient statutes of the enum {@link FunctionStatus}. */ -const FUNCTION_TRANSIENT_STATUSES = ['deleting', 'creating', 'pending']; -/** Lists transient statutes of the enum {@link NamespaceStatus}. */ -const NAMESPACE_TRANSIENT_STATUSES$1 = ['deleting', 'creating', 'pending']; +/***/ }), -/** Lists transient statutes of the enum {@link TokenStatus}. */ -const TOKEN_TRANSIENT_STATUSES = ['deleting', 'creating']; +/***/ 3687: +/***/ ((__unused_webpack_module, exports) => { -/** Lists transient statutes of the enum {@link TriggerStatus}. */ -const TRIGGER_TRANSIENT_STATUSES = ['deleting', 'creating', 'pending']; +"use strict"; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const unmarshalSecretHashedValue = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'SecretHashedValue' failed as data isn't a dictionary.`); - } - return { - hashedValue: data.hashed_value, - key: data.key - }; -}; -const unmarshalTriggerMnqNatsClientConfig = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'TriggerMnqNatsClientConfig' failed as data isn't a dictionary.`); - } - return { - mnqCredentialId: data.mnq_credential_id, - mnqNamespaceId: data.mnq_namespace_id, - mnqNatsAccountId: data.mnq_nats_account_id, - mnqProjectId: data.mnq_project_id, - mnqRegion: data.mnq_region, - subject: data.subject - }; -}; -const unmarshalTriggerMnqSqsClientConfig = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'TriggerMnqSqsClientConfig' failed as data isn't a dictionary.`); - } - return { - mnqCredentialId: data.mnq_credential_id, - mnqNamespaceId: data.mnq_namespace_id, - mnqProjectId: data.mnq_project_id, - mnqRegion: data.mnq_region, - queue: data.queue - }; -}; -const unmarshalTriggerSqsClientConfig = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'TriggerSqsClientConfig' failed as data isn't a dictionary.`); +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const DEPLOYMENT_TRANSIENT_STATUSES = [ + "creating", + "deploying", + "deleting" +]; +exports.DEPLOYMENT_TRANSIENT_STATUSES = DEPLOYMENT_TRANSIENT_STATUSES; + + +/***/ }), + +/***/ 9928: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api_gen = __nccwpck_require__(3268); +const content_gen = __nccwpck_require__(3687); +const validationRules_gen = __nccwpck_require__(5735); +exports.API = api_gen.API; +exports.DEPLOYMENT_TRANSIENT_STATUSES = content_gen.DEPLOYMENT_TRANSIENT_STATUSES; +exports.ValidationRules = validationRules_gen; + + +/***/ }), + +/***/ 6294: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const randomName = __nccwpck_require__(8141); +const json = __nccwpck_require__(3746); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const unmarshalEndpointPrivateNetworkDetails = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'EndpointPrivateNetworkDetails' failed as data isn't a dictionary.` + ); } return { - accessKey: data.access_key, - endpoint: data.endpoint, - queueUrl: data.queue_url, - secretKey: data.secret_key + privateNetworkId: data.private_network_id }; }; -const unmarshalCron = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Cron' failed as data isn't a dictionary.`); +const unmarshalEndpointPublicAccessDetails = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'EndpointPublicAccessDetails' failed as data isn't a dictionary.` + ); } - return { - args: data.args, - functionId: data.function_id, - id: data.id, - name: data.name, - schedule: data.schedule, - status: data.status - }; + return {}; }; -const unmarshalDomain$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Domain' failed as data isn't a dictionary.`); +const unmarshalEndpoint = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Endpoint' failed as data isn't a dictionary.` + ); } return { - errorMessage: data.error_message, - functionId: data.function_id, - hostname: data.hostname, + disableAuth: data.disable_auth, id: data.id, - status: data.status, + privateNetwork: data.private_network ? unmarshalEndpointPrivateNetworkDetails(data.private_network) : void 0, + publicAccess: data.public_access ? unmarshalEndpointPublicAccessDetails(data.public_access) : void 0, url: data.url }; }; -const unmarshalFunction = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Function' failed as data isn't a dictionary.`); +const unmarshalDeployment = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Deployment' failed as data isn't a dictionary.` + ); } return { - buildMessage: data.build_message, - cpuLimit: data.cpu_limit, - description: data.description, - domainName: data.domain_name, - environmentVariables: data.environment_variables, + createdAt: marshalling.unmarshalDate(data.created_at), + endpoints: marshalling.unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint), errorMessage: data.error_message, - handler: data.handler, - httpOption: data.http_option, id: data.id, - maxScale: data.max_scale, - memoryLimit: data.memory_limit, - minScale: data.min_scale, + maxSize: data.max_size, + minSize: data.min_size, + modelId: data.model_id, + modelName: data.model_name, name: data.name, - namespaceId: data.namespace_id, - privacy: data.privacy, + nodeType: data.node_type, + projectId: data.project_id, region: data.region, - runtime: data.runtime, - runtimeMessage: data.runtime_message, - secretEnvironmentVariables: unmarshalArrayOfObject(data.secret_environment_variables, unmarshalSecretHashedValue), + size: data.size, status: data.status, - timeout: data.timeout + tags: data.tags, + updatedAt: marshalling.unmarshalDate(data.updated_at) }; }; -const unmarshalLog = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Log' failed as data isn't a dictionary.`); +const unmarshalModelS3Model = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ModelS3Model' failed as data isn't a dictionary.` + ); } return { - id: data.id, - level: data.level, - message: data.message, - source: data.source, - stream: data.stream, - timestamp: unmarshalDate(data.timestamp) + nodeType: data.node_type, + pythonDependencies: data.python_dependencies, + s3Url: data.s3_url, + tritonServerVersion: data.triton_server_version }; }; -const unmarshalNamespace$2 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Namespace' failed as data isn't a dictionary.`); +const unmarshalModel = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Model' failed as data isn't a dictionary.` + ); } return { + compatibleNodeTypes: data.compatible_node_types, + createdAt: marshalling.unmarshalDate(data.created_at), description: data.description, - environmentVariables: data.environment_variables, - errorMessage: data.error_message, + hasEula: data.has_eula, id: data.id, + isPublic: data.is_public, name: data.name, - organizationId: data.organization_id, projectId: data.project_id, + provider: data.provider, + quantizationLevel: data.quantization_level, region: data.region, - registryEndpoint: data.registry_endpoint, - registryNamespaceId: data.registry_namespace_id, - secretEnvironmentVariables: unmarshalArrayOfObject(data.secret_environment_variables, unmarshalSecretHashedValue), - status: data.status - }; -}; -const unmarshalRuntime = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Runtime' failed as data isn't a dictionary.`); - } - return { - codeSample: data.code_sample, - defaultHandler: data.default_handler, - extension: data.extension, - implementation: data.implementation, - language: data.language, - logoUrl: data.logo_url, - name: data.name, - status: data.status, - statusMessage: data.status_message, - version: data.version - }; -}; -const unmarshalToken = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Token' failed as data isn't a dictionary.`); - } - return { - description: data.description, - expiresAt: unmarshalDate(data.expires_at), - functionId: data.function_id, - id: data.id, - namespaceId: data.namespace_id, - publicKey: data.public_key, - status: data.status, - token: data.token + s3Model: data.s3_model ? unmarshalModelS3Model(data.s3_model) : void 0, + tags: data.tags, + updatedAt: marshalling.unmarshalDate(data.updated_at) }; }; -const unmarshalTrigger = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Trigger' failed as data isn't a dictionary.`); +const unmarshalACLRule = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ACLRule' failed as data isn't a dictionary.` + ); } return { description: data.description, - errorMessage: data.error_message, - functionId: data.function_id, id: data.id, - inputType: data.input_type, - name: data.name, - scwNatsConfig: data.scw_nats_config ? unmarshalTriggerMnqNatsClientConfig(data.scw_nats_config) : undefined, - scwSqsConfig: data.scw_sqs_config ? unmarshalTriggerMnqSqsClientConfig(data.scw_sqs_config) : undefined, - sqsConfig: data.sqs_config ? unmarshalTriggerSqsClientConfig(data.sqs_config) : undefined, - status: data.status - }; -}; -const unmarshalDownloadURL = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'DownloadURL' failed as data isn't a dictionary.`); - } - return { - headers: data.headers, - url: data.url + ip: data.ip }; }; -const unmarshalListCronsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListCronsResponse' failed as data isn't a dictionary.`); +const unmarshalAddDeploymentACLRulesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'AddDeploymentACLRulesResponse' failed as data isn't a dictionary.` + ); } return { - crons: unmarshalArrayOfObject(data.crons, unmarshalCron), - totalCount: data.total_count + rules: marshalling.unmarshalArrayOfObject(data.rules, unmarshalACLRule) }; }; -const unmarshalListDomainsResponse$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListDomainsResponse' failed as data isn't a dictionary.`); +const unmarshalEula = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Eula' failed as data isn't a dictionary.` + ); } return { - domains: unmarshalArrayOfObject(data.domains, unmarshalDomain$1), - totalCount: data.total_count + content: data.content }; }; -const unmarshalListFunctionRuntimesResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListFunctionRuntimesResponse' failed as data isn't a dictionary.`); +const unmarshalListDeploymentACLRulesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListDeploymentACLRulesResponse' failed as data isn't a dictionary.` + ); } return { - runtimes: unmarshalArrayOfObject(data.runtimes, unmarshalRuntime), + rules: marshalling.unmarshalArrayOfObject(data.rules, unmarshalACLRule), totalCount: data.total_count }; }; -const unmarshalListFunctionsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListFunctionsResponse' failed as data isn't a dictionary.`); +const unmarshalListDeploymentsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListDeploymentsResponse' failed as data isn't a dictionary.` + ); } return { - functions: unmarshalArrayOfObject(data.functions, unmarshalFunction), + deployments: marshalling.unmarshalArrayOfObject(data.deployments, unmarshalDeployment), totalCount: data.total_count }; }; -const unmarshalListLogsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListLogsResponse' failed as data isn't a dictionary.`); +const unmarshalListModelsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListModelsResponse' failed as data isn't a dictionary.` + ); } return { - logs: unmarshalArrayOfObject(data.logs, unmarshalLog), + models: marshalling.unmarshalArrayOfObject(data.models, unmarshalModel), totalCount: data.total_count }; }; -const unmarshalListNamespacesResponse$2 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListNamespacesResponse' failed as data isn't a dictionary.`); +const unmarshalNodeType = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'NodeType' failed as data isn't a dictionary.` + ); } return { - namespaces: unmarshalArrayOfObject(data.namespaces, unmarshalNamespace$2), - totalCount: data.total_count + beta: data.beta, + createdAt: marshalling.unmarshalDate(data.created_at), + description: data.description, + disabled: data.disabled, + gpus: data.gpus, + memory: data.memory, + name: data.name, + region: data.region, + stockStatus: data.stock_status, + updatedAt: marshalling.unmarshalDate(data.updated_at), + vcpus: data.vcpus, + vram: data.vram }; }; -const unmarshalListTokensResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListTokensResponse' failed as data isn't a dictionary.`); +const unmarshalListNodeTypesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListNodeTypesResponse' failed as data isn't a dictionary.` + ); } return { - tokens: unmarshalArrayOfObject(data.tokens, unmarshalToken), + nodeTypes: marshalling.unmarshalArrayOfObject(data.node_types, unmarshalNodeType), totalCount: data.total_count }; }; -const unmarshalListTriggersResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListTriggersResponse' failed as data isn't a dictionary.`); - } - return { - totalCount: data.total_count, - triggers: unmarshalArrayOfObject(data.triggers, unmarshalTrigger) - }; -}; -const unmarshalUploadURL = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'UploadURL' failed as data isn't a dictionary.`); +const unmarshalSetDeploymentACLRulesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SetDeploymentACLRulesResponse' failed as data isn't a dictionary.` + ); } return { - headers: data.headers, - url: data.url + rules: marshalling.unmarshalArrayOfObject(data.rules, unmarshalACLRule) }; }; -const marshalCreateTriggerRequestMnqNatsClientConfig = (request, defaults) => ({ - mnq_namespace_id: request.mnqNamespaceId, - mnq_nats_account_id: request.mnqNatsAccountId, - mnq_project_id: request.mnqProjectId, - mnq_region: request.mnqRegion, - subject: request.subject -}); -const marshalCreateTriggerRequestMnqSqsClientConfig = (request, defaults) => ({ - mnq_namespace_id: request.mnqNamespaceId, - mnq_project_id: request.mnqProjectId, - mnq_region: request.mnqRegion, - queue: request.queue -}); -const marshalCreateTriggerRequestSqsClientConfig = (request, defaults) => ({ - access_key: request.accessKey, - endpoint: request.endpoint, - queue_url: request.queueUrl, - secret_key: request.secretKey -}); -const marshalSecret = (request, defaults) => ({ - key: request.key, - value: request.value -}); -const marshalUpdateTriggerRequestSqsClientConfig = (request, defaults) => ({ - access_key: request.accessKey, - secret_key: request.secretKey -}); -const marshalCreateCronRequest = (request, defaults) => ({ - args: request.args, - function_id: request.functionId, - name: request.name, - schedule: request.schedule -}); -const marshalCreateDomainRequest$1 = (request, defaults) => ({ - function_id: request.functionId, - hostname: request.hostname -}); -const marshalCreateFunctionRequest = (request, defaults) => ({ +const marshalACLRuleRequest = (request, defaults) => ({ description: request.description, - environment_variables: request.environmentVariables, - handler: request.handler, - http_option: request.httpOption ?? 'unknown_http_option', - max_scale: request.maxScale, - memory_limit: request.memoryLimit, - min_scale: request.minScale, - name: request.name || randomName('fn'), - namespace_id: request.namespaceId, - privacy: request.privacy ?? 'unknown_privacy', - runtime: request.runtime ?? 'unknown_runtime', - secret_environment_variables: request.secretEnvironmentVariables ? request.secretEnvironmentVariables.map(elt => marshalSecret(elt)) : undefined, - timeout: request.timeout + ip: request.ip }); -const marshalCreateNamespaceRequest$2 = (request, defaults) => ({ - description: request.description, - environment_variables: request.environmentVariables, - name: request.name || randomName('ns'), - project_id: request.projectId ?? defaults.defaultProjectId, - secret_environment_variables: request.secretEnvironmentVariables ? request.secretEnvironmentVariables.map(elt => marshalSecret(elt)) : undefined +const marshalAddDeploymentACLRulesRequest = (request, defaults) => ({ + acls: request.acls !== void 0 ? request.acls.map((elt) => marshalACLRuleRequest(elt)) : void 0 }); -const marshalCreateTokenRequest = (request, defaults) => ({ - description: request.description, - expires_at: request.expiresAt, - ...resolveOneOf([{ - param: 'function_id', - value: request.functionId - }, { - param: 'namespace_id', - value: request.namespaceId - }]) +const marshalEndpointSpecPrivateNetwork = (request, defaults) => ({ + private_network_id: request.privateNetworkId }); -const marshalCreateTriggerRequest = (request, defaults) => ({ - description: request.description, - function_id: request.functionId, - name: request.name, - ...resolveOneOf([{ - param: 'scw_sqs_config', - value: request.scwSqsConfig ? marshalCreateTriggerRequestMnqSqsClientConfig(request.scwSqsConfig) : undefined - }, { - param: 'sqs_config', - value: request.sqsConfig ? marshalCreateTriggerRequestSqsClientConfig(request.sqsConfig) : undefined - }, { - param: 'scw_nats_config', - value: request.scwNatsConfig ? marshalCreateTriggerRequestMnqNatsClientConfig(request.scwNatsConfig) : undefined - }]) +const marshalEndpointSpecPublic = (request, defaults) => ({}); +const marshalEndpointSpec = (request, defaults) => ({ + disable_auth: request.disableAuth, + ...marshalling.resolveOneOf([ + { + param: "public", + value: request.public !== void 0 ? marshalEndpointSpecPublic(request.public) : void 0 + }, + { + param: "private_network", + value: request.privateNetwork !== void 0 ? marshalEndpointSpecPrivateNetwork(request.privateNetwork) : void 0 + } + ]) }); -const marshalUpdateCronRequest = (request, defaults) => ({ - args: request.args, - function_id: request.functionId, - name: request.name, - schedule: request.schedule +const marshalCreateDeploymentRequest = (request, defaults) => ({ + accept_eula: request.acceptEula, + endpoints: request.endpoints.map((elt) => marshalEndpointSpec(elt)), + max_size: request.maxSize, + min_size: request.minSize, + model_name: request.modelName, + name: request.name || randomName("inference"), + node_type: request.nodeType, + project_id: request.projectId ?? defaults.defaultProjectId, + tags: request.tags }); -const marshalUpdateFunctionRequest = (request, defaults) => ({ - description: request.description, - environment_variables: request.environmentVariables, - handler: request.handler, - http_option: request.httpOption ?? 'unknown_http_option', - max_scale: request.maxScale, - memory_limit: request.memoryLimit, - min_scale: request.minScale, - privacy: request.privacy ?? 'unknown_privacy', - redeploy: request.redeploy, - runtime: request.runtime ?? 'unknown_runtime', - secret_environment_variables: request.secretEnvironmentVariables ? request.secretEnvironmentVariables.map(elt => marshalSecret(elt)) : undefined, - timeout: request.timeout +const marshalCreateEndpointRequest = (request, defaults) => ({ + deployment_id: request.deploymentId, + endpoint: marshalEndpointSpec(request.endpoint) }); -const marshalUpdateNamespaceRequest$2 = (request, defaults) => ({ - description: request.description, - environment_variables: request.environmentVariables, - secret_environment_variables: request.secretEnvironmentVariables ? request.secretEnvironmentVariables.map(elt => marshalSecret(elt)) : undefined +const marshalSetDeploymentACLRulesRequest = (request, defaults) => ({ + acls: request.acls !== void 0 ? request.acls.map((elt) => marshalACLRuleRequest(elt)) : void 0 }); -const marshalUpdateTriggerRequest = (request, defaults) => ({ - description: request.description, +const marshalUpdateDeploymentRequest = (request, defaults) => ({ + max_size: request.maxSize, + min_size: request.minSize, name: request.name, - ...resolveOneOf([{ - param: 'sqs_config', - value: request.sqsConfig ? marshalUpdateTriggerRequestSqsClientConfig(request.sqsConfig) : undefined - }]) + tags: request.tags }); +const marshalUpdateEndpointRequest = (request, defaults) => ({ + disable_auth: request.disableAuth +}); +exports.marshalAddDeploymentACLRulesRequest = marshalAddDeploymentACLRulesRequest; +exports.marshalCreateDeploymentRequest = marshalCreateDeploymentRequest; +exports.marshalCreateEndpointRequest = marshalCreateEndpointRequest; +exports.marshalSetDeploymentACLRulesRequest = marshalSetDeploymentACLRulesRequest; +exports.marshalUpdateDeploymentRequest = marshalUpdateDeploymentRequest; +exports.marshalUpdateEndpointRequest = marshalUpdateEndpointRequest; +exports.unmarshalAddDeploymentACLRulesResponse = unmarshalAddDeploymentACLRulesResponse; +exports.unmarshalDeployment = unmarshalDeployment; +exports.unmarshalEndpoint = unmarshalEndpoint; +exports.unmarshalEula = unmarshalEula; +exports.unmarshalListDeploymentACLRulesResponse = unmarshalListDeploymentACLRulesResponse; +exports.unmarshalListDeploymentsResponse = unmarshalListDeploymentsResponse; +exports.unmarshalListModelsResponse = unmarshalListModelsResponse; +exports.unmarshalListNodeTypesResponse = unmarshalListNodeTypesResponse; +exports.unmarshalModel = unmarshalModel; +exports.unmarshalSetDeploymentACLRulesResponse = unmarshalSetDeploymentACLRulesResponse; + + +/***/ }), + +/***/ 5735: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const jsonContentHeaders$i = { - 'Content-Type': 'application/json; charset=utf-8' +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const CreateDeploymentRequest = { + maxSize: { + greaterThanOrEqual: 1, + lessThanOrEqual: 50 + }, + minSize: { + greaterThanOrEqual: 1, + lessThanOrEqual: 50 + }, + modelName: { + maxLength: 255, + minLength: 0, + pattern: /^[\w-_]+\/[\w-_.]+(:[\w]+)?$/ + }, + name: { + maxLength: 255, + minLength: 1, + pattern: /^[A-Za-z0-9-_]+$/ + }, + nodeType: { + maxLength: 64, + minLength: 1 + } +}; +const ListDeploymentsRequest = { + name: { + maxLength: 255, + minLength: 1 + } +}; +const ListModelsRequest = { + name: { + maxLength: 255, + minLength: 1 + } +}; +const UpdateDeploymentRequest = { + maxSize: { + greaterThanOrEqual: 1, + lessThanOrEqual: 50 + }, + minSize: { + greaterThanOrEqual: 1, + lessThanOrEqual: 50 + }, + name: { + maxLength: 255, + minLength: 1 + } }; +exports.CreateDeploymentRequest = CreateDeploymentRequest; +exports.ListDeploymentsRequest = ListDeploymentsRequest; +exports.ListModelsRequest = ListModelsRequest; +exports.UpdateDeploymentRequest = UpdateDeploymentRequest; + + +/***/ }), + +/***/ 3693: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const index = __nccwpck_require__(9653); +exports.v1 = index; + + +/***/ }), + +/***/ 5449: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/** Serverless Functions API. */ -let API$j = class API extends API$u { - /** Lists the available regions of the API. */ - static LOCALITIES = ['fr-par', 'nl-ams', 'pl-waw']; - pageOfListNamespaces = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces`, - urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId]) - }, unmarshalListNamespacesResponse$2); +"use strict"; +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api = __nccwpck_require__(3042); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const resourcePaginator = __nccwpck_require__(4983); +const marshalling_gen = __nccwpck_require__(6847); +const jsonContentHeaders = { + "Content-Type": "application/json; charset=utf-8" +}; +class API extends api.API { + /** Lists the available zones of the API. */ + static LOCALITIES = [ + "fr-par-1", + "fr-par-2", + "fr-par-3", + "nl-ams-1", + "nl-ams-2", + "nl-ams-3", + "pl-waw-1", + "pl-waw-2", + "pl-waw-3" + ]; + /** + * Get availability. Get availability for all Instance types. + * + * @param request - The request {@link GetServerTypesAvailabilityRequest} + * @returns A Promise of GetServerTypesAvailabilityResponse + */ + getServerTypesAvailability = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/products/servers/availability`, + urlParams: marshalling.urlParams( + ["page", request.page], + ["per_page", request.perPage ?? this.client.settings.defaultPageSize] + ) + }, + marshalling_gen.unmarshalGetServerTypesAvailabilityResponse + ); + /** + * List Instance types. List available Instance types and their technical + * details. + * + * @param request - The request {@link ListServersTypesRequest} + * @returns A Promise of ListServersTypesResponse + */ + listServersTypes = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/products/servers`, + urlParams: marshalling.urlParams( + ["page", request.page], + ["per_page", request.perPage ?? this.client.settings.defaultPageSize] + ) + }, + marshalling_gen.unmarshalListServersTypesResponse + ); + /** + * List volume types. List all volume types and their technical details. + * + * @param request - The request {@link ListVolumesTypesRequest} + * @returns A Promise of ListVolumesTypesResponse + */ + listVolumesTypes = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/products/volumes`, + urlParams: marshalling.urlParams( + ["page", request.page], + ["per_page", request.perPage ?? this.client.settings.defaultPageSize] + ) + }, + marshalling_gen.unmarshalListVolumesTypesResponse + ); + pageOfListServers = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers`, + urlParams: marshalling.urlParams( + ["commercial_type", request.commercialType], + ["name", request.name], + ["order", request.order], + ["organization", request.organization], + ["page", request.page], + ["per_page", request.perPage ?? this.client.settings.defaultPageSize], + ["private_ip", request.privateIp], + ["private_network", request.privateNetwork], + [ + "private_networks", + request.privateNetworks && request.privateNetworks.length > 0 ? request.privateNetworks.join(",") : void 0 + ], + ["private_nic_mac_address", request.privateNicMacAddress], + ["project", request.project], + [ + "servers", + request.servers && request.servers.length > 0 ? request.servers.join(",") : void 0 + ], + ["state", request.state], + [ + "tags", + request.tags && request.tags.length > 0 ? request.tags.join(",") : void 0 + ], + ["with_ip", request.withIp], + ["without_ip", request.withoutIp] + ) + }, + marshalling_gen.unmarshalListServersResponse + ); + /** + * List all Instances. List all Instances in a specified Availability Zone, + * e.g. `fr-par-1`. + * + * @param request - The request {@link ListServersRequest} + * @returns A Promise of ListServersResponse + */ + listServers = (request = {}) => resourcePaginator.enrichForPagination("servers", this.pageOfListServers, request); + _createServer = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateServerRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers` + }, + marshalling_gen.unmarshalCreateServerResponse + ); + /** + * Delete an Instance. Delete the Instance with the specified ID. + * + * @param request - The request {@link DeleteServerRequest} + */ + deleteServer = (request) => this.client.fetch({ + method: "DELETE", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}` + }); + /** + * Get an Instance. Get the details of a specified Instance. + * + * @param request - The request {@link GetServerRequest} + * @returns A Promise of GetServerResponse + */ + getServer = (request) => this.client.fetch( + { + method: "GET", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}` + }, + marshalling_gen.unmarshalGetServerResponse + ); + _setServer = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalSetServerRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PUT", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("id", request.id)}` + }, + marshalling_gen.unmarshalSetServerResponse + ); + _updateServer = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateServerRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}` + }, + marshalling_gen.unmarshalUpdateServerResponse + ); + /** + * List Instance actions. List all actions (e.g. power on, power off, reboot) + * that can currently be performed on an Instance. + * + * @param request - The request {@link ListServerActionsRequest} + * @returns A Promise of ListServerActionsResponse + */ + listServerActions = (request) => this.client.fetch( + { + method: "GET", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/action` + }, + marshalling_gen.unmarshalListServerActionsResponse + ); + /** + * Perform action. Perform an action on an Instance. Available actions are: + * `poweron`: Start a stopped Instance. `poweroff`: Fully stop the Instance + * and release the hypervisor slot. `stop_in_place`: Stop the Instance, but + * keep the slot on the hypervisor. `reboot`: Stop the instance and restart + * it. `backup`: Create an image with all the volumes of an Instance. + * `terminate`: Delete the Instance along with its attached volumes, except + * for SBS volumes. `enable_routed_ip`: Migrate the Instance to the new + * network stack. + * + * Keep in mind that `terminate` an Instance will result in the deletion of + * `l_ssd`, `b_ssd` and `scratch` volumes types, `sbs_volume` volumes type + * will only be detached. If you want to preserve your volumes, you should + * detach them before the Instance deletion or `terminate` action. + * + * @param request - The request {@link ServerActionRequest} + * @returns A Promise of ServerActionResponse + */ + serverAction = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalServerActionRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/action` + }, + marshalling_gen.unmarshalServerActionResponse + ); + /** + * List user data. List all user data keys registered on a specified Instance. + * + * @param request - The request {@link ListServerUserDataRequest} + * @returns A Promise of ListServerUserDataResponse + */ + listServerUserData = (request) => this.client.fetch( + { + method: "GET", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/user_data` + }, + marshalling_gen.unmarshalListServerUserDataResponse + ); + /** + * Delete user data. Delete the specified key from an Instance's user data. + * + * @param request - The request {@link DeleteServerUserDataRequest} + */ + deleteServerUserData = (request) => this.client.fetch({ + method: "DELETE", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/user_data/${marshalling.validatePathParam("key", request.key)}` + }); + attachServerVolume = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalAttachServerVolumeRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/attach-volume` + }, + marshalling_gen.unmarshalAttachServerVolumeResponse + ); + detachServerVolume = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalDetachServerVolumeRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/detach-volume` + }, + marshalling_gen.unmarshalDetachServerVolumeResponse + ); + pageOfListImages = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/images`, + urlParams: marshalling.urlParams( + ["arch", request.arch], + ["name", request.name], + ["organization", request.organization], + ["page", request.page], + ["per_page", request.perPage ?? this.client.settings.defaultPageSize], + ["project", request.project], + ["public", request.public], + ["tags", request.tags] + ) + }, + marshalling_gen.unmarshalListImagesResponse + ); + /** + * List Instance images. List all existing Instance images. + * + * @param request - The request {@link ListImagesRequest} + * @returns A Promise of ListImagesResponse + */ + listImages = (request = {}) => resourcePaginator.enrichForPagination("images", this.pageOfListImages, request); + /** + * Get an Instance image. Get details of an image with the specified ID. + * + * @param request - The request {@link GetImageRequest} + * @returns A Promise of GetImageResponse + */ + getImage = (request) => this.client.fetch( + { + method: "GET", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/images/${marshalling.validatePathParam("imageId", request.imageId)}` + }, + marshalling_gen.unmarshalGetImageResponse + ); + /** + * Create an Instance image. Create an Instance image from the specified + * snapshot ID. + * + * @param request - The request {@link CreateImageRequest} + * @returns A Promise of CreateImageResponse + */ + createImage = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateImageRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/images` + }, + marshalling_gen.unmarshalCreateImageResponse + ); + _setImage = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalSetImageRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PUT", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/images/${marshalling.validatePathParam("id", request.id)}` + }, + marshalling_gen.unmarshalSetImageResponse + ); + /** + * Update image. Update the properties of an image. + * + * @param request - The request {@link UpdateImageRequest} + * @returns A Promise of UpdateImageResponse + */ + updateImage = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateImageRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/images/${marshalling.validatePathParam("imageId", request.imageId)}` + }, + marshalling_gen.unmarshalUpdateImageResponse + ); + /** + * Delete an Instance image. Delete the image with the specified ID. + * + * @param request - The request {@link DeleteImageRequest} + */ + deleteImage = (request) => this.client.fetch({ + method: "DELETE", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/images/${marshalling.validatePathParam("imageId", request.imageId)}` + }); + pageOfListSnapshots = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots`, + urlParams: marshalling.urlParams( + ["base_volume_id", request.baseVolumeId], + ["name", request.name], + ["organization", request.organization], + ["page", request.page], + ["per_page", request.perPage ?? this.client.settings.defaultPageSize], + ["project", request.project], + ["tags", request.tags] + ) + }, + marshalling_gen.unmarshalListSnapshotsResponse + ); + /** + * List snapshots. List all snapshots of an Organization in a specified + * Availability Zone. + * + * @param request - The request {@link ListSnapshotsRequest} + * @returns A Promise of ListSnapshotsResponse + */ + listSnapshots = (request = {}) => resourcePaginator.enrichForPagination("snapshots", this.pageOfListSnapshots, request); + /** + * Create a snapshot from a specified volume or from a QCOW2 file. Create a + * snapshot from a specified volume or from a QCOW2 file in a specified + * Availability Zone. + * + * @param request - The request {@link CreateSnapshotRequest} + * @returns A Promise of CreateSnapshotResponse + */ + createSnapshot = (request = {}) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateSnapshotRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots` + }, + marshalling_gen.unmarshalCreateSnapshotResponse + ); + /** + * Get a snapshot. Get details of a snapshot with the specified ID. + * + * @param request - The request {@link GetSnapshotRequest} + * @returns A Promise of GetSnapshotResponse + */ + getSnapshot = (request) => this.client.fetch( + { + method: "GET", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots/${marshalling.validatePathParam("snapshotId", request.snapshotId)}` + }, + marshalling_gen.unmarshalGetSnapshotResponse + ); + _setSnapshot = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalSetSnapshotRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PUT", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots/${marshalling.validatePathParam("snapshotId", request.snapshotId)}` + }, + marshalling_gen.unmarshalSetSnapshotResponse + ); + /** + * Update a snapshot. Update the properties of a snapshot. + * + * @param request - The request {@link UpdateSnapshotRequest} + * @returns A Promise of UpdateSnapshotResponse + */ + updateSnapshot = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateSnapshotRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots/${marshalling.validatePathParam("snapshotId", request.snapshotId)}` + }, + marshalling_gen.unmarshalUpdateSnapshotResponse + ); + /** + * Delete a snapshot. Delete the snapshot with the specified ID. + * + * @param request - The request {@link DeleteSnapshotRequest} + */ + deleteSnapshot = (request) => this.client.fetch({ + method: "DELETE", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots/${marshalling.validatePathParam("snapshotId", request.snapshotId)}` + }); + /** + * Export a snapshot. Export a snapshot to a specified S3 bucket in the same + * region. + * + * @param request - The request {@link ExportSnapshotRequest} + * @returns A Promise of ExportSnapshotResponse + */ + exportSnapshot = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalExportSnapshotRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/snapshots/${marshalling.validatePathParam("snapshotId", request.snapshotId)}/export` + }, + marshalling_gen.unmarshalExportSnapshotResponse + ); + pageOfListVolumes = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/volumes`, + urlParams: marshalling.urlParams( + ["name", request.name], + ["organization", request.organization], + ["page", request.page], + ["per_page", request.perPage ?? this.client.settings.defaultPageSize], + ["project", request.project], + [ + "tags", + request.tags && request.tags.length > 0 ? request.tags.join(",") : void 0 + ], + ["volume_type", request.volumeType] + ) + }, + marshalling_gen.unmarshalListVolumesResponse + ); + /** + * List volumes. List volumes in the specified Availability Zone. You can + * filter the output by volume type. + * + * @param request - The request {@link ListVolumesRequest} + * @returns A Promise of ListVolumesResponse + */ + listVolumes = (request = {}) => resourcePaginator.enrichForPagination("volumes", this.pageOfListVolumes, request); + /** + * Create a volume. Create a volume of a specified type in an Availability + * Zone. + * + * @param request - The request {@link CreateVolumeRequest} + * @returns A Promise of CreateVolumeResponse + */ + createVolume = (request = {}) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateVolumeRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/volumes` + }, + marshalling_gen.unmarshalCreateVolumeResponse + ); + /** + * Get a volume. Get details of a volume with the specified ID. + * + * @param request - The request {@link GetVolumeRequest} + * @returns A Promise of GetVolumeResponse + */ + getVolume = (request) => this.client.fetch( + { + method: "GET", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/volumes/${marshalling.validatePathParam("volumeId", request.volumeId)}` + }, + marshalling_gen.unmarshalGetVolumeResponse + ); + /** + * Update a volume. Replace the name and/or size properties of a volume + * specified by its ID, with the specified value(s). Any volume name can be + * changed, however only `b_ssd` volumes can currently be increased in size. + * + * @param request - The request {@link UpdateVolumeRequest} + * @returns A Promise of UpdateVolumeResponse + */ + updateVolume = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateVolumeRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/volumes/${marshalling.validatePathParam("volumeId", request.volumeId)}` + }, + marshalling_gen.unmarshalUpdateVolumeResponse + ); + /** + * Delete a volume. Delete the volume with the specified ID. + * + * @param request - The request {@link DeleteVolumeRequest} + */ + deleteVolume = (request) => this.client.fetch({ + method: "DELETE", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/volumes/${marshalling.validatePathParam("volumeId", request.volumeId)}` + }); + pageOfListSecurityGroups = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/security_groups`, + urlParams: marshalling.urlParams( + ["name", request.name], + ["organization", request.organization], + ["page", request.page], + ["per_page", request.perPage ?? this.client.settings.defaultPageSize], + ["project", request.project], + ["project_default", request.projectDefault], + [ + "tags", + request.tags && request.tags.length > 0 ? request.tags.join(",") : void 0 + ] + ) + }, + marshalling_gen.unmarshalListSecurityGroupsResponse + ); + /** + * List security groups. List all existing security groups. + * + * @param request - The request {@link ListSecurityGroupsRequest} + * @returns A Promise of ListSecurityGroupsResponse + */ + listSecurityGroups = (request = {}) => resourcePaginator.enrichForPagination( + "securityGroups", + this.pageOfListSecurityGroups, + request + ); + /** + * Create a security group. Create a security group with a specified name and + * description. + * + * @param request - The request {@link CreateSecurityGroupRequest} + * @returns A Promise of CreateSecurityGroupResponse + */ + createSecurityGroup = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateSecurityGroupRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/security_groups` + }, + marshalling_gen.unmarshalCreateSecurityGroupResponse + ); + /** + * Get a security group. Get the details of a security group with the + * specified ID. + * + * @param request - The request {@link GetSecurityGroupRequest} + * @returns A Promise of GetSecurityGroupResponse + */ + getSecurityGroup = (request) => this.client.fetch( + { + method: "GET", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/security_groups/${marshalling.validatePathParam("securityGroupId", request.securityGroupId)}` + }, + marshalling_gen.unmarshalGetSecurityGroupResponse + ); + /** + * Delete a security group. Delete a security group with the specified ID. + * + * @param request - The request {@link DeleteSecurityGroupRequest} + */ + deleteSecurityGroup = (request) => this.client.fetch({ + method: "DELETE", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/security_groups/${marshalling.validatePathParam("securityGroupId", request.securityGroupId)}` + }); + _setSecurityGroup = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalSetSecurityGroupRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PUT", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/security_groups/${marshalling.validatePathParam("id", request.id)}` + }, + marshalling_gen.unmarshalSetSecurityGroupResponse + ); + /** + * Update a security group. Update the properties of security group. + * + * @param request - The request {@link UpdateSecurityGroupRequest} + * @returns A Promise of UpdateSecurityGroupResponse + */ + updateSecurityGroup = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateSecurityGroupRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/security_groups/${marshalling.validatePathParam("securityGroupId", request.securityGroupId)}` + }, + marshalling_gen.unmarshalUpdateSecurityGroupResponse + ); + /** + * Get default rules. Lists the default rules applied to all the security + * groups. + * + * @param request - The request {@link ListDefaultSecurityGroupRulesRequest} + * @returns A Promise of ListSecurityGroupRulesResponse + */ + listDefaultSecurityGroupRules = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/security_groups/default/rules` + }, + marshalling_gen.unmarshalListSecurityGroupRulesResponse + ); + pageOfListSecurityGroupRules = (request) => this.client.fetch( + { + method: "GET", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/security_groups/${marshalling.validatePathParam("securityGroupId", request.securityGroupId)}/rules`, + urlParams: marshalling.urlParams( + ["page", request.page], + ["per_page", request.perPage ?? this.client.settings.defaultPageSize] + ) + }, + marshalling_gen.unmarshalListSecurityGroupRulesResponse + ); + /** + * List rules. List the rules of the a specified security group ID. + * + * @param request - The request {@link ListSecurityGroupRulesRequest} + * @returns A Promise of ListSecurityGroupRulesResponse + */ + listSecurityGroupRules = (request) => resourcePaginator.enrichForPagination("rules", this.pageOfListSecurityGroupRules, request); + /** + * Create rule. Create a rule in the specified security group ID. + * + * @param request - The request {@link CreateSecurityGroupRuleRequest} + * @returns A Promise of CreateSecurityGroupRuleResponse + */ + createSecurityGroupRule = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateSecurityGroupRuleRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/security_groups/${marshalling.validatePathParam("securityGroupId", request.securityGroupId)}/rules` + }, + marshalling_gen.unmarshalCreateSecurityGroupRuleResponse + ); /** - * List all your namespaces. List all existing namespaces in the specified - * region. + * Update all the rules of a security group. Replaces the existing rules of + * the security group with the rules provided. This endpoint supports the + * update of existing rules, creation of new rules and deletion of existing + * rules when they are not passed in the request. * - * @param request - The request {@link ListNamespacesRequest} - * @returns A Promise of ListNamespacesResponse + * @param request - The request {@link SetSecurityGroupRulesRequest} + * @returns A Promise of SetSecurityGroupRulesResponse */ - listNamespaces = (request = {}) => enrichForPagination('namespaces', this.pageOfListNamespaces, request); - + setSecurityGroupRules = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalSetSecurityGroupRulesRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PUT", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/security_groups/${marshalling.validatePathParam("securityGroupId", request.securityGroupId)}/rules` + }, + marshalling_gen.unmarshalSetSecurityGroupRulesResponse + ); /** - * Get a namespace. Get the namespace associated with the specified ID. + * Delete rule. Delete a security group rule with the specified ID. * - * @param request - The request {@link GetNamespaceRequest} - * @returns A Promise of Namespace + * @param request - The request {@link DeleteSecurityGroupRuleRequest} */ - getNamespace = request => this.client.fetch({ - method: 'GET', - path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam('namespaceId', request.namespaceId)}` - }, unmarshalNamespace$2); - + deleteSecurityGroupRule = (request) => this.client.fetch({ + method: "DELETE", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/security_groups/${marshalling.validatePathParam("securityGroupId", request.securityGroupId)}/rules/${marshalling.validatePathParam("securityGroupRuleId", request.securityGroupRuleId)}` + }); /** - * Waits for {@link Namespace} to be in a final state. + * Get rule. Get details of a security group rule with the specified ID. * - * @param request - The request {@link GetNamespaceRequest} - * @param options - The waiting options - * @returns A Promise of Namespace + * @param request - The request {@link GetSecurityGroupRuleRequest} + * @returns A Promise of GetSecurityGroupRuleResponse */ - waitForNamespace = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!NAMESPACE_TRANSIENT_STATUSES$1.includes(res.status))), this.getNamespace, request, options); - + getSecurityGroupRule = (request) => this.client.fetch( + { + method: "GET", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/security_groups/${marshalling.validatePathParam("securityGroupId", request.securityGroupId)}/rules/${marshalling.validatePathParam("securityGroupRuleId", request.securityGroupRuleId)}` + }, + marshalling_gen.unmarshalGetSecurityGroupRuleResponse + ); + _setSecurityGroupRule = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalSetSecurityGroupRuleRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PUT", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/security_groups/${marshalling.validatePathParam("securityGroupId", request.securityGroupId)}/rules/${marshalling.validatePathParam("securityGroupRuleId", request.securityGroupRuleId)}` + }, + marshalling_gen.unmarshalSetSecurityGroupRuleResponse + ); /** - * Create a new namespace. Create a new namespace in a specified Organization - * or Project. + * Update security group rule. Update the properties of a rule from a + * specified security group. * - * @param request - The request {@link CreateNamespaceRequest} - * @returns A Promise of Namespace + * @param request - The request {@link UpdateSecurityGroupRuleRequest} + * @returns A Promise of UpdateSecurityGroupRuleResponse */ - createNamespace = (request = {}) => this.client.fetch({ - body: JSON.stringify(marshalCreateNamespaceRequest$2(request, this.client.settings)), - headers: jsonContentHeaders$i, - method: 'POST', - path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces` - }, unmarshalNamespace$2); - + updateSecurityGroupRule = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateSecurityGroupRuleRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/security_groups/${marshalling.validatePathParam("securityGroupId", request.securityGroupId)}/rules/${marshalling.validatePathParam("securityGroupRuleId", request.securityGroupRuleId)}` + }, + marshalling_gen.unmarshalUpdateSecurityGroupRuleResponse + ); + pageOfListPlacementGroups = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/placement_groups`, + urlParams: marshalling.urlParams( + ["name", request.name], + ["organization", request.organization], + ["page", request.page], + ["per_page", request.perPage ?? this.client.settings.defaultPageSize], + ["project", request.project], + [ + "tags", + request.tags && request.tags.length > 0 ? request.tags.join(",") : void 0 + ] + ) + }, + marshalling_gen.unmarshalListPlacementGroupsResponse + ); /** - * Update an existing namespace. Update the namespace associated with the - * specified ID. + * List placement groups. List all placement groups in a specified + * Availability Zone. * - * @param request - The request {@link UpdateNamespaceRequest} - * @returns A Promise of Namespace + * @param request - The request {@link ListPlacementGroupsRequest} + * @returns A Promise of ListPlacementGroupsResponse */ - updateNamespace = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateNamespaceRequest$2(request, this.client.settings)), - headers: jsonContentHeaders$i, - method: 'PATCH', - path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam('namespaceId', request.namespaceId)}` - }, unmarshalNamespace$2); - + listPlacementGroups = (request = {}) => resourcePaginator.enrichForPagination( + "placementGroups", + this.pageOfListPlacementGroups, + request + ); /** - * Delete an existing namespace. Delete the namespace associated with the - * specified ID. + * Create a placement group. Create a new placement group in a specified + * Availability Zone. * - * @param request - The request {@link DeleteNamespaceRequest} - * @returns A Promise of Namespace + * @param request - The request {@link CreatePlacementGroupRequest} + * @returns A Promise of CreatePlacementGroupResponse */ - deleteNamespace = request => this.client.fetch({ - method: 'DELETE', - path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam('namespaceId', request.namespaceId)}` - }, unmarshalNamespace$2); - pageOfListFunctions = request => this.client.fetch({ - method: 'GET', - path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/functions`, - urlParams: urlParams(['name', request.name], ['namespace_id', request.namespaceId], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId]) - }, unmarshalListFunctionsResponse); - + createPlacementGroup = (request = {}) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreatePlacementGroupRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/placement_groups` + }, + marshalling_gen.unmarshalCreatePlacementGroupResponse + ); /** - * List all your functions. + * Get a placement group. Get the specified placement group. * - * @param request - The request {@link ListFunctionsRequest} - * @returns A Promise of ListFunctionsResponse + * @param request - The request {@link GetPlacementGroupRequest} + * @returns A Promise of GetPlacementGroupResponse */ - listFunctions = request => enrichForPagination('functions', this.pageOfListFunctions, request); - + getPlacementGroup = (request) => this.client.fetch( + { + method: "GET", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/placement_groups/${marshalling.validatePathParam("placementGroupId", request.placementGroupId)}` + }, + marshalling_gen.unmarshalGetPlacementGroupResponse + ); /** - * Get a function. Get the function associated with the specified ID. + * Set placement group. Set all parameters of the specified placement group. * - * @param request - The request {@link GetFunctionRequest} - * @returns A Promise of Function + * @param request - The request {@link SetPlacementGroupRequest} + * @returns A Promise of SetPlacementGroupResponse */ - getFunction = request => this.client.fetch({ - method: 'GET', - path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/functions/${validatePathParam('functionId', request.functionId)}` - }, unmarshalFunction); - + setPlacementGroup = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalSetPlacementGroupRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PUT", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/placement_groups/${marshalling.validatePathParam("placementGroupId", request.placementGroupId)}` + }, + marshalling_gen.unmarshalSetPlacementGroupResponse + ); /** - * Waits for {@link Function} to be in a final state. + * Update a placement group. Update one or more parameter of the specified + * placement group. * - * @param request - The request {@link GetFunctionRequest} - * @param options - The waiting options - * @returns A Promise of Function + * @param request - The request {@link UpdatePlacementGroupRequest} + * @returns A Promise of UpdatePlacementGroupResponse */ - waitForFunction = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!FUNCTION_TRANSIENT_STATUSES.includes(res.status))), this.getFunction, request, options); - + updatePlacementGroup = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdatePlacementGroupRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/placement_groups/${marshalling.validatePathParam("placementGroupId", request.placementGroupId)}` + }, + marshalling_gen.unmarshalUpdatePlacementGroupResponse + ); /** - * Create a new function. Create a new function in the specified region for a - * specified Organization or Project. + * Delete the specified placement group. * - * @param request - The request {@link CreateFunctionRequest} - * @returns A Promise of Function + * @param request - The request {@link DeletePlacementGroupRequest} */ - createFunction = request => this.client.fetch({ - body: JSON.stringify(marshalCreateFunctionRequest(request, this.client.settings)), - headers: jsonContentHeaders$i, - method: 'POST', - path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/functions` - }, unmarshalFunction); - + deletePlacementGroup = (request) => this.client.fetch({ + method: "DELETE", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/placement_groups/${marshalling.validatePathParam("placementGroupId", request.placementGroupId)}` + }); /** - * Update an existing function. Update the function associated with the - * specified ID. + * Get placement group servers. Get all Instances belonging to the specified + * placement group. * - * @param request - The request {@link UpdateFunctionRequest} - * @returns A Promise of Function + * @param request - The request {@link GetPlacementGroupServersRequest} + * @returns A Promise of GetPlacementGroupServersResponse */ - updateFunction = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateFunctionRequest(request, this.client.settings)), - headers: jsonContentHeaders$i, - method: 'PATCH', - path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/functions/${validatePathParam('functionId', request.functionId)}` - }, unmarshalFunction); - + getPlacementGroupServers = (request) => this.client.fetch( + { + method: "GET", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/placement_groups/${marshalling.validatePathParam("placementGroupId", request.placementGroupId)}/servers` + }, + marshalling_gen.unmarshalGetPlacementGroupServersResponse + ); /** - * Delete a function. Delete the function associated with the specified ID. + * Set placement group servers. Set all Instances belonging to the specified + * placement group. * - * @param request - The request {@link DeleteFunctionRequest} - * @returns A Promise of Function + * @param request - The request {@link SetPlacementGroupServersRequest} + * @returns A Promise of SetPlacementGroupServersResponse */ - deleteFunction = request => this.client.fetch({ - method: 'DELETE', - path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/functions/${validatePathParam('functionId', request.functionId)}` - }, unmarshalFunction); - + setPlacementGroupServers = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalSetPlacementGroupServersRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PUT", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/placement_groups/${marshalling.validatePathParam("placementGroupId", request.placementGroupId)}/servers` + }, + marshalling_gen.unmarshalSetPlacementGroupServersResponse + ); /** - * Deploy a function. Deploy a function associated with the specified ID. + * Update placement group servers. Update all Instances belonging to the + * specified placement group. * - * @param request - The request {@link DeployFunctionRequest} - * @returns A Promise of Function + * @param request - The request {@link UpdatePlacementGroupServersRequest} + * @returns A Promise of UpdatePlacementGroupServersResponse */ - deployFunction = request => this.client.fetch({ - body: '{}', - headers: jsonContentHeaders$i, - method: 'POST', - path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/functions/${validatePathParam('functionId', request.functionId)}/deploy` - }, unmarshalFunction); - + updatePlacementGroupServers = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdatePlacementGroupServersRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/placement_groups/${marshalling.validatePathParam("placementGroupId", request.placementGroupId)}/servers` + }, + marshalling_gen.unmarshalUpdatePlacementGroupServersResponse + ); + pageOfListIps = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips`, + urlParams: marshalling.urlParams( + ["name", request.name], + ["organization", request.organization], + ["page", request.page], + ["per_page", request.perPage ?? this.client.settings.defaultPageSize], + ["project", request.project], + [ + "tags", + request.tags && request.tags.length > 0 ? request.tags.join(",") : void 0 + ], + ["type", request.type] + ) + }, + marshalling_gen.unmarshalListIpsResponse + ); /** - * List function runtimes. List available function runtimes. + * List all flexible IPs. List all flexible IPs in a specified zone. * - * @param request - The request {@link ListFunctionRuntimesRequest} - * @returns A Promise of ListFunctionRuntimesResponse + * @param request - The request {@link ListIpsRequest} + * @returns A Promise of ListIpsResponse */ - listFunctionRuntimes = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/runtimes` - }, unmarshalListFunctionRuntimesResponse); - + listIps = (request = {}) => resourcePaginator.enrichForPagination("ips", this.pageOfListIps, request); /** - * Get an upload URL of a function. Get an upload URL of a function associated - * with the specified ID. + * Reserve a flexible IP. Reserve a flexible IP and attach it to the specified + * Instance. * - * @param request - The request {@link GetFunctionUploadURLRequest} - * @returns A Promise of UploadURL + * @param request - The request {@link CreateIpRequest} + * @returns A Promise of CreateIpResponse */ - getFunctionUploadURL = request => this.client.fetch({ - method: 'GET', - path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/functions/${validatePathParam('functionId', request.functionId)}/upload-url`, - urlParams: urlParams(['content_length', request.contentLength]) - }, unmarshalUploadURL); - + createIp = (request = {}) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateIpRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips` + }, + marshalling_gen.unmarshalCreateIpResponse + ); /** - * Get a download URL of a function. Get a download URL for a function - * associated with the specified ID. + * Get a flexible IP. Get details of an IP with the specified ID or address. * - * @param request - The request {@link GetFunctionDownloadURLRequest} - * @returns A Promise of DownloadURL + * @param request - The request {@link GetIpRequest} + * @returns A Promise of GetIpResponse */ - getFunctionDownloadURL = request => this.client.fetch({ - method: 'GET', - path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/functions/${validatePathParam('functionId', request.functionId)}/download-url` - }, unmarshalDownloadURL); - pageOfListCrons = request => this.client.fetch({ - method: 'GET', - path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/crons`, - urlParams: urlParams(['function_id', request.functionId], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]) - }, unmarshalListCronsResponse); - + getIp = (request) => this.client.fetch( + { + method: "GET", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips/${marshalling.validatePathParam("ip", request.ip)}` + }, + marshalling_gen.unmarshalGetIpResponse + ); /** - * List all crons. List all the cronjobs in a specified region. + * Update a flexible IP. Update a flexible IP in the specified zone with the + * specified ID. * - * @param request - The request {@link ListCronsRequest} - * @returns A Promise of ListCronsResponse + * @param request - The request {@link UpdateIpRequest} + * @returns A Promise of UpdateIpResponse */ - listCrons = request => enrichForPagination('crons', this.pageOfListCrons, request); - + updateIp = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateIpRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips/${marshalling.validatePathParam("ip", request.ip)}` + }, + marshalling_gen.unmarshalUpdateIpResponse + ); /** - * Get a cron. Get the cron associated with the specified ID. + * Delete a flexible IP. Delete the IP with the specified ID. * - * @param request - The request {@link GetCronRequest} - * @returns A Promise of Cron + * @param request - The request {@link DeleteIpRequest} */ - getCron = request => this.client.fetch({ - method: 'GET', - path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/crons/${validatePathParam('cronId', request.cronId)}` - }, unmarshalCron); - + deleteIp = (request) => this.client.fetch({ + method: "DELETE", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips/${marshalling.validatePathParam("ip", request.ip)}` + }); + pageOfListPrivateNICs = (request) => this.client.fetch( + { + method: "GET", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/private_nics`, + urlParams: marshalling.urlParams( + ["page", request.page], + ["per_page", request.perPage ?? this.client.settings.defaultPageSize], + [ + "tags", + request.tags && request.tags.length > 0 ? request.tags.join(",") : void 0 + ] + ) + }, + marshalling_gen.unmarshalListPrivateNICsResponse + ); /** - * Waits for {@link Cron} to be in a final state. + * List all private NICs. List all private NICs of a specified Instance. * - * @param request - The request {@link GetCronRequest} - * @param options - The waiting options - * @returns A Promise of Cron + * @param request - The request {@link ListPrivateNICsRequest} + * @returns A Promise of ListPrivateNICsResponse */ - waitForCron = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!CRON_TRANSIENT_STATUSES.includes(res.status))), this.getCron, request, options); - + listPrivateNICs = (request) => resourcePaginator.enrichForPagination("privateNics", this.pageOfListPrivateNICs, request); /** - * Create a new cron. Create a new cronjob for a function with the specified - * ID. + * Create a private NIC connecting an Instance to a Private Network. * - * @param request - The request {@link CreateCronRequest} - * @returns A Promise of Cron + * @param request - The request {@link CreatePrivateNICRequest} + * @returns A Promise of CreatePrivateNICResponse */ - createCron = request => this.client.fetch({ - body: JSON.stringify(marshalCreateCronRequest(request, this.client.settings)), - headers: jsonContentHeaders$i, - method: 'POST', - path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/crons` - }, unmarshalCron); - + createPrivateNIC = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreatePrivateNICRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/private_nics` + }, + marshalling_gen.unmarshalCreatePrivateNICResponse + ); /** - * Update an existing cron. Update the cron associated with the specified ID. + * Get a private NIC. Get private NIC properties. * - * @param request - The request {@link UpdateCronRequest} - * @returns A Promise of Cron + * @param request - The request {@link GetPrivateNICRequest} + * @returns A Promise of GetPrivateNICResponse */ - updateCron = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateCronRequest(request, this.client.settings)), - headers: jsonContentHeaders$i, - method: 'PATCH', - path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/crons/${validatePathParam('cronId', request.cronId)}` - }, unmarshalCron); - + getPrivateNIC = (request) => this.client.fetch( + { + method: "GET", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/private_nics/${marshalling.validatePathParam("privateNicId", request.privateNicId)}` + }, + marshalling_gen.unmarshalGetPrivateNICResponse + ); /** - * Delete an existing cron. Delete the cron associated with the specified ID. + * Update a private NIC. Update one or more parameter(s) of a specified + * private NIC. * - * @param request - The request {@link DeleteCronRequest} - * @returns A Promise of Cron + * @param request - The request {@link UpdatePrivateNICRequest} + * @returns A Promise of PrivateNIC */ - deleteCron = request => this.client.fetch({ - method: 'DELETE', - path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/crons/${validatePathParam('cronId', request.cronId)}` - }, unmarshalCron); - pageOfListLogs = request => this.client.fetch({ - method: 'GET', - path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/functions/${validatePathParam('functionId', request.functionId)}/logs`, - urlParams: urlParams(['order_by', request.orderBy ?? 'timestamp_desc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]) - }, unmarshalListLogsResponse); - + updatePrivateNIC = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdatePrivateNICRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/private_nics/${marshalling.validatePathParam("privateNicId", request.privateNicId)}` + }, + marshalling_gen.unmarshalPrivateNIC + ); /** - * List application logs. List the application logs of the function with the - * specified ID. + * Delete a private NIC. * - * @param request - The request {@link ListLogsRequest} - * @returns A Promise of ListLogsResponse + * @param request - The request {@link DeletePrivateNICRequest} + */ + deletePrivateNIC = (request) => this.client.fetch({ + method: "DELETE", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam("serverId", request.serverId)}/private_nics/${marshalling.validatePathParam("privateNicId", request.privateNicId)}` + }); + pageOfListBootscripts = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/bootscripts`, + urlParams: marshalling.urlParams( + ["arch", request.arch], + ["default", request.default], + ["page", request.page], + ["per_page", request.perPage ?? this.client.settings.defaultPageSize], + ["public", request.public], + ["title", request.title] + ) + }, + marshalling_gen.unmarshalListBootscriptsResponse + ); + /** + * List bootscripts. + * + * @deprecated + * @param request - The request {@link ListBootscriptsRequest} + * @returns A Promise of ListBootscriptsResponse + */ + listBootscripts = (request = {}) => resourcePaginator.enrichForPagination("bootscripts", this.pageOfListBootscripts, request); + /** + * Get bootscripts. Get details of a bootscript with the specified ID. + * + * @deprecated + * @param request - The request {@link GetBootscriptRequest} + * @returns A Promise of GetBootscriptResponse */ - listLogs = request => enrichForPagination('logs', this.pageOfListLogs, request); - pageOfListDomains = request => this.client.fetch({ - method: 'GET', - path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains`, - urlParams: urlParams(['function_id', request.functionId], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]) - }, unmarshalListDomainsResponse$1); + getBootscript = (request) => this.client.fetch( + { + method: "GET", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/bootscripts/${marshalling.validatePathParam("bootscriptId", request.bootscriptId)}` + }, + marshalling_gen.unmarshalGetBootscriptResponse + ); + getDashboard = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/dashboard`, + urlParams: marshalling.urlParams( + ["organization", request.organization], + ["project", request.project] + ) + }, + marshalling_gen.unmarshalGetDashboardResponse + ); + /** + * Get a volume or snapshot's migration plan. Given a volume or snapshot, + * returns the migration plan for a call to the "Apply a migration plan" + * endpoint. This plan will include zero or one volume, and zero or more + * snapshots, which will need to be migrated together. This endpoint does not + * perform the actual migration itself, the "Apply a migration plan" endpoint + * must be used. The validation_key value returned by this endpoint must be + * provided to the call to the "Apply a migration plan" endpoint to confirm + * that all resources listed in the plan should be migrated. + * + * @param request - The request {@link PlanBlockMigrationRequest} + * @returns A Promise of MigrationPlan + */ + planBlockMigration = (request = {}) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalPlanBlockMigrationRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/block-migration/plan` + }, + marshalling_gen.unmarshalMigrationPlan + ); + /** + * Migrate a volume and/or snapshots to SBS (Scaleway Block Storage). To be + * used, the call to this endpoint must be preceded by a call to the "Plan a + * migration" endpoint. To migrate all resources mentioned in the migration + * plan, the validation_key returned in the plan must be provided. + * + * @param request - The request {@link ApplyBlockMigrationRequest} + */ + applyBlockMigration = (request) => this.client.fetch({ + body: JSON.stringify( + marshalling_gen.marshalApplyBlockMigrationRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/instance/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/block-migration/apply` + }); +} +exports.API = API; + + +/***/ }), + +/***/ 8304: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const intervalRetrier = __nccwpck_require__(9052); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const api_gen = __nccwpck_require__(5449); +const content_gen = __nccwpck_require__(934); +const validateNotUndefined = (obj) => { + if (obj === void 0) throw new TypeError(`object was found undefined`); + return obj; +}; +class InstanceV1UtilsAPI extends api_gen.API { /** - * List all domain name bindings. List all domain name bindings in a specified - * region. + * Waits for {@link Image} to be in a final state. * - * @param request - The request {@link ListDomainsRequest} - * @returns A Promise of ListDomainsResponse + * @param request - The request {@link GetImageRequest} + * @param options - The waiting options + * @returns A Promise of Image */ - listDomains = request => enrichForPagination('domains', this.pageOfListDomains, request); - + waitForImage = (request, options) => intervalRetrier.tryAtIntervals( + async () => { + const value = await this.getImage(request).then( + (res) => res.image + ); + return { + done: !content_gen.IMAGE_TRANSIENT_STATUSES.includes(value.state), + value + }; + }, + intervalRetrier.createExponentialBackoffStrategy( + options?.minDelay ?? 1, + options?.maxDelay ?? 30 + ), + options?.timeout + ); /** - * Get a domain name binding. Get a domain name binding for the function with - * the specified ID. + * Waits for {@link PrivateNIC} to be in a final state. * - * @param request - The request {@link GetDomainRequest} - * @returns A Promise of Domain + * @param request - The request {@link GetPrivateNICRequest} + * @param options - The waiting options + * @returns A Promise of PrivateNIC */ - getDomain = request => this.client.fetch({ - method: 'GET', - path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam('domainId', request.domainId)}` - }, unmarshalDomain$1); - + waitForPrivateNIC = (request, options) => intervalRetrier.tryAtIntervals( + async () => { + const value = await this.getPrivateNIC(request).then( + (res) => res.privateNic + ); + return { + done: !content_gen.PRIVATE_NIC_TRANSIENT_STATUSES.includes(value.state), + value + }; + }, + intervalRetrier.createExponentialBackoffStrategy( + options?.minDelay ?? 1, + options?.maxDelay ?? 30 + ), + options?.timeout + ); /** - * Waits for {@link Domain} to be in a final state. + * Waits for {@link Server} to be in a final state. * - * @param request - The request {@link GetDomainRequest} + * @param request - The request {@link GetServerRequest} * @param options - The waiting options - * @returns A Promise of Domain + * @returns A Promise of Server */ - waitForDomain = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!DOMAIN_TRANSIENT_STATUSES$1.includes(res.status))), this.getDomain, request, options); - + waitForServer = (request, options) => intervalRetrier.tryAtIntervals( + async () => { + const value = await this.getServer(request).then( + (res) => res.server + ); + return { + done: !content_gen.SERVER_TRANSIENT_STATUSES.includes(value.state), + value + }; + }, + intervalRetrier.createExponentialBackoffStrategy( + options?.minDelay ?? 1, + options?.maxDelay ?? 30 + ), + options?.timeout + ); /** - * Create a domain name binding. Create a domain name binding for the function - * with the specified ID. + * Waits for {@link Server} to be in a final state. * - * @param request - The request {@link CreateDomainRequest} - * @returns A Promise of Domain + * @param request - The request {@link GetServerRequest} + * @param options - The waiting options + * @returns A Promise of Server */ - createDomain = request => this.client.fetch({ - body: JSON.stringify(marshalCreateDomainRequest$1(request, this.client.settings)), - headers: jsonContentHeaders$i, - method: 'POST', - path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains` - }, unmarshalDomain$1); - + waitForSnapshot = (request, options) => intervalRetrier.tryAtIntervals( + async () => { + const value = await this.getSnapshot(request).then( + (res) => res.snapshot + ); + return { + done: !content_gen.SNAPSHOT_TRANSIENT_STATUSES.includes(value.state), + value + }; + }, + intervalRetrier.createExponentialBackoffStrategy( + options?.minDelay ?? 1, + options?.maxDelay ?? 30 + ), + options?.timeout + ); /** - * Delete a domain name binding. Delete a domain name binding for the function - * with the specified ID. + * Waits for {@link Volume} to be in a final state. * - * @param request - The request {@link DeleteDomainRequest} - * @returns A Promise of Domain + * @param request - The request {@link GetVolumeRequest} + * @param options - The waiting options + * @returns A Promise of Volume */ - deleteDomain = request => this.client.fetch({ - method: 'DELETE', - path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam('domainId', request.domainId)}` - }, unmarshalDomain$1); - + waitForVolume = (request, options) => intervalRetrier.tryAtIntervals( + async () => { + const value = await this.getVolume(request).then( + (res) => res.volume + ); + return { + done: !content_gen.VOLUME_TRANSIENT_STATUSES.includes(value.state), + value + }; + }, + intervalRetrier.createExponentialBackoffStrategy( + options?.minDelay ?? 1, + options?.maxDelay ?? 30 + ), + options?.timeout + ); /** - * @deprecated - * @param request - The request {@link IssueJWTRequest} - * @returns A Promise of Token + * Updates a server. + * + * @param request - The request {@link UpdateServerRequest} + * @returns A Promise of UpdateServerResponse */ - issueJWT = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/issue-jwt`, - urlParams: urlParams(['expires_at', request.expiresAt], ...Object.entries(resolveOneOf([{ - param: 'function_id', - value: request.functionId - }, { - param: 'namespace_id', - value: request.namespaceId - }]))) - }, unmarshalToken); - + updateServer = (request) => this._updateServer(request); /** - * Create a new revocable token. + * Creates a server. * - * @param request - The request {@link CreateTokenRequest} - * @returns A Promise of Token + * @param request - The request {@link CreateServerRequest} + * @returns A Promise of CreateServerResponse */ - createToken = (request = {}) => this.client.fetch({ - body: JSON.stringify(marshalCreateTokenRequest(request, this.client.settings)), - headers: jsonContentHeaders$i, - method: 'POST', - path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/tokens` - }, unmarshalToken); - + createServer = (request) => this._createServer(request); /** - * Get a token. + * Starts an action and wait for the server to be in the correct "terminal + * state" expected by this action. * - * @param request - The request {@link GetTokenRequest} - * @returns A Promise of Token + * @param request - The request {@link ServerActionRequest} + * @returns A Promise of Server */ - getToken = request => this.client.fetch({ - method: 'GET', - path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/tokens/${validatePathParam('tokenId', request.tokenId)}` - }, unmarshalToken); - + serverActionAndWait = async (request, options) => { + const finalServer = await this.serverAction(request).then( + () => this.waitForServer( + { + serverId: request.serverId, + zone: request.zone + }, + options + ) + ); + let expectedState; + switch (request.action) { + case "poweron": + case "reboot": + expectedState = "running"; + break; + case "poweroff": + expectedState = "stopped"; + break; + case "stop_in_place": + expectedState = "stopped in place"; + break; + } + if (expectedState && finalServer.state !== expectedState) { + throw new Error( + `expected state ${expectedState} but found ${finalServer.state}: ${finalServer.stateDetail}` + ); + } + return finalServer; + }; /** - * Waits for {@link Token} to be in a final state. + * Attaches a volume to a server. * - * @param request - The request {@link GetTokenRequest} - * @param options - The waiting options - * @returns A Promise of Token + * @param request - The request {@link AttachVolumeRequest} + * @returns A Promise of AttachVolumeResponse */ - waitForToken = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!TOKEN_TRANSIENT_STATUSES.includes(res.status))), this.getToken, request, options); - pageOfListTokens = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/tokens`, - urlParams: urlParams(['function_id', request.functionId], ['namespace_id', request.namespaceId], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]) - }, unmarshalListTokensResponse); - + attachVolume = async (request) => { + const volumes = await this.getServer({ + serverId: request.serverId, + zone: request.zone + }).then((res) => validateNotUndefined(res.server?.volumes)); + const newVolumes = {}; + for (const [key, server] of Object.entries(volumes)) { + newVolumes[key] = { id: server.id, name: server.name }; + } + let found = false; + const volumesLength = Object.keys(volumes).length; + for (let index = 0; index <= volumesLength; index += 1) { + const key = index.toString(); + if (!(key in newVolumes)) { + newVolumes[key] = { + id: request.volumeId, + name: request.volumeId + // name is ignored on this PATCH + }; + found = true; + break; + } + } + if (!found) { + throw new Error(`could not find key to attach volume ${request.volumeId}`); + } + return this.updateServer({ + serverId: request.serverId, + volumes: newVolumes, + zone: request.zone + }).then((obj) => obj); + }; /** - * List all tokens. + * Detaches a volume from a server. * - * @param request - The request {@link ListTokensRequest} - * @returns A Promise of ListTokensResponse + * @param request - The request {@link DetachVolumeRequest} + * @returns A Promise of DetachVolumeResponse */ - listTokens = (request = {}) => enrichForPagination('tokens', this.pageOfListTokens, request); - + detachVolume = async (request) => { + const server = await this.getVolume({ + volumeId: request.volumeId, + zone: request.zone + }).then((res) => validateNotUndefined(res.volume?.server?.id)).then( + (serverId) => this.getServer({ + serverId, + zone: request.zone + }) + ).then((res) => validateNotUndefined(res.server)); + const newVolumes = {}; + for (const [key, volume] of Object.entries(server.volumes)) { + if (volume.id !== request.volumeId) { + newVolumes[key] = { id: volume.id, name: volume.name }; + } + } + return this.updateServer({ + serverId: server.id, + volumes: newVolumes, + zone: request.zone + }).then((obj) => obj); + }; /** - * Delete a token. + * Get the content of a user data on a server for the given key. * - * @param request - The request {@link DeleteTokenRequest} - * @returns A Promise of Token + * @param request - The request {@link GetServerUserDataRequest} + * @returns The content of the key */ - deleteToken = request => this.client.fetch({ - method: 'DELETE', - path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/tokens/${validatePathParam('tokenId', request.tokenId)}` - }, unmarshalToken); - createTrigger = request => this.client.fetch({ - body: JSON.stringify(marshalCreateTriggerRequest(request, this.client.settings)), - headers: jsonContentHeaders$i, - method: 'POST', - path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/triggers` - }, unmarshalTrigger); - getTrigger = request => this.client.fetch({ - method: 'GET', - path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/triggers/${validatePathParam('triggerId', request.triggerId)}` - }, unmarshalTrigger); - + getServerUserData = (request) => this.client.fetch({ + method: "GET", + path: `/instance/v1/zones/${marshalling.validatePathParam( + "zone", + request.zone ?? this.client.settings.defaultZone + )}/servers/${marshalling.validatePathParam( + "serverId", + request.serverId + )}/user_data/${marshalling.validatePathParam("key", request.key)}` + }); /** - * Waits for {@link Trigger} to be in a final state. + * Sets the content of a user data on a server for the given key. * - * @param request - The request {@link GetTriggerRequest} - * @param options - The waiting options - * @returns A Promise of Trigger + * @param request - The request {@link SetServerUserDataRequest} */ - waitForTrigger = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!TRIGGER_TRANSIENT_STATUSES.includes(res.status))), this.getTrigger, request, options); - pageOfListTriggers = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/triggers`, - urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ...Object.entries(resolveOneOf([{ - default: this.client.settings.defaultProjectId, - param: 'project_id', - value: request.projectId - }, { - param: 'function_id', - value: request.functionId - }, { - param: 'namespace_id', - value: request.namespaceId - }]))) - }, unmarshalListTriggersResponse); - listTriggers = (request = {}) => enrichForPagination('triggers', this.pageOfListTriggers, request); - updateTrigger = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateTriggerRequest(request, this.client.settings)), - headers: jsonContentHeaders$i, - method: 'PATCH', - path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/triggers/${validatePathParam('triggerId', request.triggerId)}` - }, unmarshalTrigger); - deleteTrigger = request => this.client.fetch({ - method: 'DELETE', - path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/triggers/${validatePathParam('triggerId', request.triggerId)}` - }, unmarshalTrigger); -}; - -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. - -var index_gen$h = /*#__PURE__*/Object.freeze({ - __proto__: null, - API: API$j, - CRON_TRANSIENT_STATUSES: CRON_TRANSIENT_STATUSES, - DOMAIN_TRANSIENT_STATUSES: DOMAIN_TRANSIENT_STATUSES$1, - FUNCTION_TRANSIENT_STATUSES: FUNCTION_TRANSIENT_STATUSES, - NAMESPACE_TRANSIENT_STATUSES: NAMESPACE_TRANSIENT_STATUSES$1, - TOKEN_TRANSIENT_STATUSES: TOKEN_TRANSIENT_STATUSES, - TRIGGER_TRANSIENT_STATUSES: TRIGGER_TRANSIENT_STATUSES -}); - -var index$k = /*#__PURE__*/Object.freeze({ - __proto__: null, - v1beta1: index_gen$h -}); - -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const unmarshalAPIKey = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'APIKey' failed as data isn't a dictionary.`); + setServerUserData = (request) => this.client.fetch({ + body: request.content, + headers: { "Content-Type": "text/plain" }, + method: "PATCH", + path: `/instance/v1/zones/${marshalling.validatePathParam( + "zone", + request.zone ?? this.client.settings.defaultZone + )}/servers/${marshalling.validatePathParam( + "serverId", + request.serverId + )}/user_data/${marshalling.validatePathParam("key", request.key)}` + }); +} +exports.InstanceV1UtilsAPI = InstanceV1UtilsAPI; + + +/***/ }), + +/***/ 934: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const IMAGE_TRANSIENT_STATUSES = ["creating"]; +const IP_TRANSIENT_STATUSES = ["pending"]; +const PRIVATE_NIC_TRANSIENT_STATUSES = ["syncing"]; +const SECURITY_GROUP_TRANSIENT_STATUSES = [ + "syncing" +]; +const SERVER_IP_TRANSIENT_STATUSES = ["pending"]; +const SERVER_TRANSIENT_STATUSES = ["starting", "stopping"]; +const SNAPSHOT_TRANSIENT_STATUSES = [ + "snapshotting", + "importing", + "exporting" +]; +const TASK_TRANSIENT_STATUSES = [ + "pending", + "started", + "retry" +]; +const VOLUME_SERVER_TRANSIENT_STATUSES = [ + "snapshotting", + "fetching", + "resizing", + "saving", + "hotsyncing" +]; +const VOLUME_TRANSIENT_STATUSES = [ + "snapshotting", + "fetching", + "resizing", + "saving", + "hotsyncing" +]; +exports.IMAGE_TRANSIENT_STATUSES = IMAGE_TRANSIENT_STATUSES; +exports.IP_TRANSIENT_STATUSES = IP_TRANSIENT_STATUSES; +exports.PRIVATE_NIC_TRANSIENT_STATUSES = PRIVATE_NIC_TRANSIENT_STATUSES; +exports.SECURITY_GROUP_TRANSIENT_STATUSES = SECURITY_GROUP_TRANSIENT_STATUSES; +exports.SERVER_IP_TRANSIENT_STATUSES = SERVER_IP_TRANSIENT_STATUSES; +exports.SERVER_TRANSIENT_STATUSES = SERVER_TRANSIENT_STATUSES; +exports.SNAPSHOT_TRANSIENT_STATUSES = SNAPSHOT_TRANSIENT_STATUSES; +exports.TASK_TRANSIENT_STATUSES = TASK_TRANSIENT_STATUSES; +exports.VOLUME_SERVER_TRANSIENT_STATUSES = VOLUME_SERVER_TRANSIENT_STATUSES; +exports.VOLUME_TRANSIENT_STATUSES = VOLUME_TRANSIENT_STATUSES; + + +/***/ }), + +/***/ 9653: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api_utils = __nccwpck_require__(8304); +const content_gen = __nccwpck_require__(934); +exports.API = api_utils.InstanceV1UtilsAPI; +exports.IMAGE_TRANSIENT_STATUSES = content_gen.IMAGE_TRANSIENT_STATUSES; +exports.IP_TRANSIENT_STATUSES = content_gen.IP_TRANSIENT_STATUSES; +exports.PRIVATE_NIC_TRANSIENT_STATUSES = content_gen.PRIVATE_NIC_TRANSIENT_STATUSES; +exports.SECURITY_GROUP_TRANSIENT_STATUSES = content_gen.SECURITY_GROUP_TRANSIENT_STATUSES; +exports.SERVER_IP_TRANSIENT_STATUSES = content_gen.SERVER_IP_TRANSIENT_STATUSES; +exports.SERVER_TRANSIENT_STATUSES = content_gen.SERVER_TRANSIENT_STATUSES; +exports.SNAPSHOT_TRANSIENT_STATUSES = content_gen.SNAPSHOT_TRANSIENT_STATUSES; +exports.TASK_TRANSIENT_STATUSES = content_gen.TASK_TRANSIENT_STATUSES; +exports.VOLUME_SERVER_TRANSIENT_STATUSES = content_gen.VOLUME_SERVER_TRANSIENT_STATUSES; +exports.VOLUME_TRANSIENT_STATUSES = content_gen.VOLUME_TRANSIENT_STATUSES; + + +/***/ }), + +/***/ 6847: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const randomName = __nccwpck_require__(8141); +const json = __nccwpck_require__(3746); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const unmarshalPrivateNIC = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'PrivateNIC' failed as data isn't a dictionary.` + ); + } + return { + id: data.id, + macAddress: data.mac_address, + privateNetworkId: data.private_network_id, + serverId: data.server_id, + state: data.state, + tags: data.tags + }; +}; +const unmarshalServerSummary = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ServerSummary' failed as data isn't a dictionary.` + ); + } + return { + id: data.id, + name: data.name + }; +}; +const unmarshalBootscript = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Bootscript' failed as data isn't a dictionary.` + ); + } + return { + architecture: data.architecture, + bootcmdargs: data.bootcmdargs, + default: data.default, + dtb: data.dtb, + id: data.id, + initrd: data.initrd, + kernel: data.kernel, + organization: data.organization, + project: data.project, + public: data.public, + title: data.title, + zone: data.zone + }; +}; +const unmarshalVolume = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Volume' failed as data isn't a dictionary.` + ); + } + return { + creationDate: marshalling.unmarshalDate(data.creation_date), + exportUri: data.export_uri, + id: data.id, + modificationDate: marshalling.unmarshalDate(data.modification_date), + name: data.name, + organization: data.organization, + project: data.project, + server: data.server ? unmarshalServerSummary(data.server) : void 0, + size: data.size, + state: data.state, + tags: data.tags, + volumeType: data.volume_type, + zone: data.zone + }; +}; +const unmarshalVolumeSummary = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'VolumeSummary' failed as data isn't a dictionary.` + ); + } + return { + id: data.id, + name: data.name, + size: data.size, + volumeType: data.volume_type + }; +}; +const unmarshalImage = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Image' failed as data isn't a dictionary.` + ); + } + return { + arch: data.arch, + creationDate: marshalling.unmarshalDate(data.creation_date), + defaultBootscript: data.default_bootscript ? unmarshalBootscript(data.default_bootscript) : void 0, + extraVolumes: marshalling.unmarshalMapOfObject(data.extra_volumes, unmarshalVolume), + fromServer: data.from_server, + id: data.id, + modificationDate: marshalling.unmarshalDate(data.modification_date), + name: data.name, + organization: data.organization, + project: data.project, + public: data.public, + rootVolume: data.root_volume ? unmarshalVolumeSummary(data.root_volume) : void 0, + state: data.state, + tags: data.tags, + zone: data.zone + }; +}; +const unmarshalPlacementGroup = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'PlacementGroup' failed as data isn't a dictionary.` + ); + } + return { + id: data.id, + name: data.name, + organization: data.organization, + policyMode: data.policy_mode, + policyRespected: data.policy_respected, + policyType: data.policy_type, + project: data.project, + tags: data.tags, + zone: data.zone + }; +}; +const unmarshalSecurityGroupSummary = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SecurityGroupSummary' failed as data isn't a dictionary.` + ); } return { - accessKey: data.access_key, - applicationId: data.application_id, - createdAt: unmarshalDate(data.created_at), - creationIp: data.creation_ip, - defaultProjectId: data.default_project_id, + id: data.id, + name: data.name + }; +}; +const unmarshalServerIp = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ServerIp' failed as data isn't a dictionary.` + ); + } + return { + address: data.address, + dynamic: data.dynamic, + family: data.family, + gateway: data.gateway, + id: data.id, + ipamId: data.ipam_id, + netmask: data.netmask, + provisioningMode: data.provisioning_mode, + state: data.state, + tags: data.tags + }; +}; +const unmarshalServerIpv6 = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ServerIpv6' failed as data isn't a dictionary.` + ); + } + return { + address: data.address, + gateway: data.gateway, + netmask: data.netmask + }; +}; +const unmarshalServerLocation = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ServerLocation' failed as data isn't a dictionary.` + ); + } + return { + clusterId: data.cluster_id, + hypervisorId: data.hypervisor_id, + nodeId: data.node_id, + platformId: data.platform_id, + zoneId: data.zone_id + }; +}; +const unmarshalServerMaintenance = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ServerMaintenance' failed as data isn't a dictionary.` + ); + } + return { + reason: data.reason, + startDate: marshalling.unmarshalDate(data.start_date) + }; +}; +const unmarshalVolumeServer = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'VolumeServer' failed as data isn't a dictionary.` + ); + } + return { + boot: data.boot, + creationDate: marshalling.unmarshalDate(data.creation_date), + exportUri: data.export_uri, + id: data.id, + modificationDate: marshalling.unmarshalDate(data.modification_date), + name: data.name, + organization: data.organization, + project: data.project, + server: data.server ? unmarshalServerSummary(data.server) : void 0, + size: data.size, + state: data.state, + volumeType: data.volume_type, + zone: data.zone + }; +}; +const unmarshalServer = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Server' failed as data isn't a dictionary.` + ); + } + return { + adminPasswordEncryptedValue: data.admin_password_encrypted_value, + adminPasswordEncryptionSshKeyId: data.admin_password_encryption_ssh_key_id, + allowedActions: data.allowed_actions, + arch: data.arch, + bootType: data.boot_type, + bootscript: data.bootscript ? unmarshalBootscript(data.bootscript) : void 0, + commercialType: data.commercial_type, + creationDate: marshalling.unmarshalDate(data.creation_date), + dynamicIpRequired: data.dynamic_ip_required, + enableIpv6: data.enable_ipv6, + hostname: data.hostname, + id: data.id, + image: data.image ? unmarshalImage(data.image) : void 0, + ipv6: data.ipv6 ? unmarshalServerIpv6(data.ipv6) : void 0, + location: data.location ? unmarshalServerLocation(data.location) : void 0, + macAddress: data.mac_address, + maintenances: marshalling.unmarshalArrayOfObject( + data.maintenances, + unmarshalServerMaintenance + ), + modificationDate: marshalling.unmarshalDate(data.modification_date), + name: data.name, + organization: data.organization, + placementGroup: data.placement_group ? unmarshalPlacementGroup(data.placement_group) : void 0, + privateIp: data.private_ip, + privateNics: marshalling.unmarshalArrayOfObject(data.private_nics, unmarshalPrivateNIC), + project: data.project, + protected: data.protected, + publicIp: data.public_ip ? unmarshalServerIp(data.public_ip) : void 0, + publicIps: marshalling.unmarshalArrayOfObject(data.public_ips, unmarshalServerIp), + routedIpEnabled: data.routed_ip_enabled, + securityGroup: data.security_group ? unmarshalSecurityGroupSummary(data.security_group) : void 0, + state: data.state, + stateDetail: data.state_detail, + tags: data.tags, + volumes: marshalling.unmarshalMapOfObject(data.volumes, unmarshalVolumeServer), + zone: data.zone + }; +}; +const unmarshalAttachServerVolumeResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'AttachServerVolumeResponse' failed as data isn't a dictionary.` + ); + } + return { + server: data.server ? unmarshalServer(data.server) : void 0 + }; +}; +const unmarshalCreateImageResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'CreateImageResponse' failed as data isn't a dictionary.` + ); + } + return { + image: data.image ? unmarshalImage(data.image) : void 0 + }; +}; +const unmarshalIp = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Ip' failed as data isn't a dictionary.` + ); + } + return { + address: data.address, + id: data.id, + ipamId: data.ipam_id, + organization: data.organization, + prefix: data.prefix, + project: data.project, + reverse: data.reverse, + server: data.server ? unmarshalServerSummary(data.server) : void 0, + state: data.state, + tags: data.tags, + type: data.type, + zone: data.zone + }; +}; +const unmarshalCreateIpResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'CreateIpResponse' failed as data isn't a dictionary.` + ); + } + return { + ip: data.ip ? unmarshalIp(data.ip) : void 0 + }; +}; +const unmarshalCreatePlacementGroupResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'CreatePlacementGroupResponse' failed as data isn't a dictionary.` + ); + } + return { + placementGroup: data.placement_group ? unmarshalPlacementGroup(data.placement_group) : void 0 + }; +}; +const unmarshalCreatePrivateNICResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'CreatePrivateNICResponse' failed as data isn't a dictionary.` + ); + } + return { + privateNic: data.private_nic ? unmarshalPrivateNIC(data.private_nic) : void 0 + }; +}; +const unmarshalSecurityGroup = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SecurityGroup' failed as data isn't a dictionary.` + ); + } + return { + creationDate: marshalling.unmarshalDate(data.creation_date), description: data.description, + enableDefaultSecurity: data.enable_default_security, + id: data.id, + inboundDefaultPolicy: data.inbound_default_policy, + modificationDate: marshalling.unmarshalDate(data.modification_date), + name: data.name, + organization: data.organization, + organizationDefault: data.organization_default, + outboundDefaultPolicy: data.outbound_default_policy, + project: data.project, + projectDefault: data.project_default, + servers: marshalling.unmarshalArrayOfObject(data.servers, unmarshalServerSummary), + state: data.state, + stateful: data.stateful, + tags: data.tags, + zone: data.zone + }; +}; +const unmarshalCreateSecurityGroupResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'CreateSecurityGroupResponse' failed as data isn't a dictionary.` + ); + } + return { + securityGroup: data.security_group ? unmarshalSecurityGroup(data.security_group) : void 0 + }; +}; +const unmarshalSecurityGroupRule = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SecurityGroupRule' failed as data isn't a dictionary.` + ); + } + return { + action: data.action, + destPortFrom: data.dest_port_from, + destPortTo: data.dest_port_to, + direction: data.direction, editable: data.editable, - expiresAt: unmarshalDate(data.expires_at), - secretKey: data.secret_key, - updatedAt: unmarshalDate(data.updated_at), - userId: data.user_id + id: data.id, + ipRange: data.ip_range, + position: data.position, + protocol: data.protocol, + zone: data.zone + }; +}; +const unmarshalCreateSecurityGroupRuleResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'CreateSecurityGroupRuleResponse' failed as data isn't a dictionary.` + ); + } + return { + rule: data.rule ? unmarshalSecurityGroupRule(data.rule) : void 0 + }; +}; +const unmarshalCreateServerResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'CreateServerResponse' failed as data isn't a dictionary.` + ); + } + return { + server: data.server ? unmarshalServer(data.server) : void 0 + }; +}; +const unmarshalSnapshotBaseVolume = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SnapshotBaseVolume' failed as data isn't a dictionary.` + ); + } + return { + id: data.id, + name: data.name + }; +}; +const unmarshalSnapshot = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Snapshot' failed as data isn't a dictionary.` + ); + } + return { + baseVolume: data.base_volume ? unmarshalSnapshotBaseVolume(data.base_volume) : void 0, + creationDate: marshalling.unmarshalDate(data.creation_date), + errorReason: data.error_reason, + id: data.id, + modificationDate: marshalling.unmarshalDate(data.modification_date), + name: data.name, + organization: data.organization, + project: data.project, + size: data.size, + state: data.state, + tags: data.tags, + volumeType: data.volume_type, + zone: data.zone + }; +}; +const unmarshalTask = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Task' failed as data isn't a dictionary.` + ); + } + return { + description: data.description, + hrefFrom: data.href_from, + hrefResult: data.href_result, + id: data.id, + progress: data.progress, + startedAt: marshalling.unmarshalDate(data.started_at), + status: data.status, + terminatedAt: marshalling.unmarshalDate(data.terminated_at), + zone: data.zone + }; +}; +const unmarshalCreateSnapshotResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'CreateSnapshotResponse' failed as data isn't a dictionary.` + ); + } + return { + snapshot: data.snapshot ? unmarshalSnapshot(data.snapshot) : void 0, + task: data.task ? unmarshalTask(data.task) : void 0 + }; +}; +const unmarshalCreateVolumeResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'CreateVolumeResponse' failed as data isn't a dictionary.` + ); + } + return { + volume: data.volume ? unmarshalVolume(data.volume) : void 0 + }; +}; +const unmarshalDetachServerVolumeResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DetachServerVolumeResponse' failed as data isn't a dictionary.` + ); + } + return { + server: data.server ? unmarshalServer(data.server) : void 0 + }; +}; +const unmarshalExportSnapshotResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ExportSnapshotResponse' failed as data isn't a dictionary.` + ); + } + return { + task: data.task ? unmarshalTask(data.task) : void 0 + }; +}; +const unmarshalGetBootscriptResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'GetBootscriptResponse' failed as data isn't a dictionary.` + ); + } + return { + bootscript: data.bootscript ? unmarshalBootscript(data.bootscript) : void 0 + }; +}; +const unmarshalDashboard = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Dashboard' failed as data isn't a dictionary.` + ); + } + return { + imagesCount: data.images_count, + ipsCount: data.ips_count, + ipsUnused: data.ips_unused, + placementGroupsCount: data.placement_groups_count, + privateNicsCount: data.private_nics_count, + runningServersCount: data.running_servers_count, + securityGroupsCount: data.security_groups_count, + serversByTypes: data.servers_by_types, + serversCount: data.servers_count, + snapshotsCount: data.snapshots_count, + volumesBSsdCount: data.volumes_b_ssd_count, + volumesBSsdTotalSize: data.volumes_b_ssd_total_size, + volumesCount: data.volumes_count, + volumesLSsdCount: data.volumes_l_ssd_count, + volumesLSsdTotalSize: data.volumes_l_ssd_total_size + }; +}; +const unmarshalGetDashboardResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'GetDashboardResponse' failed as data isn't a dictionary.` + ); + } + return { + dashboard: data.dashboard ? unmarshalDashboard(data.dashboard) : void 0 + }; +}; +const unmarshalGetImageResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'GetImageResponse' failed as data isn't a dictionary.` + ); + } + return { + image: data.image ? unmarshalImage(data.image) : void 0 + }; +}; +const unmarshalGetIpResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'GetIpResponse' failed as data isn't a dictionary.` + ); + } + return { + ip: data.ip ? unmarshalIp(data.ip) : void 0 + }; +}; +const unmarshalGetPlacementGroupResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'GetPlacementGroupResponse' failed as data isn't a dictionary.` + ); + } + return { + placementGroup: data.placement_group ? unmarshalPlacementGroup(data.placement_group) : void 0 + }; +}; +const unmarshalPlacementGroupServer = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'PlacementGroupServer' failed as data isn't a dictionary.` + ); + } + return { + id: data.id, + name: data.name, + policyRespected: data.policy_respected + }; +}; +const unmarshalGetPlacementGroupServersResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'GetPlacementGroupServersResponse' failed as data isn't a dictionary.` + ); + } + return { + servers: marshalling.unmarshalArrayOfObject( + data.servers, + unmarshalPlacementGroupServer + ) }; }; -const unmarshalApplication = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Application' failed as data isn't a dictionary.`); +const unmarshalGetPrivateNICResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'GetPrivateNICResponse' failed as data isn't a dictionary.` + ); } return { - createdAt: unmarshalDate(data.created_at), - description: data.description, - editable: data.editable, - id: data.id, - name: data.name, - nbApiKeys: data.nb_api_keys, - organizationId: data.organization_id, - updatedAt: unmarshalDate(data.updated_at) + privateNic: data.private_nic ? unmarshalPrivateNIC(data.private_nic) : void 0 }; }; -const unmarshalGroup = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Group' failed as data isn't a dictionary.`); +const unmarshalGetSecurityGroupResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'GetSecurityGroupResponse' failed as data isn't a dictionary.` + ); } return { - applicationIds: data.application_ids, - createdAt: unmarshalDate(data.created_at), - description: data.description, - id: data.id, - name: data.name, - organizationId: data.organization_id, - updatedAt: unmarshalDate(data.updated_at), - userIds: data.user_ids + securityGroup: data.security_group ? unmarshalSecurityGroup(data.security_group) : void 0 }; }; -const unmarshalJWT = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'JWT' failed as data isn't a dictionary.`); +const unmarshalGetSecurityGroupRuleResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'GetSecurityGroupRuleResponse' failed as data isn't a dictionary.` + ); } return { - audienceId: data.audience_id, - createdAt: unmarshalDate(data.created_at), - expiresAt: unmarshalDate(data.expires_at), - ip: data.ip, - issuerId: data.issuer_id, - jti: data.jti, - updatedAt: unmarshalDate(data.updated_at), - userAgent: data.user_agent + rule: data.rule ? unmarshalSecurityGroupRule(data.rule) : void 0 }; }; -const unmarshalPermissionSet = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'PermissionSet' failed as data isn't a dictionary.`); +const unmarshalGetServerResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'GetServerResponse' failed as data isn't a dictionary.` + ); } return { - categories: data.categories, - description: data.description, - id: data.id, - name: data.name, - scopeType: data.scope_type + server: data.server ? unmarshalServer(data.server) : void 0 }; }; -const unmarshalPolicy = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Policy' failed as data isn't a dictionary.`); +const unmarshalGetServerTypesAvailabilityResponseAvailability = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'GetServerTypesAvailabilityResponseAvailability' failed as data isn't a dictionary.` + ); } return { - applicationId: data.application_id, - createdAt: unmarshalDate(data.created_at), - description: data.description, - editable: data.editable, - groupId: data.group_id, - id: data.id, - name: data.name, - nbPermissionSets: data.nb_permission_sets, - nbRules: data.nb_rules, - nbScopes: data.nb_scopes, - noPrincipal: data.no_principal, - organizationId: data.organization_id, - updatedAt: unmarshalDate(data.updated_at), - userId: data.user_id + availability: data.availability }; }; -const unmarshalQuotum = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Quotum' failed as data isn't a dictionary.`); +const unmarshalGetServerTypesAvailabilityResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'GetServerTypesAvailabilityResponse' failed as data isn't a dictionary.` + ); } return { - limit: data.limit, - name: data.name, - unlimited: data.unlimited + servers: marshalling.unmarshalMapOfObject( + data.servers, + unmarshalGetServerTypesAvailabilityResponseAvailability + ), + totalCount: data.total_count }; }; -const unmarshalRule = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Rule' failed as data isn't a dictionary.`); +const unmarshalGetSnapshotResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'GetSnapshotResponse' failed as data isn't a dictionary.` + ); } return { - accountRootUserId: data.account_root_user_id, - id: data.id, - organizationId: data.organization_id, - permissionSetNames: data.permission_set_names, - permissionSetsScopeType: data.permission_sets_scope_type, - projectIds: data.project_ids + snapshot: data.snapshot ? unmarshalSnapshot(data.snapshot) : void 0 }; }; -const unmarshalSSHKey = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'SSHKey' failed as data isn't a dictionary.`); +const unmarshalGetVolumeResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'GetVolumeResponse' failed as data isn't a dictionary.` + ); } return { - createdAt: unmarshalDate(data.created_at), - disabled: data.disabled, - fingerprint: data.fingerprint, - id: data.id, - name: data.name, - organizationId: data.organization_id, - projectId: data.project_id, - publicKey: data.public_key, - updatedAt: unmarshalDate(data.updated_at) + volume: data.volume ? unmarshalVolume(data.volume) : void 0 }; }; -const unmarshalUser$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'User' failed as data isn't a dictionary.`); +const unmarshalListBootscriptsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListBootscriptsResponse' failed as data isn't a dictionary.` + ); } return { - accountRootUserId: data.account_root_user_id, - createdAt: unmarshalDate(data.created_at), - deletable: data.deletable, - email: data.email, - id: data.id, - lastLoginAt: unmarshalDate(data.last_login_at), - mfa: data.mfa, - organizationId: data.organization_id, - status: data.status, - twoFactorEnabled: data.two_factor_enabled, - type: data.type, - updatedAt: unmarshalDate(data.updated_at) + bootscripts: marshalling.unmarshalArrayOfObject(data.bootscripts, unmarshalBootscript), + totalCount: data.total_count }; }; -const unmarshalListAPIKeysResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListAPIKeysResponse' failed as data isn't a dictionary.`); +const unmarshalListImagesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListImagesResponse' failed as data isn't a dictionary.` + ); } return { - apiKeys: unmarshalArrayOfObject(data.api_keys, unmarshalAPIKey), + images: marshalling.unmarshalArrayOfObject(data.images, unmarshalImage), totalCount: data.total_count }; }; -const unmarshalListApplicationsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListApplicationsResponse' failed as data isn't a dictionary.`); +const unmarshalListIpsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListIpsResponse' failed as data isn't a dictionary.` + ); } return { - applications: unmarshalArrayOfObject(data.applications, unmarshalApplication), + ips: marshalling.unmarshalArrayOfObject(data.ips, unmarshalIp), totalCount: data.total_count }; }; -const unmarshalListGroupsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListGroupsResponse' failed as data isn't a dictionary.`); +const unmarshalListPlacementGroupsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListPlacementGroupsResponse' failed as data isn't a dictionary.` + ); } return { - groups: unmarshalArrayOfObject(data.groups, unmarshalGroup), + placementGroups: marshalling.unmarshalArrayOfObject( + data.placement_groups, + unmarshalPlacementGroup + ), totalCount: data.total_count }; }; -const unmarshalListJWTsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListJWTsResponse' failed as data isn't a dictionary.`); +const unmarshalListPrivateNICsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListPrivateNICsResponse' failed as data isn't a dictionary.` + ); } return { - jwts: unmarshalArrayOfObject(data.jwts, unmarshalJWT), + privateNics: marshalling.unmarshalArrayOfObject(data.private_nics, unmarshalPrivateNIC), totalCount: data.total_count }; }; -const unmarshalListPermissionSetsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListPermissionSetsResponse' failed as data isn't a dictionary.`); +const unmarshalListSecurityGroupRulesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListSecurityGroupRulesResponse' failed as data isn't a dictionary.` + ); } return { - permissionSets: unmarshalArrayOfObject(data.permission_sets, unmarshalPermissionSet), + rules: marshalling.unmarshalArrayOfObject(data.rules, unmarshalSecurityGroupRule), totalCount: data.total_count }; }; -const unmarshalListPoliciesResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListPoliciesResponse' failed as data isn't a dictionary.`); +const unmarshalListSecurityGroupsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListSecurityGroupsResponse' failed as data isn't a dictionary.` + ); } return { - policies: unmarshalArrayOfObject(data.policies, unmarshalPolicy), + securityGroups: marshalling.unmarshalArrayOfObject( + data.security_groups, + unmarshalSecurityGroup + ), totalCount: data.total_count }; }; -const unmarshalListQuotaResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListQuotaResponse' failed as data isn't a dictionary.`); +const unmarshalListServerActionsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListServerActionsResponse' failed as data isn't a dictionary.` + ); + } + return { + actions: data.actions + }; +}; +const unmarshalListServerUserDataResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListServerUserDataResponse' failed as data isn't a dictionary.` + ); + } + return { + userData: data.user_data + }; +}; +const unmarshalListServersResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListServersResponse' failed as data isn't a dictionary.` + ); } return { - quota: unmarshalArrayOfObject(data.quota, unmarshalQuotum), + servers: marshalling.unmarshalArrayOfObject(data.servers, unmarshalServer), totalCount: data.total_count }; }; -const unmarshalListRulesResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListRulesResponse' failed as data isn't a dictionary.`); +const unmarshalServerTypeNetworkInterface = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ServerTypeNetworkInterface' failed as data isn't a dictionary.` + ); + } + return { + internalBandwidth: data.internal_bandwidth, + internetBandwidth: data.internet_bandwidth + }; +}; +const unmarshalServerTypeVolumeConstraintSizes = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ServerTypeVolumeConstraintSizes' failed as data isn't a dictionary.` + ); + } + return { + maxSize: data.max_size, + minSize: data.min_size + }; +}; +const unmarshalServerTypeCapabilities = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ServerTypeCapabilities' failed as data isn't a dictionary.` + ); + } + return { + blockStorage: data.block_storage, + bootTypes: data.boot_types + }; +}; +const unmarshalServerTypeNetwork = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ServerTypeNetwork' failed as data isn't a dictionary.` + ); + } + return { + interfaces: marshalling.unmarshalArrayOfObject( + data.interfaces, + unmarshalServerTypeNetworkInterface + ), + ipv6Support: data.ipv6_support, + sumInternalBandwidth: data.sum_internal_bandwidth, + sumInternetBandwidth: data.sum_internet_bandwidth + }; +}; +const unmarshalServerTypeVolumeConstraintsByType = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ServerTypeVolumeConstraintsByType' failed as data isn't a dictionary.` + ); + } + return { + lSsd: data.l_ssd ? unmarshalServerTypeVolumeConstraintSizes(data.l_ssd) : void 0 + }; +}; +const unmarshalServerType = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ServerType' failed as data isn't a dictionary.` + ); + } + return { + altNames: data.alt_names, + arch: data.arch, + baremetal: data.baremetal, + blockBandwidth: data.block_bandwidth, + capabilities: data.capabilities ? unmarshalServerTypeCapabilities(data.capabilities) : void 0, + gpu: data.gpu, + hourlyPrice: data.hourly_price, + monthlyPrice: data.monthly_price, + ncpus: data.ncpus, + network: data.network ? unmarshalServerTypeNetwork(data.network) : void 0, + perVolumeConstraint: data.per_volume_constraint ? unmarshalServerTypeVolumeConstraintsByType(data.per_volume_constraint) : void 0, + ram: data.ram, + scratchStorageMaxSize: data.scratch_storage_max_size, + volumesConstraint: data.volumes_constraint ? unmarshalServerTypeVolumeConstraintSizes(data.volumes_constraint) : void 0 + }; +}; +const unmarshalListServersTypesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListServersTypesResponse' failed as data isn't a dictionary.` + ); } return { - rules: unmarshalArrayOfObject(data.rules, unmarshalRule), + servers: marshalling.unmarshalMapOfObject(data.servers, unmarshalServerType), totalCount: data.total_count }; }; -const unmarshalListSSHKeysResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListSSHKeysResponse' failed as data isn't a dictionary.`); +const unmarshalListSnapshotsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListSnapshotsResponse' failed as data isn't a dictionary.` + ); } return { - sshKeys: unmarshalArrayOfObject(data.ssh_keys, unmarshalSSHKey), + snapshots: marshalling.unmarshalArrayOfObject(data.snapshots, unmarshalSnapshot), totalCount: data.total_count }; }; -const unmarshalListUsersResponse$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListUsersResponse' failed as data isn't a dictionary.`); +const unmarshalListVolumesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListVolumesResponse' failed as data isn't a dictionary.` + ); } return { totalCount: data.total_count, - users: unmarshalArrayOfObject(data.users, unmarshalUser$1) + volumes: marshalling.unmarshalArrayOfObject(data.volumes, unmarshalVolume) }; }; -const unmarshalSetRulesResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'SetRulesResponse' failed as data isn't a dictionary.`); +const unmarshalVolumeTypeCapabilities = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'VolumeTypeCapabilities' failed as data isn't a dictionary.` + ); } return { - rules: unmarshalArrayOfObject(data.rules, unmarshalRule) + snapshot: data.snapshot }; }; -const marshalRuleSpecs = (request, defaults) => ({ - permission_set_names: request.permissionSetNames, - ...resolveOneOf([{ - param: 'project_ids', - value: request.projectIds - }, { - param: 'organization_id', - value: request.organizationId - }]) +const unmarshalVolumeTypeConstraints = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'VolumeTypeConstraints' failed as data isn't a dictionary.` + ); + } + return { + max: data.max, + min: data.min + }; +}; +const unmarshalVolumeType = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'VolumeType' failed as data isn't a dictionary.` + ); + } + return { + capabilities: data.capabilities ? unmarshalVolumeTypeCapabilities(data.capabilities) : void 0, + constraints: data.constraints ? unmarshalVolumeTypeConstraints(data.constraints) : void 0, + displayName: data.display_name + }; +}; +const unmarshalListVolumesTypesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListVolumesTypesResponse' failed as data isn't a dictionary.` + ); + } + return { + totalCount: data.total_count, + volumes: marshalling.unmarshalMapOfObject(data.volumes, unmarshalVolumeType) + }; +}; +const unmarshalMigrationPlan = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'MigrationPlan' failed as data isn't a dictionary.` + ); + } + return { + snapshots: marshalling.unmarshalArrayOfObject(data.snapshots, unmarshalSnapshot), + validationKey: data.validation_key, + volume: data.volume ? unmarshalVolume(data.volume) : void 0 + }; +}; +const unmarshalServerActionResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ServerActionResponse' failed as data isn't a dictionary.` + ); + } + return { + task: data.task ? unmarshalTask(data.task) : void 0 + }; +}; +const unmarshalSetImageResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SetImageResponse' failed as data isn't a dictionary.` + ); + } + return { + image: data.image ? unmarshalImage(data.image) : void 0 + }; +}; +const unmarshalSetPlacementGroupResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SetPlacementGroupResponse' failed as data isn't a dictionary.` + ); + } + return { + placementGroup: data.placement_group ? unmarshalPlacementGroup(data.placement_group) : void 0 + }; +}; +const unmarshalSetPlacementGroupServersResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SetPlacementGroupServersResponse' failed as data isn't a dictionary.` + ); + } + return { + servers: marshalling.unmarshalArrayOfObject( + data.servers, + unmarshalPlacementGroupServer + ) + }; +}; +const unmarshalSetSecurityGroupResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SetSecurityGroupResponse' failed as data isn't a dictionary.` + ); + } + return { + securityGroup: data.security_group ? unmarshalSecurityGroup(data.security_group) : void 0 + }; +}; +const unmarshalSetSecurityGroupRuleResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SetSecurityGroupRuleResponse' failed as data isn't a dictionary.` + ); + } + return { + rule: data.rule ? unmarshalSecurityGroupRule(data.rule) : void 0 + }; +}; +const unmarshalSetSecurityGroupRulesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SetSecurityGroupRulesResponse' failed as data isn't a dictionary.` + ); + } + return { + rules: marshalling.unmarshalArrayOfObject(data.rules, unmarshalSecurityGroupRule) + }; +}; +const unmarshalSetServerResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SetServerResponse' failed as data isn't a dictionary.` + ); + } + return { + server: data.server ? unmarshalServer(data.server) : void 0 + }; +}; +const unmarshalSetSnapshotResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SetSnapshotResponse' failed as data isn't a dictionary.` + ); + } + return { + snapshot: data.snapshot ? unmarshalSnapshot(data.snapshot) : void 0 + }; +}; +const unmarshalUpdateImageResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'UpdateImageResponse' failed as data isn't a dictionary.` + ); + } + return { + image: data.image ? unmarshalImage(data.image) : void 0 + }; +}; +const unmarshalUpdateIpResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'UpdateIpResponse' failed as data isn't a dictionary.` + ); + } + return { + ip: data.ip ? unmarshalIp(data.ip) : void 0 + }; +}; +const unmarshalUpdatePlacementGroupResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'UpdatePlacementGroupResponse' failed as data isn't a dictionary.` + ); + } + return { + placementGroup: data.placement_group ? unmarshalPlacementGroup(data.placement_group) : void 0 + }; +}; +const unmarshalUpdatePlacementGroupServersResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'UpdatePlacementGroupServersResponse' failed as data isn't a dictionary.` + ); + } + return { + servers: marshalling.unmarshalArrayOfObject( + data.servers, + unmarshalPlacementGroupServer + ) + }; +}; +const unmarshalUpdateSecurityGroupResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'UpdateSecurityGroupResponse' failed as data isn't a dictionary.` + ); + } + return { + securityGroup: data.security_group ? unmarshalSecurityGroup(data.security_group) : void 0 + }; +}; +const unmarshalUpdateSecurityGroupRuleResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'UpdateSecurityGroupRuleResponse' failed as data isn't a dictionary.` + ); + } + return { + rule: data.rule ? unmarshalSecurityGroupRule(data.rule) : void 0 + }; +}; +const unmarshalUpdateServerResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'UpdateServerResponse' failed as data isn't a dictionary.` + ); + } + return { + server: data.server ? unmarshalServer(data.server) : void 0 + }; +}; +const unmarshalUpdateSnapshotResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'UpdateSnapshotResponse' failed as data isn't a dictionary.` + ); + } + return { + snapshot: data.snapshot ? unmarshalSnapshot(data.snapshot) : void 0 + }; +}; +const unmarshalUpdateVolumeResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'UpdateVolumeResponse' failed as data isn't a dictionary.` + ); + } + return { + volume: data.volume ? unmarshalVolume(data.volume) : void 0 + }; +}; +const marshalApplyBlockMigrationRequest = (request, defaults) => ({ + validation_key: request.validationKey, + ...marshalling.resolveOneOf([ + { param: "volume_id", value: request.volumeId }, + { param: "snapshot_id", value: request.snapshotId } + ]) +}); +const marshalAttachServerVolumeRequest = (request, defaults) => ({ + boot: request.boot, + volume_id: request.volumeId, + volume_type: request.volumeType +}); +const marshalVolumeTemplate = (request, defaults) => ({ + id: request.id, + name: request.name, + size: request.size, + volume_type: request.volumeType, + ...marshalling.resolveOneOf([ + { param: "project", value: request.project }, + { param: "organization", value: request.organization } + ]) +}); +const marshalCreateImageRequest = (request, defaults) => ({ + arch: request.arch, + default_bootscript: request.defaultBootscript, + extra_volumes: request.extraVolumes !== void 0 ? Object.entries(request.extraVolumes).reduce( + (acc, [key, value]) => ({ + ...acc, + [key]: marshalVolumeTemplate(value) + }), + {} + ) : void 0, + name: request.name || randomName("img"), + public: request.public, + root_volume: request.rootVolume, + tags: request.tags, + ...marshalling.resolveOneOf([ + { + default: defaults.defaultProjectId, + param: "project", + value: request.project + }, + { + default: defaults.defaultOrganizationId, + param: "organization", + value: request.organization + } + ]) +}); +const marshalCreateIpRequest = (request, defaults) => ({ + server: request.server, + tags: request.tags, + type: request.type, + ...marshalling.resolveOneOf([ + { + default: defaults.defaultProjectId, + param: "project", + value: request.project + }, + { + default: defaults.defaultOrganizationId, + param: "organization", + value: request.organization + } + ]) +}); +const marshalCreatePlacementGroupRequest = (request, defaults) => ({ + name: request.name || randomName("pg"), + policy_mode: request.policyMode, + policy_type: request.policyType, + tags: request.tags, + ...marshalling.resolveOneOf([ + { + default: defaults.defaultProjectId, + param: "project", + value: request.project + }, + { + default: defaults.defaultOrganizationId, + param: "organization", + value: request.organization + } + ]) +}); +const marshalCreatePrivateNICRequest = (request, defaults) => ({ + ip_ids: request.ipIds, + ipam_ip_ids: request.ipamIpIds, + private_network_id: request.privateNetworkId, + tags: request.tags +}); +const marshalCreateSecurityGroupRequest = (request, defaults) => ({ + description: request.description, + enable_default_security: request.enableDefaultSecurity, + inbound_default_policy: request.inboundDefaultPolicy, + name: request.name || randomName("sg"), + outbound_default_policy: request.outboundDefaultPolicy, + stateful: request.stateful, + tags: request.tags, + ...marshalling.resolveOneOf([ + { + default: defaults.defaultProjectId, + param: "project", + value: request.project + }, + { + default: defaults.defaultOrganizationId, + param: "organization", + value: request.organization + } + ]), + ...marshalling.resolveOneOf([ + { param: "organization_default", value: request.organizationDefault }, + { param: "project_default", value: request.projectDefault } + ]) }); -const marshalAddGroupMemberRequest = (request, defaults) => ({ - ...resolveOneOf([{ - param: 'user_id', - value: request.userId - }, { - param: 'application_id', - value: request.applicationId - }]) +const marshalCreateSecurityGroupRuleRequest = (request, defaults) => ({ + action: request.action, + dest_port_from: request.destPortFrom, + dest_port_to: request.destPortTo, + direction: request.direction, + editable: request.editable, + ip_range: request.ipRange, + position: request.position, + protocol: request.protocol }); -const marshalAddGroupMembersRequest = (request, defaults) => ({ - application_ids: request.applicationIds, - user_ids: request.userIds +const marshalVolumeServerTemplate = (request, defaults) => ({ + base_snapshot: request.baseSnapshot, + boot: request.boot, + id: request.id, + name: request.name, + organization: request.organization, + project: request.project, + size: request.size, + volume_type: request.volumeType }); -const marshalCreateAPIKeyRequest = (request, defaults) => ({ - default_project_id: request.defaultProjectId, - description: request.description, - expires_at: request.expiresAt, - ...resolveOneOf([{ - param: 'application_id', - value: request.applicationId - }, { - param: 'user_id', - value: request.userId - }]) +const marshalCreateServerRequest = (request, defaults) => ({ + admin_password_encryption_ssh_key_id: request.adminPasswordEncryptionSshKeyId, + boot_type: request.bootType, + bootscript: request.bootscript, + commercial_type: request.commercialType, + dynamic_ip_required: request.dynamicIpRequired, + enable_ipv6: request.enableIpv6, + image: request.image, + name: request.name || randomName("srv"), + placement_group: request.placementGroup, + public_ip: request.publicIp, + public_ips: request.publicIps, + routed_ip_enabled: request.routedIpEnabled, + security_group: request.securityGroup, + tags: request.tags, + volumes: request.volumes !== void 0 ? Object.entries(request.volumes).reduce( + (acc, [key, value]) => ({ + ...acc, + [key]: marshalVolumeServerTemplate(value) + }), + {} + ) : void 0, + ...marshalling.resolveOneOf([ + { + default: defaults.defaultProjectId, + param: "project", + value: request.project + }, + { + default: defaults.defaultOrganizationId, + param: "organization", + value: request.organization + } + ]) }); -const marshalCreateApplicationRequest = (request, defaults) => ({ - description: request.description, - name: request.name || randomName('app'), - organization_id: request.organizationId ?? defaults.defaultOrganizationId +const marshalCreateSnapshotRequest = (request, defaults) => ({ + bucket: request.bucket, + key: request.key, + name: request.name || randomName("snp"), + size: request.size, + tags: request.tags, + volume_id: request.volumeId, + volume_type: request.volumeType, + ...marshalling.resolveOneOf([ + { + default: defaults.defaultProjectId, + param: "project", + value: request.project + }, + { + default: defaults.defaultOrganizationId, + param: "organization", + value: request.organization + } + ]) }); -const marshalCreateGroupRequest = (request, defaults) => ({ +const marshalCreateVolumeRequest = (request, defaults) => ({ + name: request.name || randomName("vol"), + tags: request.tags, + volume_type: request.volumeType, + ...marshalling.resolveOneOf([ + { + default: defaults.defaultProjectId, + param: "project", + value: request.project + }, + { + default: defaults.defaultOrganizationId, + param: "organization", + value: request.organization + } + ]), + ...marshalling.resolveOneOf([ + { param: "size", value: request.size }, + { param: "base_snapshot", value: request.baseSnapshot } + ]) +}); +const marshalDetachServerVolumeRequest = (request, defaults) => ({ + volume_id: request.volumeId +}); +const marshalExportSnapshotRequest = (request, defaults) => ({ + bucket: request.bucket, + key: request.key +}); +const marshalPlanBlockMigrationRequest = (request, defaults) => ({ + ...marshalling.resolveOneOf([ + { param: "volume_id", value: request.volumeId }, + { param: "snapshot_id", value: request.snapshotId } + ]) +}); +const marshalServerActionRequestVolumeBackupTemplate = (request, defaults) => ({ + volume_type: request.volumeType +}); +const marshalServerActionRequest = (request, defaults) => ({ + action: request.action, + name: request.name, + volumes: request.volumes !== void 0 ? Object.entries(request.volumes).reduce( + (acc, [key, value]) => ({ + ...acc, + [key]: marshalServerActionRequestVolumeBackupTemplate( + value + ) + }), + {} + ) : void 0 +}); +const marshalServerSummary = (request, defaults) => ({ + id: request.id, + name: request.name +}); +const marshalBootscript = (request, defaults) => ({ + architecture: request.architecture, + bootcmdargs: request.bootcmdargs, + default: request.default, + dtb: request.dtb, + id: request.id, + initrd: request.initrd, + kernel: request.kernel, + organization: request.organization, + project: request.project, + public: request.public, + title: request.title, + zone: request.zone +}); +const marshalVolume = (request, defaults) => ({ + creation_date: request.creationDate, + export_uri: request.exportUri, + id: request.id, + modification_date: request.modificationDate, + name: request.name, + organization: request.organization, + project: request.project, + server: request.server !== void 0 ? marshalServerSummary(request.server) : void 0, + size: request.size, + state: request.state, + tags: request.tags, + volume_type: request.volumeType, + zone: request.zone +}); +const marshalVolumeSummary = (request, defaults) => ({ + id: request.id, + name: request.name, + size: request.size, + volume_type: request.volumeType +}); +const marshalSetImageRequest = (request, defaults) => ({ + arch: request.arch, + creation_date: request.creationDate, + default_bootscript: request.defaultBootscript !== void 0 ? marshalBootscript(request.defaultBootscript) : void 0, + extra_volumes: request.extraVolumes !== void 0 ? Object.entries(request.extraVolumes).reduce( + (acc, [key, value]) => ({ + ...acc, + [key]: marshalVolume(value) + }), + {} + ) : void 0, + from_server: request.fromServer, + modification_date: request.modificationDate, + name: request.name, + organization: request.organization ?? defaults.defaultOrganizationId, + project: request.project ?? defaults.defaultProjectId, + public: request.public, + root_volume: request.rootVolume !== void 0 ? marshalVolumeSummary(request.rootVolume) : void 0, + state: request.state, + tags: request.tags +}); +const marshalSetPlacementGroupRequest = (request, defaults) => ({ + name: request.name, + organization: request.organization ?? defaults.defaultOrganizationId, + policy_mode: request.policyMode, + policy_type: request.policyType, + project: request.project ?? defaults.defaultProjectId, + tags: request.tags +}); +const marshalSetPlacementGroupServersRequest = (request, defaults) => ({ + servers: request.servers +}); +const marshalSetSecurityGroupRequest = (request, defaults) => ({ + creation_date: request.creationDate, description: request.description, - name: request.name || randomName('grp'), - organization_id: request.organizationId ?? defaults.defaultOrganizationId + enable_default_security: request.enableDefaultSecurity, + inbound_default_policy: request.inboundDefaultPolicy, + modification_date: request.modificationDate, + name: request.name, + organization: request.organization ?? defaults.defaultOrganizationId, + organization_default: request.organizationDefault, + outbound_default_policy: request.outboundDefaultPolicy, + project: request.project ?? defaults.defaultProjectId, + project_default: request.projectDefault, + servers: request.servers !== void 0 ? request.servers.map((elt) => marshalServerSummary(elt)) : void 0, + stateful: request.stateful, + tags: request.tags +}); +const marshalSetSecurityGroupRuleRequest = (request, defaults) => ({ + action: request.action, + dest_port_from: request.destPortFrom, + dest_port_to: request.destPortTo, + direction: request.direction, + editable: request.editable, + id: request.id, + ip_range: request.ipRange, + position: request.position, + protocol: request.protocol +}); +const marshalSetSecurityGroupRulesRequestRule = (request, defaults) => ({ + action: request.action, + dest_port_from: request.destPortFrom, + dest_port_to: request.destPortTo, + direction: request.direction, + editable: request.editable, + id: request.id, + ip_range: request.ipRange, + position: request.position, + protocol: request.protocol, + zone: request.zone +}); +const marshalSetSecurityGroupRulesRequest = (request, defaults) => ({ + rules: request.rules !== void 0 ? request.rules.map( + (elt) => marshalSetSecurityGroupRulesRequestRule(elt) + ) : void 0 +}); +const marshalImage = (request, defaults) => ({ + arch: request.arch, + creation_date: request.creationDate, + default_bootscript: request.defaultBootscript !== void 0 ? marshalBootscript(request.defaultBootscript) : void 0, + extra_volumes: Object.entries(request.extraVolumes).reduce( + (acc, [key, value]) => ({ ...acc, [key]: marshalVolume(value) }), + {} + ), + from_server: request.fromServer, + id: request.id, + modification_date: request.modificationDate, + name: request.name, + organization: request.organization, + project: request.project, + public: request.public, + root_volume: request.rootVolume !== void 0 ? marshalVolumeSummary(request.rootVolume) : void 0, + state: request.state, + tags: request.tags, + zone: request.zone +}); +const marshalPlacementGroup = (request, defaults) => ({ + id: request.id, + name: request.name, + organization: request.organization, + policy_mode: request.policyMode, + policy_respected: request.policyRespected, + policy_type: request.policyType, + project: request.project, + tags: request.tags, + zone: request.zone +}); +const marshalPrivateNIC = (request, defaults) => ({ + id: request.id, + mac_address: request.macAddress, + private_network_id: request.privateNetworkId, + server_id: request.serverId, + state: request.state, + tags: request.tags +}); +const marshalSecurityGroupSummary = (request, defaults) => ({ + id: request.id, + name: request.name +}); +const marshalServerIp = (request, defaults) => ({ + address: request.address, + dynamic: request.dynamic, + family: request.family, + gateway: request.gateway, + id: request.id, + ipam_id: request.ipamId, + netmask: request.netmask, + provisioning_mode: request.provisioningMode, + state: request.state, + tags: request.tags +}); +const marshalServerIpv6 = (request, defaults) => ({ + address: request.address, + gateway: request.gateway, + netmask: request.netmask +}); +const marshalServerLocation = (request, defaults) => ({ + cluster_id: request.clusterId, + hypervisor_id: request.hypervisorId, + node_id: request.nodeId, + platform_id: request.platformId, + zone_id: request.zoneId +}); +const marshalServerMaintenance = (request, defaults) => ({ + reason: request.reason, + start_date: request.startDate +}); +const marshalSetServerRequest = (request, defaults) => ({ + admin_password_encryption_ssh_key_id: request.adminPasswordEncryptionSshKeyId, + allowed_actions: request.allowedActions !== void 0 ? request.allowedActions : void 0, + arch: request.arch, + boot_type: request.bootType, + bootscript: request.bootscript !== void 0 ? marshalBootscript(request.bootscript) : void 0, + commercial_type: request.commercialType, + creation_date: request.creationDate, + dynamic_ip_required: request.dynamicIpRequired, + enable_ipv6: request.enableIpv6, + hostname: request.hostname, + image: request.image !== void 0 ? marshalImage(request.image) : void 0, + ipv6: request.ipv6 !== void 0 ? marshalServerIpv6(request.ipv6) : void 0, + location: request.location !== void 0 ? marshalServerLocation(request.location) : void 0, + maintenances: request.maintenances !== void 0 ? request.maintenances.map((elt) => marshalServerMaintenance(elt)) : void 0, + modification_date: request.modificationDate, + name: request.name, + organization: request.organization ?? defaults.defaultOrganizationId, + placement_group: request.placementGroup !== void 0 ? marshalPlacementGroup(request.placementGroup) : void 0, + private_ip: request.privateIp, + private_nics: request.privateNics !== void 0 ? request.privateNics.map((elt) => marshalPrivateNIC(elt)) : void 0, + project: request.project ?? defaults.defaultProjectId, + protected: request.protected, + public_ip: request.publicIp !== void 0 ? marshalServerIp(request.publicIp) : void 0, + public_ips: request.publicIps !== void 0 ? request.publicIps.map((elt) => marshalServerIp(elt)) : void 0, + routed_ip_enabled: request.routedIpEnabled, + security_group: request.securityGroup !== void 0 ? marshalSecurityGroupSummary(request.securityGroup) : void 0, + state: request.state, + state_detail: request.stateDetail, + tags: request.tags, + volumes: request.volumes !== void 0 ? Object.entries(request.volumes).reduce( + (acc, [key, value]) => ({ + ...acc, + [key]: marshalVolume(value) + }), + {} + ) : void 0 +}); +const marshalSnapshotBaseVolume = (request, defaults) => ({ + id: request.id, + name: request.name }); -const marshalCreatePolicyRequest = (request, defaults) => ({ - description: request.description, - name: request.name || randomName('pol'), - organization_id: request.organizationId ?? defaults.defaultOrganizationId, - rules: request.rules ? request.rules.map(elt => marshalRuleSpecs(elt)) : undefined, - ...resolveOneOf([{ - param: 'user_id', - value: request.userId - }, { - param: 'group_id', - value: request.groupId - }, { - param: 'application_id', - value: request.applicationId - }, { - param: 'no_principal', - value: request.noPrincipal - }]) +const marshalSetSnapshotRequest = (request, defaults) => ({ + base_volume: request.baseVolume !== void 0 ? marshalSnapshotBaseVolume(request.baseVolume) : void 0, + creation_date: request.creationDate, + id: request.id, + modification_date: request.modificationDate, + name: request.name, + organization: request.organization ?? defaults.defaultOrganizationId, + project: request.project ?? defaults.defaultProjectId, + size: request.size, + state: request.state, + tags: request.tags, + volume_type: request.volumeType }); -const marshalCreateSSHKeyRequest = (request, defaults) => ({ - name: request.name || randomName('key'), - project_id: request.projectId ?? defaults.defaultProjectId, - public_key: request.publicKey +const marshalVolumeImageUpdateTemplate = (request, defaults) => ({ + id: request.id }); -const marshalCreateUserRequest$1 = (request, defaults) => ({ - email: request.email, - organization_id: request.organizationId ?? defaults.defaultOrganizationId +const marshalUpdateImageRequest = (request, defaults) => ({ + arch: request.arch, + extra_volumes: request.extraVolumes !== void 0 ? Object.entries(request.extraVolumes).reduce( + (acc, [key, value]) => ({ + ...acc, + [key]: marshalVolumeImageUpdateTemplate(value) + }), + {} + ) : void 0, + name: request.name, + public: request.public, + tags: request.tags }); -const marshalRemoveGroupMemberRequest = (request, defaults) => ({ - ...resolveOneOf([{ - param: 'user_id', - value: request.userId - }, { - param: 'application_id', - value: request.applicationId - }]) +const marshalUpdateIpRequest = (request, defaults) => ({ + reverse: request.reverse, + server: request.server, + tags: request.tags, + type: request.type }); -const marshalSetGroupMembersRequest = (request, defaults) => ({ - application_ids: request.applicationIds, - user_ids: request.userIds +const marshalUpdatePlacementGroupRequest = (request, defaults) => ({ + name: request.name, + policy_mode: request.policyMode, + policy_type: request.policyType, + tags: request.tags }); -const marshalSetRulesRequest = (request, defaults) => ({ - policy_id: request.policyId, - rules: request.rules.map(elt => marshalRuleSpecs(elt)) +const marshalUpdatePlacementGroupServersRequest = (request, defaults) => ({ + servers: request.servers }); -const marshalUpdateAPIKeyRequest = (request, defaults) => ({ - default_project_id: request.defaultProjectId, - description: request.description +const marshalUpdatePrivateNICRequest = (request, defaults) => ({ + tags: request.tags }); -const marshalUpdateApplicationRequest = (request, defaults) => ({ +const marshalUpdateSecurityGroupRequest = (request, defaults) => ({ description: request.description, - name: request.name + enable_default_security: request.enableDefaultSecurity, + inbound_default_policy: request.inboundDefaultPolicy, + name: request.name, + organization_default: request.organizationDefault, + outbound_default_policy: request.outboundDefaultPolicy, + project_default: request.projectDefault, + stateful: request.stateful, + tags: request.tags }); -const marshalUpdateGroupRequest = (request, defaults) => ({ - description: request.description, +const marshalUpdateSecurityGroupRuleRequest = (request, defaults) => ({ + action: request.action, + dest_port_from: request.destPortFrom, + dest_port_to: request.destPortTo, + direction: request.direction, + ip_range: request.ipRange, + position: request.position, + protocol: request.protocol +}); +const marshalSecurityGroupTemplate = (request, defaults) => ({ + id: request.id, name: request.name }); -const marshalUpdatePolicyRequest = (request, defaults) => ({ - description: request.description, +const marshalUpdateServerRequest = (request, defaults) => ({ + admin_password_encryption_ssh_key_id: request.adminPasswordEncryptionSshKeyId, + boot_type: request.bootType, + bootscript: request.bootscript, + commercial_type: request.commercialType, + dynamic_ip_required: request.dynamicIpRequired, + enable_ipv6: request.enableIpv6, name: request.name, - ...resolveOneOf([{ - param: 'user_id', - value: request.userId - }, { - param: 'group_id', - value: request.groupId - }, { - param: 'application_id', - value: request.applicationId - }, { - param: 'no_principal', - value: request.noPrincipal - }]) + placement_group: request.placementGroup, + private_nics: request.privateNics, + protected: request.protected, + public_ips: request.publicIps, + routed_ip_enabled: request.routedIpEnabled, + security_group: request.securityGroup !== void 0 ? marshalSecurityGroupTemplate(request.securityGroup) : void 0, + tags: request.tags, + volumes: request.volumes !== void 0 ? Object.entries(request.volumes).reduce( + (acc, [key, value]) => ({ + ...acc, + [key]: marshalVolumeServerTemplate(value) + }), + {} + ) : void 0 }); -const marshalUpdateSSHKeyRequest = (request, defaults) => ({ - disabled: request.disabled, - name: request.name +const marshalUpdateSnapshotRequest = (request, defaults) => ({ + name: request.name, + tags: request.tags }); +const marshalUpdateVolumeRequest = (request, defaults) => ({ + name: request.name, + size: request.size, + tags: request.tags +}); +exports.marshalApplyBlockMigrationRequest = marshalApplyBlockMigrationRequest; +exports.marshalAttachServerVolumeRequest = marshalAttachServerVolumeRequest; +exports.marshalCreateImageRequest = marshalCreateImageRequest; +exports.marshalCreateIpRequest = marshalCreateIpRequest; +exports.marshalCreatePlacementGroupRequest = marshalCreatePlacementGroupRequest; +exports.marshalCreatePrivateNICRequest = marshalCreatePrivateNICRequest; +exports.marshalCreateSecurityGroupRequest = marshalCreateSecurityGroupRequest; +exports.marshalCreateSecurityGroupRuleRequest = marshalCreateSecurityGroupRuleRequest; +exports.marshalCreateServerRequest = marshalCreateServerRequest; +exports.marshalCreateSnapshotRequest = marshalCreateSnapshotRequest; +exports.marshalCreateVolumeRequest = marshalCreateVolumeRequest; +exports.marshalDetachServerVolumeRequest = marshalDetachServerVolumeRequest; +exports.marshalExportSnapshotRequest = marshalExportSnapshotRequest; +exports.marshalPlanBlockMigrationRequest = marshalPlanBlockMigrationRequest; +exports.marshalServerActionRequest = marshalServerActionRequest; +exports.marshalSetImageRequest = marshalSetImageRequest; +exports.marshalSetPlacementGroupRequest = marshalSetPlacementGroupRequest; +exports.marshalSetPlacementGroupServersRequest = marshalSetPlacementGroupServersRequest; +exports.marshalSetSecurityGroupRequest = marshalSetSecurityGroupRequest; +exports.marshalSetSecurityGroupRuleRequest = marshalSetSecurityGroupRuleRequest; +exports.marshalSetSecurityGroupRulesRequest = marshalSetSecurityGroupRulesRequest; +exports.marshalSetServerRequest = marshalSetServerRequest; +exports.marshalSetSnapshotRequest = marshalSetSnapshotRequest; +exports.marshalUpdateImageRequest = marshalUpdateImageRequest; +exports.marshalUpdateIpRequest = marshalUpdateIpRequest; +exports.marshalUpdatePlacementGroupRequest = marshalUpdatePlacementGroupRequest; +exports.marshalUpdatePlacementGroupServersRequest = marshalUpdatePlacementGroupServersRequest; +exports.marshalUpdatePrivateNICRequest = marshalUpdatePrivateNICRequest; +exports.marshalUpdateSecurityGroupRequest = marshalUpdateSecurityGroupRequest; +exports.marshalUpdateSecurityGroupRuleRequest = marshalUpdateSecurityGroupRuleRequest; +exports.marshalUpdateServerRequest = marshalUpdateServerRequest; +exports.marshalUpdateSnapshotRequest = marshalUpdateSnapshotRequest; +exports.marshalUpdateVolumeRequest = marshalUpdateVolumeRequest; +exports.unmarshalAttachServerVolumeResponse = unmarshalAttachServerVolumeResponse; +exports.unmarshalCreateImageResponse = unmarshalCreateImageResponse; +exports.unmarshalCreateIpResponse = unmarshalCreateIpResponse; +exports.unmarshalCreatePlacementGroupResponse = unmarshalCreatePlacementGroupResponse; +exports.unmarshalCreatePrivateNICResponse = unmarshalCreatePrivateNICResponse; +exports.unmarshalCreateSecurityGroupResponse = unmarshalCreateSecurityGroupResponse; +exports.unmarshalCreateSecurityGroupRuleResponse = unmarshalCreateSecurityGroupRuleResponse; +exports.unmarshalCreateServerResponse = unmarshalCreateServerResponse; +exports.unmarshalCreateSnapshotResponse = unmarshalCreateSnapshotResponse; +exports.unmarshalCreateVolumeResponse = unmarshalCreateVolumeResponse; +exports.unmarshalDetachServerVolumeResponse = unmarshalDetachServerVolumeResponse; +exports.unmarshalExportSnapshotResponse = unmarshalExportSnapshotResponse; +exports.unmarshalGetBootscriptResponse = unmarshalGetBootscriptResponse; +exports.unmarshalGetDashboardResponse = unmarshalGetDashboardResponse; +exports.unmarshalGetImageResponse = unmarshalGetImageResponse; +exports.unmarshalGetIpResponse = unmarshalGetIpResponse; +exports.unmarshalGetPlacementGroupResponse = unmarshalGetPlacementGroupResponse; +exports.unmarshalGetPlacementGroupServersResponse = unmarshalGetPlacementGroupServersResponse; +exports.unmarshalGetPrivateNICResponse = unmarshalGetPrivateNICResponse; +exports.unmarshalGetSecurityGroupResponse = unmarshalGetSecurityGroupResponse; +exports.unmarshalGetSecurityGroupRuleResponse = unmarshalGetSecurityGroupRuleResponse; +exports.unmarshalGetServerResponse = unmarshalGetServerResponse; +exports.unmarshalGetServerTypesAvailabilityResponse = unmarshalGetServerTypesAvailabilityResponse; +exports.unmarshalGetSnapshotResponse = unmarshalGetSnapshotResponse; +exports.unmarshalGetVolumeResponse = unmarshalGetVolumeResponse; +exports.unmarshalListBootscriptsResponse = unmarshalListBootscriptsResponse; +exports.unmarshalListImagesResponse = unmarshalListImagesResponse; +exports.unmarshalListIpsResponse = unmarshalListIpsResponse; +exports.unmarshalListPlacementGroupsResponse = unmarshalListPlacementGroupsResponse; +exports.unmarshalListPrivateNICsResponse = unmarshalListPrivateNICsResponse; +exports.unmarshalListSecurityGroupRulesResponse = unmarshalListSecurityGroupRulesResponse; +exports.unmarshalListSecurityGroupsResponse = unmarshalListSecurityGroupsResponse; +exports.unmarshalListServerActionsResponse = unmarshalListServerActionsResponse; +exports.unmarshalListServerUserDataResponse = unmarshalListServerUserDataResponse; +exports.unmarshalListServersResponse = unmarshalListServersResponse; +exports.unmarshalListServersTypesResponse = unmarshalListServersTypesResponse; +exports.unmarshalListSnapshotsResponse = unmarshalListSnapshotsResponse; +exports.unmarshalListVolumesResponse = unmarshalListVolumesResponse; +exports.unmarshalListVolumesTypesResponse = unmarshalListVolumesTypesResponse; +exports.unmarshalMigrationPlan = unmarshalMigrationPlan; +exports.unmarshalPrivateNIC = unmarshalPrivateNIC; +exports.unmarshalServerActionResponse = unmarshalServerActionResponse; +exports.unmarshalSetImageResponse = unmarshalSetImageResponse; +exports.unmarshalSetPlacementGroupResponse = unmarshalSetPlacementGroupResponse; +exports.unmarshalSetPlacementGroupServersResponse = unmarshalSetPlacementGroupServersResponse; +exports.unmarshalSetSecurityGroupResponse = unmarshalSetSecurityGroupResponse; +exports.unmarshalSetSecurityGroupRuleResponse = unmarshalSetSecurityGroupRuleResponse; +exports.unmarshalSetSecurityGroupRulesResponse = unmarshalSetSecurityGroupRulesResponse; +exports.unmarshalSetServerResponse = unmarshalSetServerResponse; +exports.unmarshalSetSnapshotResponse = unmarshalSetSnapshotResponse; +exports.unmarshalUpdateImageResponse = unmarshalUpdateImageResponse; +exports.unmarshalUpdateIpResponse = unmarshalUpdateIpResponse; +exports.unmarshalUpdatePlacementGroupResponse = unmarshalUpdatePlacementGroupResponse; +exports.unmarshalUpdatePlacementGroupServersResponse = unmarshalUpdatePlacementGroupServersResponse; +exports.unmarshalUpdateSecurityGroupResponse = unmarshalUpdateSecurityGroupResponse; +exports.unmarshalUpdateSecurityGroupRuleResponse = unmarshalUpdateSecurityGroupRuleResponse; +exports.unmarshalUpdateServerResponse = unmarshalUpdateServerResponse; +exports.unmarshalUpdateSnapshotResponse = unmarshalUpdateSnapshotResponse; +exports.unmarshalUpdateVolumeResponse = unmarshalUpdateVolumeResponse; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const jsonContentHeaders$h = { - 'Content-Type': 'application/json; charset=utf-8' -}; - -/** IAM API. */ -let API$i = class API extends API$u { - pageOfListSSHKeys = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/iam/v1alpha1/ssh-keys`, - urlParams: urlParams(['disabled', request.disabled], ['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId]) - }, unmarshalListSSHKeysResponse); - - /** - * List SSH keys. List SSH keys. By default, the SSH keys listed are ordered - * by creation date in ascending order. This can be modified via the - * `order_by` field. You can define additional parameters for your query such - * as `organization_id`, `name`, `project_id` and `disabled`. - * - * @param request - The request {@link ListSSHKeysRequest} - * @returns A Promise of ListSSHKeysResponse - */ - listSSHKeys = (request = {}) => enrichForPagination('sshKeys', this.pageOfListSSHKeys, request); - - /** - * Create an SSH key. Add a new SSH key to a Scaleway Project. You must - * specify the `name`, `public_key` and `project_id`. - * - * @param request - The request {@link CreateSSHKeyRequest} - * @returns A Promise of SSHKey - */ - createSSHKey = request => this.client.fetch({ - body: JSON.stringify(marshalCreateSSHKeyRequest(request, this.client.settings)), - headers: jsonContentHeaders$h, - method: 'POST', - path: `/iam/v1alpha1/ssh-keys` - }, unmarshalSSHKey); - /** - * Get an SSH key. Retrieve information about a given SSH key, specified by - * the `ssh_key_id` parameter. The SSH key's full details, including `id`, - * `name`, `public_key`, and `project_id` are returned in the response. - * - * @param request - The request {@link GetSSHKeyRequest} - * @returns A Promise of SSHKey - */ - getSSHKey = request => this.client.fetch({ - method: 'GET', - path: `/iam/v1alpha1/ssh-keys/${validatePathParam('sshKeyId', request.sshKeyId)}` - }, unmarshalSSHKey); +/***/ }), - /** - * Update an SSH key. Update the parameters of an SSH key, including `name` - * and `disable`. - * - * @param request - The request {@link UpdateSSHKeyRequest} - * @returns A Promise of SSHKey - */ - updateSSHKey = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateSSHKeyRequest(request, this.client.settings)), - headers: jsonContentHeaders$h, - method: 'PATCH', - path: `/iam/v1alpha1/ssh-keys/${validatePathParam('sshKeyId', request.sshKeyId)}` - }, unmarshalSSHKey); +/***/ 5926: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - /** - * Delete an SSH key. Delete a given SSH key, specified by the `ssh_key_id`. - * Deleting an SSH is permanent, and cannot be undone. Note that you might - * need to update any configurations that used the SSH key. - * - * @param request - The request {@link DeleteSSHKeyRequest} - */ - deleteSSHKey = request => this.client.fetch({ - method: 'DELETE', - path: `/iam/v1alpha1/ssh-keys/${validatePathParam('sshKeyId', request.sshKeyId)}` - }); - pageOfListUsers = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/iam/v1alpha1/users`, - urlParams: urlParams(['mfa', request.mfa], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['user_ids', request.userIds]) - }, unmarshalListUsersResponse$1); +"use strict"; - /** - * List users of an Organization. List the users of an Organization. By - * default, the users listed are ordered by creation date in ascending order. - * This can be modified via the `order_by` field. You must define the - * `organization_id` in the query path of your request. You can also define - * additional parameters for your query such as `user_ids`. - * - * @param request - The request {@link ListUsersRequest} - * @returns A Promise of ListUsersResponse - */ - listUsers = (request = {}) => enrichForPagination('users', this.pageOfListUsers, request); +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const index_gen = __nccwpck_require__(6100); +exports.v1 = index_gen; - /** - * Get a given user. Retrieve information about a user, specified by the - * `user_id` parameter. The user's full details, including `id`, `email`, - * `organization_id`, `status` and `mfa` are returned in the response. - * - * @param request - The request {@link GetUserRequest} - * @returns A Promise of User - */ - getUser = request => this.client.fetch({ - method: 'GET', - path: `/iam/v1alpha1/users/${validatePathParam('userId', request.userId)}` - }, unmarshalUser$1); - /** - * Delete a guest user from an Organization. Remove a user from an - * Organization in which they are a guest. You must define the `user_id` in - * your request. Note that removing a user from an Organization automatically - * deletes their API keys, and any policies directly attached to them become - * orphaned. - * - * @param request - The request {@link DeleteUserRequest} - */ - deleteUser = request => this.client.fetch({ - method: 'DELETE', - path: `/iam/v1alpha1/users/${validatePathParam('userId', request.userId)}` - }); +/***/ }), - /** - * Create a new user. Create a new user. You must define the `organization_id` - * and the `email` in your request. - * - * @param request - The request {@link CreateUserRequest} - * @returns A Promise of User - */ - createUser = request => this.client.fetch({ - body: JSON.stringify(marshalCreateUserRequest$1(request, this.client.settings)), - headers: jsonContentHeaders$h, - method: 'POST', - path: `/iam/v1alpha1/users` - }, unmarshalUser$1); - pageOfListApplications = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/iam/v1alpha1/applications`, - urlParams: urlParams(['application_ids', request.applicationIds], ['editable', request.editable], ['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]) - }, unmarshalListApplicationsResponse); +/***/ 5544: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - /** - * List applications of an Organization. List the applications of an - * Organization. By default, the applications listed are ordered by creation - * date in ascending order. This can be modified via the `order_by` field. You - * must define the `organization_id` in the query path of your request. You - * can also define additional parameters for your query such as - * `application_ids`. - * - * @param request - The request {@link ListApplicationsRequest} - * @returns A Promise of ListApplicationsResponse - */ - listApplications = (request = {}) => enrichForPagination('applications', this.pageOfListApplications, request); +"use strict"; +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const intervalRetrier = __nccwpck_require__(9052); +const api = __nccwpck_require__(3042); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const resourcePaginator = __nccwpck_require__(4983); +const content_gen = __nccwpck_require__(2635); +const marshalling_gen = __nccwpck_require__(5074); +const jsonContentHeaders = { + "Content-Type": "application/json; charset=utf-8" +}; +class API extends api.API { + /** Lists the available regions of the API. */ + static LOCALITIES = ["fr-par"]; + pageOfListHubs = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/iot/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hubs`, + urlParams: marshalling.urlParams( + ["name", request.name], + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId] + ) + }, + marshalling_gen.unmarshalListHubsResponse + ); /** - * Create a new application. Create a new application. You must define the - * `name` parameter in the request. + * List hubs. List all Hubs in the specified zone. By default, returned Hubs + * are ordered by creation date in ascending order, though this can be + * modified via the `order_by` field. * - * @param request - The request {@link CreateApplicationRequest} - * @returns A Promise of Application + * @param request - The request {@link ListHubsRequest} + * @returns A Promise of ListHubsResponse */ - createApplication = request => this.client.fetch({ - body: JSON.stringify(marshalCreateApplicationRequest(request, this.client.settings)), - headers: jsonContentHeaders$h, - method: 'POST', - path: `/iam/v1alpha1/applications` - }, unmarshalApplication); - + listHubs = (request = {}) => resourcePaginator.enrichForPagination("hubs", this.pageOfListHubs, request); /** - * Get a given application. Retrieve information about an application, - * specified by the `application_id` parameter. The application's full - * details, including `id`, `email`, `organization_id`, `status` and - * `two_factor_enabled` are returned in the response. + * Create a hub. Create a new Hub in the targeted region, specifying its + * configuration including name and product plan. * - * @param request - The request {@link GetApplicationRequest} - * @returns A Promise of Application + * @param request - The request {@link CreateHubRequest} + * @returns A Promise of Hub */ - getApplication = request => this.client.fetch({ - method: 'GET', - path: `/iam/v1alpha1/applications/${validatePathParam('applicationId', request.applicationId)}` - }, unmarshalApplication); - + createHub = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateHubRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/iot/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hubs` + }, + marshalling_gen.unmarshalHub + ); /** - * Update an application. Update the parameters of an application, including - * `name` and `description`. + * Get a hub. Retrieve information about an existing IoT Hub, specified by its + * Hub ID. Its full details, including name, status and endpoint, are returned + * in the response object. * - * @param request - The request {@link UpdateApplicationRequest} - * @returns A Promise of Application + * @param request - The request {@link GetHubRequest} + * @returns A Promise of Hub */ - updateApplication = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateApplicationRequest(request, this.client.settings)), - headers: jsonContentHeaders$h, - method: 'PATCH', - path: `/iam/v1alpha1/applications/${validatePathParam('applicationId', request.applicationId)}` - }, unmarshalApplication); - + getHub = (request) => this.client.fetch( + { + method: "GET", + path: `/iot/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hubs/${marshalling.validatePathParam("hubId", request.hubId)}` + }, + marshalling_gen.unmarshalHub + ); /** - * Delete an application. Delete an application. Note that this action is - * irreversible and will automatically delete the application's API keys. - * Policies attached to users and applications via this group will no longer - * apply. + * Waits for {@link Hub} to be in a final state. * - * @param request - The request {@link DeleteApplicationRequest} + * @param request - The request {@link GetHubRequest} + * @param options - The waiting options + * @returns A Promise of Hub */ - deleteApplication = request => this.client.fetch({ - method: 'DELETE', - path: `/iam/v1alpha1/applications/${validatePathParam('applicationId', request.applicationId)}` - }); - pageOfListGroups = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/iam/v1alpha1/groups`, - urlParams: urlParams(['application_ids', request.applicationIds], ['group_ids', request.groupIds], ['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['user_ids', request.userIds]) - }, unmarshalListGroupsResponse); - + waitForHub = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve(!content_gen.HUB_TRANSIENT_STATUSES.includes(res.status))), + this.getHub, + request, + options + ); /** - * List groups. List groups. By default, the groups listed are ordered by - * creation date in ascending order. This can be modified via the `order_by` - * field. You can define additional parameters to filter your query. Use - * `user_ids` or `application_ids` to list all groups certain users or - * applications belong to. + * Update a hub. Update the parameters of an existing IoT Hub, specified by + * its Hub ID. * - * @param request - The request {@link ListGroupsRequest} - * @returns A Promise of ListGroupsResponse + * @param request - The request {@link UpdateHubRequest} + * @returns A Promise of Hub */ - listGroups = (request = {}) => enrichForPagination('groups', this.pageOfListGroups, request); - + updateHub = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateHubRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/iot/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hubs/${marshalling.validatePathParam("hubId", request.hubId)}` + }, + marshalling_gen.unmarshalHub + ); /** - * Create a group. Create a new group. You must define the `name` and - * `organization_id` parameters in the request. + * Enable a hub. Enable an existing IoT Hub, specified by its Hub ID. * - * @param request - The request {@link CreateGroupRequest} - * @returns A Promise of Group + * @param request - The request {@link EnableHubRequest} + * @returns A Promise of Hub */ - createGroup = request => this.client.fetch({ - body: JSON.stringify(marshalCreateGroupRequest(request, this.client.settings)), - headers: jsonContentHeaders$h, - method: 'POST', - path: `/iam/v1alpha1/groups` - }, unmarshalGroup); - + enableHub = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/iot/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hubs/${marshalling.validatePathParam("hubId", request.hubId)}/enable` + }, + marshalling_gen.unmarshalHub + ); /** - * Get a group. Retrive information about a given group, specified by the - * `group_id` parameter. The group's full details, including `user_ids` and - * `application_ids` are returned in the response. + * Disable a hub. Disable an existing IoT Hub, specified by its Hub ID. * - * @param request - The request {@link GetGroupRequest} - * @returns A Promise of Group + * @param request - The request {@link DisableHubRequest} + * @returns A Promise of Hub */ - getGroup = request => this.client.fetch({ - method: 'GET', - path: `/iam/v1alpha1/groups/${validatePathParam('groupId', request.groupId)}` - }, unmarshalGroup); - + disableHub = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/iot/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hubs/${marshalling.validatePathParam("hubId", request.hubId)}/disable` + }, + marshalling_gen.unmarshalHub + ); /** - * Update a group. Update the parameters of group, including `name` and - * `description`. + * Delete a hub. Delete an existing IoT Hub, specified by its Hub ID. Deleting + * a Hub is permanent, and cannot be undone. * - * @param request - The request {@link UpdateGroupRequest} - * @returns A Promise of Group + * @param request - The request {@link DeleteHubRequest} */ - updateGroup = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateGroupRequest(request, this.client.settings)), - headers: jsonContentHeaders$h, - method: 'PATCH', - path: `/iam/v1alpha1/groups/${validatePathParam('groupId', request.groupId)}` - }, unmarshalGroup); - + deleteHub = (request) => this.client.fetch({ + method: "DELETE", + path: `/iot/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hubs/${marshalling.validatePathParam("hubId", request.hubId)}`, + urlParams: marshalling.urlParams(["delete_devices", request.deleteDevices]) + }); /** - * Overwrite users and applications of a group. Overwrite users and - * applications configuration in a group. Any information that you add using - * this command will overwrite the previous configuration. + * Get a hub's metrics. Get the metrics of an existing IoT Hub, specified by + * its Hub ID. * - * @param request - The request {@link SetGroupMembersRequest} - * @returns A Promise of Group + * @deprecated + * @param request - The request {@link GetHubMetricsRequest} + * @returns A Promise of GetHubMetricsResponse */ - setGroupMembers = request => this.client.fetch({ - body: JSON.stringify(marshalSetGroupMembersRequest(request, this.client.settings)), - headers: jsonContentHeaders$h, - method: 'PUT', - path: `/iam/v1alpha1/groups/${validatePathParam('groupId', request.groupId)}/members` - }, unmarshalGroup); - + getHubMetrics = (request) => this.client.fetch( + { + method: "GET", + path: `/iot/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hubs/${marshalling.validatePathParam("hubId", request.hubId)}/metrics`, + urlParams: marshalling.urlParams(["start_date", request.startDate]) + }, + marshalling_gen.unmarshalGetHubMetricsResponse + ); /** - * Add a user or an application to a group. Add a user or an application to a - * group. You can specify a `user_id` and and `application_id` in the body of - * your request. Note that you can only add one of each per request. + * Set the certificate authority of a hub. Set a particular PEM-encoded + * certificate, specified by the Hub ID. * - * @param request - The request {@link AddGroupMemberRequest} - * @returns A Promise of Group + * @param request - The request {@link SetHubCARequest} + * @returns A Promise of Hub */ - addGroupMember = request => this.client.fetch({ - body: JSON.stringify(marshalAddGroupMemberRequest(request, this.client.settings)), - headers: jsonContentHeaders$h, - method: 'POST', - path: `/iam/v1alpha1/groups/${validatePathParam('groupId', request.groupId)}/add-member` - }, unmarshalGroup); - + setHubCA = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalSetHubCARequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/iot/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hubs/${marshalling.validatePathParam("hubId", request.hubId)}/ca` + }, + marshalling_gen.unmarshalHub + ); /** - * Add multiple users and applications to a group. Add multiple users and - * applications to a group in a single call. You can specify an array of - * `user_id`s and `application_id`s. Note that any existing users and - * applications in the group will remain. To add new users/applications and - * delete pre-existing ones, use the [Overwrite users and applications of a - * group](#path-groups-overwrite-users-and-applications-of-a-group) method. + * Get the certificate authority of a hub. Get information for a particular + * PEM-encoded certificate, specified by the Hub ID. * - * @param request - The request {@link AddGroupMembersRequest} - * @returns A Promise of Group + * @param request - The request {@link GetHubCARequest} + * @returns A Promise of GetHubCAResponse */ - addGroupMembers = request => this.client.fetch({ - body: JSON.stringify(marshalAddGroupMembersRequest(request, this.client.settings)), - headers: jsonContentHeaders$h, - method: 'POST', - path: `/iam/v1alpha1/groups/${validatePathParam('groupId', request.groupId)}/add-members` - }, unmarshalGroup); - + getHubCA = (request) => this.client.fetch( + { + method: "GET", + path: `/iot/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hubs/${marshalling.validatePathParam("hubId", request.hubId)}/ca` + }, + marshalling_gen.unmarshalGetHubCAResponse + ); + pageOfListDevices = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/iot/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/devices`, + urlParams: marshalling.urlParams( + ["allow_insecure", request.allowInsecure], + ["hub_id", request.hubId], + ["name", request.name], + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["status", request.status] + ) + }, + marshalling_gen.unmarshalListDevicesResponse + ); /** - * Remove a user or an application from a group. Remove a user or an - * application from a group. You can specify a `user_id` and and - * `application_id` in the body of your request. Note that you can only remove - * one of each per request. Removing a user from a group means that any - * permissions given to them via the group (i.e. from an attached policy) will - * no longer apply. Be sure you want to remove these permissions from the user - * before proceeding. + * List devices. List all devices in the specified region. By default, + * returned devices are ordered by creation date in ascending order, though + * this can be modified via the `order_by` field. * - * @param request - The request {@link RemoveGroupMemberRequest} - * @returns A Promise of Group + * @param request - The request {@link ListDevicesRequest} + * @returns A Promise of ListDevicesResponse */ - removeGroupMember = request => this.client.fetch({ - body: JSON.stringify(marshalRemoveGroupMemberRequest(request, this.client.settings)), - headers: jsonContentHeaders$h, - method: 'POST', - path: `/iam/v1alpha1/groups/${validatePathParam('groupId', request.groupId)}/remove-member` - }, unmarshalGroup); - + listDevices = (request = {}) => resourcePaginator.enrichForPagination("devices", this.pageOfListDevices, request); /** - * Delete a group. Delete a group. Note that this action is irreversible and - * could delete permissions for group members. Policies attached to users and - * applications via this group will no longer apply. + * Add a device. Attach a device to a given Hub. * - * @param request - The request {@link DeleteGroupRequest} + * @param request - The request {@link CreateDeviceRequest} + * @returns A Promise of CreateDeviceResponse */ - deleteGroup = request => this.client.fetch({ - method: 'DELETE', - path: `/iam/v1alpha1/groups/${validatePathParam('groupId', request.groupId)}` - }); - pageOfListPolicies = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/iam/v1alpha1/policies`, - urlParams: urlParams(['application_ids', request.applicationIds], ['editable', request.editable], ['group_ids', request.groupIds], ['no_principal', request.noPrincipal], ['order_by', request.orderBy ?? 'policy_name_asc'], ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['policy_name', request.policyName], ['user_ids', request.userIds]) - }, unmarshalListPoliciesResponse); - + createDevice = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateDeviceRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/iot/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/devices` + }, + marshalling_gen.unmarshalCreateDeviceResponse + ); /** - * List policies of an Organization. List the policies of an Organization. By - * default, the policies listed are ordered by creation date in ascending - * order. This can be modified via the `order_by` field. You must define the - * `organization_id` in the query path of your request. You can also define - * additional parameters to filter your query, such as `user_ids`, - * `groups_ids`, `application_ids`, and `policy_name`. + * Get a device. Retrieve information about an existing device, specified by + * its device ID. Its full details, including name, status and ID, are + * returned in the response object. * - * @param request - The request {@link ListPoliciesRequest} - * @returns A Promise of ListPoliciesResponse + * @param request - The request {@link GetDeviceRequest} + * @returns A Promise of Device */ - listPolicies = (request = {}) => enrichForPagination('policies', this.pageOfListPolicies, request); - + getDevice = (request) => this.client.fetch( + { + method: "GET", + path: `/iot/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/devices/${marshalling.validatePathParam("deviceId", request.deviceId)}` + }, + marshalling_gen.unmarshalDevice + ); /** - * Create a new policy. Create a new application. You must define the `name` - * parameter in the request. You can specify parameters such as `user_id`, - * `groups_id`, `application_id`, `no_principal`, `rules` and its child - * attributes. + * Update a device. Update the parameters of an existing device, specified by + * its device ID. * - * @param request - The request {@link CreatePolicyRequest} - * @returns A Promise of Policy + * @param request - The request {@link UpdateDeviceRequest} + * @returns A Promise of Device */ - createPolicy = request => this.client.fetch({ - body: JSON.stringify(marshalCreatePolicyRequest(request, this.client.settings)), - headers: jsonContentHeaders$h, - method: 'POST', - path: `/iam/v1alpha1/policies` - }, unmarshalPolicy); - + updateDevice = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateDeviceRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/iot/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/devices/${marshalling.validatePathParam("deviceId", request.deviceId)}` + }, + marshalling_gen.unmarshalDevice + ); /** - * Get an existing policy. Retrieve information about a policy, speficified by - * the `policy_id` parameter. The policy's full details, including `id`, - * `name`, `organization_id`, `nb_rules` and `nb_scopes`, `nb_permission_sets` - * are returned in the response. + * Enable a device. Enable a specific device, specified by its device ID. * - * @param request - The request {@link GetPolicyRequest} - * @returns A Promise of Policy + * @param request - The request {@link EnableDeviceRequest} + * @returns A Promise of Device */ - getPolicy = request => this.client.fetch({ - method: 'GET', - path: `/iam/v1alpha1/policies/${validatePathParam('policyId', request.policyId)}` - }, unmarshalPolicy); - + enableDevice = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/iot/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/devices/${marshalling.validatePathParam("deviceId", request.deviceId)}/enable` + }, + marshalling_gen.unmarshalDevice + ); /** - * Update an existing policy. Update the parameters of a policy, including - * `name`, `description`, `user_id`, `group_id`, `application_id` and - * `no_principal`. + * Disable a device. Disable an existing device, specified by its device ID. * - * @param request - The request {@link UpdatePolicyRequest} - * @returns A Promise of Policy + * @param request - The request {@link DisableDeviceRequest} + * @returns A Promise of Device */ - updatePolicy = request => this.client.fetch({ - body: JSON.stringify(marshalUpdatePolicyRequest(request, this.client.settings)), - headers: jsonContentHeaders$h, - method: 'PATCH', - path: `/iam/v1alpha1/policies/${validatePathParam('policyId', request.policyId)}` - }, unmarshalPolicy); - + disableDevice = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/iot/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/devices/${marshalling.validatePathParam("deviceId", request.deviceId)}/disable` + }, + marshalling_gen.unmarshalDevice + ); /** - * Delete a policy. Delete a policy. You must define specify the `policy_id` - * parameter in your request. Note that when deleting a policy, all - * permissions it gives to its principal (user, group or application) will be - * revoked. + * Renew a device certificate. Renew the certificate of an existing device, + * specified by its device ID. * - * @param request - The request {@link DeletePolicyRequest} + * @param request - The request {@link RenewDeviceCertificateRequest} + * @returns A Promise of RenewDeviceCertificateResponse */ - deletePolicy = request => this.client.fetch({ - method: 'DELETE', - path: `/iam/v1alpha1/policies/${validatePathParam('policyId', request.policyId)}` - }); - + renewDeviceCertificate = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/iot/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/devices/${marshalling.validatePathParam("deviceId", request.deviceId)}/renew-certificate` + }, + marshalling_gen.unmarshalRenewDeviceCertificateResponse + ); /** - * Clone a policy. Clone a policy. You must define specify the `policy_id` - * parameter in your request. + * Set a custom certificate on a device. Switch the existing certificate of a + * given device with an EM-encoded custom certificate. * - * @param request - The request {@link ClonePolicyRequest} - * @returns A Promise of Policy + * @param request - The request {@link SetDeviceCertificateRequest} + * @returns A Promise of SetDeviceCertificateResponse */ - clonePolicy = request => this.client.fetch({ - body: '{}', - headers: jsonContentHeaders$h, - method: 'POST', - path: `/iam/v1alpha1/policies/${validatePathParam('policyId', request.policyId)}/clone` - }, unmarshalPolicy); - + setDeviceCertificate = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalSetDeviceCertificateRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PUT", + path: `/iot/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/devices/${marshalling.validatePathParam("deviceId", request.deviceId)}/certificate` + }, + marshalling_gen.unmarshalSetDeviceCertificateResponse + ); /** - * Set rules of a given policy. Overwrite the rules of a given policy. Any - * information that you add using this command will overwrite the previous - * configuration. If you include some of the rules you already had in your - * previous configuration in your new one, but you change their order, the new - * order of display will apply. While policy rules are ordered, they have no - * impact on the access logic of IAM because rules are allow-only. + * Get a device's certificate. Get information for a particular PEM-encoded + * certificate, specified by the device ID. The response returns full details + * of the device, including its type of certificate. * - * @param request - The request {@link SetRulesRequest} - * @returns A Promise of SetRulesResponse + * @param request - The request {@link GetDeviceCertificateRequest} + * @returns A Promise of GetDeviceCertificateResponse */ - setRules = request => this.client.fetch({ - body: JSON.stringify(marshalSetRulesRequest(request, this.client.settings)), - headers: jsonContentHeaders$h, - method: 'PUT', - path: `/iam/v1alpha1/rules` - }, unmarshalSetRulesResponse); - pageOfListRules = request => this.client.fetch({ - method: 'GET', - path: `/iam/v1alpha1/rules`, - urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['policy_id', request.policyId]) - }, unmarshalListRulesResponse); - + getDeviceCertificate = (request) => this.client.fetch( + { + method: "GET", + path: `/iot/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/devices/${marshalling.validatePathParam("deviceId", request.deviceId)}/certificate` + }, + marshalling_gen.unmarshalGetDeviceCertificateResponse + ); /** - * List rules of a given policy. List the rules of a given policy. By default, - * the rules listed are ordered by creation date in ascending order. This can - * be modified via the `order_by` field. You must define the `policy_id` in - * the query path of your request. + * Remove a device. Remove a specific device from the specific Hub it is + * attached to. * - * @param request - The request {@link ListRulesRequest} - * @returns A Promise of ListRulesResponse + * @param request - The request {@link DeleteDeviceRequest} */ - listRules = request => enrichForPagination('rules', this.pageOfListRules, request); - pageOfListPermissionSets = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/iam/v1alpha1/permission-sets`, - urlParams: urlParams(['order_by', request.orderBy ?? 'name_asc'], ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]) - }, unmarshalListPermissionSetsResponse); - + deleteDevice = (request) => this.client.fetch({ + method: "DELETE", + path: `/iot/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/devices/${marshalling.validatePathParam("deviceId", request.deviceId)}` + }); /** - * List permission sets. List permission sets available for given - * Organization. You must define the `organization_id` in the query path of - * your request. + * Get a device's metrics. Get the metrics of an existing device, specified by + * its device ID. * - * @param request - The request {@link ListPermissionSetsRequest} - * @returns A Promise of ListPermissionSetsResponse + * @deprecated + * @param request - The request {@link GetDeviceMetricsRequest} + * @returns A Promise of GetDeviceMetricsResponse */ - listPermissionSets = (request = {}) => enrichForPagination('permissionSets', this.pageOfListPermissionSets, request); - pageOfListAPIKeys = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/iam/v1alpha1/api-keys`, - urlParams: urlParams(['access_key', request.accessKey], ['bearer_id', request.bearerId], ['bearer_type', request.bearerType ?? 'unknown_bearer_type'], ['description', request.description], ['editable', request.editable], ['expired', request.expired], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ...Object.entries(resolveOneOf([{ - param: 'application_id', - value: request.applicationId - }, { - param: 'user_id', - value: request.userId - }]))) - }, unmarshalListAPIKeysResponse); - + getDeviceMetrics = (request) => this.client.fetch( + { + method: "GET", + path: `/iot/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/devices/${marshalling.validatePathParam("deviceId", request.deviceId)}/metrics`, + urlParams: marshalling.urlParams(["start_date", request.startDate]) + }, + marshalling_gen.unmarshalGetDeviceMetricsResponse + ); + pageOfListRoutes = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/iot/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes`, + urlParams: marshalling.urlParams( + ["hub_id", request.hubId], + ["name", request.name], + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListRoutesResponse + ); /** - * List API keys. List API keys. By default, the API keys listed are ordered - * by creation date in ascending order. This can be modified via the - * `order_by` field. You can define additional parameters for your query such - * as `editable`, `expired`, `access_key` and `bearer_id`. + * List routes. List all routes in the specified region. By default, returned + * routes are ordered by creation date in ascending order, though this can be + * modified via the `order_by` field. * - * @param request - The request {@link ListAPIKeysRequest} - * @returns A Promise of ListAPIKeysResponse + * @param request - The request {@link ListRoutesRequest} + * @returns A Promise of ListRoutesResponse */ - listAPIKeys = (request = {}) => enrichForPagination('apiKeys', this.pageOfListAPIKeys, request); - + listRoutes = (request = {}) => resourcePaginator.enrichForPagination("routes", this.pageOfListRoutes, request); /** - * Create an API key. Create an API key. You must specify the `application_id` - * or the `user_id` and the description. You can also specify the - * `default_project_id` which is the Project ID of your preferred Project, to - * use with Object Storage. The `access_key` and `secret_key` values are - * returned in the response. Note that he secret key is only showed once. Make - * sure that you copy and store both keys somewhere safe. + * Create a route. Multiple kinds of routes can be created, such as: * - * @param request - The request {@link CreateAPIKeyRequest} - * @returns A Promise of APIKey + * - Database Route Create a route that will record subscribed MQTT messages + * into your database. You need to manage the database by yourself. + * - REST Route. Create a route that will call a REST API on received subscribed + * MQTT messages. + * - S3 Routes. Create a route that will put subscribed MQTT messages into an S3 + * bucket. You need to create the bucket yourself and grant write access. + * Granting can be done with s3cmd (`s3cmd setacl s3:// + * --acl-grant=write:555c69c3-87d0-4bf8-80f1-99a2f757d031:555c69c3-87d0-4bf8-80f1-99a2f757d031`). + * + * @param request - The request {@link CreateRouteRequest} + * @returns A Promise of Route */ - createAPIKey = request => this.client.fetch({ - body: JSON.stringify(marshalCreateAPIKeyRequest(request, this.client.settings)), - headers: jsonContentHeaders$h, - method: 'POST', - path: `/iam/v1alpha1/api-keys` - }, unmarshalAPIKey); - + createRoute = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateRouteRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/iot/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes` + }, + marshalling_gen.unmarshalRoute + ); /** - * Get an API key. Retrive information about an API key, specified by the - * `access_key` parameter. The API key's details, including either the - * `user_id` or `application_id` of its bearer are returned in the response. - * Note that the string value for the `secret_key` is nullable, and therefore - * is not displayed in the response. The `secret_key` value is only displayed - * upon API key creation. + * Update a route. Update the parameters of an existing route, specified by + * its route ID. * - * @param request - The request {@link GetAPIKeyRequest} - * @returns A Promise of APIKey + * @param request - The request {@link UpdateRouteRequest} + * @returns A Promise of Route */ - getAPIKey = request => this.client.fetch({ - method: 'GET', - path: `/iam/v1alpha1/api-keys/${validatePathParam('accessKey', request.accessKey)}` - }, unmarshalAPIKey); - + updateRoute = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateRouteRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/iot/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes/${marshalling.validatePathParam("routeId", request.routeId)}` + }, + marshalling_gen.unmarshalRoute + ); /** - * Update an API key. Update the parameters of an API key, including - * `default_project_id` and `description`. + * Get a route. Get information for a particular route, specified by the route + * ID. The response returns full details of the route, including its type, the + * topic it subscribes to and its configuration. * - * @param request - The request {@link UpdateAPIKeyRequest} - * @returns A Promise of APIKey + * @param request - The request {@link GetRouteRequest} + * @returns A Promise of Route */ - updateAPIKey = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateAPIKeyRequest(request, this.client.settings)), - headers: jsonContentHeaders$h, - method: 'PATCH', - path: `/iam/v1alpha1/api-keys/${validatePathParam('accessKey', request.accessKey)}` - }, unmarshalAPIKey); - + getRoute = (request) => this.client.fetch( + { + method: "GET", + path: `/iot/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes/${marshalling.validatePathParam("routeId", request.routeId)}` + }, + marshalling_gen.unmarshalRoute + ); /** - * Delete an API key. Delete an API key. Note that this action is irreversible - * and cannot be undone. Make sure you update any configurations using the API - * keys you delete. + * Delete a route. Delete an existing route, specified by its route ID. + * Deleting a route is permanent, and cannot be undone. * - * @param request - The request {@link DeleteAPIKeyRequest} + * @param request - The request {@link DeleteRouteRequest} */ - deleteAPIKey = request => this.client.fetch({ - method: 'DELETE', - path: `/iam/v1alpha1/api-keys/${validatePathParam('accessKey', request.accessKey)}` + deleteRoute = (request) => this.client.fetch({ + method: "DELETE", + path: `/iot/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes/${marshalling.validatePathParam("routeId", request.routeId)}` }); - pageOfListQuota = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/iam/v1alpha1/quota`, - urlParams: urlParams(['order_by', request.orderBy ?? 'name_asc'], ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]) - }, unmarshalListQuotaResponse); - + pageOfListNetworks = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/iot/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/networks`, + urlParams: marshalling.urlParams( + ["hub_id", request.hubId], + ["name", request.name], + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["topic_prefix", request.topicPrefix] + ) + }, + marshalling_gen.unmarshalListNetworksResponse + ); /** - * List all quotas in the Organization. List all product and features quota - * for an Organization, with their associated limits. By default, the quota - * listed are ordered by creation date in ascending order. This can be - * modified via the `order_by` field. You must define the `organization_id` in - * the query path of your request. + * List the networks. * - * @param request - The request {@link ListQuotaRequest} - * @returns A Promise of ListQuotaResponse + * @param request - The request {@link ListNetworksRequest} + * @returns A Promise of ListNetworksResponse */ - listQuota = (request = {}) => enrichForPagination('quota', this.pageOfListQuota, request); - + listNetworks = (request = {}) => resourcePaginator.enrichForPagination("networks", this.pageOfListNetworks, request); /** - * Get a quota in the Organization. Retrieve information about a resource - * quota, speficified by the `quotum_name` parameter. The quota's `limit`, or - * whether it is unlimited, is returned in the response. + * Create a new network. Create a new network for an existing hub. Beside the + * default network, you can add networks for different data providers. + * Possible network types are Sigfox and REST. * - * @param request - The request {@link GetQuotumRequest} - * @returns A Promise of Quotum + * @param request - The request {@link CreateNetworkRequest} + * @returns A Promise of CreateNetworkResponse */ - getQuotum = request => this.client.fetch({ - method: 'GET', - path: `/iam/v1alpha1/quota/${validatePathParam('quotumName', request.quotumName)}`, - urlParams: urlParams(['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId]) - }, unmarshalQuotum); - pageOfListJWTs = request => this.client.fetch({ - method: 'GET', - path: `/iam/v1alpha1/jwts`, - urlParams: urlParams(['audience_id', request.audienceId], ['expired', request.expired], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]) - }, unmarshalListJWTsResponse); - + createNetwork = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateNetworkRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/iot/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/networks` + }, + marshalling_gen.unmarshalCreateNetworkResponse + ); /** - * List JWTs. + * Retrieve a specific network. Retrieve an existing network, specified by its + * network ID. The response returns full details of the network, including its + * type, the topic prefix and its endpoint. * - * @param request - The request {@link ListJWTsRequest} - * @returns A Promise of ListJWTsResponse + * @param request - The request {@link GetNetworkRequest} + * @returns A Promise of Network */ - listJWTs = request => enrichForPagination('jwts', this.pageOfListJWTs, request); - + getNetwork = (request) => this.client.fetch( + { + method: "GET", + path: `/iot/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/networks/${marshalling.validatePathParam("networkId", request.networkId)}` + }, + marshalling_gen.unmarshalNetwork + ); /** - * Get a JWT. + * Delete a Network. Delete an existing network, specified by its network ID. + * Deleting a network is permanent, and cannot be undone. * - * @param request - The request {@link GetJWTRequest} - * @returns A Promise of JWT + * @param request - The request {@link DeleteNetworkRequest} */ - getJWT = request => this.client.fetch({ - method: 'GET', - path: `/iam/v1alpha1/jwts/${validatePathParam('jti', request.jti)}` - }, unmarshalJWT); - + deleteNetwork = (request) => this.client.fetch({ + method: "DELETE", + path: `/iot/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/networks/${marshalling.validatePathParam("networkId", request.networkId)}` + }); /** - * Delete a JWT. + * BETA - Get a Cloud Twin Document. * - * @param request - The request {@link DeleteJWTRequest} + * @param request - The request {@link GetTwinDocumentRequest} + * @returns A Promise of TwinDocument */ - deleteJWT = request => this.client.fetch({ - method: 'DELETE', - path: `/iam/v1alpha1/jwts/${validatePathParam('jti', request.jti)}` - }); -}; - -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. - -const CreateAPIKeyRequest = { - description: { - ignoreEmpty: true, - maxLength: 200 - } -}; -const CreateApplicationRequest = { - description: { - ignoreEmpty: true, - maxLength: 200 - }, - name: { - maxLength: 64, - minLength: 1, - pattern: /^[a-zA-Z0-9\(\)\._\- ]+$/ - } -}; -const CreateGroupRequest = { - description: { - ignoreEmpty: true, - maxLength: 200 - }, - name: { - maxLength: 64, - minLength: 1, - pattern: /^[a-zA-Z0-9\(\)\._\- ]+$/ - } -}; -const CreatePolicyRequest = { - description: { - ignoreEmpty: true, - maxLength: 200 - }, - name: { - maxLength: 64, - minLength: 1, - pattern: /^[a-zA-Z0-9\(\)\._\- ]+$/ - } -}; -const CreateSSHKeyRequest = { - name: { - ignoreEmpty: true, - maxLength: 1000 - }, - publicKey: { - maxLength: 65000, - minLength: 1 - } -}; -const GetQuotumRequest = { - quotumName: { - minLength: 1 - } -}; -const ListAPIKeysRequest = { - description: { - maxLength: 200 - }, - page: { - greaterThan: 0 - }, - pageSize: { - greaterThanOrEqual: 1, - lessThanOrEqual: 100 - } -}; -const ListApplicationsRequest = { - name: { - maxLength: 64, - minLength: 1, - pattern: /^[a-zA-Z0-9\(\)\._\- ]+$/ - }, - page: { - greaterThan: 0 - }, - pageSize: { - greaterThanOrEqual: 1, - lessThanOrEqual: 100 - } -}; -const ListGroupsRequest = { - name: { - minLength: 1 - }, - page: { - greaterThan: 0 - }, - pageSize: { - greaterThanOrEqual: 1, - lessThanOrEqual: 100 - } -}; -const ListJWTsRequest = { - page: { - greaterThan: 0 - }, - pageSize: { - greaterThanOrEqual: 1, - lessThanOrEqual: 100 - } -}; -const ListPermissionSetsRequest = { - page: { - greaterThan: 0 - }, - pageSize: { - greaterThanOrEqual: 1, - lessThanOrEqual: 100 - } -}; -const ListPoliciesRequest = { - page: { - greaterThan: 0 - }, - pageSize: { - greaterThanOrEqual: 1, - lessThanOrEqual: 100 - }, - policyName: { - minLength: 1 - } -}; -const ListQuotaRequest = { - page: { - greaterThan: 0 - }, - pageSize: { - greaterThanOrEqual: 1, - lessThanOrEqual: 100 - } -}; -const ListRulesRequest = { - page: { - greaterThan: 0 - }, - pageSize: { - greaterThanOrEqual: 1, - lessThanOrEqual: 100 - } -}; -const ListSSHKeysRequest = { - name: { - maxLength: 1000, - minLength: 1 - }, - page: { - greaterThan: 0 - }, - pageSize: { - greaterThanOrEqual: 1, - lessThanOrEqual: 100 - } -}; -const ListUsersRequest = { - page: { - greaterThan: 0 - }, - pageSize: { - greaterThanOrEqual: 1, - lessThanOrEqual: 100 - } -}; -const UpdateAPIKeyRequest = { - description: { - maxLength: 200 - } -}; -const UpdateApplicationRequest = { - description: { - maxLength: 200 - }, - name: { - maxLength: 64, - minLength: 1, - pattern: /^[a-zA-Z0-9\(\)\._\- ]+$/ - } -}; -const UpdateGroupRequest = { - description: { - maxLength: 200 - }, - name: { - maxLength: 64, - minLength: 1, - pattern: /^[a-zA-Z0-9\(\)\._\- ]+$/ - } -}; -const UpdatePolicyRequest = { - description: { - maxLength: 200 - }, - name: { - maxLength: 64, - minLength: 1, - pattern: /^[a-zA-Z0-9\(\)\._\- ]+$/ - } -}; -const UpdateSSHKeyRequest = { - name: { - maxLength: 1000 - } -}; + getTwinDocument = (request) => this.client.fetch( + { + method: "GET", + path: `/iot/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/twins/${marshalling.validatePathParam("twinId", request.twinId)}/documents/${marshalling.validatePathParam("documentName", request.documentName)}` + }, + marshalling_gen.unmarshalTwinDocument + ); + /** + * BETA - Update a Cloud Twin Document. + * + * @param request - The request {@link PutTwinDocumentRequest} + * @returns A Promise of TwinDocument + */ + putTwinDocument = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalPutTwinDocumentRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PUT", + path: `/iot/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/twins/${marshalling.validatePathParam("twinId", request.twinId)}/documents/${marshalling.validatePathParam("documentName", request.documentName)}` + }, + marshalling_gen.unmarshalTwinDocument + ); + /** + * BETA - Patch a Cloud Twin Document. + * + * @param request - The request {@link PatchTwinDocumentRequest} + * @returns A Promise of TwinDocument + */ + patchTwinDocument = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalPatchTwinDocumentRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/iot/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/twins/${marshalling.validatePathParam("twinId", request.twinId)}/documents/${marshalling.validatePathParam("documentName", request.documentName)}` + }, + marshalling_gen.unmarshalTwinDocument + ); + /** + * BETA - Delete a Cloud Twin Document. + * + * @param request - The request {@link DeleteTwinDocumentRequest} + */ + deleteTwinDocument = (request) => this.client.fetch({ + method: "DELETE", + path: `/iot/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/twins/${marshalling.validatePathParam("twinId", request.twinId)}/documents/${marshalling.validatePathParam("documentName", request.documentName)}` + }); + /** + * BETA - List the documents of a Cloud Twin. + * + * @param request - The request {@link ListTwinDocumentsRequest} + * @returns A Promise of ListTwinDocumentsResponse + */ + listTwinDocuments = (request) => this.client.fetch( + { + method: "GET", + path: `/iot/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/twins/${marshalling.validatePathParam("twinId", request.twinId)}` + }, + marshalling_gen.unmarshalListTwinDocumentsResponse + ); + /** + * BETA - Delete all the documents of a Cloud Twin. + * + * @param request - The request {@link DeleteTwinDocumentsRequest} + */ + deleteTwinDocuments = (request) => this.client.fetch({ + method: "DELETE", + path: `/iot/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/twins/${marshalling.validatePathParam("twinId", request.twinId)}` + }); +} +exports.API = API; -var validationRules_gen$4 = /*#__PURE__*/Object.freeze({ - __proto__: null, - CreateAPIKeyRequest: CreateAPIKeyRequest, - CreateApplicationRequest: CreateApplicationRequest, - CreateGroupRequest: CreateGroupRequest, - CreatePolicyRequest: CreatePolicyRequest, - CreateSSHKeyRequest: CreateSSHKeyRequest, - GetQuotumRequest: GetQuotumRequest, - ListAPIKeysRequest: ListAPIKeysRequest, - ListApplicationsRequest: ListApplicationsRequest, - ListGroupsRequest: ListGroupsRequest, - ListJWTsRequest: ListJWTsRequest, - ListPermissionSetsRequest: ListPermissionSetsRequest, - ListPoliciesRequest: ListPoliciesRequest, - ListQuotaRequest: ListQuotaRequest, - ListRulesRequest: ListRulesRequest, - ListSSHKeysRequest: ListSSHKeysRequest, - ListUsersRequest: ListUsersRequest, - UpdateAPIKeyRequest: UpdateAPIKeyRequest, - UpdateApplicationRequest: UpdateApplicationRequest, - UpdateGroupRequest: UpdateGroupRequest, - UpdatePolicyRequest: UpdatePolicyRequest, - UpdateSSHKeyRequest: UpdateSSHKeyRequest -}); -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. +/***/ }), + +/***/ 2635: +/***/ ((__unused_webpack_module, exports) => { -var index_gen$g = /*#__PURE__*/Object.freeze({ - __proto__: null, - API: API$i, - ValidationRules: validationRules_gen$4 -}); +"use strict"; -var index$j = /*#__PURE__*/Object.freeze({ - __proto__: null, - v1alpha1: index_gen$g -}); +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const HUB_TRANSIENT_STATUSES = ["enabling", "disabling"]; +exports.HUB_TRANSIENT_STATUSES = HUB_TRANSIENT_STATUSES; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const unmarshalServerSummary = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ServerSummary' failed as data isn't a dictionary.`); - } - return { - id: data.id, - name: data.name - }; -}; -const unmarshalBootscript = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Bootscript' failed as data isn't a dictionary.`); - } - return { - arch: data.arch, - bootcmdargs: data.bootcmdargs, - default: data.default, - dtb: data.dtb, - id: data.id, - initrd: data.initrd, - kernel: data.kernel, - organization: data.organization, - project: data.project, - public: data.public, - title: data.title, - zone: data.zone - }; -}; -const unmarshalServerTypeNetworkInterface = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ServerTypeNetworkInterface' failed as data isn't a dictionary.`); + +/***/ }), + +/***/ 6100: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api_gen = __nccwpck_require__(5544); +const content_gen = __nccwpck_require__(2635); +exports.API = api_gen.API; +exports.HUB_TRANSIENT_STATUSES = content_gen.HUB_TRANSIENT_STATUSES; + + +/***/ }), + +/***/ 5074: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const randomName = __nccwpck_require__(8141); +const json = __nccwpck_require__(3746); +const customMarshalling = __nccwpck_require__(7586); +const marshalling = __nccwpck_require__(1162); +const unmarshalDeviceMessageFiltersRule = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DeviceMessageFiltersRule' failed as data isn't a dictionary.` + ); } return { - internalBandwidth: data.internal_bandwidth, - internetBandwidth: data.internet_bandwidth + policy: data.policy, + topics: data.topics }; }; -const unmarshalServerTypeVolumeConstraintSizes = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ServerTypeVolumeConstraintSizes' failed as data isn't a dictionary.`); +const unmarshalDeviceMessageFilters = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DeviceMessageFilters' failed as data isn't a dictionary.` + ); } return { - maxSize: data.max_size, - minSize: data.min_size + publish: data.publish ? unmarshalDeviceMessageFiltersRule(data.publish) : void 0, + subscribe: data.subscribe ? unmarshalDeviceMessageFiltersRule(data.subscribe) : void 0 }; }; -const unmarshalVolume$2 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Volume' failed as data isn't a dictionary.`); +const unmarshalDevice = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Device' failed as data isn't a dictionary.` + ); } return { - creationDate: unmarshalDate(data.creation_date), - exportUri: data.export_uri, + allowInsecure: data.allow_insecure, + allowMultipleConnections: data.allow_multiple_connections, + createdAt: marshalling.unmarshalDate(data.created_at), + description: data.description, + hasCustomCertificate: data.has_custom_certificate, + hubId: data.hub_id, id: data.id, - modificationDate: unmarshalDate(data.modification_date), + isConnected: data.is_connected, + lastActivityAt: marshalling.unmarshalDate(data.last_activity_at), + messageFilters: data.message_filters ? unmarshalDeviceMessageFilters(data.message_filters) : void 0, name: data.name, - organization: data.organization, - project: data.project, - server: data.server ? unmarshalServerSummary(data.server) : undefined, - size: data.size, - state: data.state, - tags: data.tags, - volumeType: data.volume_type, - zone: data.zone + status: data.status, + updatedAt: marshalling.unmarshalDate(data.updated_at) }; }; -const unmarshalVolumeSummary = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'VolumeSummary' failed as data isn't a dictionary.`); +const unmarshalNetwork = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Network' failed as data isn't a dictionary.` + ); } return { + createdAt: marshalling.unmarshalDate(data.created_at), + endpoint: data.endpoint, + hubId: data.hub_id, id: data.id, name: data.name, - size: data.size, - volumeType: data.volume_type + topicPrefix: data.topic_prefix, + type: data.type }; }; -const unmarshalImage$3 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Image' failed as data isn't a dictionary.`); +const unmarshalHubTwinsGraphiteConfig = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'HubTwinsGraphiteConfig' failed as data isn't a dictionary.` + ); } return { - arch: data.arch, - creationDate: unmarshalDate(data.creation_date), - defaultBootscript: data.default_bootscript ? unmarshalBootscript(data.default_bootscript) : undefined, - extraVolumes: unmarshalMapOfObject(data.extra_volumes, unmarshalVolume$2), - fromServer: data.from_server, - id: data.id, - modificationDate: unmarshalDate(data.modification_date), - name: data.name, - organization: data.organization, - project: data.project, - public: data.public, - rootVolume: data.root_volume ? unmarshalVolumeSummary(data.root_volume) : undefined, - state: data.state, - tags: data.tags, - zone: data.zone + pushUri: data.push_uri }; }; -const unmarshalPlacementGroup = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'PlacementGroup' failed as data isn't a dictionary.`); +const unmarshalHub = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Hub' failed as data isn't a dictionary.` + ); } return { + connectedDeviceCount: data.connected_device_count, + createdAt: marshalling.unmarshalDate(data.created_at), + deviceCount: data.device_count, + disableEvents: data.disable_events, + enableDeviceAutoProvisioning: data.enable_device_auto_provisioning, + enabled: data.enabled, + endpoint: data.endpoint, + eventsTopicPrefix: data.events_topic_prefix, + hasCustomCa: data.has_custom_ca, id: data.id, name: data.name, - organization: data.organization, - policyMode: data.policy_mode, - policyRespected: data.policy_respected, - policyType: data.policy_type, - project: data.project, - tags: data.tags, - zone: data.zone + organizationId: data.organization_id, + productPlan: data.product_plan, + projectId: data.project_id, + region: data.region, + status: data.status, + twinsGraphiteConfig: data.twins_graphite_config ? unmarshalHubTwinsGraphiteConfig(data.twins_graphite_config) : void 0, + updatedAt: marshalling.unmarshalDate(data.updated_at) }; }; -const unmarshalPrivateNIC = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'PrivateNIC' failed as data isn't a dictionary.`); +const unmarshalCertificate = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Certificate' failed as data isn't a dictionary.` + ); } return { - id: data.id, - macAddress: data.mac_address, - privateNetworkId: data.private_network_id, - serverId: data.server_id, - state: data.state, - tags: data.tags + crt: data.crt, + key: data.key }; }; -const unmarshalSecurityGroupSummary = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'SecurityGroupSummary' failed as data isn't a dictionary.`); +const unmarshalCreateDeviceResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'CreateDeviceResponse' failed as data isn't a dictionary.` + ); } return { - id: data.id, - name: data.name + certificate: data.certificate ? unmarshalCertificate(data.certificate) : void 0, + device: data.device ? unmarshalDevice(data.device) : void 0 }; }; -const unmarshalServerIp = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ServerIp' failed as data isn't a dictionary.`); +const unmarshalCreateNetworkResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'CreateNetworkResponse' failed as data isn't a dictionary.` + ); } return { - address: data.address, - dynamic: data.dynamic, - family: data.family, - gateway: data.gateway, - id: data.id, - netmask: data.netmask, - provisioningMode: data.provisioning_mode, - tags: data.tags + network: data.network ? unmarshalNetwork(data.network) : void 0, + secret: data.secret }; }; -const unmarshalServerIpv6 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ServerIpv6' failed as data isn't a dictionary.`); +const unmarshalGetDeviceCertificateResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'GetDeviceCertificateResponse' failed as data isn't a dictionary.` + ); } return { - address: data.address, - gateway: data.gateway, - netmask: data.netmask + certificatePem: data.certificate_pem, + device: data.device ? unmarshalDevice(data.device) : void 0 }; }; -const unmarshalServerLocation = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ServerLocation' failed as data isn't a dictionary.`); +const unmarshalGetDeviceMetricsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'GetDeviceMetricsResponse' failed as data isn't a dictionary.` + ); } return { - clusterId: data.cluster_id, - hypervisorId: data.hypervisor_id, - nodeId: data.node_id, - platformId: data.platform_id, - zoneId: data.zone_id + metrics: marshalling.unmarshalArrayOfObject(data.metrics, customMarshalling.unmarshalTimeSeries) }; }; -const unmarshalServerMaintenance = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ServerMaintenance' failed as data isn't a dictionary.`); +const unmarshalGetHubCAResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'GetHubCAResponse' failed as data isn't a dictionary.` + ); } return { - reason: data.reason + caCertPem: data.ca_cert_pem }; }; -const unmarshalServerTypeCapabilities = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ServerTypeCapabilities' failed as data isn't a dictionary.`); +const unmarshalGetHubMetricsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'GetHubMetricsResponse' failed as data isn't a dictionary.` + ); } return { - blockStorage: data.block_storage, - bootTypes: data.boot_types + metrics: marshalling.unmarshalArrayOfObject(data.metrics, customMarshalling.unmarshalTimeSeries) }; }; -const unmarshalServerTypeNetwork = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ServerTypeNetwork' failed as data isn't a dictionary.`); +const unmarshalListDevicesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListDevicesResponse' failed as data isn't a dictionary.` + ); } return { - interfaces: unmarshalArrayOfObject(data.interfaces, unmarshalServerTypeNetworkInterface), - ipv6Support: data.ipv6_support, - sumInternalBandwidth: data.sum_internal_bandwidth, - sumInternetBandwidth: data.sum_internet_bandwidth + devices: marshalling.unmarshalArrayOfObject(data.devices, unmarshalDevice), + totalCount: data.total_count }; }; -const unmarshalServerTypeVolumeConstraintsByType = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ServerTypeVolumeConstraintsByType' failed as data isn't a dictionary.`); +const unmarshalListHubsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListHubsResponse' failed as data isn't a dictionary.` + ); } return { - lSsd: data.l_ssd ? unmarshalServerTypeVolumeConstraintSizes(data.l_ssd) : undefined + hubs: marshalling.unmarshalArrayOfObject(data.hubs, unmarshalHub), + totalCount: data.total_count }; }; -const unmarshalSnapshotBaseVolume = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'SnapshotBaseVolume' failed as data isn't a dictionary.`); +const unmarshalListNetworksResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListNetworksResponse' failed as data isn't a dictionary.` + ); } return { - id: data.id, - name: data.name + networks: marshalling.unmarshalArrayOfObject(data.networks, unmarshalNetwork), + totalCount: data.total_count }; }; -const unmarshalVolumeServer = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'VolumeServer' failed as data isn't a dictionary.`); +const unmarshalRouteSummary = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'RouteSummary' failed as data isn't a dictionary.` + ); } return { - boot: data.boot, - creationDate: unmarshalDate(data.creation_date), - exportUri: data.export_uri, + createdAt: marshalling.unmarshalDate(data.created_at), + hubId: data.hub_id, id: data.id, - modificationDate: unmarshalDate(data.modification_date), name: data.name, - organization: data.organization, - project: data.project, - server: data.server ? unmarshalServerSummary(data.server) : undefined, - size: data.size, - state: data.state, - volumeType: data.volume_type, - zone: data.zone - }; -}; -const unmarshalVolumeTypeCapabilities = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'VolumeTypeCapabilities' failed as data isn't a dictionary.`); - } - return { - snapshot: data.snapshot - }; -}; -const unmarshalVolumeTypeConstraints = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'VolumeTypeConstraints' failed as data isn't a dictionary.`); - } - return { - max: data.max, - min: data.min - }; -}; -const unmarshalDashboard = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Dashboard' failed as data isn't a dictionary.`); - } - return { - imagesCount: data.images_count, - ipsCount: data.ips_count, - ipsUnused: data.ips_unused, - placementGroupsCount: data.placement_groups_count, - privateNicsCount: data.private_nics_count, - runningServersCount: data.running_servers_count, - securityGroupsCount: data.security_groups_count, - serversByTypes: data.servers_by_types, - serversCount: data.servers_count, - snapshotsCount: data.snapshots_count, - volumesBSsdCount: data.volumes_b_ssd_count, - volumesBSsdTotalSize: data.volumes_b_ssd_total_size, - volumesCount: data.volumes_count, - volumesLSsdCount: data.volumes_l_ssd_count, - volumesLSsdTotalSize: data.volumes_l_ssd_total_size + topic: data.topic, + type: data.type, + updatedAt: marshalling.unmarshalDate(data.updated_at) }; }; -const unmarshalGetServerTypesAvailabilityResponseAvailability = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'GetServerTypesAvailabilityResponseAvailability' failed as data isn't a dictionary.`); +const unmarshalListRoutesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListRoutesResponse' failed as data isn't a dictionary.` + ); } return { - availability: data.availability + routes: marshalling.unmarshalArrayOfObject(data.routes, unmarshalRouteSummary), + totalCount: data.total_count }; }; -const unmarshalIp$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Ip' failed as data isn't a dictionary.`); +const unmarshalListTwinDocumentsResponseDocumentSummary = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListTwinDocumentsResponseDocumentSummary' failed as data isn't a dictionary.` + ); } return { - address: data.address, - id: data.id, - organization: data.organization, - prefix: data.prefix, - project: data.project, - reverse: data.reverse, - server: data.server ? unmarshalServerSummary(data.server) : undefined, - state: data.state, - tags: data.tags, - type: data.type, - zone: data.zone + documentName: data.document_name }; }; -const unmarshalPlacementGroupServer = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'PlacementGroupServer' failed as data isn't a dictionary.`); +const unmarshalListTwinDocumentsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListTwinDocumentsResponse' failed as data isn't a dictionary.` + ); } return { - id: data.id, - name: data.name, - policyRespected: data.policy_respected + documents: marshalling.unmarshalArrayOfObject( + data.documents, + unmarshalListTwinDocumentsResponseDocumentSummary + ) }; }; -const unmarshalSecurityGroup = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'SecurityGroup' failed as data isn't a dictionary.`); +const unmarshalRenewDeviceCertificateResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'RenewDeviceCertificateResponse' failed as data isn't a dictionary.` + ); } return { - creationDate: unmarshalDate(data.creation_date), - description: data.description, - enableDefaultSecurity: data.enable_default_security, - id: data.id, - inboundDefaultPolicy: data.inbound_default_policy, - modificationDate: unmarshalDate(data.modification_date), - name: data.name, - organization: data.organization, - organizationDefault: data.organization_default, - outboundDefaultPolicy: data.outbound_default_policy, - project: data.project, - projectDefault: data.project_default, - servers: unmarshalArrayOfObject(data.servers, unmarshalServerSummary), - state: data.state, - stateful: data.stateful, - tags: data.tags, - zone: data.zone + certificate: data.certificate ? unmarshalCertificate(data.certificate) : void 0, + device: data.device ? unmarshalDevice(data.device) : void 0 }; }; -const unmarshalSecurityGroupRule = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'SecurityGroupRule' failed as data isn't a dictionary.`); +const unmarshalRouteDatabaseConfig = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'RouteDatabaseConfig' failed as data isn't a dictionary.` + ); } return { - action: data.action, - destPortFrom: data.dest_port_from, - destPortTo: data.dest_port_to, - direction: data.direction, - editable: data.editable, - id: data.id, - ipRange: data.ip_range, - position: data.position, - protocol: data.protocol, - zone: data.zone + dbname: data.dbname, + engine: data.engine, + host: data.host, + password: data.password, + port: data.port, + query: data.query, + username: data.username }; }; -const unmarshalServer = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Server' failed as data isn't a dictionary.`); +const unmarshalRouteRestConfig = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'RouteRestConfig' failed as data isn't a dictionary.` + ); } return { - allowedActions: data.allowed_actions, - arch: data.arch, - bootscript: data.bootscript ? unmarshalBootscript(data.bootscript) : undefined, - bootType: data.boot_type, - commercialType: data.commercial_type, - creationDate: unmarshalDate(data.creation_date), - dynamicIpRequired: data.dynamic_ip_required, - enableIpv6: data.enable_ipv6, - hostname: data.hostname, - id: data.id, - image: data.image ? unmarshalImage$3(data.image) : undefined, - ipv6: data.ipv6 ? unmarshalServerIpv6(data.ipv6) : undefined, - location: data.location ? unmarshalServerLocation(data.location) : undefined, - macAddress: data.mac_address, - maintenances: unmarshalArrayOfObject(data.maintenances, unmarshalServerMaintenance), - modificationDate: unmarshalDate(data.modification_date), - name: data.name, - organization: data.organization, - placementGroup: data.placement_group ? unmarshalPlacementGroup(data.placement_group) : undefined, - privateIp: data.private_ip, - privateNics: unmarshalArrayOfObject(data.private_nics, unmarshalPrivateNIC), - project: data.project, - protected: data.protected, - publicIp: data.public_ip ? unmarshalServerIp(data.public_ip) : undefined, - publicIps: unmarshalArrayOfObject(data.public_ips, unmarshalServerIp), - routedIpEnabled: data.routed_ip_enabled, - securityGroup: data.security_group ? unmarshalSecurityGroupSummary(data.security_group) : undefined, - state: data.state, - stateDetail: data.state_detail, - tags: data.tags, - volumes: unmarshalMapOfObject(data.volumes, unmarshalVolumeServer), - zone: data.zone + headers: data.headers, + uri: data.uri, + verb: data.verb }; }; -const unmarshalServerType = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ServerType' failed as data isn't a dictionary.`); +const unmarshalRouteS3Config = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'RouteS3Config' failed as data isn't a dictionary.` + ); } return { - altNames: data.alt_names, - arch: data.arch, - baremetal: data.baremetal, - capabilities: data.capabilities ? unmarshalServerTypeCapabilities(data.capabilities) : undefined, - gpu: data.gpu, - hourlyPrice: data.hourly_price, - monthlyPrice: data.monthly_price, - ncpus: data.ncpus, - network: data.network ? unmarshalServerTypeNetwork(data.network) : undefined, - perVolumeConstraint: data.per_volume_constraint ? unmarshalServerTypeVolumeConstraintsByType(data.per_volume_constraint) : undefined, - ram: data.ram, - scratchStorageMaxSize: data.scratch_storage_max_size, - volumesConstraint: data.volumes_constraint ? unmarshalServerTypeVolumeConstraintSizes(data.volumes_constraint) : undefined + bucketName: data.bucket_name, + bucketRegion: data.bucket_region, + objectPrefix: data.object_prefix, + strategy: data.strategy }; }; -const unmarshalSnapshot$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Snapshot' failed as data isn't a dictionary.`); +const unmarshalRoute = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Route' failed as data isn't a dictionary.` + ); } return { - baseVolume: data.base_volume ? unmarshalSnapshotBaseVolume(data.base_volume) : undefined, - creationDate: unmarshalDate(data.creation_date), - errorReason: data.error_reason, + createdAt: marshalling.unmarshalDate(data.created_at), + dbConfig: data.db_config ? unmarshalRouteDatabaseConfig(data.db_config) : void 0, + hubId: data.hub_id, id: data.id, - modificationDate: unmarshalDate(data.modification_date), name: data.name, - organization: data.organization, - project: data.project, - size: data.size, - state: data.state, - tags: data.tags, - volumeType: data.volume_type, - zone: data.zone + restConfig: data.rest_config ? unmarshalRouteRestConfig(data.rest_config) : void 0, + s3Config: data.s3_config ? unmarshalRouteS3Config(data.s3_config) : void 0, + topic: data.topic, + type: data.type, + updatedAt: marshalling.unmarshalDate(data.updated_at) }; }; -const unmarshalTask = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Task' failed as data isn't a dictionary.`); +const unmarshalSetDeviceCertificateResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SetDeviceCertificateResponse' failed as data isn't a dictionary.` + ); } return { - description: data.description, - hrefFrom: data.href_from, - hrefResult: data.href_result, - id: data.id, - progress: data.progress, - startedAt: unmarshalDate(data.started_at), - status: data.status, - terminatedAt: unmarshalDate(data.terminated_at), - zone: data.zone + certificatePem: data.certificate_pem, + device: data.device ? unmarshalDevice(data.device) : void 0 + }; +}; +const unmarshalTwinDocument = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'TwinDocument' failed as data isn't a dictionary.` + ); + } + return { + data: data.data, + documentName: data.document_name, + twinId: data.twin_id, + version: data.version }; }; -const unmarshalVolumeType = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'VolumeType' failed as data isn't a dictionary.`); +const marshalDeviceMessageFiltersRule = (request, defaults) => ({ + policy: request.policy, + topics: request.topics +}); +const marshalDeviceMessageFilters = (request, defaults) => ({ + publish: request.publish !== void 0 ? marshalDeviceMessageFiltersRule(request.publish) : void 0, + subscribe: request.subscribe !== void 0 ? marshalDeviceMessageFiltersRule(request.subscribe) : void 0 +}); +const marshalCreateDeviceRequest = (request, defaults) => ({ + allow_insecure: request.allowInsecure, + allow_multiple_connections: request.allowMultipleConnections, + description: request.description, + hub_id: request.hubId, + message_filters: request.messageFilters !== void 0 ? marshalDeviceMessageFilters(request.messageFilters) : void 0, + name: request.name || randomName("device") +}); +const marshalHubTwinsGraphiteConfig = (request, defaults) => ({ + push_uri: request.pushUri +}); +const marshalCreateHubRequest = (request, defaults) => ({ + disable_events: request.disableEvents, + events_topic_prefix: request.eventsTopicPrefix, + name: request.name || randomName("hub"), + product_plan: request.productPlan, + project_id: request.projectId ?? defaults.defaultProjectId, + ...marshalling.resolveOneOf([ + { + param: "twins_graphite_config", + value: request.twinsGraphiteConfig !== void 0 ? marshalHubTwinsGraphiteConfig(request.twinsGraphiteConfig) : void 0 + } + ]) +}); +const marshalCreateNetworkRequest = (request, defaults) => ({ + hub_id: request.hubId, + name: request.name || randomName("network"), + topic_prefix: request.topicPrefix, + type: request.type +}); +const marshalCreateRouteRequestDatabaseConfig = (request, defaults) => ({ + dbname: request.dbname, + engine: request.engine, + host: request.host, + password: request.password, + port: request.port, + query: request.query, + username: request.username +}); +const marshalCreateRouteRequestRestConfig = (request, defaults) => ({ + headers: request.headers, + uri: request.uri, + verb: request.verb +}); +const marshalCreateRouteRequestS3Config = (request, defaults) => ({ + bucket_name: request.bucketName, + bucket_region: request.bucketRegion, + object_prefix: request.objectPrefix, + strategy: request.strategy +}); +const marshalCreateRouteRequest = (request, defaults) => ({ + hub_id: request.hubId, + name: request.name || randomName("route"), + topic: request.topic, + ...marshalling.resolveOneOf([ + { + param: "s3_config", + value: request.s3Config !== void 0 ? marshalCreateRouteRequestS3Config(request.s3Config) : void 0 + }, + { + param: "db_config", + value: request.dbConfig !== void 0 ? marshalCreateRouteRequestDatabaseConfig(request.dbConfig) : void 0 + }, + { + param: "rest_config", + value: request.restConfig !== void 0 ? marshalCreateRouteRequestRestConfig(request.restConfig) : void 0 + } + ]) +}); +const marshalPatchTwinDocumentRequest = (request, defaults) => ({ + data: request.data, + version: request.version +}); +const marshalPutTwinDocumentRequest = (request, defaults) => ({ + data: request.data, + version: request.version +}); +const marshalSetDeviceCertificateRequest = (request, defaults) => ({ + certificate_pem: request.certificatePem +}); +const marshalSetHubCARequest = (request, defaults) => ({ + ca_cert_pem: request.caCertPem, + challenge_cert_pem: request.challengeCertPem +}); +const marshalUpdateDeviceRequest = (request, defaults) => ({ + allow_insecure: request.allowInsecure, + allow_multiple_connections: request.allowMultipleConnections, + description: request.description, + hub_id: request.hubId, + message_filters: request.messageFilters !== void 0 ? marshalDeviceMessageFilters(request.messageFilters) : void 0 +}); +const marshalUpdateHubRequest = (request, defaults) => ({ + disable_events: request.disableEvents, + enable_device_auto_provisioning: request.enableDeviceAutoProvisioning, + events_topic_prefix: request.eventsTopicPrefix, + name: request.name, + product_plan: request.productPlan, + ...marshalling.resolveOneOf([ + { + param: "twins_graphite_config", + value: request.twinsGraphiteConfig !== void 0 ? marshalHubTwinsGraphiteConfig(request.twinsGraphiteConfig) : void 0 + } + ]) +}); +const marshalUpdateRouteRequestDatabaseConfig = (request, defaults) => ({ + dbname: request.dbname, + engine: request.engine, + host: request.host, + password: request.password, + port: request.port, + query: request.query, + username: request.username +}); +const marshalUpdateRouteRequestRestConfig = (request, defaults) => ({ + headers: request.headers, + uri: request.uri, + verb: request.verb +}); +const marshalUpdateRouteRequestS3Config = (request, defaults) => ({ + bucket_name: request.bucketName, + bucket_region: request.bucketRegion, + object_prefix: request.objectPrefix, + strategy: request.strategy +}); +const marshalUpdateRouteRequest = (request, defaults) => ({ + name: request.name, + topic: request.topic, + ...marshalling.resolveOneOf([ + { + param: "s3_config", + value: request.s3Config !== void 0 ? marshalUpdateRouteRequestS3Config(request.s3Config) : void 0 + }, + { + param: "db_config", + value: request.dbConfig !== void 0 ? marshalUpdateRouteRequestDatabaseConfig(request.dbConfig) : void 0 + }, + { + param: "rest_config", + value: request.restConfig !== void 0 ? marshalUpdateRouteRequestRestConfig(request.restConfig) : void 0 + } + ]) +}); +exports.marshalCreateDeviceRequest = marshalCreateDeviceRequest; +exports.marshalCreateHubRequest = marshalCreateHubRequest; +exports.marshalCreateNetworkRequest = marshalCreateNetworkRequest; +exports.marshalCreateRouteRequest = marshalCreateRouteRequest; +exports.marshalPatchTwinDocumentRequest = marshalPatchTwinDocumentRequest; +exports.marshalPutTwinDocumentRequest = marshalPutTwinDocumentRequest; +exports.marshalSetDeviceCertificateRequest = marshalSetDeviceCertificateRequest; +exports.marshalSetHubCARequest = marshalSetHubCARequest; +exports.marshalUpdateDeviceRequest = marshalUpdateDeviceRequest; +exports.marshalUpdateHubRequest = marshalUpdateHubRequest; +exports.marshalUpdateRouteRequest = marshalUpdateRouteRequest; +exports.unmarshalCreateDeviceResponse = unmarshalCreateDeviceResponse; +exports.unmarshalCreateNetworkResponse = unmarshalCreateNetworkResponse; +exports.unmarshalDevice = unmarshalDevice; +exports.unmarshalGetDeviceCertificateResponse = unmarshalGetDeviceCertificateResponse; +exports.unmarshalGetDeviceMetricsResponse = unmarshalGetDeviceMetricsResponse; +exports.unmarshalGetHubCAResponse = unmarshalGetHubCAResponse; +exports.unmarshalGetHubMetricsResponse = unmarshalGetHubMetricsResponse; +exports.unmarshalHub = unmarshalHub; +exports.unmarshalListDevicesResponse = unmarshalListDevicesResponse; +exports.unmarshalListHubsResponse = unmarshalListHubsResponse; +exports.unmarshalListNetworksResponse = unmarshalListNetworksResponse; +exports.unmarshalListRoutesResponse = unmarshalListRoutesResponse; +exports.unmarshalListTwinDocumentsResponse = unmarshalListTwinDocumentsResponse; +exports.unmarshalNetwork = unmarshalNetwork; +exports.unmarshalRenewDeviceCertificateResponse = unmarshalRenewDeviceCertificateResponse; +exports.unmarshalRoute = unmarshalRoute; +exports.unmarshalSetDeviceCertificateResponse = unmarshalSetDeviceCertificateResponse; +exports.unmarshalTwinDocument = unmarshalTwinDocument; + + +/***/ }), + +/***/ 7337: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const index_gen = __nccwpck_require__(9785); +exports.v1 = index_gen; + + +/***/ }), + +/***/ 309: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api = __nccwpck_require__(3042); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const resourcePaginator = __nccwpck_require__(4983); +const marshalling_gen = __nccwpck_require__(243); +const jsonContentHeaders = { + "Content-Type": "application/json; charset=utf-8" +}; +class API extends api.API { + /** Lists the available regions of the API. */ + static LOCALITIES = ["fr-par", "nl-ams", "pl-waw"]; + /** + * Reserve a new IP. Reserve a new IP from the specified source. Currently IPs + * can only be reserved from a Private Network. + * + * @param request - The request {@link BookIPRequest} + * @returns A Promise of IP + */ + bookIP = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalBookIPRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/ipam/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips` + }, + marshalling_gen.unmarshalIP + ); + /** + * Release an IP. Release an IP not currently attached to a resource, and + * returns it to the available IP pool. + * + * @param request - The request {@link ReleaseIPRequest} + */ + releaseIP = (request) => this.client.fetch({ + body: "{}", + headers: jsonContentHeaders, + method: "DELETE", + path: `/ipam/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips/${marshalling.validatePathParam("ipId", request.ipId)}` + }); + releaseIPSet = (request = {}) => this.client.fetch({ + body: JSON.stringify( + marshalling_gen.marshalReleaseIPSetRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/ipam/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ip-sets/release` + }); + /** + * Get an IP. Retrieve details of an existing IP, specified by its IP ID. + * + * @param request - The request {@link GetIPRequest} + * @returns A Promise of IP + */ + getIP = (request) => this.client.fetch( + { + method: "GET", + path: `/ipam/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips/${marshalling.validatePathParam("ipId", request.ipId)}` + }, + marshalling_gen.unmarshalIP + ); + /** + * Update an IP. Update parameters including tags of the specified IP. + * + * @param request - The request {@link UpdateIPRequest} + * @returns A Promise of IP + */ + updateIP = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateIPRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/ipam/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips/${marshalling.validatePathParam("ipId", request.ipId)}` + }, + marshalling_gen.unmarshalIP + ); + pageOfListIPs = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/ipam/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips`, + urlParams: marshalling.urlParams( + ["attached", request.attached], + ["is_ipv6", request.isIpv6], + ["mac_address", request.macAddress], + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId], + ["resource_id", request.resourceId], + ["resource_name", request.resourceName], + ["resource_type", request.resourceType], + ["resource_types", request.resourceTypes], + ["tags", request.tags], + ["vpc_id", request.vpcId], + ...Object.entries( + marshalling.resolveOneOf([ + { param: "zonal", value: request.zonal }, + { param: "private_network_id", value: request.privateNetworkId }, + { param: "subnet_id", value: request.subnetId } + ]) + ) + ) + }, + marshalling_gen.unmarshalListIPsResponse + ); + /** + * List existing IPs. List existing IPs in the specified region using various + * filters. For example, you can filter for IPs within a specified Private + * Network, or for public IPs within a specified Project. By default, the IPs + * returned in the list are ordered by creation date in ascending order, + * though this can be modified via the order_by field. + * + * @param request - The request {@link ListIPsRequest} + * @returns A Promise of ListIPsResponse + */ + listIPs = (request = {}) => resourcePaginator.enrichForPagination("ips", this.pageOfListIPs, request); + /** + * Attach IP to custom resource. Attach an existing reserved IP from a Private + * Network subnet to a custom, named resource via its MAC address. An example + * of a custom resource is a virtual machine hosted on an Elastic Metal + * server. Do not use this method for attaching IP addresses to standard + * Scaleway resources as it will fail - see the relevant product API for an + * equivalent method. + * + * @param request - The request {@link AttachIPRequest} + * @returns A Promise of IP + */ + attachIP = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalAttachIPRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/ipam/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips/${marshalling.validatePathParam("ipId", request.ipId)}/attach` + }, + marshalling_gen.unmarshalIP + ); + /** + * Detach IP from a custom resource. Detach a private IP from a custom + * resource. An example of a custom resource is a virtual machine hosted on an + * Elastic Metal server. Do not use this method for detaching IP addresses + * from standard Scaleway resources (e.g. Instances, Load Balancers) as it + * will fail - see the relevant product API for an equivalent method. + * + * @param request - The request {@link DetachIPRequest} + * @returns A Promise of IP + */ + detachIP = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalDetachIPRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/ipam/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips/${marshalling.validatePathParam("ipId", request.ipId)}/detach` + }, + marshalling_gen.unmarshalIP + ); + /** + * Move IP to a custom resource. Move an existing reserved private IP from one + * custom resource (e.g. a virtual machine hosted on an Elastic Metal server) + * to another custom resource. This will detach it from the first resource, + * and attach it to the second. Do not use this method for moving IP addresses + * between standard Scaleway resources (e.g. Instances, Load Balancers) as it + * will fail - see the relevant product API for an equivalent method. + * + * @param request - The request {@link MoveIPRequest} + * @returns A Promise of IP + */ + moveIP = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalMoveIPRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/ipam/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips/${marshalling.validatePathParam("ipId", request.ipId)}/move` + }, + marshalling_gen.unmarshalIP + ); +} +exports.API = API; + + +/***/ }), + +/***/ 9785: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api_gen = __nccwpck_require__(309); +const validationRules_gen = __nccwpck_require__(2064); +exports.API = api_gen.API; +exports.ValidationRules = validationRules_gen; + + +/***/ }), + +/***/ 243: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const json = __nccwpck_require__(3746); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const unmarshalResource = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Resource' failed as data isn't a dictionary.` + ); } return { - capabilities: data.capabilities ? unmarshalVolumeTypeCapabilities(data.capabilities) : undefined, - constraints: data.constraints ? unmarshalVolumeTypeConstraints(data.constraints) : undefined, - displayName: data.display_name + id: data.id, + macAddress: data.mac_address, + name: data.name, + type: data.type }; }; -const unmarshalCreateImageResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'CreateImageResponse' failed as data isn't a dictionary.`); +const unmarshalReverse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Reverse' failed as data isn't a dictionary.` + ); } return { - image: data.image ? unmarshalImage$3(data.image) : undefined + address: data.address, + hostname: data.hostname }; }; -const unmarshalCreateIpResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'CreateIpResponse' failed as data isn't a dictionary.`); +const unmarshalSource = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Source' failed as data isn't a dictionary.` + ); } return { - ip: data.ip ? unmarshalIp$1(data.ip) : undefined + privateNetworkId: data.private_network_id, + subnetId: data.subnet_id, + zonal: data.zonal }; }; -const unmarshalCreatePlacementGroupResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'CreatePlacementGroupResponse' failed as data isn't a dictionary.`); +const unmarshalIP = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'IP' failed as data isn't a dictionary.` + ); } return { - placementGroup: data.placement_group ? unmarshalPlacementGroup(data.placement_group) : undefined + address: data.address, + createdAt: marshalling.unmarshalDate(data.created_at), + id: data.id, + isIpv6: data.is_ipv6, + projectId: data.project_id, + region: data.region, + resource: data.resource ? unmarshalResource(data.resource) : void 0, + reverses: marshalling.unmarshalArrayOfObject(data.reverses, unmarshalReverse), + source: data.source ? unmarshalSource(data.source) : void 0, + tags: data.tags, + updatedAt: marshalling.unmarshalDate(data.updated_at), + zone: data.zone }; }; -const unmarshalCreatePrivateNICResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'CreatePrivateNICResponse' failed as data isn't a dictionary.`); +const unmarshalListIPsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListIPsResponse' failed as data isn't a dictionary.` + ); } return { - privateNic: data.private_nic ? unmarshalPrivateNIC(data.private_nic) : undefined + ips: marshalling.unmarshalArrayOfObject(data.ips, unmarshalIP), + totalCount: data.total_count }; }; -const unmarshalCreateSecurityGroupResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'CreateSecurityGroupResponse' failed as data isn't a dictionary.`); +const marshalCustomResource = (request, defaults) => ({ + mac_address: request.macAddress, + name: request.name +}); +const marshalAttachIPRequest = (request, defaults) => ({ + resource: marshalCustomResource(request.resource) +}); +const marshalSource = (request, defaults) => ({ + ...marshalling.resolveOneOf([ + { param: "zonal", value: request.zonal }, + { param: "private_network_id", value: request.privateNetworkId }, + { param: "subnet_id", value: request.subnetId } + ]) +}); +const marshalBookIPRequest = (request, defaults) => ({ + address: request.address, + is_ipv6: request.isIpv6, + project_id: request.projectId ?? defaults.defaultProjectId, + resource: request.resource !== void 0 ? marshalCustomResource(request.resource) : void 0, + source: marshalSource(request.source), + tags: request.tags +}); +const marshalDetachIPRequest = (request, defaults) => ({ + resource: marshalCustomResource(request.resource) +}); +const marshalMoveIPRequest = (request, defaults) => ({ + from_resource: marshalCustomResource(request.fromResource), + to_resource: request.toResource !== void 0 ? marshalCustomResource(request.toResource) : void 0 +}); +const marshalReleaseIPSetRequest = (request, defaults) => ({ + ip_ids: request.ipIds +}); +const marshalReverse = (request, defaults) => ({ + address: request.address, + hostname: request.hostname +}); +const marshalUpdateIPRequest = (request, defaults) => ({ + reverses: request.reverses !== void 0 ? request.reverses.map((elt) => marshalReverse(elt)) : void 0, + tags: request.tags +}); +exports.marshalAttachIPRequest = marshalAttachIPRequest; +exports.marshalBookIPRequest = marshalBookIPRequest; +exports.marshalDetachIPRequest = marshalDetachIPRequest; +exports.marshalMoveIPRequest = marshalMoveIPRequest; +exports.marshalReleaseIPSetRequest = marshalReleaseIPSetRequest; +exports.marshalUpdateIPRequest = marshalUpdateIPRequest; +exports.unmarshalIP = unmarshalIP; +exports.unmarshalListIPsResponse = unmarshalListIPsResponse; + + +/***/ }), + +/***/ 2064: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const ListIPsRequest = { + resourceName: { + maxLength: 63, + minLength: 2 } - return { - securityGroup: data.security_group ? unmarshalSecurityGroup(data.security_group) : undefined - }; }; -const unmarshalCreateSecurityGroupRuleResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'CreateSecurityGroupRuleResponse' failed as data isn't a dictionary.`); - } - return { - rule: data.rule ? unmarshalSecurityGroupRule(data.rule) : undefined - }; +exports.ListIPsRequest = ListIPsRequest; + + +/***/ }), + +/***/ 5334: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const index_gen = __nccwpck_require__(5513); +exports.v1alpha1 = index_gen; + + +/***/ }), + +/***/ 7269: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const intervalRetrier = __nccwpck_require__(9052); +const api = __nccwpck_require__(3042); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const resourcePaginator = __nccwpck_require__(4983); +const content_gen = __nccwpck_require__(5554); +const marshalling_gen = __nccwpck_require__(2467); +const jsonContentHeaders = { + "Content-Type": "application/json; charset=utf-8" }; -const unmarshalCreateServerResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'CreateServerResponse' failed as data isn't a dictionary.`); +class API extends api.API { + /** Lists the available regions of the API. */ + static LOCALITIES = ["fr-par", "nl-ams", "pl-waw"]; + /** + * Create a new volume. Create a new volume from a Project ID. Volume is + * identified by an ID and used to host pin references. Volume is personal (at + * least to your organization) even if IPFS blocks and CID are available to + * anyone. Should be the first command you made because every pin must be + * attached to a volume. + * + * @param request - The request {@link CreateVolumeRequest} + * @returns A Promise of Volume + */ + createVolume = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateVolumeRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/ipfs/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/volumes` + }, + marshalling_gen.unmarshalVolume + ); + /** + * Get information about a volume. Retrieve information about a specific + * volume. + * + * @param request - The request {@link GetVolumeRequest} + * @returns A Promise of Volume + */ + getVolume = (request) => this.client.fetch( + { + method: "GET", + path: `/ipfs/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/volumes/${marshalling.validatePathParam("volumeId", request.volumeId)}` + }, + marshalling_gen.unmarshalVolume + ); + pageOfListVolumes = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/ipfs/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/volumes`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + [ + "project_id", + request.projectId ?? this.client.settings.defaultProjectId + ] + ) + }, + marshalling_gen.unmarshalListVolumesResponse + ); + /** + * List all volumes by a Project ID. Retrieve information about all volumes + * from a Project ID. + * + * @param request - The request {@link ListVolumesRequest} + * @returns A Promise of ListVolumesResponse + */ + listVolumes = (request = {}) => resourcePaginator.enrichForPagination("volumes", this.pageOfListVolumes, request); + /** + * Update volume information. Update volume information (tag, name...). + * + * @param request - The request {@link UpdateVolumeRequest} + * @returns A Promise of Volume + */ + updateVolume = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateVolumeRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/ipfs/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/volumes/${marshalling.validatePathParam("volumeId", request.volumeId)}` + }, + marshalling_gen.unmarshalVolume + ); + /** + * Delete an existing volume. Delete a volume by its ID and every pin attached + * to this volume. This process can take a while to conclude, depending on the + * size of your pinned content. + * + * @param request - The request {@link DeleteVolumeRequest} + */ + deleteVolume = (request) => this.client.fetch({ + method: "DELETE", + path: `/ipfs/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/volumes/${marshalling.validatePathParam("volumeId", request.volumeId)}` + }); + /** + * Create a pin by URL. Will fetch and store the content pointed by the + * provided URL. The content must be available on the public IPFS network. The + * content (IPFS blocks) will be host by the pinning service until pin + * deletion. From that point, any other IPFS peer can fetch and host your + * content: Make sure to pin public or encrypted content. Many pin requests + * (from different users) can target the same CID. A pin is defined by its ID + * (UUID), its status (queued, pinning, pinned or failed) and target CID. + * + * @param request - The request {@link CreatePinByURLRequest} + * @returns A Promise of Pin + */ + createPinByURL = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreatePinByURLRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/ipfs/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/pins/create-by-url` + }, + marshalling_gen.unmarshalPin + ); + /** + * Create a pin by CID. Will fetch and store the content pointed by the + * provided CID. The content must be available on the public IPFS network. The + * content (IPFS blocks) will be host by the pinning service until pin + * deletion. From that point, any other IPFS peer can fetch and host your + * content: Make sure to pin public or encrypted content. Many pin requests + * (from different users) can target the same CID. A pin is defined by its ID + * (UUID), its status (queued, pinning, pinned or failed) and target CID. + * + * @param request - The request {@link CreatePinByCIDRequest} + * @returns A Promise of Pin + */ + createPinByCID = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreatePinByCIDRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/ipfs/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/pins/create-by-cid` + }, + marshalling_gen.unmarshalPin + ); + /** + * Replace pin by CID. Deletes the given resource ID and pins the new CID in + * its place. Will fetch and store the content pointed by the provided CID. + * The content must be available on the public IPFS network. The content (IPFS + * blocks) is hosted by the pinning service until the pin is deleted. While + * the content is available any other IPFS peer can fetch and host your + * content. For this reason, we recommend that you pin either public or + * encrypted content. Several different pin requests can target the same CID. + * A pin is defined by its ID (UUID), its status (queued, pinning, pinned or + * failed) and target CID. + * + * @param request - The request {@link ReplacePinRequest} + * @returns A Promise of ReplacePinResponse + */ + replacePin = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalReplacePinRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/ipfs/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/pins/${marshalling.validatePathParam("pinId", request.pinId)}/replace` + }, + marshalling_gen.unmarshalReplacePinResponse + ); + /** + * Get pin information. Retrieve information about the provided **pin ID**, + * such as status, last modification, and CID. + * + * @param request - The request {@link GetPinRequest} + * @returns A Promise of Pin + */ + getPin = (request) => this.client.fetch( + { + method: "GET", + path: `/ipfs/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/pins/${marshalling.validatePathParam("pinId", request.pinId)}`, + urlParams: marshalling.urlParams(["volume_id", request.volumeId]) + }, + marshalling_gen.unmarshalPin + ); + /** + * Waits for {@link Pin} to be in a final state. + * + * @param request - The request {@link GetPinRequest} + * @param options - The waiting options + * @returns A Promise of Pin + */ + waitForPin = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve(!content_gen.PIN_TRANSIENT_STATUSES.includes(res.status))), + this.getPin, + request, + options + ); + pageOfListPins = (request) => this.client.fetch( + { + method: "GET", + path: `/ipfs/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/pins`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId], + ["status", request.status], + ["volume_id", request.volumeId] + ) + }, + marshalling_gen.unmarshalListPinsResponse + ); + /** + * List all pins within a volume. Retrieve information about all pins within a + * volume. + * + * @param request - The request {@link ListPinsRequest} + * @returns A Promise of ListPinsResponse + */ + listPins = (request) => resourcePaginator.enrichForPagination("pins", this.pageOfListPins, request); + /** + * Create an unpin request. An unpin request means that you no longer own the + * content. This content can therefore be removed and no longer provided on + * the IPFS network. + * + * @param request - The request {@link DeletePinRequest} + */ + deletePin = (request) => this.client.fetch({ + method: "DELETE", + path: `/ipfs/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/pins/${marshalling.validatePathParam("pinId", request.pinId)}`, + urlParams: marshalling.urlParams(["volume_id", request.volumeId]) + }); +} +class IpnsAPI extends api.API { + /** Lists the available regions of the API. */ + static LOCALITIES = ["fr-par", "nl-ams", "pl-waw"]; + /** + * Create a new name. You can use the `ipns key` command to list and generate + * more names and their respective keys. + * + * @param request - The request {@link IpnsApiCreateNameRequest} + * @returns A Promise of Name + */ + createName = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalIpnsApiCreateNameRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/ipfs/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/names` + }, + marshalling_gen.unmarshalName + ); + /** + * Get information about a name. Retrieve information about a specific name. + * + * @param request - The request {@link IpnsApiGetNameRequest} + * @returns A Promise of Name + */ + getName = (request) => this.client.fetch( + { + method: "GET", + path: `/ipfs/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/names/${marshalling.validatePathParam("nameId", request.nameId)}` + }, + marshalling_gen.unmarshalName + ); + /** + * Waits for {@link Name} to be in a final state. + * + * @param request - The request {@link IpnsApiGetNameRequest} + * @param options - The waiting options + * @returns A Promise of Name + */ + waitForName = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve(!content_gen.NAME_TRANSIENT_STATUSES.includes(res.status))), + this.getName, + request, + options + ); + /** + * Delete an existing name. Delete a name by its ID. + * + * @param request - The request {@link IpnsApiDeleteNameRequest} + */ + deleteName = (request) => this.client.fetch({ + method: "DELETE", + path: `/ipfs/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/names/${marshalling.validatePathParam("nameId", request.nameId)}` + }); + pageOfListNames = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/ipfs/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/names`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId] + ) + }, + marshalling_gen.unmarshalListNamesResponse + ); + /** + * List all names by a Project ID. Retrieve information about all names from a + * Project ID. + * + * @param request - The request {@link IpnsApiListNamesRequest} + * @returns A Promise of ListNamesResponse + */ + listNames = (request = {}) => resourcePaginator.enrichForPagination("names", this.pageOfListNames, request); + /** + * Update name information. Update name information (CID, tag, name...). + * + * @param request - The request {@link IpnsApiUpdateNameRequest} + * @returns A Promise of Name + */ + updateName = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalIpnsApiUpdateNameRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/ipfs/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/names/${marshalling.validatePathParam("nameId", request.nameId)}` + }, + marshalling_gen.unmarshalName + ); + /** + * Export your private key. Export a private key by its ID. + * + * @param request - The request {@link IpnsApiExportKeyNameRequest} + * @returns A Promise of ExportKeyNameResponse + */ + exportKeyName = (request) => this.client.fetch( + { + method: "GET", + path: `/ipfs/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/names/${marshalling.validatePathParam("nameId", request.nameId)}/export-key` + }, + marshalling_gen.unmarshalExportKeyNameResponse + ); + /** + * Import your private key. Import a private key. + * + * @param request - The request {@link IpnsApiImportKeyNameRequest} + * @returns A Promise of Name + */ + importKeyName = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalIpnsApiImportKeyNameRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/ipfs/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/names/import-key` + }, + marshalling_gen.unmarshalName + ); +} +exports.API = API; +exports.IpnsAPI = IpnsAPI; + + +/***/ }), + +/***/ 5554: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const NAME_TRANSIENT_STATUSES = ["queued", "publishing"]; +const PIN_TRANSIENT_STATUSES = ["queued", "pinning"]; +exports.NAME_TRANSIENT_STATUSES = NAME_TRANSIENT_STATUSES; +exports.PIN_TRANSIENT_STATUSES = PIN_TRANSIENT_STATUSES; + + +/***/ }), + +/***/ 5513: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api_gen = __nccwpck_require__(7269); +const content_gen = __nccwpck_require__(5554); +exports.API = api_gen.API; +exports.IpnsAPI = api_gen.IpnsAPI; +exports.NAME_TRANSIENT_STATUSES = content_gen.NAME_TRANSIENT_STATUSES; +exports.PIN_TRANSIENT_STATUSES = content_gen.PIN_TRANSIENT_STATUSES; + + +/***/ }), + +/***/ 2467: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const json = __nccwpck_require__(3746); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const unmarshalName = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Name' failed as data isn't a dictionary.` + ); } return { - server: data.server ? unmarshalServer(data.server) : undefined + createdAt: marshalling.unmarshalDate(data.created_at), + key: data.key, + name: data.name, + nameId: data.name_id, + projectId: data.project_id, + region: data.region, + status: data.status, + tags: data.tags, + updatedAt: marshalling.unmarshalDate(data.updated_at), + value: data.value }; }; -const unmarshalCreateSnapshotResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'CreateSnapshotResponse' failed as data isn't a dictionary.`); +const unmarshalPinCIDMeta = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'PinCIDMeta' failed as data isn't a dictionary.` + ); } return { - snapshot: data.snapshot ? unmarshalSnapshot$1(data.snapshot) : undefined, - task: data.task ? unmarshalTask(data.task) : undefined + id: data.id }; }; -const unmarshalCreateVolumeResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'CreateVolumeResponse' failed as data isn't a dictionary.`); +const unmarshalPinCID = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'PinCID' failed as data isn't a dictionary.` + ); } return { - volume: data.volume ? unmarshalVolume$2(data.volume) : undefined + cid: data.cid, + meta: data.meta ? unmarshalPinCIDMeta(data.meta) : void 0, + name: data.name, + origins: data.origins }; }; -const unmarshalExportSnapshotResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ExportSnapshotResponse' failed as data isn't a dictionary.`); +const unmarshalPinInfo = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'PinInfo' failed as data isn't a dictionary.` + ); } return { - task: data.task ? unmarshalTask(data.task) : undefined + id: data.id, + progress: data.progress, + size: data.size, + statusDetails: data.status_details, + url: data.url }; }; -const unmarshalGetBootscriptResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'GetBootscriptResponse' failed as data isn't a dictionary.`); +const unmarshalPin = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Pin' failed as data isn't a dictionary.` + ); } return { - bootscript: data.bootscript ? unmarshalBootscript(data.bootscript) : undefined + cid: data.cid ? unmarshalPinCID(data.cid) : void 0, + createdAt: marshalling.unmarshalDate(data.created_at), + delegates: data.delegates, + info: data.info ? unmarshalPinInfo(data.info) : void 0, + pinId: data.pin_id, + status: data.status }; }; -const unmarshalGetDashboardResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'GetDashboardResponse' failed as data isn't a dictionary.`); +const unmarshalVolume = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Volume' failed as data isn't a dictionary.` + ); } return { - dashboard: data.dashboard ? unmarshalDashboard(data.dashboard) : undefined + countPin: data.count_pin, + createdAt: marshalling.unmarshalDate(data.created_at), + id: data.id, + name: data.name, + projectId: data.project_id, + region: data.region, + size: data.size, + tags: data.tags, + updatedAt: marshalling.unmarshalDate(data.updated_at) }; }; -const unmarshalGetImageResponse$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'GetImageResponse' failed as data isn't a dictionary.`); +const unmarshalExportKeyNameResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ExportKeyNameResponse' failed as data isn't a dictionary.` + ); } return { - image: data.image ? unmarshalImage$3(data.image) : undefined + createdAt: marshalling.unmarshalDate(data.created_at), + nameId: data.name_id, + privateKey: data.private_key, + projectId: data.project_id, + publicKey: data.public_key, + updatedAt: marshalling.unmarshalDate(data.updated_at) }; }; -const unmarshalGetIpResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'GetIpResponse' failed as data isn't a dictionary.`); +const unmarshalListNamesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListNamesResponse' failed as data isn't a dictionary.` + ); } return { - ip: data.ip ? unmarshalIp$1(data.ip) : undefined + names: marshalling.unmarshalArrayOfObject(data.names, unmarshalName), + totalCount: data.total_count }; }; -const unmarshalGetPlacementGroupResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'GetPlacementGroupResponse' failed as data isn't a dictionary.`); +const unmarshalListPinsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListPinsResponse' failed as data isn't a dictionary.` + ); } return { - placementGroup: data.placement_group ? unmarshalPlacementGroup(data.placement_group) : undefined + pins: marshalling.unmarshalArrayOfObject(data.pins, unmarshalPin), + totalCount: data.total_count }; }; -const unmarshalGetPlacementGroupServersResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'GetPlacementGroupServersResponse' failed as data isn't a dictionary.`); +const unmarshalListVolumesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListVolumesResponse' failed as data isn't a dictionary.` + ); } return { - servers: unmarshalArrayOfObject(data.servers, unmarshalPlacementGroupServer) + totalCount: data.total_count, + volumes: marshalling.unmarshalArrayOfObject(data.volumes, unmarshalVolume) }; }; -const unmarshalGetPrivateNICResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'GetPrivateNICResponse' failed as data isn't a dictionary.`); +const unmarshalReplacePinResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ReplacePinResponse' failed as data isn't a dictionary.` + ); } return { - privateNic: data.private_nic ? unmarshalPrivateNIC(data.private_nic) : undefined + pin: data.pin ? unmarshalPin(data.pin) : void 0 }; }; -const unmarshalGetSecurityGroupResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'GetSecurityGroupResponse' failed as data isn't a dictionary.`); +const marshalCreatePinByCIDRequest = (request, defaults) => ({ + cid: request.cid, + name: request.name, + origins: request.origins, + volume_id: request.volumeId +}); +const marshalCreatePinByURLRequest = (request, defaults) => ({ + name: request.name, + url: request.url, + volume_id: request.volumeId +}); +const marshalCreateVolumeRequest = (request, defaults) => ({ + name: request.name, + project_id: request.projectId ?? defaults.defaultProjectId +}); +const marshalIpnsApiCreateNameRequest = (request, defaults) => ({ + name: request.name, + project_id: request.projectId ?? defaults.defaultProjectId, + value: request.value +}); +const marshalIpnsApiImportKeyNameRequest = (request, defaults) => ({ + name: request.name, + private_key: request.privateKey, + project_id: request.projectId ?? defaults.defaultProjectId, + value: request.value +}); +const marshalIpnsApiUpdateNameRequest = (request, defaults) => ({ + name: request.name, + tags: request.tags, + value: request.value +}); +const marshalReplacePinRequest = (request, defaults) => ({ + cid: request.cid, + name: request.name, + origins: request.origins, + volume_id: request.volumeId +}); +const marshalUpdateVolumeRequest = (request, defaults) => ({ + name: request.name, + tags: request.tags +}); +exports.marshalCreatePinByCIDRequest = marshalCreatePinByCIDRequest; +exports.marshalCreatePinByURLRequest = marshalCreatePinByURLRequest; +exports.marshalCreateVolumeRequest = marshalCreateVolumeRequest; +exports.marshalIpnsApiCreateNameRequest = marshalIpnsApiCreateNameRequest; +exports.marshalIpnsApiImportKeyNameRequest = marshalIpnsApiImportKeyNameRequest; +exports.marshalIpnsApiUpdateNameRequest = marshalIpnsApiUpdateNameRequest; +exports.marshalReplacePinRequest = marshalReplacePinRequest; +exports.marshalUpdateVolumeRequest = marshalUpdateVolumeRequest; +exports.unmarshalExportKeyNameResponse = unmarshalExportKeyNameResponse; +exports.unmarshalListNamesResponse = unmarshalListNamesResponse; +exports.unmarshalListPinsResponse = unmarshalListPinsResponse; +exports.unmarshalListVolumesResponse = unmarshalListVolumesResponse; +exports.unmarshalName = unmarshalName; +exports.unmarshalPin = unmarshalPin; +exports.unmarshalReplacePinResponse = unmarshalReplacePinResponse; +exports.unmarshalVolume = unmarshalVolume; + + +/***/ }), + +/***/ 364: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const index_gen = __nccwpck_require__(1907); +exports.v1alpha1 = index_gen; + + +/***/ }), + +/***/ 6499: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api = __nccwpck_require__(3042); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const resourcePaginator = __nccwpck_require__(4983); +const marshalling_gen = __nccwpck_require__(4545); +const jsonContentHeaders = { + "Content-Type": "application/json; charset=utf-8" +}; +class API extends api.API { + /** Lists the available regions of the API. */ + static LOCALITIES = ["fr-par", "nl-ams", "pl-waw"]; + /** + * Create a new job definition in a specified Project. + * + * @param request - The request {@link CreateJobDefinitionRequest} + * @returns A Promise of JobDefinition + */ + createJobDefinition = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateJobDefinitionRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/serverless-jobs/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-definitions` + }, + marshalling_gen.unmarshalJobDefinition + ); + /** + * Get a job definition by its unique identifier. + * + * @param request - The request {@link GetJobDefinitionRequest} + * @returns A Promise of JobDefinition + */ + getJobDefinition = (request) => this.client.fetch( + { + method: "GET", + path: `/serverless-jobs/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-definitions/${marshalling.validatePathParam("jobDefinitionId", request.jobDefinitionId)}` + }, + marshalling_gen.unmarshalJobDefinition + ); + pageOfListJobDefinitions = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/serverless-jobs/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-definitions`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId] + ) + }, + marshalling_gen.unmarshalListJobDefinitionsResponse + ); + /** + * List all your job definitions with filters. + * + * @param request - The request {@link ListJobDefinitionsRequest} + * @returns A Promise of ListJobDefinitionsResponse + */ + listJobDefinitions = (request = {}) => resourcePaginator.enrichForPagination( + "jobDefinitions", + this.pageOfListJobDefinitions, + request + ); + /** + * Update an existing job definition associated with the specified unique + * identifier. + * + * @param request - The request {@link UpdateJobDefinitionRequest} + * @returns A Promise of JobDefinition + */ + updateJobDefinition = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateJobDefinitionRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/serverless-jobs/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-definitions/${marshalling.validatePathParam("jobDefinitionId", request.jobDefinitionId)}` + }, + marshalling_gen.unmarshalJobDefinition + ); + /** + * Delete an exsisting job definition by its unique identifier. + * + * @param request - The request {@link DeleteJobDefinitionRequest} + */ + deleteJobDefinition = (request) => this.client.fetch({ + method: "DELETE", + path: `/serverless-jobs/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-definitions/${marshalling.validatePathParam("jobDefinitionId", request.jobDefinitionId)}` + }); + /** + * Run an existing job definition by its unique identifier. This will create a + * new job run. + * + * @param request - The request {@link StartJobDefinitionRequest} + * @returns A Promise of StartJobDefinitionResponse + */ + startJobDefinition = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalStartJobDefinitionRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/serverless-jobs/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-definitions/${marshalling.validatePathParam("jobDefinitionId", request.jobDefinitionId)}/start` + }, + marshalling_gen.unmarshalStartJobDefinitionResponse + ); + /** + * Get a job run by its unique identifier. + * + * @param request - The request {@link GetJobRunRequest} + * @returns A Promise of JobRun + */ + getJobRun = (request) => this.client.fetch( + { + method: "GET", + path: `/serverless-jobs/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-runs/${marshalling.validatePathParam("jobRunId", request.jobRunId)}` + }, + marshalling_gen.unmarshalJobRun + ); + /** + * Stop a job run by its unique identifier. + * + * @param request - The request {@link StopJobRunRequest} + * @returns A Promise of JobRun + */ + stopJobRun = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/serverless-jobs/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-runs/${marshalling.validatePathParam("jobRunId", request.jobRunId)}/stop` + }, + marshalling_gen.unmarshalJobRun + ); + pageOfListJobRuns = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/serverless-jobs/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/job-runs`, + urlParams: marshalling.urlParams( + ["job_definition_id", request.jobDefinitionId], + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId] + ) + }, + marshalling_gen.unmarshalListJobRunsResponse + ); + /** + * List all job runs with filters. + * + * @param request - The request {@link ListJobRunsRequest} + * @returns A Promise of ListJobRunsResponse + */ + listJobRuns = (request = {}) => resourcePaginator.enrichForPagination("jobRuns", this.pageOfListJobRuns, request); + /** + * List jobs resources for the console. + * + * @param request - The request {@link ListJobsResourcesRequest} + * @returns A Promise of ListJobsResourcesResponse + */ + listJobsResources = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/serverless-jobs/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/jobs-resources` + }, + marshalling_gen.unmarshalListJobsResourcesResponse + ); +} +exports.API = API; + + +/***/ }), + +/***/ 7064: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const JOB_RUN_TRANSIENT_STATUSES = [ + "queued", + "scheduled", + "running" +]; +exports.JOB_RUN_TRANSIENT_STATUSES = JOB_RUN_TRANSIENT_STATUSES; + + +/***/ }), + +/***/ 1907: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api_gen = __nccwpck_require__(6499); +const content_gen = __nccwpck_require__(7064); +const validationRules_gen = __nccwpck_require__(1918); +exports.API = api_gen.API; +exports.JOB_RUN_TRANSIENT_STATUSES = content_gen.JOB_RUN_TRANSIENT_STATUSES; +exports.ValidationRules = validationRules_gen; + + +/***/ }), + +/***/ 4545: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const randomName = __nccwpck_require__(8141); +const json = __nccwpck_require__(3746); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const unmarshalCronSchedule = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'CronSchedule' failed as data isn't a dictionary.` + ); } return { - securityGroup: data.security_group ? unmarshalSecurityGroup(data.security_group) : undefined + schedule: data.schedule, + timezone: data.timezone }; }; -const unmarshalGetSecurityGroupRuleResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'GetSecurityGroupRuleResponse' failed as data isn't a dictionary.`); +const unmarshalJobDefinition = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'JobDefinition' failed as data isn't a dictionary.` + ); } return { - rule: data.rule ? unmarshalSecurityGroupRule(data.rule) : undefined + command: data.command, + cpuLimit: data.cpu_limit, + createdAt: marshalling.unmarshalDate(data.created_at), + cronSchedule: data.cron_schedule ? unmarshalCronSchedule(data.cron_schedule) : void 0, + description: data.description, + environmentVariables: data.environment_variables, + id: data.id, + imageUri: data.image_uri, + jobTimeout: data.job_timeout, + localStorageCapacity: data.local_storage_capacity, + memoryLimit: data.memory_limit, + name: data.name, + projectId: data.project_id, + region: data.region, + updatedAt: marshalling.unmarshalDate(data.updated_at) }; }; -const unmarshalGetServerResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'GetServerResponse' failed as data isn't a dictionary.`); +const unmarshalJobRun = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'JobRun' failed as data isn't a dictionary.` + ); } return { - server: data.server ? unmarshalServer(data.server) : undefined + command: data.command, + cpuLimit: data.cpu_limit, + createdAt: marshalling.unmarshalDate(data.created_at), + environmentVariables: data.environment_variables, + errorMessage: data.error_message, + exitCode: data.exit_code, + id: data.id, + jobDefinitionId: data.job_definition_id, + localStorageCapacity: data.local_storage_capacity, + memoryLimit: data.memory_limit, + region: data.region, + runDuration: data.run_duration, + startedAt: marshalling.unmarshalDate(data.started_at), + state: data.state, + terminatedAt: marshalling.unmarshalDate(data.terminated_at), + updatedAt: marshalling.unmarshalDate(data.updated_at) }; }; -const unmarshalGetServerTypesAvailabilityResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'GetServerTypesAvailabilityResponse' failed as data isn't a dictionary.`); +const unmarshalListJobDefinitionsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListJobDefinitionsResponse' failed as data isn't a dictionary.` + ); } return { - servers: unmarshalMapOfObject(data.servers, unmarshalGetServerTypesAvailabilityResponseAvailability), + jobDefinitions: marshalling.unmarshalArrayOfObject( + data.job_definitions, + unmarshalJobDefinition + ), totalCount: data.total_count }; }; -const unmarshalGetSnapshotResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'GetSnapshotResponse' failed as data isn't a dictionary.`); +const unmarshalListJobRunsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListJobRunsResponse' failed as data isn't a dictionary.` + ); } return { - snapshot: data.snapshot ? unmarshalSnapshot$1(data.snapshot) : undefined + jobRuns: marshalling.unmarshalArrayOfObject(data.job_runs, unmarshalJobRun), + totalCount: data.total_count }; }; -const unmarshalGetVolumeResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'GetVolumeResponse' failed as data isn't a dictionary.`); +const unmarshalResource = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Resource' failed as data isn't a dictionary.` + ); } return { - volume: data.volume ? unmarshalVolume$2(data.volume) : undefined + cpuLimit: data.cpu_limit, + memoryLimit: data.memory_limit }; }; -const unmarshalListBootscriptsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListBootscriptsResponse' failed as data isn't a dictionary.`); +const unmarshalListJobsResourcesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListJobsResourcesResponse' failed as data isn't a dictionary.` + ); } return { - bootscripts: unmarshalArrayOfObject(data.bootscripts, unmarshalBootscript), - totalCount: data.total_count + resources: marshalling.unmarshalArrayOfObject(data.resources, unmarshalResource) }; }; -const unmarshalListImagesResponse$3 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListImagesResponse' failed as data isn't a dictionary.`); +const unmarshalStartJobDefinitionResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'StartJobDefinitionResponse' failed as data isn't a dictionary.` + ); } return { - images: unmarshalArrayOfObject(data.images, unmarshalImage$3), - totalCount: data.total_count + jobRuns: marshalling.unmarshalArrayOfObject(data.job_runs, unmarshalJobRun) }; }; -const unmarshalListIpsResponse$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListIpsResponse' failed as data isn't a dictionary.`); +const marshalCreateJobDefinitionRequestCronScheduleConfig = (request, defaults) => ({ + schedule: request.schedule, + timezone: request.timezone +}); +const marshalCreateJobDefinitionRequest = (request, defaults) => ({ + command: request.command, + cpu_limit: request.cpuLimit, + cron_schedule: request.cronSchedule !== void 0 ? marshalCreateJobDefinitionRequestCronScheduleConfig( + request.cronSchedule + ) : void 0, + description: request.description, + environment_variables: request.environmentVariables !== void 0 ? request.environmentVariables : void 0, + image_uri: request.imageUri, + job_timeout: request.jobTimeout, + local_storage_capacity: request.localStorageCapacity, + memory_limit: request.memoryLimit, + name: request.name || randomName("job"), + project_id: request.projectId ?? defaults.defaultProjectId +}); +const marshalStartJobDefinitionRequest = (request, defaults) => ({ + command: request.command, + environment_variables: request.environmentVariables, + replicas: request.replicas +}); +const marshalUpdateJobDefinitionRequestCronScheduleConfig = (request, defaults) => ({ + schedule: request.schedule, + timezone: request.timezone +}); +const marshalUpdateJobDefinitionRequest = (request, defaults) => ({ + command: request.command, + cpu_limit: request.cpuLimit, + cron_schedule: request.cronSchedule !== void 0 ? marshalUpdateJobDefinitionRequestCronScheduleConfig( + request.cronSchedule + ) : void 0, + description: request.description, + environment_variables: request.environmentVariables, + image_uri: request.imageUri, + job_timeout: request.jobTimeout, + local_storage_capacity: request.localStorageCapacity, + memory_limit: request.memoryLimit, + name: request.name +}); +exports.marshalCreateJobDefinitionRequest = marshalCreateJobDefinitionRequest; +exports.marshalStartJobDefinitionRequest = marshalStartJobDefinitionRequest; +exports.marshalUpdateJobDefinitionRequest = marshalUpdateJobDefinitionRequest; +exports.unmarshalJobDefinition = unmarshalJobDefinition; +exports.unmarshalJobRun = unmarshalJobRun; +exports.unmarshalListJobDefinitionsResponse = unmarshalListJobDefinitionsResponse; +exports.unmarshalListJobRunsResponse = unmarshalListJobRunsResponse; +exports.unmarshalListJobsResourcesResponse = unmarshalListJobsResourcesResponse; +exports.unmarshalStartJobDefinitionResponse = unmarshalStartJobDefinitionResponse; + + +/***/ }), + +/***/ 1918: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const CreateJobDefinitionRequest = { + cpuLimit: { + greaterThan: 0 + }, + imageUri: { + pattern: /^((?:(?:(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])(?:\.(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]))*|\[(?:[a-fA-F0-9:]+)\])(?::[0-9]+)?\/)?[a-z0-9]+(?:(?:[._]|__|[-]+)[a-z0-9]+)*(?:\/[a-z0-9]+(?:(?:[._]|__|[-]+)[a-z0-9]+)*)*)(?::([\w][\w.-]{0,127}))?(?:@([A-Za-z][A-Za-z0-9]*(?:[-_+.][A-Za-z][A-Za-z0-9]*)*[:][[:xdigit:]]{32,}))?$/ + }, + localStorageCapacity: { + greaterThan: 0 + }, + memoryLimit: { + greaterThan: 0 + }, + name: { + pattern: /^[A-Za-z0-9-_]{3,50}$/ } - return { - ips: unmarshalArrayOfObject(data.ips, unmarshalIp$1), - totalCount: data.total_count - }; }; -const unmarshalListPlacementGroupsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListPlacementGroupsResponse' failed as data isn't a dictionary.`); +const CreateJobDefinitionRequestCronScheduleConfig = { + schedule: { + maxLength: 255, + minLength: 1 + }, + timezone: { + maxLength: 255, + minLength: 1 } - return { - placementGroups: unmarshalArrayOfObject(data.placement_groups, unmarshalPlacementGroup), - totalCount: data.total_count - }; }; -const unmarshalListPrivateNICsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListPrivateNICsResponse' failed as data isn't a dictionary.`); +const CronSchedule = { + schedule: { + maxLength: 255, + minLength: 1 + }, + timezone: { + maxLength: 255, + minLength: 1 } - return { - privateNics: unmarshalArrayOfObject(data.private_nics, unmarshalPrivateNIC), - totalCount: data.total_count - }; }; -const unmarshalListSecurityGroupRulesResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListSecurityGroupRulesResponse' failed as data isn't a dictionary.`); +const ListJobDefinitionsRequest = { + page: { + greaterThanOrEqual: 1 + }, + pageSize: { + greaterThanOrEqual: 1, + lessThanOrEqual: 1e3 } - return { - rules: unmarshalArrayOfObject(data.rules, unmarshalSecurityGroupRule), - totalCount: data.total_count - }; }; -const unmarshalListSecurityGroupsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListSecurityGroupsResponse' failed as data isn't a dictionary.`); +const ListJobRunsRequest = { + page: { + greaterThanOrEqual: 1 + }, + pageSize: { + greaterThanOrEqual: 1, + lessThanOrEqual: 1e3 } - return { - securityGroups: unmarshalArrayOfObject(data.security_groups, unmarshalSecurityGroup), - totalCount: data.total_count - }; }; -const unmarshalListServerActionsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListServerActionsResponse' failed as data isn't a dictionary.`); +const StartJobDefinitionRequest = { + replicas: { + greaterThan: 0 } - return { - actions: data.actions - }; }; -const unmarshalListServerUserDataResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListServerUserDataResponse' failed as data isn't a dictionary.`); +const UpdateJobDefinitionRequest = { + cpuLimit: { + greaterThan: 0 + }, + imageUri: { + pattern: /^((?:(?:(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])(?:\.(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]))*|\[(?:[a-fA-F0-9:]+)\])(?::[0-9]+)?\/)?[a-z0-9]+(?:(?:[._]|__|[-]+)[a-z0-9]+)*(?:\/[a-z0-9]+(?:(?:[._]|__|[-]+)[a-z0-9]+)*)*)(?::([\w][\w.-]{0,127}))?(?:@([A-Za-z][A-Za-z0-9]*(?:[-_+.][A-Za-z][A-Za-z0-9]*)*[:][[:xdigit:]]{32,}))?$/ + }, + localStorageCapacity: { + greaterThan: 0 + }, + memoryLimit: { + greaterThan: 0 + }, + name: { + pattern: /^[A-Za-z0-9-_]{3,50}$/ } - return { - userData: data.user_data - }; }; -const unmarshalListServersResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListServersResponse' failed as data isn't a dictionary.`); +const UpdateJobDefinitionRequestCronScheduleConfig = { + schedule: { + maxLength: 255, + minLength: 1 + }, + timezone: { + maxLength: 255, + minLength: 1 } - return { - servers: unmarshalArrayOfObject(data.servers, unmarshalServer), - totalCount: data.total_count - }; }; -const unmarshalListServersTypesResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListServersTypesResponse' failed as data isn't a dictionary.`); - } - return { - servers: unmarshalMapOfObject(data.servers, unmarshalServerType), - totalCount: data.total_count - }; +exports.CreateJobDefinitionRequest = CreateJobDefinitionRequest; +exports.CreateJobDefinitionRequestCronScheduleConfig = CreateJobDefinitionRequestCronScheduleConfig; +exports.CronSchedule = CronSchedule; +exports.ListJobDefinitionsRequest = ListJobDefinitionsRequest; +exports.ListJobRunsRequest = ListJobRunsRequest; +exports.StartJobDefinitionRequest = StartJobDefinitionRequest; +exports.UpdateJobDefinitionRequest = UpdateJobDefinitionRequest; +exports.UpdateJobDefinitionRequestCronScheduleConfig = UpdateJobDefinitionRequestCronScheduleConfig; + + +/***/ }), + +/***/ 378: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const index = __nccwpck_require__(8088); +exports.v1 = index; + + +/***/ }), + +/***/ 636: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const intervalRetrier = __nccwpck_require__(9052); +const api = __nccwpck_require__(3042); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const resourcePaginator = __nccwpck_require__(4983); +const content_gen = __nccwpck_require__(15); +const marshalling_gen = __nccwpck_require__(1166); +const jsonContentHeaders = { + "Content-Type": "application/json; charset=utf-8" }; -const unmarshalListSnapshotsResponse$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListSnapshotsResponse' failed as data isn't a dictionary.`); +class API extends api.API { + /** Lists the available regions of the API. */ + static LOCALITIES = ["fr-par", "nl-ams", "pl-waw"]; + pageOfListClusters = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/k8s/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters`, + urlParams: marshalling.urlParams( + ["name", request.name], + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["private_network_id", request.privateNetworkId], + ["project_id", request.projectId], + ["status", request.status], + ["type", request.type] + ) + }, + marshalling_gen.unmarshalListClustersResponse + ); + /** + * List Clusters. List all existing Kubernetes clusters in a specific region. + * + * @param request - The request {@link ListClustersRequest} + * @returns A Promise of ListClustersResponse + */ + listClusters = (request = {}) => resourcePaginator.enrichForPagination("clusters", this.pageOfListClusters, request); + /** + * Create a new Cluster. Create a new Kubernetes cluster in a Scaleway region. + * + * @param request - The request {@link CreateClusterRequest} + * @returns A Promise of Cluster + */ + createCluster = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateClusterRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/k8s/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters` + }, + marshalling_gen.unmarshalCluster + ); + /** + * Get a Cluster. Retrieve information about a specific Kubernetes cluster. + * + * @param request - The request {@link GetClusterRequest} + * @returns A Promise of Cluster + */ + getCluster = (request) => this.client.fetch( + { + method: "GET", + path: `/k8s/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${marshalling.validatePathParam("clusterId", request.clusterId)}` + }, + marshalling_gen.unmarshalCluster + ); + /** + * Waits for {@link Cluster} to be in a final state. + * + * @param request - The request {@link GetClusterRequest} + * @param options - The waiting options + * @returns A Promise of Cluster + */ + waitForCluster = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve(!content_gen.CLUSTER_TRANSIENT_STATUSES.includes(res.status))), + this.getCluster, + request, + options + ); + /** + * Update a Cluster. Update information on a specific Kubernetes cluster. You + * can update details such as its name, description, tags and configuration. + * To upgrade a cluster, you will need to use the dedicated endpoint. + * + * @param request - The request {@link UpdateClusterRequest} + * @returns A Promise of Cluster + */ + updateCluster = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateClusterRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/k8s/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${marshalling.validatePathParam("clusterId", request.clusterId)}` + }, + marshalling_gen.unmarshalCluster + ); + /** + * Delete a Cluster. Delete a specific Kubernetes cluster and all its + * associated pools and nodes. Note that this method will not delete any Load + * Balancer or Block Volume that are associated with the cluster. + * + * @param request - The request {@link DeleteClusterRequest} + * @returns A Promise of Cluster + */ + deleteCluster = (request) => this.client.fetch( + { + method: "DELETE", + path: `/k8s/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${marshalling.validatePathParam("clusterId", request.clusterId)}`, + urlParams: marshalling.urlParams([ + "with_additional_resources", + request.withAdditionalResources + ]) + }, + marshalling_gen.unmarshalCluster + ); + /** + * Upgrade a Cluster. Upgrade a specific Kubernetes cluster and possibly its + * associated pools to a specific and supported Kubernetes version. + * + * @param request - The request {@link UpgradeClusterRequest} + * @returns A Promise of Cluster + */ + upgradeCluster = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpgradeClusterRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/k8s/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${marshalling.validatePathParam("clusterId", request.clusterId)}/upgrade` + }, + marshalling_gen.unmarshalCluster + ); + /** + * Change the Cluster type. Change the type of a specific Kubernetes cluster. + * To see the possible values you can enter for the `type` field, [list + * available cluster + * types](#path-clusters-list-available-cluster-types-for-a-cluster). + * + * @param request - The request {@link SetClusterTypeRequest} + * @returns A Promise of Cluster + */ + setClusterType = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalSetClusterTypeRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/k8s/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${marshalling.validatePathParam("clusterId", request.clusterId)}/set-type` + }, + marshalling_gen.unmarshalCluster + ); + /** + * List available versions for a Cluster. List the versions that a specific + * Kubernetes cluster is allowed to upgrade to. Results will include every + * patch version greater than the current patch, as well as one minor version + * ahead of the current version. Any upgrade skipping a minor version will not + * work. + * + * @param request - The request {@link ListClusterAvailableVersionsRequest} + * @returns A Promise of ListClusterAvailableVersionsResponse + */ + listClusterAvailableVersions = (request) => this.client.fetch( + { + method: "GET", + path: `/k8s/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${marshalling.validatePathParam("clusterId", request.clusterId)}/available-versions` + }, + marshalling_gen.unmarshalListClusterAvailableVersionsResponse + ); + /** + * List available cluster types for a cluster. List the cluster types that a + * specific Kubernetes cluster is allowed to switch to. + * + * @param request - The request {@link ListClusterAvailableTypesRequest} + * @returns A Promise of ListClusterAvailableTypesResponse + */ + listClusterAvailableTypes = (request) => this.client.fetch( + { + method: "GET", + path: `/k8s/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${marshalling.validatePathParam("clusterId", request.clusterId)}/available-types` + }, + marshalling_gen.unmarshalListClusterAvailableTypesResponse + ); + _getClusterKubeConfig = (request) => this.client.fetch({ + method: "GET", + path: `/k8s/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${marshalling.validatePathParam("clusterId", request.clusterId)}/kubeconfig`, + urlParams: marshalling.urlParams(["dl", 1], ["redacted", request.redacted]), + responseType: "blob" + }); + /** + * Reset the admin token of a Cluster. Reset the admin token for a specific + * Kubernetes cluster. This will revoke the old admin token (which will not be + * usable afterwards) and create a new one. Note that you will need to + * download kubeconfig again to keep interacting with the cluster. + * + * @param request - The request {@link ResetClusterAdminTokenRequest} + */ + resetClusterAdminToken = (request) => this.client.fetch({ + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/k8s/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${marshalling.validatePathParam("clusterId", request.clusterId)}/reset-admin-token` + }); + /** + * Migrate a cluster to Routed IPs. Migrate the nodes of an existing cluster + * to Routed IPs and enable Routed IPs for all future nodes. + * + * @param request - The request {@link MigrateClusterToRoutedIPsRequest} + * @returns A Promise of Cluster + */ + migrateClusterToRoutedIPs = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/k8s/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${marshalling.validatePathParam("clusterId", request.clusterId)}/migrate-to-routed-ips` + }, + marshalling_gen.unmarshalCluster + ); + /** + * Migrate a cluster to SBS CSI. Enable the latest CSI compatible with + * Scaleway Block Storage (SBS) and migrate all existing + * PersistentVolumes/VolumeSnapshotContents to SBS. + * + * @param request - The request {@link MigrateClusterToSBSCSIRequest} + * @returns A Promise of Cluster + */ + migrateClusterToSBSCSI = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/k8s/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${marshalling.validatePathParam("clusterId", request.clusterId)}/migrate-to-sbs-csi` + }, + marshalling_gen.unmarshalCluster + ); + pageOfListPools = (request) => this.client.fetch( + { + method: "GET", + path: `/k8s/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${marshalling.validatePathParam("clusterId", request.clusterId)}/pools`, + urlParams: marshalling.urlParams( + ["name", request.name], + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["status", request.status] + ) + }, + marshalling_gen.unmarshalListPoolsResponse + ); + /** + * List Pools in a Cluster. List all the existing pools for a specific + * Kubernetes cluster. + * + * @param request - The request {@link ListPoolsRequest} + * @returns A Promise of ListPoolsResponse + */ + listPools = (request) => resourcePaginator.enrichForPagination("pools", this.pageOfListPools, request); + /** + * Create a new Pool in a Cluster. Create a new pool in a specific Kubernetes + * cluster. + * + * @param request - The request {@link CreatePoolRequest} + * @returns A Promise of Pool + */ + createPool = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreatePoolRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/k8s/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${marshalling.validatePathParam("clusterId", request.clusterId)}/pools` + }, + marshalling_gen.unmarshalPool + ); + /** + * Get a Pool in a Cluster. Retrieve details about a specific pool in a + * Kubernetes cluster. + * + * @param request - The request {@link GetPoolRequest} + * @returns A Promise of Pool + */ + getPool = (request) => this.client.fetch( + { + method: "GET", + path: `/k8s/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/pools/${marshalling.validatePathParam("poolId", request.poolId)}` + }, + marshalling_gen.unmarshalPool + ); + /** + * Waits for {@link Pool} to be in a final state. + * + * @param request - The request {@link GetPoolRequest} + * @param options - The waiting options + * @returns A Promise of Pool + */ + waitForPool = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve(!content_gen.POOL_TRANSIENT_STATUSES.includes(res.status))), + this.getPool, + request, + options + ); + /** + * Upgrade a Pool in a Cluster. Upgrade the Kubernetes version of a specific + * pool. Note that it only works if the targeted version matches the cluster's + * version. + * + * @param request - The request {@link UpgradePoolRequest} + * @returns A Promise of Pool + */ + upgradePool = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpgradePoolRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/k8s/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/pools/${marshalling.validatePathParam("poolId", request.poolId)}/upgrade` + }, + marshalling_gen.unmarshalPool + ); + /** + * Update a Pool in a Cluster. Update the attributes of a specific pool, such + * as its desired size, autoscaling settings, and tags. + * + * @param request - The request {@link UpdatePoolRequest} + * @returns A Promise of Pool + */ + updatePool = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdatePoolRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/k8s/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/pools/${marshalling.validatePathParam("poolId", request.poolId)}` + }, + marshalling_gen.unmarshalPool + ); + /** + * Delete a Pool in a Cluster. Delete a specific pool from a cluster. Note + * that all the pool's nodes will also be deleted. + * + * @param request - The request {@link DeletePoolRequest} + * @returns A Promise of Pool + */ + deletePool = (request) => this.client.fetch( + { + method: "DELETE", + path: `/k8s/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/pools/${marshalling.validatePathParam("poolId", request.poolId)}` + }, + marshalling_gen.unmarshalPool + ); + /** + * Fetch node metadata. Rerieve metadata to instantiate a Kapsule/Kosmos node. + * This method is not intended to be called by end users but rather + * programmatically by the node-installer. + * + * @param request - The request {@link GetNodeMetadataRequest} + * @returns A Promise of NodeMetadata + */ + getNodeMetadata = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/k8s/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nodes/metadata` + }, + marshalling_gen.unmarshalNodeMetadata + ); + /** + * Authenticate Kosmos external node. Creates a newer Kosmos node and returns + * its token. This method is not intended to be called by end users but rather + * programmatically by the node-installer. + * + * @param request - The request {@link AuthExternalNodeRequest} + * @returns A Promise of ExternalNodeAuth + */ + authExternalNode = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/k8s/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/pools/${marshalling.validatePathParam("poolId", request.poolId)}/external-nodes/auth` + }, + marshalling_gen.unmarshalExternalNodeAuth + ); + /** + * Create a Kosmos node. Retrieve metadata for a Kosmos node. This method is + * not intended to be called by end users but rather programmatically by the + * kapsule-node-agent. + * + * @param request - The request {@link CreateExternalNodeRequest} + * @returns A Promise of ExternalNode + */ + createExternalNode = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/k8s/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/pools/${marshalling.validatePathParam("poolId", request.poolId)}/external-nodes` + }, + marshalling_gen.unmarshalExternalNode + ); + pageOfListNodes = (request) => this.client.fetch( + { + method: "GET", + path: `/k8s/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/clusters/${marshalling.validatePathParam("clusterId", request.clusterId)}/nodes`, + urlParams: marshalling.urlParams( + ["name", request.name], + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["pool_id", request.poolId], + ["status", request.status] + ) + }, + marshalling_gen.unmarshalListNodesResponse + ); + /** + * List Nodes in a Cluster. List all the existing nodes for a specific + * Kubernetes cluster. + * + * @param request - The request {@link ListNodesRequest} + * @returns A Promise of ListNodesResponse + */ + listNodes = (request) => resourcePaginator.enrichForPagination("nodes", this.pageOfListNodes, request); + /** + * Get a Node in a Cluster. Retrieve details about a specific Kubernetes Node. + * + * @param request - The request {@link GetNodeRequest} + * @returns A Promise of Node + */ + getNode = (request) => this.client.fetch( + { + method: "GET", + path: `/k8s/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nodes/${marshalling.validatePathParam("nodeId", request.nodeId)}` + }, + marshalling_gen.unmarshalNode + ); + /** + * Waits for {@link Node} to be in a final state. + * + * @param request - The request {@link GetNodeRequest} + * @param options - The waiting options + * @returns A Promise of Node + */ + waitForNode = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve(!content_gen.NODE_TRANSIENT_STATUSES.includes(res.status))), + this.getNode, + request, + options + ); + /** + * Replace a Node in a Cluster. Replace a specific Node. The node will first + * be cordoned (scheduling will be disabled on it). The existing pods on the + * node will then be drained and rescheduled onto another schedulable node. + * Note that when there is not enough space to reschedule all the pods (such + * as in a one-node cluster), disruption of your applications can be + * expected. + * + * @deprecated + * @param request - The request {@link ReplaceNodeRequest} + * @returns A Promise of Node + */ + replaceNode = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/k8s/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nodes/${marshalling.validatePathParam("nodeId", request.nodeId)}/replace` + }, + marshalling_gen.unmarshalNode + ); + /** + * Reboot a Node in a Cluster. Reboot a specific Node. The node will first be + * cordoned (scheduling will be disabled on it). The existing pods on the node + * will then be drained and rescheduled onto another schedulable node. Note + * that when there is not enough space to reschedule all the pods (such as in + * a one-node cluster), disruption of your applications can be expected. + * + * @param request - The request {@link RebootNodeRequest} + * @returns A Promise of Node + */ + rebootNode = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/k8s/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nodes/${marshalling.validatePathParam("nodeId", request.nodeId)}/reboot` + }, + marshalling_gen.unmarshalNode + ); + /** + * Delete a Node in a Cluster. Delete a specific Node. Note that when there is + * not enough space to reschedule all the pods (such as in a one-node + * cluster), disruption of your applications can be expected. + * + * @param request - The request {@link DeleteNodeRequest} + * @returns A Promise of Node + */ + deleteNode = (request) => this.client.fetch( + { + method: "DELETE", + path: `/k8s/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nodes/${marshalling.validatePathParam("nodeId", request.nodeId)}`, + urlParams: marshalling.urlParams( + ["replace", request.replace], + ["skip_drain", request.skipDrain] + ) + }, + marshalling_gen.unmarshalNode + ); + /** + * List all available Versions. List all available versions for the creation + * of a new Kubernetes cluster. + * + * @param request - The request {@link ListVersionsRequest} + * @returns A Promise of ListVersionsResponse + */ + listVersions = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/k8s/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/versions` + }, + marshalling_gen.unmarshalListVersionsResponse + ); + /** + * Get a Version. Retrieve a specific Kubernetes version and its details. + * + * @param request - The request {@link GetVersionRequest} + * @returns A Promise of Version + */ + getVersion = (request) => this.client.fetch( + { + method: "GET", + path: `/k8s/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/versions/${marshalling.validatePathParam("versionName", request.versionName)}` + }, + marshalling_gen.unmarshalVersion + ); + pageOfListClusterTypes = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/k8s/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/cluster-types`, + urlParams: marshalling.urlParams( + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListClusterTypesResponse + ); + /** + * List cluster types. List available cluster types and their technical + * details. + * + * @param request - The request {@link ListClusterTypesRequest} + * @returns A Promise of ListClusterTypesResponse + */ + listClusterTypes = (request = {}) => resourcePaginator.enrichForPagination("clusterTypes", this.pageOfListClusterTypes, request); +} +exports.API = API; + + +/***/ }), + +/***/ 225: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api_gen = __nccwpck_require__(636); +class K8SUtilsAPI extends api_gen.API { + /** + * Get configuration of a kube cluster. + * + * @param request - The request {@link GetClusterKubeConfigRequest} + * @returns A Promise of Blob + */ + getClusterKubeConfig = (request) => this._getClusterKubeConfig(request); +} +exports.K8SUtilsAPI = K8SUtilsAPI; + + +/***/ }), + +/***/ 15: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const CLUSTER_TRANSIENT_STATUSES = [ + "creating", + "deleting", + "updating" +]; +const NODE_TRANSIENT_STATUSES = [ + "creating", + "deleting", + "rebooting", + "upgrading", + "starting", + "registering" +]; +const POOL_TRANSIENT_STATUSES = [ + "deleting", + "scaling", + "upgrading" +]; +exports.CLUSTER_TRANSIENT_STATUSES = CLUSTER_TRANSIENT_STATUSES; +exports.NODE_TRANSIENT_STATUSES = NODE_TRANSIENT_STATUSES; +exports.POOL_TRANSIENT_STATUSES = POOL_TRANSIENT_STATUSES; + + +/***/ }), + +/***/ 8088: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api_utils = __nccwpck_require__(225); +const content_gen = __nccwpck_require__(15); +const validationRules_gen = __nccwpck_require__(6431); +exports.API = api_utils.K8SUtilsAPI; +exports.CLUSTER_TRANSIENT_STATUSES = content_gen.CLUSTER_TRANSIENT_STATUSES; +exports.NODE_TRANSIENT_STATUSES = content_gen.NODE_TRANSIENT_STATUSES; +exports.POOL_TRANSIENT_STATUSES = content_gen.POOL_TRANSIENT_STATUSES; +exports.ValidationRules = validationRules_gen; + + +/***/ }), + +/***/ 1166: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const randomName = __nccwpck_require__(8141); +const json = __nccwpck_require__(3746); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const unmarshalPoolUpgradePolicy = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'PoolUpgradePolicy' failed as data isn't a dictionary.` + ); } return { - snapshots: unmarshalArrayOfObject(data.snapshots, unmarshalSnapshot$1), - totalCount: data.total_count + maxSurge: data.max_surge, + maxUnavailable: data.max_unavailable }; }; -const unmarshalListVolumesResponse$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListVolumesResponse' failed as data isn't a dictionary.`); +const unmarshalPool = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Pool' failed as data isn't a dictionary.` + ); } return { - totalCount: data.total_count, - volumes: unmarshalArrayOfObject(data.volumes, unmarshalVolume$2) + autohealing: data.autohealing, + autoscaling: data.autoscaling, + clusterId: data.cluster_id, + containerRuntime: data.container_runtime, + createdAt: marshalling.unmarshalDate(data.created_at), + id: data.id, + kubeletArgs: data.kubelet_args, + maxSize: data.max_size, + minSize: data.min_size, + name: data.name, + nodeType: data.node_type, + placementGroupId: data.placement_group_id, + publicIpDisabled: data.public_ip_disabled, + region: data.region, + rootVolumeSize: data.root_volume_size, + rootVolumeType: data.root_volume_type, + size: data.size, + status: data.status, + tags: data.tags, + updatedAt: marshalling.unmarshalDate(data.updated_at), + upgradePolicy: data.upgrade_policy ? unmarshalPoolUpgradePolicy(data.upgrade_policy) : void 0, + version: data.version, + zone: data.zone }; }; -const unmarshalListVolumesTypesResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListVolumesTypesResponse' failed as data isn't a dictionary.`); +const unmarshalVersion = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Version' failed as data isn't a dictionary.` + ); } return { - totalCount: data.total_count, - volumes: unmarshalMapOfObject(data.volumes, unmarshalVolumeType) + availableAdmissionPlugins: data.available_admission_plugins, + availableCnis: data.available_cnis, + availableContainerRuntimes: data.available_container_runtimes, + availableFeatureGates: data.available_feature_gates, + availableKubeletArgs: data.available_kubelet_args, + label: data.label, + name: data.name, + region: data.region }; }; -const unmarshalMigrationPlan = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'MigrationPlan' failed as data isn't a dictionary.`); +const unmarshalMaintenanceWindow = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'MaintenanceWindow' failed as data isn't a dictionary.` + ); } return { - snapshots: unmarshalArrayOfObject(data.snapshots, unmarshalSnapshot$1), - validationKey: data.validation_key, - volume: data.volume ? unmarshalVolume$2(data.volume) : undefined + day: data.day, + startHour: data.start_hour }; }; -const unmarshalServerActionResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ServerActionResponse' failed as data isn't a dictionary.`); +const unmarshalClusterAutoUpgrade = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ClusterAutoUpgrade' failed as data isn't a dictionary.` + ); } return { - task: data.task ? unmarshalTask(data.task) : undefined + enabled: data.enabled, + maintenanceWindow: data.maintenance_window ? unmarshalMaintenanceWindow(data.maintenance_window) : void 0 }; }; -const unmarshalSetImageResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'SetImageResponse' failed as data isn't a dictionary.`); +const unmarshalClusterAutoscalerConfig = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ClusterAutoscalerConfig' failed as data isn't a dictionary.` + ); } return { - image: data.image ? unmarshalImage$3(data.image) : undefined + balanceSimilarNodeGroups: data.balance_similar_node_groups, + estimator: data.estimator, + expander: data.expander, + expendablePodsPriorityCutoff: data.expendable_pods_priority_cutoff, + ignoreDaemonsetsUtilization: data.ignore_daemonsets_utilization, + maxGracefulTerminationSec: data.max_graceful_termination_sec, + scaleDownDelayAfterAdd: data.scale_down_delay_after_add, + scaleDownDisabled: data.scale_down_disabled, + scaleDownUnneededTime: data.scale_down_unneeded_time, + scaleDownUtilizationThreshold: data.scale_down_utilization_threshold }; }; -const unmarshalSetPlacementGroupResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'SetPlacementGroupResponse' failed as data isn't a dictionary.`); +const unmarshalClusterOpenIDConnectConfig = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ClusterOpenIDConnectConfig' failed as data isn't a dictionary.` + ); } return { - placementGroup: data.placement_group ? unmarshalPlacementGroup(data.placement_group) : undefined + clientId: data.client_id, + groupsClaim: data.groups_claim, + groupsPrefix: data.groups_prefix, + issuerUrl: data.issuer_url, + requiredClaim: data.required_claim, + usernameClaim: data.username_claim, + usernamePrefix: data.username_prefix }; }; -const unmarshalSetPlacementGroupServersResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'SetPlacementGroupServersResponse' failed as data isn't a dictionary.`); +const unmarshalCluster = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Cluster' failed as data isn't a dictionary.` + ); } return { - servers: unmarshalArrayOfObject(data.servers, unmarshalPlacementGroupServer) + admissionPlugins: data.admission_plugins, + apiserverCertSans: data.apiserver_cert_sans, + autoUpgrade: data.auto_upgrade ? unmarshalClusterAutoUpgrade(data.auto_upgrade) : void 0, + autoscalerConfig: data.autoscaler_config ? unmarshalClusterAutoscalerConfig(data.autoscaler_config) : void 0, + clusterUrl: data.cluster_url, + cni: data.cni, + commitmentEndsAt: marshalling.unmarshalDate(data.commitment_ends_at), + createdAt: marshalling.unmarshalDate(data.created_at), + description: data.description, + dnsWildcard: data.dns_wildcard, + featureGates: data.feature_gates, + fullVpcIntegratonEnabled: data.full_vpc_integraton_enabled, + id: data.id, + name: data.name, + openIdConnectConfig: data.open_id_connect_config ? unmarshalClusterOpenIDConnectConfig(data.open_id_connect_config) : void 0, + organizationId: data.organization_id, + privateNetworkId: data.private_network_id, + projectId: data.project_id, + region: data.region, + routedIpEnabled: data.routed_ip_enabled, + sbsCsiEnabled: data.sbs_csi_enabled, + status: data.status, + tags: data.tags, + type: data.type, + updatedAt: marshalling.unmarshalDate(data.updated_at), + upgradeAvailable: data.upgrade_available, + version: data.version }; }; -const unmarshalSetSecurityGroupResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'SetSecurityGroupResponse' failed as data isn't a dictionary.`); +const unmarshalNode = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Node' failed as data isn't a dictionary.` + ); } return { - securityGroup: data.security_group ? unmarshalSecurityGroup(data.security_group) : undefined + clusterId: data.cluster_id, + conditions: data.conditions ? data.conditions : void 0, + createdAt: marshalling.unmarshalDate(data.created_at), + errorMessage: data.error_message, + id: data.id, + name: data.name, + poolId: data.pool_id, + providerId: data.provider_id, + publicIpV4: data.public_ip_v4, + publicIpV6: data.public_ip_v6, + region: data.region, + status: data.status, + updatedAt: marshalling.unmarshalDate(data.updated_at) }; }; -const unmarshalSetSecurityGroupRuleResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'SetSecurityGroupRuleResponse' failed as data isn't a dictionary.`); +const unmarshalExternalNodeCoreV1Taint = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ExternalNodeCoreV1Taint' failed as data isn't a dictionary.` + ); } return { - rule: data.rule ? unmarshalSecurityGroupRule(data.rule) : undefined + effect: data.effect, + key: data.key, + value: data.value }; }; -const unmarshalSetSecurityGroupRulesResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'SetSecurityGroupRulesResponse' failed as data isn't a dictionary.`); +const unmarshalExternalNode = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ExternalNode' failed as data isn't a dictionary.` + ); } return { - rules: unmarshalArrayOfObject(data.rules, unmarshalSecurityGroupRule) + clusterCa: data.cluster_ca, + clusterUrl: data.cluster_url, + cniPluginsVersion: data.cni_plugins_version, + containerdVersion: data.containerd_version, + externalIp: data.external_ip, + id: data.id, + kubeToken: data.kube_token, + kubeletConfig: data.kubelet_config, + name: data.name, + nodeLabels: data.node_labels, + nodeTaints: marshalling.unmarshalArrayOfObject( + data.node_taints, + unmarshalExternalNodeCoreV1Taint + ), + poolVersion: data.pool_version, + runcVersion: data.runc_version }; }; -const unmarshalSetServerResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'SetServerResponse' failed as data isn't a dictionary.`); +const unmarshalExternalNodeAuth = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ExternalNodeAuth' failed as data isn't a dictionary.` + ); } return { - server: data.server ? unmarshalServer(data.server) : undefined + apiUrl: data.api_url, + nodeToken: data.node_token }; }; -const unmarshalSetSnapshotResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'SetSnapshotResponse' failed as data isn't a dictionary.`); +const unmarshalClusterType = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ClusterType' failed as data isn't a dictionary.` + ); } return { - snapshot: data.snapshot ? unmarshalSnapshot$1(data.snapshot) : undefined + auditLogsSupported: data.audit_logs_supported, + availability: data.availability, + commitmentDelay: data.commitment_delay, + dedicated: data.dedicated, + maxEtcdSize: data.max_etcd_size, + maxNodes: data.max_nodes, + memory: data.memory, + name: data.name, + resiliency: data.resiliency, + sla: data.sla }; }; -const unmarshalUpdateIpResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'UpdateIpResponse' failed as data isn't a dictionary.`); +const unmarshalListClusterAvailableTypesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListClusterAvailableTypesResponse' failed as data isn't a dictionary.` + ); } return { - ip: data.ip ? unmarshalIp$1(data.ip) : undefined + clusterTypes: marshalling.unmarshalArrayOfObject( + data.cluster_types, + unmarshalClusterType + ), + totalCount: data.total_count }; }; -const unmarshalUpdatePlacementGroupResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'UpdatePlacementGroupResponse' failed as data isn't a dictionary.`); +const unmarshalListClusterAvailableVersionsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListClusterAvailableVersionsResponse' failed as data isn't a dictionary.` + ); } return { - placementGroup: data.placement_group ? unmarshalPlacementGroup(data.placement_group) : undefined + versions: marshalling.unmarshalArrayOfObject(data.versions, unmarshalVersion) }; }; -const unmarshalUpdatePlacementGroupServersResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'UpdatePlacementGroupServersResponse' failed as data isn't a dictionary.`); +const unmarshalListClusterTypesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListClusterTypesResponse' failed as data isn't a dictionary.` + ); } return { - servers: unmarshalArrayOfObject(data.servers, unmarshalPlacementGroupServer) + clusterTypes: marshalling.unmarshalArrayOfObject( + data.cluster_types, + unmarshalClusterType + ), + totalCount: data.total_count }; }; -const unmarshalUpdateServerResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'UpdateServerResponse' failed as data isn't a dictionary.`); +const unmarshalListClustersResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListClustersResponse' failed as data isn't a dictionary.` + ); } return { - server: data.server ? unmarshalServer(data.server) : undefined + clusters: marshalling.unmarshalArrayOfObject(data.clusters, unmarshalCluster), + totalCount: data.total_count }; }; -const unmarshalUpdateVolumeResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'UpdateVolumeResponse' failed as data isn't a dictionary.`); +const unmarshalListNodesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListNodesResponse' failed as data isn't a dictionary.` + ); } return { - volume: data.volume ? unmarshalVolume$2(data.volume) : undefined - }; -}; -const marshalServerSummary$1 = (request, defaults) => ({ - id: request.id, - name: request.name -}); -const marshalBootscript$1 = (request, defaults) => ({ - arch: request.arch, - bootcmdargs: request.bootcmdargs, - default: request.default, - dtb: request.dtb, - id: request.id, - initrd: request.initrd, - kernel: request.kernel, - organization: request.organization, - project: request.project, - public: request.public, - title: request.title, - zone: request.zone -}); -const marshalVolume$1 = (request, defaults) => ({ - creation_date: request.creationDate, - export_uri: request.exportUri, - id: request.id, - modification_date: request.modificationDate, - name: request.name, - organization: request.organization, - project: request.project, - server: request.server ? marshalServerSummary$1(request.server) : undefined, - size: request.size, - state: request.state, - tags: request.tags, - volume_type: request.volumeType, - zone: request.zone -}); -const marshalVolumeSummary$1 = (request, defaults) => ({ - id: request.id, - name: request.name, - size: request.size, - volume_type: request.volumeType -}); -const marshalImage = (request, defaults) => ({ - arch: request.arch, - creation_date: request.creationDate, - default_bootscript: request.defaultBootscript ? marshalBootscript$1(request.defaultBootscript) : undefined, - extra_volumes: Object.entries(request.extraVolumes).reduce((acc, [key, value]) => ({ - ...acc, - [key]: marshalVolume$1(value) - }), {}), - from_server: request.fromServer, - id: request.id, - modification_date: request.modificationDate, - name: request.name, - organization: request.organization, - project: request.project, - public: request.public, - root_volume: request.rootVolume ? marshalVolumeSummary$1(request.rootVolume) : undefined, - state: request.state, - tags: request.tags, - zone: request.zone -}); -const marshalPlacementGroup = (request, defaults) => ({ - id: request.id, - name: request.name, - organization: request.organization, - policy_mode: request.policyMode, - policy_respected: request.policyRespected, - policy_type: request.policyType, - project: request.project, - tags: request.tags, - zone: request.zone -}); -const marshalPrivateNIC = (request, defaults) => ({ - id: request.id, - mac_address: request.macAddress, - private_network_id: request.privateNetworkId, - server_id: request.serverId, - state: request.state, - tags: request.tags -}); -const marshalSecurityGroupSummary = (request, defaults) => ({ - id: request.id, - name: request.name -}); -const marshalSecurityGroupTemplate = (request, defaults) => ({ - id: request.id, - name: request.name -}); -const marshalServerActionRequestVolumeBackupTemplate = (request, defaults) => ({ - volume_type: request.volumeType -}); -const marshalServerIp = (request, defaults) => ({ - address: request.address, - dynamic: request.dynamic, - family: request.family, - gateway: request.gateway, - id: request.id, - netmask: request.netmask, - provisioning_mode: request.provisioningMode, - tags: request.tags -}); -const marshalServerIpv6 = (request, defaults) => ({ - address: request.address, - gateway: request.gateway, - netmask: request.netmask -}); -const marshalServerLocation = (request, defaults) => ({ - cluster_id: request.clusterId, - hypervisor_id: request.hypervisorId, - node_id: request.nodeId, - platform_id: request.platformId, - zone_id: request.zoneId + nodes: marshalling.unmarshalArrayOfObject(data.nodes, unmarshalNode), + totalCount: data.total_count + }; +}; +const unmarshalListPoolsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListPoolsResponse' failed as data isn't a dictionary.` + ); + } + return { + pools: marshalling.unmarshalArrayOfObject(data.pools, unmarshalPool), + totalCount: data.total_count + }; +}; +const unmarshalListVersionsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListVersionsResponse' failed as data isn't a dictionary.` + ); + } + return { + versions: marshalling.unmarshalArrayOfObject(data.versions, unmarshalVersion) + }; +}; +const unmarshalNodeMetadataCoreV1Taint = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'NodeMetadataCoreV1Taint' failed as data isn't a dictionary.` + ); + } + return { + effect: data.effect, + key: data.key, + value: data.value + }; +}; +const unmarshalNodeMetadata = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'NodeMetadata' failed as data isn't a dictionary.` + ); + } + return { + clusterCa: data.cluster_ca, + clusterUrl: data.cluster_url, + credentialProviderConfig: data.credential_provider_config, + externalIp: data.external_ip, + fullIsolation: data.full_isolation, + hasGpu: data.has_gpu, + id: data.id, + kapsuleIfaceMac: data.kapsule_iface_mac, + kubeletConfig: data.kubelet_config, + name: data.name, + nodeLabels: data.node_labels, + nodeTaints: marshalling.unmarshalArrayOfObject( + data.node_taints, + unmarshalNodeMetadataCoreV1Taint + ), + poolVersion: data.pool_version, + privateNetworkMode: data.private_network_mode + }; +}; +const marshalMaintenanceWindow = (request, defaults) => ({ + day: request.day, + start_hour: request.startHour }); -const marshalServerMaintenance = (request, defaults) => ({ - reason: request.reason +const marshalCreateClusterRequestPoolConfigUpgradePolicy = (request, defaults) => ({ + max_surge: request.maxSurge, + max_unavailable: request.maxUnavailable }); -const marshalSetSecurityGroupRulesRequestRule = (request, defaults) => ({ - action: request.action, - dest_port_from: request.destPortFrom, - dest_port_to: request.destPortTo, - direction: request.direction, - editable: request.editable, - id: request.id, - ip_range: request.ipRange, - position: request.position, - protocol: request.protocol, - zone: request.zone +const marshalCreateClusterRequestAutoUpgrade = (request, defaults) => ({ + enable: request.enable, + maintenance_window: request.maintenanceWindow !== void 0 ? marshalMaintenanceWindow(request.maintenanceWindow) : void 0 }); -const marshalSnapshotBaseVolume = (request, defaults) => ({ - id: request.id, - name: request.name +const marshalCreateClusterRequestAutoscalerConfig = (request, defaults) => ({ + balance_similar_node_groups: request.balanceSimilarNodeGroups, + estimator: request.estimator, + expander: request.expander, + expendable_pods_priority_cutoff: request.expendablePodsPriorityCutoff, + ignore_daemonsets_utilization: request.ignoreDaemonsetsUtilization, + max_graceful_termination_sec: request.maxGracefulTerminationSec, + scale_down_delay_after_add: request.scaleDownDelayAfterAdd, + scale_down_disabled: request.scaleDownDisabled, + scale_down_unneeded_time: request.scaleDownUnneededTime, + scale_down_utilization_threshold: request.scaleDownUtilizationThreshold }); -const marshalVolumeServerTemplate = (request, defaults) => ({ - base_snapshot: request.baseSnapshot, - boot: request.boot, - id: request.id, - name: request.name, - organization: request.organization, - project: request.project, - size: request.size, - volume_type: request.volumeType +const marshalCreateClusterRequestOpenIDConnectConfig = (request, defaults) => ({ + client_id: request.clientId, + groups_claim: request.groupsClaim, + groups_prefix: request.groupsPrefix, + issuer_url: request.issuerUrl, + required_claim: request.requiredClaim, + username_claim: request.usernameClaim, + username_prefix: request.usernamePrefix }); -const marshalVolumeTemplate = (request, defaults) => ({ - id: request.id, +const marshalCreateClusterRequestPoolConfig = (request, defaults) => ({ + autohealing: request.autohealing, + autoscaling: request.autoscaling, + container_runtime: request.containerRuntime, + kubelet_args: request.kubeletArgs, + max_size: request.maxSize, + min_size: request.minSize, name: request.name, + node_type: request.nodeType, + placement_group_id: request.placementGroupId, + public_ip_disabled: request.publicIpDisabled, + root_volume_size: request.rootVolumeSize, + root_volume_type: request.rootVolumeType, size: request.size, - volume_type: request.volumeType, - ...resolveOneOf([{ - param: 'project', - value: request.project - }, { - param: 'organization', - value: request.organization - }]) -}); -const marshalApplyBlockMigrationRequest = (request, defaults) => ({ - validation_key: request.validationKey, - ...resolveOneOf([{ - param: 'volume_id', - value: request.volumeId - }, { - param: 'snapshot_id', - value: request.snapshotId - }]) -}); -const marshalCreateImageRequest = (request, defaults) => ({ - arch: request.arch, - default_bootscript: request.defaultBootscript, - extra_volumes: request.extraVolumes ? Object.entries(request.extraVolumes).reduce((acc, [key, value]) => ({ - ...acc, - [key]: marshalVolumeTemplate(value) - }), {}) : undefined, - name: request.name || randomName('img'), - public: request.public, - root_volume: request.rootVolume, - tags: request.tags, - ...resolveOneOf([{ - default: defaults.defaultProjectId, - param: 'project', - value: request.project - }, { - default: defaults.defaultOrganizationId, - param: 'organization', - value: request.organization - }]) -}); -const marshalCreateIpRequest$1 = (request, defaults) => ({ - server: request.server, - tags: request.tags, - type: request.type ?? 'unknown_iptype', - ...resolveOneOf([{ - default: defaults.defaultProjectId, - param: 'project', - value: request.project - }, { - default: defaults.defaultOrganizationId, - param: 'organization', - value: request.organization - }]) -}); -const marshalCreatePlacementGroupRequest = (request, defaults) => ({ - name: request.name || randomName('pg'), - policy_mode: request.policyMode ?? 'optional', - policy_type: request.policyType ?? 'max_availability', tags: request.tags, - ...resolveOneOf([{ - default: defaults.defaultProjectId, - param: 'project', - value: request.project - }, { - default: defaults.defaultOrganizationId, - param: 'organization', - value: request.organization - }]) -}); -const marshalCreatePrivateNICRequest = (request, defaults) => ({ - ip_ids: request.ipIds, - private_network_id: request.privateNetworkId, - tags: request.tags + upgrade_policy: request.upgradePolicy !== void 0 ? marshalCreateClusterRequestPoolConfigUpgradePolicy( + request.upgradePolicy + ) : void 0, + zone: request.zone }); -const marshalCreateSecurityGroupRequest = (request, defaults) => ({ +const marshalCreateClusterRequest = (request, defaults) => ({ + admission_plugins: request.admissionPlugins, + apiserver_cert_sans: request.apiserverCertSans, + auto_upgrade: request.autoUpgrade !== void 0 ? marshalCreateClusterRequestAutoUpgrade(request.autoUpgrade) : void 0, + autoscaler_config: request.autoscalerConfig !== void 0 ? marshalCreateClusterRequestAutoscalerConfig( + request.autoscalerConfig + ) : void 0, + cni: request.cni, description: request.description, - enable_default_security: request.enableDefaultSecurity, - inbound_default_policy: request.inboundDefaultPolicy ?? 'accept', - name: request.name || randomName('sg'), - outbound_default_policy: request.outboundDefaultPolicy ?? 'accept', - stateful: request.stateful, + feature_gates: request.featureGates, + name: request.name || randomName("k8s"), + open_id_connect_config: request.openIdConnectConfig !== void 0 ? marshalCreateClusterRequestOpenIDConnectConfig( + request.openIdConnectConfig + ) : void 0, + pools: request.pools !== void 0 ? request.pools.map( + (elt) => marshalCreateClusterRequestPoolConfig(elt) + ) : void 0, + private_network_id: request.privateNetworkId, tags: request.tags, - ...resolveOneOf([{ - param: 'organization_default', - value: request.organizationDefault - }, { - param: 'project_default', - value: request.projectDefault - }]), - ...resolveOneOf([{ - default: defaults.defaultProjectId, - param: 'project', - value: request.project - }, { - default: defaults.defaultOrganizationId, - param: 'organization', - value: request.organization - }]) + type: request.type, + version: request.version, + ...marshalling.resolveOneOf([ + { + default: defaults.defaultProjectId, + param: "project_id", + value: request.projectId + }, + { + default: defaults.defaultOrganizationId, + param: "organization_id", + value: request.organizationId + } + ]) }); -const marshalCreateSecurityGroupRuleRequest = (request, defaults) => ({ - action: request.action, - dest_port_from: request.destPortFrom, - dest_port_to: request.destPortTo, - direction: request.direction, - editable: request.editable, - ip_range: request.ipRange, - position: request.position, - protocol: request.protocol +const marshalCreatePoolRequestUpgradePolicy = (request, defaults) => ({ + max_surge: request.maxSurge, + max_unavailable: request.maxUnavailable }); -const marshalCreateServerRequest = (request, defaults) => ({ - boot_type: request.bootType, - bootscript: request.bootscript, - commercial_type: request.commercialType, - dynamic_ip_required: request.dynamicIpRequired, - enable_ipv6: request.enableIpv6, - image: request.image, - name: request.name || randomName('srv'), - placement_group: request.placementGroup, - public_ip: request.publicIp, - public_ips: request.publicIps, - routed_ip_enabled: request.routedIpEnabled, - security_group: request.securityGroup, - tags: request.tags, - volumes: request.volumes ? Object.entries(request.volumes).reduce((acc, [key, value]) => ({ - ...acc, - [key]: marshalVolumeServerTemplate(value) - }), {}) : undefined, - ...resolveOneOf([{ - default: defaults.defaultProjectId, - param: 'project', - value: request.project - }, { - default: defaults.defaultOrganizationId, - param: 'organization', - value: request.organization - }]) -}); -const marshalCreateSnapshotRequest$1 = (request, defaults) => ({ - bucket: request.bucket, - key: request.key, - name: request.name || randomName('snp'), +const marshalCreatePoolRequest = (request, defaults) => ({ + autohealing: request.autohealing, + autoscaling: request.autoscaling, + container_runtime: request.containerRuntime, + kubelet_args: request.kubeletArgs !== void 0 ? request.kubeletArgs : void 0, + max_size: request.maxSize, + min_size: request.minSize, + name: request.name || randomName("pool"), + node_type: request.nodeType, + placement_group_id: request.placementGroupId, + public_ip_disabled: request.publicIpDisabled, + root_volume_size: request.rootVolumeSize, + root_volume_type: request.rootVolumeType, size: request.size, tags: request.tags, - volume_id: request.volumeId, - volume_type: request.volumeType ?? 'unknown_volume_type', - ...resolveOneOf([{ - default: defaults.defaultProjectId, - param: 'project', - value: request.project - }, { - default: defaults.defaultOrganizationId, - param: 'organization', - value: request.organization - }]) -}); -const marshalCreateVolumeRequest$1 = (request, defaults) => ({ - name: request.name || randomName('vol'), - tags: request.tags, - volume_type: request.volumeType ?? 'l_ssd', - ...resolveOneOf([{ - default: defaults.defaultProjectId, - param: 'project', - value: request.project - }, { - default: defaults.defaultOrganizationId, - param: 'organization', - value: request.organization - }]), - ...resolveOneOf([{ - param: 'size', - value: request.size - }, { - param: 'base_volume', - value: request.baseVolume - }, { - param: 'base_snapshot', - value: request.baseSnapshot - }]) -}); -const marshalExportSnapshotRequest = (request, defaults) => ({ - bucket: request.bucket, - key: request.key -}); -const marshalPlanBlockMigrationRequest = (request, defaults) => ({ - ...resolveOneOf([{ - param: 'volume_id', - value: request.volumeId - }, { - param: 'snapshot_id', - value: request.snapshotId - }]) + upgrade_policy: request.upgradePolicy !== void 0 ? marshalCreatePoolRequestUpgradePolicy(request.upgradePolicy) : void 0, + zone: request.zone ?? defaults.defaultZone }); -const marshalServerActionRequest = (request, defaults) => ({ - action: request.action ?? 'poweron', - name: request.name, - volumes: request.volumes ? Object.entries(request.volumes).reduce((acc, [key, value]) => ({ - ...acc, - [key]: marshalServerActionRequestVolumeBackupTemplate(value) - }), {}) : undefined +const marshalSetClusterTypeRequest = (request, defaults) => ({ + type: request.type }); -const marshalSetImageRequest = (request, defaults) => ({ - arch: request.arch, - creation_date: request.creationDate, - default_bootscript: request.defaultBootscript ? marshalBootscript$1(request.defaultBootscript) : undefined, - extra_volumes: request.extraVolumes ? Object.entries(request.extraVolumes).reduce((acc, [key, value]) => ({ - ...acc, - [key]: marshalVolume$1(value) - }), {}) : undefined, - from_server: request.fromServer, - modification_date: request.modificationDate, - name: request.name, - organization: request.organization, - project: request.project, - public: request.public, - root_volume: request.rootVolume ? marshalVolumeSummary$1(request.rootVolume) : undefined, - state: request.state, - tags: request.tags +const marshalUpdateClusterRequestAutoUpgrade = (request, defaults) => ({ + enable: request.enable, + maintenance_window: request.maintenanceWindow !== void 0 ? marshalMaintenanceWindow(request.maintenanceWindow) : void 0 }); -const marshalSetPlacementGroupRequest = (request, defaults) => ({ - name: request.name, - organization: request.organization, - policy_mode: request.policyMode, - policy_type: request.policyType, - project: request.project, - tags: request.tags +const marshalUpdateClusterRequestAutoscalerConfig = (request, defaults) => ({ + balance_similar_node_groups: request.balanceSimilarNodeGroups, + estimator: request.estimator, + expander: request.expander, + expendable_pods_priority_cutoff: request.expendablePodsPriorityCutoff, + ignore_daemonsets_utilization: request.ignoreDaemonsetsUtilization, + max_graceful_termination_sec: request.maxGracefulTerminationSec, + scale_down_delay_after_add: request.scaleDownDelayAfterAdd, + scale_down_disabled: request.scaleDownDisabled, + scale_down_unneeded_time: request.scaleDownUnneededTime, + scale_down_utilization_threshold: request.scaleDownUtilizationThreshold }); -const marshalSetPlacementGroupServersRequest = (request, defaults) => ({ - servers: request.servers +const marshalUpdateClusterRequestOpenIDConnectConfig = (request, defaults) => ({ + client_id: request.clientId, + groups_claim: request.groupsClaim, + groups_prefix: request.groupsPrefix, + issuer_url: request.issuerUrl, + required_claim: request.requiredClaim, + username_claim: request.usernameClaim, + username_prefix: request.usernamePrefix }); -const marshalSetSecurityGroupRequest = (request, defaults) => ({ - creation_date: request.creationDate, +const marshalUpdateClusterRequest = (request, defaults) => ({ + admission_plugins: request.admissionPlugins, + apiserver_cert_sans: request.apiserverCertSans, + auto_upgrade: request.autoUpgrade !== void 0 ? marshalUpdateClusterRequestAutoUpgrade(request.autoUpgrade) : void 0, + autoscaler_config: request.autoscalerConfig !== void 0 ? marshalUpdateClusterRequestAutoscalerConfig( + request.autoscalerConfig + ) : void 0, description: request.description, - enable_default_security: request.enableDefaultSecurity, - inbound_default_policy: request.inboundDefaultPolicy, - modification_date: request.modificationDate, + feature_gates: request.featureGates, name: request.name, - organization: request.organization, - organization_default: request.organizationDefault, - outbound_default_policy: request.outboundDefaultPolicy, - project: request.project, - project_default: request.projectDefault, - servers: request.servers ? request.servers.map(elt => marshalServerSummary$1(elt)) : undefined, - stateful: request.stateful, + open_id_connect_config: request.openIdConnectConfig !== void 0 ? marshalUpdateClusterRequestOpenIDConnectConfig( + request.openIdConnectConfig + ) : void 0, tags: request.tags }); -const marshalSetSecurityGroupRuleRequest = (request, defaults) => ({ - action: request.action, - dest_port_from: request.destPortFrom, - dest_port_to: request.destPortTo, - direction: request.direction, - editable: request.editable, - id: request.id, - ip_range: request.ipRange, - position: request.position, - protocol: request.protocol +const marshalUpdatePoolRequestUpgradePolicy = (request, defaults) => ({ + max_surge: request.maxSurge, + max_unavailable: request.maxUnavailable +}); +const marshalUpdatePoolRequest = (request, defaults) => ({ + autohealing: request.autohealing, + autoscaling: request.autoscaling, + kubelet_args: request.kubeletArgs, + max_size: request.maxSize, + min_size: request.minSize, + size: request.size, + tags: request.tags, + upgrade_policy: request.upgradePolicy !== void 0 ? marshalUpdatePoolRequestUpgradePolicy(request.upgradePolicy) : void 0 }); -const marshalSetSecurityGroupRulesRequest = (request, defaults) => ({ - rules: request.rules ? request.rules.map(elt => marshalSetSecurityGroupRulesRequestRule(elt)) : undefined +const marshalUpgradeClusterRequest = (request, defaults) => ({ + upgrade_pools: request.upgradePools, + version: request.version }); -const marshalSetServerRequest = (request, defaults) => ({ - allowed_actions: request.allowedActions, - arch: request.arch, - boot_type: request.bootType, - bootscript: request.bootscript ? marshalBootscript$1(request.bootscript) : undefined, - commercial_type: request.commercialType, - creation_date: request.creationDate, - dynamic_ip_required: request.dynamicIpRequired, - enable_ipv6: request.enableIpv6, - hostname: request.hostname, - image: request.image ? marshalImage(request.image) : undefined, - ipv6: request.ipv6 ? marshalServerIpv6(request.ipv6) : undefined, - location: request.location ? marshalServerLocation(request.location) : undefined, - maintenances: request.maintenances ? request.maintenances.map(elt => marshalServerMaintenance(elt)) : undefined, - modification_date: request.modificationDate, - name: request.name, - organization: request.organization, - placement_group: request.placementGroup ? marshalPlacementGroup(request.placementGroup) : undefined, - private_ip: request.privateIp, - private_nics: request.privateNics ? request.privateNics.map(elt => marshalPrivateNIC(elt)) : undefined, - project: request.project, - protected: request.protected, - public_ip: request.publicIp ? marshalServerIp(request.publicIp) : undefined, - public_ips: request.publicIps ? request.publicIps.map(elt => marshalServerIp(elt)) : undefined, - routed_ip_enabled: request.routedIpEnabled, - security_group: request.securityGroup ? marshalSecurityGroupSummary(request.securityGroup) : undefined, - state: request.state, - state_detail: request.stateDetail, - tags: request.tags, - volumes: request.volumes ? Object.entries(request.volumes).reduce((acc, [key, value]) => ({ - ...acc, - [key]: marshalVolume$1(value) - }), {}) : undefined +const marshalUpgradePoolRequest = (request, defaults) => ({ + version: request.version +}); +exports.marshalCreateClusterRequest = marshalCreateClusterRequest; +exports.marshalCreatePoolRequest = marshalCreatePoolRequest; +exports.marshalSetClusterTypeRequest = marshalSetClusterTypeRequest; +exports.marshalUpdateClusterRequest = marshalUpdateClusterRequest; +exports.marshalUpdatePoolRequest = marshalUpdatePoolRequest; +exports.marshalUpgradeClusterRequest = marshalUpgradeClusterRequest; +exports.marshalUpgradePoolRequest = marshalUpgradePoolRequest; +exports.unmarshalCluster = unmarshalCluster; +exports.unmarshalExternalNode = unmarshalExternalNode; +exports.unmarshalExternalNodeAuth = unmarshalExternalNodeAuth; +exports.unmarshalListClusterAvailableTypesResponse = unmarshalListClusterAvailableTypesResponse; +exports.unmarshalListClusterAvailableVersionsResponse = unmarshalListClusterAvailableVersionsResponse; +exports.unmarshalListClusterTypesResponse = unmarshalListClusterTypesResponse; +exports.unmarshalListClustersResponse = unmarshalListClustersResponse; +exports.unmarshalListNodesResponse = unmarshalListNodesResponse; +exports.unmarshalListPoolsResponse = unmarshalListPoolsResponse; +exports.unmarshalListVersionsResponse = unmarshalListVersionsResponse; +exports.unmarshalNode = unmarshalNode; +exports.unmarshalNodeMetadata = unmarshalNodeMetadata; +exports.unmarshalPool = unmarshalPool; +exports.unmarshalVersion = unmarshalVersion; + + +/***/ }), + +/***/ 6431: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const CreateClusterRequest = { + description: { + maxLength: 4096 + }, + name: { + maxLength: 100, + minLength: 1 + }, + type: { + maxLength: 100 + }, + version: { + maxLength: 10 + } +}; +const CreateClusterRequestAutoscalerConfig = { + scaleDownDelayAfterAdd: { + maxLength: 100 + }, + scaleDownUtilizationThreshold: { + greaterThan: 0, + lessThan: 1 + } +}; +const CreateClusterRequestOpenIDConnectConfig = { + clientId: { + maxLength: 255, + minLength: 1 + }, + groupsPrefix: { + maxLength: 100, + minLength: 1 + }, + issuerUrl: { + maxLength: 255 + }, + usernameClaim: { + maxLength: 100, + minLength: 1 + }, + usernamePrefix: { + maxLength: 100, + minLength: 1 + } +}; +const CreateClusterRequestPoolConfig = { + name: { + maxLength: 100, + minLength: 1 + } +}; +const CreatePoolRequest = { + name: { + maxLength: 100, + minLength: 1 + } +}; +const ListClusterTypesRequest = { + page: { + greaterThan: 0 + }, + pageSize: { + greaterThan: 0, + lessThanOrEqual: 100 + } +}; +const ListClustersRequest = { + name: { + minLength: 1 + }, + page: { + greaterThan: 0 + }, + pageSize: { + greaterThan: 0, + lessThanOrEqual: 100 + } +}; +const ListNodesRequest = { + name: { + minLength: 1 + }, + page: { + greaterThan: 0 + }, + pageSize: { + greaterThan: 0, + lessThanOrEqual: 100 + } +}; +const ListPoolsRequest = { + name: { + minLength: 1 + }, + page: { + greaterThan: 0 + }, + pageSize: { + greaterThan: 0, + lessThanOrEqual: 100 + } +}; +const MaintenanceWindow = { + startHour: { + lessThanOrEqual: 23 + } +}; +const SetClusterTypeRequest = { + type: { + maxLength: 100 + } +}; +const UpdateClusterRequest = { + description: { + maxLength: 4096 + }, + name: { + maxLength: 100, + minLength: 1 + } +}; +const UpdateClusterRequestAutoscalerConfig = { + scaleDownDelayAfterAdd: { + maxLength: 100 + }, + scaleDownUtilizationThreshold: { + greaterThan: 0, + lessThan: 1 + } +}; +const UpdateClusterRequestOpenIDConnectConfig = { + clientId: { + maxLength: 255, + minLength: 1 + }, + groupsPrefix: { + maxLength: 100, + minLength: 1 + }, + issuerUrl: { + maxLength: 255 + }, + usernameClaim: { + maxLength: 100, + minLength: 1 + }, + usernamePrefix: { + maxLength: 100, + minLength: 1 + } +}; +const UpgradeClusterRequest = { + version: { + maxLength: 10 + } +}; +exports.CreateClusterRequest = CreateClusterRequest; +exports.CreateClusterRequestAutoscalerConfig = CreateClusterRequestAutoscalerConfig; +exports.CreateClusterRequestOpenIDConnectConfig = CreateClusterRequestOpenIDConnectConfig; +exports.CreateClusterRequestPoolConfig = CreateClusterRequestPoolConfig; +exports.CreatePoolRequest = CreatePoolRequest; +exports.ListClusterTypesRequest = ListClusterTypesRequest; +exports.ListClustersRequest = ListClustersRequest; +exports.ListNodesRequest = ListNodesRequest; +exports.ListPoolsRequest = ListPoolsRequest; +exports.MaintenanceWindow = MaintenanceWindow; +exports.SetClusterTypeRequest = SetClusterTypeRequest; +exports.UpdateClusterRequest = UpdateClusterRequest; +exports.UpdateClusterRequestAutoscalerConfig = UpdateClusterRequestAutoscalerConfig; +exports.UpdateClusterRequestOpenIDConnectConfig = UpdateClusterRequestOpenIDConnectConfig; +exports.UpgradeClusterRequest = UpgradeClusterRequest; + + +/***/ }), + +/***/ 4387: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const index_gen = __nccwpck_require__(2194); +exports.v1alpha1 = index_gen; + + +/***/ }), + +/***/ 5770: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api = __nccwpck_require__(3042); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const resourcePaginator = __nccwpck_require__(4983); +const marshalling_gen = __nccwpck_require__(5100); +const jsonContentHeaders = { + "Content-Type": "application/json; charset=utf-8" +}; +class API extends api.API { + /** Lists the available regions of the API. */ + static LOCALITIES = ["fr-par", "nl-ams", "pl-waw"]; + /** + * Create a key. Create a key in a given region specified by the `region` + * parameter. Keys only support symmetric encryption. You can use keys to + * encrypt or decrypt arbitrary payloads, or to generate data encryption keys + * that can be used without being stored in Key Manager. + * + * @param request - The request {@link CreateKeyRequest} + * @returns A Promise of Key + */ + createKey = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateKeyRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/key-manager/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys` + }, + marshalling_gen.unmarshalKey + ); + /** + * Get key metadata. Retrieve the metadata of a key specified by the `region` + * and `key_id` parameters. + * + * @param request - The request {@link GetKeyRequest} + * @returns A Promise of Key + */ + getKey = (request) => this.client.fetch( + { + method: "GET", + path: `/key-manager/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${marshalling.validatePathParam("keyId", request.keyId)}` + }, + marshalling_gen.unmarshalKey + ); + /** + * Update a key. Update a key's metadata (name, description and tags), + * specified by the `key_id` and `region` parameters. + * + * @param request - The request {@link UpdateKeyRequest} + * @returns A Promise of Key + */ + updateKey = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateKeyRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/key-manager/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${marshalling.validatePathParam("keyId", request.keyId)}` + }, + marshalling_gen.unmarshalKey + ); + /** + * Delete a key. Delete an existing key specified by the `region` and `key_id` + * parameters. Deleting a key is permanent and cannot be undone. All data + * encrypted using this key, including data encryption keys, will become + * unusable. + * + * @param request - The request {@link DeleteKeyRequest} + */ + deleteKey = (request) => this.client.fetch({ + method: "DELETE", + path: `/key-manager/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${marshalling.validatePathParam("keyId", request.keyId)}` + }); + /** + * Rotate a key. Generate a new version of an existing key with randomly + * generated key material. Rotated keys can still be used to decrypt + * previously encrypted data. The key's new material will be used for + * subsequent encryption operations and data key generation. + * + * @param request - The request {@link RotateKeyRequest} + * @returns A Promise of Key + */ + rotateKey = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/key-manager/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${marshalling.validatePathParam("keyId", request.keyId)}/rotate` + }, + marshalling_gen.unmarshalKey + ); + /** + * Apply key protection. Apply key protection to a given key specified by the + * `key_id` parameter. Applying key protection means that your key can be used + * and modified, but it cannot be deleted. + * + * @param request - The request {@link ProtectKeyRequest} + * @returns A Promise of Key + */ + protectKey = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/key-manager/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${marshalling.validatePathParam("keyId", request.keyId)}/protect` + }, + marshalling_gen.unmarshalKey + ); + /** + * Remove key protection. Remove key protection from a given key specified by + * the `key_id` parameter. Removing key protection means that your key can be + * deleted anytime. + * + * @param request - The request {@link UnprotectKeyRequest} + * @returns A Promise of Key + */ + unprotectKey = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/key-manager/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${marshalling.validatePathParam("keyId", request.keyId)}/unprotect` + }, + marshalling_gen.unmarshalKey + ); + /** + * Enable key. Enable a given key to be used for cryptographic operations. + * Enabling a key allows you to make a disabled key usable again. You must + * specify the `region` and `key_id` parameters. + * + * @param request - The request {@link EnableKeyRequest} + * @returns A Promise of Key + */ + enableKey = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/key-manager/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${marshalling.validatePathParam("keyId", request.keyId)}/enable` + }, + marshalling_gen.unmarshalKey + ); + /** + * Disable key. Disable a given key to be used for cryptographic operations. + * Disabling a key renders it unusable. You must specify the `region` and + * `key_id` parameters. + * + * @param request - The request {@link DisableKeyRequest} + * @returns A Promise of Key + */ + disableKey = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/key-manager/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${marshalling.validatePathParam("keyId", request.keyId)}/disable` + }, + marshalling_gen.unmarshalKey + ); + pageOfListKeys = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/key-manager/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys`, + urlParams: marshalling.urlParams( + ["name", request.name], + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId], + ["tags", request.tags] + ) + }, + marshalling_gen.unmarshalListKeysResponse + ); + /** + * List keys. Retrieve the list of keys created within all Projects of an + * Organization or in a given Project. You must specify the `region`, and + * either the `organization_id` or the `project_id`. + * + * @param request - The request {@link ListKeysRequest} + * @returns A Promise of ListKeysResponse + */ + listKeys = (request = {}) => resourcePaginator.enrichForPagination("keys", this.pageOfListKeys, request); + /** + * Generate a data encryption key. Generate a new data encryption key to use + * for cryptographic operations outside of Key Manager. Note that Key Manager + * does not store your data encryption key. The data encryption key is + * encrypted and must be decrypted using the key you have created in Key + * Manager. The data encryption key's plaintext is returned in the response + * object, for immediate usage. + * + * Always store the data encryption key's ciphertext, rather than its + * plaintext, which must not be stored. To retrieve your key's plaintext, call + * the Decrypt endpoint with your key's ID and ciphertext. + * + * @param request - The request {@link GenerateDataKeyRequest} + * @returns A Promise of DataKey + */ + generateDataKey = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalGenerateDataKeyRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/key-manager/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${marshalling.validatePathParam("keyId", request.keyId)}/generate-data-key` + }, + marshalling_gen.unmarshalDataKey + ); + /** + * Encrypt data. Encrypt data using an existing key, specified by the `key_id` + * parameter. Only keys with a usage set to **symmetric_encryption** are + * supported by this method. The maximum payload size that can be encrypted is + * 64KB of plaintext. + * + * @param request - The request {@link EncryptRequest} + * @returns A Promise of EncryptResponse + */ + encrypt = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalEncryptRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/key-manager/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${marshalling.validatePathParam("keyId", request.keyId)}/encrypt` + }, + marshalling_gen.unmarshalEncryptResponse + ); + /** + * Decrypt data. Decrypt data using an existing key, specified by the `key_id` + * parameter. The maximum payload size that can be decrypted is the result of + * the encryption of 64KB of data (around 131KB). + * + * @param request - The request {@link DecryptRequest} + * @returns A Promise of DecryptResponse + */ + decrypt = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalDecryptRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/key-manager/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${marshalling.validatePathParam("keyId", request.keyId)}/decrypt` + }, + marshalling_gen.unmarshalDecryptResponse + ); + /** + * Import key material. Import key material to use to derive a new + * cryptographic key. The key's origin must be `external`. + * + * @param request - The request {@link ImportKeyMaterialRequest} + * @returns A Promise of Key + */ + importKeyMaterial = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalImportKeyMaterialRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/key-manager/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${marshalling.validatePathParam("keyId", request.keyId)}/import-key-material` + }, + marshalling_gen.unmarshalKey + ); + /** + * Delete key material. Delete previously imported key material. This renders + * the associated cryptographic key unusable for any operation. The key's + * origin must be `external`. + * + * @param request - The request {@link DeleteKeyMaterialRequest} + */ + deleteKeyMaterial = (request) => this.client.fetch({ + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/key-manager/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${marshalling.validatePathParam("keyId", request.keyId)}/delete-key-material` + }); +} +exports.API = API; + + +/***/ }), + +/***/ 2194: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api_gen = __nccwpck_require__(5770); +exports.API = api_gen.API; + + +/***/ }), + +/***/ 5100: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const json = __nccwpck_require__(3746); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const unmarshalKeyRotationPolicy = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'KeyRotationPolicy' failed as data isn't a dictionary.` + ); + } + return { + nextRotationAt: marshalling.unmarshalDate(data.next_rotation_at), + rotationPeriod: data.rotation_period + }; +}; +const unmarshalKeyUsage = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'KeyUsage' failed as data isn't a dictionary.` + ); + } + return { + symmetricEncryption: data.symmetric_encryption ? data.symmetric_encryption : void 0 + }; +}; +const unmarshalKey = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Key' failed as data isn't a dictionary.` + ); + } + return { + createdAt: marshalling.unmarshalDate(data.created_at), + description: data.description, + id: data.id, + locked: data.locked, + name: data.name, + origin: data.origin, + projectId: data.project_id, + protected: data.protected, + region: data.region, + rotatedAt: marshalling.unmarshalDate(data.rotated_at), + rotationCount: data.rotation_count, + rotationPolicy: data.rotation_policy ? unmarshalKeyRotationPolicy(data.rotation_policy) : void 0, + state: data.state, + tags: data.tags, + updatedAt: marshalling.unmarshalDate(data.updated_at), + usage: data.usage ? unmarshalKeyUsage(data.usage) : void 0 + }; +}; +const unmarshalDataKey = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DataKey' failed as data isn't a dictionary.` + ); + } + return { + algorithm: data.algorithm, + ciphertext: data.ciphertext, + createdAt: marshalling.unmarshalDate(data.created_at), + keyId: data.key_id, + plaintext: data.plaintext + }; +}; +const unmarshalDecryptResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DecryptResponse' failed as data isn't a dictionary.` + ); + } + return { + ciphertext: data.ciphertext, + keyId: data.key_id, + plaintext: data.plaintext + }; +}; +const unmarshalEncryptResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'EncryptResponse' failed as data isn't a dictionary.` + ); + } + return { + ciphertext: data.ciphertext, + keyId: data.key_id + }; +}; +const unmarshalListKeysResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListKeysResponse' failed as data isn't a dictionary.` + ); + } + return { + keys: marshalling.unmarshalArrayOfObject(data.keys, unmarshalKey), + totalCount: data.total_count + }; +}; +const marshalKeyRotationPolicy = (request, defaults) => ({ + next_rotation_at: request.nextRotationAt, + rotation_period: request.rotationPeriod }); -const marshalSetSnapshotRequest = (request, defaults) => ({ - base_volume: request.baseVolume ? marshalSnapshotBaseVolume(request.baseVolume) : undefined, - creation_date: request.creationDate, - id: request.id, - modification_date: request.modificationDate, - name: request.name, - organization: request.organization, - project: request.project, - size: request.size, - state: request.state, - tags: request.tags, - volume_type: request.volumeType +const marshalKeyUsage = (request, defaults) => ({ + ...marshalling.resolveOneOf([ + { param: "symmetric_encryption", value: request.symmetricEncryption } + ]) }); -const marshalUpdateIpRequest$1 = (request, defaults) => ({ - reverse: request.reverse, - server: request.server, +const marshalCreateKeyRequest = (request, defaults) => ({ + description: request.description, + name: request.name, + origin: request.origin, + project_id: request.projectId ?? defaults.defaultProjectId, + rotation_policy: request.rotationPolicy !== void 0 ? marshalKeyRotationPolicy(request.rotationPolicy) : void 0, tags: request.tags, - type: request.type ?? 'unknown_iptype' + unprotected: request.unprotected, + usage: request.usage !== void 0 ? marshalKeyUsage(request.usage) : void 0 }); -const marshalUpdatePlacementGroupRequest = (request, defaults) => ({ - name: request.name, - policy_mode: request.policyMode, - policy_type: request.policyType, - tags: request.tags +const marshalDecryptRequest = (request, defaults) => ({ + associated_data: request.associatedData, + ciphertext: request.ciphertext }); -const marshalUpdatePlacementGroupServersRequest = (request, defaults) => ({ - servers: request.servers +const marshalEncryptRequest = (request, defaults) => ({ + associated_data: request.associatedData, + plaintext: request.plaintext }); -const marshalUpdatePrivateNICRequest = (request, defaults) => ({ - tags: request.tags +const marshalGenerateDataKeyRequest = (request, defaults) => ({ + algorithm: request.algorithm, + without_plaintext: request.withoutPlaintext }); -const marshalUpdateServerRequest = (request, defaults) => ({ - boot_type: request.bootType, - bootscript: request.bootscript, - commercial_type: request.commercialType, - dynamic_ip_required: request.dynamicIpRequired, - enable_ipv6: request.enableIpv6, - name: request.name, - placement_group: request.placementGroup, - private_nics: request.privateNics, - protected: request.protected, - public_ips: request.publicIps, - routed_ip_enabled: request.routedIpEnabled, - security_group: request.securityGroup ? marshalSecurityGroupTemplate(request.securityGroup) : undefined, - tags: request.tags, - volumes: request.volumes ? Object.entries(request.volumes).reduce((acc, [key, value]) => ({ - ...acc, - [key]: marshalVolumeServerTemplate(value) - }), {}) : undefined +const marshalImportKeyMaterialRequest = (request, defaults) => ({ + key_material: request.keyMaterial, + salt: request.salt }); -const marshalUpdateVolumeRequest$1 = (request, defaults) => ({ +const marshalUpdateKeyRequest = (request, defaults) => ({ + description: request.description, name: request.name, - size: request.size, + rotation_policy: request.rotationPolicy !== void 0 ? marshalKeyRotationPolicy(request.rotationPolicy) : void 0, tags: request.tags }); +exports.marshalCreateKeyRequest = marshalCreateKeyRequest; +exports.marshalDecryptRequest = marshalDecryptRequest; +exports.marshalEncryptRequest = marshalEncryptRequest; +exports.marshalGenerateDataKeyRequest = marshalGenerateDataKeyRequest; +exports.marshalImportKeyMaterialRequest = marshalImportKeyMaterialRequest; +exports.marshalUpdateKeyRequest = marshalUpdateKeyRequest; +exports.unmarshalDataKey = unmarshalDataKey; +exports.unmarshalDecryptResponse = unmarshalDecryptResponse; +exports.unmarshalEncryptResponse = unmarshalEncryptResponse; +exports.unmarshalKey = unmarshalKey; +exports.unmarshalListKeysResponse = unmarshalListKeysResponse; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const jsonContentHeaders$g = { - 'Content-Type': 'application/json; charset=utf-8' -}; -/** Instance API. */ -let API$h = class API extends API$u { - /** Lists the available zones of the API. */ - static LOCALITIES = ['fr-par-1', 'fr-par-2', 'fr-par-3', 'nl-ams-1', 'nl-ams-2', 'nl-ams-3', 'pl-waw-1', 'pl-waw-2', 'pl-waw-3']; +/***/ }), + +/***/ 4542: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const index = __nccwpck_require__(6916); +exports.v1 = index; + +/***/ }), + +/***/ 3488: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const intervalRetrier = __nccwpck_require__(9052); +const api = __nccwpck_require__(3042); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const resourcePaginator = __nccwpck_require__(4983); +const content_gen = __nccwpck_require__(2259); +const marshalling_gen = __nccwpck_require__(6234); +const jsonContentHeaders = { + "Content-Type": "application/json; charset=utf-8" +}; +class ZonedAPI extends api.API { + /** Lists the available zones of the API. */ + static LOCALITIES = [ + "fr-par-1", + "fr-par-2", + "nl-ams-1", + "nl-ams-2", + "nl-ams-3", + "pl-waw-1", + "pl-waw-2", + "pl-waw-3" + ]; + pageOfListLbs = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/lbs`, + urlParams: marshalling.urlParams( + ["name", request.name], + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId], + ["tags", request.tags] + ) + }, + marshalling_gen.unmarshalListLbsResponse + ); + /** + * List Load Balancers. List all Load Balancers in the specified zone, for a + * Scaleway Organization or Scaleway Project. By default, the Load Balancers + * returned in the list are ordered by creation date in ascending order, + * though this can be modified via the `order_by` field. + * + * @param request - The request {@link ZonedApiListLbsRequest} + * @returns A Promise of ListLbsResponse + */ + listLbs = (request = {}) => resourcePaginator.enrichForPagination("lbs", this.pageOfListLbs, request); + /** + * Create a Load Balancer. Create a new Load Balancer. Note that the Load + * Balancer will be created without frontends or backends; these must be + * created separately via the dedicated endpoints. + * + * @param request - The request {@link ZonedApiCreateLbRequest} + * @returns A Promise of Lb + */ + createLb = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalZonedApiCreateLbRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/lbs` + }, + marshalling_gen.unmarshalLb + ); + /** + * Get a Load Balancer. Retrieve information about an existing Load Balancer, + * specified by its Load Balancer ID. Its full details, including name, status + * and IP address, are returned in the response object. + * + * @param request - The request {@link ZonedApiGetLbRequest} + * @returns A Promise of Lb + */ + getLb = (request) => this.client.fetch( + { + method: "GET", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/lbs/${marshalling.validatePathParam("lbId", request.lbId)}` + }, + marshalling_gen.unmarshalLb + ); + /** + * Waits for {@link Lb} to be in a final state. + * + * @param request - The request {@link ZonedApiGetLbRequest} + * @param options - The waiting options + * @returns A Promise of Lb + */ + waitForLb = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve(!content_gen.LB_TRANSIENT_STATUSES.includes(res.status))), + this.getLb, + request, + options + ); + /** + * Update a Load Balancer. Update the parameters of an existing Load Balancer, + * specified by its Load Balancer ID. Note that the request type is PUT and + * not PATCH. You must set all parameters. + * + * @param request - The request {@link ZonedApiUpdateLbRequest} + * @returns A Promise of Lb + */ + updateLb = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalZonedApiUpdateLbRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PUT", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/lbs/${marshalling.validatePathParam("lbId", request.lbId)}` + }, + marshalling_gen.unmarshalLb + ); + /** + * Delete a Load Balancer. Delete an existing Load Balancer, specified by its + * Load Balancer ID. Deleting a Load Balancer is permanent, and cannot be + * undone. The Load Balancer's flexible IP address can either be deleted with + * the Load Balancer, or kept in your account for future use. + * + * @param request - The request {@link ZonedApiDeleteLbRequest} + */ + deleteLb = (request) => this.client.fetch({ + method: "DELETE", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/lbs/${marshalling.validatePathParam("lbId", request.lbId)}`, + urlParams: marshalling.urlParams(["release_ip", request.releaseIp]) + }); + /** + * Migrate a Load Balancer. Migrate an existing Load Balancer from one + * commercial type to another. Allows you to scale your Load Balancer up or + * down in terms of bandwidth or multi-cloud provision. + * + * @param request - The request {@link ZonedApiMigrateLbRequest} + * @returns A Promise of Lb + */ + migrateLb = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalZonedApiMigrateLbRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/lbs/${marshalling.validatePathParam("lbId", request.lbId)}/migrate` + }, + marshalling_gen.unmarshalLb + ); + pageOfListIPs = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips`, + urlParams: marshalling.urlParams( + ["ip_address", request.ipAddress], + ["ip_type", request.ipType], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId], + ["tags", request.tags] + ) + }, + marshalling_gen.unmarshalListIpsResponse + ); + /** + * List IP addresses. List the Load Balancer flexible IP addresses held in the + * account (filtered by Organization ID or Project ID). It is also possible to + * search for a specific IP address. + * + * @param request - The request {@link ZonedApiListIPsRequest} + * @returns A Promise of ListIpsResponse + */ + listIPs = (request = {}) => resourcePaginator.enrichForPagination("ips", this.pageOfListIPs, request); + /** + * Create an IP address. Create a new Load Balancer flexible IP address, in + * the specified Scaleway Project. This can be attached to new Load Balancers + * created in the future. + * + * @param request - The request {@link ZonedApiCreateIpRequest} + * @returns A Promise of Ip + */ + createIp = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalZonedApiCreateIpRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips` + }, + marshalling_gen.unmarshalIp + ); + /** + * Get an IP address. Retrieve the full details of a Load Balancer flexible IP + * address. + * + * @param request - The request {@link ZonedApiGetIpRequest} + * @returns A Promise of Ip + */ + getIp = (request) => this.client.fetch( + { + method: "GET", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips/${marshalling.validatePathParam("ipId", request.ipId)}` + }, + marshalling_gen.unmarshalIp + ); + /** + * Delete an IP address. Delete a Load Balancer flexible IP address. This + * action is irreversible, and cannot be undone. + * + * @param request - The request {@link ZonedApiReleaseIpRequest} + */ + releaseIp = (request) => this.client.fetch({ + method: "DELETE", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips/${marshalling.validatePathParam("ipId", request.ipId)}` + }); + /** + * Update an IP address. Update the reverse DNS of a Load Balancer flexible IP + * address. + * + * @param request - The request {@link ZonedApiUpdateIpRequest} + * @returns A Promise of Ip + */ + updateIp = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalZonedApiUpdateIpRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips/${marshalling.validatePathParam("ipId", request.ipId)}` + }, + marshalling_gen.unmarshalIp + ); + pageOfListBackends = (request) => this.client.fetch( + { + method: "GET", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/lbs/${marshalling.validatePathParam("lbId", request.lbId)}/backends`, + urlParams: marshalling.urlParams( + ["name", request.name], + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListBackendsResponse + ); + /** + * List the backends of a given Load Balancer. List all the backends of a Load + * Balancer, specified by its Load Balancer ID. By default, results are + * returned in ascending order by the creation date of each backend. The + * response is an array of backend objects, containing full details of each + * one including their configuration parameters such as protocol, port and + * forwarding algorithm. + * + * @param request - The request {@link ZonedApiListBackendsRequest} + * @returns A Promise of ListBackendsResponse + */ + listBackends = (request) => resourcePaginator.enrichForPagination("backends", this.pageOfListBackends, request); + /** + * Create a backend for a given Load Balancer. Create a new backend for a + * given Load Balancer, specifying its full configuration including protocol, + * port and forwarding algorithm. + * + * @param request - The request {@link ZonedApiCreateBackendRequest} + * @returns A Promise of Backend + */ + createBackend = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalZonedApiCreateBackendRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/lbs/${marshalling.validatePathParam("lbId", request.lbId)}/backends` + }, + marshalling_gen.unmarshalBackend + ); + /** + * Get a backend of a given Load Balancer. Get the full details of a given + * backend, specified by its backend ID. The response contains the backend's + * full configuration parameters including protocol, port and forwarding + * algorithm. + * + * @param request - The request {@link ZonedApiGetBackendRequest} + * @returns A Promise of Backend + */ + getBackend = (request) => this.client.fetch( + { + method: "GET", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/backends/${marshalling.validatePathParam("backendId", request.backendId)}` + }, + marshalling_gen.unmarshalBackend + ); + /** + * Update a backend of a given Load Balancer. Update a backend of a given Load + * Balancer, specified by its backend ID. Note that the request type is PUT + * and not PATCH. You must set all parameters. + * + * @param request - The request {@link ZonedApiUpdateBackendRequest} + * @returns A Promise of Backend + */ + updateBackend = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalZonedApiUpdateBackendRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PUT", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/backends/${marshalling.validatePathParam("backendId", request.backendId)}` + }, + marshalling_gen.unmarshalBackend + ); + /** + * Delete a backend of a given Load Balancer. Delete a backend of a given Load + * Balancer, specified by its backend ID. This action is irreversible and + * cannot be undone. + * + * @param request - The request {@link ZonedApiDeleteBackendRequest} + */ + deleteBackend = (request) => this.client.fetch({ + method: "DELETE", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/backends/${marshalling.validatePathParam("backendId", request.backendId)}` + }); + /** + * Add a set of backend servers to a given backend. For a given backend + * specified by its backend ID, add a set of backend servers (identified by + * their IP addresses) it should forward traffic to. These will be appended to + * any existing set of backend servers for this backend. + * + * @param request - The request {@link ZonedApiAddBackendServersRequest} + * @returns A Promise of Backend + */ + addBackendServers = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalZonedApiAddBackendServersRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/backends/${marshalling.validatePathParam("backendId", request.backendId)}/servers` + }, + marshalling_gen.unmarshalBackend + ); + /** + * Remove a set of servers for a given backend. For a given backend specified + * by its backend ID, remove the specified backend servers (identified by + * their IP addresses) so that it no longer forwards traffic to them. + * + * @param request - The request {@link ZonedApiRemoveBackendServersRequest} + * @returns A Promise of Backend + */ + removeBackendServers = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalZonedApiRemoveBackendServersRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "DELETE", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/backends/${marshalling.validatePathParam("backendId", request.backendId)}/servers` + }, + marshalling_gen.unmarshalBackend + ); + /** + * Define all backend servers for a given backend. For a given backend + * specified by its backend ID, define the set of backend servers (identified + * by their IP addresses) that it should forward traffic to. Any existing + * backend servers configured for this backend will be removed. + * + * @param request - The request {@link ZonedApiSetBackendServersRequest} + * @returns A Promise of Backend + */ + setBackendServers = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalZonedApiSetBackendServersRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "PUT", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/backends/${marshalling.validatePathParam("backendId", request.backendId)}/servers` + }, + marshalling_gen.unmarshalBackend + ); + /** + * Update a health check for a given backend. Update the configuration of the + * health check performed by a given backend to verify the health of its + * backend servers, identified by its backend ID. Note that the request type + * is PUT and not PATCH. You must set all parameters. + * + * @param request - The request {@link ZonedApiUpdateHealthCheckRequest} + * @returns A Promise of HealthCheck + */ + updateHealthCheck = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalZonedApiUpdateHealthCheckRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "PUT", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/backends/${marshalling.validatePathParam("backendId", request.backendId)}/healthcheck` + }, + marshalling_gen.unmarshalHealthCheck + ); + pageOfListFrontends = (request) => this.client.fetch( + { + method: "GET", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/lbs/${marshalling.validatePathParam("lbId", request.lbId)}/frontends`, + urlParams: marshalling.urlParams( + ["name", request.name], + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListFrontendsResponse + ); + /** + * List frontends of a given Load Balancer. List all the frontends of a Load + * Balancer, specified by its Load Balancer ID. By default, results are + * returned in ascending order by the creation date of each frontend. The + * response is an array of frontend objects, containing full details of each + * one including the port they listen on and the backend they are attached + * to. + * + * @param request - The request {@link ZonedApiListFrontendsRequest} + * @returns A Promise of ListFrontendsResponse + */ + listFrontends = (request) => resourcePaginator.enrichForPagination("frontends", this.pageOfListFrontends, request); + /** + * Create a frontend in a given Load Balancer. Create a new frontend for a + * given Load Balancer, specifying its configuration including the port it + * should listen on and the backend to attach it to. + * + * @param request - The request {@link ZonedApiCreateFrontendRequest} + * @returns A Promise of Frontend + */ + createFrontend = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalZonedApiCreateFrontendRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/lbs/${marshalling.validatePathParam("lbId", request.lbId)}/frontends` + }, + marshalling_gen.unmarshalFrontend + ); + /** + * Get a frontend. Get the full details of a given frontend, specified by its + * frontend ID. The response contains the frontend's full configuration + * parameters including the backend it is attached to, the port it listens on, + * and any certificates it has. + * + * @param request - The request {@link ZonedApiGetFrontendRequest} + * @returns A Promise of Frontend + */ + getFrontend = (request) => this.client.fetch( + { + method: "GET", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/frontends/${marshalling.validatePathParam("frontendId", request.frontendId)}` + }, + marshalling_gen.unmarshalFrontend + ); + /** + * Update a frontend. Update a given frontend, specified by its frontend ID. + * You can update configuration parameters including its name and the port it + * listens on. Note that the request type is PUT and not PATCH. You must set + * all parameters. + * + * @param request - The request {@link ZonedApiUpdateFrontendRequest} + * @returns A Promise of Frontend + */ + updateFrontend = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalZonedApiUpdateFrontendRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PUT", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/frontends/${marshalling.validatePathParam("frontendId", request.frontendId)}` + }, + marshalling_gen.unmarshalFrontend + ); + /** + * Delete a frontend. Delete a given frontend, specified by its frontend ID. + * This action is irreversible and cannot be undone. + * + * @param request - The request {@link ZonedApiDeleteFrontendRequest} + */ + deleteFrontend = (request) => this.client.fetch({ + method: "DELETE", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/frontends/${marshalling.validatePathParam("frontendId", request.frontendId)}` + }); + pageOfListRoutes = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/routes`, + urlParams: marshalling.urlParams( + ["frontend_id", request.frontendId], + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListRoutesResponse + ); + /** + * List all routes. List all routes for a given frontend. The response is an + * array of routes, each one with a specified backend to direct to if a + * certain condition is matched (based on the value of the SNI field or HTTP + * Host header). + * + * @param request - The request {@link ZonedApiListRoutesRequest} + * @returns A Promise of ListRoutesResponse + */ + listRoutes = (request = {}) => resourcePaginator.enrichForPagination("routes", this.pageOfListRoutes, request); + /** + * Create a route. Create a new route on a given frontend. To configure a + * route, specify the backend to direct to if a certain condition is matched + * (based on the value of the SNI field or HTTP Host header). + * + * @param request - The request {@link ZonedApiCreateRouteRequest} + * @returns A Promise of Route + */ + createRoute = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalZonedApiCreateRouteRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/routes` + }, + marshalling_gen.unmarshalRoute + ); + /** + * Get a route. Retrieve information about an existing route, specified by its + * route ID. Its full details, origin frontend, target backend and match + * condition, are returned in the response object. + * + * @param request - The request {@link ZonedApiGetRouteRequest} + * @returns A Promise of Route + */ + getRoute = (request) => this.client.fetch( + { + method: "GET", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/routes/${marshalling.validatePathParam("routeId", request.routeId)}` + }, + marshalling_gen.unmarshalRoute + ); + /** + * Update a route. Update the configuration of an existing route, specified by + * its route ID. + * + * @param request - The request {@link ZonedApiUpdateRouteRequest} + * @returns A Promise of Route + */ + updateRoute = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalZonedApiUpdateRouteRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PUT", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/routes/${marshalling.validatePathParam("routeId", request.routeId)}` + }, + marshalling_gen.unmarshalRoute + ); + /** + * Delete a route. Delete an existing route, specified by its route ID. + * Deleting a route is permanent, and cannot be undone. + * + * @param request - The request {@link ZonedApiDeleteRouteRequest} + */ + deleteRoute = (request) => this.client.fetch({ + method: "DELETE", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/routes/${marshalling.validatePathParam("routeId", request.routeId)}` + }); + /** + * Get usage statistics of a given Load Balancer. + * + * @deprecated + * @param request - The request {@link ZonedApiGetLbStatsRequest} + * @returns A Promise of LbStats + */ + getLbStats = (request) => this.client.fetch( + { + method: "GET", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/lbs/${marshalling.validatePathParam("lbId", request.lbId)}/stats`, + urlParams: marshalling.urlParams(["backend_id", request.backendId]) + }, + marshalling_gen.unmarshalLbStats + ); + pageOfListBackendStats = (request) => this.client.fetch( + { + method: "GET", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/lbs/${marshalling.validatePathParam("lbId", request.lbId)}/backend-stats`, + urlParams: marshalling.urlParams( + ["backend_id", request.backendId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListBackendStatsResponse + ); + /** + * List backend server statistics. List information about your backend + * servers, including their state and the result of their last health check. + * + * @param request - The request {@link ZonedApiListBackendStatsRequest} + * @returns A Promise of ListBackendStatsResponse + */ + listBackendStats = (request) => resourcePaginator.enrichForPagination( + "backendServersStats", + this.pageOfListBackendStats, + request + ); + pageOfListAcls = (request) => this.client.fetch( + { + method: "GET", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/frontends/${marshalling.validatePathParam("frontendId", request.frontendId)}/acls`, + urlParams: marshalling.urlParams( + ["name", request.name], + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListAclResponse + ); + /** + * List ACLs for a given frontend. List the ACLs for a given frontend, + * specified by its frontend ID. The response is an array of ACL objects, each + * one representing an ACL that denies or allows traffic based on certain + * conditions. + * + * @param request - The request {@link ZonedApiListAclsRequest} + * @returns A Promise of ListAclResponse + */ + listAcls = (request) => resourcePaginator.enrichForPagination("acls", this.pageOfListAcls, request); + /** + * Create an ACL for a given frontend. Create a new ACL for a given frontend. + * Each ACL must have a name, an action to perform (allow or deny), and a + * match rule (the action is carried out when the incoming traffic matches the + * rule). + * + * @param request - The request {@link ZonedApiCreateAclRequest} + * @returns A Promise of Acl + */ + createAcl = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalZonedApiCreateAclRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/frontends/${marshalling.validatePathParam("frontendId", request.frontendId)}/acls` + }, + marshalling_gen.unmarshalAcl + ); + /** + * Get an ACL. Get information for a particular ACL, specified by its ACL ID. + * The response returns full details of the ACL, including its name, action, + * match rule and frontend. + * + * @param request - The request {@link ZonedApiGetAclRequest} + * @returns A Promise of Acl + */ + getAcl = (request) => this.client.fetch( + { + method: "GET", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/acls/${marshalling.validatePathParam("aclId", request.aclId)}` + }, + marshalling_gen.unmarshalAcl + ); + /** + * Update an ACL. Update a particular ACL, specified by its ACL ID. You can + * update details including its name, action and match rule. + * + * @param request - The request {@link ZonedApiUpdateAclRequest} + * @returns A Promise of Acl + */ + updateAcl = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalZonedApiUpdateAclRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PUT", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/acls/${marshalling.validatePathParam("aclId", request.aclId)}` + }, + marshalling_gen.unmarshalAcl + ); + /** + * Delete an ACL. Delete an ACL, specified by its ACL ID. Deleting an ACL is + * irreversible and cannot be undone. + * + * @param request - The request {@link ZonedApiDeleteAclRequest} + */ + deleteAcl = (request) => this.client.fetch({ + method: "DELETE", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/acls/${marshalling.validatePathParam("aclId", request.aclId)}` + }); + /** + * Define all ACLs for a given frontend. For a given frontend specified by its + * frontend ID, define and add the complete set of ACLS for that frontend. Any + * existing ACLs on this frontend will be removed. + * + * @param request - The request {@link ZonedApiSetAclsRequest} + * @returns A Promise of SetAclsResponse + */ + setAcls = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalZonedApiSetAclsRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PUT", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/frontends/${marshalling.validatePathParam("frontendId", request.frontendId)}/acls` + }, + marshalling_gen.unmarshalSetAclsResponse + ); + /** + * Create an SSL/TLS certificate. Generate a new SSL/TLS certificate for a + * given Load Balancer. You can choose to create a Let's Encrypt certificate, + * or import a custom certificate. + * + * @param request - The request {@link ZonedApiCreateCertificateRequest} + * @returns A Promise of Certificate + */ + createCertificate = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalZonedApiCreateCertificateRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/lbs/${marshalling.validatePathParam("lbId", request.lbId)}/certificates` + }, + marshalling_gen.unmarshalCertificate + ); + pageOfListCertificates = (request) => this.client.fetch( + { + method: "GET", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/lbs/${marshalling.validatePathParam("lbId", request.lbId)}/certificates`, + urlParams: marshalling.urlParams( + ["name", request.name], + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListCertificatesResponse + ); + /** + * List all SSL/TLS certificates on a given Load Balancer. List all the + * SSL/TLS certificates on a given Load Balancer. The response is an array of + * certificate objects, which are by default listed in ascending order of + * creation date. + * + * @param request - The request {@link ZonedApiListCertificatesRequest} + * @returns A Promise of ListCertificatesResponse + */ + listCertificates = (request) => resourcePaginator.enrichForPagination("certificates", this.pageOfListCertificates, request); + /** + * Get an SSL/TLS certificate. Get information for a particular SSL/TLS + * certificate, specified by its certificate ID. The response returns full + * details of the certificate, including its type, main domain name, and + * alternative domain names. + * + * @param request - The request {@link ZonedApiGetCertificateRequest} + * @returns A Promise of Certificate + */ + getCertificate = (request) => this.client.fetch( + { + method: "GET", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/certificates/${marshalling.validatePathParam("certificateId", request.certificateId)}` + }, + marshalling_gen.unmarshalCertificate + ); + /** + * Waits for {@link Certificate} to be in a final state. + * + * @param request - The request {@link ZonedApiGetCertificateRequest} + * @param options - The waiting options + * @returns A Promise of Certificate + */ + waitForCertificate = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve( + !content_gen.CERTIFICATE_TRANSIENT_STATUSES.includes(res.status) + )), + this.getCertificate, + request, + options + ); + /** + * Update an SSL/TLS certificate. Update the name of a particular SSL/TLS + * certificate, specified by its certificate ID. + * + * @param request - The request {@link ZonedApiUpdateCertificateRequest} + * @returns A Promise of Certificate + */ + updateCertificate = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalZonedApiUpdateCertificateRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "PUT", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/certificates/${marshalling.validatePathParam("certificateId", request.certificateId)}` + }, + marshalling_gen.unmarshalCertificate + ); + /** + * Delete an SSL/TLS certificate. Delete an SSL/TLS certificate, specified by + * its certificate ID. Deleting a certificate is irreversible and cannot be + * undone. + * + * @param request - The request {@link ZonedApiDeleteCertificateRequest} + */ + deleteCertificate = (request) => this.client.fetch({ + method: "DELETE", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/certificates/${marshalling.validatePathParam("certificateId", request.certificateId)}` + }); + pageOfListLbTypes = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/lb-types`, + urlParams: marshalling.urlParams( + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListLbTypesResponse + ); + /** + * List all Load Balancer offer types. List all the different commercial Load + * Balancer types. The response includes an array of offer types, each with a + * name, description, and information about its stock availability. + * + * @param request - The request {@link ZonedApiListLbTypesRequest} + * @returns A Promise of ListLbTypesResponse + */ + listLbTypes = (request = {}) => resourcePaginator.enrichForPagination("lbTypes", this.pageOfListLbTypes, request); + /** + * Create a subscriber. Create a new subscriber, either with an email + * configuration or a webhook configuration, for a specified Scaleway + * Project. + * + * @param request - The request {@link ZonedApiCreateSubscriberRequest} + * @returns A Promise of Subscriber + */ + createSubscriber = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalZonedApiCreateSubscriberRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/subscribers` + }, + marshalling_gen.unmarshalSubscriber + ); + /** + * Get a subscriber. Retrieve information about an existing subscriber, + * specified by its subscriber ID. Its full details, including name and + * email/webhook configuration, are returned in the response object. + * + * @param request - The request {@link ZonedApiGetSubscriberRequest} + * @returns A Promise of Subscriber + */ + getSubscriber = (request) => this.client.fetch( + { + method: "GET", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/subscribers/${marshalling.validatePathParam("subscriberId", request.subscriberId)}` + }, + marshalling_gen.unmarshalSubscriber + ); + pageOfListSubscriber = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/subscribers`, + urlParams: marshalling.urlParams( + ["name", request.name], + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId] + ) + }, + marshalling_gen.unmarshalListSubscriberResponse + ); + /** + * List all subscribers. List all subscribers to Load Balancer alerts. By + * default, returns all subscribers to Load Balancer alerts for the + * Organization associated with the authentication token used for the + * request. + * + * @param request - The request {@link ZonedApiListSubscriberRequest} + * @returns A Promise of ListSubscriberResponse + */ + listSubscriber = (request = {}) => resourcePaginator.enrichForPagination("subscribers", this.pageOfListSubscriber, request); + /** + * Update a subscriber. Update the parameters of a given subscriber (e.g. + * name, webhook configuration, email configuration), specified by its + * subscriber ID. + * + * @param request - The request {@link ZonedApiUpdateSubscriberRequest} + * @returns A Promise of Subscriber + */ + updateSubscriber = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalZonedApiUpdateSubscriberRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PUT", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/subscribers/${marshalling.validatePathParam("subscriberId", request.subscriberId)}` + }, + marshalling_gen.unmarshalSubscriber + ); /** - * Get availability. Get availability for all Instance types. + * Delete a subscriber. Delete an existing subscriber, specified by its + * subscriber ID. Deleting a subscriber is permanent, and cannot be undone. * - * @param request - The request {@link GetServerTypesAvailabilityRequest} - * @returns A Promise of GetServerTypesAvailabilityResponse + * @param request - The request {@link ZonedApiDeleteSubscriberRequest} */ - getServerTypesAvailability = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/products/servers/availability`, - urlParams: urlParams(['page', request.page], ['per_page', request.perPage ?? this.client.settings.defaultPageSize]) - }, unmarshalGetServerTypesAvailabilityResponse); - + deleteSubscriber = (request) => this.client.fetch({ + method: "DELETE", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/lb/subscription/${marshalling.validatePathParam("subscriberId", request.subscriberId)}` + }); /** - * List Instance types. List available Instance types and their technical - * details. + * Subscribe a subscriber to alerts for a given Load Balancer. Subscribe an + * existing subscriber to alerts for a given Load Balancer. * - * @param request - The request {@link ListServersTypesRequest} - * @returns A Promise of ListServersTypesResponse + * @param request - The request {@link ZonedApiSubscribeToLbRequest} + * @returns A Promise of Lb */ - listServersTypes = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/products/servers`, - urlParams: urlParams(['page', request.page], ['per_page', request.perPage ?? this.client.settings.defaultPageSize]) - }, unmarshalListServersTypesResponse); - + subscribeToLb = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalZonedApiSubscribeToLbRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/lb/${marshalling.validatePathParam("lbId", request.lbId)}/subscribe` + }, + marshalling_gen.unmarshalLb + ); /** - * List volume types. List all volume types and their technical details. + * Unsubscribe a subscriber from alerts for a given Load Balancer. Unsubscribe + * a subscriber from alerts for a given Load Balancer. The subscriber is not + * deleted, and can be resubscribed in the future if necessary. * - * @param request - The request {@link ListVolumesTypesRequest} - * @returns A Promise of ListVolumesTypesResponse + * @param request - The request {@link ZonedApiUnsubscribeFromLbRequest} + * @returns A Promise of Lb */ - listVolumesTypes = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/products/volumes`, - urlParams: urlParams(['page', request.page], ['per_page', request.perPage ?? this.client.settings.defaultPageSize]) - }, unmarshalListVolumesTypesResponse); - pageOfListServers = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers`, - urlParams: urlParams(['commercial_type', request.commercialType], ['name', request.name], ['order', request.order], ['organization', request.organization], ['page', request.page], ['per_page', request.perPage ?? this.client.settings.defaultPageSize], ['private_ip', request.privateIp], ['private_network', request.privateNetwork], ['private_networks', request.privateNetworks && request.privateNetworks.length > 0 ? request.privateNetworks.join(',') : undefined], ['private_nic_mac_address', request.privateNicMacAddress], ['project', request.project], ['servers', request.servers && request.servers.length > 0 ? request.servers.join(',') : undefined], ['state', request.state], ['tags', request.tags && request.tags.length > 0 ? request.tags.join(',') : undefined], ['without_ip', request.withoutIp]) - }, unmarshalListServersResponse); - + unsubscribeFromLb = (request) => this.client.fetch( + { + method: "DELETE", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/lb/${marshalling.validatePathParam("lbId", request.lbId)}/unsubscribe` + }, + marshalling_gen.unmarshalLb + ); + pageOfListLbPrivateNetworks = (request) => this.client.fetch( + { + method: "GET", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/lbs/${marshalling.validatePathParam("lbId", request.lbId)}/private-networks`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListLbPrivateNetworksResponse + ); /** - * List all Instances. List all Instances in a specified Availability Zone, - * e.g. `fr-par-1`. + * List Private Networks attached to a Load Balancer. List the Private + * Networks attached to a given Load Balancer, specified by its Load Balancer + * ID. The response is an array of Private Network objects, giving information + * including the status, configuration, name and creation date of each Private + * Network. * - * @param request - The request {@link ListServersRequest} - * @returns A Promise of ListServersResponse + * @param request - The request {@link ZonedApiListLbPrivateNetworksRequest} + * @returns A Promise of ListLbPrivateNetworksResponse */ - listServers = (request = {}) => enrichForPagination('servers', this.pageOfListServers, request); - _createServer = request => this.client.fetch({ - body: JSON.stringify(marshalCreateServerRequest(request, this.client.settings)), - headers: jsonContentHeaders$g, - method: 'POST', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers` - }, unmarshalCreateServerResponse); - + listLbPrivateNetworks = (request) => resourcePaginator.enrichForPagination( + "privateNetwork", + this.pageOfListLbPrivateNetworks, + request + ); /** - * Delete an Instance. Delete the Instance with the specified ID. + * Attach a Load Balancer to a Private Network. Attach a specified Load + * Balancer to a specified Private Network, defining a static or DHCP + * configuration for the Load Balancer on the network. * - * @param request - The request {@link DeleteServerRequest} + * @param request - The request {@link ZonedApiAttachPrivateNetworkRequest} + * @returns A Promise of PrivateNetwork + */ + attachPrivateNetwork = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalZonedApiAttachPrivateNetworkRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/lbs/${marshalling.validatePathParam("lbId", request.lbId)}/private-networks/${marshalling.validatePathParam("privateNetworkId", request.privateNetworkId)}/attach` + }, + marshalling_gen.unmarshalPrivateNetwork + ); + /** + * Detach Load Balancer from Private Network. Detach a specified Load Balancer + * from a specified Private Network. + * + * @param request - The request {@link ZonedApiDetachPrivateNetworkRequest} */ - deleteServer = request => this.client.fetch({ - method: 'DELETE', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}` + detachPrivateNetwork = (request) => this.client.fetch({ + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/lb/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/lbs/${marshalling.validatePathParam("lbId", request.lbId)}/private-networks/${marshalling.validatePathParam("privateNetworkId", request.privateNetworkId)}/detach` }); - +} +class API extends api.API { + /** Lists the available regions of the API. */ + static LOCALITIES = ["fr-par", "nl-ams", "pl-waw"]; + pageOfListLbs = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/lb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/lbs`, + urlParams: marshalling.urlParams( + ["name", request.name], + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId], + ["tags", request.tags] + ) + }, + marshalling_gen.unmarshalListLbsResponse + ); /** - * Get an Instance. Get the details of a specified Instance. + * List load balancers. * - * @param request - The request {@link GetServerRequest} - * @returns A Promise of GetServerResponse + * @param request - The request {@link ListLbsRequest} + * @returns A Promise of ListLbsResponse */ - getServer = request => this.client.fetch({ - method: 'GET', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}` - }, unmarshalGetServerResponse); - _setServer = request => this.client.fetch({ - body: JSON.stringify(marshalSetServerRequest(request, this.client.settings)), - headers: jsonContentHeaders$g, - method: 'PUT', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('id', request.id)}` - }, unmarshalSetServerResponse); - _updateServer = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateServerRequest(request, this.client.settings)), - headers: jsonContentHeaders$g, - method: 'PATCH', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}` - }, unmarshalUpdateServerResponse); - + listLbs = (request = {}) => resourcePaginator.enrichForPagination("lbs", this.pageOfListLbs, request); /** - * List Instance actions. List all actions (e.g. power on, power off, reboot) - * that can currently be performed on an Instance. + * Create a load balancer. * - * @param request - The request {@link ListServerActionsRequest} - * @returns A Promise of ListServerActionsResponse + * @param request - The request {@link CreateLbRequest} + * @returns A Promise of Lb */ - listServerActions = request => this.client.fetch({ - method: 'GET', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/action` - }, unmarshalListServerActionsResponse); - + createLb = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateLbRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/lb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/lbs` + }, + marshalling_gen.unmarshalLb + ); /** - * Perform action. Perform an action on an Instance. Available actions are: - * `poweron`: Start a stopped Instance. `poweroff`: Fully stop the Instance - * and release the hypervisor slot. `stop_in_place`: Stop the Instance, but - * keep the slot on the hypervisor. `reboot`: Stop the instance and restart - * it. `backup`: Create an image with all the volumes of an Instance. - * `terminate`: Delete the Instance along with all attached volumes. - * `enable_routed_ip`: Migrate the Instance to the new network stack. + * Get a load balancer. * - * Keep in mind that terminating an Instance will result in the deletion of - * all attached volumes, including local and block storage. If you want to - * preserve your local volumes, you should use the `archive` action instead of - * `terminate`. Similarly, if you want to keep your block storage volumes, you - * must first detach them before issuing the `terminate` command. For more - * information, read the [Volumes](#path-volumes-list-volumes) documentation. + * @param request - The request {@link GetLbRequest} + * @returns A Promise of Lb + */ + getLb = (request) => this.client.fetch( + { + method: "GET", + path: `/lb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/lbs/${marshalling.validatePathParam("lbId", request.lbId)}` + }, + marshalling_gen.unmarshalLb + ); + /** + * Waits for {@link Lb} to be in a final state. * - * @param request - The request {@link ServerActionRequest} - * @returns A Promise of ServerActionResponse + * @param request - The request {@link GetLbRequest} + * @param options - The waiting options + * @returns A Promise of Lb */ - serverAction = request => this.client.fetch({ - body: JSON.stringify(marshalServerActionRequest(request, this.client.settings)), - headers: jsonContentHeaders$g, - method: 'POST', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/action` - }, unmarshalServerActionResponse); - + waitForLb = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve(!content_gen.LB_TRANSIENT_STATUSES.includes(res.status))), + this.getLb, + request, + options + ); /** - * List user data. List all user data keys registered on a specified Instance. + * Update a load balancer. * - * @param request - The request {@link ListServerUserDataRequest} - * @returns A Promise of ListServerUserDataResponse + * @param request - The request {@link UpdateLbRequest} + * @returns A Promise of Lb */ - listServerUserData = request => this.client.fetch({ - method: 'GET', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/user_data` - }, unmarshalListServerUserDataResponse); - + updateLb = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateLbRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PUT", + path: `/lb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/lbs/${marshalling.validatePathParam("lbId", request.lbId)}` + }, + marshalling_gen.unmarshalLb + ); /** - * Delete user data. Delete the specified key from an Instance's user data. + * Delete a load balancer. * - * @param request - The request {@link DeleteServerUserDataRequest} + * @param request - The request {@link DeleteLbRequest} */ - deleteServerUserData = request => this.client.fetch({ - method: 'DELETE', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/user_data/${validatePathParam('key', request.key)}` + deleteLb = (request) => this.client.fetch({ + method: "DELETE", + path: `/lb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/lbs/${marshalling.validatePathParam("lbId", request.lbId)}`, + urlParams: marshalling.urlParams(["release_ip", request.releaseIp]) }); - pageOfListImages = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/images`, - urlParams: urlParams(['arch', request.arch], ['name', request.name], ['organization', request.organization], ['page', request.page], ['per_page', request.perPage ?? this.client.settings.defaultPageSize], ['project', request.project], ['public', request.public], ['tags', request.tags]) - }, unmarshalListImagesResponse$3); - /** - * List Instance images. List all existing Instance images. + * Migrate a load balancer. * - * @param request - The request {@link ListImagesRequest} - * @returns A Promise of ListImagesResponse + * @param request - The request {@link MigrateLbRequest} + * @returns A Promise of Lb */ - listImages = (request = {}) => enrichForPagination('images', this.pageOfListImages, request); - + migrateLb = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalMigrateLbRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/lb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/lbs/${marshalling.validatePathParam("lbId", request.lbId)}/migrate` + }, + marshalling_gen.unmarshalLb + ); + pageOfListIPs = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/lb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips`, + urlParams: marshalling.urlParams( + ["ip_address", request.ipAddress], + ["ip_type", request.ipType], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId], + ["tags", request.tags] + ) + }, + marshalling_gen.unmarshalListIpsResponse + ); /** - * Get an Instance image. Get details of an image with the specified ID. + * List IPs. * - * @param request - The request {@link GetImageRequest} - * @returns A Promise of GetImageResponse + * @param request - The request {@link ListIPsRequest} + * @returns A Promise of ListIpsResponse */ - getImage = request => this.client.fetch({ - method: 'GET', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/images/${validatePathParam('imageId', request.imageId)}` - }, unmarshalGetImageResponse$1); - + listIPs = (request = {}) => resourcePaginator.enrichForPagination("ips", this.pageOfListIPs, request); /** - * Create an Instance image. Create an Instance image from the specified - * snapshot ID. + * Create an IP. * - * @param request - The request {@link CreateImageRequest} - * @returns A Promise of CreateImageResponse + * @param request - The request {@link CreateIpRequest} + * @returns A Promise of Ip */ - createImage = request => this.client.fetch({ - body: JSON.stringify(marshalCreateImageRequest(request, this.client.settings)), - headers: jsonContentHeaders$g, - method: 'POST', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/images` - }, unmarshalCreateImageResponse); - _setImage = request => this.client.fetch({ - body: JSON.stringify(marshalSetImageRequest(request, this.client.settings)), - headers: jsonContentHeaders$g, - method: 'PUT', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/images/${validatePathParam('id', request.id)}` - }, unmarshalSetImageResponse); - + createIp = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateIpRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/lb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips` + }, + marshalling_gen.unmarshalIp + ); /** - * Delete an Instance image. Delete the image with the specified ID. + * Get an IP. * - * @param request - The request {@link DeleteImageRequest} + * @param request - The request {@link GetIpRequest} + * @returns A Promise of Ip + */ + getIp = (request) => this.client.fetch( + { + method: "GET", + path: `/lb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips/${marshalling.validatePathParam("ipId", request.ipId)}` + }, + marshalling_gen.unmarshalIp + ); + /** + * Delete an IP. + * + * @param request - The request {@link ReleaseIpRequest} */ - deleteImage = request => this.client.fetch({ - method: 'DELETE', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/images/${validatePathParam('imageId', request.imageId)}` + releaseIp = (request) => this.client.fetch({ + method: "DELETE", + path: `/lb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips/${marshalling.validatePathParam("ipId", request.ipId)}` }); - pageOfListSnapshots = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/snapshots`, - urlParams: urlParams(['base_volume_id', request.baseVolumeId], ['name', request.name], ['organization', request.organization], ['page', request.page], ['per_page', request.perPage ?? this.client.settings.defaultPageSize], ['project', request.project], ['tags', request.tags]) - }, unmarshalListSnapshotsResponse$1); - /** - * List snapshots. List all snapshots of an Organization in a specified - * Availability Zone. + * Update an IP. * - * @param request - The request {@link ListSnapshotsRequest} - * @returns A Promise of ListSnapshotsResponse + * @param request - The request {@link UpdateIpRequest} + * @returns A Promise of Ip */ - listSnapshots = (request = {}) => enrichForPagination('snapshots', this.pageOfListSnapshots, request); - + updateIp = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateIpRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/lb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/ips/${marshalling.validatePathParam("ipId", request.ipId)}` + }, + marshalling_gen.unmarshalIp + ); + pageOfListBackends = (request) => this.client.fetch( + { + method: "GET", + path: `/lb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/lbs/${marshalling.validatePathParam("lbId", request.lbId)}/backends`, + urlParams: marshalling.urlParams( + ["name", request.name], + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListBackendsResponse + ); /** - * Create a snapshot from a specified volume or from a QCOW2 file. Create a - * snapshot from a specified volume or from a QCOW2 file in a specified - * Availability Zone. + * List backends in a given load balancer. * - * @param request - The request {@link CreateSnapshotRequest} - * @returns A Promise of CreateSnapshotResponse + * @param request - The request {@link ListBackendsRequest} + * @returns A Promise of ListBackendsResponse */ - createSnapshot = (request = {}) => this.client.fetch({ - body: JSON.stringify(marshalCreateSnapshotRequest$1(request, this.client.settings)), - headers: jsonContentHeaders$g, - method: 'POST', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/snapshots` - }, unmarshalCreateSnapshotResponse); - + listBackends = (request) => resourcePaginator.enrichForPagination("backends", this.pageOfListBackends, request); /** - * Get a snapshot. Get details of a snapshot with the specified ID. + * Create a backend in a given load balancer. * - * @param request - The request {@link GetSnapshotRequest} - * @returns A Promise of GetSnapshotResponse + * @param request - The request {@link CreateBackendRequest} + * @returns A Promise of Backend */ - getSnapshot = request => this.client.fetch({ - method: 'GET', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam('snapshotId', request.snapshotId)}` - }, unmarshalGetSnapshotResponse); - _setSnapshot = request => this.client.fetch({ - body: JSON.stringify(marshalSetSnapshotRequest(request, this.client.settings)), - headers: jsonContentHeaders$g, - method: 'PUT', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam('snapshotId', request.snapshotId)}` - }, unmarshalSetSnapshotResponse); - + createBackend = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateBackendRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/lb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/lbs/${marshalling.validatePathParam("lbId", request.lbId)}/backends` + }, + marshalling_gen.unmarshalBackend + ); /** - * Delete a snapshot. Delete the snapshot with the specified ID. + * Get a backend in a given load balancer. * - * @param request - The request {@link DeleteSnapshotRequest} + * @param request - The request {@link GetBackendRequest} + * @returns A Promise of Backend + */ + getBackend = (request) => this.client.fetch( + { + method: "GET", + path: `/lb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/backends/${marshalling.validatePathParam("backendId", request.backendId)}` + }, + marshalling_gen.unmarshalBackend + ); + /** + * Update a backend in a given load balancer. + * + * @param request - The request {@link UpdateBackendRequest} + * @returns A Promise of Backend + */ + updateBackend = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateBackendRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PUT", + path: `/lb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/backends/${marshalling.validatePathParam("backendId", request.backendId)}` + }, + marshalling_gen.unmarshalBackend + ); + /** + * Delete a backend in a given load balancer. + * + * @param request - The request {@link DeleteBackendRequest} */ - deleteSnapshot = request => this.client.fetch({ - method: 'DELETE', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam('snapshotId', request.snapshotId)}` + deleteBackend = (request) => this.client.fetch({ + method: "DELETE", + path: `/lb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/backends/${marshalling.validatePathParam("backendId", request.backendId)}` }); - /** - * Export a snapshot. Export a snapshot to a specified S3 bucket in the same - * region. + * Add a set of servers in a given backend. * - * @param request - The request {@link ExportSnapshotRequest} - * @returns A Promise of ExportSnapshotResponse + * @param request - The request {@link AddBackendServersRequest} + * @returns A Promise of Backend */ - exportSnapshot = request => this.client.fetch({ - body: JSON.stringify(marshalExportSnapshotRequest(request, this.client.settings)), - headers: jsonContentHeaders$g, - method: 'POST', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam('snapshotId', request.snapshotId)}/export` - }, unmarshalExportSnapshotResponse); - pageOfListVolumes = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/volumes`, - urlParams: urlParams(['name', request.name], ['organization', request.organization], ['page', request.page], ['per_page', request.perPage ?? this.client.settings.defaultPageSize], ['project', request.project], ['tags', request.tags && request.tags.length > 0 ? request.tags.join(',') : undefined], ['volume_type', request.volumeType]) - }, unmarshalListVolumesResponse$1); - + addBackendServers = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalAddBackendServersRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/lb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/backends/${marshalling.validatePathParam("backendId", request.backendId)}/servers` + }, + marshalling_gen.unmarshalBackend + ); /** - * List volumes. List volumes in the specified Availability Zone. You can - * filter the output by volume type. + * Remove a set of servers for a given backend. * - * @param request - The request {@link ListVolumesRequest} - * @returns A Promise of ListVolumesResponse + * @param request - The request {@link RemoveBackendServersRequest} + * @returns A Promise of Backend */ - listVolumes = (request = {}) => enrichForPagination('volumes', this.pageOfListVolumes, request); - + removeBackendServers = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalRemoveBackendServersRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "DELETE", + path: `/lb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/backends/${marshalling.validatePathParam("backendId", request.backendId)}/servers` + }, + marshalling_gen.unmarshalBackend + ); /** - * Create a volume. Create a volume of a specified type in an Availability - * Zone. + * Define all servers in a given backend. * - * @param request - The request {@link CreateVolumeRequest} - * @returns A Promise of CreateVolumeResponse + * @param request - The request {@link SetBackendServersRequest} + * @returns A Promise of Backend */ - createVolume = (request = {}) => this.client.fetch({ - body: JSON.stringify(marshalCreateVolumeRequest$1(request, this.client.settings)), - headers: jsonContentHeaders$g, - method: 'POST', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/volumes` - }, unmarshalCreateVolumeResponse); - + setBackendServers = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalSetBackendServersRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PUT", + path: `/lb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/backends/${marshalling.validatePathParam("backendId", request.backendId)}/servers` + }, + marshalling_gen.unmarshalBackend + ); /** - * Get a volume. Get details of a volume with the specified ID. + * Update an health check for a given backend. * - * @param request - The request {@link GetVolumeRequest} - * @returns A Promise of GetVolumeResponse + * @param request - The request {@link UpdateHealthCheckRequest} + * @returns A Promise of HealthCheck */ - getVolume = request => this.client.fetch({ - method: 'GET', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/volumes/${validatePathParam('volumeId', request.volumeId)}` - }, unmarshalGetVolumeResponse); - + updateHealthCheck = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateHealthCheckRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PUT", + path: `/lb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/backends/${marshalling.validatePathParam("backendId", request.backendId)}/healthcheck` + }, + marshalling_gen.unmarshalHealthCheck + ); + pageOfListFrontends = (request) => this.client.fetch( + { + method: "GET", + path: `/lb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/lbs/${marshalling.validatePathParam("lbId", request.lbId)}/frontends`, + urlParams: marshalling.urlParams( + ["name", request.name], + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListFrontendsResponse + ); /** - * Update a volume. Replace the name and/or size properties of a volume - * specified by its ID, with the specified value(s). Any volume name can be - * changed, however only `b_ssd` volumes can currently be increased in size. + * List frontends in a given load balancer. * - * @param request - The request {@link UpdateVolumeRequest} - * @returns A Promise of UpdateVolumeResponse + * @param request - The request {@link ListFrontendsRequest} + * @returns A Promise of ListFrontendsResponse + */ + listFrontends = (request) => resourcePaginator.enrichForPagination("frontends", this.pageOfListFrontends, request); + /** + * Create a frontend in a given load balancer. + * + * @param request - The request {@link CreateFrontendRequest} + * @returns A Promise of Frontend + */ + createFrontend = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateFrontendRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/lb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/lbs/${marshalling.validatePathParam("lbId", request.lbId)}/frontends` + }, + marshalling_gen.unmarshalFrontend + ); + /** + * Get a frontend. + * + * @param request - The request {@link GetFrontendRequest} + * @returns A Promise of Frontend + */ + getFrontend = (request) => this.client.fetch( + { + method: "GET", + path: `/lb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/frontends/${marshalling.validatePathParam("frontendId", request.frontendId)}` + }, + marshalling_gen.unmarshalFrontend + ); + /** + * Update a frontend. + * + * @param request - The request {@link UpdateFrontendRequest} + * @returns A Promise of Frontend */ - updateVolume = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateVolumeRequest$1(request, this.client.settings)), - headers: jsonContentHeaders$g, - method: 'PATCH', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/volumes/${validatePathParam('volumeId', request.volumeId)}` - }, unmarshalUpdateVolumeResponse); - + updateFrontend = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateFrontendRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PUT", + path: `/lb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/frontends/${marshalling.validatePathParam("frontendId", request.frontendId)}` + }, + marshalling_gen.unmarshalFrontend + ); /** - * Delete a volume. Delete the volume with the specified ID. + * Delete a frontend. * - * @param request - The request {@link DeleteVolumeRequest} + * @param request - The request {@link DeleteFrontendRequest} */ - deleteVolume = request => this.client.fetch({ - method: 'DELETE', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/volumes/${validatePathParam('volumeId', request.volumeId)}` + deleteFrontend = (request) => this.client.fetch({ + method: "DELETE", + path: `/lb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/frontends/${marshalling.validatePathParam("frontendId", request.frontendId)}` }); - pageOfListSecurityGroups = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/security_groups`, - urlParams: urlParams(['name', request.name], ['organization', request.organization], ['page', request.page], ['per_page', request.perPage ?? this.client.settings.defaultPageSize], ['project', request.project], ['project_default', request.projectDefault], ['tags', request.tags && request.tags.length > 0 ? request.tags.join(',') : undefined]) - }, unmarshalListSecurityGroupsResponse); - + pageOfListRoutes = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/lb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes`, + urlParams: marshalling.urlParams( + ["frontend_id", request.frontendId], + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListRoutesResponse + ); /** - * List security groups. List all existing security groups. + * List all backend redirections. * - * @param request - The request {@link ListSecurityGroupsRequest} - * @returns A Promise of ListSecurityGroupsResponse + * @param request - The request {@link ListRoutesRequest} + * @returns A Promise of ListRoutesResponse */ - listSecurityGroups = (request = {}) => enrichForPagination('securityGroups', this.pageOfListSecurityGroups, request); - + listRoutes = (request = {}) => resourcePaginator.enrichForPagination("routes", this.pageOfListRoutes, request); /** - * Create a security group. Create a security group with a specified name and - * description. + * Create a backend redirection. * - * @param request - The request {@link CreateSecurityGroupRequest} - * @returns A Promise of CreateSecurityGroupResponse + * @param request - The request {@link CreateRouteRequest} + * @returns A Promise of Route */ - createSecurityGroup = request => this.client.fetch({ - body: JSON.stringify(marshalCreateSecurityGroupRequest(request, this.client.settings)), - headers: jsonContentHeaders$g, - method: 'POST', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/security_groups` - }, unmarshalCreateSecurityGroupResponse); - + createRoute = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateRouteRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/lb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes` + }, + marshalling_gen.unmarshalRoute + ); /** - * Get a security group. Get the details of a security group with the - * specified ID. + * Get single backend redirection. * - * @param request - The request {@link GetSecurityGroupRequest} - * @returns A Promise of GetSecurityGroupResponse + * @param request - The request {@link GetRouteRequest} + * @returns A Promise of Route */ - getSecurityGroup = request => this.client.fetch({ - method: 'GET', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/security_groups/${validatePathParam('securityGroupId', request.securityGroupId)}` - }, unmarshalGetSecurityGroupResponse); - + getRoute = (request) => this.client.fetch( + { + method: "GET", + path: `/lb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes/${marshalling.validatePathParam("routeId", request.routeId)}` + }, + marshalling_gen.unmarshalRoute + ); /** - * Delete a security group. Delete a security group with the specified ID. + * Edit a backend redirection. * - * @param request - The request {@link DeleteSecurityGroupRequest} + * @param request - The request {@link UpdateRouteRequest} + * @returns A Promise of Route */ - deleteSecurityGroup = request => this.client.fetch({ - method: 'DELETE', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/security_groups/${validatePathParam('securityGroupId', request.securityGroupId)}` - }); - _setSecurityGroup = request => this.client.fetch({ - body: JSON.stringify(marshalSetSecurityGroupRequest(request, this.client.settings)), - headers: jsonContentHeaders$g, - method: 'PUT', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/security_groups/${validatePathParam('id', request.id)}` - }, unmarshalSetSecurityGroupResponse); - + updateRoute = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateRouteRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PUT", + path: `/lb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes/${marshalling.validatePathParam("routeId", request.routeId)}` + }, + marshalling_gen.unmarshalRoute + ); /** - * Get default rules. Lists the default rules applied to all the security - * groups. + * Delete a backend redirection. * - * @param request - The request {@link ListDefaultSecurityGroupRulesRequest} - * @returns A Promise of ListSecurityGroupRulesResponse + * @param request - The request {@link DeleteRouteRequest} */ - listDefaultSecurityGroupRules = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/security_groups/default/rules` - }, unmarshalListSecurityGroupRulesResponse); - pageOfListSecurityGroupRules = request => this.client.fetch({ - method: 'GET', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/security_groups/${validatePathParam('securityGroupId', request.securityGroupId)}/rules`, - urlParams: urlParams(['page', request.page], ['per_page', request.perPage ?? this.client.settings.defaultPageSize]) - }, unmarshalListSecurityGroupRulesResponse); - + deleteRoute = (request) => this.client.fetch({ + method: "DELETE", + path: `/lb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes/${marshalling.validatePathParam("routeId", request.routeId)}` + }); /** - * List rules. List the rules of the a specified security group ID. + * Get usage statistics of a given load balancer. * - * @param request - The request {@link ListSecurityGroupRulesRequest} - * @returns A Promise of ListSecurityGroupRulesResponse + * @deprecated + * @param request - The request {@link GetLbStatsRequest} + * @returns A Promise of LbStats */ - listSecurityGroupRules = request => enrichForPagination('rules', this.pageOfListSecurityGroupRules, request); - + getLbStats = (request) => this.client.fetch( + { + method: "GET", + path: `/lb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/lbs/${marshalling.validatePathParam("lbId", request.lbId)}/stats`, + urlParams: marshalling.urlParams(["backend_id", request.backendId]) + }, + marshalling_gen.unmarshalLbStats + ); + pageOfListBackendStats = (request) => this.client.fetch( + { + method: "GET", + path: `/lb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/lbs/${marshalling.validatePathParam("lbId", request.lbId)}/backend-stats`, + urlParams: marshalling.urlParams( + ["backend_id", request.backendId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListBackendStatsResponse + ); /** - * Create rule. Create a rule in the specified security group ID. + * List backend server statistics. * - * @param request - The request {@link CreateSecurityGroupRuleRequest} - * @returns A Promise of CreateSecurityGroupRuleResponse + * @param request - The request {@link ListBackendStatsRequest} + * @returns A Promise of ListBackendStatsResponse */ - createSecurityGroupRule = request => this.client.fetch({ - body: JSON.stringify(marshalCreateSecurityGroupRuleRequest(request, this.client.settings)), - headers: jsonContentHeaders$g, - method: 'POST', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/security_groups/${validatePathParam('securityGroupId', request.securityGroupId)}/rules` - }, unmarshalCreateSecurityGroupRuleResponse); - + listBackendStats = (request) => resourcePaginator.enrichForPagination( + "backendServersStats", + this.pageOfListBackendStats, + request + ); + pageOfListAcls = (request) => this.client.fetch( + { + method: "GET", + path: `/lb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/frontends/${marshalling.validatePathParam("frontendId", request.frontendId)}/acls`, + urlParams: marshalling.urlParams( + ["name", request.name], + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListAclResponse + ); /** - * Update all the rules of a security group. Replaces the existing rules of - * the security group with the rules provided. This endpoint supports the - * update of existing rules, creation of new rules and deletion of existing - * rules when they are not passed in the request. + * List ACL for a given frontend. * - * @param request - The request {@link SetSecurityGroupRulesRequest} - * @returns A Promise of SetSecurityGroupRulesResponse + * @param request - The request {@link ListAclsRequest} + * @returns A Promise of ListAclResponse */ - setSecurityGroupRules = request => this.client.fetch({ - body: JSON.stringify(marshalSetSecurityGroupRulesRequest(request, this.client.settings)), - headers: jsonContentHeaders$g, - method: 'PUT', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/security_groups/${validatePathParam('securityGroupId', request.securityGroupId)}/rules` - }, unmarshalSetSecurityGroupRulesResponse); - + listAcls = (request) => resourcePaginator.enrichForPagination("acls", this.pageOfListAcls, request); /** - * Delete rule. Delete a security group rule with the specified ID. + * Create an ACL for a given frontend. * - * @param request - The request {@link DeleteSecurityGroupRuleRequest} + * @param request - The request {@link CreateAclRequest} + * @returns A Promise of Acl */ - deleteSecurityGroupRule = request => this.client.fetch({ - method: 'DELETE', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/security_groups/${validatePathParam('securityGroupId', request.securityGroupId)}/rules/${validatePathParam('securityGroupRuleId', request.securityGroupRuleId)}` - }); - + createAcl = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateAclRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/lb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/frontends/${marshalling.validatePathParam("frontendId", request.frontendId)}/acls` + }, + marshalling_gen.unmarshalAcl + ); /** - * Get rule. Get details of a security group rule with the specified ID. + * Get an ACL. * - * @param request - The request {@link GetSecurityGroupRuleRequest} - * @returns A Promise of GetSecurityGroupRuleResponse + * @param request - The request {@link GetAclRequest} + * @returns A Promise of Acl */ - getSecurityGroupRule = request => this.client.fetch({ - method: 'GET', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/security_groups/${validatePathParam('securityGroupId', request.securityGroupId)}/rules/${validatePathParam('securityGroupRuleId', request.securityGroupRuleId)}` - }, unmarshalGetSecurityGroupRuleResponse); - _setSecurityGroupRule = request => this.client.fetch({ - body: JSON.stringify(marshalSetSecurityGroupRuleRequest(request, this.client.settings)), - headers: jsonContentHeaders$g, - method: 'PUT', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/security_groups/${validatePathParam('securityGroupId', request.securityGroupId)}/rules/${validatePathParam('securityGroupRuleId', request.securityGroupRuleId)}` - }, unmarshalSetSecurityGroupRuleResponse); - pageOfListPlacementGroups = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/placement_groups`, - urlParams: urlParams(['name', request.name], ['organization', request.organization], ['page', request.page], ['per_page', request.perPage ?? this.client.settings.defaultPageSize], ['project', request.project], ['tags', request.tags && request.tags.length > 0 ? request.tags.join(',') : undefined]) - }, unmarshalListPlacementGroupsResponse); - + getAcl = (request) => this.client.fetch( + { + method: "GET", + path: `/lb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/acls/${marshalling.validatePathParam("aclId", request.aclId)}` + }, + marshalling_gen.unmarshalAcl + ); /** - * List placement groups. List all placement groups in a specified - * Availability Zone. + * Update an ACL. * - * @param request - The request {@link ListPlacementGroupsRequest} - * @returns A Promise of ListPlacementGroupsResponse + * @param request - The request {@link UpdateAclRequest} + * @returns A Promise of Acl */ - listPlacementGroups = (request = {}) => enrichForPagination('placementGroups', this.pageOfListPlacementGroups, request); - + updateAcl = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateAclRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PUT", + path: `/lb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/acls/${marshalling.validatePathParam("aclId", request.aclId)}` + }, + marshalling_gen.unmarshalAcl + ); /** - * Create a placement group. Create a new placement group in a specified - * Availability Zone. + * Delete an ACL. * - * @param request - The request {@link CreatePlacementGroupRequest} - * @returns A Promise of CreatePlacementGroupResponse + * @param request - The request {@link DeleteAclRequest} */ - createPlacementGroup = (request = {}) => this.client.fetch({ - body: JSON.stringify(marshalCreatePlacementGroupRequest(request, this.client.settings)), - headers: jsonContentHeaders$g, - method: 'POST', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/placement_groups` - }, unmarshalCreatePlacementGroupResponse); - + deleteAcl = (request) => this.client.fetch({ + method: "DELETE", + path: `/lb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/acls/${marshalling.validatePathParam("aclId", request.aclId)}` + }); /** - * Get a placement group. Get the specified placement group. + * Create a TLS certificate. Generate a new TLS certificate using Let's + * Encrypt or import your certificate. * - * @param request - The request {@link GetPlacementGroupRequest} - * @returns A Promise of GetPlacementGroupResponse + * @param request - The request {@link CreateCertificateRequest} + * @returns A Promise of Certificate */ - getPlacementGroup = request => this.client.fetch({ - method: 'GET', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/placement_groups/${validatePathParam('placementGroupId', request.placementGroupId)}` - }, unmarshalGetPlacementGroupResponse); - + createCertificate = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateCertificateRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/lb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/lbs/${marshalling.validatePathParam("lbId", request.lbId)}/certificates` + }, + marshalling_gen.unmarshalCertificate + ); + pageOfListCertificates = (request) => this.client.fetch( + { + method: "GET", + path: `/lb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/lbs/${marshalling.validatePathParam("lbId", request.lbId)}/certificates`, + urlParams: marshalling.urlParams( + ["name", request.name], + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListCertificatesResponse + ); /** - * Set placement group. Set all parameters of the specified placement group. + * List all TLS certificates on a given load balancer. * - * @param request - The request {@link SetPlacementGroupRequest} - * @returns A Promise of SetPlacementGroupResponse + * @param request - The request {@link ListCertificatesRequest} + * @returns A Promise of ListCertificatesResponse */ - setPlacementGroup = request => this.client.fetch({ - body: JSON.stringify(marshalSetPlacementGroupRequest(request, this.client.settings)), - headers: jsonContentHeaders$g, - method: 'PUT', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/placement_groups/${validatePathParam('placementGroupId', request.placementGroupId)}` - }, unmarshalSetPlacementGroupResponse); - + listCertificates = (request) => resourcePaginator.enrichForPagination("certificates", this.pageOfListCertificates, request); /** - * Update a placement group. Update one or more parameter of the specified - * placement group. + * Get a TLS certificate. * - * @param request - The request {@link UpdatePlacementGroupRequest} - * @returns A Promise of UpdatePlacementGroupResponse + * @param request - The request {@link GetCertificateRequest} + * @returns A Promise of Certificate */ - updatePlacementGroup = request => this.client.fetch({ - body: JSON.stringify(marshalUpdatePlacementGroupRequest(request, this.client.settings)), - headers: jsonContentHeaders$g, - method: 'PATCH', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/placement_groups/${validatePathParam('placementGroupId', request.placementGroupId)}` - }, unmarshalUpdatePlacementGroupResponse); - + getCertificate = (request) => this.client.fetch( + { + method: "GET", + path: `/lb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/certificates/${marshalling.validatePathParam("certificateId", request.certificateId)}` + }, + marshalling_gen.unmarshalCertificate + ); /** - * Delete the specified placement group. + * Waits for {@link Certificate} to be in a final state. * - * @param request - The request {@link DeletePlacementGroupRequest} + * @param request - The request {@link GetCertificateRequest} + * @param options - The waiting options + * @returns A Promise of Certificate */ - deletePlacementGroup = request => this.client.fetch({ - method: 'DELETE', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/placement_groups/${validatePathParam('placementGroupId', request.placementGroupId)}` - }); - + waitForCertificate = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve( + !content_gen.CERTIFICATE_TRANSIENT_STATUSES.includes(res.status) + )), + this.getCertificate, + request, + options + ); /** - * Get placement group servers. Get all Instances belonging to the specified - * placement group. + * Update a TLS certificate. * - * @param request - The request {@link GetPlacementGroupServersRequest} - * @returns A Promise of GetPlacementGroupServersResponse + * @param request - The request {@link UpdateCertificateRequest} + * @returns A Promise of Certificate */ - getPlacementGroupServers = request => this.client.fetch({ - method: 'GET', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/placement_groups/${validatePathParam('placementGroupId', request.placementGroupId)}/servers` - }, unmarshalGetPlacementGroupServersResponse); - + updateCertificate = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateCertificateRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PUT", + path: `/lb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/certificates/${marshalling.validatePathParam("certificateId", request.certificateId)}` + }, + marshalling_gen.unmarshalCertificate + ); /** - * Set placement group servers. Set all Instances belonging to the specified - * placement group. + * Delete a TLS certificate. * - * @param request - The request {@link SetPlacementGroupServersRequest} - * @returns A Promise of SetPlacementGroupServersResponse + * @param request - The request {@link DeleteCertificateRequest} */ - setPlacementGroupServers = request => this.client.fetch({ - body: JSON.stringify(marshalSetPlacementGroupServersRequest(request, this.client.settings)), - headers: jsonContentHeaders$g, - method: 'PUT', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/placement_groups/${validatePathParam('placementGroupId', request.placementGroupId)}/servers` - }, unmarshalSetPlacementGroupServersResponse); - + deleteCertificate = (request) => this.client.fetch({ + method: "DELETE", + path: `/lb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/certificates/${marshalling.validatePathParam("certificateId", request.certificateId)}` + }); + pageOfListLbTypes = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/lb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/lb-types`, + urlParams: marshalling.urlParams( + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListLbTypesResponse + ); /** - * Update placement group servers. Update all Instances belonging to the - * specified placement group. + * List all load balancer offer type. * - * @param request - The request {@link UpdatePlacementGroupServersRequest} - * @returns A Promise of UpdatePlacementGroupServersResponse + * @param request - The request {@link ListLbTypesRequest} + * @returns A Promise of ListLbTypesResponse */ - updatePlacementGroupServers = request => this.client.fetch({ - body: JSON.stringify(marshalUpdatePlacementGroupServersRequest(request, this.client.settings)), - headers: jsonContentHeaders$g, - method: 'PATCH', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/placement_groups/${validatePathParam('placementGroupId', request.placementGroupId)}/servers` - }, unmarshalUpdatePlacementGroupServersResponse); - pageOfListIps = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips`, - urlParams: urlParams(['name', request.name], ['organization', request.organization], ['page', request.page], ['per_page', request.perPage ?? this.client.settings.defaultPageSize], ['project', request.project], ['tags', request.tags && request.tags.length > 0 ? request.tags.join(',') : undefined], ['type', request.type]) - }, unmarshalListIpsResponse$1); - + listLbTypes = (request = {}) => resourcePaginator.enrichForPagination("lbTypes", this.pageOfListLbTypes, request); /** - * List all flexible IPs. List all flexible IPs in a specified zone. + * Create a subscriber, webhook or email. * - * @param request - The request {@link ListIpsRequest} - * @returns A Promise of ListIpsResponse + * @param request - The request {@link CreateSubscriberRequest} + * @returns A Promise of Subscriber */ - listIps = (request = {}) => enrichForPagination('ips', this.pageOfListIps, request); - + createSubscriber = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateSubscriberRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/lb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/subscribers` + }, + marshalling_gen.unmarshalSubscriber + ); /** - * Reserve a flexible IP. Reserve a flexible IP and attach it to the specified - * Instance. + * Get a subscriber. * - * @param request - The request {@link CreateIpRequest} - * @returns A Promise of CreateIpResponse + * @param request - The request {@link GetSubscriberRequest} + * @returns A Promise of Subscriber */ - createIp = (request = {}) => this.client.fetch({ - body: JSON.stringify(marshalCreateIpRequest$1(request, this.client.settings)), - headers: jsonContentHeaders$g, - method: 'POST', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips` - }, unmarshalCreateIpResponse); - + getSubscriber = (request) => this.client.fetch( + { + method: "GET", + path: `/lb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/subscribers/${marshalling.validatePathParam("subscriberId", request.subscriberId)}` + }, + marshalling_gen.unmarshalSubscriber + ); + pageOfListSubscriber = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/lb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/subscribers`, + urlParams: marshalling.urlParams( + ["name", request.name], + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId] + ) + }, + marshalling_gen.unmarshalListSubscriberResponse + ); /** - * Get a flexible IP. Get details of an IP with the specified ID or address. + * List all subscriber. * - * @param request - The request {@link GetIpRequest} - * @returns A Promise of GetIpResponse + * @param request - The request {@link ListSubscriberRequest} + * @returns A Promise of ListSubscriberResponse */ - getIp = request => this.client.fetch({ - method: 'GET', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam('ip', request.ip)}` - }, unmarshalGetIpResponse); - + listSubscriber = (request = {}) => resourcePaginator.enrichForPagination("subscribers", this.pageOfListSubscriber, request); /** - * Update a flexible IP. Update a flexible IP in the specified zone with the - * specified ID. + * Update a subscriber. * - * @param request - The request {@link UpdateIpRequest} - * @returns A Promise of UpdateIpResponse + * @param request - The request {@link UpdateSubscriberRequest} + * @returns A Promise of Subscriber */ - updateIp = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateIpRequest$1(request, this.client.settings)), - headers: jsonContentHeaders$g, - method: 'PATCH', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam('ip', request.ip)}` - }, unmarshalUpdateIpResponse); - + updateSubscriber = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateSubscriberRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PUT", + path: `/lb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/subscribers/${marshalling.validatePathParam("subscriberId", request.subscriberId)}` + }, + marshalling_gen.unmarshalSubscriber + ); /** - * Delete a flexible IP. Delete the IP with the specified ID. + * Delete a subscriber. * - * @param request - The request {@link DeleteIpRequest} + * @param request - The request {@link DeleteSubscriberRequest} */ - deleteIp = request => this.client.fetch({ - method: 'DELETE', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam('ip', request.ip)}` + deleteSubscriber = (request) => this.client.fetch({ + method: "DELETE", + path: `/lb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/lb/subscriber/${marshalling.validatePathParam("subscriberId", request.subscriberId)}` }); - pageOfListPrivateNICs = request => this.client.fetch({ - method: 'GET', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/private_nics`, - urlParams: urlParams(['page', request.page], ['per_page', request.perPage ?? this.client.settings.defaultPageSize], ['tags', request.tags && request.tags.length > 0 ? request.tags.join(',') : undefined]) - }, unmarshalListPrivateNICsResponse); - /** - * List all private NICs. List all private NICs of a specified Instance. + * Subscribe a subscriber to a given load balancer. * - * @param request - The request {@link ListPrivateNICsRequest} - * @returns A Promise of ListPrivateNICsResponse + * @param request - The request {@link SubscribeToLbRequest} + * @returns A Promise of Lb */ - listPrivateNICs = request => enrichForPagination('privateNics', this.pageOfListPrivateNICs, request); - + subscribeToLb = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalSubscribeToLbRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/lb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/lb/${marshalling.validatePathParam("lbId", request.lbId)}/subscribe` + }, + marshalling_gen.unmarshalLb + ); /** - * Create a private NIC connecting an Instance to a Private Network. + * Unsubscribe a subscriber from a given load balancer. * - * @param request - The request {@link CreatePrivateNICRequest} - * @returns A Promise of CreatePrivateNICResponse + * @param request - The request {@link UnsubscribeFromLbRequest} + * @returns A Promise of Lb */ - createPrivateNIC = request => this.client.fetch({ - body: JSON.stringify(marshalCreatePrivateNICRequest(request, this.client.settings)), - headers: jsonContentHeaders$g, - method: 'POST', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/private_nics` - }, unmarshalCreatePrivateNICResponse); - + unsubscribeFromLb = (request) => this.client.fetch( + { + method: "DELETE", + path: `/lb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/lb/${marshalling.validatePathParam("lbId", request.lbId)}/unsubscribe` + }, + marshalling_gen.unmarshalLb + ); + pageOfListLbPrivateNetworks = (request) => this.client.fetch( + { + method: "GET", + path: `/lb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/lbs/${marshalling.validatePathParam("lbId", request.lbId)}/private-networks`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListLbPrivateNetworksResponse + ); /** - * Get a private NIC. Get private NIC properties. + * List attached private network of load balancer. * - * @param request - The request {@link GetPrivateNICRequest} - * @returns A Promise of GetPrivateNICResponse + * @param request - The request {@link ListLbPrivateNetworksRequest} + * @returns A Promise of ListLbPrivateNetworksResponse */ - getPrivateNIC = request => this.client.fetch({ - method: 'GET', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/private_nics/${validatePathParam('privateNicId', request.privateNicId)}` - }, unmarshalGetPrivateNICResponse); - + listLbPrivateNetworks = (request) => resourcePaginator.enrichForPagination( + "privateNetwork", + this.pageOfListLbPrivateNetworks, + request + ); /** - * Update a private NIC. Update one or more parameter(s) of a specified - * private NIC. + * Add load balancer on instance private network. * - * @param request - The request {@link UpdatePrivateNICRequest} - * @returns A Promise of PrivateNIC + * @param request - The request {@link AttachPrivateNetworkRequest} + * @returns A Promise of PrivateNetwork */ - updatePrivateNIC = request => this.client.fetch({ - body: JSON.stringify(marshalUpdatePrivateNICRequest(request, this.client.settings)), - headers: jsonContentHeaders$g, - method: 'PATCH', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/private_nics/${validatePathParam('privateNicId', request.privateNicId)}` - }, unmarshalPrivateNIC); + attachPrivateNetwork = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalAttachPrivateNetworkRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/lb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/lbs/${marshalling.validatePathParam("lbId", request.lbId)}/private-networks/${marshalling.validatePathParam("privateNetworkId", request.privateNetworkId)}/attach` + }, + marshalling_gen.unmarshalPrivateNetwork + ); + /** + * Remove load balancer of private network. + * + * @param request - The request {@link DetachPrivateNetworkRequest} + */ + detachPrivateNetwork = (request) => this.client.fetch({ + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/lb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/lbs/${marshalling.validatePathParam("lbId", request.lbId)}/private-networks/${marshalling.validatePathParam("privateNetworkId", request.privateNetworkId)}/detach` + }); +} +exports.API = API; +exports.ZonedAPI = ZonedAPI; + + +/***/ }), + +/***/ 9813: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const intervalRetrier = __nccwpck_require__(9052); +const api_gen = __nccwpck_require__(3488); +const content_gen = __nccwpck_require__(2259); +class LbV1UtilsAPI extends api_gen.API { /** - * Delete a private NIC. + * Waits for all private networks of a load balancer to be in a final state. * - * @param request - The request {@link DeletePrivateNICRequest} + * @param request - The request {@link WaitForLbPrivateNetworksRequest} + * @param options - The waiting options + * @returns A Promise of ListLbPrivateNetworksResponse */ - deletePrivateNIC = request => this.client.fetch({ - method: 'DELETE', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/private_nics/${validatePathParam('privateNicId', request.privateNicId)}` - }); - pageOfListBootscripts = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/bootscripts`, - urlParams: urlParams(['arch', request.arch], ['default', request.default], ['page', request.page], ['per_page', request.perPage ?? this.client.settings.defaultPageSize], ['public', request.public], ['title', request.title]) - }, unmarshalListBootscriptsResponse); - + waitForLbPrivateNetworks = (request, options) => intervalRetrier.tryAtIntervals( + async () => { + const value = await this.listLbPrivateNetworks({ + lbId: request.lbId, + region: request.region + }).all().then((list) => ({ + privateNetwork: list, + totalCount: list.length + })); + return { + done: value.privateNetwork.find( + (elt) => content_gen.PRIVATE_NETWORK_TRANSIENT_STATUSES.includes(elt.status) + ) === void 0, + value + }; + }, + intervalRetrier.createExponentialBackoffStrategy( + options?.minDelay ?? 1, + options?.maxDelay ?? 30 + ), + options?.timeout + ); /** - * List bootscripts. + * Waits for all instances of a load balancer to be in a final state. * - * @deprecated - * @param request - The request {@link ListBootscriptsRequest} - * @returns A Promise of ListBootscriptsResponse + * @param request - The request {@link GetLbRequest} + * @param options - The waiting options + * @returns A Promise of Lb */ - listBootscripts = (request = {}) => enrichForPagination('bootscripts', this.pageOfListBootscripts, request); - + waitForLbInstances = (request, options) => intervalRetrier.tryAtIntervals( + async () => { + const value = await this.getLb(request); + return { + done: !content_gen.LB_TRANSIENT_STATUSES.includes(value.status) && value.instances.find( + (elt) => content_gen.INSTANCE_TRANSIENT_STATUSES.includes(elt.status) + ) === void 0, + value + }; + }, + intervalRetrier.createExponentialBackoffStrategy( + options?.minDelay ?? 1, + options?.maxDelay ?? 30 + ), + options?.timeout + ); +} +class LbZonedV1UtilsAPI extends api_gen.ZonedAPI { /** - * Get bootscripts. Get details of a bootscript with the specified ID. + * Waits for all private networks of a (zoned) load balancer to be in a final + * state. * - * @deprecated - * @param request - The request {@link GetBootscriptRequest} - * @returns A Promise of GetBootscriptResponse + * @param request - The request {@link ZonedWaitForLbPrivateNetworksRequest} + * @param options - The waiting options + * @returns A Promise of ListLbPrivateNetworksResponse */ - getBootscript = request => this.client.fetch({ - method: 'GET', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/bootscripts/${validatePathParam('bootscriptId', request.bootscriptId)}` - }, unmarshalGetBootscriptResponse); - getDashboard = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/dashboard`, - urlParams: urlParams(['organization', request.organization], ['project', request.project]) - }, unmarshalGetDashboardResponse); - + waitForLbPrivateNetworks = (request, options) => intervalRetrier.tryAtIntervals( + async () => { + const value = await this.listLbPrivateNetworks({ + lbId: request.lbId, + zone: request.zone + }).all().then((list) => ({ + privateNetwork: list, + totalCount: list.length + })); + return { + done: value.privateNetwork.find( + (elt) => content_gen.PRIVATE_NETWORK_TRANSIENT_STATUSES.includes(elt.status) + ) === void 0, + value + }; + }, + intervalRetrier.createExponentialBackoffStrategy( + options?.minDelay ?? 1, + options?.maxDelay ?? 30 + ), + options?.timeout + ); /** - * Get a volume or snapshot's migration plan. Given a volume or snapshot, - * returns the migration plan for a call to the RPC ApplyBlockMigration. This - * plan will include zero or one volume, and zero or more snapshots, which - * will need to be migrated together. This RPC does not perform the actual - * migration itself, ApplyBlockMigration must be used. The validation_key - * value returned by this call must be provided to the ApplyBlockMigration - * call to confirm that all resources listed in the plan should be migrated. + * Waits for all instances of a (zoned) load balancer to be in a final state. * - * @param request - The request {@link PlanBlockMigrationRequest} - * @returns A Promise of MigrationPlan + * @param request - The request {@link GetLbRequest} + * @param options - The waiting options + * @returns A Promise of Lb */ - planBlockMigration = (request = {}) => this.client.fetch({ - body: JSON.stringify(marshalPlanBlockMigrationRequest(request, this.client.settings)), - headers: jsonContentHeaders$g, - method: 'POST', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/block-migration/plan` - }, unmarshalMigrationPlan); + waitForLbInstances = (request, options) => intervalRetrier.tryAtIntervals( + async () => { + const value = await this.getLb(request); + return { + done: !content_gen.LB_TRANSIENT_STATUSES.includes(value.status) && value.instances.find( + (elt) => content_gen.INSTANCE_TRANSIENT_STATUSES.includes(elt.status) + ) === void 0, + value + }; + }, + intervalRetrier.createExponentialBackoffStrategy( + options?.minDelay ?? 1, + options?.maxDelay ?? 30 + ), + options?.timeout + ); +} +exports.LbV1UtilsAPI = LbV1UtilsAPI; +exports.LbZonedV1UtilsAPI = LbZonedV1UtilsAPI; - /** - * Migrate a volume and/or snapshots to SBS (Scaleway Block Storage). To be - * used, this RPC must be preceded by a call to PlanBlockMigration. To migrate - * all resources mentioned in the MigrationPlan, the validation_key returned - * in the MigrationPlan must be provided. - * - * @param request - The request {@link ApplyBlockMigrationRequest} - */ - applyBlockMigration = request => this.client.fetch({ - body: JSON.stringify(marshalApplyBlockMigrationRequest(request, this.client.settings)), - headers: jsonContentHeaders$g, - method: 'POST', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/block-migration/apply` - }); + +/***/ }), + +/***/ 2259: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const CERTIFICATE_TRANSIENT_STATUSES = ["pending"]; +const INSTANCE_TRANSIENT_STATUSES = [ + "pending", + "migrating" +]; +const LB_TRANSIENT_STATUSES = [ + "pending", + "migrating", + "to_create", + "creating", + "to_delete", + "deleting" +]; +const PRIVATE_NETWORK_TRANSIENT_STATUSES = [ + "pending" +]; +exports.CERTIFICATE_TRANSIENT_STATUSES = CERTIFICATE_TRANSIENT_STATUSES; +exports.INSTANCE_TRANSIENT_STATUSES = INSTANCE_TRANSIENT_STATUSES; +exports.LB_TRANSIENT_STATUSES = LB_TRANSIENT_STATUSES; +exports.PRIVATE_NETWORK_TRANSIENT_STATUSES = PRIVATE_NETWORK_TRANSIENT_STATUSES; + + +/***/ }), + +/***/ 6916: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api_utils = __nccwpck_require__(9813); +const content_gen = __nccwpck_require__(2259); +exports.API = api_utils.LbV1UtilsAPI; +exports.ZonedAPI = api_utils.LbZonedV1UtilsAPI; +exports.CERTIFICATE_TRANSIENT_STATUSES = content_gen.CERTIFICATE_TRANSIENT_STATUSES; +exports.INSTANCE_TRANSIENT_STATUSES = content_gen.INSTANCE_TRANSIENT_STATUSES; +exports.LB_TRANSIENT_STATUSES = content_gen.LB_TRANSIENT_STATUSES; +exports.PRIVATE_NETWORK_TRANSIENT_STATUSES = content_gen.PRIVATE_NETWORK_TRANSIENT_STATUSES; + + +/***/ }), + +/***/ 6234: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const randomName = __nccwpck_require__(8141); +const json = __nccwpck_require__(3746); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const unmarshalIp = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Ip' failed as data isn't a dictionary.` + ); + } + return { + id: data.id, + ipAddress: data.ip_address, + lbId: data.lb_id, + organizationId: data.organization_id, + projectId: data.project_id, + region: data.region, + reverse: data.reverse, + tags: data.tags, + zone: data.zone + }; +}; +const unmarshalSubscriberEmailConfig = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SubscriberEmailConfig' failed as data isn't a dictionary.` + ); + } + return { + email: data.email + }; +}; +const unmarshalSubscriberWebhookConfig = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SubscriberWebhookConfig' failed as data isn't a dictionary.` + ); + } + return { + uri: data.uri + }; +}; +const unmarshalSubscriber = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Subscriber' failed as data isn't a dictionary.` + ); + } + return { + emailConfig: data.email_config ? unmarshalSubscriberEmailConfig(data.email_config) : void 0, + id: data.id, + name: data.name, + webhookConfig: data.webhook_config ? unmarshalSubscriberWebhookConfig(data.webhook_config) : void 0 + }; +}; +const unmarshalHealthCheckHttpConfig = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'HealthCheckHttpConfig' failed as data isn't a dictionary.` + ); + } + return { + code: data.code, + hostHeader: data.host_header, + method: data.method, + uri: data.uri + }; +}; +const unmarshalHealthCheckHttpsConfig = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'HealthCheckHttpsConfig' failed as data isn't a dictionary.` + ); + } + return { + code: data.code, + hostHeader: data.host_header, + method: data.method, + sni: data.sni, + uri: data.uri + }; +}; +const unmarshalHealthCheckLdapConfig = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'HealthCheckLdapConfig' failed as data isn't a dictionary.` + ); + } + return {}; +}; +const unmarshalHealthCheckMysqlConfig = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'HealthCheckMysqlConfig' failed as data isn't a dictionary.` + ); + } + return { + user: data.user + }; +}; +const unmarshalHealthCheckPgsqlConfig = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'HealthCheckPgsqlConfig' failed as data isn't a dictionary.` + ); + } + return { + user: data.user + }; +}; +const unmarshalHealthCheckRedisConfig = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'HealthCheckRedisConfig' failed as data isn't a dictionary.` + ); + } + return {}; +}; +const unmarshalHealthCheckTcpConfig = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'HealthCheckTcpConfig' failed as data isn't a dictionary.` + ); + } + return {}; +}; +const unmarshalHealthCheck = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'HealthCheck' failed as data isn't a dictionary.` + ); + } + return { + checkDelay: data.check_delay, + checkMaxRetries: data.check_max_retries, + checkSendProxy: data.check_send_proxy, + checkTimeout: data.check_timeout, + httpConfig: data.http_config ? unmarshalHealthCheckHttpConfig(data.http_config) : void 0, + httpsConfig: data.https_config ? unmarshalHealthCheckHttpsConfig(data.https_config) : void 0, + ldapConfig: data.ldap_config ? unmarshalHealthCheckLdapConfig(data.ldap_config) : void 0, + mysqlConfig: data.mysql_config ? unmarshalHealthCheckMysqlConfig(data.mysql_config) : void 0, + pgsqlConfig: data.pgsql_config ? unmarshalHealthCheckPgsqlConfig(data.pgsql_config) : void 0, + port: data.port, + redisConfig: data.redis_config ? unmarshalHealthCheckRedisConfig(data.redis_config) : void 0, + tcpConfig: data.tcp_config ? unmarshalHealthCheckTcpConfig(data.tcp_config) : void 0, + transientCheckDelay: data.transient_check_delay + }; +}; +const unmarshalInstance = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Instance' failed as data isn't a dictionary.` + ); + } + return { + createdAt: marshalling.unmarshalDate(data.created_at), + id: data.id, + ipAddress: data.ip_address, + region: data.region, + status: data.status, + updatedAt: marshalling.unmarshalDate(data.updated_at), + zone: data.zone + }; +}; +const unmarshalLb = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Lb' failed as data isn't a dictionary.` + ); + } + return { + backendCount: data.backend_count, + createdAt: marshalling.unmarshalDate(data.created_at), + description: data.description, + frontendCount: data.frontend_count, + id: data.id, + instances: marshalling.unmarshalArrayOfObject(data.instances, unmarshalInstance), + ip: marshalling.unmarshalArrayOfObject(data.ip, unmarshalIp), + name: data.name, + organizationId: data.organization_id, + privateNetworkCount: data.private_network_count, + projectId: data.project_id, + region: data.region, + routeCount: data.route_count, + sslCompatibilityLevel: data.ssl_compatibility_level, + status: data.status, + subscriber: data.subscriber ? unmarshalSubscriber(data.subscriber) : void 0, + tags: data.tags, + type: data.type, + updatedAt: marshalling.unmarshalDate(data.updated_at), + zone: data.zone + }; +}; +const unmarshalBackend = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Backend' failed as data isn't a dictionary.` + ); + } + return { + createdAt: marshalling.unmarshalDate(data.created_at), + failoverHost: data.failover_host, + forwardPort: data.forward_port, + forwardPortAlgorithm: data.forward_port_algorithm, + forwardProtocol: data.forward_protocol, + healthCheck: data.health_check ? unmarshalHealthCheck(data.health_check) : void 0, + id: data.id, + ignoreSslServerVerify: data.ignore_ssl_server_verify, + lb: data.lb ? unmarshalLb(data.lb) : void 0, + maxConnections: data.max_connections, + maxRetries: data.max_retries, + name: data.name, + onMarkedDownAction: data.on_marked_down_action, + pool: data.pool, + proxyProtocol: data.proxy_protocol, + redispatchAttemptCount: data.redispatch_attempt_count, + sendProxyV2: data.send_proxy_v2, + sslBridging: data.ssl_bridging, + stickySessions: data.sticky_sessions, + stickySessionsCookieName: data.sticky_sessions_cookie_name, + timeoutConnect: data.timeout_connect, + timeoutQueue: data.timeout_queue, + timeoutServer: data.timeout_server, + timeoutTunnel: data.timeout_tunnel, + updatedAt: marshalling.unmarshalDate(data.updated_at) + }; +}; +const unmarshalCertificate = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Certificate' failed as data isn't a dictionary.` + ); + } + return { + commonName: data.common_name, + createdAt: marshalling.unmarshalDate(data.created_at), + fingerprint: data.fingerprint, + id: data.id, + lb: data.lb ? unmarshalLb(data.lb) : void 0, + name: data.name, + notValidAfter: marshalling.unmarshalDate(data.not_valid_after), + notValidBefore: marshalling.unmarshalDate(data.not_valid_before), + status: data.status, + statusDetails: data.status_details, + subjectAlternativeName: data.subject_alternative_name, + type: data.type, + updatedAt: marshalling.unmarshalDate(data.updated_at) + }; +}; +const unmarshalFrontend = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Frontend' failed as data isn't a dictionary.` + ); + } + return { + backend: data.backend ? unmarshalBackend(data.backend) : void 0, + certificate: data.certificate ? unmarshalCertificate(data.certificate) : void 0, + certificateIds: data.certificate_ids, + createdAt: marshalling.unmarshalDate(data.created_at), + enableHttp3: data.enable_http3, + id: data.id, + inboundPort: data.inbound_port, + lb: data.lb ? unmarshalLb(data.lb) : void 0, + name: data.name, + timeoutClient: data.timeout_client, + updatedAt: marshalling.unmarshalDate(data.updated_at) + }; +}; +const unmarshalAclActionRedirect = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'AclActionRedirect' failed as data isn't a dictionary.` + ); + } + return { + code: data.code, + target: data.target, + type: data.type + }; +}; +const unmarshalAclAction = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'AclAction' failed as data isn't a dictionary.` + ); + } + return { + redirect: data.redirect ? unmarshalAclActionRedirect(data.redirect) : void 0, + type: data.type + }; +}; +const unmarshalAclMatch = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'AclMatch' failed as data isn't a dictionary.` + ); + } + return { + httpFilter: data.http_filter, + httpFilterOption: data.http_filter_option, + httpFilterValue: data.http_filter_value, + invert: data.invert, + ipSubnet: data.ip_subnet + }; +}; +const unmarshalAcl = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Acl' failed as data isn't a dictionary.` + ); + } + return { + action: data.action ? unmarshalAclAction(data.action) : void 0, + createdAt: marshalling.unmarshalDate(data.created_at), + description: data.description, + frontend: data.frontend ? unmarshalFrontend(data.frontend) : void 0, + id: data.id, + index: data.index, + match: data.match ? unmarshalAclMatch(data.match) : void 0, + name: data.name, + updatedAt: marshalling.unmarshalDate(data.updated_at) + }; +}; +const unmarshalPrivateNetworkDHCPConfig = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'PrivateNetworkDHCPConfig' failed as data isn't a dictionary.` + ); + } + return { + ipId: data.ip_id + }; }; - -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. - -/** Lists transient statutes of the enum {@link ImageState}. */ -const IMAGE_TRANSIENT_STATUSES$1 = ['creating']; - -/** Lists transient statutes of the enum {@link IpState}. */ -const IP_TRANSIENT_STATUSES = ['pending']; - -/** Lists transient statutes of the enum {@link PrivateNICState}. */ -const PRIVATE_NIC_TRANSIENT_STATUSES = ['syncing']; - -/** Lists transient statutes of the enum {@link SecurityGroupState}. */ -const SECURITY_GROUP_TRANSIENT_STATUSES = ['syncing']; - -/** Lists transient statutes of the enum {@link ServerState}. */ -const SERVER_TRANSIENT_STATUSES = ['starting', 'stopping']; - -/** Lists transient statutes of the enum {@link SnapshotState}. */ -const SNAPSHOT_TRANSIENT_STATUSES$1 = ['snapshotting', 'importing', 'exporting']; - -/** Lists transient statutes of the enum {@link TaskStatus}. */ -const TASK_TRANSIENT_STATUSES = ['pending', 'started', 'retry']; - -/** Lists transient statutes of the enum {@link VolumeServerState}. */ -const VOLUME_SERVER_TRANSIENT_STATUSES = ['snapshotting', 'fetching', 'resizing', 'saving', 'hotsyncing']; - -/** Lists transient statutes of the enum {@link VolumeState}. */ -const VOLUME_TRANSIENT_STATUSES = ['snapshotting', 'fetching', 'resizing', 'saving', 'hotsyncing']; - -const marshalVolumeSummary = (request, defaults) => ({ - id: request.id, +const unmarshalPrivateNetworkIpamConfig = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'PrivateNetworkIpamConfig' failed as data isn't a dictionary.` + ); + } + return {}; +}; +const unmarshalPrivateNetworkStaticConfig = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'PrivateNetworkStaticConfig' failed as data isn't a dictionary.` + ); + } + return { + ipAddress: data.ip_address ? data.ip_address : void 0 + }; +}; +const unmarshalPrivateNetwork = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'PrivateNetwork' failed as data isn't a dictionary.` + ); + } + return { + createdAt: marshalling.unmarshalDate(data.created_at), + dhcpConfig: data.dhcp_config ? unmarshalPrivateNetworkDHCPConfig(data.dhcp_config) : void 0, + ipamConfig: data.ipam_config ? unmarshalPrivateNetworkIpamConfig(data.ipam_config) : void 0, + ipamIds: data.ipam_ids, + lb: data.lb ? unmarshalLb(data.lb) : void 0, + privateNetworkId: data.private_network_id, + staticConfig: data.static_config ? unmarshalPrivateNetworkStaticConfig(data.static_config) : void 0, + status: data.status, + updatedAt: marshalling.unmarshalDate(data.updated_at) + }; +}; +const unmarshalRouteMatch = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'RouteMatch' failed as data isn't a dictionary.` + ); + } + return { + hostHeader: data.host_header, + sni: data.sni + }; +}; +const unmarshalRoute = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Route' failed as data isn't a dictionary.` + ); + } + return { + backendId: data.backend_id, + createdAt: marshalling.unmarshalDate(data.created_at), + frontendId: data.frontend_id, + id: data.id, + match: data.match ? unmarshalRouteMatch(data.match) : void 0, + updatedAt: marshalling.unmarshalDate(data.updated_at) + }; +}; +const unmarshalBackendServerStats = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'BackendServerStats' failed as data isn't a dictionary.` + ); + } + return { + backendId: data.backend_id, + instanceId: data.instance_id, + ip: data.ip, + lastHealthCheckStatus: data.last_health_check_status, + serverState: data.server_state, + serverStateChangedAt: marshalling.unmarshalDate(data.server_state_changed_at) + }; +}; +const unmarshalLbStats = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'LbStats' failed as data isn't a dictionary.` + ); + } + return { + backendServersStats: marshalling.unmarshalArrayOfObject( + data.backend_servers_stats, + unmarshalBackendServerStats + ) + }; +}; +const unmarshalListAclResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListAclResponse' failed as data isn't a dictionary.` + ); + } + return { + acls: marshalling.unmarshalArrayOfObject(data.acls, unmarshalAcl), + totalCount: data.total_count + }; +}; +const unmarshalListBackendStatsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListBackendStatsResponse' failed as data isn't a dictionary.` + ); + } + return { + backendServersStats: marshalling.unmarshalArrayOfObject( + data.backend_servers_stats, + unmarshalBackendServerStats + ), + totalCount: data.total_count + }; +}; +const unmarshalListBackendsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListBackendsResponse' failed as data isn't a dictionary.` + ); + } + return { + backends: marshalling.unmarshalArrayOfObject(data.backends, unmarshalBackend), + totalCount: data.total_count + }; +}; +const unmarshalListCertificatesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListCertificatesResponse' failed as data isn't a dictionary.` + ); + } + return { + certificates: marshalling.unmarshalArrayOfObject( + data.certificates, + unmarshalCertificate + ), + totalCount: data.total_count + }; +}; +const unmarshalListFrontendsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListFrontendsResponse' failed as data isn't a dictionary.` + ); + } + return { + frontends: marshalling.unmarshalArrayOfObject(data.frontends, unmarshalFrontend), + totalCount: data.total_count + }; +}; +const unmarshalListIpsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListIpsResponse' failed as data isn't a dictionary.` + ); + } + return { + ips: marshalling.unmarshalArrayOfObject(data.ips, unmarshalIp), + totalCount: data.total_count + }; +}; +const unmarshalListLbPrivateNetworksResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListLbPrivateNetworksResponse' failed as data isn't a dictionary.` + ); + } + return { + privateNetwork: marshalling.unmarshalArrayOfObject( + data.private_network, + unmarshalPrivateNetwork + ), + totalCount: data.total_count + }; +}; +const unmarshalLbType = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'LbType' failed as data isn't a dictionary.` + ); + } + return { + description: data.description, + name: data.name, + region: data.region, + stockStatus: data.stock_status, + zone: data.zone + }; +}; +const unmarshalListLbTypesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListLbTypesResponse' failed as data isn't a dictionary.` + ); + } + return { + lbTypes: marshalling.unmarshalArrayOfObject(data.lb_types, unmarshalLbType), + totalCount: data.total_count + }; +}; +const unmarshalListLbsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListLbsResponse' failed as data isn't a dictionary.` + ); + } + return { + lbs: marshalling.unmarshalArrayOfObject(data.lbs, unmarshalLb), + totalCount: data.total_count + }; +}; +const unmarshalListRoutesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListRoutesResponse' failed as data isn't a dictionary.` + ); + } + return { + routes: marshalling.unmarshalArrayOfObject(data.routes, unmarshalRoute), + totalCount: data.total_count + }; +}; +const unmarshalListSubscriberResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListSubscriberResponse' failed as data isn't a dictionary.` + ); + } + return { + subscribers: marshalling.unmarshalArrayOfObject(data.subscribers, unmarshalSubscriber), + totalCount: data.total_count + }; +}; +const unmarshalSetAclsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SetAclsResponse' failed as data isn't a dictionary.` + ); + } + return { + acls: marshalling.unmarshalArrayOfObject(data.acls, unmarshalAcl), + totalCount: data.total_count + }; +}; +const marshalAddBackendServersRequest = (request, defaults) => ({ + server_ip: request.serverIp +}); +const marshalPrivateNetworkDHCPConfig = (request, defaults) => ({ + ip_id: request.ipId +}); +const marshalPrivateNetworkIpamConfig = (request, defaults) => ({}); +const marshalPrivateNetworkStaticConfig = (request, defaults) => ({ + ip_address: request.ipAddress +}); +const marshalAttachPrivateNetworkRequest = (request, defaults) => ({ + ipam_ids: request.ipamIds, + ...marshalling.resolveOneOf([ + { + param: "static_config", + value: request.staticConfig !== void 0 ? marshalPrivateNetworkStaticConfig(request.staticConfig) : void 0 + }, + { + param: "dhcp_config", + value: request.dhcpConfig !== void 0 ? marshalPrivateNetworkDHCPConfig(request.dhcpConfig) : void 0 + }, + { + param: "ipam_config", + value: request.ipamConfig !== void 0 ? marshalPrivateNetworkIpamConfig(request.ipamConfig) : void 0 + } + ]) +}); +const marshalAclActionRedirect = (request, defaults) => ({ + code: request.code, + target: request.target, + type: request.type +}); +const marshalAclAction = (request, defaults) => ({ + redirect: request.redirect !== void 0 ? marshalAclActionRedirect(request.redirect) : void 0, + type: request.type +}); +const marshalAclMatch = (request, defaults) => ({ + http_filter: request.httpFilter, + http_filter_option: request.httpFilterOption, + http_filter_value: request.httpFilterValue, + invert: request.invert, + ip_subnet: request.ipSubnet +}); +const marshalCreateAclRequest = (request, defaults) => ({ + action: marshalAclAction(request.action), + description: request.description, + index: request.index, + match: request.match !== void 0 ? marshalAclMatch(request.match) : void 0, + name: request.name || randomName("acl") +}); +const marshalHealthCheckHttpConfig = (request, defaults) => ({ + code: request.code, + host_header: request.hostHeader, + method: request.method, + uri: request.uri +}); +const marshalHealthCheckHttpsConfig = (request, defaults) => ({ + code: request.code, + host_header: request.hostHeader, + method: request.method, + sni: request.sni, + uri: request.uri +}); +const marshalHealthCheckLdapConfig = (request, defaults) => ({}); +const marshalHealthCheckMysqlConfig = (request, defaults) => ({ + user: request.user +}); +const marshalHealthCheckPgsqlConfig = (request, defaults) => ({ + user: request.user +}); +const marshalHealthCheckRedisConfig = (request, defaults) => ({}); +const marshalHealthCheckTcpConfig = (request, defaults) => ({}); +const marshalHealthCheck = (request, defaults) => ({ + check_delay: request.checkDelay, + check_max_retries: request.checkMaxRetries, + check_send_proxy: request.checkSendProxy, + check_timeout: request.checkTimeout, + port: request.port, + transient_check_delay: request.transientCheckDelay, + ...marshalling.resolveOneOf([ + { + param: "tcp_config", + value: request.tcpConfig !== void 0 ? marshalHealthCheckTcpConfig(request.tcpConfig) : void 0 + }, + { + param: "mysql_config", + value: request.mysqlConfig !== void 0 ? marshalHealthCheckMysqlConfig(request.mysqlConfig) : void 0 + }, + { + param: "pgsql_config", + value: request.pgsqlConfig !== void 0 ? marshalHealthCheckPgsqlConfig(request.pgsqlConfig) : void 0 + }, + { + param: "ldap_config", + value: request.ldapConfig !== void 0 ? marshalHealthCheckLdapConfig(request.ldapConfig) : void 0 + }, + { + param: "redis_config", + value: request.redisConfig !== void 0 ? marshalHealthCheckRedisConfig(request.redisConfig) : void 0 + }, + { + param: "http_config", + value: request.httpConfig !== void 0 ? marshalHealthCheckHttpConfig(request.httpConfig) : void 0 + }, + { + param: "https_config", + value: request.httpsConfig !== void 0 ? marshalHealthCheckHttpsConfig(request.httpsConfig) : void 0 + } + ]) +}); +const marshalCreateBackendRequest = (request, defaults) => ({ + failover_host: request.failoverHost, + forward_port: request.forwardPort, + forward_port_algorithm: request.forwardPortAlgorithm, + forward_protocol: request.forwardProtocol, + health_check: marshalHealthCheck(request.healthCheck), + ignore_ssl_server_verify: request.ignoreSslServerVerify, + max_connections: request.maxConnections, + max_retries: request.maxRetries, + name: request.name || randomName("lbb"), + on_marked_down_action: request.onMarkedDownAction, + proxy_protocol: request.proxyProtocol, + redispatch_attempt_count: request.redispatchAttemptCount, + send_proxy_v2: request.sendProxyV2, + server_ip: request.serverIp, + ssl_bridging: request.sslBridging, + sticky_sessions: request.stickySessions, + sticky_sessions_cookie_name: request.stickySessionsCookieName, + timeout_connect: request.timeoutConnect, + timeout_queue: request.timeoutQueue, + timeout_server: request.timeoutServer, + timeout_tunnel: request.timeoutTunnel +}); +const marshalCreateCertificateRequestCustomCertificate = (request, defaults) => ({ + certificate_chain: request.certificateChain +}); +const marshalCreateCertificateRequestLetsencryptConfig = (request, defaults) => ({ + common_name: request.commonName, + subject_alternative_name: request.subjectAlternativeName +}); +const marshalCreateCertificateRequest = (request, defaults) => ({ + name: request.name || randomName("certificate"), + ...marshalling.resolveOneOf([ + { + param: "letsencrypt", + value: request.letsencrypt !== void 0 ? marshalCreateCertificateRequestLetsencryptConfig( + request.letsencrypt + ) : void 0 + }, + { + param: "custom_certificate", + value: request.customCertificate !== void 0 ? marshalCreateCertificateRequestCustomCertificate( + request.customCertificate + ) : void 0 + } + ]) +}); +const marshalCreateFrontendRequest = (request, defaults) => ({ + backend_id: request.backendId, + certificate_id: request.certificateId, + certificate_ids: request.certificateIds, + enable_http3: request.enableHttp3, + inbound_port: request.inboundPort, + name: request.name || randomName("lbf"), + timeout_client: request.timeoutClient +}); +const marshalCreateIpRequest = (request, defaults) => ({ + is_ipv6: request.isIpv6, + reverse: request.reverse, + tags: request.tags, + ...marshalling.resolveOneOf([ + { + default: defaults.defaultProjectId, + param: "project_id", + value: request.projectId + }, + { + default: defaults.defaultOrganizationId, + param: "organization_id", + value: request.organizationId + } + ]) +}); +const marshalCreateLbRequest = (request, defaults) => ({ + assign_flexible_ip: request.assignFlexibleIp, + assign_flexible_ipv6: request.assignFlexibleIpv6, + description: request.description, + ip_id: request.ipId, + ip_ids: request.ipIds, + name: request.name || randomName("lb"), + ssl_compatibility_level: request.sslCompatibilityLevel, + tags: request.tags, + type: request.type, + ...marshalling.resolveOneOf([ + { + default: defaults.defaultProjectId, + param: "project_id", + value: request.projectId + }, + { + default: defaults.defaultOrganizationId, + param: "organization_id", + value: request.organizationId + } + ]) +}); +const marshalRouteMatch = (request, defaults) => ({ + ...marshalling.resolveOneOf([ + { param: "sni", value: request.sni }, + { param: "host_header", value: request.hostHeader } + ]) +}); +const marshalCreateRouteRequest = (request, defaults) => ({ + backend_id: request.backendId, + frontend_id: request.frontendId, + match: request.match !== void 0 ? marshalRouteMatch(request.match) : void 0 +}); +const marshalSubscriberEmailConfig = (request, defaults) => ({ + email: request.email +}); +const marshalSubscriberWebhookConfig = (request, defaults) => ({ + uri: request.uri +}); +const marshalCreateSubscriberRequest = (request, defaults) => ({ name: request.name, - size: request.size, - volume_type: request.volumeType + ...marshalling.resolveOneOf([ + { + default: defaults.defaultProjectId, + param: "project_id", + value: request.projectId + }, + { + default: defaults.defaultOrganizationId, + param: "organization_id", + value: request.organizationId + } + ]), + ...marshalling.resolveOneOf([ + { + param: "email_config", + value: request.emailConfig !== void 0 ? marshalSubscriberEmailConfig(request.emailConfig) : void 0 + }, + { + param: "webhook_config", + value: request.webhookConfig !== void 0 ? marshalSubscriberWebhookConfig(request.webhookConfig) : void 0 + } + ]) }); -const marshalServerSummary = (request, defaults) => ({ - id: request.id, +const marshalMigrateLbRequest = (request, defaults) => ({ + type: request.type +}); +const marshalRemoveBackendServersRequest = (request, defaults) => ({ + server_ip: request.serverIp +}); +const marshalSetBackendServersRequest = (request, defaults) => ({ + server_ip: request.serverIp +}); +const marshalSubscribeToLbRequest = (request, defaults) => ({ + subscriber_id: request.subscriberId +}); +const marshalUpdateAclRequest = (request, defaults) => ({ + action: marshalAclAction(request.action), + description: request.description, + index: request.index, + match: request.match !== void 0 ? marshalAclMatch(request.match) : void 0, name: request.name }); -const marshalBootscript = (request, defaults) => ({ - arch: request.arch, - bootcmdargs: request.bootcmdargs, - default: request.default, - dtb: request.dtb, - id: request.id, - initrd: request.initrd, - kernel: request.kernel, - organization: request.organization, - project: request.project, - public: request.public, - title: request.title, - zone: request.zone +const marshalUpdateBackendRequest = (request, defaults) => ({ + failover_host: request.failoverHost, + forward_port: request.forwardPort, + forward_port_algorithm: request.forwardPortAlgorithm, + forward_protocol: request.forwardProtocol, + ignore_ssl_server_verify: request.ignoreSslServerVerify, + max_connections: request.maxConnections, + max_retries: request.maxRetries, + name: request.name, + on_marked_down_action: request.onMarkedDownAction, + proxy_protocol: request.proxyProtocol, + redispatch_attempt_count: request.redispatchAttemptCount, + send_proxy_v2: request.sendProxyV2, + ssl_bridging: request.sslBridging, + sticky_sessions: request.stickySessions, + sticky_sessions_cookie_name: request.stickySessionsCookieName, + timeout_connect: request.timeoutConnect, + timeout_queue: request.timeoutQueue, + timeout_server: request.timeoutServer, + timeout_tunnel: request.timeoutTunnel +}); +const marshalUpdateCertificateRequest = (request, defaults) => ({ + name: request.name +}); +const marshalUpdateFrontendRequest = (request, defaults) => ({ + backend_id: request.backendId, + certificate_id: request.certificateId, + certificate_ids: request.certificateIds, + enable_http3: request.enableHttp3, + inbound_port: request.inboundPort, + name: request.name, + timeout_client: request.timeoutClient +}); +const marshalUpdateHealthCheckRequest = (request, defaults) => ({ + check_delay: request.checkDelay, + check_max_retries: request.checkMaxRetries, + check_send_proxy: request.checkSendProxy, + check_timeout: request.checkTimeout, + port: request.port, + transient_check_delay: request.transientCheckDelay, + ...marshalling.resolveOneOf([ + { + param: "tcp_config", + value: request.tcpConfig !== void 0 ? marshalHealthCheckTcpConfig(request.tcpConfig) : void 0 + }, + { + param: "mysql_config", + value: request.mysqlConfig !== void 0 ? marshalHealthCheckMysqlConfig(request.mysqlConfig) : void 0 + }, + { + param: "pgsql_config", + value: request.pgsqlConfig !== void 0 ? marshalHealthCheckPgsqlConfig(request.pgsqlConfig) : void 0 + }, + { + param: "ldap_config", + value: request.ldapConfig !== void 0 ? marshalHealthCheckLdapConfig(request.ldapConfig) : void 0 + }, + { + param: "redis_config", + value: request.redisConfig !== void 0 ? marshalHealthCheckRedisConfig(request.redisConfig) : void 0 + }, + { + param: "http_config", + value: request.httpConfig !== void 0 ? marshalHealthCheckHttpConfig(request.httpConfig) : void 0 + }, + { + param: "https_config", + value: request.httpsConfig !== void 0 ? marshalHealthCheckHttpsConfig(request.httpsConfig) : void 0 + } + ]) +}); +const marshalUpdateIpRequest = (request, defaults) => ({ + lb_id: request.lbId, + reverse: request.reverse, + tags: request.tags +}); +const marshalUpdateLbRequest = (request, defaults) => ({ + description: request.description, + name: request.name, + ssl_compatibility_level: request.sslCompatibilityLevel, + tags: request.tags +}); +const marshalUpdateRouteRequest = (request, defaults) => ({ + backend_id: request.backendId, + match: request.match !== void 0 ? marshalRouteMatch(request.match) : void 0 +}); +const marshalUpdateSubscriberRequest = (request, defaults) => ({ + name: request.name, + ...marshalling.resolveOneOf([ + { + param: "email_config", + value: request.emailConfig !== void 0 ? marshalSubscriberEmailConfig(request.emailConfig) : void 0 + }, + { + param: "webhook_config", + value: request.webhookConfig !== void 0 ? marshalSubscriberWebhookConfig(request.webhookConfig) : void 0 + } + ]) +}); +const marshalZonedApiAddBackendServersRequest = (request, defaults) => ({ + server_ip: request.serverIp +}); +const marshalZonedApiAttachPrivateNetworkRequest = (request, defaults) => ({ + ipam_ids: request.ipamIds, + ...marshalling.resolveOneOf([ + { + param: "static_config", + value: request.staticConfig !== void 0 ? marshalPrivateNetworkStaticConfig(request.staticConfig) : void 0 + }, + { + param: "dhcp_config", + value: request.dhcpConfig !== void 0 ? marshalPrivateNetworkDHCPConfig(request.dhcpConfig) : void 0 + }, + { + param: "ipam_config", + value: request.ipamConfig !== void 0 ? marshalPrivateNetworkIpamConfig(request.ipamConfig) : void 0 + } + ]) +}); +const marshalZonedApiCreateAclRequest = (request, defaults) => ({ + action: marshalAclAction(request.action), + description: request.description, + index: request.index, + match: request.match !== void 0 ? marshalAclMatch(request.match) : void 0, + name: request.name || randomName("acl") +}); +const marshalZonedApiCreateBackendRequest = (request, defaults) => ({ + failover_host: request.failoverHost, + forward_port: request.forwardPort, + forward_port_algorithm: request.forwardPortAlgorithm, + forward_protocol: request.forwardProtocol, + health_check: marshalHealthCheck(request.healthCheck), + ignore_ssl_server_verify: request.ignoreSslServerVerify, + max_connections: request.maxConnections, + max_retries: request.maxRetries, + name: request.name || randomName("lbb"), + on_marked_down_action: request.onMarkedDownAction, + proxy_protocol: request.proxyProtocol, + redispatch_attempt_count: request.redispatchAttemptCount, + send_proxy_v2: request.sendProxyV2, + server_ip: request.serverIp, + ssl_bridging: request.sslBridging, + sticky_sessions: request.stickySessions, + sticky_sessions_cookie_name: request.stickySessionsCookieName, + timeout_connect: request.timeoutConnect, + timeout_queue: request.timeoutQueue, + timeout_server: request.timeoutServer, + timeout_tunnel: request.timeoutTunnel +}); +const marshalZonedApiCreateCertificateRequest = (request, defaults) => ({ + name: request.name || randomName("certificate"), + ...marshalling.resolveOneOf([ + { + param: "letsencrypt", + value: request.letsencrypt !== void 0 ? marshalCreateCertificateRequestLetsencryptConfig( + request.letsencrypt + ) : void 0 + }, + { + param: "custom_certificate", + value: request.customCertificate !== void 0 ? marshalCreateCertificateRequestCustomCertificate( + request.customCertificate + ) : void 0 + } + ]) +}); +const marshalZonedApiCreateFrontendRequest = (request, defaults) => ({ + backend_id: request.backendId, + certificate_id: request.certificateId, + certificate_ids: request.certificateIds, + enable_http3: request.enableHttp3, + inbound_port: request.inboundPort, + name: request.name || randomName("lbf"), + timeout_client: request.timeoutClient +}); +const marshalZonedApiCreateIpRequest = (request, defaults) => ({ + is_ipv6: request.isIpv6, + reverse: request.reverse, + tags: request.tags, + ...marshalling.resolveOneOf([ + { + default: defaults.defaultProjectId, + param: "project_id", + value: request.projectId + }, + { + default: defaults.defaultOrganizationId, + param: "organization_id", + value: request.organizationId + } + ]) +}); +const marshalZonedApiCreateLbRequest = (request, defaults) => ({ + assign_flexible_ip: request.assignFlexibleIp, + assign_flexible_ipv6: request.assignFlexibleIpv6, + description: request.description, + ip_id: request.ipId, + ip_ids: request.ipIds, + name: request.name || randomName("lb"), + ssl_compatibility_level: request.sslCompatibilityLevel, + tags: request.tags, + type: request.type, + ...marshalling.resolveOneOf([ + { + default: defaults.defaultProjectId, + param: "project_id", + value: request.projectId + }, + { + default: defaults.defaultOrganizationId, + param: "organization_id", + value: request.organizationId + } + ]) +}); +const marshalZonedApiCreateRouteRequest = (request, defaults) => ({ + backend_id: request.backendId, + frontend_id: request.frontendId, + match: request.match !== void 0 ? marshalRouteMatch(request.match) : void 0 +}); +const marshalZonedApiCreateSubscriberRequest = (request, defaults) => ({ + name: request.name, + ...marshalling.resolveOneOf([ + { + default: defaults.defaultProjectId, + param: "project_id", + value: request.projectId + }, + { + default: defaults.defaultOrganizationId, + param: "organization_id", + value: request.organizationId + } + ]), + ...marshalling.resolveOneOf([ + { + param: "email_config", + value: request.emailConfig !== void 0 ? marshalSubscriberEmailConfig(request.emailConfig) : void 0 + }, + { + param: "webhook_config", + value: request.webhookConfig !== void 0 ? marshalSubscriberWebhookConfig(request.webhookConfig) : void 0 + } + ]) +}); +const marshalZonedApiMigrateLbRequest = (request, defaults) => ({ + type: request.type +}); +const marshalZonedApiRemoveBackendServersRequest = (request, defaults) => ({ + server_ip: request.serverIp +}); +const marshalAclSpec = (request, defaults) => ({ + action: marshalAclAction(request.action), + description: request.description, + index: request.index, + match: request.match !== void 0 ? marshalAclMatch(request.match) : void 0, + name: request.name +}); +const marshalZonedApiSetAclsRequest = (request, defaults) => ({ + acls: request.acls.map((elt) => marshalAclSpec(elt)) +}); +const marshalZonedApiSetBackendServersRequest = (request, defaults) => ({ + server_ip: request.serverIp +}); +const marshalZonedApiSubscribeToLbRequest = (request, defaults) => ({ + subscriber_id: request.subscriberId +}); +const marshalZonedApiUpdateAclRequest = (request, defaults) => ({ + action: marshalAclAction(request.action), + description: request.description, + index: request.index, + match: request.match !== void 0 ? marshalAclMatch(request.match) : void 0, + name: request.name +}); +const marshalZonedApiUpdateBackendRequest = (request, defaults) => ({ + failover_host: request.failoverHost, + forward_port: request.forwardPort, + forward_port_algorithm: request.forwardPortAlgorithm, + forward_protocol: request.forwardProtocol, + ignore_ssl_server_verify: request.ignoreSslServerVerify, + max_connections: request.maxConnections, + max_retries: request.maxRetries, + name: request.name, + on_marked_down_action: request.onMarkedDownAction, + proxy_protocol: request.proxyProtocol, + redispatch_attempt_count: request.redispatchAttemptCount, + send_proxy_v2: request.sendProxyV2, + ssl_bridging: request.sslBridging, + sticky_sessions: request.stickySessions, + sticky_sessions_cookie_name: request.stickySessionsCookieName, + timeout_connect: request.timeoutConnect, + timeout_queue: request.timeoutQueue, + timeout_server: request.timeoutServer, + timeout_tunnel: request.timeoutTunnel +}); +const marshalZonedApiUpdateCertificateRequest = (request, defaults) => ({ + name: request.name +}); +const marshalZonedApiUpdateFrontendRequest = (request, defaults) => ({ + backend_id: request.backendId, + certificate_id: request.certificateId, + certificate_ids: request.certificateIds, + enable_http3: request.enableHttp3, + inbound_port: request.inboundPort, + name: request.name, + timeout_client: request.timeoutClient +}); +const marshalZonedApiUpdateHealthCheckRequest = (request, defaults) => ({ + check_delay: request.checkDelay, + check_max_retries: request.checkMaxRetries, + check_send_proxy: request.checkSendProxy, + check_timeout: request.checkTimeout, + port: request.port, + transient_check_delay: request.transientCheckDelay, + ...marshalling.resolveOneOf([ + { + param: "tcp_config", + value: request.tcpConfig !== void 0 ? marshalHealthCheckTcpConfig(request.tcpConfig) : void 0 + }, + { + param: "mysql_config", + value: request.mysqlConfig !== void 0 ? marshalHealthCheckMysqlConfig(request.mysqlConfig) : void 0 + }, + { + param: "pgsql_config", + value: request.pgsqlConfig !== void 0 ? marshalHealthCheckPgsqlConfig(request.pgsqlConfig) : void 0 + }, + { + param: "ldap_config", + value: request.ldapConfig !== void 0 ? marshalHealthCheckLdapConfig(request.ldapConfig) : void 0 + }, + { + param: "redis_config", + value: request.redisConfig !== void 0 ? marshalHealthCheckRedisConfig(request.redisConfig) : void 0 + }, + { + param: "http_config", + value: request.httpConfig !== void 0 ? marshalHealthCheckHttpConfig(request.httpConfig) : void 0 + }, + { + param: "https_config", + value: request.httpsConfig !== void 0 ? marshalHealthCheckHttpsConfig(request.httpsConfig) : void 0 + } + ]) }); -const marshalVolume = (request, defaults) => ({ - creation_date: request.creationDate, - export_uri: request.exportUri, - id: request.id, - modification_date: request.modificationDate, - name: request.name, - organization: request.organization, - project: request.project, - server: request.server ? marshalServerSummary(request.server) : undefined, - size: request.size, - state: request.state, - tags: request.tags, - volume_type: request.volumeType, - zone: request.zone +const marshalZonedApiUpdateIpRequest = (request, defaults) => ({ + lb_id: request.lbId, + reverse: request.reverse, + tags: request.tags }); -const marshalSetImageRequestWithID = (request, defaults) => ({ - arch: request.arch, - creation_date: request.creationDate, - default_bootscript: request.defaultBootscript ? marshalBootscript(request.defaultBootscript) : undefined, - extra_volumes: request.extraVolumes ? Object.entries(request.extraVolumes).reduce((acc, [key, value]) => ({ - ...acc, - [key]: marshalVolume(value) - }), {}) : undefined, - from_server: request.fromServer, - modification_date: request.modificationDate, - id: request.id, +const marshalZonedApiUpdateLbRequest = (request, defaults) => ({ + description: request.description, name: request.name, - organization: request.organization, - project: request.project, - public: request.public, - root_volume: request.rootVolume ? marshalVolumeSummary(request.rootVolume) : undefined, - state: request.state, + ssl_compatibility_level: request.sslCompatibilityLevel, tags: request.tags }); +const marshalZonedApiUpdateRouteRequest = (request, defaults) => ({ + backend_id: request.backendId, + match: request.match !== void 0 ? marshalRouteMatch(request.match) : void 0 +}); +const marshalZonedApiUpdateSubscriberRequest = (request, defaults) => ({ + name: request.name, + ...marshalling.resolveOneOf([ + { + param: "email_config", + value: request.emailConfig !== void 0 ? marshalSubscriberEmailConfig(request.emailConfig) : void 0 + }, + { + param: "webhook_config", + value: request.webhookConfig !== void 0 ? marshalSubscriberWebhookConfig(request.webhookConfig) : void 0 + } + ]) +}); +exports.marshalAddBackendServersRequest = marshalAddBackendServersRequest; +exports.marshalAttachPrivateNetworkRequest = marshalAttachPrivateNetworkRequest; +exports.marshalCreateAclRequest = marshalCreateAclRequest; +exports.marshalCreateBackendRequest = marshalCreateBackendRequest; +exports.marshalCreateCertificateRequest = marshalCreateCertificateRequest; +exports.marshalCreateFrontendRequest = marshalCreateFrontendRequest; +exports.marshalCreateIpRequest = marshalCreateIpRequest; +exports.marshalCreateLbRequest = marshalCreateLbRequest; +exports.marshalCreateRouteRequest = marshalCreateRouteRequest; +exports.marshalCreateSubscriberRequest = marshalCreateSubscriberRequest; +exports.marshalMigrateLbRequest = marshalMigrateLbRequest; +exports.marshalRemoveBackendServersRequest = marshalRemoveBackendServersRequest; +exports.marshalSetBackendServersRequest = marshalSetBackendServersRequest; +exports.marshalSubscribeToLbRequest = marshalSubscribeToLbRequest; +exports.marshalUpdateAclRequest = marshalUpdateAclRequest; +exports.marshalUpdateBackendRequest = marshalUpdateBackendRequest; +exports.marshalUpdateCertificateRequest = marshalUpdateCertificateRequest; +exports.marshalUpdateFrontendRequest = marshalUpdateFrontendRequest; +exports.marshalUpdateHealthCheckRequest = marshalUpdateHealthCheckRequest; +exports.marshalUpdateIpRequest = marshalUpdateIpRequest; +exports.marshalUpdateLbRequest = marshalUpdateLbRequest; +exports.marshalUpdateRouteRequest = marshalUpdateRouteRequest; +exports.marshalUpdateSubscriberRequest = marshalUpdateSubscriberRequest; +exports.marshalZonedApiAddBackendServersRequest = marshalZonedApiAddBackendServersRequest; +exports.marshalZonedApiAttachPrivateNetworkRequest = marshalZonedApiAttachPrivateNetworkRequest; +exports.marshalZonedApiCreateAclRequest = marshalZonedApiCreateAclRequest; +exports.marshalZonedApiCreateBackendRequest = marshalZonedApiCreateBackendRequest; +exports.marshalZonedApiCreateCertificateRequest = marshalZonedApiCreateCertificateRequest; +exports.marshalZonedApiCreateFrontendRequest = marshalZonedApiCreateFrontendRequest; +exports.marshalZonedApiCreateIpRequest = marshalZonedApiCreateIpRequest; +exports.marshalZonedApiCreateLbRequest = marshalZonedApiCreateLbRequest; +exports.marshalZonedApiCreateRouteRequest = marshalZonedApiCreateRouteRequest; +exports.marshalZonedApiCreateSubscriberRequest = marshalZonedApiCreateSubscriberRequest; +exports.marshalZonedApiMigrateLbRequest = marshalZonedApiMigrateLbRequest; +exports.marshalZonedApiRemoveBackendServersRequest = marshalZonedApiRemoveBackendServersRequest; +exports.marshalZonedApiSetAclsRequest = marshalZonedApiSetAclsRequest; +exports.marshalZonedApiSetBackendServersRequest = marshalZonedApiSetBackendServersRequest; +exports.marshalZonedApiSubscribeToLbRequest = marshalZonedApiSubscribeToLbRequest; +exports.marshalZonedApiUpdateAclRequest = marshalZonedApiUpdateAclRequest; +exports.marshalZonedApiUpdateBackendRequest = marshalZonedApiUpdateBackendRequest; +exports.marshalZonedApiUpdateCertificateRequest = marshalZonedApiUpdateCertificateRequest; +exports.marshalZonedApiUpdateFrontendRequest = marshalZonedApiUpdateFrontendRequest; +exports.marshalZonedApiUpdateHealthCheckRequest = marshalZonedApiUpdateHealthCheckRequest; +exports.marshalZonedApiUpdateIpRequest = marshalZonedApiUpdateIpRequest; +exports.marshalZonedApiUpdateLbRequest = marshalZonedApiUpdateLbRequest; +exports.marshalZonedApiUpdateRouteRequest = marshalZonedApiUpdateRouteRequest; +exports.marshalZonedApiUpdateSubscriberRequest = marshalZonedApiUpdateSubscriberRequest; +exports.unmarshalAcl = unmarshalAcl; +exports.unmarshalBackend = unmarshalBackend; +exports.unmarshalBackendServerStats = unmarshalBackendServerStats; +exports.unmarshalCertificate = unmarshalCertificate; +exports.unmarshalFrontend = unmarshalFrontend; +exports.unmarshalHealthCheck = unmarshalHealthCheck; +exports.unmarshalIp = unmarshalIp; +exports.unmarshalLb = unmarshalLb; +exports.unmarshalLbStats = unmarshalLbStats; +exports.unmarshalListAclResponse = unmarshalListAclResponse; +exports.unmarshalListBackendStatsResponse = unmarshalListBackendStatsResponse; +exports.unmarshalListBackendsResponse = unmarshalListBackendsResponse; +exports.unmarshalListCertificatesResponse = unmarshalListCertificatesResponse; +exports.unmarshalListFrontendsResponse = unmarshalListFrontendsResponse; +exports.unmarshalListIpsResponse = unmarshalListIpsResponse; +exports.unmarshalListLbPrivateNetworksResponse = unmarshalListLbPrivateNetworksResponse; +exports.unmarshalListLbTypesResponse = unmarshalListLbTypesResponse; +exports.unmarshalListLbsResponse = unmarshalListLbsResponse; +exports.unmarshalListRoutesResponse = unmarshalListRoutesResponse; +exports.unmarshalListSubscriberResponse = unmarshalListSubscriberResponse; +exports.unmarshalPrivateNetwork = unmarshalPrivateNetwork; +exports.unmarshalRoute = unmarshalRoute; +exports.unmarshalSetAclsResponse = unmarshalSetAclsResponse; +exports.unmarshalSubscriber = unmarshalSubscriber; -const validateNotUndefined = obj => { - if (obj === undefined) throw new TypeError(`object was found undefined`); - return obj; + +/***/ }), + +/***/ 9579: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const index_gen = __nccwpck_require__(4604); +exports.v1beta1 = index_gen; + + +/***/ }), + +/***/ 5040: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const intervalRetrier = __nccwpck_require__(9052); +const api = __nccwpck_require__(3042); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const resourcePaginator = __nccwpck_require__(4983); +const content_gen = __nccwpck_require__(2867); +const marshalling_gen = __nccwpck_require__(4778); +const jsonContentHeaders = { + "Content-Type": "application/json; charset=utf-8" }; -class InstanceV1UtilsAPI extends API$h { +class API extends api.API { + /** Lists the available regions of the API. */ + static LOCALITIES = ["fr-par"]; + pageOfListDeployments = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/llm-inference/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments`, + urlParams: marshalling.urlParams( + ["name", request.name], + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId], + ["tags", request.tags] + ) + }, + marshalling_gen.unmarshalListDeploymentsResponse + ); /** - * Waits for {@link Image} to be in a final state. + * List inference deployments. List all your inference deployments. * - * @param request - The request {@link GetImageRequest} - * @param options - The waiting options - * @returns A Promise of Image + * @param request - The request {@link ListDeploymentsRequest} + * @returns A Promise of ListDeploymentsResponse */ - waitForImage = (request, options) => tryAtIntervals(async () => { - const value = await this.getImage(request).then(res => res.image); - return { - done: !IMAGE_TRANSIENT_STATUSES$1.includes(value.state), - value - }; - }, createExponentialBackoffStrategy(options?.minDelay ?? 1, options?.maxDelay ?? 30), options?.timeout); - + listDeployments = (request = {}) => resourcePaginator.enrichForPagination("deployments", this.pageOfListDeployments, request); /** - * Waits for {@link PrivateNIC} to be in a final state. + * Get a deployment. Get the deployment for the given ID. * - * @param request - The request {@link GetPrivateNICRequest} - * @param options - The waiting options - * @returns A Promise of PrivateNIC + * @param request - The request {@link GetDeploymentRequest} + * @returns A Promise of Deployment */ - waitForPrivateNIC = (request, options) => tryAtIntervals(async () => { - const value = await this.getPrivateNIC(request).then(res => res.privateNic); - return { - done: !PRIVATE_NIC_TRANSIENT_STATUSES.includes(value.state), - value - }; - }, createExponentialBackoffStrategy(options?.minDelay ?? 1, options?.maxDelay ?? 30), options?.timeout); - + getDeployment = (request) => this.client.fetch( + { + method: "GET", + path: `/llm-inference/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${marshalling.validatePathParam("deploymentId", request.deploymentId)}` + }, + marshalling_gen.unmarshalDeployment + ); /** - * Waits for {@link Server} to be in a final state. + * Waits for {@link Deployment} to be in a final state. * - * @param request - The request {@link GetServerRequest} + * @param request - The request {@link GetDeploymentRequest} * @param options - The waiting options - * @returns A Promise of Server + * @returns A Promise of Deployment + */ + waitForDeployment = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve(!content_gen.DEPLOYMENT_TRANSIENT_STATUSES.includes(res.status))), + this.getDeployment, + request, + options + ); + /** + * Create a deployment. Create a new inference deployment related to a + * specific model. + * + * @param request - The request {@link CreateDeploymentRequest} + * @returns A Promise of Deployment + */ + createDeployment = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateDeploymentRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/llm-inference/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments` + }, + marshalling_gen.unmarshalDeployment + ); + /** + * Update a deployment. Update an existing inference deployment. + * + * @param request - The request {@link UpdateDeploymentRequest} + * @returns A Promise of Deployment + */ + updateDeployment = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateDeploymentRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/llm-inference/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${marshalling.validatePathParam("deploymentId", request.deploymentId)}` + }, + marshalling_gen.unmarshalDeployment + ); + /** + * Delete a deployment. Delete an existing inference deployment. + * + * @param request - The request {@link DeleteDeploymentRequest} + * @returns A Promise of Deployment */ - waitForServer = (request, options) => tryAtIntervals(async () => { - const value = await this.getServer(request).then(res => res.server); - return { - done: !SERVER_TRANSIENT_STATUSES.includes(value.state), - value - }; - }, createExponentialBackoffStrategy(options?.minDelay ?? 1, options?.maxDelay ?? 30), options?.timeout); - + deleteDeployment = (request) => this.client.fetch( + { + method: "DELETE", + path: `/llm-inference/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${marshalling.validatePathParam("deploymentId", request.deploymentId)}` + }, + marshalling_gen.unmarshalDeployment + ); /** - * Waits for {@link Server} to be in a final state. + * Get the CA certificate. Get the CA certificate used for the deployment of + * private endpoints. The CA certificate will be returned as a PEM file. * - * @param request - The request {@link GetServerRequest} - * @param options - The waiting options - * @returns A Promise of Server + * @param request - The request {@link GetDeploymentCertificateRequest} + * @returns A Promise of Blob */ - waitForSnapshot = (request, options) => tryAtIntervals(async () => { - const value = await this.getSnapshot(request).then(res => res.snapshot); - return { - done: !SNAPSHOT_TRANSIENT_STATUSES$1.includes(value.state), - value - }; - }, createExponentialBackoffStrategy(options?.minDelay ?? 1, options?.maxDelay ?? 30), options?.timeout); - + getDeploymentCertificate = (request) => this.client.fetch({ + method: "GET", + path: `/llm-inference/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${marshalling.validatePathParam("deploymentId", request.deploymentId)}/certificate`, + urlParams: marshalling.urlParams(["dl", 1]), + responseType: "blob" + }); /** - * Waits for {@link Volume} to be in a final state. + * Create an endpoint. Create a new Endpoint related to a specific deployment. * - * @param request - The request {@link GetVolumeRequest} - * @param options - The waiting options - * @returns A Promise of Volume + * @param request - The request {@link CreateEndpointRequest} + * @returns A Promise of Endpoint */ - waitForVolume = (request, options) => tryAtIntervals(async () => { - const value = await this.getVolume(request).then(res => res.volume); - return { - done: !VOLUME_TRANSIENT_STATUSES.includes(value.state), - value - }; - }, createExponentialBackoffStrategy(options?.minDelay ?? 1, options?.maxDelay ?? 30), options?.timeout); - + createEndpoint = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateEndpointRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/llm-inference/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/endpoints` + }, + marshalling_gen.unmarshalEndpoint + ); /** - * Updates a snapshot. + * Update an endpoint. Update an existing Endpoint. * - * @param request - The request {@link UpdateSnapshotRequest} - * @returns A Promise of UpdateSnapshotResponse + * @param request - The request {@link UpdateEndpointRequest} + * @returns A Promise of Endpoint */ - updateSnapshot = request => this.getSnapshot(request).then(res => validateNotUndefined(res.snapshot)).then(snapshot => this._setSnapshot({ - ...snapshot, - name: request.name ?? snapshot.name, - snapshotId: snapshot.id - })).then(res => ({ - snapshot: res.snapshot - })); - + updateEndpoint = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateEndpointRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/llm-inference/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/endpoints/${marshalling.validatePathParam("endpointId", request.endpointId)}` + }, + marshalling_gen.unmarshalEndpoint + ); /** - * Updates a security group. + * Delete an endpoint. Delete an existing Endpoint. * - * @param request - The request {@link UpdateSecurityGroupRequest} - * @returns A Promise of UpdateSecurityGroupResponse + * @param request - The request {@link DeleteEndpointRequest} */ - updateSecurityGroup = request => this.getSecurityGroup({ - securityGroupId: request.securityGroupId, - zone: request.zone - }).then(res => validateNotUndefined(res.securityGroup)).then(securityGroup => this._setSecurityGroup({ - creationDate: securityGroup.creationDate, - description: request.description ?? securityGroup.description, - enableDefaultSecurity: request.enableDefaultSecurity ?? securityGroup.enableDefaultSecurity, - id: securityGroup.id, - inboundDefaultPolicy: request.inboundDefaultPolicy ?? securityGroup.inboundDefaultPolicy, - modificationDate: securityGroup.modificationDate, - name: request.name ?? securityGroup.name, - organization: securityGroup.organization, - organizationDefault: request.organizationDefault ?? securityGroup.organizationDefault, - outboundDefaultPolicy: request.outboundDefaultPolicy ?? securityGroup.outboundDefaultPolicy, - project: securityGroup.project, - projectDefault: request.projectDefault ?? securityGroup.projectDefault, - servers: securityGroup.servers, - stateful: request.stateful ?? securityGroup.stateful, - zone: request.zone - })).then(res => ({ - securityGroup: res.securityGroup - })); - - /** - * Updates a security group rule. + deleteEndpoint = (request) => this.client.fetch({ + method: "DELETE", + path: `/llm-inference/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/endpoints/${marshalling.validatePathParam("endpointId", request.endpointId)}` + }); + pageOfListDeploymentACLRules = (request) => this.client.fetch( + { + method: "GET", + path: `/llm-inference/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${marshalling.validatePathParam("deploymentId", request.deploymentId)}/acls`, + urlParams: marshalling.urlParams( + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListDeploymentACLRulesResponse + ); + /** + * List your ACLs. List ACLs for a specific deployment. * - * @param request - The request {@link UpdateSecurityGroupRuleRequest} - * @returns A Promise of UpdateSecurityGroupRuleResponse + * @param request - The request {@link ListDeploymentACLRulesRequest} + * @returns A Promise of ListDeploymentACLRulesResponse */ - updateSecurityGroupRule = request => this.getSecurityGroupRule({ - securityGroupId: request.securityGroupId, - securityGroupRuleId: request.securityGroupRuleId, - zone: request.zone - }).then(res => validateNotUndefined(res.rule)).then(rule => { - let sReq = { - action: request.action ?? rule.action, - destPortFrom: rule.destPortFrom, - destPortTo: rule.destPortTo, - direction: request.direction ?? rule.direction, - editable: rule.editable, - id: request.securityGroupRuleId, - ipRange: request.ipRange ?? rule.ipRange, - position: request.position ?? rule.position, - protocol: request.protocol ?? rule.protocol, - securityGroupId: request.securityGroupId, - securityGroupRuleId: request.securityGroupRuleId - }; - if (request.destPortFrom) { - sReq = { - ...sReq, - destPortFrom: request.destPortFrom > 0 ? request.destPortFrom : undefined - }; - } - if (request.destPortTo) { - sReq = { - ...sReq, - destPortTo: request.destPortTo > 0 ? request.destPortTo : undefined - }; - } - if (sReq.destPortFrom && sReq.destPortTo && sReq.destPortFrom === sReq.destPortTo) { - sReq = { - ...sReq, - destPortTo: undefined - }; - } - // When we use ICMP protocol portFrom and portTo should be set to nil - if (request.protocol === 'ICMP') { - sReq = { - ...sReq, - destPortFrom: undefined, - destPortTo: undefined - }; - } - return this._setSecurityGroupRule(sReq); - }).then(res => ({ - rule: res.rule - })); - + listDeploymentACLRules = (request) => resourcePaginator.enrichForPagination("rules", this.pageOfListDeploymentACLRules, request); /** - * Updates a server. + * Add new ACLs. Add new ACL rules for a specific deployment. * - * @param request - The request {@link UpdateServerRequest} - * @returns A Promise of UpdateServerResponse + * @param request - The request {@link AddDeploymentACLRulesRequest} + * @returns A Promise of AddDeploymentACLRulesResponse */ - updateServer = request => this._updateServer(request); - + addDeploymentACLRules = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalAddDeploymentACLRulesRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/llm-inference/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${marshalling.validatePathParam("deploymentId", request.deploymentId)}/acls` + }, + marshalling_gen.unmarshalAddDeploymentACLRulesResponse + ); + /** + * Set new ACL. Set new ACL rules for a specific deployment. + * + * @param request - The request {@link SetDeploymentACLRulesRequest} + * @returns A Promise of SetDeploymentACLRulesResponse + */ + setDeploymentACLRules = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalSetDeploymentACLRulesRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PUT", + path: `/llm-inference/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deployments/${marshalling.validatePathParam("deploymentId", request.deploymentId)}/acls` + }, + marshalling_gen.unmarshalSetDeploymentACLRulesResponse + ); /** - * Creates a server. + * Delete an exising ACL. * - * @param request - The request {@link CreateServerRequest} - * @returns A Promise of CreateServerResponse + * @param request - The request {@link DeleteDeploymentACLRuleRequest} */ - createServer = request => this._createServer(request); - + deleteDeploymentACLRule = (request) => this.client.fetch({ + method: "DELETE", + path: `/llm-inference/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/acls/${marshalling.validatePathParam("aclId", request.aclId)}` + }); + pageOfListModels = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/llm-inference/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/models`, + urlParams: marshalling.urlParams( + ["name", request.name], + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId], + ["tags", request.tags] + ) + }, + marshalling_gen.unmarshalListModelsResponse + ); /** - * Starts an action and wait for the server to be in the correct "terminal - * state" expected by this action. + * List models. List all available models. * - * @param request - The request {@link ServerActionRequest} - * @returns A Promise of Server + * @param request - The request {@link ListModelsRequest} + * @returns A Promise of ListModelsResponse */ - serverActionAndWait = async (request, options) => { - const finalServer = await this.serverAction(request).then(() => this.waitForServer({ - serverId: request.serverId, - zone: request.zone - }, options)); - - // Check the action was properly executed. - let expectedState; - switch (request.action) { - case 'poweron': - case 'reboot': - expectedState = 'running'; - break; - case 'poweroff': - expectedState = 'stopped'; - break; - case 'stop_in_place': - expectedState = 'stopped in place'; - break; - } - if (expectedState && finalServer.state !== expectedState) { - throw new Error(`expected state ${expectedState} but found ${finalServer.state}: ${finalServer.stateDetail}`); - } - return finalServer; - }; - + listModels = (request = {}) => resourcePaginator.enrichForPagination("models", this.pageOfListModels, request); /** - * Attaches a volume to a server. + * Get a model. Get the model for the given ID. * - * @param request - The request {@link AttachVolumeRequest} - * @returns A Promise of AttachVolumeResponse + * @param request - The request {@link GetModelRequest} + * @returns A Promise of Model */ - attachVolume = async request => { - const volumes = await this.getServer({ - serverId: request.serverId, - zone: request.zone - }).then(res => validateNotUndefined(res.server?.volumes)); - const newVolumes = {}; - for (const [key, server] of Object.entries(volumes)) { - newVolumes[key] = { - id: server.id, - name: server.name - }; - } + getModel = (request) => this.client.fetch( + { + method: "GET", + path: `/llm-inference/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/models/${marshalling.validatePathParam("modelId", request.modelId)}` + }, + marshalling_gen.unmarshalModel + ); + getModelEula = (request) => this.client.fetch( + { + method: "GET", + path: `/llm-inference/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/models/${marshalling.validatePathParam("modelId", request.modelId)}/eula` + }, + marshalling_gen.unmarshalEula + ); + pageOfListNodeTypes = (request) => this.client.fetch( + { + method: "GET", + path: `/llm-inference/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/node-types`, + urlParams: marshalling.urlParams( + ["include_disabled_types", request.includeDisabledTypes], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListNodeTypesResponse + ); + /** + * List available node types. List all available node types. By default, the + * node types returned in the list are ordered by creation date in ascending + * order, though this can be modified via the `order_by` field. + * + * @param request - The request {@link ListNodeTypesRequest} + * @returns A Promise of ListNodeTypesResponse + */ + listNodeTypes = (request) => resourcePaginator.enrichForPagination("nodeTypes", this.pageOfListNodeTypes, request); +} +exports.API = API; - // We loop through all the possible volume keys (0 to len(volumes)) - // to find a non existing key and assign it to the requested volume. - // A key should always be found. However we return an error if no keys were found. - let found = false; - const volumesLength = Object.keys(volumes).length; - for (let index = 0; index <= volumesLength; index += 1) { - const key = index.toString(); - if (!(key in newVolumes)) { - newVolumes[key] = { - id: request.volumeId, - name: request.volumeId // name is ignored on this PATCH - }; - found = true; - break; - } - } - if (!found) { - throw new Error(`could not find key to attach volume ${request.volumeId}`); - } +/***/ }), - // Update server - return this.updateServer({ - serverId: request.serverId, - volumes: newVolumes, - zone: request.zone - }).then(obj => obj); - }; +/***/ 2867: +/***/ ((__unused_webpack_module, exports) => { - /** - * Detaches a volume from a server. - * - * @param request - The request {@link DetachVolumeRequest} - * @returns A Promise of DetachVolumeResponse - */ - detachVolume = async request => { - // Get server and related volumes. - const server = await this.getVolume({ - volumeId: request.volumeId, - zone: request.zone - }).then(res => validateNotUndefined(res.volume?.server?.id)).then(serverId => this.getServer({ - serverId, - zone: request.zone - })).then(res => validateNotUndefined(res.server)); +"use strict"; - // Remove volume. - const newVolumes = {}; - for (const [key, volume] of Object.entries(server.volumes)) { - if (volume.id !== request.volumeId) { - newVolumes[key] = { - id: volume.id, - name: volume.name - }; - } - } +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const DEPLOYMENT_TRANSIENT_STATUSES = [ + "creating", + "deploying", + "deleting" +]; +exports.DEPLOYMENT_TRANSIENT_STATUSES = DEPLOYMENT_TRANSIENT_STATUSES; - // Update server. - return this.updateServer({ - serverId: server.id, - volumes: newVolumes, - zone: request.zone - }).then(obj => obj); - }; - /** - * Updates an image. - * - * @param request - The request {@link UpdateImageRequest} - * @returns A Promise of UpdateImageResponse - */ - updateImage = request => this.getImage({ - zone: request.zone, - imageId: request.imageId - }).then(res => validateNotUndefined(res.image)).then(image => ({ - ...image, - name: request.name ?? image.name, - tags: request.tags ?? image.tags, - id: image.id - })).then(imageReq => this.client.fetch({ - body: JSON.stringify(marshalSetImageRequestWithID(imageReq, this.client.settings)), - headers: { - 'Content-Type': 'application/json; charset=utf-8' - }, - method: 'PUT', - path: `/instance/v1/zones/${validatePathParam('zone', imageReq.zone)}/images/${validatePathParam('id', imageReq.id)}` - }, unmarshalSetImageResponse)).then(res => ({ - image: res.image - })); +/***/ }), - /** - * Get the content of a user data on a server for the given key. - * - * @param request - The request {@link GetServerUserDataRequest} - * @returns The content of the key - */ - getServerUserData = request => this.client.fetch({ - method: 'GET', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/user_data/${validatePathParam('key', request.key)}` - }); +/***/ 4604: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - /** - * Sets the content of a user data on a server for the given key. - * - * @param request - The request {@link SetServerUserDataRequest} - */ - setServerUserData = request => this.client.fetch({ - body: request.content, - headers: { - 'Content-Type': 'text/plain' - }, - method: 'PATCH', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/user_data/${validatePathParam('key', request.key)}` - }); -} +"use strict"; -var index$i = /*#__PURE__*/Object.freeze({ - __proto__: null, - API: InstanceV1UtilsAPI, - IMAGE_TRANSIENT_STATUSES: IMAGE_TRANSIENT_STATUSES$1, - IP_TRANSIENT_STATUSES: IP_TRANSIENT_STATUSES, - PRIVATE_NIC_TRANSIENT_STATUSES: PRIVATE_NIC_TRANSIENT_STATUSES, - SECURITY_GROUP_TRANSIENT_STATUSES: SECURITY_GROUP_TRANSIENT_STATUSES, - SERVER_TRANSIENT_STATUSES: SERVER_TRANSIENT_STATUSES, - SNAPSHOT_TRANSIENT_STATUSES: SNAPSHOT_TRANSIENT_STATUSES$1, - TASK_TRANSIENT_STATUSES: TASK_TRANSIENT_STATUSES, - VOLUME_SERVER_TRANSIENT_STATUSES: VOLUME_SERVER_TRANSIENT_STATUSES, - VOLUME_TRANSIENT_STATUSES: VOLUME_TRANSIENT_STATUSES -}); +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api_gen = __nccwpck_require__(5040); +const content_gen = __nccwpck_require__(2867); +const validationRules_gen = __nccwpck_require__(3595); +exports.API = api_gen.API; +exports.DEPLOYMENT_TRANSIENT_STATUSES = content_gen.DEPLOYMENT_TRANSIENT_STATUSES; +exports.ValidationRules = validationRules_gen; -var index$h = /*#__PURE__*/Object.freeze({ - __proto__: null, - v1: index$i -}); -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. +/***/ }), + +/***/ 4778: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/** Lists transient statutes of the enum {@link HubStatus}. */ -const HUB_TRANSIENT_STATUSES = ['enabling', 'disabling']; +"use strict"; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const unmarshalDeviceMessageFiltersRule = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'DeviceMessageFiltersRule' failed as data isn't a dictionary.`); +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const randomName = __nccwpck_require__(8141); +const json = __nccwpck_require__(3746); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const unmarshalEndpointPrivateNetworkDetails = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'EndpointPrivateNetworkDetails' failed as data isn't a dictionary.` + ); } return { - policy: data.policy, - topics: data.topics + privateNetworkId: data.private_network_id }; }; -const unmarshalDeviceMessageFilters = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'DeviceMessageFilters' failed as data isn't a dictionary.`); +const unmarshalEndpointPublicAccessDetails = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'EndpointPublicAccessDetails' failed as data isn't a dictionary.` + ); + } + return {}; +}; +const unmarshalEndpoint = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Endpoint' failed as data isn't a dictionary.` + ); } return { - publish: data.publish ? unmarshalDeviceMessageFiltersRule(data.publish) : undefined, - subscribe: data.subscribe ? unmarshalDeviceMessageFiltersRule(data.subscribe) : undefined + disableAuth: data.disable_auth, + id: data.id, + privateNetwork: data.private_network ? unmarshalEndpointPrivateNetworkDetails(data.private_network) : void 0, + publicAccess: data.public_access ? unmarshalEndpointPublicAccessDetails(data.public_access) : void 0, + url: data.url }; }; -const unmarshalHubTwinsGraphiteConfig = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'HubTwinsGraphiteConfig' failed as data isn't a dictionary.`); +const unmarshalDeployment = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Deployment' failed as data isn't a dictionary.` + ); } return { - pushUri: data.push_uri + createdAt: marshalling.unmarshalDate(data.created_at), + endpoints: marshalling.unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint), + errorMessage: data.error_message, + id: data.id, + maxSize: data.max_size, + minSize: data.min_size, + modelName: data.model_name, + name: data.name, + nodeType: data.node_type, + projectId: data.project_id, + region: data.region, + size: data.size, + status: data.status, + tags: data.tags, + updatedAt: marshalling.unmarshalDate(data.updated_at) }; }; -const unmarshalCertificate$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Certificate' failed as data isn't a dictionary.`); +const unmarshalModelS3Model = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ModelS3Model' failed as data isn't a dictionary.` + ); } return { - crt: data.crt, - key: data.key + nodeType: data.node_type, + pythonDependencies: data.python_dependencies, + s3Url: data.s3_url, + tritonServerVersion: data.triton_server_version }; }; -const unmarshalDevice = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Device' failed as data isn't a dictionary.`); +const unmarshalModel = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Model' failed as data isn't a dictionary.` + ); } return { - allowInsecure: data.allow_insecure, - allowMultipleConnections: data.allow_multiple_connections, - createdAt: unmarshalDate(data.created_at), + compatibleNodeTypes: data.compatible_node_types, + createdAt: marshalling.unmarshalDate(data.created_at), description: data.description, - hasCustomCertificate: data.has_custom_certificate, - hubId: data.hub_id, + hasEula: data.has_eula, id: data.id, - isConnected: data.is_connected, - lastActivityAt: unmarshalDate(data.last_activity_at), - messageFilters: data.message_filters ? unmarshalDeviceMessageFilters(data.message_filters) : undefined, + isPublic: data.is_public, name: data.name, - status: data.status, - updatedAt: unmarshalDate(data.updated_at) + projectId: data.project_id, + provider: data.provider, + quantizationLevel: data.quantization_level, + region: data.region, + s3Model: data.s3_model ? unmarshalModelS3Model(data.s3_model) : void 0, + tags: data.tags, + updatedAt: marshalling.unmarshalDate(data.updated_at) }; }; -const unmarshalHub = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Hub' failed as data isn't a dictionary.`); +const unmarshalACLRule = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ACLRule' failed as data isn't a dictionary.` + ); } return { - connectedDeviceCount: data.connected_device_count, - createdAt: unmarshalDate(data.created_at), - deviceCount: data.device_count, - disableEvents: data.disable_events, - enabled: data.enabled, - enableDeviceAutoProvisioning: data.enable_device_auto_provisioning, - endpoint: data.endpoint, - eventsTopicPrefix: data.events_topic_prefix, - hasCustomCa: data.has_custom_ca, + description: data.description, id: data.id, + ip: data.ip + }; +}; +const unmarshalAddDeploymentACLRulesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'AddDeploymentACLRulesResponse' failed as data isn't a dictionary.` + ); + } + return { + rules: marshalling.unmarshalArrayOfObject(data.rules, unmarshalACLRule) + }; +}; +const unmarshalEula = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Eula' failed as data isn't a dictionary.` + ); + } + return { + content: data.content + }; +}; +const unmarshalListDeploymentACLRulesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListDeploymentACLRulesResponse' failed as data isn't a dictionary.` + ); + } + return { + rules: marshalling.unmarshalArrayOfObject(data.rules, unmarshalACLRule), + totalCount: data.total_count + }; +}; +const unmarshalListDeploymentsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListDeploymentsResponse' failed as data isn't a dictionary.` + ); + } + return { + deployments: marshalling.unmarshalArrayOfObject(data.deployments, unmarshalDeployment), + totalCount: data.total_count + }; +}; +const unmarshalListModelsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListModelsResponse' failed as data isn't a dictionary.` + ); + } + return { + models: marshalling.unmarshalArrayOfObject(data.models, unmarshalModel), + totalCount: data.total_count + }; +}; +const unmarshalNodeType = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'NodeType' failed as data isn't a dictionary.` + ); + } + return { + beta: data.beta, + createdAt: marshalling.unmarshalDate(data.created_at), + description: data.description, + disabled: data.disabled, + gpus: data.gpus, + memory: data.memory, name: data.name, - organizationId: data.organization_id, - productPlan: data.product_plan, - projectId: data.project_id, region: data.region, - status: data.status, - twinsGraphiteConfig: data.twins_graphite_config ? unmarshalHubTwinsGraphiteConfig(data.twins_graphite_config) : undefined, - updatedAt: unmarshalDate(data.updated_at) + stockStatus: data.stock_status, + updatedAt: marshalling.unmarshalDate(data.updated_at), + vcpus: data.vcpus, + vram: data.vram }; }; -const unmarshalListTwinDocumentsResponseDocumentSummary = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListTwinDocumentsResponseDocumentSummary' failed as data isn't a dictionary.`); +const unmarshalListNodeTypesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListNodeTypesResponse' failed as data isn't a dictionary.` + ); } return { - documentName: data.document_name + nodeTypes: marshalling.unmarshalArrayOfObject(data.node_types, unmarshalNodeType), + totalCount: data.total_count }; }; -const unmarshalNetwork = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Network' failed as data isn't a dictionary.`); +const unmarshalSetDeploymentACLRulesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SetDeploymentACLRulesResponse' failed as data isn't a dictionary.` + ); + } + return { + rules: marshalling.unmarshalArrayOfObject(data.rules, unmarshalACLRule) + }; +}; +const marshalACLRuleRequest = (request, defaults) => ({ + description: request.description, + ip: request.ip +}); +const marshalAddDeploymentACLRulesRequest = (request, defaults) => ({ + acls: request.acls !== void 0 ? request.acls.map((elt) => marshalACLRuleRequest(elt)) : void 0 +}); +const marshalEndpointSpecPrivateNetwork = (request, defaults) => ({ + private_network_id: request.privateNetworkId +}); +const marshalEndpointSpecPublic = (request, defaults) => ({}); +const marshalEndpointSpec = (request, defaults) => ({ + disable_auth: request.disableAuth, + ...marshalling.resolveOneOf([ + { + param: "public", + value: request.public !== void 0 ? marshalEndpointSpecPublic(request.public) : void 0 + }, + { + param: "private_network", + value: request.privateNetwork !== void 0 ? marshalEndpointSpecPrivateNetwork(request.privateNetwork) : void 0 + } + ]) +}); +const marshalCreateDeploymentRequest = (request, defaults) => ({ + accept_eula: request.acceptEula, + endpoints: request.endpoints.map((elt) => marshalEndpointSpec(elt)), + max_size: request.maxSize, + min_size: request.minSize, + model_name: request.modelName, + name: request.name || randomName("llm"), + node_type: request.nodeType, + project_id: request.projectId ?? defaults.defaultProjectId, + tags: request.tags +}); +const marshalCreateEndpointRequest = (request, defaults) => ({ + deployment_id: request.deploymentId, + endpoint: marshalEndpointSpec(request.endpoint) +}); +const marshalSetDeploymentACLRulesRequest = (request, defaults) => ({ + acls: request.acls !== void 0 ? request.acls.map((elt) => marshalACLRuleRequest(elt)) : void 0 +}); +const marshalUpdateDeploymentRequest = (request, defaults) => ({ + max_size: request.maxSize, + min_size: request.minSize, + name: request.name, + tags: request.tags +}); +const marshalUpdateEndpointRequest = (request, defaults) => ({ + disable_auth: request.disableAuth +}); +exports.marshalAddDeploymentACLRulesRequest = marshalAddDeploymentACLRulesRequest; +exports.marshalCreateDeploymentRequest = marshalCreateDeploymentRequest; +exports.marshalCreateEndpointRequest = marshalCreateEndpointRequest; +exports.marshalSetDeploymentACLRulesRequest = marshalSetDeploymentACLRulesRequest; +exports.marshalUpdateDeploymentRequest = marshalUpdateDeploymentRequest; +exports.marshalUpdateEndpointRequest = marshalUpdateEndpointRequest; +exports.unmarshalAddDeploymentACLRulesResponse = unmarshalAddDeploymentACLRulesResponse; +exports.unmarshalDeployment = unmarshalDeployment; +exports.unmarshalEndpoint = unmarshalEndpoint; +exports.unmarshalEula = unmarshalEula; +exports.unmarshalListDeploymentACLRulesResponse = unmarshalListDeploymentACLRulesResponse; +exports.unmarshalListDeploymentsResponse = unmarshalListDeploymentsResponse; +exports.unmarshalListModelsResponse = unmarshalListModelsResponse; +exports.unmarshalListNodeTypesResponse = unmarshalListNodeTypesResponse; +exports.unmarshalModel = unmarshalModel; +exports.unmarshalSetDeploymentACLRulesResponse = unmarshalSetDeploymentACLRulesResponse; + + +/***/ }), + +/***/ 3595: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const CreateDeploymentRequest = { + maxSize: { + greaterThanOrEqual: 1, + lessThanOrEqual: 50 + }, + minSize: { + greaterThanOrEqual: 1, + lessThanOrEqual: 50 + }, + modelName: { + maxLength: 255, + minLength: 0, + pattern: /^[\w-_]+\/[\w-_.]+(:[\w]+)?$/ + }, + name: { + maxLength: 255, + minLength: 1, + pattern: /^[A-Za-z0-9-_]+$/ + }, + nodeType: { + maxLength: 64, + minLength: 1 + } +}; +const ListDeploymentsRequest = { + name: { + maxLength: 255, + minLength: 1 + } +}; +const ListModelsRequest = { + name: { + maxLength: 255, + minLength: 1 + } +}; +const UpdateDeploymentRequest = { + maxSize: { + greaterThanOrEqual: 1, + lessThanOrEqual: 50 + }, + minSize: { + greaterThanOrEqual: 1, + lessThanOrEqual: 50 + }, + name: { + maxLength: 255, + minLength: 1 + } +}; +exports.CreateDeploymentRequest = CreateDeploymentRequest; +exports.ListDeploymentsRequest = ListDeploymentsRequest; +exports.ListModelsRequest = ListModelsRequest; +exports.UpdateDeploymentRequest = UpdateDeploymentRequest; + + +/***/ }), + +/***/ 6875: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const index_gen = __nccwpck_require__(9888); +exports.v2 = index_gen; + + +/***/ }), + +/***/ 6204: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api = __nccwpck_require__(3042); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const resourcePaginator = __nccwpck_require__(4983); +const marshalling_gen = __nccwpck_require__(5278); +class API extends api.API { + pageOfListImages = (request) => this.client.fetch( + { + method: "GET", + path: `/marketplace/v2/images`, + urlParams: marshalling.urlParams( + ["arch", request.arch], + ["category", request.category], + ["include_eol", request.includeEol], + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListImagesResponse + ); + /** + * List marketplace images. List all available images on the marketplace, + * their UUID, CPU architecture and description. + * + * @param request - The request {@link ListImagesRequest} + * @returns A Promise of ListImagesResponse + */ + listImages = (request) => resourcePaginator.enrichForPagination("images", this.pageOfListImages, request); + /** + * Get a specific marketplace image. Get detailed information about a + * marketplace image, specified by its `image_id` (UUID format). + * + * @param request - The request {@link GetImageRequest} + * @returns A Promise of Image + */ + getImage = (request) => this.client.fetch( + { + method: "GET", + path: `/marketplace/v2/images/${marshalling.validatePathParam("imageId", request.imageId)}` + }, + marshalling_gen.unmarshalImage + ); + pageOfListVersions = (request) => this.client.fetch( + { + method: "GET", + path: `/marketplace/v2/versions`, + urlParams: marshalling.urlParams( + ["image_id", request.imageId], + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListVersionsResponse + ); + /** + * List versions of an Image. Get a list of all available version of an image, + * specified by its `image_id` (UUID format). + * + * @param request - The request {@link ListVersionsRequest} + * @returns A Promise of ListVersionsResponse + */ + listVersions = (request) => resourcePaginator.enrichForPagination("versions", this.pageOfListVersions, request); + /** + * Get a specific image version. Get information such as the name, creation + * date, last update and published date for an image version specified by its + * `version_id` (UUID format). + * + * @param request - The request {@link GetVersionRequest} + * @returns A Promise of Version + */ + getVersion = (request) => this.client.fetch( + { + method: "GET", + path: `/marketplace/v2/versions/${marshalling.validatePathParam("versionId", request.versionId)}` + }, + marshalling_gen.unmarshalVersion + ); + pageOfListLocalImages = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/marketplace/v2/local-images`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["type", request.type], + ["zone", request.zone], + ...Object.entries( + marshalling.resolveOneOf([ + { param: "image_id", value: request.imageId }, + { param: "version_id", value: request.versionId }, + { param: "image_label", value: request.imageLabel } + ]) + ) + ) + }, + marshalling_gen.unmarshalListLocalImagesResponse + ); + /** + * List local images from a specific image or version. List information about + * local images in a specific Availability Zone, specified by its `image_id` + * (UUID format), `version_id` (UUID format) or `image_label`. Only one of + * these three parameters may be set. + * + * @param request - The request {@link ListLocalImagesRequest} + * @returns A Promise of ListLocalImagesResponse + */ + listLocalImages = (request = {}) => resourcePaginator.enrichForPagination("localImages", this.pageOfListLocalImages, request); + /** + * Get a specific local image by ID. Get detailed information about a local + * image, including compatible commercial types, supported architecture, + * labels and the Availability Zone of the image, specified by its + * `local_image_id` (UUID format). + * + * @param request - The request {@link GetLocalImageRequest} + * @returns A Promise of LocalImage + */ + getLocalImage = (request) => this.client.fetch( + { + method: "GET", + path: `/marketplace/v2/local-images/${marshalling.validatePathParam("localImageId", request.localImageId)}` + }, + marshalling_gen.unmarshalLocalImage + ); + pageOfListCategories = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/marketplace/v2/categories`, + urlParams: marshalling.urlParams( + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListCategoriesResponse + ); + /** + * List existing image categories. Get a list of all existing categories. The + * output can be paginated. + * + * @param request - The request {@link ListCategoriesRequest} + * @returns A Promise of ListCategoriesResponse + */ + listCategories = (request = {}) => resourcePaginator.enrichForPagination("categories", this.pageOfListCategories, request); + /** + * Get a specific category. Get information about a specific category of the + * marketplace catalog, specified by its `category_id` (UUID format). + * + * @param request - The request {@link GetCategoryRequest} + * @returns A Promise of Category + */ + getCategory = (request) => this.client.fetch( + { + method: "GET", + path: `/marketplace/v2/categories/${marshalling.validatePathParam("categoryId", request.categoryId)}` + }, + marshalling_gen.unmarshalCategory + ); +} +exports.API = API; + + +/***/ }), + +/***/ 9888: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api_gen = __nccwpck_require__(6204); +exports.API = api_gen.API; + + +/***/ }), + +/***/ 5278: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const json = __nccwpck_require__(3746); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const unmarshalCategory = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Category' failed as data isn't a dictionary.` + ); } return { - createdAt: unmarshalDate(data.created_at), - endpoint: data.endpoint, - hubId: data.hub_id, + description: data.description, id: data.id, - name: data.name, - topicPrefix: data.topic_prefix, - type: data.type - }; -}; -const unmarshalRouteDatabaseConfig = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'RouteDatabaseConfig' failed as data isn't a dictionary.`); - } - return { - dbname: data.dbname, - engine: data.engine, - host: data.host, - password: data.password, - port: data.port, - query: data.query, - username: data.username - }; -}; -const unmarshalRouteRestConfig = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'RouteRestConfig' failed as data isn't a dictionary.`); - } - return { - headers: data.headers, - uri: data.uri, - verb: data.verb - }; -}; -const unmarshalRouteS3Config = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'RouteS3Config' failed as data isn't a dictionary.`); - } - return { - bucketName: data.bucket_name, - bucketRegion: data.bucket_region, - objectPrefix: data.object_prefix, - strategy: data.strategy + name: data.name }; }; -const unmarshalRouteSummary = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'RouteSummary' failed as data isn't a dictionary.`); +const unmarshalImage = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Image' failed as data isn't a dictionary.` + ); } return { - createdAt: unmarshalDate(data.created_at), - hubId: data.hub_id, + categories: data.categories, + createdAt: marshalling.unmarshalDate(data.created_at), + description: data.description, id: data.id, + label: data.label, + logo: data.logo, name: data.name, - topic: data.topic, - type: data.type, - updatedAt: unmarshalDate(data.updated_at) - }; -}; -const unmarshalCreateDeviceResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'CreateDeviceResponse' failed as data isn't a dictionary.`); - } - return { - certificate: data.certificate ? unmarshalCertificate$1(data.certificate) : undefined, - device: data.device ? unmarshalDevice(data.device) : undefined - }; -}; -const unmarshalCreateNetworkResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'CreateNetworkResponse' failed as data isn't a dictionary.`); - } - return { - network: data.network ? unmarshalNetwork(data.network) : undefined, - secret: data.secret - }; -}; -const unmarshalGetDeviceCertificateResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'GetDeviceCertificateResponse' failed as data isn't a dictionary.`); - } - return { - certificatePem: data.certificate_pem, - device: data.device ? unmarshalDevice(data.device) : undefined - }; -}; -const unmarshalGetDeviceMetricsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'GetDeviceMetricsResponse' failed as data isn't a dictionary.`); - } - return { - metrics: unmarshalArrayOfObject(data.metrics, unmarshalTimeSeries) - }; -}; -const unmarshalGetHubCAResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'GetHubCAResponse' failed as data isn't a dictionary.`); - } - return { - caCertPem: data.ca_cert_pem + updatedAt: marshalling.unmarshalDate(data.updated_at), + validUntil: marshalling.unmarshalDate(data.valid_until) }; }; -const unmarshalGetHubMetricsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'GetHubMetricsResponse' failed as data isn't a dictionary.`); +const unmarshalLocalImage = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'LocalImage' failed as data isn't a dictionary.` + ); } return { - metrics: unmarshalArrayOfObject(data.metrics, unmarshalTimeSeries) + arch: data.arch, + compatibleCommercialTypes: data.compatible_commercial_types, + id: data.id, + label: data.label, + type: data.type, + zone: data.zone }; }; -const unmarshalListDevicesResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListDevicesResponse' failed as data isn't a dictionary.`); +const unmarshalVersion = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Version' failed as data isn't a dictionary.` + ); } return { - devices: unmarshalArrayOfObject(data.devices, unmarshalDevice), - totalCount: data.total_count + createdAt: marshalling.unmarshalDate(data.created_at), + id: data.id, + name: data.name, + publishedAt: marshalling.unmarshalDate(data.published_at), + updatedAt: marshalling.unmarshalDate(data.updated_at) }; }; -const unmarshalListHubsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListHubsResponse' failed as data isn't a dictionary.`); +const unmarshalListCategoriesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListCategoriesResponse' failed as data isn't a dictionary.` + ); } return { - hubs: unmarshalArrayOfObject(data.hubs, unmarshalHub), + categories: marshalling.unmarshalArrayOfObject(data.categories, unmarshalCategory), totalCount: data.total_count }; }; -const unmarshalListNetworksResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListNetworksResponse' failed as data isn't a dictionary.`); +const unmarshalListImagesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListImagesResponse' failed as data isn't a dictionary.` + ); } return { - networks: unmarshalArrayOfObject(data.networks, unmarshalNetwork), + images: marshalling.unmarshalArrayOfObject(data.images, unmarshalImage), totalCount: data.total_count }; }; -const unmarshalListRoutesResponse$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListRoutesResponse' failed as data isn't a dictionary.`); +const unmarshalListLocalImagesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListLocalImagesResponse' failed as data isn't a dictionary.` + ); } return { - routes: unmarshalArrayOfObject(data.routes, unmarshalRouteSummary), + localImages: marshalling.unmarshalArrayOfObject(data.local_images, unmarshalLocalImage), totalCount: data.total_count }; }; -const unmarshalListTwinDocumentsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListTwinDocumentsResponse' failed as data isn't a dictionary.`); - } - return { - documents: unmarshalArrayOfObject(data.documents, unmarshalListTwinDocumentsResponseDocumentSummary) - }; -}; -const unmarshalRenewDeviceCertificateResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'RenewDeviceCertificateResponse' failed as data isn't a dictionary.`); - } - return { - certificate: data.certificate ? unmarshalCertificate$1(data.certificate) : undefined, - device: data.device ? unmarshalDevice(data.device) : undefined - }; -}; -const unmarshalRoute$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Route' failed as data isn't a dictionary.`); - } - return { - createdAt: unmarshalDate(data.created_at), - dbConfig: data.db_config ? unmarshalRouteDatabaseConfig(data.db_config) : undefined, - hubId: data.hub_id, - id: data.id, - name: data.name, - restConfig: data.rest_config ? unmarshalRouteRestConfig(data.rest_config) : undefined, - s3Config: data.s3_config ? unmarshalRouteS3Config(data.s3_config) : undefined, - topic: data.topic, - type: data.type, - updatedAt: unmarshalDate(data.updated_at) - }; -}; -const unmarshalSetDeviceCertificateResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'SetDeviceCertificateResponse' failed as data isn't a dictionary.`); - } - return { - certificatePem: data.certificate_pem, - device: data.device ? unmarshalDevice(data.device) : undefined - }; -}; -const unmarshalTwinDocument = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'TwinDocument' failed as data isn't a dictionary.`); +const unmarshalListVersionsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListVersionsResponse' failed as data isn't a dictionary.` + ); } return { - data: data.data, - documentName: data.document_name, - twinId: data.twin_id, - version: data.version + totalCount: data.total_count, + versions: marshalling.unmarshalArrayOfObject(data.versions, unmarshalVersion) }; -}; -const marshalDeviceMessageFiltersRule = (request, defaults) => ({ - policy: request.policy, - topics: request.topics -}); -const marshalCreateRouteRequestDatabaseConfig = (request, defaults) => ({ - dbname: request.dbname, - engine: request.engine, - host: request.host, - password: request.password, - port: request.port, - query: request.query, - username: request.username -}); -const marshalCreateRouteRequestRestConfig = (request, defaults) => ({ - headers: request.headers, - uri: request.uri, - verb: request.verb -}); -const marshalCreateRouteRequestS3Config = (request, defaults) => ({ - bucket_name: request.bucketName, - bucket_region: request.bucketRegion, - object_prefix: request.objectPrefix, - strategy: request.strategy -}); -const marshalDeviceMessageFilters = (request, defaults) => ({ - publish: request.publish ? marshalDeviceMessageFiltersRule(request.publish) : undefined, - subscribe: request.subscribe ? marshalDeviceMessageFiltersRule(request.subscribe) : undefined -}); -const marshalHubTwinsGraphiteConfig = (request, defaults) => ({ - push_uri: request.pushUri -}); -const marshalUpdateRouteRequestDatabaseConfig = (request, defaults) => ({ - dbname: request.dbname, - engine: request.engine, - host: request.host, - password: request.password, - port: request.port, - query: request.query, - username: request.username -}); -const marshalUpdateRouteRequestRestConfig = (request, defaults) => ({ - headers: request.headers, - uri: request.uri, - verb: request.verb -}); -const marshalUpdateRouteRequestS3Config = (request, defaults) => ({ - bucket_name: request.bucketName, - bucket_region: request.bucketRegion, - object_prefix: request.objectPrefix, - strategy: request.strategy -}); -const marshalCreateDeviceRequest = (request, defaults) => ({ - allow_insecure: request.allowInsecure, - allow_multiple_connections: request.allowMultipleConnections, - description: request.description, - hub_id: request.hubId, - message_filters: request.messageFilters ? marshalDeviceMessageFilters(request.messageFilters) : undefined, - name: request.name || randomName('device') -}); -const marshalCreateHubRequest = (request, defaults) => ({ - disable_events: request.disableEvents, - events_topic_prefix: request.eventsTopicPrefix, - name: request.name || randomName('hub'), - product_plan: request.productPlan, - project_id: request.projectId ?? defaults.defaultProjectId, - ...resolveOneOf([{ - param: 'twins_graphite_config', - value: request.twinsGraphiteConfig ? marshalHubTwinsGraphiteConfig(request.twinsGraphiteConfig) : undefined - }]) -}); -const marshalCreateNetworkRequest = (request, defaults) => ({ - hub_id: request.hubId, - name: request.name || randomName('network'), - topic_prefix: request.topicPrefix, - type: request.type -}); -const marshalCreateRouteRequest$1 = (request, defaults) => ({ - hub_id: request.hubId, - name: request.name || randomName('route'), - topic: request.topic, - ...resolveOneOf([{ - param: 's3_config', - value: request.s3Config ? marshalCreateRouteRequestS3Config(request.s3Config) : undefined - }, { - param: 'db_config', - value: request.dbConfig ? marshalCreateRouteRequestDatabaseConfig(request.dbConfig) : undefined - }, { - param: 'rest_config', - value: request.restConfig ? marshalCreateRouteRequestRestConfig(request.restConfig) : undefined - }]) -}); -const marshalPatchTwinDocumentRequest = (request, defaults) => ({ - data: request.data, - version: request.version -}); -const marshalPutTwinDocumentRequest = (request, defaults) => ({ - data: request.data, - version: request.version -}); -const marshalSetDeviceCertificateRequest = (request, defaults) => ({ - certificate_pem: request.certificatePem -}); -const marshalSetHubCARequest = (request, defaults) => ({ - ca_cert_pem: request.caCertPem, - challenge_cert_pem: request.challengeCertPem -}); -const marshalUpdateDeviceRequest = (request, defaults) => ({ - allow_insecure: request.allowInsecure, - allow_multiple_connections: request.allowMultipleConnections, - description: request.description, - hub_id: request.hubId, - message_filters: request.messageFilters ? marshalDeviceMessageFilters(request.messageFilters) : undefined -}); -const marshalUpdateHubRequest = (request, defaults) => ({ - disable_events: request.disableEvents, - enable_device_auto_provisioning: request.enableDeviceAutoProvisioning, - events_topic_prefix: request.eventsTopicPrefix, - name: request.name, - product_plan: request.productPlan ?? 'plan_unknown', - ...resolveOneOf([{ - param: 'twins_graphite_config', - value: request.twinsGraphiteConfig ? marshalHubTwinsGraphiteConfig(request.twinsGraphiteConfig) : undefined - }]) -}); -const marshalUpdateRouteRequest$1 = (request, defaults) => ({ - name: request.name, - topic: request.topic, - ...resolveOneOf([{ - param: 's3_config', - value: request.s3Config ? marshalUpdateRouteRequestS3Config(request.s3Config) : undefined - }, { - param: 'db_config', - value: request.dbConfig ? marshalUpdateRouteRequestDatabaseConfig(request.dbConfig) : undefined - }, { - param: 'rest_config', - value: request.restConfig ? marshalUpdateRouteRequestRestConfig(request.restConfig) : undefined - }]) -}); - -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const jsonContentHeaders$f = { - 'Content-Type': 'application/json; charset=utf-8' -}; - -/** - * IoT Hub API. - * - * This API allows you to manage IoT hubs and devices. IoT Hub API. - */ -let API$g = class API extends API$u { - /** Lists the available regions of the API. */ - static LOCALITIES = ['fr-par']; - pageOfListHubs = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hubs`, - urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'name_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId]) - }, unmarshalListHubsResponse); - - /** - * List hubs. List all Hubs in the specified zone. By default, returned Hubs - * are ordered by creation date in ascending order, though this can be - * modified via the `order_by` field. - * - * @param request - The request {@link ListHubsRequest} - * @returns A Promise of ListHubsResponse - */ - listHubs = (request = {}) => enrichForPagination('hubs', this.pageOfListHubs, request); - - /** - * Create a hub. Create a new Hub in the targeted region, specifying its - * configuration including name and product plan. - * - * @param request - The request {@link CreateHubRequest} - * @returns A Promise of Hub - */ - createHub = request => this.client.fetch({ - body: JSON.stringify(marshalCreateHubRequest(request, this.client.settings)), - headers: jsonContentHeaders$f, - method: 'POST', - path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hubs` - }, unmarshalHub); - - /** - * Get a hub. Retrieve information about an existing IoT Hub, specified by its - * Hub ID. Its full details, including name, status and endpoint, are returned - * in the response object. - * - * @param request - The request {@link GetHubRequest} - * @returns A Promise of Hub - */ - getHub = request => this.client.fetch({ - method: 'GET', - path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hubs/${validatePathParam('hubId', request.hubId)}` - }, unmarshalHub); - - /** - * Waits for {@link Hub} to be in a final state. - * - * @param request - The request {@link GetHubRequest} - * @param options - The waiting options - * @returns A Promise of Hub - */ - waitForHub = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!HUB_TRANSIENT_STATUSES.includes(res.status))), this.getHub, request, options); - - /** - * Update a hub. Update the parameters of an existing IoT Hub, specified by - * its Hub ID. - * - * @param request - The request {@link UpdateHubRequest} - * @returns A Promise of Hub - */ - updateHub = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateHubRequest(request, this.client.settings)), - headers: jsonContentHeaders$f, - method: 'PATCH', - path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hubs/${validatePathParam('hubId', request.hubId)}` - }, unmarshalHub); - - /** - * Enable a hub. Enable an existing IoT Hub, specified by its Hub ID. - * - * @param request - The request {@link EnableHubRequest} - * @returns A Promise of Hub - */ - enableHub = request => this.client.fetch({ - body: '{}', - headers: jsonContentHeaders$f, - method: 'POST', - path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hubs/${validatePathParam('hubId', request.hubId)}/enable` - }, unmarshalHub); +}; +exports.unmarshalCategory = unmarshalCategory; +exports.unmarshalImage = unmarshalImage; +exports.unmarshalListCategoriesResponse = unmarshalListCategoriesResponse; +exports.unmarshalListImagesResponse = unmarshalListImagesResponse; +exports.unmarshalListLocalImagesResponse = unmarshalListLocalImagesResponse; +exports.unmarshalListVersionsResponse = unmarshalListVersionsResponse; +exports.unmarshalLocalImage = unmarshalLocalImage; +exports.unmarshalVersion = unmarshalVersion; - /** - * Disable a hub. Disable an existing IoT Hub, specified by its Hub ID. - * - * @param request - The request {@link DisableHubRequest} - * @returns A Promise of Hub - */ - disableHub = request => this.client.fetch({ - body: '{}', - headers: jsonContentHeaders$f, - method: 'POST', - path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hubs/${validatePathParam('hubId', request.hubId)}/disable` - }, unmarshalHub); - /** - * Delete a hub. Delete an existing IoT Hub, specified by its Hub ID. Deleting - * a Hub is permanent, and cannot be undone. - * - * @param request - The request {@link DeleteHubRequest} - */ - deleteHub = request => this.client.fetch({ - method: 'DELETE', - path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hubs/${validatePathParam('hubId', request.hubId)}`, - urlParams: urlParams(['delete_devices', request.deleteDevices]) - }); +/***/ }), - /** - * Get a hub's metrics. Get the metrics of an existing IoT Hub, specified by - * its Hub ID. - * - * @deprecated - * @param request - The request {@link GetHubMetricsRequest} - * @returns A Promise of GetHubMetricsResponse - */ - getHubMetrics = request => this.client.fetch({ - method: 'GET', - path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hubs/${validatePathParam('hubId', request.hubId)}/metrics`, - urlParams: urlParams(['start_date', request.startDate]) - }, unmarshalGetHubMetricsResponse); +/***/ 9256: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - /** - * Set the certificate authority of a hub. Set a particular PEM-encoded - * certificate, specified by the Hub ID. - * - * @param request - The request {@link SetHubCARequest} - * @returns A Promise of Hub - */ - setHubCA = request => this.client.fetch({ - body: JSON.stringify(marshalSetHubCARequest(request, this.client.settings)), - headers: jsonContentHeaders$f, - method: 'POST', - path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hubs/${validatePathParam('hubId', request.hubId)}/ca` - }, unmarshalHub); +"use strict"; - /** - * Get the certificate authority of a hub. Get information for a particular - * PEM-encoded certificate, specified by the Hub ID. - * - * @param request - The request {@link GetHubCARequest} - * @returns A Promise of GetHubCAResponse - */ - getHubCA = request => this.client.fetch({ - method: 'GET', - path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hubs/${validatePathParam('hubId', request.hubId)}/ca` - }, unmarshalGetHubCAResponse); - pageOfListDevices = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/devices`, - urlParams: urlParams(['allow_insecure', request.allowInsecure], ['hub_id', request.hubId], ['name', request.name], ['order_by', request.orderBy ?? 'name_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['status', request.status ?? 'unknown']) - }, unmarshalListDevicesResponse); +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const index_gen = __nccwpck_require__(5235); +exports.v1beta1 = index_gen; - /** - * List devices. List all devices in the specified region. By default, - * returned devices are ordered by creation date in ascending order, though - * this can be modified via the `order_by` field. - * - * @param request - The request {@link ListDevicesRequest} - * @returns A Promise of ListDevicesResponse - */ - listDevices = (request = {}) => enrichForPagination('devices', this.pageOfListDevices, request); +/***/ }), + +/***/ 291: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api = __nccwpck_require__(3042); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const resourcePaginator = __nccwpck_require__(4983); +const marshalling_gen = __nccwpck_require__(7953); +const jsonContentHeaders = { + "Content-Type": "application/json; charset=utf-8" +}; +class NatsAPI extends api.API { + /** Lists the available regions of the API. */ + static LOCALITIES = ["fr-par", "nl-ams"]; /** - * Add a device. Attach a device to a given Hub. + * Create a NATS account. Create a NATS account associated with a Project. * - * @param request - The request {@link CreateDeviceRequest} - * @returns A Promise of CreateDeviceResponse + * @param request - The request {@link NatsApiCreateNatsAccountRequest} + * @returns A Promise of NatsAccount */ - createDevice = request => this.client.fetch({ - body: JSON.stringify(marshalCreateDeviceRequest(request, this.client.settings)), - headers: jsonContentHeaders$f, - method: 'POST', - path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/devices` - }, unmarshalCreateDeviceResponse); - + createNatsAccount = (request = {}) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalNatsApiCreateNatsAccountRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/mnq/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nats-accounts` + }, + marshalling_gen.unmarshalNatsAccount + ); /** - * Get a device. Retrieve information about an existing device, specified by - * its device ID. Its full details, including name, status and ID, are - * returned in the response object. + * Delete a NATS account. Delete a NATS account, specified by its NATS account + * ID. Note that deleting a NATS account is irreversible, and any credentials, + * streams, consumer and stored messages belonging to this NATS account will + * also be deleted. * - * @param request - The request {@link GetDeviceRequest} - * @returns A Promise of Device + * @param request - The request {@link NatsApiDeleteNatsAccountRequest} */ - getDevice = request => this.client.fetch({ - method: 'GET', - path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/devices/${validatePathParam('deviceId', request.deviceId)}` - }, unmarshalDevice); - + deleteNatsAccount = (request) => this.client.fetch({ + method: "DELETE", + path: `/mnq/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nats-accounts/${marshalling.validatePathParam("natsAccountId", request.natsAccountId)}` + }); /** - * Update a device. Update the parameters of an existing device, specified by - * its device ID. + * Update the name of a NATS account. Update the name of a NATS account, + * specified by its NATS account ID. * - * @param request - The request {@link UpdateDeviceRequest} - * @returns A Promise of Device + * @param request - The request {@link NatsApiUpdateNatsAccountRequest} + * @returns A Promise of NatsAccount */ - updateDevice = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateDeviceRequest(request, this.client.settings)), - headers: jsonContentHeaders$f, - method: 'PATCH', - path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/devices/${validatePathParam('deviceId', request.deviceId)}` - }, unmarshalDevice); - + updateNatsAccount = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalNatsApiUpdateNatsAccountRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/mnq/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nats-accounts/${marshalling.validatePathParam("natsAccountId", request.natsAccountId)}` + }, + marshalling_gen.unmarshalNatsAccount + ); /** - * Enable a device. Enable a specific device, specified by its device ID. + * Get a NATS account. Retrieve information about an existing NATS account + * identified by its NATS account ID. Its full details, including name and + * endpoint, are returned in the response. * - * @param request - The request {@link EnableDeviceRequest} - * @returns A Promise of Device + * @param request - The request {@link NatsApiGetNatsAccountRequest} + * @returns A Promise of NatsAccount */ - enableDevice = request => this.client.fetch({ - body: '{}', - headers: jsonContentHeaders$f, - method: 'POST', - path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/devices/${validatePathParam('deviceId', request.deviceId)}/enable` - }, unmarshalDevice); - + getNatsAccount = (request) => this.client.fetch( + { + method: "GET", + path: `/mnq/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nats-accounts/${marshalling.validatePathParam("natsAccountId", request.natsAccountId)}` + }, + marshalling_gen.unmarshalNatsAccount + ); + pageOfListNatsAccounts = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/mnq/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nats-accounts`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId] + ) + }, + marshalling_gen.unmarshalListNatsAccountsResponse + ); /** - * Disable a device. Disable an existing device, specified by its device ID. + * List NATS accounts. List all NATS accounts in the specified region, for a + * Scaleway Organization or Project. By default, the NATS accounts returned in + * the list are ordered by creation date in ascending order, though this can + * be modified via the `order_by` field. * - * @param request - The request {@link DisableDeviceRequest} - * @returns A Promise of Device + * @param request - The request {@link NatsApiListNatsAccountsRequest} + * @returns A Promise of ListNatsAccountsResponse */ - disableDevice = request => this.client.fetch({ - body: '{}', - headers: jsonContentHeaders$f, - method: 'POST', - path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/devices/${validatePathParam('deviceId', request.deviceId)}/disable` - }, unmarshalDevice); - + listNatsAccounts = (request = {}) => resourcePaginator.enrichForPagination("natsAccounts", this.pageOfListNatsAccounts, request); /** - * Renew a device certificate. Renew the certificate of an existing device, - * specified by its device ID. + * Create NATS credentials. Create a set of credentials for a NATS account, + * specified by its NATS account ID. * - * @param request - The request {@link RenewDeviceCertificateRequest} - * @returns A Promise of RenewDeviceCertificateResponse + * @param request - The request {@link NatsApiCreateNatsCredentialsRequest} + * @returns A Promise of NatsCredentials */ - renewDeviceCertificate = request => this.client.fetch({ - body: '{}', - headers: jsonContentHeaders$f, - method: 'POST', - path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/devices/${validatePathParam('deviceId', request.deviceId)}/renew-certificate` - }, unmarshalRenewDeviceCertificateResponse); - + createNatsCredentials = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalNatsApiCreateNatsCredentialsRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/mnq/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nats-credentials` + }, + marshalling_gen.unmarshalNatsCredentials + ); /** - * Set a custom certificate on a device. Switch the existing certificate of a - * given device with an EM-encoded custom certificate. + * Delete NATS credentials. Delete a set of credentials, specified by their + * credentials ID. Deleting credentials is irreversible and cannot be undone. + * The credentials can no longer be used to access the NATS account, and + * active connections using this credentials will be closed. * - * @param request - The request {@link SetDeviceCertificateRequest} - * @returns A Promise of SetDeviceCertificateResponse + * @param request - The request {@link NatsApiDeleteNatsCredentialsRequest} */ - setDeviceCertificate = request => this.client.fetch({ - body: JSON.stringify(marshalSetDeviceCertificateRequest(request, this.client.settings)), - headers: jsonContentHeaders$f, - method: 'PUT', - path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/devices/${validatePathParam('deviceId', request.deviceId)}/certificate` - }, unmarshalSetDeviceCertificateResponse); - + deleteNatsCredentials = (request) => this.client.fetch({ + method: "DELETE", + path: `/mnq/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nats-credentials/${marshalling.validatePathParam("natsCredentialsId", request.natsCredentialsId)}` + }); /** - * Get a device's certificate. Get information for a particular PEM-encoded - * certificate, specified by the device ID. The response returns full details - * of the device, including its type of certificate. + * Get NATS credentials. Retrieve an existing set of credentials, identified + * by the `nats_credentials_id`. The credentials themselves are NOT returned, + * only their metadata (NATS account ID, credentials name, etc), are returned + * in the response. * - * @param request - The request {@link GetDeviceCertificateRequest} - * @returns A Promise of GetDeviceCertificateResponse + * @param request - The request {@link NatsApiGetNatsCredentialsRequest} + * @returns A Promise of NatsCredentials */ - getDeviceCertificate = request => this.client.fetch({ - method: 'GET', - path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/devices/${validatePathParam('deviceId', request.deviceId)}/certificate` - }, unmarshalGetDeviceCertificateResponse); - + getNatsCredentials = (request) => this.client.fetch( + { + method: "GET", + path: `/mnq/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nats-credentials/${marshalling.validatePathParam("natsCredentialsId", request.natsCredentialsId)}` + }, + marshalling_gen.unmarshalNatsCredentials + ); + pageOfListNatsCredentials = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/mnq/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/nats-credentials`, + urlParams: marshalling.urlParams( + ["nats_account_id", request.natsAccountId], + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListNatsCredentialsResponse + ); /** - * Remove a device. Remove a specific device from the specific Hub it is - * attached to. + * List NATS credentials. List existing credentials in the specified NATS + * account. The response contains only the metadata for the credentials, not + * the credentials themselves, which are only returned after a **Create + * Credentials** call. * - * @param request - The request {@link DeleteDeviceRequest} + * @param request - The request {@link NatsApiListNatsCredentialsRequest} + * @returns A Promise of ListNatsCredentialsResponse */ - deleteDevice = request => this.client.fetch({ - method: 'DELETE', - path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/devices/${validatePathParam('deviceId', request.deviceId)}` - }); - + listNatsCredentials = (request = {}) => resourcePaginator.enrichForPagination( + "natsCredentials", + this.pageOfListNatsCredentials, + request + ); +} +class SnsAPI extends api.API { + /** Lists the available regions of the API. */ + static LOCALITIES = ["fr-par", "nl-ams"]; /** - * Get a device's metrics. Get the metrics of an existing device, specified by - * its device ID. + * Activate SNS. Activate SNS for the specified Project ID. SNS must be + * activated before any usage. Activating SNS does not trigger any billing, + * and you can deactivate at any time. * - * @deprecated - * @param request - The request {@link GetDeviceMetricsRequest} - * @returns A Promise of GetDeviceMetricsResponse + * @param request - The request {@link SnsApiActivateSnsRequest} + * @returns A Promise of SnsInfo */ - getDeviceMetrics = request => this.client.fetch({ - method: 'GET', - path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/devices/${validatePathParam('deviceId', request.deviceId)}/metrics`, - urlParams: urlParams(['start_date', request.startDate]) - }, unmarshalGetDeviceMetricsResponse); - pageOfListRoutes = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/routes`, - urlParams: urlParams(['hub_id', request.hubId], ['name', request.name], ['order_by', request.orderBy ?? 'name_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]) - }, unmarshalListRoutesResponse$1); - + activateSns = (request = {}) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalSnsApiActivateSnsRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/mnq/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/activate-sns` + }, + marshalling_gen.unmarshalSnsInfo + ); /** - * List routes. List all routes in the specified region. By default, returned - * routes are ordered by creation date in ascending order, though this can be - * modified via the `order_by` field. + * Get SNS info. Retrieve the SNS information of the specified Project ID. + * Informations include the activation status and the SNS API endpoint URL. * - * @param request - The request {@link ListRoutesRequest} - * @returns A Promise of ListRoutesResponse + * @param request - The request {@link SnsApiGetSnsInfoRequest} + * @returns A Promise of SnsInfo */ - listRoutes = (request = {}) => enrichForPagination('routes', this.pageOfListRoutes, request); - + getSnsInfo = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/mnq/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sns-info`, + urlParams: marshalling.urlParams([ + "project_id", + request.projectId ?? this.client.settings.defaultProjectId + ]) + }, + marshalling_gen.unmarshalSnsInfo + ); /** - * Create a route. Multiple kinds of routes can be created, such as: - * - * - Database Route Create a route that will record subscribed MQTT messages - * into your database. You need to manage the database by yourself. - * - REST Route. Create a route that will call a REST API on received subscribed - * MQTT messages. - * - S3 Routes. Create a route that will put subscribed MQTT messages into an S3 - * bucket. You need to create the bucket yourself and grant write access. - * Granting can be done with s3cmd (`s3cmd setacl s3://<my-bucket> - * --acl-grant=write:555c69c3-87d0-4bf8-80f1-99a2f757d031:555c69c3-87d0-4bf8-80f1-99a2f757d031`). + * Deactivate SNS. Deactivate SNS for the specified Project ID.You must delete + * all topics and credentials before this call or you need to set the + * force_delete parameter. * - * @param request - The request {@link CreateRouteRequest} - * @returns A Promise of Route + * @param request - The request {@link SnsApiDeactivateSnsRequest} + * @returns A Promise of SnsInfo */ - createRoute = request => this.client.fetch({ - body: JSON.stringify(marshalCreateRouteRequest$1(request, this.client.settings)), - headers: jsonContentHeaders$f, - method: 'POST', - path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/routes` - }, unmarshalRoute$1); - + deactivateSns = (request = {}) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalSnsApiDeactivateSnsRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/mnq/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deactivate-sns` + }, + marshalling_gen.unmarshalSnsInfo + ); /** - * Update a route. Update the parameters of an existing route, specified by - * its route ID. + * Create SNS credentials. Create a set of credentials for SNS, specified by a + * Project ID. Credentials give the bearer access to topics, and the level of + * permissions can be defined granularly. * - * @param request - The request {@link UpdateRouteRequest} - * @returns A Promise of Route + * @param request - The request {@link SnsApiCreateSnsCredentialsRequest} + * @returns A Promise of SnsCredentials */ - updateRoute = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateRouteRequest$1(request, this.client.settings)), - headers: jsonContentHeaders$f, - method: 'PATCH', - path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam('routeId', request.routeId)}` - }, unmarshalRoute$1); - + createSnsCredentials = (request = {}) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalSnsApiCreateSnsCredentialsRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/mnq/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sns-credentials` + }, + marshalling_gen.unmarshalSnsCredentials + ); /** - * Get a route. Get information for a particular route, specified by the route - * ID. The response returns full details of the route, including its type, the - * topic it subscribes to and its configuration. + * Delete SNS credentials. Delete a set of SNS credentials, specified by their + * credentials ID. Deleting credentials is irreversible and cannot be undone. + * The credentials can then no longer be used to access SNS. * - * @param request - The request {@link GetRouteRequest} - * @returns A Promise of Route + * @param request - The request {@link SnsApiDeleteSnsCredentialsRequest} */ - getRoute = request => this.client.fetch({ - method: 'GET', - path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam('routeId', request.routeId)}` - }, unmarshalRoute$1); - + deleteSnsCredentials = (request) => this.client.fetch({ + method: "DELETE", + path: `/mnq/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sns-credentials/${marshalling.validatePathParam("snsCredentialsId", request.snsCredentialsId)}` + }); /** - * Delete a route. Delete an existing route, specified by its route ID. - * Deleting a route is permanent, and cannot be undone. + * Update SNS credentials. Update a set of SNS credentials. You can update the + * credentials' name, or their permissions. * - * @param request - The request {@link DeleteRouteRequest} + * @param request - The request {@link SnsApiUpdateSnsCredentialsRequest} + * @returns A Promise of SnsCredentials */ - deleteRoute = request => this.client.fetch({ - method: 'DELETE', - path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam('routeId', request.routeId)}` - }); - pageOfListNetworks = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/networks`, - urlParams: urlParams(['hub_id', request.hubId], ['name', request.name], ['order_by', request.orderBy ?? 'name_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['topic_prefix', request.topicPrefix]) - }, unmarshalListNetworksResponse); - + updateSnsCredentials = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalSnsApiUpdateSnsCredentialsRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/mnq/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sns-credentials/${marshalling.validatePathParam("snsCredentialsId", request.snsCredentialsId)}` + }, + marshalling_gen.unmarshalSnsCredentials + ); /** - * List the networks. + * Get SNS credentials. Retrieve an existing set of credentials, identified by + * the `credentials_id`. The credentials themselves, as well as their metadata + * (name, project ID etc), are returned in the response. * - * @param request - The request {@link ListNetworksRequest} - * @returns A Promise of ListNetworksResponse + * @param request - The request {@link SnsApiGetSnsCredentialsRequest} + * @returns A Promise of SnsCredentials */ - listNetworks = (request = {}) => enrichForPagination('networks', this.pageOfListNetworks, request); - + getSnsCredentials = (request) => this.client.fetch( + { + method: "GET", + path: `/mnq/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sns-credentials/${marshalling.validatePathParam("snsCredentialsId", request.snsCredentialsId)}` + }, + marshalling_gen.unmarshalSnsCredentials + ); + pageOfListSnsCredentials = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/mnq/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sns-credentials`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId] + ) + }, + marshalling_gen.unmarshalListSnsCredentialsResponse + ); /** - * Create a new network. Create a new network for an existing hub. Beside the - * default network, you can add networks for different data providers. - * Possible network types are Sigfox and REST. + * List SNS credentials. List existing SNS credentials in the specified + * region. The response contains only the metadata for the credentials, not + * the credentials themselves. * - * @param request - The request {@link CreateNetworkRequest} - * @returns A Promise of CreateNetworkResponse + * @param request - The request {@link SnsApiListSnsCredentialsRequest} + * @returns A Promise of ListSnsCredentialsResponse */ - createNetwork = request => this.client.fetch({ - body: JSON.stringify(marshalCreateNetworkRequest(request, this.client.settings)), - headers: jsonContentHeaders$f, - method: 'POST', - path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/networks` - }, unmarshalCreateNetworkResponse); - + listSnsCredentials = (request = {}) => resourcePaginator.enrichForPagination( + "snsCredentials", + this.pageOfListSnsCredentials, + request + ); +} +class SqsAPI extends api.API { + /** Lists the available regions of the API. */ + static LOCALITIES = ["fr-par", "nl-ams"]; /** - * Retrieve a specific network. Retrieve an existing network, specified by its - * network ID. The response returns full details of the network, including its - * type, the topic prefix and its endpoint. + * Activate SQS. Activate SQS for the specified Project ID. SQS must be + * activated before any usage such as creating credentials and queues. + * Activating SQS does not trigger any billing, and you can deactivate at any + * time. * - * @param request - The request {@link GetNetworkRequest} - * @returns A Promise of Network + * @param request - The request {@link SqsApiActivateSqsRequest} + * @returns A Promise of SqsInfo */ - getNetwork = request => this.client.fetch({ - method: 'GET', - path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/networks/${validatePathParam('networkId', request.networkId)}` - }, unmarshalNetwork); - + activateSqs = (request = {}) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalSqsApiActivateSqsRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/mnq/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/activate-sqs` + }, + marshalling_gen.unmarshalSqsInfo + ); /** - * Delete a Network. Delete an existing network, specified by its network ID. - * Deleting a network is permanent, and cannot be undone. + * Get SQS info. Retrieve the SQS information of the specified Project ID. + * Informations include the activation status and the SQS API endpoint URL. * - * @param request - The request {@link DeleteNetworkRequest} + * @param request - The request {@link SqsApiGetSqsInfoRequest} + * @returns A Promise of SqsInfo */ - deleteNetwork = request => this.client.fetch({ - method: 'DELETE', - path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/networks/${validatePathParam('networkId', request.networkId)}` - }); - + getSqsInfo = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/mnq/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sqs-info`, + urlParams: marshalling.urlParams([ + "project_id", + request.projectId ?? this.client.settings.defaultProjectId + ]) + }, + marshalling_gen.unmarshalSqsInfo + ); /** - * BETA - Get a Cloud Twin Document. + * Deactivate SQS. Deactivate SQS for the specified Project ID. You must + * delete all queues and credentials before this call or you need to set the + * force_delete parameter. * - * @param request - The request {@link GetTwinDocumentRequest} - * @returns A Promise of TwinDocument + * @param request - The request {@link SqsApiDeactivateSqsRequest} + * @returns A Promise of SqsInfo */ - getTwinDocument = request => this.client.fetch({ - method: 'GET', - path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/twins/${validatePathParam('twinId', request.twinId)}/documents/${validatePathParam('documentName', request.documentName)}` - }, unmarshalTwinDocument); - + deactivateSqs = (request = {}) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalSqsApiDeactivateSqsRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/mnq/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/deactivate-sqs` + }, + marshalling_gen.unmarshalSqsInfo + ); /** - * BETA - Update a Cloud Twin Document. + * Create SQS credentials. Create a set of credentials for SQS, specified by a + * Project ID. Credentials give the bearer access to queues, and the level of + * permissions can be defined granularly. * - * @param request - The request {@link PutTwinDocumentRequest} - * @returns A Promise of TwinDocument + * @param request - The request {@link SqsApiCreateSqsCredentialsRequest} + * @returns A Promise of SqsCredentials */ - putTwinDocument = request => this.client.fetch({ - body: JSON.stringify(marshalPutTwinDocumentRequest(request, this.client.settings)), - headers: jsonContentHeaders$f, - method: 'PUT', - path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/twins/${validatePathParam('twinId', request.twinId)}/documents/${validatePathParam('documentName', request.documentName)}` - }, unmarshalTwinDocument); - + createSqsCredentials = (request = {}) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalSqsApiCreateSqsCredentialsRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/mnq/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sqs-credentials` + }, + marshalling_gen.unmarshalSqsCredentials + ); /** - * BETA - Patch a Cloud Twin Document. + * Delete SQS credentials. Delete a set of SQS credentials, specified by their + * credentials ID. Deleting credentials is irreversible and cannot be undone. + * The credentials can then no longer be used to access SQS. * - * @param request - The request {@link PatchTwinDocumentRequest} - * @returns A Promise of TwinDocument + * @param request - The request {@link SqsApiDeleteSqsCredentialsRequest} */ - patchTwinDocument = request => this.client.fetch({ - body: JSON.stringify(marshalPatchTwinDocumentRequest(request, this.client.settings)), - headers: jsonContentHeaders$f, - method: 'PATCH', - path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/twins/${validatePathParam('twinId', request.twinId)}/documents/${validatePathParam('documentName', request.documentName)}` - }, unmarshalTwinDocument); - + deleteSqsCredentials = (request) => this.client.fetch({ + method: "DELETE", + path: `/mnq/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sqs-credentials/${marshalling.validatePathParam("sqsCredentialsId", request.sqsCredentialsId)}` + }); /** - * BETA - Delete a Cloud Twin Document. + * Update SQS credentials. Update a set of SQS credentials. You can update the + * credentials' name, or their permissions. * - * @param request - The request {@link DeleteTwinDocumentRequest} + * @param request - The request {@link SqsApiUpdateSqsCredentialsRequest} + * @returns A Promise of SqsCredentials */ - deleteTwinDocument = request => this.client.fetch({ - method: 'DELETE', - path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/twins/${validatePathParam('twinId', request.twinId)}/documents/${validatePathParam('documentName', request.documentName)}` - }); - + updateSqsCredentials = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalSqsApiUpdateSqsCredentialsRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/mnq/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sqs-credentials/${marshalling.validatePathParam("sqsCredentialsId", request.sqsCredentialsId)}` + }, + marshalling_gen.unmarshalSqsCredentials + ); /** - * BETA - List the documents of a Cloud Twin. + * Get SQS credentials. Retrieve an existing set of credentials, identified by + * the `credentials_id`. The credentials themselves, as well as their metadata + * (name, project ID etc), are returned in the response. * - * @param request - The request {@link ListTwinDocumentsRequest} - * @returns A Promise of ListTwinDocumentsResponse + * @param request - The request {@link SqsApiGetSqsCredentialsRequest} + * @returns A Promise of SqsCredentials */ - listTwinDocuments = request => this.client.fetch({ - method: 'GET', - path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/twins/${validatePathParam('twinId', request.twinId)}` - }, unmarshalListTwinDocumentsResponse); - + getSqsCredentials = (request) => this.client.fetch( + { + method: "GET", + path: `/mnq/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sqs-credentials/${marshalling.validatePathParam("sqsCredentialsId", request.sqsCredentialsId)}` + }, + marshalling_gen.unmarshalSqsCredentials + ); + pageOfListSqsCredentials = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/mnq/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/sqs-credentials`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId] + ) + }, + marshalling_gen.unmarshalListSqsCredentialsResponse + ); /** - * BETA - Delete all the documents of a Cloud Twin. + * List SQS credentials. List existing SQS credentials in the specified + * region. The response contains only the metadata for the credentials, not + * the credentials themselves. * - * @param request - The request {@link DeleteTwinDocumentsRequest} + * @param request - The request {@link SqsApiListSqsCredentialsRequest} + * @returns A Promise of ListSqsCredentialsResponse */ - deleteTwinDocuments = request => this.client.fetch({ - method: 'DELETE', - path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/twins/${validatePathParam('twinId', request.twinId)}` - }); -}; + listSqsCredentials = (request = {}) => resourcePaginator.enrichForPagination( + "sqsCredentials", + this.pageOfListSqsCredentials, + request + ); +} +exports.NatsAPI = NatsAPI; +exports.SnsAPI = SnsAPI; +exports.SqsAPI = SqsAPI; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -var index_gen$f = /*#__PURE__*/Object.freeze({ - __proto__: null, - API: API$g, - HUB_TRANSIENT_STATUSES: HUB_TRANSIENT_STATUSES -}); +/***/ }), -var index$g = /*#__PURE__*/Object.freeze({ - __proto__: null, - v1: index_gen$f -}); +/***/ 5235: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api_gen = __nccwpck_require__(291); +const validationRules_gen = __nccwpck_require__(2574); +exports.NatsAPI = api_gen.NatsAPI; +exports.SnsAPI = api_gen.SnsAPI; +exports.SqsAPI = api_gen.SqsAPI; +exports.ValidationRules = validationRules_gen; -/** Lists transient statutes of the enum {@link NameStatus}. */ -const NAME_TRANSIENT_STATUSES = ['queued', 'publishing']; -/** Lists transient statutes of the enum {@link PinStatus}. */ -const PIN_TRANSIENT_STATUSES = ['queued', 'pinning']; +/***/ }), + +/***/ 7953: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const unmarshalPinCIDMeta = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'PinCIDMeta' failed as data isn't a dictionary.`); +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const randomName = __nccwpck_require__(8141); +const json = __nccwpck_require__(3746); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const unmarshalNatsAccount = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'NatsAccount' failed as data isn't a dictionary.` + ); } return { - id: data.id + createdAt: marshalling.unmarshalDate(data.created_at), + endpoint: data.endpoint, + id: data.id, + name: data.name, + projectId: data.project_id, + region: data.region, + updatedAt: marshalling.unmarshalDate(data.updated_at) }; }; -const unmarshalPinCID = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'PinCID' failed as data isn't a dictionary.`); +const unmarshalFile = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'File' failed as data isn't a dictionary.` + ); } return { - cid: data.cid, - meta: data.meta ? unmarshalPinCIDMeta(data.meta) : undefined, - name: data.name, - origins: data.origins + content: data.content, + name: data.name }; }; -const unmarshalPinInfo = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'PinInfo' failed as data isn't a dictionary.`); +const unmarshalNatsCredentials = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'NatsCredentials' failed as data isn't a dictionary.` + ); } return { + checksum: data.checksum, + createdAt: marshalling.unmarshalDate(data.created_at), + credentials: data.credentials ? unmarshalFile(data.credentials) : void 0, id: data.id, - progress: data.progress, - size: data.size, - statusDetails: data.status_details, - url: data.url + name: data.name, + natsAccountId: data.nats_account_id, + updatedAt: marshalling.unmarshalDate(data.updated_at) }; }; -const unmarshalName = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Name' failed as data isn't a dictionary.`); +const unmarshalSnsPermissions = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SnsPermissions' failed as data isn't a dictionary.` + ); } return { - createdAt: unmarshalDate(data.created_at), - key: data.key, + canManage: data.can_manage, + canPublish: data.can_publish, + canReceive: data.can_receive + }; +}; +const unmarshalSnsCredentials = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SnsCredentials' failed as data isn't a dictionary.` + ); + } + return { + accessKey: data.access_key, + createdAt: marshalling.unmarshalDate(data.created_at), + id: data.id, name: data.name, - nameId: data.name_id, + permissions: data.permissions ? unmarshalSnsPermissions(data.permissions) : void 0, projectId: data.project_id, region: data.region, - status: data.status, - tags: data.tags, - updatedAt: unmarshalDate(data.updated_at), - value: data.value + secretChecksum: data.secret_checksum, + secretKey: data.secret_key, + updatedAt: marshalling.unmarshalDate(data.updated_at) }; }; -const unmarshalPin = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Pin' failed as data isn't a dictionary.`); +const unmarshalSqsPermissions = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SqsPermissions' failed as data isn't a dictionary.` + ); } return { - cid: data.cid ? unmarshalPinCID(data.cid) : undefined, - createdAt: unmarshalDate(data.created_at), - delegates: data.delegates, - info: data.info ? unmarshalPinInfo(data.info) : undefined, - pinId: data.pin_id, - status: data.status + canManage: data.can_manage, + canPublish: data.can_publish, + canReceive: data.can_receive }; }; -const unmarshalVolume$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Volume' failed as data isn't a dictionary.`); +const unmarshalSqsCredentials = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SqsCredentials' failed as data isn't a dictionary.` + ); } return { - countPin: data.count_pin, - createdAt: unmarshalDate(data.created_at), + accessKey: data.access_key, + createdAt: marshalling.unmarshalDate(data.created_at), id: data.id, name: data.name, + permissions: data.permissions ? unmarshalSqsPermissions(data.permissions) : void 0, projectId: data.project_id, region: data.region, - size: data.size, - tags: data.tags, - updatedAt: unmarshalDate(data.updated_at) + secretChecksum: data.secret_checksum, + secretKey: data.secret_key, + updatedAt: marshalling.unmarshalDate(data.updated_at) }; }; -const unmarshalExportKeyNameResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ExportKeyNameResponse' failed as data isn't a dictionary.`); +const unmarshalListNatsAccountsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListNatsAccountsResponse' failed as data isn't a dictionary.` + ); } return { - createdAt: unmarshalDate(data.created_at), - nameId: data.name_id, - privateKey: data.private_key, + natsAccounts: marshalling.unmarshalArrayOfObject( + data.nats_accounts, + unmarshalNatsAccount + ), + totalCount: data.total_count + }; +}; +const unmarshalListNatsCredentialsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListNatsCredentialsResponse' failed as data isn't a dictionary.` + ); + } + return { + natsCredentials: marshalling.unmarshalArrayOfObject( + data.nats_credentials, + unmarshalNatsCredentials + ), + totalCount: data.total_count + }; +}; +const unmarshalListSnsCredentialsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListSnsCredentialsResponse' failed as data isn't a dictionary.` + ); + } + return { + snsCredentials: marshalling.unmarshalArrayOfObject( + data.sns_credentials, + unmarshalSnsCredentials + ), + totalCount: data.total_count + }; +}; +const unmarshalListSqsCredentialsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListSqsCredentialsResponse' failed as data isn't a dictionary.` + ); + } + return { + sqsCredentials: marshalling.unmarshalArrayOfObject( + data.sqs_credentials, + unmarshalSqsCredentials + ), + totalCount: data.total_count + }; +}; +const unmarshalSnsInfo = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SnsInfo' failed as data isn't a dictionary.` + ); + } + return { + createdAt: marshalling.unmarshalDate(data.created_at), projectId: data.project_id, - publicKey: data.public_key, - updatedAt: unmarshalDate(data.updated_at) + region: data.region, + snsEndpointUrl: data.sns_endpoint_url, + status: data.status, + updatedAt: marshalling.unmarshalDate(data.updated_at) + }; +}; +const unmarshalSqsInfo = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SqsInfo' failed as data isn't a dictionary.` + ); + } + return { + createdAt: marshalling.unmarshalDate(data.created_at), + projectId: data.project_id, + region: data.region, + sqsEndpointUrl: data.sqs_endpoint_url, + status: data.status, + updatedAt: marshalling.unmarshalDate(data.updated_at) }; }; -const unmarshalListNamesResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListNamesResponse' failed as data isn't a dictionary.`); +const marshalNatsApiCreateNatsAccountRequest = (request, defaults) => ({ + name: request.name || randomName("mnq"), + project_id: request.projectId ?? defaults.defaultProjectId +}); +const marshalNatsApiCreateNatsCredentialsRequest = (request, defaults) => ({ + name: request.name || randomName("mnq"), + nats_account_id: request.natsAccountId +}); +const marshalNatsApiUpdateNatsAccountRequest = (request, defaults) => ({ + name: request.name +}); +const marshalSnsApiActivateSnsRequest = (request, defaults) => ({ + project_id: request.projectId ?? defaults.defaultProjectId +}); +const marshalSnsPermissions = (request, defaults) => ({ + can_manage: request.canManage, + can_publish: request.canPublish, + can_receive: request.canReceive +}); +const marshalSnsApiCreateSnsCredentialsRequest = (request, defaults) => ({ + name: request.name || randomName("mnq_sns"), + permissions: request.permissions !== void 0 ? marshalSnsPermissions(request.permissions) : void 0, + project_id: request.projectId ?? defaults.defaultProjectId +}); +const marshalSnsApiDeactivateSnsRequest = (request, defaults) => ({ + project_id: request.projectId ?? defaults.defaultProjectId +}); +const marshalSnsApiUpdateSnsCredentialsRequest = (request, defaults) => ({ + name: request.name, + permissions: request.permissions !== void 0 ? marshalSnsPermissions(request.permissions) : void 0 +}); +const marshalSqsApiActivateSqsRequest = (request, defaults) => ({ + project_id: request.projectId ?? defaults.defaultProjectId +}); +const marshalSqsPermissions = (request, defaults) => ({ + can_manage: request.canManage, + can_publish: request.canPublish, + can_receive: request.canReceive +}); +const marshalSqsApiCreateSqsCredentialsRequest = (request, defaults) => ({ + name: request.name || randomName("mnq_sqs"), + permissions: request.permissions !== void 0 ? marshalSqsPermissions(request.permissions) : void 0, + project_id: request.projectId ?? defaults.defaultProjectId +}); +const marshalSqsApiDeactivateSqsRequest = (request, defaults) => ({ + project_id: request.projectId ?? defaults.defaultProjectId +}); +const marshalSqsApiUpdateSqsCredentialsRequest = (request, defaults) => ({ + name: request.name, + permissions: request.permissions !== void 0 ? marshalSqsPermissions(request.permissions) : void 0 +}); +exports.marshalNatsApiCreateNatsAccountRequest = marshalNatsApiCreateNatsAccountRequest; +exports.marshalNatsApiCreateNatsCredentialsRequest = marshalNatsApiCreateNatsCredentialsRequest; +exports.marshalNatsApiUpdateNatsAccountRequest = marshalNatsApiUpdateNatsAccountRequest; +exports.marshalSnsApiActivateSnsRequest = marshalSnsApiActivateSnsRequest; +exports.marshalSnsApiCreateSnsCredentialsRequest = marshalSnsApiCreateSnsCredentialsRequest; +exports.marshalSnsApiDeactivateSnsRequest = marshalSnsApiDeactivateSnsRequest; +exports.marshalSnsApiUpdateSnsCredentialsRequest = marshalSnsApiUpdateSnsCredentialsRequest; +exports.marshalSqsApiActivateSqsRequest = marshalSqsApiActivateSqsRequest; +exports.marshalSqsApiCreateSqsCredentialsRequest = marshalSqsApiCreateSqsCredentialsRequest; +exports.marshalSqsApiDeactivateSqsRequest = marshalSqsApiDeactivateSqsRequest; +exports.marshalSqsApiUpdateSqsCredentialsRequest = marshalSqsApiUpdateSqsCredentialsRequest; +exports.unmarshalListNatsAccountsResponse = unmarshalListNatsAccountsResponse; +exports.unmarshalListNatsCredentialsResponse = unmarshalListNatsCredentialsResponse; +exports.unmarshalListSnsCredentialsResponse = unmarshalListSnsCredentialsResponse; +exports.unmarshalListSqsCredentialsResponse = unmarshalListSqsCredentialsResponse; +exports.unmarshalNatsAccount = unmarshalNatsAccount; +exports.unmarshalNatsCredentials = unmarshalNatsCredentials; +exports.unmarshalSnsCredentials = unmarshalSnsCredentials; +exports.unmarshalSnsInfo = unmarshalSnsInfo; +exports.unmarshalSqsCredentials = unmarshalSqsCredentials; +exports.unmarshalSqsInfo = unmarshalSqsInfo; + + +/***/ }), + +/***/ 2574: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const NatsAccount = { + name: { + maxLength: 64, + minLength: 1 + } +}; +const NatsApiCreateNatsAccountRequest = { + name: { + maxLength: 64, + minLength: 1 + } +}; +const NatsApiCreateNatsCredentialsRequest = { + name: { + maxLength: 500, + minLength: 1 + } +}; +const NatsApiUpdateNatsAccountRequest = { + name: { + maxLength: 64, + minLength: 1 + } +}; +const NatsCredentials = { + name: { + maxLength: 500, + minLength: 1 + } +}; +const SnsApiCreateSnsCredentialsRequest = { + name: { + maxLength: 500, + minLength: 1 + } +}; +const SnsApiUpdateSnsCredentialsRequest = { + name: { + maxLength: 500, + minLength: 1 + } +}; +const SnsCredentials = { + accessKey: { + minLength: 1 + }, + name: { + maxLength: 500, + minLength: 1 } - return { - names: unmarshalArrayOfObject(data.names, unmarshalName), - totalCount: data.total_count - }; }; -const unmarshalListPinsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListPinsResponse' failed as data isn't a dictionary.`); +const SqsApiCreateSqsCredentialsRequest = { + name: { + maxLength: 500, + minLength: 1 } - return { - pins: unmarshalArrayOfObject(data.pins, unmarshalPin), - totalCount: data.total_count - }; }; -const unmarshalListVolumesResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListVolumesResponse' failed as data isn't a dictionary.`); +const SqsApiUpdateSqsCredentialsRequest = { + name: { + maxLength: 500, + minLength: 1 } - return { - totalCount: data.total_count, - volumes: unmarshalArrayOfObject(data.volumes, unmarshalVolume$1) - }; }; -const unmarshalReplacePinResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ReplacePinResponse' failed as data isn't a dictionary.`); +const SqsCredentials = { + accessKey: { + minLength: 1 + }, + name: { + maxLength: 500, + minLength: 1 } - return { - pin: data.pin ? unmarshalPin(data.pin) : undefined - }; }; -const marshalPinOptions = (request, defaults) => ({ - replication_count: request.replicationCount, - required_zones: request.requiredZones -}); -const marshalCreatePinByCIDRequest = (request, defaults) => ({ - cid: request.cid, - name: request.name, - origins: request.origins, - pin_options: request.pinOptions ? marshalPinOptions(request.pinOptions) : undefined, - volume_id: request.volumeId -}); -const marshalCreatePinByURLRequest = (request, defaults) => ({ - name: request.name, - pin_options: request.pinOptions ? marshalPinOptions(request.pinOptions) : undefined, - url: request.url, - volume_id: request.volumeId -}); -const marshalCreateVolumeRequest = (request, defaults) => ({ - name: request.name, - project_id: request.projectId ?? defaults.defaultProjectId -}); -const marshalIpnsApiCreateNameRequest = (request, defaults) => ({ - name: request.name, - project_id: request.projectId ?? defaults.defaultProjectId, - value: request.value -}); -const marshalIpnsApiImportKeyNameRequest = (request, defaults) => ({ - name: request.name, - private_key: request.privateKey, - project_id: request.projectId ?? defaults.defaultProjectId, - value: request.value -}); -const marshalIpnsApiUpdateNameRequest = (request, defaults) => ({ - name: request.name, - tags: request.tags, - value: request.value -}); -const marshalReplacePinRequest = (request, defaults) => ({ - cid: request.cid, - name: request.name, - origins: request.origins, - pin_options: request.pinOptions ? marshalPinOptions(request.pinOptions) : undefined, - volume_id: request.volumeId -}); -const marshalUpdateVolumeRequest = (request, defaults) => ({ - name: request.name, - tags: request.tags -}); +exports.NatsAccount = NatsAccount; +exports.NatsApiCreateNatsAccountRequest = NatsApiCreateNatsAccountRequest; +exports.NatsApiCreateNatsCredentialsRequest = NatsApiCreateNatsCredentialsRequest; +exports.NatsApiUpdateNatsAccountRequest = NatsApiUpdateNatsAccountRequest; +exports.NatsCredentials = NatsCredentials; +exports.SnsApiCreateSnsCredentialsRequest = SnsApiCreateSnsCredentialsRequest; +exports.SnsApiUpdateSnsCredentialsRequest = SnsApiUpdateSnsCredentialsRequest; +exports.SnsCredentials = SnsCredentials; +exports.SqsApiCreateSqsCredentialsRequest = SqsApiCreateSqsCredentialsRequest; +exports.SqsApiUpdateSqsCredentialsRequest = SqsApiUpdateSqsCredentialsRequest; +exports.SqsCredentials = SqsCredentials; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const jsonContentHeaders$e = { - 'Content-Type': 'application/json; charset=utf-8' -}; -/** IPFS Pinning service API. */ -let API$f = class API extends API$u { - /** Lists the available regions of the API. */ - static LOCALITIES = ['fr-par', 'nl-ams', 'pl-waw']; +/***/ }), + +/***/ 1606: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const index_gen = __nccwpck_require__(8937); +exports.v1alpha1 = index_gen; + + +/***/ }), + +/***/ 341: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const intervalRetrier = __nccwpck_require__(9052); +const api = __nccwpck_require__(3042); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const resourcePaginator = __nccwpck_require__(4983); +const content_gen = __nccwpck_require__(1842); +const marshalling_gen = __nccwpck_require__(7875); +const jsonContentHeaders = { + "Content-Type": "application/json; charset=utf-8" +}; +class API extends api.API { /** - * Create a new volume. Create a new volume from a Project ID. Volume is - * identified by an ID and used to host pin references. Volume is personal (at - * least to your organization) even if IPFS blocks and CID are available to - * anyone. Should be the first command you made because every pin must be - * attached to a volume. + * Get job information. Retrieve information about the provided **job ID**, + * such as status, payload, and result. * - * @param request - The request {@link CreateVolumeRequest} - * @returns A Promise of Volume + * @param request - The request {@link GetJobRequest} + * @returns A Promise of Job */ - createVolume = request => this.client.fetch({ - body: JSON.stringify(marshalCreateVolumeRequest(request, this.client.settings)), - headers: jsonContentHeaders$e, - method: 'POST', - path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/volumes` - }, unmarshalVolume$1); - + getJob = (request) => this.client.fetch( + { + method: "GET", + path: `/qaas/v1alpha1/jobs/${marshalling.validatePathParam("jobId", request.jobId)}` + }, + marshalling_gen.unmarshalJob + ); /** - * Get information about a volume. Retrieve information about a specific - * volume. + * Waits for {@link Job} to be in a final state. * - * @param request - The request {@link GetVolumeRequest} - * @returns A Promise of Volume + * @param request - The request {@link GetJobRequest} + * @param options - The waiting options + * @returns A Promise of Job + */ + waitForJob = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve(!content_gen.JOB_TRANSIENT_STATUSES.includes(res.status))), + this.getJob, + request, + options + ); + pageOfListJobs = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/qaas/v1alpha1/jobs`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["tags", request.tags], + ...Object.entries( + marshalling.resolveOneOf([ + { param: "session_id", value: request.sessionId }, + { + default: this.client.settings.defaultProjectId, + param: "project_id", + value: request.projectId + } + ]) + ) + ) + }, + marshalling_gen.unmarshalListJobsResponse + ); + /** + * List all jobs within a project or session. Retrieve information about all + * jobs within a given project or session. + * + * @param request - The request {@link ListJobsRequest} + * @returns A Promise of ListJobsResponse + */ + listJobs = (request = {}) => resourcePaginator.enrichForPagination("jobs", this.pageOfListJobs, request); + pageOfListJobResults = (request) => this.client.fetch( + { + method: "GET", + path: `/qaas/v1alpha1/jobs/${marshalling.validatePathParam("jobId", request.jobId)}/results`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListJobResultsResponse + ); + /** + * List all results of a job. Retrieve all intermediate and final results of a + * job. + * + * @param request - The request {@link ListJobResultsRequest} + * @returns A Promise of ListJobResultsResponse */ - getVolume = request => this.client.fetch({ - method: 'GET', - path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/volumes/${validatePathParam('volumeId', request.volumeId)}` - }, unmarshalVolume$1); - pageOfListVolumes = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/volumes`, - urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId ?? this.client.settings.defaultProjectId]) - }, unmarshalListVolumesResponse); - + listJobResults = (request) => resourcePaginator.enrichForPagination("jobResults", this.pageOfListJobResults, request); /** - * List all volumes by a Project ID. Retrieve information about all volumes - * from a Project ID. + * Create a job. Create a job to be executed inside a session. * - * @param request - The request {@link ListVolumesRequest} - * @returns A Promise of ListVolumesResponse + * @param request - The request {@link CreateJobRequest} + * @returns A Promise of Job */ - listVolumes = (request = {}) => enrichForPagination('volumes', this.pageOfListVolumes, request); - + createJob = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateJobRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/qaas/v1alpha1/jobs` + }, + marshalling_gen.unmarshalJob + ); + /** + * Update job information. Update job information about the provided **job + * ID**. + * + * @param request - The request {@link UpdateJobRequest} + * @returns A Promise of Job + */ + updateJob = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateJobRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/qaas/v1alpha1/jobs/${marshalling.validatePathParam("jobId", request.jobId)}` + }, + marshalling_gen.unmarshalJob + ); /** - * Update volume information. Update volume information (tag, name...). + * Cancel a job. Cancel the job corresponding to the provided **job ID**. * - * @param request - The request {@link UpdateVolumeRequest} - * @returns A Promise of Volume + * @param request - The request {@link CancelJobRequest} + * @returns A Promise of Job */ - updateVolume = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateVolumeRequest(request, this.client.settings)), - headers: jsonContentHeaders$e, - method: 'PATCH', - path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/volumes/${validatePathParam('volumeId', request.volumeId)}` - }, unmarshalVolume$1); - + cancelJob = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/qaas/v1alpha1/jobs/${marshalling.validatePathParam("jobId", request.jobId)}/cancel` + }, + marshalling_gen.unmarshalJob + ); /** - * Delete an existing volume. Delete a volume by its ID and every pin attached - * to this volume. This process can take a while to conclude, depending on the - * size of your pinned content. + * Delete a job. Delete the job corresponding to the provided **job ID**. * - * @param request - The request {@link DeleteVolumeRequest} + * @param request - The request {@link DeleteJobRequest} */ - deleteVolume = request => this.client.fetch({ - method: 'DELETE', - path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/volumes/${validatePathParam('volumeId', request.volumeId)}` + deleteJob = (request) => this.client.fetch({ + method: "DELETE", + path: `/qaas/v1alpha1/jobs/${marshalling.validatePathParam("jobId", request.jobId)}` }); - /** - * Create a pin by URL. Will fetch and store the content pointed by the - * provided URL. The content must be available on the public IPFS network. The - * content (IPFS blocks) will be host by the pinning service until pin - * deletion. From that point, any other IPFS peer can fetch and host your - * content: Make sure to pin public or encrypted content. Many pin requests - * (from different users) can target the same CID. A pin is defined by its ID - * (UUID), its status (queued, pinning, pinned or failed) and target CID. + * Get a job circuit. Retrieve the circuit of the provided **job ID**. * - * @param request - The request {@link CreatePinByURLRequest} - * @returns A Promise of Pin + * @param request - The request {@link GetJobCircuitRequest} + * @returns A Promise of JobCircuit */ - createPinByURL = request => this.client.fetch({ - body: JSON.stringify(marshalCreatePinByURLRequest(request, this.client.settings)), - headers: jsonContentHeaders$e, - method: 'POST', - path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/pins/create-by-url` - }, unmarshalPin); - + getJobCircuit = (request) => this.client.fetch( + { + method: "GET", + path: `/qaas/v1alpha1/jobs/${marshalling.validatePathParam("jobId", request.jobId)}/circuit` + }, + marshalling_gen.unmarshalJobCircuit + ); /** - * Create a pin by CID. Will fetch and store the content pointed by the - * provided CID. The content must be available on the public IPFS network. The - * content (IPFS blocks) will be host by the pinning service until pin - * deletion. From that point, any other IPFS peer can fetch and host your - * content: Make sure to pin public or encrypted content. Many pin requests - * (from different users) can target the same CID. A pin is defined by its ID - * (UUID), its status (queued, pinning, pinned or failed) and target CID. + * Get platform information. Retrieve information about the provided + * **platform ID**, such as provider name, technology, and type. * - * @param request - The request {@link CreatePinByCIDRequest} - * @returns A Promise of Pin + * @param request - The request {@link GetPlatformRequest} + * @returns A Promise of Platform */ - createPinByCID = request => this.client.fetch({ - body: JSON.stringify(marshalCreatePinByCIDRequest(request, this.client.settings)), - headers: jsonContentHeaders$e, - method: 'POST', - path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/pins/create-by-cid` - }, unmarshalPin); - replacePin = request => this.client.fetch({ - body: JSON.stringify(marshalReplacePinRequest(request, this.client.settings)), - headers: jsonContentHeaders$e, - method: 'POST', - path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/pins/${validatePathParam('pinId', request.pinId)}/replace` - }, unmarshalReplacePinResponse); - + getPlatform = (request) => this.client.fetch( + { + method: "GET", + path: `/qaas/v1alpha1/platforms/${marshalling.validatePathParam("platformId", request.platformId)}` + }, + marshalling_gen.unmarshalPlatform + ); + pageOfListPlatforms = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/qaas/v1alpha1/platforms`, + urlParams: marshalling.urlParams( + ["backend_name", request.backendName], + ["name", request.name], + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["platform_technology", request.platformTechnology], + ["platform_type", request.platformType], + ["provider_name", request.providerName] + ) + }, + marshalling_gen.unmarshalListPlatformsResponse + ); /** - * Get pin information. Retrieve information about the provided **pin ID**, - * such as status, last modification, and CID. + * List all available platforms. Retrieve information about all platforms. * - * @param request - The request {@link GetPinRequest} - * @returns A Promise of Pin + * @param request - The request {@link ListPlatformsRequest} + * @returns A Promise of ListPlatformsResponse */ - getPin = request => this.client.fetch({ - method: 'GET', - path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/pins/${validatePathParam('pinId', request.pinId)}`, - urlParams: urlParams(['volume_id', request.volumeId]) - }, unmarshalPin); - + listPlatforms = (request = {}) => resourcePaginator.enrichForPagination("platforms", this.pageOfListPlatforms, request); /** - * Waits for {@link Pin} to be in a final state. + * Get session infrormation. Retrieve information about the provided **session + * ID**, such as name, status, and number of executed jobs. * - * @param request - The request {@link GetPinRequest} + * @param request - The request {@link GetSessionRequest} + * @returns A Promise of Session + */ + getSession = (request) => this.client.fetch( + { + method: "GET", + path: `/qaas/v1alpha1/sessions/${marshalling.validatePathParam("sessionId", request.sessionId)}` + }, + marshalling_gen.unmarshalSession + ); + /** + * Waits for {@link Session} to be in a final state. + * + * @param request - The request {@link GetSessionRequest} * @param options - The waiting options - * @returns A Promise of Pin + * @returns A Promise of Session + */ + waitForSession = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve(!content_gen.SESSION_TRANSIENT_STATUSES.includes(res.status))), + this.getSession, + request, + options + ); + pageOfListSessions = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/qaas/v1alpha1/sessions`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["platform_id", request.platformId], + [ + "project_id", + request.projectId ?? this.client.settings.defaultProjectId + ], + ["tags", request.tags] + ) + }, + marshalling_gen.unmarshalListSessionsResponse + ); + /** + * List all sessions. Retrieve information about all sessions. + * + * @param request - The request {@link ListSessionsRequest} + * @returns A Promise of ListSessionsResponse */ - waitForPin = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!PIN_TRANSIENT_STATUSES.includes(res.status))), this.getPin, request, options); - pageOfListPins = request => this.client.fetch({ - method: 'GET', - path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/pins`, - urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId], ['status', request.status ?? 'unknown_status'], ['volume_id', request.volumeId]) - }, unmarshalListPinsResponse); - + listSessions = (request = {}) => resourcePaginator.enrichForPagination("sessions", this.pageOfListSessions, request); /** - * List all pins within a volume. Retrieve information about all pins within a - * volume. + * Create a session. Create a dedicated session for the specified platform. * - * @param request - The request {@link ListPinsRequest} - * @returns A Promise of ListPinsResponse + * @param request - The request {@link CreateSessionRequest} + * @returns A Promise of Session */ - listPins = request => enrichForPagination('pins', this.pageOfListPins, request); - + createSession = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateSessionRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/qaas/v1alpha1/sessions` + }, + marshalling_gen.unmarshalSession + ); + /** + * Update session information. Update session information of the provided + * **session ID**. + * + * @param request - The request {@link UpdateSessionRequest} + * @returns A Promise of Session + */ + updateSession = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateSessionRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/qaas/v1alpha1/sessions/${marshalling.validatePathParam("sessionId", request.sessionId)}` + }, + marshalling_gen.unmarshalSession + ); /** - * Create an unpin request. An unpin request means that you no longer own the - * content. This content can therefore be removed and no longer provided on - * the IPFS network. + * Terminate an existing session. Terminate a session by its unique ID and + * cancel all its attached jobs. * - * @param request - The request {@link DeletePinRequest} + * @param request - The request {@link TerminateSessionRequest} + * @returns A Promise of Session */ - deletePin = request => this.client.fetch({ - method: 'DELETE', - path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/pins/${validatePathParam('pinId', request.pinId)}`, - urlParams: urlParams(['volume_id', request.volumeId]) - }); -}; - -/** IPFS Naming service API. */ -class IpnsAPI extends API$u { - /** Lists the available regions of the API. */ - static LOCALITIES = ['fr-par', 'nl-ams', 'pl-waw']; - + terminateSession = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/qaas/v1alpha1/sessions/${marshalling.validatePathParam("sessionId", request.sessionId)}/terminate` + }, + marshalling_gen.unmarshalSession + ); /** - * Create a new name. You can use the `ipns key` command to list and generate - * more names and their respective keys. + * Delete an existing session. Delete a session by its unique ID and delete + * all its attached jobs. * - * @param request - The request {@link IpnsApiCreateNameRequest} - * @returns A Promise of Name + * @param request - The request {@link DeleteSessionRequest} */ - createName = request => this.client.fetch({ - body: JSON.stringify(marshalIpnsApiCreateNameRequest(request, this.client.settings)), - headers: jsonContentHeaders$e, - method: 'POST', - path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/names` - }, unmarshalName); - + deleteSession = (request) => this.client.fetch({ + method: "DELETE", + path: `/qaas/v1alpha1/sessions/${marshalling.validatePathParam("sessionId", request.sessionId)}` + }); + pageOfListSessionACLs = (request) => this.client.fetch( + { + method: "GET", + path: `/qaas/v1alpha1/sessions/${marshalling.validatePathParam("sessionId", request.sessionId)}/acls`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListSessionACLsResponse + ); + listSessionACLs = (request) => resourcePaginator.enrichForPagination("acls", this.pageOfListSessionACLs, request); + /** + * Create a process. Create a new process for the specified application on a + * specified platform. + * + * @param request - The request {@link CreateProcessRequest} + * @returns A Promise of Process + */ + createProcess = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateProcessRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/qaas/v1alpha1/processes` + }, + marshalling_gen.unmarshalProcess + ); /** - * Get information about a name. Retrieve information about a specific name. + * Get process infrormation. Retrieve information about the provided **process + * ID**, such as name, status and progress. * - * @param request - The request {@link IpnsApiGetNameRequest} - * @returns A Promise of Name + * @param request - The request {@link GetProcessRequest} + * @returns A Promise of Process */ - getName = request => this.client.fetch({ - method: 'GET', - path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/names/${validatePathParam('nameId', request.nameId)}` - }, unmarshalName); - + getProcess = (request) => this.client.fetch( + { + method: "GET", + path: `/qaas/v1alpha1/processes/${marshalling.validatePathParam("processId", request.processId)}` + }, + marshalling_gen.unmarshalProcess + ); /** - * Waits for {@link Name} to be in a final state. + * Waits for {@link Process} to be in a final state. * - * @param request - The request {@link GetNameRequest} + * @param request - The request {@link GetProcessRequest} * @param options - The waiting options - * @returns A Promise of Name + * @returns A Promise of Process + */ + waitForProcess = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve(!content_gen.PROCESS_TRANSIENT_STATUSES.includes(res.status))), + this.getProcess, + request, + options + ); + pageOfListProcesses = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/qaas/v1alpha1/processes`, + urlParams: marshalling.urlParams( + ["application_id", request.applicationId], + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + [ + "project_id", + request.projectId ?? this.client.settings.defaultProjectId + ], + ["tags", request.tags] + ) + }, + marshalling_gen.unmarshalListProcessesResponse + ); + /** + * List all processes. Retrieve information about all processes. + * + * @param request - The request {@link ListProcessesRequest} + * @returns A Promise of ListProcessesResponse */ - waitForName = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!NAME_TRANSIENT_STATUSES.includes(res.status))), this.getName, request, options); - + listProcesses = (request = {}) => resourcePaginator.enrichForPagination("processes", this.pageOfListProcesses, request); /** - * Delete an existing name. Delete a name by its ID. + * Update process information. Update process information of the provided + * **process ID**. * - * @param request - The request {@link IpnsApiDeleteNameRequest} + * @param request - The request {@link UpdateProcessRequest} + * @returns A Promise of Process */ - deleteName = request => this.client.fetch({ - method: 'DELETE', - path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/names/${validatePathParam('nameId', request.nameId)}` - }); - pageOfListNames = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/names`, - urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId]) - }, unmarshalListNamesResponse); - + updateProcess = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateProcessRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/qaas/v1alpha1/processes/${marshalling.validatePathParam("processId", request.processId)}` + }, + marshalling_gen.unmarshalProcess + ); /** - * List all names by a Project ID. Retrieve information about all names from a - * Project ID. + * Cancel a running process. Cancel a process by its unique ID. Intermediate + * results are still available. * - * @param request - The request {@link IpnsApiListNamesRequest} - * @returns A Promise of ListNamesResponse + * @param request - The request {@link CancelProcessRequest} + * @returns A Promise of Process */ - listNames = (request = {}) => enrichForPagination('names', this.pageOfListNames, request); - + cancelProcess = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/qaas/v1alpha1/processes/${marshalling.validatePathParam("processId", request.processId)}/cancel` + }, + marshalling_gen.unmarshalProcess + ); /** - * Update name information. Update name information (CID, tag, name...). + * Delete an existing process. Delete a process by its unique ID and delete + * all its data. * - * @param request - The request {@link IpnsApiUpdateNameRequest} - * @returns A Promise of Name + * @param request - The request {@link DeleteProcessRequest} */ - updateName = request => this.client.fetch({ - body: JSON.stringify(marshalIpnsApiUpdateNameRequest(request, this.client.settings)), - headers: jsonContentHeaders$e, - method: 'PATCH', - path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/names/${validatePathParam('nameId', request.nameId)}` - }, unmarshalName); - + deleteProcess = (request) => this.client.fetch({ + method: "DELETE", + path: `/qaas/v1alpha1/processes/${marshalling.validatePathParam("processId", request.processId)}` + }); + pageOfListProcessResults = (request) => this.client.fetch( + { + method: "GET", + path: `/qaas/v1alpha1/processes/${marshalling.validatePathParam("processId", request.processId)}/results`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListProcessResultsResponse + ); /** - * Export your private key. Export a private key by its ID. + * List all results of a process. Retrieve all intermediate and final result + * of a process. * - * @param request - The request {@link IpnsApiExportKeyNameRequest} - * @returns A Promise of ExportKeyNameResponse + * @param request - The request {@link ListProcessResultsRequest} + * @returns A Promise of ListProcessResultsResponse */ - exportKeyName = request => this.client.fetch({ - method: 'GET', - path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/names/${validatePathParam('nameId', request.nameId)}/export-key` - }, unmarshalExportKeyNameResponse); - + listProcessResults = (request) => resourcePaginator.enrichForPagination( + "processResults", + this.pageOfListProcessResults, + request + ); /** - * Import your private key. Import a private key. + * Get application information. Retrieve information about the provided + * **applcation ID**, such as name, type and compatible platforms. * - * @param request - The request {@link IpnsApiImportKeyNameRequest} - * @returns A Promise of Name + * @param request - The request {@link GetApplicationRequest} + * @returns A Promise of Application + */ + getApplication = (request) => this.client.fetch( + { + method: "GET", + path: `/qaas/v1alpha1/applications/${marshalling.validatePathParam("applicationId", request.applicationId)}` + }, + marshalling_gen.unmarshalApplication + ); + pageOfListApplications = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/qaas/v1alpha1/applications`, + urlParams: marshalling.urlParams( + ["application_type", request.applicationType], + ["name", request.name], + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListApplicationsResponse + ); + /** + * List all available applications. Retrieve information about all + * applications. + * + * @param request - The request {@link ListApplicationsRequest} + * @returns A Promise of ListApplicationsResponse */ - importKeyName = request => this.client.fetch({ - body: JSON.stringify(marshalIpnsApiImportKeyNameRequest(request, this.client.settings)), - headers: jsonContentHeaders$e, - method: 'POST', - path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/names/import-key` - }, unmarshalName); + listApplications = (request = {}) => resourcePaginator.enrichForPagination("applications", this.pageOfListApplications, request); } +exports.API = API; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -var index_gen$e = /*#__PURE__*/Object.freeze({ - __proto__: null, - API: API$f, - IpnsAPI: IpnsAPI, - NAME_TRANSIENT_STATUSES: NAME_TRANSIENT_STATUSES, - PIN_TRANSIENT_STATUSES: PIN_TRANSIENT_STATUSES -}); +/***/ }), -var index$f = /*#__PURE__*/Object.freeze({ - __proto__: null, - v1alpha1: index_gen$e -}); +/***/ 1842: +/***/ ((__unused_webpack_module, exports) => { -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const JOB_TRANSIENT_STATUSES = [ + "waiting", + "running", + "cancelling" +]; +const PROCESS_TRANSIENT_STATUSES = [ + "starting", + "running", + "cancelling" +]; +const SESSION_TRANSIENT_STATUSES = [ + "starting", + "stopping" +]; +exports.JOB_TRANSIENT_STATUSES = JOB_TRANSIENT_STATUSES; +exports.PROCESS_TRANSIENT_STATUSES = PROCESS_TRANSIENT_STATUSES; +exports.SESSION_TRANSIENT_STATUSES = SESSION_TRANSIENT_STATUSES; + + +/***/ }), -/** Lists transient statutes of the enum {@link ClusterStatus}. */ -const CLUSTER_TRANSIENT_STATUSES$1 = ['creating', 'deleting', 'updating']; +/***/ 8937: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api_gen = __nccwpck_require__(341); +const content_gen = __nccwpck_require__(1842); +const validationRules_gen = __nccwpck_require__(9171); +exports.API = api_gen.API; +exports.JOB_TRANSIENT_STATUSES = content_gen.JOB_TRANSIENT_STATUSES; +exports.PROCESS_TRANSIENT_STATUSES = content_gen.PROCESS_TRANSIENT_STATUSES; +exports.SESSION_TRANSIENT_STATUSES = content_gen.SESSION_TRANSIENT_STATUSES; +exports.ValidationRules = validationRules_gen; -/** Lists transient statutes of the enum {@link NodeStatus}. */ -const NODE_TRANSIENT_STATUSES = ['creating', 'deleting', 'rebooting', 'upgrading', 'starting', 'registering']; -/** Lists transient statutes of the enum {@link PoolStatus}. */ -const POOL_TRANSIENT_STATUSES = ['deleting', 'scaling', 'upgrading']; +/***/ }), + +/***/ 7875: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const unmarshalMaintenanceWindow = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'MaintenanceWindow' failed as data isn't a dictionary.`); - } - return { - day: data.day, - startHour: data.start_hour - }; -}; -const unmarshalClusterAutoUpgrade = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ClusterAutoUpgrade' failed as data isn't a dictionary.`); - } - return { - enabled: data.enabled, - maintenanceWindow: data.maintenance_window ? unmarshalMaintenanceWindow(data.maintenance_window) : undefined - }; -}; -const unmarshalClusterAutoscalerConfig = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ClusterAutoscalerConfig' failed as data isn't a dictionary.`); - } - return { - balanceSimilarNodeGroups: data.balance_similar_node_groups, - estimator: data.estimator, - expander: data.expander, - expendablePodsPriorityCutoff: data.expendable_pods_priority_cutoff, - ignoreDaemonsetsUtilization: data.ignore_daemonsets_utilization, - maxGracefulTerminationSec: data.max_graceful_termination_sec, - scaleDownDelayAfterAdd: data.scale_down_delay_after_add, - scaleDownDisabled: data.scale_down_disabled, - scaleDownUnneededTime: data.scale_down_unneeded_time, - scaleDownUtilizationThreshold: data.scale_down_utilization_threshold - }; -}; -const unmarshalClusterOpenIDConnectConfig = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ClusterOpenIDConnectConfig' failed as data isn't a dictionary.`); - } - return { - clientId: data.client_id, - groupsClaim: data.groups_claim, - groupsPrefix: data.groups_prefix, - issuerUrl: data.issuer_url, - requiredClaim: data.required_claim, - usernameClaim: data.username_claim, - usernamePrefix: data.username_prefix - }; -}; -const unmarshalPoolUpgradePolicy = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'PoolUpgradePolicy' failed as data isn't a dictionary.`); - } - return { - maxSurge: data.max_surge, - maxUnavailable: data.max_unavailable - }; -}; -const unmarshalCluster$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Cluster' failed as data isn't a dictionary.`); - } - return { - admissionPlugins: data.admission_plugins, - apiserverCertSans: data.apiserver_cert_sans, - autoscalerConfig: data.autoscaler_config ? unmarshalClusterAutoscalerConfig(data.autoscaler_config) : undefined, - autoUpgrade: data.auto_upgrade ? unmarshalClusterAutoUpgrade(data.auto_upgrade) : undefined, - clusterUrl: data.cluster_url, - cni: data.cni, - commitmentEndsAt: unmarshalDate(data.commitment_ends_at), - createdAt: unmarshalDate(data.created_at), - dashboardEnabled: data.dashboard_enabled, - description: data.description, - dnsWildcard: data.dns_wildcard, - featureGates: data.feature_gates, - id: data.id, - ingress: data.ingress, - name: data.name, - openIdConnectConfig: data.open_id_connect_config ? unmarshalClusterOpenIDConnectConfig(data.open_id_connect_config) : undefined, - organizationId: data.organization_id, - privateNetworkId: data.private_network_id, - projectId: data.project_id, - region: data.region, - status: data.status, - tags: data.tags, - type: data.type, - updatedAt: unmarshalDate(data.updated_at), - upgradeAvailable: data.upgrade_available, - version: data.version - }; -}; -const unmarshalClusterType = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ClusterType' failed as data isn't a dictionary.`); +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const json = __nccwpck_require__(3746); +const customMarshalling = __nccwpck_require__(7586); +const marshalling = __nccwpck_require__(1162); +const unmarshalJobCircuit = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'JobCircuit' failed as data isn't a dictionary.` + ); } return { - availability: data.availability, - commitmentDelay: data.commitment_delay, - dedicated: data.dedicated, - maxNodes: data.max_nodes, - memory: data.memory, - name: data.name, - resiliency: data.resiliency, - sla: data.sla + percevalCircuit: data.perceval_circuit, + qiskitCircuit: data.qiskit_circuit }; }; -const unmarshalNode = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Node' failed as data isn't a dictionary.`); +const unmarshalApplication = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Application' failed as data isn't a dictionary.` + ); } return { - clusterId: data.cluster_id, - conditions: data.conditions, - createdAt: unmarshalDate(data.created_at), - errorMessage: data.error_message, + compatiblePlatformIds: data.compatible_platform_ids, id: data.id, + inputTemplate: data.input_template, name: data.name, - poolId: data.pool_id, - providerId: data.provider_id, - publicIpV4: data.public_ip_v4, - publicIpV6: data.public_ip_v6, - region: data.region, - status: data.status, - updatedAt: unmarshalDate(data.updated_at) + type: data.type }; }; -const unmarshalPool = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Pool' failed as data isn't a dictionary.`); +const unmarshalJob = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Job' failed as data isn't a dictionary.` + ); } return { - autohealing: data.autohealing, - autoscaling: data.autoscaling, - clusterId: data.cluster_id, - containerRuntime: data.container_runtime, - createdAt: unmarshalDate(data.created_at), + createdAt: marshalling.unmarshalDate(data.created_at), id: data.id, - kubeletArgs: data.kubelet_args, - maxSize: data.max_size, - minSize: data.min_size, + jobDuration: data.job_duration, name: data.name, - nodeType: data.node_type, - placementGroupId: data.placement_group_id, - publicIpDisabled: data.public_ip_disabled, - region: data.region, - rootVolumeSize: data.root_volume_size, - rootVolumeType: data.root_volume_type, - size: data.size, + progressMessage: data.progress_message, + resultDistribution: data.result_distribution, + sessionId: data.session_id, + startedAt: marshalling.unmarshalDate(data.started_at), status: data.status, tags: data.tags, - updatedAt: unmarshalDate(data.updated_at), - upgradePolicy: data.upgrade_policy ? unmarshalPoolUpgradePolicy(data.upgrade_policy) : undefined, - version: data.version, - zone: data.zone + updatedAt: marshalling.unmarshalDate(data.updated_at) }; }; -const unmarshalVersion$2 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Version' failed as data isn't a dictionary.`); +const unmarshalPlatformHardware = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'PlatformHardware' failed as data isn't a dictionary.` + ); } return { - availableAdmissionPlugins: data.available_admission_plugins, - availableCnis: data.available_cnis, - availableContainerRuntimes: data.available_container_runtimes, - availableFeatureGates: data.available_feature_gates, - availableIngresses: data.available_ingresses, - availableKubeletArgs: data.available_kubelet_args, - label: data.label, + gpus: data.gpus, + gpusNetwork: data.gpus_network, name: data.name, - region: data.region + ram: data.ram, + vcpus: data.vcpus, + vram: data.vram }; }; -const unmarshalExternalNode = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ExternalNode' failed as data isn't a dictionary.`); +const unmarshalPlatform = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Platform' failed as data isn't a dictionary.` + ); } return { - clusterCa: data.cluster_ca, - clusterUrl: data.cluster_url, - externalIp: data.external_ip, + availability: data.availability, + backendName: data.backend_name, + hardware: data.hardware ? unmarshalPlatformHardware(data.hardware) : void 0, id: data.id, - kubeletConfig: data.kubelet_config, - kubeToken: data.kube_token, + maxQubitCount: data.max_qubit_count, + metadata: data.metadata, name: data.name, - poolVersion: data.pool_version - }; -}; -const unmarshalListClusterAvailableTypesResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListClusterAvailableTypesResponse' failed as data isn't a dictionary.`); - } - return { - clusterTypes: unmarshalArrayOfObject(data.cluster_types, unmarshalClusterType), - totalCount: data.total_count - }; -}; -const unmarshalListClusterAvailableVersionsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListClusterAvailableVersionsResponse' failed as data isn't a dictionary.`); - } - return { - versions: unmarshalArrayOfObject(data.versions, unmarshalVersion$2) - }; -}; -const unmarshalListClusterTypesResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListClusterTypesResponse' failed as data isn't a dictionary.`); - } - return { - clusterTypes: unmarshalArrayOfObject(data.cluster_types, unmarshalClusterType), - totalCount: data.total_count - }; -}; -const unmarshalListClustersResponse$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListClustersResponse' failed as data isn't a dictionary.`); - } - return { - clusters: unmarshalArrayOfObject(data.clusters, unmarshalCluster$1), - totalCount: data.total_count - }; -}; -const unmarshalListNodesResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListNodesResponse' failed as data isn't a dictionary.`); - } - return { - nodes: unmarshalArrayOfObject(data.nodes, unmarshalNode), - totalCount: data.total_count - }; -}; -const unmarshalListPoolsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListPoolsResponse' failed as data isn't a dictionary.`); - } - return { - pools: unmarshalArrayOfObject(data.pools, unmarshalPool), - totalCount: data.total_count + pricePerHour: data.price_per_hour ? customMarshalling.unmarshalMoney(data.price_per_hour) : void 0, + providerName: data.provider_name, + technology: data.technology, + type: data.type, + version: data.version }; }; -const unmarshalListVersionsResponse$2 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListVersionsResponse' failed as data isn't a dictionary.`); +const unmarshalProcess = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Process' failed as data isn't a dictionary.` + ); } return { - versions: unmarshalArrayOfObject(data.versions, unmarshalVersion$2) - }; -}; -const marshalCreateClusterRequestPoolConfigUpgradePolicy = (request, defaults) => ({ - max_surge: request.maxSurge, - max_unavailable: request.maxUnavailable -}); -const marshalMaintenanceWindow = (request, defaults) => ({ - day: request.day, - start_hour: request.startHour -}); -const marshalCreateClusterRequestAutoUpgrade = (request, defaults) => ({ - enable: request.enable, - maintenance_window: request.maintenanceWindow ? marshalMaintenanceWindow(request.maintenanceWindow) : undefined -}); -const marshalCreateClusterRequestAutoscalerConfig = (request, defaults) => ({ - balance_similar_node_groups: request.balanceSimilarNodeGroups, - estimator: request.estimator, - expander: request.expander, - expendable_pods_priority_cutoff: request.expendablePodsPriorityCutoff, - ignore_daemonsets_utilization: request.ignoreDaemonsetsUtilization, - max_graceful_termination_sec: request.maxGracefulTerminationSec, - scale_down_delay_after_add: request.scaleDownDelayAfterAdd, - scale_down_disabled: request.scaleDownDisabled, - scale_down_unneeded_time: request.scaleDownUnneededTime, - scale_down_utilization_threshold: request.scaleDownUtilizationThreshold -}); -const marshalCreateClusterRequestOpenIDConnectConfig = (request, defaults) => ({ - client_id: request.clientId, - groups_claim: request.groupsClaim, - groups_prefix: request.groupsPrefix, - issuer_url: request.issuerUrl, - required_claim: request.requiredClaim, - username_claim: request.usernameClaim, - username_prefix: request.usernamePrefix -}); -const marshalCreateClusterRequestPoolConfig = (request, defaults) => ({ - autohealing: request.autohealing, - autoscaling: request.autoscaling, - container_runtime: request.containerRuntime, - kubelet_args: request.kubeletArgs, - max_size: request.maxSize, - min_size: request.minSize, - name: request.name, - node_type: request.nodeType, - placement_group_id: request.placementGroupId, - public_ip_disabled: request.publicIpDisabled, - root_volume_size: request.rootVolumeSize, - root_volume_type: request.rootVolumeType, - size: request.size, - tags: request.tags, - upgrade_policy: request.upgradePolicy ? marshalCreateClusterRequestPoolConfigUpgradePolicy(request.upgradePolicy) : undefined, - zone: request.zone -}); -const marshalCreatePoolRequestUpgradePolicy = (request, defaults) => ({ - max_surge: request.maxSurge, - max_unavailable: request.maxUnavailable -}); -const marshalUpdateClusterRequestAutoUpgrade = (request, defaults) => ({ - enable: request.enable, - maintenance_window: request.maintenanceWindow ? marshalMaintenanceWindow(request.maintenanceWindow) : undefined -}); -const marshalUpdateClusterRequestAutoscalerConfig = (request, defaults) => ({ - balance_similar_node_groups: request.balanceSimilarNodeGroups, - estimator: request.estimator, - expander: request.expander, - expendable_pods_priority_cutoff: request.expendablePodsPriorityCutoff, - ignore_daemonsets_utilization: request.ignoreDaemonsetsUtilization, - max_graceful_termination_sec: request.maxGracefulTerminationSec, - scale_down_delay_after_add: request.scaleDownDelayAfterAdd, - scale_down_disabled: request.scaleDownDisabled, - scale_down_unneeded_time: request.scaleDownUnneededTime, - scale_down_utilization_threshold: request.scaleDownUtilizationThreshold -}); -const marshalUpdateClusterRequestOpenIDConnectConfig = (request, defaults) => ({ - client_id: request.clientId, - groups_claim: request.groupsClaim, - groups_prefix: request.groupsPrefix, - issuer_url: request.issuerUrl, - required_claim: request.requiredClaim, - username_claim: request.usernameClaim, - username_prefix: request.usernamePrefix -}); -const marshalUpdatePoolRequestUpgradePolicy = (request, defaults) => ({ - max_surge: request.maxSurge, - max_unavailable: request.maxUnavailable -}); -const marshalCreateClusterRequest$1 = (request, defaults) => ({ - admission_plugins: request.admissionPlugins, - apiserver_cert_sans: request.apiserverCertSans, - auto_upgrade: request.autoUpgrade ? marshalCreateClusterRequestAutoUpgrade(request.autoUpgrade) : undefined, - autoscaler_config: request.autoscalerConfig ? marshalCreateClusterRequestAutoscalerConfig(request.autoscalerConfig) : undefined, - cni: request.cni, - description: request.description, - enable_dashboard: request.enableDashboard, - feature_gates: request.featureGates, - ingress: request.ingress, - name: request.name || randomName('k8s'), - open_id_connect_config: request.openIdConnectConfig ? marshalCreateClusterRequestOpenIDConnectConfig(request.openIdConnectConfig) : undefined, - pools: request.pools ? request.pools.map(elt => marshalCreateClusterRequestPoolConfig(elt)) : undefined, - private_network_id: request.privateNetworkId, - tags: request.tags, - type: request.type, - version: request.version, - ...resolveOneOf([{ - default: defaults.defaultProjectId, - param: 'project_id', - value: request.projectId - }, { - default: defaults.defaultOrganizationId, - param: 'organization_id', - value: request.organizationId - }]) -}); -const marshalCreatePoolRequest = (request, defaults) => ({ - autohealing: request.autohealing, - autoscaling: request.autoscaling, - container_runtime: request.containerRuntime ?? 'unknown_runtime', - kubelet_args: request.kubeletArgs, - max_size: request.maxSize, - min_size: request.minSize, - name: request.name || randomName('pool'), - node_type: request.nodeType, - placement_group_id: request.placementGroupId, - public_ip_disabled: request.publicIpDisabled, - root_volume_size: request.rootVolumeSize, - root_volume_type: request.rootVolumeType ?? 'default_volume_type', - size: request.size, - tags: request.tags, - upgrade_policy: request.upgradePolicy ? marshalCreatePoolRequestUpgradePolicy(request.upgradePolicy) : undefined, - zone: request.zone ?? defaults.defaultZone + applicationId: data.application_id, + attachedSessionIds: data.attached_session_ids, + createdAt: marshalling.unmarshalDate(data.created_at), + finishedAt: marshalling.unmarshalDate(data.finished_at), + id: data.id, + input: data.input, + name: data.name, + platformId: data.platform_id, + progress: data.progress, + progressMessage: data.progress_message, + projectId: data.project_id, + startedAt: marshalling.unmarshalDate(data.started_at), + status: data.status, + tags: data.tags, + updatedAt: marshalling.unmarshalDate(data.updated_at) + }; +}; +const unmarshalSession = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Session' failed as data isn't a dictionary.` + ); + } + return { + createdAt: marshalling.unmarshalDate(data.created_at), + deduplicationId: data.deduplication_id, + finishedJobCount: data.finished_job_count, + id: data.id, + maxDuration: data.max_duration, + maxIdleDuration: data.max_idle_duration, + name: data.name, + originId: data.origin_id, + originType: data.origin_type, + platformId: data.platform_id, + progressMessage: data.progress_message, + projectId: data.project_id, + startedAt: marshalling.unmarshalDate(data.started_at), + status: data.status, + tags: data.tags, + terminatedAt: marshalling.unmarshalDate(data.terminated_at), + updatedAt: marshalling.unmarshalDate(data.updated_at), + waitingJobCount: data.waiting_job_count + }; +}; +const unmarshalListApplicationsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListApplicationsResponse' failed as data isn't a dictionary.` + ); + } + return { + applications: marshalling.unmarshalArrayOfObject( + data.applications, + unmarshalApplication + ), + totalCount: data.total_count + }; +}; +const unmarshalJobResult = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'JobResult' failed as data isn't a dictionary.` + ); + } + return { + createdAt: marshalling.unmarshalDate(data.created_at), + jobId: data.job_id, + result: data.result, + url: data.url + }; +}; +const unmarshalListJobResultsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListJobResultsResponse' failed as data isn't a dictionary.` + ); + } + return { + jobResults: marshalling.unmarshalArrayOfObject(data.job_results, unmarshalJobResult), + totalCount: data.total_count + }; +}; +const unmarshalListJobsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListJobsResponse' failed as data isn't a dictionary.` + ); + } + return { + jobs: marshalling.unmarshalArrayOfObject(data.jobs, unmarshalJob), + totalCount: data.total_count + }; +}; +const unmarshalListPlatformsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListPlatformsResponse' failed as data isn't a dictionary.` + ); + } + return { + platforms: marshalling.unmarshalArrayOfObject(data.platforms, unmarshalPlatform), + totalCount: data.total_count + }; +}; +const unmarshalProcessResult = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ProcessResult' failed as data isn't a dictionary.` + ); + } + return { + createdAt: marshalling.unmarshalDate(data.created_at), + processId: data.process_id, + result: data.result + }; +}; +const unmarshalListProcessResultsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListProcessResultsResponse' failed as data isn't a dictionary.` + ); + } + return { + processResults: marshalling.unmarshalArrayOfObject( + data.process_results, + unmarshalProcessResult + ), + totalCount: data.total_count + }; +}; +const unmarshalListProcessesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListProcessesResponse' failed as data isn't a dictionary.` + ); + } + return { + processes: marshalling.unmarshalArrayOfObject(data.processes, unmarshalProcess), + totalCount: data.total_count + }; +}; +const unmarshalListSessionACLsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListSessionACLsResponse' failed as data isn't a dictionary.` + ); + } + return { + acls: data.acls, + totalCount: data.total_count + }; +}; +const unmarshalListSessionsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListSessionsResponse' failed as data isn't a dictionary.` + ); + } + return { + sessions: marshalling.unmarshalArrayOfObject(data.sessions, unmarshalSession), + totalCount: data.total_count + }; +}; +const marshalJobCircuit = (request, defaults) => ({ + ...marshalling.resolveOneOf([ + { param: "perceval_circuit", value: request.percevalCircuit }, + { param: "qiskit_circuit", value: request.qiskitCircuit } + ]) }); -const marshalMigrateToPrivateNetworkClusterRequest = (request, defaults) => ({ - private_network_id: request.privateNetworkId +const marshalCreateJobRequest = (request, defaults) => ({ + circuit: marshalJobCircuit(request.circuit), + max_duration: request.maxDuration, + name: request.name, + session_id: request.sessionId, + tags: request.tags }); -const marshalSetClusterTypeRequest = (request, defaults) => ({ - type: request.type +const marshalCreateProcessRequest = (request, defaults) => ({ + application_id: request.applicationId, + input: request.input, + name: request.name, + platform_id: request.platformId, + project_id: request.projectId ?? defaults.defaultProjectId, + tags: request.tags }); -const marshalUpdateClusterRequest$1 = (request, defaults) => ({ - admission_plugins: request.admissionPlugins, - apiserver_cert_sans: request.apiserverCertSans, - auto_upgrade: request.autoUpgrade ? marshalUpdateClusterRequestAutoUpgrade(request.autoUpgrade) : undefined, - autoscaler_config: request.autoscalerConfig ? marshalUpdateClusterRequestAutoscalerConfig(request.autoscalerConfig) : undefined, - description: request.description, - enable_dashboard: request.enableDashboard, - feature_gates: request.featureGates, - ingress: request.ingress, +const marshalCreateSessionRequest = (request, defaults) => ({ + deduplication_id: request.deduplicationId, + max_duration: request.maxDuration, + max_idle_duration: request.maxIdleDuration, name: request.name, - open_id_connect_config: request.openIdConnectConfig ? marshalUpdateClusterRequestOpenIDConnectConfig(request.openIdConnectConfig) : undefined, + platform_id: request.platformId, + project_id: request.projectId ?? defaults.defaultProjectId, tags: request.tags }); -const marshalUpdatePoolRequest = (request, defaults) => ({ - autohealing: request.autohealing, - autoscaling: request.autoscaling, - kubelet_args: request.kubeletArgs, - max_size: request.maxSize, - min_size: request.minSize, - size: request.size, - tags: request.tags, - upgrade_policy: request.upgradePolicy ? marshalUpdatePoolRequestUpgradePolicy(request.upgradePolicy) : undefined +const marshalUpdateJobRequest = (request, defaults) => ({ + name: request.name, + tags: request.tags }); -const marshalUpgradeClusterRequest = (request, defaults) => ({ - upgrade_pools: request.upgradePools, - version: request.version +const marshalUpdateProcessRequest = (request, defaults) => ({ + name: request.name, + tags: request.tags }); -const marshalUpgradePoolRequest = (request, defaults) => ({ - version: request.version +const marshalUpdateSessionRequest = (request, defaults) => ({ + max_duration: request.maxDuration, + max_idle_duration: request.maxIdleDuration, + name: request.name, + tags: request.tags }); +exports.marshalCreateJobRequest = marshalCreateJobRequest; +exports.marshalCreateProcessRequest = marshalCreateProcessRequest; +exports.marshalCreateSessionRequest = marshalCreateSessionRequest; +exports.marshalUpdateJobRequest = marshalUpdateJobRequest; +exports.marshalUpdateProcessRequest = marshalUpdateProcessRequest; +exports.marshalUpdateSessionRequest = marshalUpdateSessionRequest; +exports.unmarshalApplication = unmarshalApplication; +exports.unmarshalJob = unmarshalJob; +exports.unmarshalJobCircuit = unmarshalJobCircuit; +exports.unmarshalListApplicationsResponse = unmarshalListApplicationsResponse; +exports.unmarshalListJobResultsResponse = unmarshalListJobResultsResponse; +exports.unmarshalListJobsResponse = unmarshalListJobsResponse; +exports.unmarshalListPlatformsResponse = unmarshalListPlatformsResponse; +exports.unmarshalListProcessResultsResponse = unmarshalListProcessResultsResponse; +exports.unmarshalListProcessesResponse = unmarshalListProcessesResponse; +exports.unmarshalListSessionACLsResponse = unmarshalListSessionACLsResponse; +exports.unmarshalListSessionsResponse = unmarshalListSessionsResponse; +exports.unmarshalPlatform = unmarshalPlatform; +exports.unmarshalProcess = unmarshalProcess; +exports.unmarshalSession = unmarshalSession; + + +/***/ }), + +/***/ 9171: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const jsonContentHeaders$d = { - 'Content-Type': 'application/json; charset=utf-8' +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const CreateJobRequest = { + name: { + minLength: 1 + } +}; +const CreateProcessRequest = { + name: { + minLength: 1 + } }; +exports.CreateJobRequest = CreateJobRequest; +exports.CreateProcessRequest = CreateProcessRequest; -/** Kubernetes API. */ -let API$e = class API extends API$u { - /** Lists the available regions of the API. */ - static LOCALITIES = ['fr-par', 'nl-ams', 'pl-waw']; - pageOfListClusters = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters`, - urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['private_network_id', request.privateNetworkId], ['project_id', request.projectId], ['status', request.status ?? 'unknown'], ['type', request.type]) - }, unmarshalListClustersResponse$1); +/***/ }), + +/***/ 8398: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const index_gen = __nccwpck_require__(7116); +exports.v1 = index_gen; + + +/***/ }), + +/***/ 6160: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const intervalRetrier = __nccwpck_require__(9052); +const api = __nccwpck_require__(3042); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const resourcePaginator = __nccwpck_require__(4983); +const content_gen = __nccwpck_require__(5683); +const marshalling_gen = __nccwpck_require__(5034); +const jsonContentHeaders = { + "Content-Type": "application/json; charset=utf-8" +}; +class API extends api.API { + /** Lists the available regions of the API. */ + static LOCALITIES = ["fr-par", "nl-ams", "pl-waw"]; + pageOfListDatabaseEngines = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/database-engines`, + urlParams: marshalling.urlParams( + ["name", request.name], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["version", request.version] + ) + }, + marshalling_gen.unmarshalListDatabaseEnginesResponse + ); + /** + * List available database engines. List the PostgreSQL and MySQL database + * engines available at Scaleway. + * + * @param request - The request {@link ListDatabaseEnginesRequest} + * @returns A Promise of ListDatabaseEnginesResponse + */ + listDatabaseEngines = (request = {}) => resourcePaginator.enrichForPagination("engines", this.pageOfListDatabaseEngines, request); + pageOfListNodeTypes = (request) => this.client.fetch( + { + method: "GET", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/node-types`, + urlParams: marshalling.urlParams( + ["include_disabled_types", request.includeDisabledTypes], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListNodeTypesResponse + ); + /** + * List available node types. List all available node types. By default, the + * node types returned in the list are ordered by creation date in ascending + * order, though this can be modified via the `order_by` field. + * + * @param request - The request {@link ListNodeTypesRequest} + * @returns A Promise of ListNodeTypesResponse + */ + listNodeTypes = (request) => resourcePaginator.enrichForPagination("nodeTypes", this.pageOfListNodeTypes, request); + pageOfListDatabaseBackups = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/backups`, + urlParams: marshalling.urlParams( + ["instance_id", request.instanceId], + ["name", request.name], + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId] + ) + }, + marshalling_gen.unmarshalListDatabaseBackupsResponse + ); + /** + * List database backups. List all backups in a specified region, for a given + * Scaleway Organization or Scaleway Project. By default, the backups listed + * are ordered by creation date in ascending order. This can be modified via + * the `order_by` field. + * + * @param request - The request {@link ListDatabaseBackupsRequest} + * @returns A Promise of ListDatabaseBackupsResponse + */ + listDatabaseBackups = (request = {}) => resourcePaginator.enrichForPagination( + "databaseBackups", + this.pageOfListDatabaseBackups, + request + ); + /** + * Create a database backup. Create a new backup. You must set the + * `instance_id`, `database_name`, `name` and `expires_at` parameters. + * + * @param request - The request {@link CreateDatabaseBackupRequest} + * @returns A Promise of DatabaseBackup + */ + createDatabaseBackup = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateDatabaseBackupRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/backups` + }, + marshalling_gen.unmarshalDatabaseBackup + ); + /** + * Get a database backup. Retrieve information about a given backup, specified + * by its database backup ID and region. Full details about the backup, like + * size, URL and expiration date, are returned in the response. + * + * @param request - The request {@link GetDatabaseBackupRequest} + * @returns A Promise of DatabaseBackup + */ + getDatabaseBackup = (request) => this.client.fetch( + { + method: "GET", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/backups/${marshalling.validatePathParam("databaseBackupId", request.databaseBackupId)}` + }, + marshalling_gen.unmarshalDatabaseBackup + ); + /** + * Waits for {@link DatabaseBackup} to be in a final state. + * + * @param request - The request {@link GetDatabaseBackupRequest} + * @param options - The waiting options + * @returns A Promise of DatabaseBackup + */ + waitForDatabaseBackup = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve( + !content_gen.DATABASE_BACKUP_TRANSIENT_STATUSES.includes(res.status) + )), + this.getDatabaseBackup, + request, + options + ); + /** + * Update a database backup. Update the parameters of a backup, including name + * and expiration date. + * + * @param request - The request {@link UpdateDatabaseBackupRequest} + * @returns A Promise of DatabaseBackup + */ + updateDatabaseBackup = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateDatabaseBackupRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/backups/${marshalling.validatePathParam("databaseBackupId", request.databaseBackupId)}` + }, + marshalling_gen.unmarshalDatabaseBackup + ); + /** + * Delete a database backup. Delete a backup, specified by its database backup + * ID and region. Deleting a backup is permanent, and cannot be undone. + * + * @param request - The request {@link DeleteDatabaseBackupRequest} + * @returns A Promise of DatabaseBackup + */ + deleteDatabaseBackup = (request) => this.client.fetch( + { + method: "DELETE", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/backups/${marshalling.validatePathParam("databaseBackupId", request.databaseBackupId)}` + }, + marshalling_gen.unmarshalDatabaseBackup + ); + /** + * Restore a database backup. Launch the process of restoring database backup. + * You must specify the `instance_id` of the Database Instance of destination, + * where the backup will be restored. Note that large database backups can + * take up to several hours to restore. + * + * @param request - The request {@link RestoreDatabaseBackupRequest} + * @returns A Promise of DatabaseBackup + */ + restoreDatabaseBackup = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalRestoreDatabaseBackupRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/backups/${marshalling.validatePathParam("databaseBackupId", request.databaseBackupId)}/restore` + }, + marshalling_gen.unmarshalDatabaseBackup + ); + /** + * Export a database backup. Export a backup, specified by the + * `database_backup_id` and the `region` parameters. The download URL is + * returned in the response. + * + * @param request - The request {@link ExportDatabaseBackupRequest} + * @returns A Promise of DatabaseBackup + */ + exportDatabaseBackup = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/backups/${marshalling.validatePathParam("databaseBackupId", request.databaseBackupId)}/export` + }, + marshalling_gen.unmarshalDatabaseBackup + ); + /** + * Upgrade a Database Instance. Upgrade your current Database Instance + * specifications like node type, high availability, volume, or the database + * engine version. Note that upon upgrade the `enable_ha` parameter can only + * be set to `true`. + * + * @param request - The request {@link UpgradeInstanceRequest} + * @returns A Promise of Instance + */ + upgradeInstance = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpgradeInstanceRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/upgrade` + }, + marshalling_gen.unmarshalInstance + ); + pageOfListInstances = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances`, + urlParams: marshalling.urlParams( + ["name", request.name], + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId], + ["tags", request.tags] + ) + }, + marshalling_gen.unmarshalListInstancesResponse + ); + /** + * List Database Instances. List all Database Instances in the specified + * region, for a given Scaleway Organization or Scaleway Project. By default, + * the Database Instances returned in the list are ordered by creation date in + * ascending order, though this can be modified via the order_by field. You + * can define additional parameters for your query, such as `tags` and `name`. + * For the `name` parameter, the value you include will be checked against the + * whole name string to see if it includes the string you put in the + * parameter. + * + * @param request - The request {@link ListInstancesRequest} + * @returns A Promise of ListInstancesResponse + */ + listInstances = (request = {}) => resourcePaginator.enrichForPagination("instances", this.pageOfListInstances, request); + /** + * Get a Database Instance. Retrieve information about a given Database + * Instance, specified by the `region` and `instance_id` parameters. Its full + * details, including name, status, IP address and port, are returned in the + * response object. + * + * @param request - The request {@link GetInstanceRequest} + * @returns A Promise of Instance + */ + getInstance = (request) => this.client.fetch( + { + method: "GET", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}` + }, + marshalling_gen.unmarshalInstance + ); + /** + * Waits for {@link Instance} to be in a final state. + * + * @param request - The request {@link GetInstanceRequest} + * @param options - The waiting options + * @returns A Promise of Instance + */ + waitForInstance = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve(!content_gen.INSTANCE_TRANSIENT_STATUSES.includes(res.status))), + this.getInstance, + request, + options + ); /** - * List Clusters. List all existing Kubernetes clusters in a specific region. + * Create a Database Instance. Create a new Database Instance. You must set + * the `engine`, `user_name`, `password` and `node_type` parameters. + * Optionally, you can specify the volume type and size. * - * @param request - The request {@link ListClustersRequest} - * @returns A Promise of ListClustersResponse + * @param request - The request {@link CreateInstanceRequest} + * @returns A Promise of Instance */ - listClusters = (request = {}) => enrichForPagination('clusters', this.pageOfListClusters, request); - + createInstance = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateInstanceRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances` + }, + marshalling_gen.unmarshalInstance + ); /** - * Create a new Cluster. Create a new Kubernetes cluster in a Scaleway region. + * Update a Database Instance. Update the parameters of a Database Instance, + * including name, tags and backup schedule details. * - * @param request - The request {@link CreateClusterRequest} - * @returns A Promise of Cluster + * @param request - The request {@link UpdateInstanceRequest} + * @returns A Promise of Instance */ - createCluster = request => this.client.fetch({ - body: JSON.stringify(marshalCreateClusterRequest$1(request, this.client.settings)), - headers: jsonContentHeaders$d, - method: 'POST', - path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters` - }, unmarshalCluster$1); - + updateInstance = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateInstanceRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}` + }, + marshalling_gen.unmarshalInstance + ); /** - * Get a Cluster. Retrieve information about a specific Kubernetes cluster. + * Delete a Database Instance. Delete a given Database Instance, specified by + * the `region` and `instance_id` parameters. Deleting a Database Instance is + * permanent, and cannot be undone. Note that upon deletion all your data will + * be lost. * - * @param request - The request {@link GetClusterRequest} - * @returns A Promise of Cluster + * @param request - The request {@link DeleteInstanceRequest} + * @returns A Promise of Instance */ - getCluster = request => this.client.fetch({ - method: 'GET', - path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}` - }, unmarshalCluster$1); - + deleteInstance = (request) => this.client.fetch( + { + method: "DELETE", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}` + }, + marshalling_gen.unmarshalInstance + ); /** - * Waits for {@link Cluster} to be in a final state. + * Clone a Database Instance. Clone a given Database Instance, specified by + * the `region` and `instance_id` parameters. The clone feature allows you to + * create a new Database Instance from an existing one. The clone includes all + * existing databases, users and permissions. You can create a clone on a + * Database Instance bigger than your current one. * - * @param request - The request {@link GetClusterRequest} + * @param request - The request {@link CloneInstanceRequest} + * @returns A Promise of Instance + */ + cloneInstance = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCloneInstanceRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/clone` + }, + marshalling_gen.unmarshalInstance + ); + /** + * Restart Database Instance. Restart a given Database Instance, specified by + * the `region` and `instance_id` parameters. The status of the Database + * Instance returned in the response. + * + * @param request - The request {@link RestartInstanceRequest} + * @returns A Promise of Instance + */ + restartInstance = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/restart` + }, + marshalling_gen.unmarshalInstance + ); + /** + * Get the TLS certificate of a Database Instance. Retrieve information about + * the TLS certificate of a given Database Instance. Details like name and + * content are returned in the response. + * + * @param request - The request {@link GetInstanceCertificateRequest} + * @returns A Promise of Blob + */ + getInstanceCertificate = (request) => this.client.fetch({ + method: "GET", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/certificate`, + urlParams: marshalling.urlParams(["dl", 1]), + responseType: "blob" + }); + /** + * Renew the TLS certificate of a Database Instance. Renew a TLS for a + * Database Instance. Renewing a certificate means that you will not be able + * to connect to your Database Instance using the previous certificate. You + * will also need to download and update the new certificate for all database + * clients. + * + * @param request - The request {@link RenewInstanceCertificateRequest} + */ + renewInstanceCertificate = (request) => this.client.fetch({ + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/renew-certificate` + }); + /** + * Get Database Instance metrics. Retrieve the time series metrics of a given + * Database Instance. You can define the period from which to retrieve metrics + * by specifying the `start_date` and `end_date`. + * + * @param request - The request {@link GetInstanceMetricsRequest} + * @returns A Promise of InstanceMetrics + */ + getInstanceMetrics = (request) => this.client.fetch( + { + method: "GET", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/metrics`, + urlParams: marshalling.urlParams( + ["end_date", request.endDate], + ["metric_name", request.metricName], + ["start_date", request.startDate] + ) + }, + marshalling_gen.unmarshalInstanceMetrics + ); + /** + * Create a Read Replica. Create a new Read Replica of a Database Instance. + * You must specify the `region` and the `instance_id`. You can only create a + * maximum of 3 Read Replicas per Database Instance. + * + * @param request - The request {@link CreateReadReplicaRequest} + * @returns A Promise of ReadReplica + */ + createReadReplica = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateReadReplicaRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/read-replicas` + }, + marshalling_gen.unmarshalReadReplica + ); + /** + * Get a Read Replica. Retrieve information about a Database Instance Read + * Replica. Full details about the Read Replica, like `endpoints`, `status` + * and `region` are returned in the response. + * + * @param request - The request {@link GetReadReplicaRequest} + * @returns A Promise of ReadReplica + */ + getReadReplica = (request) => this.client.fetch( + { + method: "GET", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/read-replicas/${marshalling.validatePathParam("readReplicaId", request.readReplicaId)}` + }, + marshalling_gen.unmarshalReadReplica + ); + /** + * Waits for {@link ReadReplica} to be in a final state. + * + * @param request - The request {@link GetReadReplicaRequest} * @param options - The waiting options - * @returns A Promise of Cluster + * @returns A Promise of ReadReplica */ - waitForCluster = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!CLUSTER_TRANSIENT_STATUSES$1.includes(res.status))), this.getCluster, request, options); - + waitForReadReplica = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve( + !content_gen.READ_REPLICA_TRANSIENT_STATUSES.includes(res.status) + )), + this.getReadReplica, + request, + options + ); /** - * Update a Cluster. Update information on a specific Kubernetes cluster. You - * can update details such as its name, description, tags and configuration. - * To upgrade a cluster, you will need to use the dedicated endpoint. + * Delete a Read Replica. Delete a Read Replica of a Database Instance. You + * must specify the `region` and `read_replica_id` parameters of the Read + * Replica you want to delete. * - * @param request - The request {@link UpdateClusterRequest} - * @returns A Promise of Cluster + * @param request - The request {@link DeleteReadReplicaRequest} + * @returns A Promise of ReadReplica */ - updateCluster = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateClusterRequest$1(request, this.client.settings)), - headers: jsonContentHeaders$d, - method: 'PATCH', - path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}` - }, unmarshalCluster$1); - + deleteReadReplica = (request) => this.client.fetch( + { + method: "DELETE", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/read-replicas/${marshalling.validatePathParam("readReplicaId", request.readReplicaId)}` + }, + marshalling_gen.unmarshalReadReplica + ); /** - * Delete a Cluster. Delete a specific Kubernetes cluster and all its - * associated pools and nodes. Note that this method will not delete any Load - * Balancer or Block Volume that are associated with the cluster. + * Resync a Read Replica. When you resync a Read Replica, first it is reset, + * then its data is resynchronized from the primary node. Your Read Replica + * remains unavailable during the resync process. The duration of this process + * is proportional to the size of your Database Instance. The configured + * endpoints do not change. * - * @param request - The request {@link DeleteClusterRequest} - * @returns A Promise of Cluster + * @param request - The request {@link ResetReadReplicaRequest} + * @returns A Promise of ReadReplica */ - deleteCluster = request => this.client.fetch({ - method: 'DELETE', - path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}`, - urlParams: urlParams(['with_additional_resources', request.withAdditionalResources]) - }, unmarshalCluster$1); - + resetReadReplica = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/read-replicas/${marshalling.validatePathParam("readReplicaId", request.readReplicaId)}/reset` + }, + marshalling_gen.unmarshalReadReplica + ); /** - * Upgrade a Cluster. Upgrade a specific Kubernetes cluster and possibly its - * associated pools to a specific and supported Kubernetes version. + * Promote a Read Replica. Promote a Read Replica to Database Instance + * automatically. * - * @param request - The request {@link UpgradeClusterRequest} - * @returns A Promise of Cluster + * @param request - The request {@link PromoteReadReplicaRequest} + * @returns A Promise of Instance */ - upgradeCluster = request => this.client.fetch({ - body: JSON.stringify(marshalUpgradeClusterRequest(request, this.client.settings)), - headers: jsonContentHeaders$d, - method: 'POST', - path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/upgrade` - }, unmarshalCluster$1); - + promoteReadReplica = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/read-replicas/${marshalling.validatePathParam("readReplicaId", request.readReplicaId)}/promote` + }, + marshalling_gen.unmarshalInstance + ); /** - * Change the Cluster type. Change the type of a specific Kubernetes cluster. - * To see the possible values you can enter for the `type` field, [list - * available cluster - * types](#path-clusters-list-available-cluster-types-for-a-cluster). + * Create an endpoint for a Read Replica. Create a new endpoint for a Read + * Replica. Read Replicas can have at most one direct access and one Private + * Network endpoint. * - * @param request - The request {@link SetClusterTypeRequest} - * @returns A Promise of Cluster + * @param request - The request {@link CreateReadReplicaEndpointRequest} + * @returns A Promise of ReadReplica */ - setClusterType = request => this.client.fetch({ - body: JSON.stringify(marshalSetClusterTypeRequest(request, this.client.settings)), - headers: jsonContentHeaders$d, - method: 'POST', - path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/set-type` - }, unmarshalCluster$1); - + createReadReplicaEndpoint = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateReadReplicaEndpointRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/read-replicas/${marshalling.validatePathParam("readReplicaId", request.readReplicaId)}/endpoints` + }, + marshalling_gen.unmarshalReadReplica + ); /** - * List available versions for a Cluster. List the versions that a specific - * Kubernetes cluster is allowed to upgrade to. Results will include every - * patch version greater than the current patch, as well as one minor version - * ahead of the current version. Any upgrade skipping a minor version will not - * work. + * Prepare logs of a Database Instance. Prepare your Database Instance logs. + * You can define the `start_date` and `end_date` parameters for your query. + * The download URL is returned in the response. Logs are recorded from 00h00 + * to 23h59 and then aggregated in a `.log` file once a day. Therefore, even + * if you specify a timeframe from which you want to get the logs, you will + * receive logs from the full 24 hours. * - * @param request - The request {@link ListClusterAvailableVersionsRequest} - * @returns A Promise of ListClusterAvailableVersionsResponse + * @param request - The request {@link PrepareInstanceLogsRequest} + * @returns A Promise of PrepareInstanceLogsResponse + */ + prepareInstanceLogs = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalPrepareInstanceLogsRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/prepare-logs` + }, + marshalling_gen.unmarshalPrepareInstanceLogsResponse + ); + /** + * List available logs of a Database Instance. List the available logs of a + * Database Instance. By default, the logs returned in the list are ordered by + * creation date in ascending order, though this can be modified via the + * order_by field. + * + * @param request - The request {@link ListInstanceLogsRequest} + * @returns A Promise of ListInstanceLogsResponse + */ + listInstanceLogs = (request) => this.client.fetch( + { + method: "GET", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/logs`, + urlParams: marshalling.urlParams(["order_by", request.orderBy]) + }, + marshalling_gen.unmarshalListInstanceLogsResponse + ); + /** + * Get given logs of a Database Instance. Retrieve information about the logs + * of a Database Instance. Specify the `instance_log_id` and `region` in your + * request to get information such as `download_url`, `status`, `expires_at` + * and `created_at` about your logs in the response. + * + * @param request - The request {@link GetInstanceLogRequest} + * @returns A Promise of InstanceLog + */ + getInstanceLog = (request) => this.client.fetch( + { + method: "GET", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/logs/${marshalling.validatePathParam("instanceLogId", request.instanceLogId)}` + }, + marshalling_gen.unmarshalInstanceLog + ); + /** + * Waits for {@link InstanceLog} to be in a final state. + * + * @param request - The request {@link GetInstanceLogRequest} + * @param options - The waiting options + * @returns A Promise of InstanceLog + */ + waitForInstanceLog = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve( + !content_gen.INSTANCE_LOG_TRANSIENT_STATUSES.includes(res.status) + )), + this.getInstanceLog, + request, + options + ); + /** + * Purge remote Database Instance logs. Purge a given remote log from a + * Database Instance. You can specify the `log_name` of the log you wish to + * clean from your Database Instance. + * + * @param request - The request {@link PurgeInstanceLogsRequest} + */ + purgeInstanceLogs = (request) => this.client.fetch({ + body: JSON.stringify( + marshalling_gen.marshalPurgeInstanceLogsRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/purge-logs` + }); + /** + * List remote Database Instance logs details. List remote log details. By + * default, the details returned in the list are ordered by creation date in + * ascending order, though this can be modified via the order_by field. + * + * @param request - The request {@link ListInstanceLogsDetailsRequest} + * @returns A Promise of ListInstanceLogsDetailsResponse + */ + listInstanceLogsDetails = (request) => this.client.fetch( + { + method: "GET", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/logs-details` + }, + marshalling_gen.unmarshalListInstanceLogsDetailsResponse + ); + /** + * Add Database Instance advanced settings. Add an advanced setting to a + * Database Instance. You must set the `name` and the `value` of each + * setting. + * + * @param request - The request {@link AddInstanceSettingsRequest} + * @returns A Promise of AddInstanceSettingsResponse + */ + addInstanceSettings = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalAddInstanceSettingsRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/settings` + }, + marshalling_gen.unmarshalAddInstanceSettingsResponse + ); + /** + * Delete Database Instance advanced settings. Delete an advanced setting in a + * Database Instance. You must specify the names of the settings you want to + * delete in the request. + * + * @param request - The request {@link DeleteInstanceSettingsRequest} + * @returns A Promise of DeleteInstanceSettingsResponse + */ + deleteInstanceSettings = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalDeleteInstanceSettingsRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "DELETE", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/settings` + }, + marshalling_gen.unmarshalDeleteInstanceSettingsResponse + ); + /** + * Set Database Instance advanced settings. Update an advanced setting for a + * Database Instance. Settings added upon database engine initalization can + * only be defined once, and cannot, therefore, be updated. + * + * @param request - The request {@link SetInstanceSettingsRequest} + * @returns A Promise of SetInstanceSettingsResponse + */ + setInstanceSettings = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalSetInstanceSettingsRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PUT", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/settings` + }, + marshalling_gen.unmarshalSetInstanceSettingsResponse + ); + pageOfListInstanceACLRules = (request) => this.client.fetch( + { + method: "GET", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/acls`, + urlParams: marshalling.urlParams( + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListInstanceACLRulesResponse + ); + /** + * List ACL rules of a Database Instance. List the ACL rules for a given + * Database Instance. The response is an array of ACL objects, each one + * representing an ACL that denies, allows or redirects traffic based on + * certain conditions. + * + * @param request - The request {@link ListInstanceACLRulesRequest} + * @returns A Promise of ListInstanceACLRulesResponse + */ + listInstanceACLRules = (request) => resourcePaginator.enrichForPagination("rules", this.pageOfListInstanceACLRules, request); + /** + * Add an ACL rule to a Database Instance. Add an additional ACL rule to a + * Database Instance. + * + * @param request - The request {@link AddInstanceACLRulesRequest} + * @returns A Promise of AddInstanceACLRulesResponse */ - listClusterAvailableVersions = request => this.client.fetch({ - method: 'GET', - path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/available-versions` - }, unmarshalListClusterAvailableVersionsResponse); - + addInstanceACLRules = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalAddInstanceACLRulesRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/acls` + }, + marshalling_gen.unmarshalAddInstanceACLRulesResponse + ); /** - * List available cluster types for a cluster. List the cluster types that a - * specific Kubernetes cluster is allowed to switch to. + * Set ACL rules for a Database Instance. Replace all the ACL rules of a + * Database Instance. * - * @param request - The request {@link ListClusterAvailableTypesRequest} - * @returns A Promise of ListClusterAvailableTypesResponse + * @param request - The request {@link SetInstanceACLRulesRequest} + * @returns A Promise of SetInstanceACLRulesResponse */ - listClusterAvailableTypes = request => this.client.fetch({ - method: 'GET', - path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/available-types` - }, unmarshalListClusterAvailableTypesResponse); - _getClusterKubeConfig = request => this.client.fetch({ - method: 'GET', - path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/kubeconfig`, - urlParams: urlParams(['dl', 1]), - responseType: 'blob' - }); - + setInstanceACLRules = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalSetInstanceACLRulesRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PUT", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/acls` + }, + marshalling_gen.unmarshalSetInstanceACLRulesResponse + ); /** - * Reset the admin token of a Cluster. Reset the admin token for a specific - * Kubernetes cluster. This will revoke the old admin token (which will not be - * usable afterwards) and create a new one. Note that you will need to - * download kubeconfig again to keep interacting with the cluster. + * Delete ACL rules of a Database Instance. Delete one or more ACL rules of a + * Database Instance. * - * @param request - The request {@link ResetClusterAdminTokenRequest} + * @param request - The request {@link DeleteInstanceACLRulesRequest} + * @returns A Promise of DeleteInstanceACLRulesResponse */ - resetClusterAdminToken = request => this.client.fetch({ - body: '{}', - headers: jsonContentHeaders$d, - method: 'POST', - path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/reset-admin-token` - }); - + deleteInstanceACLRules = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalDeleteInstanceACLRulesRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "DELETE", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/acls` + }, + marshalling_gen.unmarshalDeleteInstanceACLRulesResponse + ); + pageOfListUsers = (request) => this.client.fetch( + { + method: "GET", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/users`, + urlParams: marshalling.urlParams( + ["name", request.name], + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListUsersResponse + ); /** - * Migrate an existing cluster to a Private Network cluster. Migrate a cluster - * that was created before the release of Private Network clusters to a new - * one with a Private Network. + * List users of a Database Instance. List all users of a given Database + * Instance. By default, the users returned in the list are ordered by + * creation date in ascending order, though this can be modified via the + * order_by field. * - * @param request - The request {@link MigrateToPrivateNetworkClusterRequest} - * @returns A Promise of Cluster + * @param request - The request {@link ListUsersRequest} + * @returns A Promise of ListUsersResponse */ - migrateToPrivateNetworkCluster = request => this.client.fetch({ - body: JSON.stringify(marshalMigrateToPrivateNetworkClusterRequest(request, this.client.settings)), - headers: jsonContentHeaders$d, - method: 'POST', - path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/migrate-to-private-network` - }, unmarshalCluster$1); - pageOfListPools = request => this.client.fetch({ - method: 'GET', - path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/pools`, - urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['status', request.status ?? 'unknown']) - }, unmarshalListPoolsResponse); - + listUsers = (request) => resourcePaginator.enrichForPagination("users", this.pageOfListUsers, request); /** - * List Pools in a Cluster. List all the existing pools for a specific - * Kubernetes cluster. + * Create a user for a Database Instance. Create a new user for a Database + * Instance. You must define the `name`, `password` and `is_admin` + * parameters. * - * @param request - The request {@link ListPoolsRequest} - * @returns A Promise of ListPoolsResponse + * @param request - The request {@link CreateUserRequest} + * @returns A Promise of User */ - listPools = request => enrichForPagination('pools', this.pageOfListPools, request); - + createUser = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateUserRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/users` + }, + marshalling_gen.unmarshalUser + ); /** - * Create a new Pool in a Cluster. Create a new pool in a specific Kubernetes - * cluster. + * Update a user on a Database Instance. Update the parameters of a user on a + * Database Instance. You can update the `password` and `is_admin` parameters, + * but you cannot change the name of the user. * - * @param request - The request {@link CreatePoolRequest} - * @returns A Promise of Pool + * @param request - The request {@link UpdateUserRequest} + * @returns A Promise of User */ - createPool = request => this.client.fetch({ - body: JSON.stringify(marshalCreatePoolRequest(request, this.client.settings)), - headers: jsonContentHeaders$d, - method: 'POST', - path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/pools` - }, unmarshalPool); - + updateUser = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateUserRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/users/${marshalling.validatePathParam("name", request.name)}` + }, + marshalling_gen.unmarshalUser + ); /** - * Get a Pool in a Cluster. Retrieve details about a specific pool in a - * Kubernetes cluster. + * Delete a user on a Database Instance. Delete a given user on a Database + * Instance. You must specify, in the endpoint, the `region`, `instance_id` + * and `name` parameters of the user you want to delete. * - * @param request - The request {@link GetPoolRequest} - * @returns A Promise of Pool + * @param request - The request {@link DeleteUserRequest} */ - getPool = request => this.client.fetch({ - method: 'GET', - path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/pools/${validatePathParam('poolId', request.poolId)}` - }, unmarshalPool); - + deleteUser = (request) => this.client.fetch({ + method: "DELETE", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/users/${marshalling.validatePathParam("name", request.name)}` + }); + pageOfListDatabases = (request) => this.client.fetch( + { + method: "GET", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/databases`, + urlParams: marshalling.urlParams( + ["managed", request.managed], + ["name", request.name], + ["order_by", request.orderBy], + ["owner", request.owner], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListDatabasesResponse + ); /** - * Waits for {@link Pool} to be in a final state. + * List databases in a Database Instance. List all databases of a given + * Database Instance. By default, the databases returned in the list are + * ordered by creation date in ascending order, though this can be modified + * via the order_by field. You can define additional parameters for your + * query, such as `name`, `managed` and `owner`. * - * @param request - The request {@link GetPoolRequest} - * @param options - The waiting options - * @returns A Promise of Pool + * @param request - The request {@link ListDatabasesRequest} + * @returns A Promise of ListDatabasesResponse */ - waitForPool = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!POOL_TRANSIENT_STATUSES.includes(res.status))), this.getPool, request, options); - + listDatabases = (request) => resourcePaginator.enrichForPagination("databases", this.pageOfListDatabases, request); /** - * Upgrade a Pool in a Cluster. Upgrade the Kubernetes version of a specific - * pool. Note that it only works if the targeted version matches the cluster's - * version. + * Create a database in a Database Instance. Create a new database. You must + * define the `name` parameter in the request. * - * @param request - The request {@link UpgradePoolRequest} - * @returns A Promise of Pool + * @param request - The request {@link CreateDatabaseRequest} + * @returns A Promise of Database */ - upgradePool = request => this.client.fetch({ - body: JSON.stringify(marshalUpgradePoolRequest(request, this.client.settings)), - headers: jsonContentHeaders$d, - method: 'POST', - path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/pools/${validatePathParam('poolId', request.poolId)}/upgrade` - }, unmarshalPool); - + createDatabase = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateDatabaseRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/databases` + }, + marshalling_gen.unmarshalDatabase + ); /** - * Update a Pool in a Cluster. Update the attributes of a specific pool, such - * as its desired size, autoscaling settings, and tags. + * Delete a database in a Database Instance. Delete a given database on a + * Database Instance. You must specify, in the endpoint, the `region`, + * `instance_id` and `name` parameters of the database you want to delete. * - * @param request - The request {@link UpdatePoolRequest} - * @returns A Promise of Pool + * @param request - The request {@link DeleteDatabaseRequest} */ - updatePool = request => this.client.fetch({ - body: JSON.stringify(marshalUpdatePoolRequest(request, this.client.settings)), - headers: jsonContentHeaders$d, - method: 'PATCH', - path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/pools/${validatePathParam('poolId', request.poolId)}` - }, unmarshalPool); - + deleteDatabase = (request) => this.client.fetch({ + method: "DELETE", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/databases/${marshalling.validatePathParam("name", request.name)}` + }); + pageOfListPrivileges = (request) => this.client.fetch( + { + method: "GET", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/privileges`, + urlParams: marshalling.urlParams( + ["database_name", request.databaseName], + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["user_name", request.userName] + ) + }, + marshalling_gen.unmarshalListPrivilegesResponse + ); /** - * Delete a Pool in a Cluster. Delete a specific pool from a cluster. Note - * that all the pool's nodes will also be deleted. + * List user privileges for a database. List privileges of a user on a + * database. By default, the details returned in the list are ordered by + * creation date in ascending order, though this can be modified via the + * order_by field. You can define additional parameters for your query, such + * as `database_name` and `user_name`. * - * @param request - The request {@link DeletePoolRequest} - * @returns A Promise of Pool + * @param request - The request {@link ListPrivilegesRequest} + * @returns A Promise of ListPrivilegesResponse */ - deletePool = request => this.client.fetch({ - method: 'DELETE', - path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/pools/${validatePathParam('poolId', request.poolId)}` - }, unmarshalPool); - + listPrivileges = (request) => resourcePaginator.enrichForPagination("privileges", this.pageOfListPrivileges, request); /** - * Create a Kosmos node. Retrieve metadata for a Kosmos node. This method is - * not intended to be called by end users but rather programmatically by the - * kapsule-node-agent. + * Set user privileges for a database. Set the privileges of a user on a + * database. You must define `database_name`, `user_name` and `permission` in + * the request body. * - * @param request - The request {@link CreateExternalNodeRequest} - * @returns A Promise of ExternalNode + * @param request - The request {@link SetPrivilegeRequest} + * @returns A Promise of Privilege */ - createExternalNode = request => this.client.fetch({ - body: '{}', - headers: jsonContentHeaders$d, - method: 'POST', - path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/pools/${validatePathParam('poolId', request.poolId)}/external-nodes` - }, unmarshalExternalNode); - pageOfListNodes = request => this.client.fetch({ - method: 'GET', - path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/nodes`, - urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['pool_id', request.poolId], ['status', request.status ?? 'unknown']) - }, unmarshalListNodesResponse); - + setPrivilege = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalSetPrivilegeRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PUT", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/privileges` + }, + marshalling_gen.unmarshalPrivilege + ); + pageOfListSnapshots = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/snapshots`, + urlParams: marshalling.urlParams( + ["instance_id", request.instanceId], + ["name", request.name], + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId] + ) + }, + marshalling_gen.unmarshalListSnapshotsResponse + ); /** - * List Nodes in a Cluster. List all the existing nodes for a specific - * Kubernetes cluster. + * List snapshots. List snapshots. You can include the `instance_id` or + * `project_id` in your query to get the list of snapshots for specific + * Database Instances and/or Projects. By default, the details returned in the + * list are ordered by creation date in ascending order, though this can be + * modified via the `order_by` field. * - * @param request - The request {@link ListNodesRequest} - * @returns A Promise of ListNodesResponse + * @param request - The request {@link ListSnapshotsRequest} + * @returns A Promise of ListSnapshotsResponse */ - listNodes = request => enrichForPagination('nodes', this.pageOfListNodes, request); - + listSnapshots = (request = {}) => resourcePaginator.enrichForPagination("snapshots", this.pageOfListSnapshots, request); /** - * Get a Node in a Cluster. Retrieve details about a specific Kubernetes Node. + * Get a Database Instance snapshot. Retrieve information about a given + * snapshot, specified by its `snapshot_id` and `region`. Full details about + * the snapshot, like size and expiration date, are returned in the response. * - * @param request - The request {@link GetNodeRequest} - * @returns A Promise of Node + * @param request - The request {@link GetSnapshotRequest} + * @returns A Promise of Snapshot */ - getNode = request => this.client.fetch({ - method: 'GET', - path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/nodes/${validatePathParam('nodeId', request.nodeId)}` - }, unmarshalNode); - + getSnapshot = (request) => this.client.fetch( + { + method: "GET", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/snapshots/${marshalling.validatePathParam("snapshotId", request.snapshotId)}` + }, + marshalling_gen.unmarshalSnapshot + ); /** - * Waits for {@link Node} to be in a final state. + * Waits for {@link Snapshot} to be in a final state. * - * @param request - The request {@link GetNodeRequest} + * @param request - The request {@link GetSnapshotRequest} * @param options - The waiting options - * @returns A Promise of Node + * @returns A Promise of Snapshot */ - waitForNode = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!NODE_TRANSIENT_STATUSES.includes(res.status))), this.getNode, request, options); - + waitForSnapshot = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve(!content_gen.SNAPSHOT_TRANSIENT_STATUSES.includes(res.status))), + this.getSnapshot, + request, + options + ); /** - * Replace a Node in a Cluster. Replace a specific Node. The node will first - * be cordoned (scheduling will be disabled on it). The existing pods on the - * node will then be drained and rescheduled onto another schedulable node. - * Note that when there is not enough space to reschedule all the pods (such - * as in a one-node cluster), disruption of your applications can be - * expected. + * Create a Database Instance snapshot. Create a new snapshot of a Database + * Instance. You must define the `name` parameter in the request. * - * @deprecated - * @param request - The request {@link ReplaceNodeRequest} - * @returns A Promise of Node + * @param request - The request {@link CreateSnapshotRequest} + * @returns A Promise of Snapshot */ - replaceNode = request => this.client.fetch({ - body: '{}', - headers: jsonContentHeaders$d, - method: 'POST', - path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/nodes/${validatePathParam('nodeId', request.nodeId)}/replace` - }, unmarshalNode); - + createSnapshot = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateSnapshotRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/snapshots` + }, + marshalling_gen.unmarshalSnapshot + ); /** - * Reboot a Node in a Cluster. Reboot a specific Node. The node will first be - * cordoned (scheduling will be disabled on it). The existing pods on the node - * will then be drained and rescheduled onto another schedulable node. Note - * that when there is not enough space to reschedule all the pods (such as in - * a one-node cluster), disruption of your applications can be expected. + * Update a Database Instance snapshot. Update the parameters of a snapshot of + * a Database Instance. You can update the `name` and `expires_at` + * parameters. * - * @param request - The request {@link RebootNodeRequest} - * @returns A Promise of Node + * @param request - The request {@link UpdateSnapshotRequest} + * @returns A Promise of Snapshot */ - rebootNode = request => this.client.fetch({ - body: '{}', - headers: jsonContentHeaders$d, - method: 'POST', - path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/nodes/${validatePathParam('nodeId', request.nodeId)}/reboot` - }, unmarshalNode); - + updateSnapshot = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateSnapshotRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/snapshots/${marshalling.validatePathParam("snapshotId", request.snapshotId)}` + }, + marshalling_gen.unmarshalSnapshot + ); /** - * Delete a Node in a Cluster. Delete a specific Node. Note that when there is - * not enough space to reschedule all the pods (such as in a one-node - * cluster), disruption of your applications can be expected. + * Delete a Database Instance snapshot. Delete a given snapshot of a Database + * Instance. You must specify, in the endpoint, the `region` and `snapshot_id` + * parameters of the snapshot you want to delete. * - * @param request - The request {@link DeleteNodeRequest} - * @returns A Promise of Node + * @param request - The request {@link DeleteSnapshotRequest} + * @returns A Promise of Snapshot */ - deleteNode = request => this.client.fetch({ - method: 'DELETE', - path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/nodes/${validatePathParam('nodeId', request.nodeId)}`, - urlParams: urlParams(['replace', request.replace], ['skip_drain', request.skipDrain]) - }, unmarshalNode); - + deleteSnapshot = (request) => this.client.fetch( + { + method: "DELETE", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/snapshots/${marshalling.validatePathParam("snapshotId", request.snapshotId)}` + }, + marshalling_gen.unmarshalSnapshot + ); /** - * List all available Versions. List all available versions for the creation - * of a new Kubernetes cluster. + * Create a new Database Instance from a snapshot. Restore a snapshot. When + * you restore a snapshot, a new Instance is created and billed to your + * account. Note that is possible to select a larger node type for your new + * Database Instance. However, the Block volume size will be the same as the + * size of the restored snapshot. All Instance settings will be restored if + * you chose a node type with the same or more memory size than the initial + * Instance. Settings will be reset to the default if your node type has less + * memory. * - * @param request - The request {@link ListVersionsRequest} - * @returns A Promise of ListVersionsResponse + * @param request - The request {@link CreateInstanceFromSnapshotRequest} + * @returns A Promise of Instance */ - listVersions = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/versions` - }, unmarshalListVersionsResponse$2); - + createInstanceFromSnapshot = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateInstanceFromSnapshotRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/snapshots/${marshalling.validatePathParam("snapshotId", request.snapshotId)}/create-instance` + }, + marshalling_gen.unmarshalInstance + ); /** - * Get a Version. Retrieve a specific Kubernetes version and its details. + * Create a new Database Instance endpoint. Create a new endpoint for a + * Database Instance. You can add `load_balancer` and `private_network` + * specifications to the body of the request. * - * @param request - The request {@link GetVersionRequest} - * @returns A Promise of Version + * @param request - The request {@link CreateEndpointRequest} + * @returns A Promise of Endpoint */ - getVersion = request => this.client.fetch({ - method: 'GET', - path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/versions/${validatePathParam('versionName', request.versionName)}` - }, unmarshalVersion$2); - pageOfListClusterTypes = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/cluster-types`, - urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]) - }, unmarshalListClusterTypesResponse); - + createEndpoint = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateEndpointRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/endpoints` + }, + marshalling_gen.unmarshalEndpoint + ); /** - * List cluster types. List available cluster types and their technical - * details. + * Delete a Database Instance endpoint. Delete the endpoint of a Database + * Instance. You must specify the `region` and `endpoint_id` parameters of the + * endpoint you want to delete. Note that might need to update any environment + * configurations that point to the deleted endpoint. * - * @param request - The request {@link ListClusterTypesRequest} - * @returns A Promise of ListClusterTypesResponse + * @param request - The request {@link DeleteEndpointRequest} */ - listClusterTypes = (request = {}) => enrichForPagination('clusterTypes', this.pageOfListClusterTypes, request); -}; - -class K8SUtilsAPI extends API$e { + deleteEndpoint = (request) => this.client.fetch({ + method: "DELETE", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/endpoints/${marshalling.validatePathParam("endpointId", request.endpointId)}` + }); /** - * Get configuration of a kube cluster. + * Get a Database Instance endpoint. Retrieve information about a Database + * Instance endpoint. Full details about the endpoint, like `ip`, `port`, + * `private_network` and `load_balancer` specifications are returned in the + * response. * - * @param request - The request {@link GetClusterKubeConfigRequest} - * @returns A Promise of Blob + * @param request - The request {@link GetEndpointRequest} + * @returns A Promise of Endpoint + */ + getEndpoint = (request) => this.client.fetch( + { + method: "GET", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/endpoints/${marshalling.validatePathParam("endpointId", request.endpointId)}` + }, + marshalling_gen.unmarshalEndpoint + ); + /** + * Migrate an existing instance endpoint to another instance. + * + * @param request - The request {@link MigrateEndpointRequest} + * @returns A Promise of Endpoint */ - getClusterKubeConfig = request => this._getClusterKubeConfig(request); + migrateEndpoint = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalMigrateEndpointRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/endpoints/${marshalling.validatePathParam("endpointId", request.endpointId)}/migrate` + }, + marshalling_gen.unmarshalEndpoint + ); + /** + * Apply Database Instance maintenance. Apply maintenance tasks to your + * Database Instance. This will trigger pending maintenance tasks to start in + * your Database Instance and can generate service interruption. Maintenance + * tasks can be applied between `starts_at` and `stops_at` times, and are run + * directly by Scaleway at `forced_at` timestamp. + * + * @param request - The request {@link ApplyInstanceMaintenanceRequest} + * @returns A Promise of Maintenance + */ + applyInstanceMaintenance = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/rdb/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam("instanceId", request.instanceId)}/apply-maintenance` + }, + marshalling_gen.unmarshalMaintenance + ); } +exports.API = API; + -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. +/***/ }), -const CreateClusterRequest = { - name: { - minLength: 1 - } -}; -const CreateClusterRequestAutoscalerConfig = { - scaleDownUtilizationThreshold: { - greaterThan: 0, - lessThan: 1 - } -}; -const CreateClusterRequestOpenIDConnectConfig = { - clientId: { - minLength: 1 - }, - groupsPrefix: { - minLength: 1 - }, - usernameClaim: { - minLength: 1 - }, - usernamePrefix: { - minLength: 1 - } -}; -const CreateClusterRequestPoolConfig = { - name: { - minLength: 1 - } -}; -const CreatePoolRequest = { - name: { - minLength: 1 - } -}; -const ListClusterTypesRequest = { - page: { - greaterThan: 0 - }, - pageSize: { - greaterThan: 0, - lessThanOrEqual: 100 - } -}; -const ListClustersRequest = { - name: { - minLength: 1 - }, - page: { - greaterThan: 0 - }, - pageSize: { - greaterThan: 0, - lessThanOrEqual: 100 - } -}; -const ListNodesRequest = { - name: { - minLength: 1 - }, - page: { - greaterThan: 0 - }, - pageSize: { - greaterThan: 0, - lessThanOrEqual: 100 - } -}; -const ListPoolsRequest = { - name: { - minLength: 1 - }, - page: { - greaterThan: 0 - }, - pageSize: { - greaterThan: 0, - lessThanOrEqual: 100 - } -}; -const MaintenanceWindow = { - startHour: { - lessThanOrEqual: 23 - } -}; -const UpdateClusterRequest = { - name: { - minLength: 1 - } -}; -const UpdateClusterRequestAutoscalerConfig = { - scaleDownUtilizationThreshold: { - greaterThan: 0, - lessThan: 1 - } -}; +/***/ 5683: +/***/ ((__unused_webpack_module, exports) => { -var validationRules_gen$3 = /*#__PURE__*/Object.freeze({ - __proto__: null, - CreateClusterRequest: CreateClusterRequest, - CreateClusterRequestAutoscalerConfig: CreateClusterRequestAutoscalerConfig, - CreateClusterRequestOpenIDConnectConfig: CreateClusterRequestOpenIDConnectConfig, - CreateClusterRequestPoolConfig: CreateClusterRequestPoolConfig, - CreatePoolRequest: CreatePoolRequest, - ListClusterTypesRequest: ListClusterTypesRequest, - ListClustersRequest: ListClustersRequest, - ListNodesRequest: ListNodesRequest, - ListPoolsRequest: ListPoolsRequest, - MaintenanceWindow: MaintenanceWindow, - UpdateClusterRequest: UpdateClusterRequest, - UpdateClusterRequestAutoscalerConfig: UpdateClusterRequestAutoscalerConfig -}); +"use strict"; -var index$e = /*#__PURE__*/Object.freeze({ - __proto__: null, - API: K8SUtilsAPI, - CLUSTER_TRANSIENT_STATUSES: CLUSTER_TRANSIENT_STATUSES$1, - NODE_TRANSIENT_STATUSES: NODE_TRANSIENT_STATUSES, - POOL_TRANSIENT_STATUSES: POOL_TRANSIENT_STATUSES, - ValidationRules: validationRules_gen$3 -}); +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const DATABASE_BACKUP_TRANSIENT_STATUSES = [ + "creating", + "restoring", + "deleting", + "exporting" +]; +const INSTANCE_LOG_TRANSIENT_STATUSES = ["creating"]; +const INSTANCE_TRANSIENT_STATUSES = [ + "provisioning", + "configuring", + "deleting", + "autohealing", + "initializing", + "backuping", + "snapshotting", + "restarting" +]; +const MAINTENANCE_TRANSIENT_STATUSES = ["ongoing"]; +const READ_REPLICA_TRANSIENT_STATUSES = [ + "provisioning", + "initializing", + "deleting", + "configuring", + "promoting" +]; +const SNAPSHOT_TRANSIENT_STATUSES = [ + "creating", + "restoring", + "deleting" +]; +exports.DATABASE_BACKUP_TRANSIENT_STATUSES = DATABASE_BACKUP_TRANSIENT_STATUSES; +exports.INSTANCE_LOG_TRANSIENT_STATUSES = INSTANCE_LOG_TRANSIENT_STATUSES; +exports.INSTANCE_TRANSIENT_STATUSES = INSTANCE_TRANSIENT_STATUSES; +exports.MAINTENANCE_TRANSIENT_STATUSES = MAINTENANCE_TRANSIENT_STATUSES; +exports.READ_REPLICA_TRANSIENT_STATUSES = READ_REPLICA_TRANSIENT_STATUSES; +exports.SNAPSHOT_TRANSIENT_STATUSES = SNAPSHOT_TRANSIENT_STATUSES; -var index$d = /*#__PURE__*/Object.freeze({ - __proto__: null, - v1: index$e -}); -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. +/***/ }), -/** Lists transient statutes of the enum {@link CertificateStatus}. */ -const CERTIFICATE_TRANSIENT_STATUSES = ['pending']; +/***/ 7116: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/** Lists transient statutes of the enum {@link InstanceStatus}. */ -const INSTANCE_TRANSIENT_STATUSES$1 = ['pending', 'migrating']; +"use strict"; -/** Lists transient statutes of the enum {@link LbStatus}. */ -const LB_TRANSIENT_STATUSES = ['pending', 'migrating', 'to_create', 'creating', 'to_delete', 'deleting']; +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api_gen = __nccwpck_require__(6160); +const content_gen = __nccwpck_require__(5683); +const validationRules_gen = __nccwpck_require__(1960); +exports.API = api_gen.API; +exports.DATABASE_BACKUP_TRANSIENT_STATUSES = content_gen.DATABASE_BACKUP_TRANSIENT_STATUSES; +exports.INSTANCE_LOG_TRANSIENT_STATUSES = content_gen.INSTANCE_LOG_TRANSIENT_STATUSES; +exports.INSTANCE_TRANSIENT_STATUSES = content_gen.INSTANCE_TRANSIENT_STATUSES; +exports.MAINTENANCE_TRANSIENT_STATUSES = content_gen.MAINTENANCE_TRANSIENT_STATUSES; +exports.READ_REPLICA_TRANSIENT_STATUSES = content_gen.READ_REPLICA_TRANSIENT_STATUSES; +exports.SNAPSHOT_TRANSIENT_STATUSES = content_gen.SNAPSHOT_TRANSIENT_STATUSES; +exports.ValidationRules = validationRules_gen; -/** Lists transient statutes of the enum {@link PrivateNetworkStatus}. */ -const PRIVATE_NETWORK_TRANSIENT_STATUSES = ['pending']; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const unmarshalSubscriberEmailConfig = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'SubscriberEmailConfig' failed as data isn't a dictionary.`); - } - return { - email: data.email - }; -}; -const unmarshalSubscriberWebhookConfig = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'SubscriberWebhookConfig' failed as data isn't a dictionary.`); - } - return { - uri: data.uri - }; -}; -const unmarshalHealthCheckHttpConfig = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'HealthCheckHttpConfig' failed as data isn't a dictionary.`); - } - return { - code: data.code, - hostHeader: data.host_header, - method: data.method, - uri: data.uri - }; -}; -const unmarshalHealthCheckHttpsConfig = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'HealthCheckHttpsConfig' failed as data isn't a dictionary.`); - } - return { - code: data.code, - hostHeader: data.host_header, - method: data.method, - sni: data.sni, - uri: data.uri - }; -}; -const unmarshalHealthCheckLdapConfig = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'HealthCheckLdapConfig' failed as data isn't a dictionary.`); - } - return {}; -}; -const unmarshalHealthCheckMysqlConfig = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'HealthCheckMysqlConfig' failed as data isn't a dictionary.`); - } - return { - user: data.user - }; -}; -const unmarshalHealthCheckPgsqlConfig = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'HealthCheckPgsqlConfig' failed as data isn't a dictionary.`); - } - return { - user: data.user - }; -}; -const unmarshalHealthCheckRedisConfig = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'HealthCheckRedisConfig' failed as data isn't a dictionary.`); +/***/ }), + +/***/ 5034: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const randomName = __nccwpck_require__(8141); +const json = __nccwpck_require__(3746); +const customMarshalling = __nccwpck_require__(7586); +const marshalling = __nccwpck_require__(1162); +const unmarshalEndpointDirectAccessDetails = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'EndpointDirectAccessDetails' failed as data isn't a dictionary.` + ); } return {}; }; -const unmarshalHealthCheckTcpConfig = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'HealthCheckTcpConfig' failed as data isn't a dictionary.`); +const unmarshalEndpointLoadBalancerDetails = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'EndpointLoadBalancerDetails' failed as data isn't a dictionary.` + ); } return {}; }; -const unmarshalInstance$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Instance' failed as data isn't a dictionary.`); - } - return { - createdAt: unmarshalDate(data.created_at), - id: data.id, - ipAddress: data.ip_address, - region: data.region, - status: data.status, - updatedAt: unmarshalDate(data.updated_at), - zone: data.zone - }; -}; -const unmarshalIp = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Ip' failed as data isn't a dictionary.`); +const unmarshalEndpointPrivateNetworkDetails = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'EndpointPrivateNetworkDetails' failed as data isn't a dictionary.` + ); } return { - id: data.id, - ipAddress: data.ip_address, - lbId: data.lb_id, - organizationId: data.organization_id, - projectId: data.project_id, - region: data.region, - reverse: data.reverse, + privateNetworkId: data.private_network_id, + provisioningMode: data.provisioning_mode, + serviceIp: data.service_ip, zone: data.zone }; }; -const unmarshalSubscriber = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Subscriber' failed as data isn't a dictionary.`); +const unmarshalEndpoint = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Endpoint' failed as data isn't a dictionary.` + ); } return { - emailConfig: data.email_config ? unmarshalSubscriberEmailConfig(data.email_config) : undefined, + directAccess: data.direct_access ? unmarshalEndpointDirectAccessDetails(data.direct_access) : void 0, + hostname: data.hostname, id: data.id, + ip: data.ip, + loadBalancer: data.load_balancer ? unmarshalEndpointLoadBalancerDetails(data.load_balancer) : void 0, name: data.name, - webhookConfig: data.webhook_config ? unmarshalSubscriberWebhookConfig(data.webhook_config) : undefined - }; -}; -const unmarshalHealthCheck = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'HealthCheck' failed as data isn't a dictionary.`); - } - return { - checkDelay: data.check_delay, - checkMaxRetries: data.check_max_retries, - checkSendProxy: data.check_send_proxy, - checkTimeout: data.check_timeout, - httpConfig: data.http_config ? unmarshalHealthCheckHttpConfig(data.http_config) : undefined, - httpsConfig: data.https_config ? unmarshalHealthCheckHttpsConfig(data.https_config) : undefined, - ldapConfig: data.ldap_config ? unmarshalHealthCheckLdapConfig(data.ldap_config) : undefined, - mysqlConfig: data.mysql_config ? unmarshalHealthCheckMysqlConfig(data.mysql_config) : undefined, - pgsqlConfig: data.pgsql_config ? unmarshalHealthCheckPgsqlConfig(data.pgsql_config) : undefined, port: data.port, - redisConfig: data.redis_config ? unmarshalHealthCheckRedisConfig(data.redis_config) : undefined, - tcpConfig: data.tcp_config ? unmarshalHealthCheckTcpConfig(data.tcp_config) : undefined, - transientCheckDelay: data.transient_check_delay + privateNetwork: data.private_network ? unmarshalEndpointPrivateNetworkDetails(data.private_network) : void 0 }; }; -const unmarshalLb = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Lb' failed as data isn't a dictionary.`); +const unmarshalMaintenance = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Maintenance' failed as data isn't a dictionary.` + ); } return { - backendCount: data.backend_count, - createdAt: unmarshalDate(data.created_at), - description: data.description, - frontendCount: data.frontend_count, - id: data.id, - instances: unmarshalArrayOfObject(data.instances, unmarshalInstance$1), - ip: unmarshalArrayOfObject(data.ip, unmarshalIp), - name: data.name, - organizationId: data.organization_id, - privateNetworkCount: data.private_network_count, - projectId: data.project_id, - region: data.region, - routeCount: data.route_count, - sslCompatibilityLevel: data.ssl_compatibility_level, + closedAt: marshalling.unmarshalDate(data.closed_at), + forcedAt: marshalling.unmarshalDate(data.forced_at), + reason: data.reason, + startsAt: marshalling.unmarshalDate(data.starts_at), status: data.status, - subscriber: data.subscriber ? unmarshalSubscriber(data.subscriber) : undefined, - tags: data.tags, - type: data.type, - updatedAt: unmarshalDate(data.updated_at), - zone: data.zone + stopsAt: marshalling.unmarshalDate(data.stops_at) }; }; -const unmarshalAclActionRedirect = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'AclActionRedirect' failed as data isn't a dictionary.`); +const unmarshalReadReplica = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ReadReplica' failed as data isn't a dictionary.` + ); } return { - code: data.code, - target: data.target, - type: data.type - }; -}; -const unmarshalBackend = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Backend' failed as data isn't a dictionary.`); - } - return { - createdAt: unmarshalDate(data.created_at), - failoverHost: data.failover_host, - forwardPort: data.forward_port, - forwardPortAlgorithm: data.forward_port_algorithm, - forwardProtocol: data.forward_protocol, - healthCheck: data.health_check ? unmarshalHealthCheck(data.health_check) : undefined, + endpoints: marshalling.unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint), id: data.id, - ignoreSslServerVerify: data.ignore_ssl_server_verify, - lb: data.lb ? unmarshalLb(data.lb) : undefined, - maxConnections: data.max_connections, - maxRetries: data.max_retries, - name: data.name, - onMarkedDownAction: data.on_marked_down_action, - pool: data.pool, - proxyProtocol: data.proxy_protocol, - redispatchAttemptCount: data.redispatch_attempt_count, - sendProxyV2: data.send_proxy_v2, - sslBridging: data.ssl_bridging, - stickySessions: data.sticky_sessions, - stickySessionsCookieName: data.sticky_sessions_cookie_name, - timeoutConnect: data.timeout_connect, - timeoutQueue: data.timeout_queue, - timeoutServer: data.timeout_server, - timeoutTunnel: data.timeout_tunnel, - updatedAt: unmarshalDate(data.updated_at) + instanceId: data.instance_id, + region: data.region, + sameZone: data.same_zone, + status: data.status }; }; -const unmarshalCertificate = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Certificate' failed as data isn't a dictionary.`); +const unmarshalDatabaseBackup = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DatabaseBackup' failed as data isn't a dictionary.` + ); } return { - commonName: data.common_name, - createdAt: unmarshalDate(data.created_at), - fingerprint: data.fingerprint, + createdAt: marshalling.unmarshalDate(data.created_at), + databaseName: data.database_name, + downloadUrl: data.download_url, + downloadUrlExpiresAt: marshalling.unmarshalDate(data.download_url_expires_at), + expiresAt: marshalling.unmarshalDate(data.expires_at), id: data.id, - lb: data.lb ? unmarshalLb(data.lb) : undefined, - name: data.name, - notValidAfter: unmarshalDate(data.not_valid_after), - notValidBefore: unmarshalDate(data.not_valid_before), - status: data.status, - statusDetails: data.status_details, - subjectAlternativeName: data.subject_alternative_name, - type: data.type, - updatedAt: unmarshalDate(data.updated_at) - }; -}; -const unmarshalAclAction = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'AclAction' failed as data isn't a dictionary.`); - } - return { - redirect: data.redirect ? unmarshalAclActionRedirect(data.redirect) : undefined, - type: data.type - }; -}; -const unmarshalAclMatch = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'AclMatch' failed as data isn't a dictionary.`); - } - return { - httpFilter: data.http_filter, - httpFilterOption: data.http_filter_option, - httpFilterValue: data.http_filter_value, - invert: data.invert, - ipSubnet: data.ip_subnet + instanceId: data.instance_id, + instanceName: data.instance_name, + name: data.name, + region: data.region, + sameRegion: data.same_region, + size: data.size, + status: data.status, + updatedAt: marshalling.unmarshalDate(data.updated_at) }; }; -const unmarshalFrontend = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Frontend' failed as data isn't a dictionary.`); +const unmarshalDatabase = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Database' failed as data isn't a dictionary.` + ); } return { - backend: data.backend ? unmarshalBackend(data.backend) : undefined, - certificate: data.certificate ? unmarshalCertificate(data.certificate) : undefined, - certificateIds: data.certificate_ids, - createdAt: unmarshalDate(data.created_at), - enableHttp3: data.enable_http3, - id: data.id, - inboundPort: data.inbound_port, - lb: data.lb ? unmarshalLb(data.lb) : undefined, + managed: data.managed, name: data.name, - timeoutClient: data.timeout_client, - updatedAt: unmarshalDate(data.updated_at) + owner: data.owner, + size: data.size }; }; -const unmarshalPrivateNetworkDHCPConfig = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'PrivateNetworkDHCPConfig' failed as data isn't a dictionary.`); +const unmarshalInstanceLog = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'InstanceLog' failed as data isn't a dictionary.` + ); } return { - ipId: data.ip_id + createdAt: marshalling.unmarshalDate(data.created_at), + downloadUrl: data.download_url, + expiresAt: marshalling.unmarshalDate(data.expires_at), + id: data.id, + nodeName: data.node_name, + region: data.region, + status: data.status }; }; -const unmarshalPrivateNetworkIpamConfig = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'PrivateNetworkIpamConfig' failed as data isn't a dictionary.`); - } - return {}; -}; -const unmarshalPrivateNetworkStaticConfig = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'PrivateNetworkStaticConfig' failed as data isn't a dictionary.`); +const unmarshalBackupSchedule = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'BackupSchedule' failed as data isn't a dictionary.` + ); } return { - ipAddress: data.ip_address + disabled: data.disabled, + frequency: data.frequency, + nextRunAt: marshalling.unmarshalDate(data.next_run_at), + retention: data.retention }; }; -const unmarshalRouteMatch = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'RouteMatch' failed as data isn't a dictionary.`); +const unmarshalEncryptionAtRest = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'EncryptionAtRest' failed as data isn't a dictionary.` + ); } return { - hostHeader: data.host_header, - sni: data.sni + enabled: data.enabled }; }; -const unmarshalAcl = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Acl' failed as data isn't a dictionary.`); +const unmarshalInstanceSetting = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'InstanceSetting' failed as data isn't a dictionary.` + ); } return { - action: data.action ? unmarshalAclAction(data.action) : undefined, - createdAt: unmarshalDate(data.created_at), - description: data.description, - frontend: data.frontend ? unmarshalFrontend(data.frontend) : undefined, - id: data.id, - index: data.index, - match: data.match ? unmarshalAclMatch(data.match) : undefined, name: data.name, - updatedAt: unmarshalDate(data.updated_at) + value: data.value }; }; -const unmarshalBackendServerStats = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'BackendServerStats' failed as data isn't a dictionary.`); +const unmarshalLogsPolicy = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'LogsPolicy' failed as data isn't a dictionary.` + ); } return { - backendId: data.backend_id, - instanceId: data.instance_id, - ip: data.ip, - lastHealthCheckStatus: data.last_health_check_status, - serverState: data.server_state, - serverStateChangedAt: unmarshalDate(data.server_state_changed_at) + maxAgeRetention: data.max_age_retention, + totalDiskRetention: data.total_disk_retention }; }; -const unmarshalLbType = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'LbType' failed as data isn't a dictionary.`); +const unmarshalUpgradableVersion = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'UpgradableVersion' failed as data isn't a dictionary.` + ); } return { - description: data.description, + id: data.id, + minorVersion: data.minor_version, name: data.name, - region: data.region, - stockStatus: data.stock_status, - zone: data.zone + version: data.version }; }; -const unmarshalPrivateNetwork$3 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'PrivateNetwork' failed as data isn't a dictionary.`); +const unmarshalVolume = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Volume' failed as data isn't a dictionary.` + ); } return { - createdAt: unmarshalDate(data.created_at), - dhcpConfig: data.dhcp_config ? unmarshalPrivateNetworkDHCPConfig(data.dhcp_config) : undefined, - ipamConfig: data.ipam_config ? unmarshalPrivateNetworkIpamConfig(data.ipam_config) : undefined, - ipamIds: data.ipam_ids, - lb: data.lb ? unmarshalLb(data.lb) : undefined, - privateNetworkId: data.private_network_id, - staticConfig: data.static_config ? unmarshalPrivateNetworkStaticConfig(data.static_config) : undefined, - status: data.status, - updatedAt: unmarshalDate(data.updated_at) + class: data.class, + size: data.size, + type: data.type }; }; -const unmarshalRoute = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Route' failed as data isn't a dictionary.`); +const unmarshalInstance = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Instance' failed as data isn't a dictionary.` + ); } return { - backendId: data.backend_id, - createdAt: unmarshalDate(data.created_at), - frontendId: data.frontend_id, + backupSameRegion: data.backup_same_region, + backupSchedule: data.backup_schedule ? unmarshalBackupSchedule(data.backup_schedule) : void 0, + createdAt: marshalling.unmarshalDate(data.created_at), + encryption: data.encryption ? unmarshalEncryptionAtRest(data.encryption) : void 0, + endpoint: data.endpoint ? unmarshalEndpoint(data.endpoint) : void 0, + endpoints: marshalling.unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint), + engine: data.engine, id: data.id, - match: data.match ? unmarshalRouteMatch(data.match) : undefined, - updatedAt: unmarshalDate(data.updated_at) + initSettings: marshalling.unmarshalArrayOfObject( + data.init_settings, + unmarshalInstanceSetting + ), + isHaCluster: data.is_ha_cluster, + logsPolicy: data.logs_policy ? unmarshalLogsPolicy(data.logs_policy) : void 0, + maintenances: marshalling.unmarshalArrayOfObject( + data.maintenances, + unmarshalMaintenance + ), + name: data.name, + nodeType: data.node_type, + organizationId: data.organization_id, + projectId: data.project_id, + readReplicas: marshalling.unmarshalArrayOfObject( + data.read_replicas, + unmarshalReadReplica + ), + region: data.region, + settings: marshalling.unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting), + status: data.status, + tags: data.tags, + upgradableVersion: marshalling.unmarshalArrayOfObject( + data.upgradable_version, + unmarshalUpgradableVersion + ), + volume: data.volume ? unmarshalVolume(data.volume) : void 0 }; }; -const unmarshalLbStats = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'LbStats' failed as data isn't a dictionary.`); +const unmarshalPrivilege = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Privilege' failed as data isn't a dictionary.` + ); } return { - backendServersStats: unmarshalArrayOfObject(data.backend_servers_stats, unmarshalBackendServerStats) + databaseName: data.database_name, + permission: data.permission, + userName: data.user_name }; }; -const unmarshalListAclResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListAclResponse' failed as data isn't a dictionary.`); +const unmarshalSnapshotVolumeType = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SnapshotVolumeType' failed as data isn't a dictionary.` + ); } return { - acls: unmarshalArrayOfObject(data.acls, unmarshalAcl), - totalCount: data.total_count + class: data.class, + type: data.type }; }; -const unmarshalListBackendStatsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListBackendStatsResponse' failed as data isn't a dictionary.`); +const unmarshalSnapshot = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Snapshot' failed as data isn't a dictionary.` + ); } return { - backendServersStats: unmarshalArrayOfObject(data.backend_servers_stats, unmarshalBackendServerStats), - totalCount: data.total_count + createdAt: marshalling.unmarshalDate(data.created_at), + expiresAt: marshalling.unmarshalDate(data.expires_at), + id: data.id, + instanceId: data.instance_id, + instanceName: data.instance_name, + name: data.name, + nodeType: data.node_type, + region: data.region, + size: data.size, + status: data.status, + updatedAt: marshalling.unmarshalDate(data.updated_at), + volumeType: data.volume_type ? unmarshalSnapshotVolumeType(data.volume_type) : void 0 }; }; -const unmarshalListBackendsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListBackendsResponse' failed as data isn't a dictionary.`); +const unmarshalUser = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'User' failed as data isn't a dictionary.` + ); } return { - backends: unmarshalArrayOfObject(data.backends, unmarshalBackend), - totalCount: data.total_count + isAdmin: data.is_admin, + name: data.name }; }; -const unmarshalListCertificatesResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListCertificatesResponse' failed as data isn't a dictionary.`); +const unmarshalACLRule = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ACLRule' failed as data isn't a dictionary.` + ); } return { - certificates: unmarshalArrayOfObject(data.certificates, unmarshalCertificate), - totalCount: data.total_count + action: data.action, + description: data.description, + direction: data.direction, + ip: data.ip, + port: data.port, + protocol: data.protocol }; }; -const unmarshalListFrontendsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListFrontendsResponse' failed as data isn't a dictionary.`); +const unmarshalAddInstanceACLRulesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'AddInstanceACLRulesResponse' failed as data isn't a dictionary.` + ); } return { - frontends: unmarshalArrayOfObject(data.frontends, unmarshalFrontend), - totalCount: data.total_count + rules: marshalling.unmarshalArrayOfObject(data.rules, unmarshalACLRule) }; }; -const unmarshalListIpsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListIpsResponse' failed as data isn't a dictionary.`); +const unmarshalAddInstanceSettingsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'AddInstanceSettingsResponse' failed as data isn't a dictionary.` + ); } return { - ips: unmarshalArrayOfObject(data.ips, unmarshalIp), - totalCount: data.total_count + settings: marshalling.unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting) }; }; -const unmarshalListLbPrivateNetworksResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListLbPrivateNetworksResponse' failed as data isn't a dictionary.`); +const unmarshalDeleteInstanceACLRulesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DeleteInstanceACLRulesResponse' failed as data isn't a dictionary.` + ); } return { - privateNetwork: unmarshalArrayOfObject(data.private_network, unmarshalPrivateNetwork$3), - totalCount: data.total_count + rules: marshalling.unmarshalArrayOfObject(data.rules, unmarshalACLRule) }; }; -const unmarshalListLbTypesResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListLbTypesResponse' failed as data isn't a dictionary.`); +const unmarshalDeleteInstanceSettingsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DeleteInstanceSettingsResponse' failed as data isn't a dictionary.` + ); } return { - lbTypes: unmarshalArrayOfObject(data.lb_types, unmarshalLbType), - totalCount: data.total_count + settings: marshalling.unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting) }; }; -const unmarshalListLbsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListLbsResponse' failed as data isn't a dictionary.`); +const unmarshalInstanceMetrics = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'InstanceMetrics' failed as data isn't a dictionary.` + ); } return { - lbs: unmarshalArrayOfObject(data.lbs, unmarshalLb), - totalCount: data.total_count + timeseries: marshalling.unmarshalArrayOfObject(data.timeseries, customMarshalling.unmarshalTimeSeries) }; }; -const unmarshalListRoutesResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListRoutesResponse' failed as data isn't a dictionary.`); +const unmarshalListDatabaseBackupsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListDatabaseBackupsResponse' failed as data isn't a dictionary.` + ); } return { - routes: unmarshalArrayOfObject(data.routes, unmarshalRoute), + databaseBackups: marshalling.unmarshalArrayOfObject( + data.database_backups, + unmarshalDatabaseBackup + ), totalCount: data.total_count }; }; -const unmarshalListSubscriberResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListSubscriberResponse' failed as data isn't a dictionary.`); +const unmarshalEngineSetting = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'EngineSetting' failed as data isn't a dictionary.` + ); } return { - subscribers: unmarshalArrayOfObject(data.subscribers, unmarshalSubscriber), - totalCount: data.total_count + defaultValue: data.default_value, + description: data.description, + floatMax: data.float_max, + floatMin: data.float_min, + hotConfigurable: data.hot_configurable, + intMax: data.int_max, + intMin: data.int_min, + name: data.name, + propertyType: data.property_type, + stringConstraint: data.string_constraint, + unit: data.unit }; }; -const unmarshalSetAclsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'SetAclsResponse' failed as data isn't a dictionary.`); +const unmarshalEngineVersion = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'EngineVersion' failed as data isn't a dictionary.` + ); } return { - acls: unmarshalArrayOfObject(data.acls, unmarshalAcl), - totalCount: data.total_count - }; -}; -const marshalAclActionRedirect = (request, defaults) => ({ - code: request.code, - target: request.target, - type: request.type -}); -const marshalAclAction = (request, defaults) => ({ - redirect: request.redirect ? marshalAclActionRedirect(request.redirect) : undefined, - type: request.type -}); -const marshalAclMatch = (request, defaults) => ({ - http_filter: request.httpFilter, - http_filter_option: request.httpFilterOption, - http_filter_value: request.httpFilterValue, - invert: request.invert, - ip_subnet: request.ipSubnet -}); -const marshalHealthCheckHttpConfig = (request, defaults) => ({ - code: request.code, - host_header: request.hostHeader, - method: request.method, - uri: request.uri -}); -const marshalHealthCheckHttpsConfig = (request, defaults) => ({ - code: request.code, - host_header: request.hostHeader, - method: request.method, - sni: request.sni, - uri: request.uri -}); -const marshalHealthCheckLdapConfig = (request, defaults) => ({}); -const marshalHealthCheckMysqlConfig = (request, defaults) => ({ - user: request.user -}); -const marshalHealthCheckPgsqlConfig = (request, defaults) => ({ - user: request.user -}); -const marshalHealthCheckRedisConfig = (request, defaults) => ({}); -const marshalHealthCheckTcpConfig = (request, defaults) => ({}); -const marshalAclSpec = (request, defaults) => ({ - action: marshalAclAction(request.action), - description: request.description, - index: request.index, - match: request.match ? marshalAclMatch(request.match) : undefined, - name: request.name -}); -const marshalCreateCertificateRequestCustomCertificate = (request, defaults) => ({ - certificate_chain: request.certificateChain -}); -const marshalCreateCertificateRequestLetsencryptConfig = (request, defaults) => ({ - common_name: request.commonName, - subject_alternative_name: request.subjectAlternativeName -}); -const marshalHealthCheck = (request, defaults) => ({ - check_delay: request.checkDelay, - check_max_retries: request.checkMaxRetries, - check_send_proxy: request.checkSendProxy, - check_timeout: request.checkTimeout, - port: request.port, - transient_check_delay: request.transientCheckDelay, - ...resolveOneOf([{ - param: 'tcp_config', - value: request.tcpConfig ? marshalHealthCheckTcpConfig(request.tcpConfig) : undefined - }, { - param: 'mysql_config', - value: request.mysqlConfig ? marshalHealthCheckMysqlConfig(request.mysqlConfig) : undefined - }, { - param: 'pgsql_config', - value: request.pgsqlConfig ? marshalHealthCheckPgsqlConfig(request.pgsqlConfig) : undefined - }, { - param: 'ldap_config', - value: request.ldapConfig ? marshalHealthCheckLdapConfig(request.ldapConfig) : undefined - }, { - param: 'redis_config', - value: request.redisConfig ? marshalHealthCheckRedisConfig(request.redisConfig) : undefined - }, { - param: 'http_config', - value: request.httpConfig ? marshalHealthCheckHttpConfig(request.httpConfig) : undefined - }, { - param: 'https_config', - value: request.httpsConfig ? marshalHealthCheckHttpsConfig(request.httpsConfig) : undefined - }]) -}); -const marshalPrivateNetworkDHCPConfig = (request, defaults) => ({ - ip_id: request.ipId -}); -const marshalPrivateNetworkIpamConfig = (request, defaults) => ({}); -const marshalPrivateNetworkStaticConfig = (request, defaults) => ({ - ip_address: request.ipAddress -}); -const marshalRouteMatch = (request, defaults) => ({ - ...resolveOneOf([{ - param: 'sni', - value: request.sni - }, { - param: 'host_header', - value: request.hostHeader - }]) -}); -const marshalSubscriberEmailConfig = (request, defaults) => ({ - email: request.email -}); -const marshalSubscriberWebhookConfig = (request, defaults) => ({ - uri: request.uri -}); -const marshalAddBackendServersRequest = (request, defaults) => ({ - server_ip: request.serverIp -}); -const marshalAttachPrivateNetworkRequest = (request, defaults) => ({ - ...resolveOneOf([{ - param: 'static_config', - value: request.staticConfig ? marshalPrivateNetworkStaticConfig(request.staticConfig) : undefined - }, { - param: 'dhcp_config', - value: request.dhcpConfig ? marshalPrivateNetworkDHCPConfig(request.dhcpConfig) : undefined - }, { - param: 'ipam_config', - value: request.ipamConfig ? marshalPrivateNetworkIpamConfig(request.ipamConfig) : undefined - }]) -}); -const marshalCreateAclRequest = (request, defaults) => ({ - action: marshalAclAction(request.action), - description: request.description, - index: request.index, - match: request.match ? marshalAclMatch(request.match) : undefined, - name: request.name || randomName('acl') -}); -const marshalCreateBackendRequest = (request, defaults) => ({ - failover_host: request.failoverHost, - forward_port: request.forwardPort, - forward_port_algorithm: request.forwardPortAlgorithm, - forward_protocol: request.forwardProtocol, - health_check: marshalHealthCheck(request.healthCheck), - ignore_ssl_server_verify: request.ignoreSslServerVerify, - max_connections: request.maxConnections, - max_retries: request.maxRetries, - name: request.name || randomName('lbb'), - on_marked_down_action: request.onMarkedDownAction ?? 'on_marked_down_action_none', - proxy_protocol: request.proxyProtocol ?? 'proxy_protocol_unknown', - redispatch_attempt_count: request.redispatchAttemptCount, - send_proxy_v2: request.sendProxyV2, - server_ip: request.serverIp, - ssl_bridging: request.sslBridging, - sticky_sessions: request.stickySessions, - sticky_sessions_cookie_name: request.stickySessionsCookieName, - timeout_connect: request.timeoutConnect, - timeout_queue: request.timeoutQueue, - timeout_server: request.timeoutServer, - timeout_tunnel: request.timeoutTunnel -}); -const marshalCreateCertificateRequest = (request, defaults) => ({ - name: request.name || randomName('certificate'), - ...resolveOneOf([{ - param: 'letsencrypt', - value: request.letsencrypt ? marshalCreateCertificateRequestLetsencryptConfig(request.letsencrypt) : undefined - }, { - param: 'custom_certificate', - value: request.customCertificate ? marshalCreateCertificateRequestCustomCertificate(request.customCertificate) : undefined - }], true) -}); -const marshalCreateFrontendRequest = (request, defaults) => ({ - backend_id: request.backendId, - certificate_id: request.certificateId, - certificate_ids: request.certificateIds, - enable_http3: request.enableHttp3, - inbound_port: request.inboundPort, - name: request.name || randomName('lbf'), - timeout_client: request.timeoutClient -}); -const marshalCreateIpRequest = (request, defaults) => ({ - reverse: request.reverse, - ...resolveOneOf([{ - default: defaults.defaultProjectId, - param: 'project_id', - value: request.projectId - }, { - default: defaults.defaultOrganizationId, - param: 'organization_id', - value: request.organizationId - }]) -}); -const marshalCreateLbRequest = (request, defaults) => ({ - assign_flexible_ip: request.assignFlexibleIp, - description: request.description, - ip_id: request.ipId, - name: request.name || randomName('lb'), - ssl_compatibility_level: request.sslCompatibilityLevel ?? 'ssl_compatibility_level_unknown', - tags: request.tags, - type: request.type, - ...resolveOneOf([{ - default: defaults.defaultProjectId, - param: 'project_id', - value: request.projectId - }, { - default: defaults.defaultOrganizationId, - param: 'organization_id', - value: request.organizationId - }]) -}); -const marshalCreateRouteRequest = (request, defaults) => ({ - backend_id: request.backendId, - frontend_id: request.frontendId, - match: request.match ? marshalRouteMatch(request.match) : undefined -}); -const marshalCreateSubscriberRequest = (request, defaults) => ({ - name: request.name, - ...resolveOneOf([{ - default: defaults.defaultProjectId, - param: 'project_id', - value: request.projectId - }, { - default: defaults.defaultOrganizationId, - param: 'organization_id', - value: request.organizationId - }]), - ...resolveOneOf([{ - param: 'email_config', - value: request.emailConfig ? marshalSubscriberEmailConfig(request.emailConfig) : undefined - }, { - param: 'webhook_config', - value: request.webhookConfig ? marshalSubscriberWebhookConfig(request.webhookConfig) : undefined - }]) -}); -const marshalMigrateLbRequest = (request, defaults) => ({ - type: request.type -}); -const marshalRemoveBackendServersRequest = (request, defaults) => ({ - server_ip: request.serverIp -}); -const marshalSetBackendServersRequest = (request, defaults) => ({ - server_ip: request.serverIp -}); -const marshalSubscribeToLbRequest = (request, defaults) => ({ - subscriber_id: request.subscriberId -}); -const marshalUpdateAclRequest = (request, defaults) => ({ - action: marshalAclAction(request.action), + availableInitSettings: marshalling.unmarshalArrayOfObject( + data.available_init_settings, + unmarshalEngineSetting + ), + availableSettings: marshalling.unmarshalArrayOfObject( + data.available_settings, + unmarshalEngineSetting + ), + beta: data.beta, + disabled: data.disabled, + endOfLife: marshalling.unmarshalDate(data.end_of_life), + name: data.name, + version: data.version + }; +}; +const unmarshalDatabaseEngine = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DatabaseEngine' failed as data isn't a dictionary.` + ); + } + return { + logoUrl: data.logo_url, + name: data.name, + region: data.region, + versions: marshalling.unmarshalArrayOfObject(data.versions, unmarshalEngineVersion) + }; +}; +const unmarshalListDatabaseEnginesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListDatabaseEnginesResponse' failed as data isn't a dictionary.` + ); + } + return { + engines: marshalling.unmarshalArrayOfObject(data.engines, unmarshalDatabaseEngine), + totalCount: data.total_count + }; +}; +const unmarshalListDatabasesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListDatabasesResponse' failed as data isn't a dictionary.` + ); + } + return { + databases: marshalling.unmarshalArrayOfObject(data.databases, unmarshalDatabase), + totalCount: data.total_count + }; +}; +const unmarshalListInstanceACLRulesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListInstanceACLRulesResponse' failed as data isn't a dictionary.` + ); + } + return { + rules: marshalling.unmarshalArrayOfObject(data.rules, unmarshalACLRule), + totalCount: data.total_count + }; +}; +const unmarshalListInstanceLogsDetailsResponseInstanceLogDetail = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListInstanceLogsDetailsResponseInstanceLogDetail' failed as data isn't a dictionary.` + ); + } + return { + logName: data.log_name, + size: data.size + }; +}; +const unmarshalListInstanceLogsDetailsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListInstanceLogsDetailsResponse' failed as data isn't a dictionary.` + ); + } + return { + details: marshalling.unmarshalArrayOfObject( + data.details, + unmarshalListInstanceLogsDetailsResponseInstanceLogDetail + ) + }; +}; +const unmarshalListInstanceLogsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListInstanceLogsResponse' failed as data isn't a dictionary.` + ); + } + return { + instanceLogs: marshalling.unmarshalArrayOfObject( + data.instance_logs, + unmarshalInstanceLog + ) + }; +}; +const unmarshalListInstancesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListInstancesResponse' failed as data isn't a dictionary.` + ); + } + return { + instances: marshalling.unmarshalArrayOfObject(data.instances, unmarshalInstance), + totalCount: data.total_count + }; +}; +const unmarshalNodeTypeVolumeConstraintSizes = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'NodeTypeVolumeConstraintSizes' failed as data isn't a dictionary.` + ); + } + return { + maxSize: data.max_size, + minSize: data.min_size + }; +}; +const unmarshalNodeTypeVolumeType = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'NodeTypeVolumeType' failed as data isn't a dictionary.` + ); + } + return { + chunkSize: data.chunk_size, + class: data.class, + description: data.description, + maxSize: data.max_size, + minSize: data.min_size, + type: data.type + }; +}; +const unmarshalNodeType = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'NodeType' failed as data isn't a dictionary.` + ); + } + return { + availableVolumeTypes: marshalling.unmarshalArrayOfObject( + data.available_volume_types, + unmarshalNodeTypeVolumeType + ), + beta: data.beta, + description: data.description, + disabled: data.disabled, + generation: data.generation, + instanceRange: data.instance_range, + isBssdCompatible: data.is_bssd_compatible, + isHaRequired: data.is_ha_required, + memory: data.memory, + name: data.name, + region: data.region, + stockStatus: data.stock_status, + vcpus: data.vcpus, + volumeConstraint: data.volume_constraint ? unmarshalNodeTypeVolumeConstraintSizes(data.volume_constraint) : void 0 + }; +}; +const unmarshalListNodeTypesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListNodeTypesResponse' failed as data isn't a dictionary.` + ); + } + return { + nodeTypes: marshalling.unmarshalArrayOfObject(data.node_types, unmarshalNodeType), + totalCount: data.total_count + }; +}; +const unmarshalListPrivilegesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListPrivilegesResponse' failed as data isn't a dictionary.` + ); + } + return { + privileges: marshalling.unmarshalArrayOfObject(data.privileges, unmarshalPrivilege), + totalCount: data.total_count + }; +}; +const unmarshalListSnapshotsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListSnapshotsResponse' failed as data isn't a dictionary.` + ); + } + return { + snapshots: marshalling.unmarshalArrayOfObject(data.snapshots, unmarshalSnapshot), + totalCount: data.total_count + }; +}; +const unmarshalListUsersResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListUsersResponse' failed as data isn't a dictionary.` + ); + } + return { + totalCount: data.total_count, + users: marshalling.unmarshalArrayOfObject(data.users, unmarshalUser) + }; +}; +const unmarshalPrepareInstanceLogsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'PrepareInstanceLogsResponse' failed as data isn't a dictionary.` + ); + } + return { + instanceLogs: marshalling.unmarshalArrayOfObject( + data.instance_logs, + unmarshalInstanceLog + ) + }; +}; +const unmarshalSetInstanceACLRulesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SetInstanceACLRulesResponse' failed as data isn't a dictionary.` + ); + } + return { + rules: marshalling.unmarshalArrayOfObject(data.rules, unmarshalACLRule) + }; +}; +const unmarshalSetInstanceSettingsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SetInstanceSettingsResponse' failed as data isn't a dictionary.` + ); + } + return { + settings: marshalling.unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting) + }; +}; +const marshalACLRuleRequest = (request, defaults) => ({ description: request.description, - index: request.index, - match: request.match ? marshalAclMatch(request.match) : undefined, - name: request.name -}); -const marshalUpdateBackendRequest = (request, defaults) => ({ - failover_host: request.failoverHost, - forward_port: request.forwardPort, - forward_port_algorithm: request.forwardPortAlgorithm, - forward_protocol: request.forwardProtocol, - ignore_ssl_server_verify: request.ignoreSslServerVerify, - max_connections: request.maxConnections, - max_retries: request.maxRetries, - name: request.name, - on_marked_down_action: request.onMarkedDownAction ?? 'on_marked_down_action_none', - proxy_protocol: request.proxyProtocol ?? 'proxy_protocol_unknown', - redispatch_attempt_count: request.redispatchAttemptCount, - send_proxy_v2: request.sendProxyV2, - ssl_bridging: request.sslBridging, - sticky_sessions: request.stickySessions, - sticky_sessions_cookie_name: request.stickySessionsCookieName, - timeout_connect: request.timeoutConnect, - timeout_queue: request.timeoutQueue, - timeout_server: request.timeoutServer, - timeout_tunnel: request.timeoutTunnel -}); -const marshalUpdateCertificateRequest = (request, defaults) => ({ - name: request.name -}); -const marshalUpdateFrontendRequest = (request, defaults) => ({ - backend_id: request.backendId, - certificate_id: request.certificateId, - certificate_ids: request.certificateIds, - enable_http3: request.enableHttp3, - inbound_port: request.inboundPort, - name: request.name, - timeout_client: request.timeoutClient -}); -const marshalUpdateHealthCheckRequest = (request, defaults) => ({ - check_delay: request.checkDelay, - check_max_retries: request.checkMaxRetries, - check_send_proxy: request.checkSendProxy, - check_timeout: request.checkTimeout, - port: request.port, - transient_check_delay: request.transientCheckDelay, - ...resolveOneOf([{ - param: 'tcp_config', - value: request.tcpConfig ? marshalHealthCheckTcpConfig(request.tcpConfig) : undefined - }, { - param: 'mysql_config', - value: request.mysqlConfig ? marshalHealthCheckMysqlConfig(request.mysqlConfig) : undefined - }, { - param: 'pgsql_config', - value: request.pgsqlConfig ? marshalHealthCheckPgsqlConfig(request.pgsqlConfig) : undefined - }, { - param: 'ldap_config', - value: request.ldapConfig ? marshalHealthCheckLdapConfig(request.ldapConfig) : undefined - }, { - param: 'redis_config', - value: request.redisConfig ? marshalHealthCheckRedisConfig(request.redisConfig) : undefined - }, { - param: 'http_config', - value: request.httpConfig ? marshalHealthCheckHttpConfig(request.httpConfig) : undefined - }, { - param: 'https_config', - value: request.httpsConfig ? marshalHealthCheckHttpsConfig(request.httpsConfig) : undefined - }]) + ip: request.ip }); -const marshalUpdateIpRequest = (request, defaults) => ({ - reverse: request.reverse +const marshalAddInstanceACLRulesRequest = (request, defaults) => ({ + rules: request.rules.map((elt) => marshalACLRuleRequest(elt)) }); -const marshalUpdateLbRequest = (request, defaults) => ({ - description: request.description, +const marshalInstanceSetting = (request, defaults) => ({ name: request.name, - ssl_compatibility_level: request.sslCompatibilityLevel ?? 'ssl_compatibility_level_unknown', - tags: request.tags + value: request.value }); -const marshalUpdateRouteRequest = (request, defaults) => ({ - backend_id: request.backendId, - match: request.match ? marshalRouteMatch(request.match) : undefined +const marshalAddInstanceSettingsRequest = (request, defaults) => ({ + settings: request.settings.map((elt) => marshalInstanceSetting(elt)) }); -const marshalUpdateSubscriberRequest = (request, defaults) => ({ +const marshalCloneInstanceRequest = (request, defaults) => ({ name: request.name, - ...resolveOneOf([{ - param: 'email_config', - value: request.emailConfig ? marshalSubscriberEmailConfig(request.emailConfig) : undefined - }, { - param: 'webhook_config', - value: request.webhookConfig ? marshalSubscriberWebhookConfig(request.webhookConfig) : undefined - }]) + node_type: request.nodeType }); -const marshalZonedApiAddBackendServersRequest = (request, defaults) => ({ - server_ip: request.serverIp +const marshalCreateDatabaseBackupRequest = (request, defaults) => ({ + database_name: request.databaseName, + expires_at: request.expiresAt, + instance_id: request.instanceId, + name: request.name || randomName("bkp") }); -const marshalZonedApiAttachPrivateNetworkRequest = (request, defaults) => ({ - ...resolveOneOf([{ - param: 'static_config', - value: request.staticConfig ? marshalPrivateNetworkStaticConfig(request.staticConfig) : undefined - }, { - param: 'dhcp_config', - value: request.dhcpConfig ? marshalPrivateNetworkDHCPConfig(request.dhcpConfig) : undefined - }, { - param: 'ipam_config', - value: request.ipamConfig ? marshalPrivateNetworkIpamConfig(request.ipamConfig) : undefined - }]) +const marshalCreateDatabaseRequest = (request, defaults) => ({ + name: request.name }); -const marshalZonedApiCreateAclRequest = (request, defaults) => ({ - action: marshalAclAction(request.action), - description: request.description, - index: request.index, - match: request.match ? marshalAclMatch(request.match) : undefined, - name: request.name || randomName('acl') +const marshalEndpointSpecPrivateNetworkIpamConfig = (request, defaults) => ({}); +const marshalEndpointSpecLoadBalancer = (request, defaults) => ({}); +const marshalEndpointSpecPrivateNetwork = (request, defaults) => ({ + private_network_id: request.privateNetworkId, + ...marshalling.resolveOneOf([ + { param: "service_ip", value: request.serviceIp }, + { + param: "ipam_config", + value: request.ipamConfig !== void 0 ? marshalEndpointSpecPrivateNetworkIpamConfig( + request.ipamConfig + ) : void 0 + } + ]) }); -const marshalZonedApiCreateBackendRequest = (request, defaults) => ({ - failover_host: request.failoverHost, - forward_port: request.forwardPort, - forward_port_algorithm: request.forwardPortAlgorithm, - forward_protocol: request.forwardProtocol, - health_check: marshalHealthCheck(request.healthCheck), - ignore_ssl_server_verify: request.ignoreSslServerVerify, - max_connections: request.maxConnections, - max_retries: request.maxRetries, - name: request.name || randomName('lbb'), - on_marked_down_action: request.onMarkedDownAction ?? 'on_marked_down_action_none', - proxy_protocol: request.proxyProtocol ?? 'proxy_protocol_unknown', - redispatch_attempt_count: request.redispatchAttemptCount, - send_proxy_v2: request.sendProxyV2, - server_ip: request.serverIp, - ssl_bridging: request.sslBridging, - sticky_sessions: request.stickySessions, - sticky_sessions_cookie_name: request.stickySessionsCookieName, - timeout_connect: request.timeoutConnect, - timeout_queue: request.timeoutQueue, - timeout_server: request.timeoutServer, - timeout_tunnel: request.timeoutTunnel +const marshalEndpointSpec = (request, defaults) => ({ + ...marshalling.resolveOneOf([ + { + param: "load_balancer", + value: request.loadBalancer !== void 0 ? marshalEndpointSpecLoadBalancer(request.loadBalancer) : void 0 + }, + { + param: "private_network", + value: request.privateNetwork !== void 0 ? marshalEndpointSpecPrivateNetwork(request.privateNetwork) : void 0 + } + ]) }); -const marshalZonedApiCreateCertificateRequest = (request, defaults) => ({ - name: request.name || randomName('certificate'), - ...resolveOneOf([{ - param: 'letsencrypt', - value: request.letsencrypt ? marshalCreateCertificateRequestLetsencryptConfig(request.letsencrypt) : undefined - }, { - param: 'custom_certificate', - value: request.customCertificate ? marshalCreateCertificateRequestCustomCertificate(request.customCertificate) : undefined - }], true) +const marshalCreateEndpointRequest = (request, defaults) => ({ + endpoint_spec: request.endpointSpec !== void 0 ? marshalEndpointSpec(request.endpointSpec) : void 0 }); -const marshalZonedApiCreateFrontendRequest = (request, defaults) => ({ - backend_id: request.backendId, - certificate_id: request.certificateId, - certificate_ids: request.certificateIds, - enable_http3: request.enableHttp3, - inbound_port: request.inboundPort, - name: request.name || randomName('lbf'), - timeout_client: request.timeoutClient +const marshalCreateInstanceFromSnapshotRequest = (request, defaults) => ({ + instance_name: request.instanceName, + is_ha_cluster: request.isHaCluster, + node_type: request.nodeType }); -const marshalZonedApiCreateIpRequest = (request, defaults) => ({ - reverse: request.reverse, - ...resolveOneOf([{ - default: defaults.defaultProjectId, - param: 'project_id', - value: request.projectId - }, { - default: defaults.defaultOrganizationId, - param: 'organization_id', - value: request.organizationId - }]) +const marshalEncryptionAtRest = (request, defaults) => ({ + enabled: request.enabled }); -const marshalZonedApiCreateLbRequest = (request, defaults) => ({ - assign_flexible_ip: request.assignFlexibleIp, - description: request.description, - ip_id: request.ipId, - name: request.name || randomName('lb'), - ssl_compatibility_level: request.sslCompatibilityLevel ?? 'ssl_compatibility_level_unknown', +const marshalCreateInstanceRequest = (request, defaults) => ({ + backup_same_region: request.backupSameRegion, + disable_backup: request.disableBackup, + encryption: request.encryption !== void 0 ? marshalEncryptionAtRest(request.encryption) : void 0, + engine: request.engine, + init_endpoints: request.initEndpoints !== void 0 ? request.initEndpoints.map((elt) => marshalEndpointSpec(elt)) : void 0, + init_settings: request.initSettings !== void 0 ? request.initSettings.map((elt) => marshalInstanceSetting(elt)) : void 0, + is_ha_cluster: request.isHaCluster, + name: request.name || randomName("ins"), + node_type: request.nodeType, + password: request.password, tags: request.tags, - type: request.type, - ...resolveOneOf([{ - default: defaults.defaultProjectId, - param: 'project_id', - value: request.projectId - }, { - default: defaults.defaultOrganizationId, - param: 'organization_id', - value: request.organizationId - }]) -}); -const marshalZonedApiCreateRouteRequest = (request, defaults) => ({ - backend_id: request.backendId, - frontend_id: request.frontendId, - match: request.match ? marshalRouteMatch(request.match) : undefined -}); -const marshalZonedApiCreateSubscriberRequest = (request, defaults) => ({ - name: request.name, - ...resolveOneOf([{ - default: defaults.defaultProjectId, - param: 'project_id', - value: request.projectId - }, { - default: defaults.defaultOrganizationId, - param: 'organization_id', - value: request.organizationId - }]), - ...resolveOneOf([{ - param: 'email_config', - value: request.emailConfig ? marshalSubscriberEmailConfig(request.emailConfig) : undefined - }, { - param: 'webhook_config', - value: request.webhookConfig ? marshalSubscriberWebhookConfig(request.webhookConfig) : undefined - }]) -}); -const marshalZonedApiMigrateLbRequest = (request, defaults) => ({ - type: request.type + user_name: request.userName, + volume_size: request.volumeSize, + volume_type: request.volumeType, + ...marshalling.resolveOneOf([ + { + default: defaults.defaultProjectId, + param: "project_id", + value: request.projectId + }, + { + default: defaults.defaultOrganizationId, + param: "organization_id", + value: request.organizationId + } + ]) }); -const marshalZonedApiRemoveBackendServersRequest = (request, defaults) => ({ - server_ip: request.serverIp +const marshalReadReplicaEndpointSpecPrivateNetworkIpamConfig = (request, defaults) => ({}); +const marshalReadReplicaEndpointSpecDirectAccess = (request, defaults) => ({}); +const marshalReadReplicaEndpointSpecPrivateNetwork = (request, defaults) => ({ + private_network_id: request.privateNetworkId, + ...marshalling.resolveOneOf([ + { param: "service_ip", value: request.serviceIp }, + { + param: "ipam_config", + value: request.ipamConfig !== void 0 ? marshalReadReplicaEndpointSpecPrivateNetworkIpamConfig( + request.ipamConfig + ) : void 0 + } + ]) }); -const marshalZonedApiSetAclsRequest = (request, defaults) => ({ - acls: request.acls.map(elt => marshalAclSpec(elt)) +const marshalReadReplicaEndpointSpec = (request, defaults) => ({ + ...marshalling.resolveOneOf([ + { + param: "direct_access", + value: request.directAccess !== void 0 ? marshalReadReplicaEndpointSpecDirectAccess( + request.directAccess + ) : void 0 + }, + { + param: "private_network", + value: request.privateNetwork !== void 0 ? marshalReadReplicaEndpointSpecPrivateNetwork( + request.privateNetwork + ) : void 0 + } + ]) }); -const marshalZonedApiSetBackendServersRequest = (request, defaults) => ({ - server_ip: request.serverIp +const marshalCreateReadReplicaEndpointRequest = (request, defaults) => ({ + endpoint_spec: request.endpointSpec.map( + (elt) => marshalReadReplicaEndpointSpec(elt) + ) }); -const marshalZonedApiSubscribeToLbRequest = (request, defaults) => ({ - subscriber_id: request.subscriberId +const marshalCreateReadReplicaRequest = (request, defaults) => ({ + endpoint_spec: request.endpointSpec !== void 0 ? request.endpointSpec.map( + (elt) => marshalReadReplicaEndpointSpec(elt) + ) : void 0, + instance_id: request.instanceId, + same_zone: request.sameZone }); -const marshalZonedApiUpdateAclRequest = (request, defaults) => ({ - action: marshalAclAction(request.action), - description: request.description, - index: request.index, - match: request.match ? marshalAclMatch(request.match) : undefined, - name: request.name +const marshalCreateSnapshotRequest = (request, defaults) => ({ + expires_at: request.expiresAt, + name: request.name || randomName("snp") }); -const marshalZonedApiUpdateBackendRequest = (request, defaults) => ({ - failover_host: request.failoverHost, - forward_port: request.forwardPort, - forward_port_algorithm: request.forwardPortAlgorithm, - forward_protocol: request.forwardProtocol, - ignore_ssl_server_verify: request.ignoreSslServerVerify, - max_connections: request.maxConnections, - max_retries: request.maxRetries, +const marshalCreateUserRequest = (request, defaults) => ({ + is_admin: request.isAdmin, name: request.name, - on_marked_down_action: request.onMarkedDownAction ?? 'on_marked_down_action_none', - proxy_protocol: request.proxyProtocol ?? 'proxy_protocol_unknown', - redispatch_attempt_count: request.redispatchAttemptCount, - send_proxy_v2: request.sendProxyV2, - ssl_bridging: request.sslBridging, - sticky_sessions: request.stickySessions, - sticky_sessions_cookie_name: request.stickySessionsCookieName, - timeout_connect: request.timeoutConnect, - timeout_queue: request.timeoutQueue, - timeout_server: request.timeoutServer, - timeout_tunnel: request.timeoutTunnel + password: request.password }); -const marshalZonedApiUpdateCertificateRequest = (request, defaults) => ({ - name: request.name +const marshalDeleteInstanceACLRulesRequest = (request, defaults) => ({ + acl_rule_ips: request.aclRuleIps }); -const marshalZonedApiUpdateFrontendRequest = (request, defaults) => ({ - backend_id: request.backendId, - certificate_id: request.certificateId, - certificate_ids: request.certificateIds, - enable_http3: request.enableHttp3, - inbound_port: request.inboundPort, - name: request.name, - timeout_client: request.timeoutClient +const marshalDeleteInstanceSettingsRequest = (request, defaults) => ({ + setting_names: request.settingNames }); -const marshalZonedApiUpdateHealthCheckRequest = (request, defaults) => ({ - check_delay: request.checkDelay, - check_max_retries: request.checkMaxRetries, - check_send_proxy: request.checkSendProxy, - check_timeout: request.checkTimeout, - port: request.port, - transient_check_delay: request.transientCheckDelay, - ...resolveOneOf([{ - param: 'tcp_config', - value: request.tcpConfig ? marshalHealthCheckTcpConfig(request.tcpConfig) : undefined - }, { - param: 'mysql_config', - value: request.mysqlConfig ? marshalHealthCheckMysqlConfig(request.mysqlConfig) : undefined - }, { - param: 'pgsql_config', - value: request.pgsqlConfig ? marshalHealthCheckPgsqlConfig(request.pgsqlConfig) : undefined - }, { - param: 'ldap_config', - value: request.ldapConfig ? marshalHealthCheckLdapConfig(request.ldapConfig) : undefined - }, { - param: 'redis_config', - value: request.redisConfig ? marshalHealthCheckRedisConfig(request.redisConfig) : undefined - }, { - param: 'http_config', - value: request.httpConfig ? marshalHealthCheckHttpConfig(request.httpConfig) : undefined - }, { - param: 'https_config', - value: request.httpsConfig ? marshalHealthCheckHttpsConfig(request.httpsConfig) : undefined - }]) +const marshalMigrateEndpointRequest = (request, defaults) => ({ + instance_id: request.instanceId }); -const marshalZonedApiUpdateIpRequest = (request, defaults) => ({ - reverse: request.reverse +const marshalPrepareInstanceLogsRequest = (request, defaults) => ({ + end_date: request.endDate, + start_date: request.startDate }); -const marshalZonedApiUpdateLbRequest = (request, defaults) => ({ - description: request.description, - name: request.name, - ssl_compatibility_level: request.sslCompatibilityLevel ?? 'ssl_compatibility_level_unknown', - tags: request.tags +const marshalPurgeInstanceLogsRequest = (request, defaults) => ({ + log_name: request.logName }); -const marshalZonedApiUpdateRouteRequest = (request, defaults) => ({ - backend_id: request.backendId, - match: request.match ? marshalRouteMatch(request.match) : undefined +const marshalRestoreDatabaseBackupRequest = (request, defaults) => ({ + database_name: request.databaseName, + instance_id: request.instanceId }); -const marshalZonedApiUpdateSubscriberRequest = (request, defaults) => ({ - name: request.name, - ...resolveOneOf([{ - param: 'email_config', - value: request.emailConfig ? marshalSubscriberEmailConfig(request.emailConfig) : undefined - }, { - param: 'webhook_config', - value: request.webhookConfig ? marshalSubscriberWebhookConfig(request.webhookConfig) : undefined - }]) +const marshalSetInstanceACLRulesRequest = (request, defaults) => ({ + rules: request.rules.map((elt) => marshalACLRuleRequest(elt)) }); +const marshalSetInstanceSettingsRequest = (request, defaults) => ({ + settings: request.settings.map((elt) => marshalInstanceSetting(elt)) +}); +const marshalSetPrivilegeRequest = (request, defaults) => ({ + database_name: request.databaseName, + permission: request.permission, + user_name: request.userName +}); +const marshalUpdateDatabaseBackupRequest = (request, defaults) => ({ + expires_at: request.expiresAt, + name: request.name +}); +const marshalLogsPolicy = (request, defaults) => ({ + max_age_retention: request.maxAgeRetention, + total_disk_retention: request.totalDiskRetention +}); +const marshalUpdateInstanceRequest = (request, defaults) => ({ + backup_same_region: request.backupSameRegion, + backup_schedule_frequency: request.backupScheduleFrequency, + backup_schedule_retention: request.backupScheduleRetention, + backup_schedule_start_hour: request.backupScheduleStartHour, + is_backup_schedule_disabled: request.isBackupScheduleDisabled, + logs_policy: request.logsPolicy !== void 0 ? marshalLogsPolicy(request.logsPolicy) : void 0, + name: request.name, + tags: request.tags +}); +const marshalUpdateSnapshotRequest = (request, defaults) => ({ + expires_at: request.expiresAt, + name: request.name +}); +const marshalUpdateUserRequest = (request, defaults) => ({ + is_admin: request.isAdmin, + password: request.password +}); +const marshalUpgradeInstanceRequestMajorUpgradeWorkflow = (request, defaults) => ({ + upgradable_version_id: request.upgradableVersionId, + with_endpoints: request.withEndpoints +}); +const marshalUpgradeInstanceRequest = (request, defaults) => ({ + ...marshalling.resolveOneOf([ + { param: "node_type", value: request.nodeType }, + { param: "enable_ha", value: request.enableHa }, + { param: "volume_size", value: request.volumeSize }, + { param: "volume_type", value: request.volumeType }, + { param: "upgradable_version_id", value: request.upgradableVersionId }, + { + param: "major_upgrade_workflow", + value: request.majorUpgradeWorkflow !== void 0 ? marshalUpgradeInstanceRequestMajorUpgradeWorkflow( + request.majorUpgradeWorkflow + ) : void 0 + } + ]) +}); +exports.marshalAddInstanceACLRulesRequest = marshalAddInstanceACLRulesRequest; +exports.marshalAddInstanceSettingsRequest = marshalAddInstanceSettingsRequest; +exports.marshalCloneInstanceRequest = marshalCloneInstanceRequest; +exports.marshalCreateDatabaseBackupRequest = marshalCreateDatabaseBackupRequest; +exports.marshalCreateDatabaseRequest = marshalCreateDatabaseRequest; +exports.marshalCreateEndpointRequest = marshalCreateEndpointRequest; +exports.marshalCreateInstanceFromSnapshotRequest = marshalCreateInstanceFromSnapshotRequest; +exports.marshalCreateInstanceRequest = marshalCreateInstanceRequest; +exports.marshalCreateReadReplicaEndpointRequest = marshalCreateReadReplicaEndpointRequest; +exports.marshalCreateReadReplicaRequest = marshalCreateReadReplicaRequest; +exports.marshalCreateSnapshotRequest = marshalCreateSnapshotRequest; +exports.marshalCreateUserRequest = marshalCreateUserRequest; +exports.marshalDeleteInstanceACLRulesRequest = marshalDeleteInstanceACLRulesRequest; +exports.marshalDeleteInstanceSettingsRequest = marshalDeleteInstanceSettingsRequest; +exports.marshalMigrateEndpointRequest = marshalMigrateEndpointRequest; +exports.marshalPrepareInstanceLogsRequest = marshalPrepareInstanceLogsRequest; +exports.marshalPurgeInstanceLogsRequest = marshalPurgeInstanceLogsRequest; +exports.marshalRestoreDatabaseBackupRequest = marshalRestoreDatabaseBackupRequest; +exports.marshalSetInstanceACLRulesRequest = marshalSetInstanceACLRulesRequest; +exports.marshalSetInstanceSettingsRequest = marshalSetInstanceSettingsRequest; +exports.marshalSetPrivilegeRequest = marshalSetPrivilegeRequest; +exports.marshalUpdateDatabaseBackupRequest = marshalUpdateDatabaseBackupRequest; +exports.marshalUpdateInstanceRequest = marshalUpdateInstanceRequest; +exports.marshalUpdateSnapshotRequest = marshalUpdateSnapshotRequest; +exports.marshalUpdateUserRequest = marshalUpdateUserRequest; +exports.marshalUpgradeInstanceRequest = marshalUpgradeInstanceRequest; +exports.unmarshalACLRule = unmarshalACLRule; +exports.unmarshalAddInstanceACLRulesResponse = unmarshalAddInstanceACLRulesResponse; +exports.unmarshalAddInstanceSettingsResponse = unmarshalAddInstanceSettingsResponse; +exports.unmarshalBackupSchedule = unmarshalBackupSchedule; +exports.unmarshalDatabase = unmarshalDatabase; +exports.unmarshalDatabaseBackup = unmarshalDatabaseBackup; +exports.unmarshalDeleteInstanceACLRulesResponse = unmarshalDeleteInstanceACLRulesResponse; +exports.unmarshalDeleteInstanceSettingsResponse = unmarshalDeleteInstanceSettingsResponse; +exports.unmarshalEndpoint = unmarshalEndpoint; +exports.unmarshalInstance = unmarshalInstance; +exports.unmarshalInstanceLog = unmarshalInstanceLog; +exports.unmarshalInstanceMetrics = unmarshalInstanceMetrics; +exports.unmarshalListDatabaseBackupsResponse = unmarshalListDatabaseBackupsResponse; +exports.unmarshalListDatabaseEnginesResponse = unmarshalListDatabaseEnginesResponse; +exports.unmarshalListDatabasesResponse = unmarshalListDatabasesResponse; +exports.unmarshalListInstanceACLRulesResponse = unmarshalListInstanceACLRulesResponse; +exports.unmarshalListInstanceLogsDetailsResponse = unmarshalListInstanceLogsDetailsResponse; +exports.unmarshalListInstanceLogsResponse = unmarshalListInstanceLogsResponse; +exports.unmarshalListInstancesResponse = unmarshalListInstancesResponse; +exports.unmarshalListNodeTypesResponse = unmarshalListNodeTypesResponse; +exports.unmarshalListPrivilegesResponse = unmarshalListPrivilegesResponse; +exports.unmarshalListSnapshotsResponse = unmarshalListSnapshotsResponse; +exports.unmarshalListUsersResponse = unmarshalListUsersResponse; +exports.unmarshalMaintenance = unmarshalMaintenance; +exports.unmarshalPrepareInstanceLogsResponse = unmarshalPrepareInstanceLogsResponse; +exports.unmarshalPrivilege = unmarshalPrivilege; +exports.unmarshalReadReplica = unmarshalReadReplica; +exports.unmarshalSetInstanceACLRulesResponse = unmarshalSetInstanceACLRulesResponse; +exports.unmarshalSetInstanceSettingsResponse = unmarshalSetInstanceSettingsResponse; +exports.unmarshalSnapshot = unmarshalSnapshot; +exports.unmarshalUser = unmarshalUser; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const jsonContentHeaders$c = { - 'Content-Type': 'application/json; charset=utf-8' -}; - -/** - * Load balancer API. - * - * This API allows you to manage your load balancer service. Load balancer API. - */ -let API$d = class API extends API$u { - /** Lists the available regions of the API. */ - static LOCALITIES = ['fr-par', 'nl-ams', 'pl-waw']; - pageOfListLbs = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs`, - urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId]) - }, unmarshalListLbsResponse); - - /** - * List load balancers. - * - * @param request - The request {@link ListLbsRequest} - * @returns A Promise of ListLbsResponse - */ - listLbs = (request = {}) => enrichForPagination('lbs', this.pageOfListLbs, request); - - /** - * Create a load balancer. - * - * @param request - The request {@link CreateLbRequest} - * @returns A Promise of Lb - */ - createLb = request => this.client.fetch({ - body: JSON.stringify(marshalCreateLbRequest(request, this.client.settings)), - headers: jsonContentHeaders$c, - method: 'POST', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs` - }, unmarshalLb); - - /** - * Get a load balancer. - * - * @param request - The request {@link GetLbRequest} - * @returns A Promise of Lb - */ - getLb = request => this.client.fetch({ - method: 'GET', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}` - }, unmarshalLb); - - /** - * Waits for {@link Lb} to be in a final state. - * - * @param request - The request {@link GetLbRequest} - * @param options - The waiting options - * @returns A Promise of Lb - */ - waitForLb = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!LB_TRANSIENT_STATUSES.includes(res.status))), this.getLb, request, options); - - /** - * Update a load balancer. - * - * @param request - The request {@link UpdateLbRequest} - * @returns A Promise of Lb - */ - updateLb = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateLbRequest(request, this.client.settings)), - headers: jsonContentHeaders$c, - method: 'PUT', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}` - }, unmarshalLb); - - /** - * Delete a load balancer. - * - * @param request - The request {@link DeleteLbRequest} - */ - deleteLb = request => this.client.fetch({ - method: 'DELETE', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}`, - urlParams: urlParams(['release_ip', request.releaseIp]) - }); - - /** - * Migrate a load balancer. - * - * @param request - The request {@link MigrateLbRequest} - * @returns A Promise of Lb - */ - migrateLb = request => this.client.fetch({ - body: JSON.stringify(marshalMigrateLbRequest(request, this.client.settings)), - headers: jsonContentHeaders$c, - method: 'POST', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}/migrate` - }, unmarshalLb); - pageOfListIPs = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/ips`, - urlParams: urlParams(['ip_address', request.ipAddress], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId]) - }, unmarshalListIpsResponse); - - /** - * List IPs. - * - * @param request - The request {@link ListIPsRequest} - * @returns A Promise of ListIpsResponse - */ - listIPs = (request = {}) => enrichForPagination('ips', this.pageOfListIPs, request); - - /** - * Create an IP. - * - * @param request - The request {@link CreateIpRequest} - * @returns A Promise of Ip - */ - createIp = (request = {}) => this.client.fetch({ - body: JSON.stringify(marshalCreateIpRequest(request, this.client.settings)), - headers: jsonContentHeaders$c, - method: 'POST', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/ips` - }, unmarshalIp); - - /** - * Get an IP. - * - * @param request - The request {@link GetIpRequest} - * @returns A Promise of Ip - */ - getIp = request => this.client.fetch({ - method: 'GET', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/ips/${validatePathParam('ipId', request.ipId)}` - }, unmarshalIp); - - /** - * Delete an IP. - * - * @param request - The request {@link ReleaseIpRequest} - */ - releaseIp = request => this.client.fetch({ - method: 'DELETE', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/ips/${validatePathParam('ipId', request.ipId)}` - }); - - /** - * Update an IP. - * - * @param request - The request {@link UpdateIpRequest} - * @returns A Promise of Ip - */ - updateIp = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateIpRequest(request, this.client.settings)), - headers: jsonContentHeaders$c, - method: 'PATCH', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/ips/${validatePathParam('ipId', request.ipId)}` - }, unmarshalIp); - pageOfListBackends = request => this.client.fetch({ - method: 'GET', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}/backends`, - urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]) - }, unmarshalListBackendsResponse); - - /** - * List backends in a given load balancer. - * - * @param request - The request {@link ListBackendsRequest} - * @returns A Promise of ListBackendsResponse - */ - listBackends = request => enrichForPagination('backends', this.pageOfListBackends, request); - - /** - * Create a backend in a given load balancer. - * - * @param request - The request {@link CreateBackendRequest} - * @returns A Promise of Backend - */ - createBackend = request => this.client.fetch({ - body: JSON.stringify(marshalCreateBackendRequest(request, this.client.settings)), - headers: jsonContentHeaders$c, - method: 'POST', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}/backends` - }, unmarshalBackend); - - /** - * Get a backend in a given load balancer. - * - * @param request - The request {@link GetBackendRequest} - * @returns A Promise of Backend - */ - getBackend = request => this.client.fetch({ - method: 'GET', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/backends/${validatePathParam('backendId', request.backendId)}` - }, unmarshalBackend); - - /** - * Update a backend in a given load balancer. - * - * @param request - The request {@link UpdateBackendRequest} - * @returns A Promise of Backend - */ - updateBackend = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateBackendRequest(request, this.client.settings)), - headers: jsonContentHeaders$c, - method: 'PUT', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/backends/${validatePathParam('backendId', request.backendId)}` - }, unmarshalBackend); - - /** - * Delete a backend in a given load balancer. - * - * @param request - The request {@link DeleteBackendRequest} - */ - deleteBackend = request => this.client.fetch({ - method: 'DELETE', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/backends/${validatePathParam('backendId', request.backendId)}` - }); - - /** - * Add a set of servers in a given backend. - * - * @param request - The request {@link AddBackendServersRequest} - * @returns A Promise of Backend - */ - addBackendServers = request => this.client.fetch({ - body: JSON.stringify(marshalAddBackendServersRequest(request, this.client.settings)), - headers: jsonContentHeaders$c, - method: 'POST', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/backends/${validatePathParam('backendId', request.backendId)}/servers` - }, unmarshalBackend); - - /** - * Remove a set of servers for a given backend. - * - * @param request - The request {@link RemoveBackendServersRequest} - * @returns A Promise of Backend - */ - removeBackendServers = request => this.client.fetch({ - body: JSON.stringify(marshalRemoveBackendServersRequest(request, this.client.settings)), - headers: jsonContentHeaders$c, - method: 'DELETE', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/backends/${validatePathParam('backendId', request.backendId)}/servers` - }, unmarshalBackend); - - /** - * Define all servers in a given backend. - * - * @param request - The request {@link SetBackendServersRequest} - * @returns A Promise of Backend - */ - setBackendServers = request => this.client.fetch({ - body: JSON.stringify(marshalSetBackendServersRequest(request, this.client.settings)), - headers: jsonContentHeaders$c, - method: 'PUT', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/backends/${validatePathParam('backendId', request.backendId)}/servers` - }, unmarshalBackend); - - /** - * Update an health check for a given backend. - * - * @param request - The request {@link UpdateHealthCheckRequest} - * @returns A Promise of HealthCheck - */ - updateHealthCheck = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateHealthCheckRequest(request, this.client.settings)), - headers: jsonContentHeaders$c, - method: 'PUT', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/backends/${validatePathParam('backendId', request.backendId)}/healthcheck` - }, unmarshalHealthCheck); - pageOfListFrontends = request => this.client.fetch({ - method: 'GET', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}/frontends`, - urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]) - }, unmarshalListFrontendsResponse); - - /** - * List frontends in a given load balancer. - * - * @param request - The request {@link ListFrontendsRequest} - * @returns A Promise of ListFrontendsResponse - */ - listFrontends = request => enrichForPagination('frontends', this.pageOfListFrontends, request); - - /** - * Create a frontend in a given load balancer. - * - * @param request - The request {@link CreateFrontendRequest} - * @returns A Promise of Frontend - */ - createFrontend = request => this.client.fetch({ - body: JSON.stringify(marshalCreateFrontendRequest(request, this.client.settings)), - headers: jsonContentHeaders$c, - method: 'POST', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}/frontends` - }, unmarshalFrontend); - - /** - * Get a frontend. - * - * @param request - The request {@link GetFrontendRequest} - * @returns A Promise of Frontend - */ - getFrontend = request => this.client.fetch({ - method: 'GET', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/frontends/${validatePathParam('frontendId', request.frontendId)}` - }, unmarshalFrontend); - - /** - * Update a frontend. - * - * @param request - The request {@link UpdateFrontendRequest} - * @returns A Promise of Frontend - */ - updateFrontend = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateFrontendRequest(request, this.client.settings)), - headers: jsonContentHeaders$c, - method: 'PUT', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/frontends/${validatePathParam('frontendId', request.frontendId)}` - }, unmarshalFrontend); - /** - * Delete a frontend. - * - * @param request - The request {@link DeleteFrontendRequest} - */ - deleteFrontend = request => this.client.fetch({ - method: 'DELETE', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/frontends/${validatePathParam('frontendId', request.frontendId)}` - }); - pageOfListRoutes = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/routes`, - urlParams: urlParams(['frontend_id', request.frontendId], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]) - }, unmarshalListRoutesResponse); +/***/ }), - /** - * List all backend redirections. - * - * @param request - The request {@link ListRoutesRequest} - * @returns A Promise of ListRoutesResponse - */ - listRoutes = (request = {}) => enrichForPagination('routes', this.pageOfListRoutes, request); +/***/ 1960: +/***/ ((__unused_webpack_module, exports) => { - /** - * Create a backend redirection. - * - * @param request - The request {@link CreateRouteRequest} - * @returns A Promise of Route - */ - createRoute = request => this.client.fetch({ - body: JSON.stringify(marshalCreateRouteRequest(request, this.client.settings)), - headers: jsonContentHeaders$c, - method: 'POST', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/routes` - }, unmarshalRoute); +"use strict"; - /** - * Get single backend redirection. - * - * @param request - The request {@link GetRouteRequest} - * @returns A Promise of Route - */ - getRoute = request => this.client.fetch({ - method: 'GET', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam('routeId', request.routeId)}` - }, unmarshalRoute); +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const UpdateInstanceRequest = { + backupScheduleStartHour: { + lessThanOrEqual: 23 + } +}; +exports.UpdateInstanceRequest = UpdateInstanceRequest; - /** - * Edit a backend redirection. - * - * @param request - The request {@link UpdateRouteRequest} - * @returns A Promise of Route - */ - updateRoute = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateRouteRequest(request, this.client.settings)), - headers: jsonContentHeaders$c, - method: 'PUT', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam('routeId', request.routeId)}` - }, unmarshalRoute); - /** - * Delete a backend redirection. - * - * @param request - The request {@link DeleteRouteRequest} - */ - deleteRoute = request => this.client.fetch({ - method: 'DELETE', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam('routeId', request.routeId)}` - }); +/***/ }), - /** - * Get usage statistics of a given load balancer. - * - * @deprecated - * @param request - The request {@link GetLbStatsRequest} - * @returns A Promise of LbStats - */ - getLbStats = request => this.client.fetch({ - method: 'GET', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}/stats`, - urlParams: urlParams(['backend_id', request.backendId]) - }, unmarshalLbStats); - pageOfListBackendStats = request => this.client.fetch({ - method: 'GET', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}/backend-stats`, - urlParams: urlParams(['backend_id', request.backendId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]) - }, unmarshalListBackendStatsResponse); +/***/ 7171: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - /** - * List backend server statistics. - * - * @param request - The request {@link ListBackendStatsRequest} - * @returns A Promise of ListBackendStatsResponse - */ - listBackendStats = request => enrichForPagination('backendServersStats', this.pageOfListBackendStats, request); - pageOfListAcls = request => this.client.fetch({ - method: 'GET', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/frontends/${validatePathParam('frontendId', request.frontendId)}/acls`, - urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]) - }, unmarshalListAclResponse); +"use strict"; - /** - * List ACL for a given frontend. - * - * @param request - The request {@link ListAclsRequest} - * @returns A Promise of ListAclResponse - */ - listAcls = request => enrichForPagination('acls', this.pageOfListAcls, request); +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const index_gen = __nccwpck_require__(1239); +exports.v1 = index_gen; - /** - * Create an ACL for a given frontend. - * - * @param request - The request {@link CreateAclRequest} - * @returns A Promise of Acl - */ - createAcl = request => this.client.fetch({ - body: JSON.stringify(marshalCreateAclRequest(request, this.client.settings)), - headers: jsonContentHeaders$c, - method: 'POST', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/frontends/${validatePathParam('frontendId', request.frontendId)}/acls` - }, unmarshalAcl); - /** - * Get an ACL. - * - * @param request - The request {@link GetAclRequest} - * @returns A Promise of Acl - */ - getAcl = request => this.client.fetch({ - method: 'GET', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/acls/${validatePathParam('aclId', request.aclId)}` - }, unmarshalAcl); +/***/ }), - /** - * Update an ACL. - * - * @param request - The request {@link UpdateAclRequest} - * @returns A Promise of Acl - */ - updateAcl = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateAclRequest(request, this.client.settings)), - headers: jsonContentHeaders$c, - method: 'PUT', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/acls/${validatePathParam('aclId', request.aclId)}` - }, unmarshalAcl); +/***/ 8143: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - /** - * Delete an ACL. - * - * @param request - The request {@link DeleteAclRequest} - */ - deleteAcl = request => this.client.fetch({ - method: 'DELETE', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/acls/${validatePathParam('aclId', request.aclId)}` - }); +"use strict"; +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const intervalRetrier = __nccwpck_require__(9052); +const api = __nccwpck_require__(3042); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const resourcePaginator = __nccwpck_require__(4983); +const content_gen = __nccwpck_require__(3060); +const marshalling_gen = __nccwpck_require__(1653); +const jsonContentHeaders = { + "Content-Type": "application/json; charset=utf-8" +}; +class API extends api.API { + /** Lists the available zones of the API. */ + static LOCALITIES = [ + "fr-par-1", + "fr-par-2", + "nl-ams-1", + "nl-ams-2", + "pl-waw-1", + "pl-waw-2" + ]; /** - * Create a TLS certificate. Generate a new TLS certificate using Let's - * Encrypt or import your certificate. + * Create a Redis™ Database Instance. Create a new Redis™ Database Instance + * (Redis™ cluster). You must set the `zone`, `project_id`, `version`, + * `node_type`, `user_name` and `password` parameters. Optionally you can + * define `acl_rules`, `endpoints`, `tls_enabled` and `cluster_settings`. * - * @param request - The request {@link CreateCertificateRequest} - * @returns A Promise of Certificate + * @param request - The request {@link CreateClusterRequest} + * @returns A Promise of Cluster */ - createCertificate = request => this.client.fetch({ - body: JSON.stringify(marshalCreateCertificateRequest(request, this.client.settings)), - headers: jsonContentHeaders$c, - method: 'POST', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}/certificates` - }, unmarshalCertificate); - pageOfListCertificates = request => this.client.fetch({ - method: 'GET', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}/certificates`, - urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]) - }, unmarshalListCertificatesResponse); - + createCluster = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateClusterRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/redis/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/clusters` + }, + marshalling_gen.unmarshalCluster + ); /** - * List all TLS certificates on a given load balancer. + * Update a Redis™ Database Instance. Update the parameters of a Redis™ + * Database Instance (Redis™ cluster), including `name`, `tags`, `user_name` + * and `password`. * - * @param request - The request {@link ListCertificatesRequest} - * @returns A Promise of ListCertificatesResponse + * @param request - The request {@link UpdateClusterRequest} + * @returns A Promise of Cluster */ - listCertificates = request => enrichForPagination('certificates', this.pageOfListCertificates, request); - + updateCluster = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateClusterRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/redis/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/clusters/${marshalling.validatePathParam("clusterId", request.clusterId)}` + }, + marshalling_gen.unmarshalCluster + ); /** - * Get a TLS certificate. + * Get a Redis™ Database Instance. Retrieve information about a Redis™ + * Database Instance (Redis™ cluster). Specify the `cluster_id` and `region` + * in your request to get information such as `id`, `status`, `version`, + * `tls_enabled`, `cluster_settings`, `upgradable_versions` and `endpoints` + * about your cluster in the response. * - * @param request - The request {@link GetCertificateRequest} - * @returns A Promise of Certificate + * @param request - The request {@link GetClusterRequest} + * @returns A Promise of Cluster */ - getCertificate = request => this.client.fetch({ - method: 'GET', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/certificates/${validatePathParam('certificateId', request.certificateId)}` - }, unmarshalCertificate); - + getCluster = (request) => this.client.fetch( + { + method: "GET", + path: `/redis/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/clusters/${marshalling.validatePathParam("clusterId", request.clusterId)}` + }, + marshalling_gen.unmarshalCluster + ); /** - * Waits for {@link Certificate} to be in a final state. + * Waits for {@link Cluster} to be in a final state. * - * @param request - The request {@link GetCertificateRequest} + * @param request - The request {@link GetClusterRequest} * @param options - The waiting options - * @returns A Promise of Certificate - */ - waitForCertificate = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!CERTIFICATE_TRANSIENT_STATUSES.includes(res.status))), this.getCertificate, request, options); - - /** - * Update a TLS certificate. - * - * @param request - The request {@link UpdateCertificateRequest} - * @returns A Promise of Certificate - */ - updateCertificate = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateCertificateRequest(request, this.client.settings)), - headers: jsonContentHeaders$c, - method: 'PUT', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/certificates/${validatePathParam('certificateId', request.certificateId)}` - }, unmarshalCertificate); - - /** - * Delete a TLS certificate. - * - * @param request - The request {@link DeleteCertificateRequest} - */ - deleteCertificate = request => this.client.fetch({ - method: 'DELETE', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/certificates/${validatePathParam('certificateId', request.certificateId)}` - }); - pageOfListLbTypes = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lb-types`, - urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]) - }, unmarshalListLbTypesResponse); - - /** - * List all load balancer offer type. - * - * @param request - The request {@link ListLbTypesRequest} - * @returns A Promise of ListLbTypesResponse - */ - listLbTypes = (request = {}) => enrichForPagination('lbTypes', this.pageOfListLbTypes, request); - - /** - * Create a subscriber, webhook or email. - * - * @param request - The request {@link CreateSubscriberRequest} - * @returns A Promise of Subscriber + * @returns A Promise of Cluster */ - createSubscriber = request => this.client.fetch({ - body: JSON.stringify(marshalCreateSubscriberRequest(request, this.client.settings)), - headers: jsonContentHeaders$c, - method: 'POST', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/subscribers` - }, unmarshalSubscriber); - + waitForCluster = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve(!content_gen.CLUSTER_TRANSIENT_STATUSES.includes(res.status))), + this.getCluster, + request, + options + ); + pageOfListClusters = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/redis/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/clusters`, + urlParams: marshalling.urlParams( + ["name", request.name], + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId], + ["tags", request.tags], + ["version", request.version] + ) + }, + marshalling_gen.unmarshalListClustersResponse + ); /** - * Get a subscriber. + * List Redis™ Database Instances. List all Redis™ Database Instances (Redis™ + * cluster) in the specified zone. By default, the Database Instances returned + * in the list are ordered by creation date in ascending order, though this + * can be modified via the order_by field. You can define additional + * parameters for your query, such as `tags`, `name`, `organization_id` and + * `version`. * - * @param request - The request {@link GetSubscriberRequest} - * @returns A Promise of Subscriber + * @param request - The request {@link ListClustersRequest} + * @returns A Promise of ListClustersResponse */ - getSubscriber = request => this.client.fetch({ - method: 'GET', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/subscribers/${validatePathParam('subscriberId', request.subscriberId)}` - }, unmarshalSubscriber); - pageOfListSubscriber = request => this.client.fetch({ - method: 'GET', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/subscribers`, - urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId]) - }, unmarshalListSubscriberResponse); - + listClusters = (request = {}) => resourcePaginator.enrichForPagination("clusters", this.pageOfListClusters, request); /** - * List all subscriber. + * Scale up a Redis™ Database Instance. Upgrade your Redis™ Database Instance, + * either by upgrading to a bigger node type (vertical scaling) or by adding + * more nodes to your Database Instance to increase your number of endpoints + * and distribute cache (horizontal scaling, available for clusters only). + * Note that scaling horizontally your Redis™ Database Instance will not renew + * its TLS certificate. In order to refresh the TLS certificate, you must use + * the Renew TLS certificate endpoint. * - * @param request - The request {@link ListSubscriberRequest} - * @returns A Promise of ListSubscriberResponse + * @param request - The request {@link MigrateClusterRequest} + * @returns A Promise of Cluster */ - listSubscriber = request => enrichForPagination('subscribers', this.pageOfListSubscriber, request); - + migrateCluster = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalMigrateClusterRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/redis/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/clusters/${marshalling.validatePathParam("clusterId", request.clusterId)}/migrate` + }, + marshalling_gen.unmarshalCluster + ); /** - * Update a subscriber. + * Delete a Redis™ Database Instance. Delete a Redis™ Database Instance + * (Redis™ cluster), specified by the `region` and `cluster_id` parameters. + * Deleting a Database Instance is permanent, and cannot be undone. Note that + * upon deletion all your data will be lost. * - * @param request - The request {@link UpdateSubscriberRequest} - * @returns A Promise of Subscriber + * @param request - The request {@link DeleteClusterRequest} + * @returns A Promise of Cluster */ - updateSubscriber = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateSubscriberRequest(request, this.client.settings)), - headers: jsonContentHeaders$c, - method: 'PUT', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/subscribers/${validatePathParam('subscriberId', request.subscriberId)}` - }, unmarshalSubscriber); - + deleteCluster = (request) => this.client.fetch( + { + method: "DELETE", + path: `/redis/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/clusters/${marshalling.validatePathParam("clusterId", request.clusterId)}` + }, + marshalling_gen.unmarshalCluster + ); /** - * Delete a subscriber. + * Get metrics of a Redis™ Database Instance. Retrieve the metrics of a Redis™ + * Database Instance (Redis™ cluster). You can define the period from which to + * retrieve metrics by specifying the `start_date` and `end_date`. * - * @param request - The request {@link DeleteSubscriberRequest} + * @param request - The request {@link GetClusterMetricsRequest} + * @returns A Promise of ClusterMetricsResponse */ - deleteSubscriber = request => this.client.fetch({ - method: 'DELETE', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lb/subscriber/${validatePathParam('subscriberId', request.subscriberId)}` - }); - + getClusterMetrics = (request) => this.client.fetch( + { + method: "GET", + path: `/redis/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/clusters/${marshalling.validatePathParam("clusterId", request.clusterId)}/metrics`, + urlParams: marshalling.urlParams( + ["end_at", request.endAt], + ["metric_name", request.metricName], + ["start_at", request.startAt] + ) + }, + marshalling_gen.unmarshalClusterMetricsResponse + ); + pageOfListNodeTypes = (request) => this.client.fetch( + { + method: "GET", + path: `/redis/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/node-types`, + urlParams: marshalling.urlParams( + ["include_disabled_types", request.includeDisabledTypes], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListNodeTypesResponse + ); /** - * Subscribe a subscriber to a given load balancer. + * List available node types. List all available node types. By default, the + * node types returned in the list are ordered by creation date in ascending + * order, though this can be modified via the `order_by` field. * - * @param request - The request {@link SubscribeToLbRequest} - * @returns A Promise of Lb + * @param request - The request {@link ListNodeTypesRequest} + * @returns A Promise of ListNodeTypesResponse */ - subscribeToLb = request => this.client.fetch({ - body: JSON.stringify(marshalSubscribeToLbRequest(request, this.client.settings)), - headers: jsonContentHeaders$c, - method: 'POST', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lb/${validatePathParam('lbId', request.lbId)}/subscribe` - }, unmarshalLb); - + listNodeTypes = (request) => resourcePaginator.enrichForPagination("nodeTypes", this.pageOfListNodeTypes, request); + pageOfListClusterVersions = (request) => this.client.fetch( + { + method: "GET", + path: `/redis/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/cluster-versions`, + urlParams: marshalling.urlParams( + ["include_beta", request.includeBeta], + ["include_deprecated", request.includeDeprecated], + ["include_disabled", request.includeDisabled], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["version", request.version] + ) + }, + marshalling_gen.unmarshalListClusterVersionsResponse + ); /** - * Unsubscribe a subscriber from a given load balancer. + * List available Redis™ versions. List the Redis™ database engine versions + * available. You can define additional parameters for your query, such as + * `include_disabled`, `include_beta`, `include_deprecated` and `version`. * - * @param request - The request {@link UnsubscribeFromLbRequest} - * @returns A Promise of Lb + * @param request - The request {@link ListClusterVersionsRequest} + * @returns A Promise of ListClusterVersionsResponse */ - unsubscribeFromLb = request => this.client.fetch({ - method: 'DELETE', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lb/${validatePathParam('lbId', request.lbId)}/unsubscribe` - }, unmarshalLb); - pageOfListLbPrivateNetworks = request => this.client.fetch({ - method: 'GET', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}/private-networks`, - urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]) - }, unmarshalListLbPrivateNetworksResponse); - + listClusterVersions = (request) => resourcePaginator.enrichForPagination("versions", this.pageOfListClusterVersions, request); /** - * List attached private network of load balancer. + * Get the TLS certificate of a cluster. Retrieve information about the TLS + * certificate of a Redis™ Database Instance (Redis™ cluster). Details like + * name and content are returned in the response. * - * @param request - The request {@link ListLbPrivateNetworksRequest} - * @returns A Promise of ListLbPrivateNetworksResponse + * @param request - The request {@link GetClusterCertificateRequest} + * @returns A Promise of Blob */ - listLbPrivateNetworks = request => enrichForPagination('privateNetwork', this.pageOfListLbPrivateNetworks, request); - + getClusterCertificate = (request) => this.client.fetch({ + method: "GET", + path: `/redis/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/clusters/${marshalling.validatePathParam("clusterId", request.clusterId)}/certificate`, + urlParams: marshalling.urlParams(["dl", 1]), + responseType: "blob" + }); /** - * Add load balancer on instance private network. + * Renew the TLS certificate of a cluster. Renew a TLS certificate for a + * Redis™ Database Instance (Redis™ cluster). Renewing a certificate means + * that you will not be able to connect to your Database Instance using the + * previous certificate. You will also need to download and update the new + * certificate for all database clients. * - * @param request - The request {@link AttachPrivateNetworkRequest} - * @returns A Promise of PrivateNetwork + * @param request - The request {@link RenewClusterCertificateRequest} + * @returns A Promise of Cluster */ - attachPrivateNetwork = request => this.client.fetch({ - body: JSON.stringify(marshalAttachPrivateNetworkRequest(request, this.client.settings)), - headers: jsonContentHeaders$c, - method: 'POST', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}/attach` - }, unmarshalPrivateNetwork$3); - + renewClusterCertificate = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/redis/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/clusters/${marshalling.validatePathParam("clusterId", request.clusterId)}/renew-certificate` + }, + marshalling_gen.unmarshalCluster + ); /** - * Remove load balancer of private network. + * Add advanced settings. Add an advanced setting to a Redis™ Database + * Instance (Redis™ cluster). You must set the `name` and the `value` of each + * setting. * - * @param request - The request {@link DetachPrivateNetworkRequest} + * @param request - The request {@link AddClusterSettingsRequest} + * @returns A Promise of ClusterSettingsResponse */ - detachPrivateNetwork = request => this.client.fetch({ - body: '{}', - headers: jsonContentHeaders$c, - method: 'POST', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}/detach` - }); -}; - -/** - * Load Balancer API. - * - * This API allows you to manage your Scaleway Load Balancer services. Load - * Balancer API. - */ -class ZonedAPI extends API$u { - /** Lists the available zones of the API. */ - static LOCALITIES = ['fr-par-1', 'fr-par-2', 'nl-ams-1', 'nl-ams-2', 'nl-ams-3', 'pl-waw-1', 'pl-waw-2', 'pl-waw-3']; - pageOfListLbs = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs`, - urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId]) - }, unmarshalListLbsResponse); - + addClusterSettings = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalAddClusterSettingsRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/redis/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/clusters/${marshalling.validatePathParam("clusterId", request.clusterId)}/settings` + }, + marshalling_gen.unmarshalClusterSettingsResponse + ); /** - * List Load Balancers. List all Load Balancers in the specified zone, for a - * Scaleway Organization or Scaleway Project. By default, the Load Balancers - * returned in the list are ordered by creation date in ascending order, - * though this can be modified via the `order_by` field. + * Delete advanced setting. Delete an advanced setting in a Redis™ Database + * Instance (Redis™ cluster). You must specify the names of the settings you + * want to delete in the request body. * - * @param request - The request {@link ZonedApiListLbsRequest} - * @returns A Promise of ListLbsResponse + * @param request - The request {@link DeleteClusterSettingRequest} + * @returns A Promise of Cluster */ - listLbs = (request = {}) => enrichForPagination('lbs', this.pageOfListLbs, request); - + deleteClusterSetting = (request) => this.client.fetch( + { + method: "DELETE", + path: `/redis/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/clusters/${marshalling.validatePathParam("clusterId", request.clusterId)}/settings/${marshalling.validatePathParam("settingName", request.settingName)}` + }, + marshalling_gen.unmarshalCluster + ); /** - * Create a Load Balancer. Create a new Load Balancer. Note that the Load - * Balancer will be created without frontends or backends; these must be - * created separately via the dedicated endpoints. + * Set advanced settings. Update an advanced setting for a Redis™ Database + * Instance (Redis™ cluster). Settings added upon database engine + * initalization can only be defined once, and cannot, therefore, be updated. * - * @param request - The request {@link ZonedApiCreateLbRequest} - * @returns A Promise of Lb + * @param request - The request {@link SetClusterSettingsRequest} + * @returns A Promise of ClusterSettingsResponse */ - createLb = request => this.client.fetch({ - body: JSON.stringify(marshalZonedApiCreateLbRequest(request, this.client.settings)), - headers: jsonContentHeaders$c, - method: 'POST', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs` - }, unmarshalLb); - + setClusterSettings = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalSetClusterSettingsRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PUT", + path: `/redis/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/clusters/${marshalling.validatePathParam("clusterId", request.clusterId)}/settings` + }, + marshalling_gen.unmarshalClusterSettingsResponse + ); /** - * Get a Load Balancer. Retrieve information about an existing Load Balancer, - * specified by its Load Balancer ID. Its full details, including name, status - * and IP address, are returned in the response object. + * Set ACL rules for a cluster. Replace all the ACL rules of a Redis™ Database + * Instance (Redis™ cluster). * - * @param request - The request {@link ZonedApiGetLbRequest} - * @returns A Promise of Lb + * @param request - The request {@link SetAclRulesRequest} + * @returns A Promise of SetAclRulesResponse */ - getLb = request => this.client.fetch({ - method: 'GET', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}` - }, unmarshalLb); - + setAclRules = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalSetAclRulesRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PUT", + path: `/redis/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/clusters/${marshalling.validatePathParam("clusterId", request.clusterId)}/acls` + }, + marshalling_gen.unmarshalSetAclRulesResponse + ); /** - * Waits for {@link Lb} to be in a final state. + * Add ACL rules for a cluster. Add an additional ACL rule to a Redis™ + * Database Instance (Redis™ cluster). * - * @param request - The request {@link GetLbRequest} - * @param options - The waiting options - * @returns A Promise of Lb + * @param request - The request {@link AddAclRulesRequest} + * @returns A Promise of AddAclRulesResponse */ - waitForLb = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!LB_TRANSIENT_STATUSES.includes(res.status))), this.getLb, request, options); - + addAclRules = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalAddAclRulesRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/redis/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/clusters/${marshalling.validatePathParam("clusterId", request.clusterId)}/acls` + }, + marshalling_gen.unmarshalAddAclRulesResponse + ); /** - * Update a Load Balancer. Update the parameters of an existing Load Balancer, - * specified by its Load Balancer ID. Note that the request type is PUT and - * not PATCH. You must set all parameters. + * Delete an ACL rule for a cluster. Delete an ACL rule of a Redis™ Database + * Instance (Redis™ cluster). You must specify the `acl_id` of the rule you + * want to delete in your request. * - * @param request - The request {@link ZonedApiUpdateLbRequest} - * @returns A Promise of Lb + * @param request - The request {@link DeleteAclRuleRequest} + * @returns A Promise of Cluster */ - updateLb = request => this.client.fetch({ - body: JSON.stringify(marshalZonedApiUpdateLbRequest(request, this.client.settings)), - headers: jsonContentHeaders$c, - method: 'PUT', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}` - }, unmarshalLb); - + deleteAclRule = (request) => this.client.fetch( + { + method: "DELETE", + path: `/redis/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/acls/${marshalling.validatePathParam("aclId", request.aclId)}` + }, + marshalling_gen.unmarshalCluster + ); /** - * Delete a Load Balancer. Delete an existing Load Balancer, specified by its - * Load Balancer ID. Deleting a Load Balancer is permanent, and cannot be - * undone. The Load Balancer's flexible IP address can either be deleted with - * the Load Balancer, or kept in your account for future use. + * Get an ACL rule. Retrieve information about an ACL rule of a Redis™ + * Database Instance (Redis™ cluster). You must specify the `acl_id` of the + * rule in your request. * - * @param request - The request {@link ZonedApiDeleteLbRequest} + * @param request - The request {@link GetAclRuleRequest} + * @returns A Promise of ACLRule */ - deleteLb = request => this.client.fetch({ - method: 'DELETE', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}`, - urlParams: urlParams(['release_ip', request.releaseIp]) - }); - + getAclRule = (request) => this.client.fetch( + { + method: "GET", + path: `/redis/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/acls/${marshalling.validatePathParam("aclId", request.aclId)}` + }, + marshalling_gen.unmarshalACLRule + ); /** - * Migrate a Load Balancer. Migrate an existing Load Balancer from one - * commercial type to another. Allows you to scale your Load Balancer up or - * down in terms of bandwidth or multi-cloud provision. + * Set endpoints for a cluster. Update an endpoint for a Redis™ Database + * Instance (Redis™ cluster). You must specify the `cluster_id` and the + * `endpoints` parameters in your request. * - * @param request - The request {@link ZonedApiMigrateLbRequest} - * @returns A Promise of Lb + * @param request - The request {@link SetEndpointsRequest} + * @returns A Promise of SetEndpointsResponse */ - migrateLb = request => this.client.fetch({ - body: JSON.stringify(marshalZonedApiMigrateLbRequest(request, this.client.settings)), - headers: jsonContentHeaders$c, - method: 'POST', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}/migrate` - }, unmarshalLb); - pageOfListIPs = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips`, - urlParams: urlParams(['ip_address', request.ipAddress], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId]) - }, unmarshalListIpsResponse); - + setEndpoints = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalSetEndpointsRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PUT", + path: `/redis/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/clusters/${marshalling.validatePathParam("clusterId", request.clusterId)}/endpoints` + }, + marshalling_gen.unmarshalSetEndpointsResponse + ); /** - * List IP addresses. List the Load Balancer flexible IP addresses held in the - * account (filtered by Organization ID or Project ID). It is also possible to - * search for a specific IP address. + * Add endpoints for a cluster. Add a new endpoint for a Redis™ Database + * Instance (Redis™ cluster). You can add `private_network` or + * `public_network` specifications to the body of the request. * - * @param request - The request {@link ZonedApiListIPsRequest} - * @returns A Promise of ListIpsResponse + * @param request - The request {@link AddEndpointsRequest} + * @returns A Promise of AddEndpointsResponse */ - listIPs = (request = {}) => enrichForPagination('ips', this.pageOfListIPs, request); - + addEndpoints = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalAddEndpointsRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/redis/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/clusters/${marshalling.validatePathParam("clusterId", request.clusterId)}/endpoints` + }, + marshalling_gen.unmarshalAddEndpointsResponse + ); /** - * Create an IP address. Create a new Load Balancer flexible IP address, in - * the specified Scaleway Project. This can be attached to new Load Balancers - * created in the future. + * Delete an endpoint for a cluster. Delete the endpoint of a Redis™ Database + * Instance (Redis™ cluster). You must specify the `region` and `endpoint_id` + * parameters of the endpoint you want to delete. Note that might need to + * update any environment configurations that point to the deleted endpoint. * - * @param request - The request {@link ZonedApiCreateIpRequest} - * @returns A Promise of Ip + * @param request - The request {@link DeleteEndpointRequest} + * @returns A Promise of Cluster */ - createIp = (request = {}) => this.client.fetch({ - body: JSON.stringify(marshalZonedApiCreateIpRequest(request, this.client.settings)), - headers: jsonContentHeaders$c, - method: 'POST', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips` - }, unmarshalIp); - + deleteEndpoint = (request) => this.client.fetch( + { + method: "DELETE", + path: `/redis/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/endpoints/${marshalling.validatePathParam("endpointId", request.endpointId)}` + }, + marshalling_gen.unmarshalCluster + ); /** - * Get an IP address. Retrieve the full details of a Load Balancer flexible IP - * address. + * Get an endpoint. Retrieve information about a Redis™ Database Instance + * (Redis™ cluster) endpoint. Full details about the endpoint, like `ips`, + * `port`, `private_network` and `public_network` specifications are returned + * in the response. * - * @param request - The request {@link ZonedApiGetIpRequest} - * @returns A Promise of Ip + * @param request - The request {@link GetEndpointRequest} + * @returns A Promise of Endpoint */ - getIp = request => this.client.fetch({ - method: 'GET', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam('ipId', request.ipId)}` - }, unmarshalIp); - + getEndpoint = (request) => this.client.fetch( + { + method: "GET", + path: `/redis/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/endpoints/${marshalling.validatePathParam("endpointId", request.endpointId)}` + }, + marshalling_gen.unmarshalEndpoint + ); /** - * Delete an IP address. Delete a Load Balancer flexible IP address. This - * action is irreversible, and cannot be undone. + * Update an endpoint. Update information about a Redis™ Database Instance + * (Redis™ cluster) endpoint. Full details about the endpoint, like `ips`, + * `port`, `private_network` and `public_network` specifications are returned + * in the response. * - * @param request - The request {@link ZonedApiReleaseIpRequest} + * @param request - The request {@link UpdateEndpointRequest} + * @returns A Promise of Endpoint */ - releaseIp = request => this.client.fetch({ - method: 'DELETE', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam('ipId', request.ipId)}` - }); + updateEndpoint = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateEndpointRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/redis/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/endpoints/${marshalling.validatePathParam("endpointId", request.endpointId)}` + }, + marshalling_gen.unmarshalEndpoint + ); +} +exports.API = API; + + +/***/ }), + +/***/ 3060: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const CLUSTER_TRANSIENT_STATUSES = [ + "provisioning", + "configuring", + "deleting", + "autohealing", + "initializing" +]; +exports.CLUSTER_TRANSIENT_STATUSES = CLUSTER_TRANSIENT_STATUSES; + + +/***/ }), + +/***/ 1239: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api_gen = __nccwpck_require__(8143); +const content_gen = __nccwpck_require__(3060); +exports.API = api_gen.API; +exports.CLUSTER_TRANSIENT_STATUSES = content_gen.CLUSTER_TRANSIENT_STATUSES; + + +/***/ }), + +/***/ 1653: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const randomName = __nccwpck_require__(8141); +const json = __nccwpck_require__(3746); +const customMarshalling = __nccwpck_require__(7586); +const marshalling = __nccwpck_require__(1162); +const unmarshalACLRule = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ACLRule' failed as data isn't a dictionary.` + ); + } + return { + description: data.description, + id: data.id, + ipCidr: data.ip_cidr + }; +}; +const unmarshalPrivateNetwork = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'PrivateNetwork' failed as data isn't a dictionary.` + ); + } + return { + id: data.id, + provisioningMode: data.provisioning_mode, + serviceIps: data.service_ips, + zone: data.zone + }; +}; +const unmarshalPublicNetwork = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'PublicNetwork' failed as data isn't a dictionary.` + ); + } + return {}; +}; +const unmarshalEndpoint = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Endpoint' failed as data isn't a dictionary.` + ); + } + return { + id: data.id, + ips: data.ips, + port: data.port, + privateNetwork: data.private_network ? unmarshalPrivateNetwork(data.private_network) : void 0, + publicNetwork: data.public_network ? unmarshalPublicNetwork(data.public_network) : void 0 + }; +}; +const unmarshalClusterSetting = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ClusterSetting' failed as data isn't a dictionary.` + ); + } + return { + name: data.name, + value: data.value + }; +}; +const unmarshalCluster = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Cluster' failed as data isn't a dictionary.` + ); + } + return { + aclRules: marshalling.unmarshalArrayOfObject(data.acl_rules, unmarshalACLRule), + clusterSettings: marshalling.unmarshalArrayOfObject( + data.cluster_settings, + unmarshalClusterSetting + ), + clusterSize: data.cluster_size, + createdAt: marshalling.unmarshalDate(data.created_at), + endpoints: marshalling.unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint), + id: data.id, + name: data.name, + nodeType: data.node_type, + projectId: data.project_id, + status: data.status, + tags: data.tags, + tlsEnabled: data.tls_enabled, + updatedAt: marshalling.unmarshalDate(data.updated_at), + upgradableVersions: data.upgradable_versions, + userName: data.user_name, + version: data.version, + zone: data.zone + }; +}; +const unmarshalAddAclRulesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'AddAclRulesResponse' failed as data isn't a dictionary.` + ); + } + return { + aclRules: marshalling.unmarshalArrayOfObject(data.acl_rules, unmarshalACLRule), + totalCount: data.total_count + }; +}; +const unmarshalAddEndpointsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'AddEndpointsResponse' failed as data isn't a dictionary.` + ); + } + return { + endpoints: marshalling.unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint), + totalCount: data.total_count + }; +}; +const unmarshalClusterMetricsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ClusterMetricsResponse' failed as data isn't a dictionary.` + ); + } + return { + timeseries: marshalling.unmarshalArrayOfObject(data.timeseries, customMarshalling.unmarshalTimeSeries) + }; +}; +const unmarshalClusterSettingsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ClusterSettingsResponse' failed as data isn't a dictionary.` + ); + } + return { + settings: marshalling.unmarshalArrayOfObject(data.settings, unmarshalClusterSetting) + }; +}; +const unmarshalAvailableClusterSetting = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'AvailableClusterSetting' failed as data isn't a dictionary.` + ); + } + return { + defaultValue: data.default_value, + deprecated: data.deprecated, + description: data.description, + maxValue: data.max_value, + minValue: data.min_value, + name: data.name, + regex: data.regex, + type: data.type + }; +}; +const unmarshalClusterVersion = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ClusterVersion' failed as data isn't a dictionary.` + ); + } + return { + availableSettings: marshalling.unmarshalArrayOfObject( + data.available_settings, + unmarshalAvailableClusterSetting + ), + endOfLifeAt: marshalling.unmarshalDate(data.end_of_life_at), + logoUrl: data.logo_url, + version: data.version, + zone: data.zone + }; +}; +const unmarshalListClusterVersionsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListClusterVersionsResponse' failed as data isn't a dictionary.` + ); + } + return { + totalCount: data.total_count, + versions: marshalling.unmarshalArrayOfObject(data.versions, unmarshalClusterVersion) + }; +}; +const unmarshalListClustersResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListClustersResponse' failed as data isn't a dictionary.` + ); + } + return { + clusters: marshalling.unmarshalArrayOfObject(data.clusters, unmarshalCluster), + totalCount: data.total_count + }; +}; +const unmarshalNodeType = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'NodeType' failed as data isn't a dictionary.` + ); + } + return { + beta: data.beta, + description: data.description, + disabled: data.disabled, + memory: data.memory, + name: data.name, + stockStatus: data.stock_status, + vcpus: data.vcpus, + zone: data.zone + }; +}; +const unmarshalListNodeTypesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListNodeTypesResponse' failed as data isn't a dictionary.` + ); + } + return { + nodeTypes: marshalling.unmarshalArrayOfObject(data.node_types, unmarshalNodeType), + totalCount: data.total_count + }; +}; +const unmarshalSetAclRulesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SetAclRulesResponse' failed as data isn't a dictionary.` + ); + } + return { + aclRules: marshalling.unmarshalArrayOfObject(data.acl_rules, unmarshalACLRule) + }; +}; +const unmarshalSetEndpointsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SetEndpointsResponse' failed as data isn't a dictionary.` + ); + } + return { + endpoints: marshalling.unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint) + }; +}; +const marshalACLRuleSpec = (request, defaults) => ({ + description: request.description, + ip_cidr: request.ipCidr +}); +const marshalAddAclRulesRequest = (request, defaults) => ({ + acl_rules: request.aclRules.map((elt) => marshalACLRuleSpec(elt)) +}); +const marshalClusterSetting = (request, defaults) => ({ + name: request.name, + value: request.value +}); +const marshalAddClusterSettingsRequest = (request, defaults) => ({ + settings: request.settings.map((elt) => marshalClusterSetting(elt)) +}); +const marshalEndpointSpecPrivateNetworkSpecIpamConfig = (request, defaults) => ({}); +const marshalEndpointSpecPrivateNetworkSpec = (request, defaults) => ({ + id: request.id, + ipam_config: request.ipamConfig !== void 0 ? marshalEndpointSpecPrivateNetworkSpecIpamConfig( + request.ipamConfig + ) : void 0, + service_ips: request.serviceIps +}); +const marshalEndpointSpecPublicNetworkSpec = (request, defaults) => ({}); +const marshalEndpointSpec = (request, defaults) => ({ + ...marshalling.resolveOneOf([ + { + param: "private_network", + value: request.privateNetwork !== void 0 ? marshalEndpointSpecPrivateNetworkSpec( + request.privateNetwork + ) : void 0 + }, + { + param: "public_network", + value: request.publicNetwork !== void 0 ? marshalEndpointSpecPublicNetworkSpec( + request.publicNetwork + ) : void 0 + } + ]) +}); +const marshalAddEndpointsRequest = (request, defaults) => ({ + endpoints: request.endpoints.map((elt) => marshalEndpointSpec(elt)) +}); +const marshalCreateClusterRequest = (request, defaults) => ({ + acl_rules: request.aclRules !== void 0 ? request.aclRules.map((elt) => marshalACLRuleSpec(elt)) : void 0, + cluster_settings: request.clusterSettings !== void 0 ? request.clusterSettings.map((elt) => marshalClusterSetting(elt)) : void 0, + cluster_size: request.clusterSize, + endpoints: request.endpoints !== void 0 ? request.endpoints.map((elt) => marshalEndpointSpec(elt)) : void 0, + name: request.name || randomName("ins"), + node_type: request.nodeType, + password: request.password, + project_id: request.projectId ?? defaults.defaultProjectId, + tags: request.tags, + tls_enabled: request.tlsEnabled, + user_name: request.userName, + version: request.version +}); +const marshalMigrateClusterRequest = (request, defaults) => ({ + ...marshalling.resolveOneOf([ + { param: "version", value: request.version }, + { param: "node_type", value: request.nodeType }, + { param: "cluster_size", value: request.clusterSize } + ]) +}); +const marshalSetAclRulesRequest = (request, defaults) => ({ + acl_rules: request.aclRules.map((elt) => marshalACLRuleSpec(elt)) +}); +const marshalSetClusterSettingsRequest = (request, defaults) => ({ + settings: request.settings.map((elt) => marshalClusterSetting(elt)) +}); +const marshalSetEndpointsRequest = (request, defaults) => ({ + endpoints: request.endpoints.map((elt) => marshalEndpointSpec(elt)) +}); +const marshalUpdateClusterRequest = (request, defaults) => ({ + name: request.name, + password: request.password, + tags: request.tags, + user_name: request.userName +}); +const marshalUpdateEndpointRequest = (request, defaults) => ({ + ...marshalling.resolveOneOf([ + { + param: "private_network", + value: request.privateNetwork !== void 0 ? marshalEndpointSpecPrivateNetworkSpec( + request.privateNetwork + ) : void 0 + }, + { + param: "public_network", + value: request.publicNetwork !== void 0 ? marshalEndpointSpecPublicNetworkSpec( + request.publicNetwork + ) : void 0 + } + ]) +}); +exports.marshalAddAclRulesRequest = marshalAddAclRulesRequest; +exports.marshalAddClusterSettingsRequest = marshalAddClusterSettingsRequest; +exports.marshalAddEndpointsRequest = marshalAddEndpointsRequest; +exports.marshalCreateClusterRequest = marshalCreateClusterRequest; +exports.marshalMigrateClusterRequest = marshalMigrateClusterRequest; +exports.marshalSetAclRulesRequest = marshalSetAclRulesRequest; +exports.marshalSetClusterSettingsRequest = marshalSetClusterSettingsRequest; +exports.marshalSetEndpointsRequest = marshalSetEndpointsRequest; +exports.marshalUpdateClusterRequest = marshalUpdateClusterRequest; +exports.marshalUpdateEndpointRequest = marshalUpdateEndpointRequest; +exports.unmarshalACLRule = unmarshalACLRule; +exports.unmarshalAddAclRulesResponse = unmarshalAddAclRulesResponse; +exports.unmarshalAddEndpointsResponse = unmarshalAddEndpointsResponse; +exports.unmarshalCluster = unmarshalCluster; +exports.unmarshalClusterMetricsResponse = unmarshalClusterMetricsResponse; +exports.unmarshalClusterSettingsResponse = unmarshalClusterSettingsResponse; +exports.unmarshalEndpoint = unmarshalEndpoint; +exports.unmarshalListClusterVersionsResponse = unmarshalListClusterVersionsResponse; +exports.unmarshalListClustersResponse = unmarshalListClustersResponse; +exports.unmarshalListNodeTypesResponse = unmarshalListNodeTypesResponse; +exports.unmarshalSetAclRulesResponse = unmarshalSetAclRulesResponse; +exports.unmarshalSetEndpointsResponse = unmarshalSetEndpointsResponse; - /** - * Update an IP address. Update the reverse DNS of a Load Balancer flexible IP - * address. - * - * @param request - The request {@link ZonedApiUpdateIpRequest} - * @returns A Promise of Ip - */ - updateIp = request => this.client.fetch({ - body: JSON.stringify(marshalZonedApiUpdateIpRequest(request, this.client.settings)), - headers: jsonContentHeaders$c, - method: 'PATCH', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam('ipId', request.ipId)}` - }, unmarshalIp); - pageOfListBackends = request => this.client.fetch({ - method: 'GET', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}/backends`, - urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]) - }, unmarshalListBackendsResponse); - /** - * List the backends of a given Load Balancer. List all the backends of a Load - * Balancer, specified by its Load Balancer ID. By default, results are - * returned in ascending order by the creation date of each backend. The - * response is an array of backend objects, containing full details of each - * one including their configuration parameters such as protocol, port and - * forwarding algorithm. - * - * @param request - The request {@link ZonedApiListBackendsRequest} - * @returns A Promise of ListBackendsResponse - */ - listBackends = request => enrichForPagination('backends', this.pageOfListBackends, request); +/***/ }), - /** - * Create a backend for a given Load Balancer. Create a new backend for a - * given Load Balancer, specifying its full configuration including protocol, - * port and forwarding algorithm. - * - * @param request - The request {@link ZonedApiCreateBackendRequest} - * @returns A Promise of Backend - */ - createBackend = request => this.client.fetch({ - body: JSON.stringify(marshalZonedApiCreateBackendRequest(request, this.client.settings)), - headers: jsonContentHeaders$c, - method: 'POST', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}/backends` - }, unmarshalBackend); +/***/ 9977: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - /** - * Get a backend of a given Load Balancer. Get the full details of a given - * backend, specified by its backend ID. The response contains the backend's - * full configuration parameters including protocol, port and forwarding - * algorithm. - * - * @param request - The request {@link ZonedApiGetBackendRequest} - * @returns A Promise of Backend - */ - getBackend = request => this.client.fetch({ - method: 'GET', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/backends/${validatePathParam('backendId', request.backendId)}` - }, unmarshalBackend); +"use strict"; - /** - * Update a backend of a given Load Balancer. Update a backend of a given Load - * Balancer, specified by its backend ID. Note that the request type is PUT - * and not PATCH. You must set all parameters. - * - * @param request - The request {@link ZonedApiUpdateBackendRequest} - * @returns A Promise of Backend - */ - updateBackend = request => this.client.fetch({ - body: JSON.stringify(marshalZonedApiUpdateBackendRequest(request, this.client.settings)), - headers: jsonContentHeaders$c, - method: 'PUT', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/backends/${validatePathParam('backendId', request.backendId)}` - }, unmarshalBackend); +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const index_gen = __nccwpck_require__(7945); +exports.v1 = index_gen; - /** - * Delete a backend of a given Load Balancer. Delete a backend of a given Load - * Balancer, specified by its backend ID. This action is irreversible and - * cannot be undone. - * - * @param request - The request {@link ZonedApiDeleteBackendRequest} - */ - deleteBackend = request => this.client.fetch({ - method: 'DELETE', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/backends/${validatePathParam('backendId', request.backendId)}` - }); - /** - * Add a set of backend servers to a given backend. For a given backend - * specified by its backend ID, add a set of backend servers (identified by - * their IP addresses) it should forward traffic to. These will be appended to - * any existing set of backend servers for this backend. - * - * @param request - The request {@link ZonedApiAddBackendServersRequest} - * @returns A Promise of Backend - */ - addBackendServers = request => this.client.fetch({ - body: JSON.stringify(marshalZonedApiAddBackendServersRequest(request, this.client.settings)), - headers: jsonContentHeaders$c, - method: 'POST', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/backends/${validatePathParam('backendId', request.backendId)}/servers` - }, unmarshalBackend); +/***/ }), - /** - * Remove a set of servers for a given backend. For a given backend specified - * by its backend ID, remove the specified backend servers (identified by - * their IP addresses) so that it no longer forwards traffic to them. - * - * @param request - The request {@link ZonedApiRemoveBackendServersRequest} - * @returns A Promise of Backend - */ - removeBackendServers = request => this.client.fetch({ - body: JSON.stringify(marshalZonedApiRemoveBackendServersRequest(request, this.client.settings)), - headers: jsonContentHeaders$c, - method: 'DELETE', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/backends/${validatePathParam('backendId', request.backendId)}/servers` - }, unmarshalBackend); +/***/ 5413: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - /** - * Define all backend servers for a given backend. For a given backend - * specified by its backend ID, define the set of backend servers (identified - * by their IP addresses) that it should forward traffic to. Any existing - * backend servers configured for this backend will be removed. - * - * @param request - The request {@link ZonedApiSetBackendServersRequest} - * @returns A Promise of Backend - */ - setBackendServers = request => this.client.fetch({ - body: JSON.stringify(marshalZonedApiSetBackendServersRequest(request, this.client.settings)), - headers: jsonContentHeaders$c, - method: 'PUT', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/backends/${validatePathParam('backendId', request.backendId)}/servers` - }, unmarshalBackend); +"use strict"; +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const intervalRetrier = __nccwpck_require__(9052); +const api = __nccwpck_require__(3042); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const resourcePaginator = __nccwpck_require__(4983); +const content_gen = __nccwpck_require__(9906); +const marshalling_gen = __nccwpck_require__(7651); +const jsonContentHeaders = { + "Content-Type": "application/json; charset=utf-8" +}; +class API extends api.API { + /** Lists the available regions of the API. */ + static LOCALITIES = ["fr-par", "nl-ams", "pl-waw"]; + pageOfListNamespaces = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/registry/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/namespaces`, + urlParams: marshalling.urlParams( + ["name", request.name], + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId] + ) + }, + marshalling_gen.unmarshalListNamespacesResponse + ); /** - * Update a health check for a given backend. Update the configuration of the - * health check performed by a given backend to verify the health of its - * backend servers, identified by its backend ID. Note that the request type - * is PUT and not PATCH. You must set all parameters. + * List namespaces. List all namespaces in a specified region. By default, the + * namespaces listed are ordered by creation date in ascending order. This can + * be modified via the order_by field. You can also define additional + * parameters for your query, such as the `instance_id` and `project_id` + * parameters. * - * @param request - The request {@link ZonedApiUpdateHealthCheckRequest} - * @returns A Promise of HealthCheck + * @param request - The request {@link ListNamespacesRequest} + * @returns A Promise of ListNamespacesResponse */ - updateHealthCheck = request => this.client.fetch({ - body: JSON.stringify(marshalZonedApiUpdateHealthCheckRequest(request, this.client.settings)), - headers: jsonContentHeaders$c, - method: 'PUT', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/backends/${validatePathParam('backendId', request.backendId)}/healthcheck` - }, unmarshalHealthCheck); - pageOfListFrontends = request => this.client.fetch({ - method: 'GET', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}/frontends`, - urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]) - }, unmarshalListFrontendsResponse); - + listNamespaces = (request = {}) => resourcePaginator.enrichForPagination("namespaces", this.pageOfListNamespaces, request); /** - * List frontends of a given Load Balancer. List all the frontends of a Load - * Balancer, specified by its Load Balancer ID. By default, results are - * returned in ascending order by the creation date of each frontend. The - * response is an array of frontend objects, containing full details of each - * one including the port they listen on and the backend they are attached - * to. + * Get a namespace. Retrieve information about a given namespace, specified by + * its `namespace_id` and region. Full details about the namespace, such as + * `description`, `project_id`, `status`, `endpoint`, `is_public`, `size`, and + * `image_count` are returned in the response. * - * @param request - The request {@link ZonedApiListFrontendsRequest} - * @returns A Promise of ListFrontendsResponse + * @param request - The request {@link GetNamespaceRequest} + * @returns A Promise of Namespace */ - listFrontends = request => enrichForPagination('frontends', this.pageOfListFrontends, request); - + getNamespace = (request) => this.client.fetch( + { + method: "GET", + path: `/registry/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/namespaces/${marshalling.validatePathParam("namespaceId", request.namespaceId)}` + }, + marshalling_gen.unmarshalNamespace + ); /** - * Create a frontend in a given Load Balancer. Create a new frontend for a - * given Load Balancer, specifying its configuration including the port it - * should listen on and the backend to attach it to. + * Waits for {@link Namespace} to be in a final state. * - * @param request - The request {@link ZonedApiCreateFrontendRequest} - * @returns A Promise of Frontend + * @param request - The request {@link GetNamespaceRequest} + * @param options - The waiting options + * @returns A Promise of Namespace */ - createFrontend = request => this.client.fetch({ - body: JSON.stringify(marshalZonedApiCreateFrontendRequest(request, this.client.settings)), - headers: jsonContentHeaders$c, - method: 'POST', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}/frontends` - }, unmarshalFrontend); - + waitForNamespace = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve(!content_gen.NAMESPACE_TRANSIENT_STATUSES.includes(res.status))), + this.getNamespace, + request, + options + ); /** - * Get a frontend. Get the full details of a given frontend, specified by its - * frontend ID. The response contains the frontend's full configuration - * parameters including the backend it is attached to, the port it listens on, - * and any certificates it has. + * Create a namespace. Create a new Container Registry namespace. You must + * specify the namespace name and region in which you want it to be created. + * Optionally, you can specify the `project_id` and `is_public` in the request + * payload. * - * @param request - The request {@link ZonedApiGetFrontendRequest} - * @returns A Promise of Frontend + * @param request - The request {@link CreateNamespaceRequest} + * @returns A Promise of Namespace */ - getFrontend = request => this.client.fetch({ - method: 'GET', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/frontends/${validatePathParam('frontendId', request.frontendId)}` - }, unmarshalFrontend); - + createNamespace = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateNamespaceRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/registry/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/namespaces` + }, + marshalling_gen.unmarshalNamespace + ); /** - * Update a frontend. Update a given frontend, specified by its frontend ID. - * You can update configuration parameters including its name and the port it - * listens on. Note that the request type is PUT and not PATCH. You must set - * all parameters. + * Update a namespace. Update the parameters of a given namespace, specified + * by its `namespace_id` and `region`. You can update the `description` and + * `is_public` parameters. * - * @param request - The request {@link ZonedApiUpdateFrontendRequest} - * @returns A Promise of Frontend + * @param request - The request {@link UpdateNamespaceRequest} + * @returns A Promise of Namespace */ - updateFrontend = request => this.client.fetch({ - body: JSON.stringify(marshalZonedApiUpdateFrontendRequest(request, this.client.settings)), - headers: jsonContentHeaders$c, - method: 'PUT', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/frontends/${validatePathParam('frontendId', request.frontendId)}` - }, unmarshalFrontend); - + updateNamespace = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateNamespaceRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/registry/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/namespaces/${marshalling.validatePathParam("namespaceId", request.namespaceId)}` + }, + marshalling_gen.unmarshalNamespace + ); /** - * Delete a frontend. Delete a given frontend, specified by its frontend ID. - * This action is irreversible and cannot be undone. + * Delete a namespace. Delete a given namespace. You must specify, in the + * endpoint, the `region` and `namespace_id` parameters of the namespace you + * want to delete. * - * @param request - The request {@link ZonedApiDeleteFrontendRequest} + * @param request - The request {@link DeleteNamespaceRequest} + * @returns A Promise of Namespace */ - deleteFrontend = request => this.client.fetch({ - method: 'DELETE', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/frontends/${validatePathParam('frontendId', request.frontendId)}` - }); - pageOfListRoutes = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/routes`, - urlParams: urlParams(['frontend_id', request.frontendId], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]) - }, unmarshalListRoutesResponse); - + deleteNamespace = (request) => this.client.fetch( + { + method: "DELETE", + path: `/registry/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/namespaces/${marshalling.validatePathParam("namespaceId", request.namespaceId)}` + }, + marshalling_gen.unmarshalNamespace + ); + pageOfListImages = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/registry/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/images`, + urlParams: marshalling.urlParams( + ["name", request.name], + ["namespace_id", request.namespaceId], + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId] + ) + }, + marshalling_gen.unmarshalListImagesResponse + ); /** - * List all routes. List all routes for a given frontend. The response is an - * array of routes, each one with a specified backend to direct to if a - * certain condition is matched (based on the value of the SNI field or HTTP - * Host header). + * List images. List all images in a specified region. By default, the images + * listed are ordered by creation date in ascending order. This can be + * modified via the order_by field. You can also define additional parameters + * for your query, such as the `namespace_id` and `project_id` parameters. * - * @param request - The request {@link ZonedApiListRoutesRequest} - * @returns A Promise of ListRoutesResponse + * @param request - The request {@link ListImagesRequest} + * @returns A Promise of ListImagesResponse */ - listRoutes = (request = {}) => enrichForPagination('routes', this.pageOfListRoutes, request); - + listImages = (request = {}) => resourcePaginator.enrichForPagination("images", this.pageOfListImages, request); /** - * Create a route. Create a new route on a given frontend. To configure a - * route, specify the backend to direct to if a certain condition is matched - * (based on the value of the SNI field or HTTP Host header). + * Get an image. Retrieve information about a given container image, specified + * by its `image_id` and region. Full details about the image, such as `name`, + * `namespace_id`, `status`, `visibility`, and `size` are returned in the + * response. * - * @param request - The request {@link ZonedApiCreateRouteRequest} - * @returns A Promise of Route + * @param request - The request {@link GetImageRequest} + * @returns A Promise of Image */ - createRoute = request => this.client.fetch({ - body: JSON.stringify(marshalZonedApiCreateRouteRequest(request, this.client.settings)), - headers: jsonContentHeaders$c, - method: 'POST', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/routes` - }, unmarshalRoute); - + getImage = (request) => this.client.fetch( + { + method: "GET", + path: `/registry/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/images/${marshalling.validatePathParam("imageId", request.imageId)}` + }, + marshalling_gen.unmarshalImage + ); /** - * Get a route. Retrieve information about an existing route, specified by its - * route ID. Its full details, origin frontend, target backend and match - * condition, are returned in the response object. + * Waits for {@link Image} to be in a final state. * - * @param request - The request {@link ZonedApiGetRouteRequest} - * @returns A Promise of Route + * @param request - The request {@link GetImageRequest} + * @param options - The waiting options + * @returns A Promise of Image */ - getRoute = request => this.client.fetch({ - method: 'GET', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/routes/${validatePathParam('routeId', request.routeId)}` - }, unmarshalRoute); - + waitForImage = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve(!content_gen.IMAGE_TRANSIENT_STATUSES.includes(res.status))), + this.getImage, + request, + options + ); /** - * Update a route. Update the configuration of an existing route, specified by - * its route ID. + * Update an image. Update the parameters of a given image, specified by its + * `image_id` and `region`. You can update the `visibility` parameter. * - * @param request - The request {@link ZonedApiUpdateRouteRequest} - * @returns A Promise of Route + * @param request - The request {@link UpdateImageRequest} + * @returns A Promise of Image */ - updateRoute = request => this.client.fetch({ - body: JSON.stringify(marshalZonedApiUpdateRouteRequest(request, this.client.settings)), - headers: jsonContentHeaders$c, - method: 'PUT', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/routes/${validatePathParam('routeId', request.routeId)}` - }, unmarshalRoute); - + updateImage = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateImageRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/registry/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/images/${marshalling.validatePathParam("imageId", request.imageId)}` + }, + marshalling_gen.unmarshalImage + ); /** - * Delete a route. Delete an existing route, specified by its route ID. - * Deleting a route is permanent, and cannot be undone. + * Delete an image. Delete a given image. You must specify, in the endpoint, + * the `region` and `image_id` parameters of the image you want to delete. * - * @param request - The request {@link ZonedApiDeleteRouteRequest} + * @param request - The request {@link DeleteImageRequest} + * @returns A Promise of Image */ - deleteRoute = request => this.client.fetch({ - method: 'DELETE', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/routes/${validatePathParam('routeId', request.routeId)}` - }); - + deleteImage = (request) => this.client.fetch( + { + method: "DELETE", + path: `/registry/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/images/${marshalling.validatePathParam("imageId", request.imageId)}` + }, + marshalling_gen.unmarshalImage + ); + pageOfListTags = (request) => this.client.fetch( + { + method: "GET", + path: `/registry/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/images/${marshalling.validatePathParam("imageId", request.imageId)}/tags`, + urlParams: marshalling.urlParams( + ["name", request.name], + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListTagsResponse + ); /** - * Get usage statistics of a given Load Balancer. + * List tags. List all tags for a given image, specified by region. By + * default, the tags listed are ordered by creation date in ascending order. + * This can be modified via the order_by field. You can also define additional + * parameters for your query, such as the `name`. * - * @deprecated - * @param request - The request {@link ZonedApiGetLbStatsRequest} - * @returns A Promise of LbStats + * @param request - The request {@link ListTagsRequest} + * @returns A Promise of ListTagsResponse */ - getLbStats = request => this.client.fetch({ - method: 'GET', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}/stats`, - urlParams: urlParams(['backend_id', request.backendId]) - }, unmarshalLbStats); - pageOfListBackendStats = request => this.client.fetch({ - method: 'GET', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}/backend-stats`, - urlParams: urlParams(['backend_id', request.backendId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]) - }, unmarshalListBackendStatsResponse); - + listTags = (request) => resourcePaginator.enrichForPagination("tags", this.pageOfListTags, request); /** - * List backend server statistics. List information about your backend - * servers, including their state and the result of their last health check. + * Get a tag. Retrieve information about a given image tag, specified by its + * `tag_id` and region. Full details about the tag, such as `name`, + * `image_id`, `status`, and `digest` are returned in the response. * - * @param request - The request {@link ZonedApiListBackendStatsRequest} - * @returns A Promise of ListBackendStatsResponse + * @param request - The request {@link GetTagRequest} + * @returns A Promise of Tag */ - listBackendStats = request => enrichForPagination('backendServersStats', this.pageOfListBackendStats, request); - pageOfListAcls = request => this.client.fetch({ - method: 'GET', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/frontends/${validatePathParam('frontendId', request.frontendId)}/acls`, - urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]) - }, unmarshalListAclResponse); - + getTag = (request) => this.client.fetch( + { + method: "GET", + path: `/registry/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/tags/${marshalling.validatePathParam("tagId", request.tagId)}` + }, + marshalling_gen.unmarshalTag + ); /** - * List ACLs for a given frontend. List the ACLs for a given frontend, - * specified by its frontend ID. The response is an array of ACL objects, each - * one representing an ACL that denies or allows traffic based on certain - * conditions. + * Waits for {@link Tag} to be in a final state. * - * @param request - The request {@link ZonedApiListAclsRequest} - * @returns A Promise of ListAclResponse + * @param request - The request {@link GetTagRequest} + * @param options - The waiting options + * @returns A Promise of Tag */ - listAcls = request => enrichForPagination('acls', this.pageOfListAcls, request); - + waitForTag = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve(!content_gen.TAG_TRANSIENT_STATUSES.includes(res.status))), + this.getTag, + request, + options + ); /** - * Create an ACL for a given frontend. Create a new ACL for a given frontend. - * Each ACL must have a name, an action to perform (allow or deny), and a - * match rule (the action is carried out when the incoming traffic matches the - * rule). + * Delete a tag. Delete a given image tag. You must specify, in the endpoint, + * the `region` and `tag_id` parameters of the tag you want to delete. * - * @param request - The request {@link ZonedApiCreateAclRequest} - * @returns A Promise of Acl + * @param request - The request {@link DeleteTagRequest} + * @returns A Promise of Tag */ - createAcl = request => this.client.fetch({ - body: JSON.stringify(marshalZonedApiCreateAclRequest(request, this.client.settings)), - headers: jsonContentHeaders$c, - method: 'POST', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/frontends/${validatePathParam('frontendId', request.frontendId)}/acls` - }, unmarshalAcl); + deleteTag = (request) => this.client.fetch( + { + method: "DELETE", + path: `/registry/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/tags/${marshalling.validatePathParam("tagId", request.tagId)}`, + urlParams: marshalling.urlParams(["force", request.force]) + }, + marshalling_gen.unmarshalTag + ); +} +exports.API = API; + + +/***/ }), + +/***/ 9906: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const IMAGE_TRANSIENT_STATUSES = ["deleting"]; +const NAMESPACE_TRANSIENT_STATUSES = ["deleting"]; +const TAG_TRANSIENT_STATUSES = ["deleting"]; +exports.IMAGE_TRANSIENT_STATUSES = IMAGE_TRANSIENT_STATUSES; +exports.NAMESPACE_TRANSIENT_STATUSES = NAMESPACE_TRANSIENT_STATUSES; +exports.TAG_TRANSIENT_STATUSES = TAG_TRANSIENT_STATUSES; + + +/***/ }), + +/***/ 7945: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api_gen = __nccwpck_require__(5413); +const content_gen = __nccwpck_require__(9906); +exports.API = api_gen.API; +exports.IMAGE_TRANSIENT_STATUSES = content_gen.IMAGE_TRANSIENT_STATUSES; +exports.NAMESPACE_TRANSIENT_STATUSES = content_gen.NAMESPACE_TRANSIENT_STATUSES; +exports.TAG_TRANSIENT_STATUSES = content_gen.TAG_TRANSIENT_STATUSES; + + +/***/ }), + +/***/ 7651: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const randomName = __nccwpck_require__(8141); +const json = __nccwpck_require__(3746); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const unmarshalImage = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Image' failed as data isn't a dictionary.` + ); + } + return { + createdAt: marshalling.unmarshalDate(data.created_at), + id: data.id, + name: data.name, + namespaceId: data.namespace_id, + size: data.size, + status: data.status, + statusMessage: data.status_message, + tags: data.tags, + updatedAt: marshalling.unmarshalDate(data.updated_at), + visibility: data.visibility + }; +}; +const unmarshalNamespace = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Namespace' failed as data isn't a dictionary.` + ); + } + return { + createdAt: marshalling.unmarshalDate(data.created_at), + description: data.description, + endpoint: data.endpoint, + id: data.id, + imageCount: data.image_count, + isPublic: data.is_public, + name: data.name, + organizationId: data.organization_id, + projectId: data.project_id, + region: data.region, + size: data.size, + status: data.status, + statusMessage: data.status_message, + updatedAt: marshalling.unmarshalDate(data.updated_at) + }; +}; +const unmarshalTag = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Tag' failed as data isn't a dictionary.` + ); + } + return { + createdAt: marshalling.unmarshalDate(data.created_at), + digest: data.digest, + id: data.id, + imageId: data.image_id, + name: data.name, + status: data.status, + updatedAt: marshalling.unmarshalDate(data.updated_at) + }; +}; +const unmarshalListImagesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListImagesResponse' failed as data isn't a dictionary.` + ); + } + return { + images: marshalling.unmarshalArrayOfObject(data.images, unmarshalImage), + totalCount: data.total_count + }; +}; +const unmarshalListNamespacesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListNamespacesResponse' failed as data isn't a dictionary.` + ); + } + return { + namespaces: marshalling.unmarshalArrayOfObject(data.namespaces, unmarshalNamespace), + totalCount: data.total_count + }; +}; +const unmarshalListTagsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListTagsResponse' failed as data isn't a dictionary.` + ); + } + return { + tags: marshalling.unmarshalArrayOfObject(data.tags, unmarshalTag), + totalCount: data.total_count + }; +}; +const marshalCreateNamespaceRequest = (request, defaults) => ({ + description: request.description, + is_public: request.isPublic, + name: request.name || randomName("ns"), + ...marshalling.resolveOneOf([ + { + default: defaults.defaultProjectId, + param: "project_id", + value: request.projectId + }, + { + default: defaults.defaultOrganizationId, + param: "organization_id", + value: request.organizationId + } + ]) +}); +const marshalUpdateImageRequest = (request, defaults) => ({ + visibility: request.visibility +}); +const marshalUpdateNamespaceRequest = (request, defaults) => ({ + description: request.description, + is_public: request.isPublic +}); +exports.marshalCreateNamespaceRequest = marshalCreateNamespaceRequest; +exports.marshalUpdateImageRequest = marshalUpdateImageRequest; +exports.marshalUpdateNamespaceRequest = marshalUpdateNamespaceRequest; +exports.unmarshalImage = unmarshalImage; +exports.unmarshalListImagesResponse = unmarshalListImagesResponse; +exports.unmarshalListNamespacesResponse = unmarshalListNamespacesResponse; +exports.unmarshalListTagsResponse = unmarshalListTagsResponse; +exports.unmarshalNamespace = unmarshalNamespace; +exports.unmarshalTag = unmarshalTag; + + +/***/ }), + +/***/ 6484: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const index_gen = __nccwpck_require__(9147); +const index_gen$1 = __nccwpck_require__(6095); +exports.v1alpha1 = index_gen; +exports.v1beta1 = index_gen$1; + + +/***/ }), + +/***/ 4075: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api = __nccwpck_require__(3042); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const resourcePaginator = __nccwpck_require__(4983); +const marshalling_gen = __nccwpck_require__(3929); +const jsonContentHeaders = { + "Content-Type": "application/json; charset=utf-8" +}; +class API extends api.API { + /** Lists the available regions of the API. */ + static LOCALITIES = ["fr-par", "nl-ams", "pl-waw"]; /** - * Get an ACL. Get information for a particular ACL, specified by its ACL ID. - * The response returns full details of the ACL, including its name, action, - * match rule and frontend. + * Create a secret. You must specify the `region` to create a secret. * - * @param request - The request {@link ZonedApiGetAclRequest} - * @returns A Promise of Acl + * @param request - The request {@link CreateSecretRequest} + * @returns A Promise of Secret */ - getAcl = request => this.client.fetch({ - method: 'GET', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/acls/${validatePathParam('aclId', request.aclId)}` - }, unmarshalAcl); - + createSecret = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateSecretRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/secret-manager/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets` + }, + marshalling_gen.unmarshalSecret + ); /** - * Update an ACL. Update a particular ACL, specified by its ACL ID. You can - * update details including its name, action and match rule. + * Create folder. * - * @param request - The request {@link ZonedApiUpdateAclRequest} - * @returns A Promise of Acl + * @param request - The request {@link CreateFolderRequest} + * @returns A Promise of Folder */ - updateAcl = request => this.client.fetch({ - body: JSON.stringify(marshalZonedApiUpdateAclRequest(request, this.client.settings)), - headers: jsonContentHeaders$c, - method: 'PUT', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/acls/${validatePathParam('aclId', request.aclId)}` - }, unmarshalAcl); - + createFolder = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateFolderRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/secret-manager/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/folders` + }, + marshalling_gen.unmarshalFolder + ); /** - * Delete an ACL. Delete an ACL, specified by its ACL ID. Deleting an ACL is - * irreversible and cannot be undone. + * Get metadata using the secret's ID. Retrieve the metadata of a secret + * specified by the `region` and `secret_id` parameters. * - * @param request - The request {@link ZonedApiDeleteAclRequest} + * @param request - The request {@link GetSecretRequest} + * @returns A Promise of Secret */ - deleteAcl = request => this.client.fetch({ - method: 'DELETE', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/acls/${validatePathParam('aclId', request.aclId)}` - }); - + getSecret = (request) => this.client.fetch( + { + method: "GET", + path: `/secret-manager/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam("secretId", request.secretId)}` + }, + marshalling_gen.unmarshalSecret + ); /** - * Define all ACLs for a given frontend. For a given frontend specified by its - * frontend ID, define and add the complete set of ACLS for that frontend. Any - * existing ACLs on this frontend will be removed. + * Get metadata using the secret's name. Retrieve the metadata of a secret + * specified by the `region` and `secret_name` parameters. * - * @param request - The request {@link ZonedApiSetAclsRequest} - * @returns A Promise of SetAclsResponse + * GetSecretByName usage is now deprecated. + * + * Scaleway recommends that you use the `ListSecrets` request with the `name` + * filter. + * + * @deprecated + * @param request - The request {@link GetSecretByNameRequest} + * @returns A Promise of Secret */ - setAcls = request => this.client.fetch({ - body: JSON.stringify(marshalZonedApiSetAclsRequest(request, this.client.settings)), - headers: jsonContentHeaders$c, - method: 'PUT', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/frontends/${validatePathParam('frontendId', request.frontendId)}/acls` - }, unmarshalSetAclsResponse); - + getSecretByName = (request) => this.client.fetch( + { + method: "GET", + path: `/secret-manager/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets-by-name/${marshalling.validatePathParam("secretName", request.secretName)}`, + urlParams: marshalling.urlParams(["project_id", request.projectId]) + }, + marshalling_gen.unmarshalSecret + ); /** - * Create an SSL/TLS certificate. Generate a new SSL/TLS certificate for a - * given Load Balancer. You can choose to create a Let's Encrypt certificate, - * or import a custom certificate. + * Update metadata of a secret. Edit a secret's metadata such as name, tag(s), + * description and ephemeral policy. The secret to update is specified by the + * `secret_id` and `region` parameters. * - * @param request - The request {@link ZonedApiCreateCertificateRequest} - * @returns A Promise of Certificate + * @param request - The request {@link UpdateSecretRequest} + * @returns A Promise of Secret */ - createCertificate = request => this.client.fetch({ - body: JSON.stringify(marshalZonedApiCreateCertificateRequest(request, this.client.settings)), - headers: jsonContentHeaders$c, - method: 'POST', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}/certificates` - }, unmarshalCertificate); - pageOfListCertificates = request => this.client.fetch({ - method: 'GET', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}/certificates`, - urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]) - }, unmarshalListCertificatesResponse); - + updateSecret = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateSecretRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/secret-manager/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam("secretId", request.secretId)}` + }, + marshalling_gen.unmarshalSecret + ); + pageOfListSecrets = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/secret-manager/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets`, + urlParams: marshalling.urlParams( + ["is_ephemeral", request.isEphemeral], + ["is_managed", request.isManaged], + ["name", request.name], + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["path", request.path], + ["project_id", request.projectId], + ["tags", request.tags] + ) + }, + marshalling_gen.unmarshalListSecretsResponse + ); /** - * List all SSL/TLS certificates on a given Load Balancer. List all the - * SSL/TLS certificates on a given Load Balancer. The response is an array of - * certificate objects, which are by default listed in ascending order of - * creation date. + * List secrets. Retrieve the list of secrets created within an Organization + * and/or Project. You must specify either the `organization_id` or the + * `project_id` and the `region`. * - * @param request - The request {@link ZonedApiListCertificatesRequest} - * @returns A Promise of ListCertificatesResponse + * @param request - The request {@link ListSecretsRequest} + * @returns A Promise of ListSecretsResponse */ - listCertificates = request => enrichForPagination('certificates', this.pageOfListCertificates, request); - + listSecrets = (request = {}) => resourcePaginator.enrichForPagination("secrets", this.pageOfListSecrets, request); + pageOfListFolders = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/secret-manager/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/folders`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["path", request.path], + ["project_id", request.projectId] + ) + }, + marshalling_gen.unmarshalListFoldersResponse + ); /** - * Get an SSL/TLS certificate. Get information for a particular SSL/TLS - * certificate, specified by its certificate ID. The response returns full - * details of the certificate, including its type, main domain name, and - * alternative domain names. + * List folders. Retrieve the list of folders created within a Project. * - * @param request - The request {@link ZonedApiGetCertificateRequest} - * @returns A Promise of Certificate + * @param request - The request {@link ListFoldersRequest} + * @returns A Promise of ListFoldersResponse */ - getCertificate = request => this.client.fetch({ - method: 'GET', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/certificates/${validatePathParam('certificateId', request.certificateId)}` - }, unmarshalCertificate); - + listFolders = (request = {}) => resourcePaginator.enrichForPagination("folders", this.pageOfListFolders, request); /** - * Waits for {@link Certificate} to be in a final state. + * Delete a secret. Delete a given secret specified by the `region` and + * `secret_id` parameters. * - * @param request - The request {@link GetCertificateRequest} - * @param options - The waiting options - * @returns A Promise of Certificate + * @param request - The request {@link DeleteSecretRequest} */ - waitForCertificate = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!CERTIFICATE_TRANSIENT_STATUSES.includes(res.status))), this.getCertificate, request, options); - + deleteSecret = (request) => this.client.fetch({ + method: "DELETE", + path: `/secret-manager/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam("secretId", request.secretId)}` + }); /** - * Update an SSL/TLS certificate. Update the name of a particular SSL/TLS - * certificate, specified by its certificate ID. + * Delete a given folder specified by the `region` and `folder_id` parameters. * - * @param request - The request {@link ZonedApiUpdateCertificateRequest} - * @returns A Promise of Certificate + * @param request - The request {@link DeleteFolderRequest} */ - updateCertificate = request => this.client.fetch({ - body: JSON.stringify(marshalZonedApiUpdateCertificateRequest(request, this.client.settings)), - headers: jsonContentHeaders$c, - method: 'PUT', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/certificates/${validatePathParam('certificateId', request.certificateId)}` - }, unmarshalCertificate); - + deleteFolder = (request) => this.client.fetch({ + method: "DELETE", + path: `/secret-manager/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/folders/${marshalling.validatePathParam("folderId", request.folderId)}` + }); /** - * Delete an SSL/TLS certificate. Delete an SSL/TLS certificate, specified by - * its certificate ID. Deleting a certificate is irreversible and cannot be - * undone. + * Protect a secret. Protect a given secret specified by the `secret_id` + * parameter. A protected secret can be read and modified but cannot be + * deleted. * - * @param request - The request {@link ZonedApiDeleteCertificateRequest} + * @param request - The request {@link ProtectSecretRequest} + * @returns A Promise of Secret */ - deleteCertificate = request => this.client.fetch({ - method: 'DELETE', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/certificates/${validatePathParam('certificateId', request.certificateId)}` - }); - pageOfListLbTypes = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lb-types`, - urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]) - }, unmarshalListLbTypesResponse); - + protectSecret = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/secret-manager/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam("secretId", request.secretId)}/protect` + }, + marshalling_gen.unmarshalSecret + ); /** - * List all Load Balancer offer types. List all the different commercial Load - * Balancer types. The response includes an array of offer types, each with a - * name, description, and information about its stock availability. + * Unprotect a secret. Unprotect a given secret specified by the `secret_id` + * parameter. An unprotected secret can be read, modified and deleted. * - * @param request - The request {@link ZonedApiListLbTypesRequest} - * @returns A Promise of ListLbTypesResponse + * @param request - The request {@link UnprotectSecretRequest} + * @returns A Promise of Secret */ - listLbTypes = (request = {}) => enrichForPagination('lbTypes', this.pageOfListLbTypes, request); - + unprotectSecret = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/secret-manager/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam("secretId", request.secretId)}/unprotect` + }, + marshalling_gen.unmarshalSecret + ); /** - * Create a subscriber. Create a new subscriber, either with an email - * configuration or a webhook configuration, for a specified Scaleway - * Project. + * Allow a product to use the secret. * - * @param request - The request {@link ZonedApiCreateSubscriberRequest} - * @returns A Promise of Subscriber + * @param request - The request {@link AddSecretOwnerRequest} */ - createSubscriber = request => this.client.fetch({ - body: JSON.stringify(marshalZonedApiCreateSubscriberRequest(request, this.client.settings)), - headers: jsonContentHeaders$c, - method: 'POST', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/subscribers` - }, unmarshalSubscriber); - + addSecretOwner = (request) => this.client.fetch({ + body: JSON.stringify( + marshalling_gen.marshalAddSecretOwnerRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/secret-manager/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam("secretId", request.secretId)}/add-owner` + }); /** - * Get a subscriber. Retrieve information about an existing subscriber, - * specified by its subscriber ID. Its full details, including name and - * email/webhook configuration, are returned in the response object. + * Create a version. Create a version of a given secret specified by the + * `region` and `secret_id` parameters. * - * @param request - The request {@link ZonedApiGetSubscriberRequest} - * @returns A Promise of Subscriber + * @param request - The request {@link CreateSecretVersionRequest} + * @returns A Promise of SecretVersion */ - getSubscriber = request => this.client.fetch({ - method: 'GET', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/subscribers/${validatePathParam('subscriberId', request.subscriberId)}` - }, unmarshalSubscriber); - pageOfListSubscriber = request => this.client.fetch({ - method: 'GET', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/subscribers`, - urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId]) - }, unmarshalListSubscriberResponse); - + createSecretVersion = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateSecretVersionRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/secret-manager/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam("secretId", request.secretId)}/versions` + }, + marshalling_gen.unmarshalSecretVersion + ); /** - * List all subscribers. List all subscribers to Load Balancer alerts. By - * default, returns all subscribers to Load Balancer alerts for the - * Organization associated with the authentication token used for the - * request. + * Generate a password in a new version. Generate a password for the given + * secret specified by the `region` and `secret_id` parameters. This will also + * create a new version of the secret that will store the password. * - * @param request - The request {@link ZonedApiListSubscriberRequest} - * @returns A Promise of ListSubscriberResponse + * @param request - The request {@link GeneratePasswordRequest} + * @returns A Promise of SecretVersion */ - listSubscriber = request => enrichForPagination('subscribers', this.pageOfListSubscriber, request); - + generatePassword = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalGeneratePasswordRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/secret-manager/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam("secretId", request.secretId)}/generate-password` + }, + marshalling_gen.unmarshalSecretVersion + ); /** - * Update a subscriber. Update the parameters of a given subscriber (e.g. - * name, webhook configuration, email configuration), specified by its - * subscriber ID. + * Get metadata of a secret's version using the secret's ID. Retrieve the + * metadata of a secret's given version specified by the `region`, `secret_id` + * and `revision` parameters. * - * @param request - The request {@link ZonedApiUpdateSubscriberRequest} - * @returns A Promise of Subscriber + * @param request - The request {@link GetSecretVersionRequest} + * @returns A Promise of SecretVersion */ - updateSubscriber = request => this.client.fetch({ - body: JSON.stringify(marshalZonedApiUpdateSubscriberRequest(request, this.client.settings)), - headers: jsonContentHeaders$c, - method: 'PUT', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/subscribers/${validatePathParam('subscriberId', request.subscriberId)}` - }, unmarshalSubscriber); - + getSecretVersion = (request) => this.client.fetch( + { + method: "GET", + path: `/secret-manager/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam("secretId", request.secretId)}/versions/${marshalling.validatePathParam("revision", request.revision)}` + }, + marshalling_gen.unmarshalSecretVersion + ); /** - * Delete a subscriber. Delete an existing subscriber, specified by its - * subscriber ID. Deleting a subscriber is permanent, and cannot be undone. + * Get metadata of a secret's version using the secret's name. Retrieve the + * metadata of a secret's given version specified by the `region`, + * `secret_name`, `revision` and `project_id` parameters. * - * @param request - The request {@link ZonedApiDeleteSubscriberRequest} + * This method is deprecated. + * + * Scaleway recommends that you use the `ListSecrets` request with the `name` + * filter to specify the secret version desired, then use the + * `GetSecretVersion` request. + * + * @deprecated + * @param request - The request {@link GetSecretVersionByNameRequest} + * @returns A Promise of SecretVersion */ - deleteSubscriber = request => this.client.fetch({ - method: 'DELETE', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lb/subscription/${validatePathParam('subscriberId', request.subscriberId)}` - }); - + getSecretVersionByName = (request) => this.client.fetch( + { + method: "GET", + path: `/secret-manager/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets-by-name/${marshalling.validatePathParam("secretName", request.secretName)}/versions/${marshalling.validatePathParam("revision", request.revision)}`, + urlParams: marshalling.urlParams(["project_id", request.projectId]) + }, + marshalling_gen.unmarshalSecretVersion + ); /** - * Subscribe a subscriber to alerts for a given Load Balancer. Subscribe an - * existing subscriber to alerts for a given Load Balancer. + * Update metadata of a version. Edit the metadata of a secret's given + * version, specified by the `region`, `secret_id` and `revision` parameters. * - * @param request - The request {@link ZonedApiSubscribeToLbRequest} - * @returns A Promise of Lb + * @param request - The request {@link UpdateSecretVersionRequest} + * @returns A Promise of SecretVersion */ - subscribeToLb = request => this.client.fetch({ - body: JSON.stringify(marshalZonedApiSubscribeToLbRequest(request, this.client.settings)), - headers: jsonContentHeaders$c, - method: 'POST', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lb/${validatePathParam('lbId', request.lbId)}/subscribe` - }, unmarshalLb); - + updateSecretVersion = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateSecretVersionRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/secret-manager/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam("secretId", request.secretId)}/versions/${marshalling.validatePathParam("revision", request.revision)}` + }, + marshalling_gen.unmarshalSecretVersion + ); + pageOfListSecretVersions = (request) => this.client.fetch( + { + method: "GET", + path: `/secret-manager/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam("secretId", request.secretId)}/versions`, + urlParams: marshalling.urlParams( + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["status", request.status] + ) + }, + marshalling_gen.unmarshalListSecretVersionsResponse + ); /** - * Unsubscribe a subscriber from alerts for a given Load Balancer. Unsubscribe - * a subscriber from alerts for a given Load Balancer. The subscriber is not - * deleted, and can be resubscribed in the future if necessary. + * List versions of a secret using the secret's ID. Retrieve the list of a + * given secret's versions specified by the `secret_id` and `region` + * parameters. * - * @param request - The request {@link ZonedApiUnsubscribeFromLbRequest} - * @returns A Promise of Lb + * @param request - The request {@link ListSecretVersionsRequest} + * @returns A Promise of ListSecretVersionsResponse */ - unsubscribeFromLb = request => this.client.fetch({ - method: 'DELETE', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lb/${validatePathParam('lbId', request.lbId)}/unsubscribe` - }, unmarshalLb); - pageOfListLbPrivateNetworks = request => this.client.fetch({ - method: 'GET', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}/private-networks`, - urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]) - }, unmarshalListLbPrivateNetworksResponse); - + listSecretVersions = (request) => resourcePaginator.enrichForPagination("versions", this.pageOfListSecretVersions, request); + pageOfListSecretVersionsByName = (request) => this.client.fetch( + { + method: "GET", + path: `/secret-manager/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets-by-name/${marshalling.validatePathParam("secretName", request.secretName)}/versions`, + urlParams: marshalling.urlParams( + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId], + ["status", request.status] + ) + }, + marshalling_gen.unmarshalListSecretVersionsResponse + ); /** - * List Private Networks attached to a Load Balancer. List the Private - * Networks attached to a given Load Balancer, specified by its Load Balancer - * ID. The response is an array of Private Network objects, giving information - * including the status, configuration, name and creation date of each Private - * Network. + * List versions of a secret using the secret's name. Retrieve the list of a + * given secret's versions specified by the `secret_name`,`region` and + * `project_id` parameters. * - * @param request - The request {@link ZonedApiListLbPrivateNetworksRequest} - * @returns A Promise of ListLbPrivateNetworksResponse + * This method is deprecated. + * + * Scaleway recommends that you use the `ListSecrets` request with the `name` + * filter to specify the secret version desired, then use the + * `ListSecretVersions` request. + * + * @deprecated + * @param request - The request {@link ListSecretVersionsByNameRequest} + * @returns A Promise of ListSecretVersionsResponse */ - listLbPrivateNetworks = request => enrichForPagination('privateNetwork', this.pageOfListLbPrivateNetworks, request); - + listSecretVersionsByName = (request) => resourcePaginator.enrichForPagination( + "versions", + this.pageOfListSecretVersionsByName, + request + ); /** - * Attach a Load Balancer to a Private Network. Attach a specified Load - * Balancer to a specified Private Network, defining a static or DHCP - * configuration for the Load Balancer on the network. + * Enable a version. Make a specific version accessible. You must specify the + * `region`, `secret_id` and `revision` parameters. * - * @param request - The request {@link ZonedApiAttachPrivateNetworkRequest} - * @returns A Promise of PrivateNetwork + * @param request - The request {@link EnableSecretVersionRequest} + * @returns A Promise of SecretVersion */ - attachPrivateNetwork = request => this.client.fetch({ - body: JSON.stringify(marshalZonedApiAttachPrivateNetworkRequest(request, this.client.settings)), - headers: jsonContentHeaders$c, - method: 'POST', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}/attach` - }, unmarshalPrivateNetwork$3); - + enableSecretVersion = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/secret-manager/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam("secretId", request.secretId)}/versions/${marshalling.validatePathParam("revision", request.revision)}/enable` + }, + marshalling_gen.unmarshalSecretVersion + ); /** - * Detach Load Balancer from Private Network. Detach a specified Load Balancer - * from a specified Private Network. + * Disable a version. Make a specific version inaccessible. You must specify + * the `region`, `secret_id` and `revision` parameters. * - * @param request - The request {@link ZonedApiDetachPrivateNetworkRequest} + * @param request - The request {@link DisableSecretVersionRequest} + * @returns A Promise of SecretVersion */ - detachPrivateNetwork = request => this.client.fetch({ - body: '{}', - headers: jsonContentHeaders$c, - method: 'POST', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}/detach` - }); -} - -class LbV1UtilsAPI extends API$d { + disableSecretVersion = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/secret-manager/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam("secretId", request.secretId)}/versions/${marshalling.validatePathParam("revision", request.revision)}/disable` + }, + marshalling_gen.unmarshalSecretVersion + ); /** - * Waits for all private networks of a load balancer to be in a final state. + * Access a secret's version using the secret's ID. Access sensitive data in a + * secret's version specified by the `region`, `secret_id` and `revision` + * parameters. * - * @param request - The request {@link WaitForLbPrivateNetworksRequest} - * @param options - The waiting options - * @returns A Promise of ListLbPrivateNetworksResponse + * @param request - The request {@link AccessSecretVersionRequest} + * @returns A Promise of AccessSecretVersionResponse */ - waitForLbPrivateNetworks = (request, options) => tryAtIntervals(async () => { - const value = await this.listLbPrivateNetworks({ - lbId: request.lbId, - region: request.region - }).all().then(list => ({ - privateNetwork: list, - totalCount: list.length - })); - return { - done: value.privateNetwork.find(elt => PRIVATE_NETWORK_TRANSIENT_STATUSES.includes(elt.status)) === undefined, - value - }; - }, createExponentialBackoffStrategy(options?.minDelay ?? 1, options?.maxDelay ?? 30), options?.timeout); - + accessSecretVersion = (request) => this.client.fetch( + { + method: "GET", + path: `/secret-manager/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam("secretId", request.secretId)}/versions/${marshalling.validatePathParam("revision", request.revision)}/access` + }, + marshalling_gen.unmarshalAccessSecretVersionResponse + ); /** - * Waits for all instances of a load balancer to be in a final state. + * Access a secret's version using the secret's name. Access sensitive data in + * a secret's version specified by the `region`, `secret_name`, `revision` and + * `project_id` parameters. * - * @param request - The request {@link GetLbRequest} - * @param options - The waiting options - * @returns A Promise of Lb + * This method is deprecated. + * + * Scaleway recommends that you use the `ListSecrets` request with the `name` + * filter to specify the secret version desired, then use the + * `AccessSecretVersion` request. + * + * @deprecated + * @param request - The request {@link AccessSecretVersionByNameRequest} + * @returns A Promise of AccessSecretVersionResponse */ - waitForLbInstances = (request, options) => tryAtIntervals(async () => { - const value = await this.getLb(request); - return { - done: !LB_TRANSIENT_STATUSES.includes(value.status) && value.instances.find(elt => INSTANCE_TRANSIENT_STATUSES$1.includes(elt.status)) === undefined, - value - }; - }, createExponentialBackoffStrategy(options?.minDelay ?? 1, options?.maxDelay ?? 30), options?.timeout); -} -class LbZonedV1UtilsAPI extends ZonedAPI { + accessSecretVersionByName = (request) => this.client.fetch( + { + method: "GET", + path: `/secret-manager/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets-by-name/${marshalling.validatePathParam("secretName", request.secretName)}/versions/${marshalling.validatePathParam("revision", request.revision)}/access`, + urlParams: marshalling.urlParams(["project_id", request.projectId]) + }, + marshalling_gen.unmarshalAccessSecretVersionResponse + ); /** - * Waits for all private networks of a (zoned) load balancer to be in a final - * state. + * Delete a version. Delete a secret's version and the sensitive data + * contained in it. Deleting a version is permanent and cannot be undone. * - * @param request - The request {@link ZonedWaitForLbPrivateNetworksRequest} - * @param options - The waiting options - * @returns A Promise of ListLbPrivateNetworksResponse + * @param request - The request {@link DestroySecretVersionRequest} + * @returns A Promise of SecretVersion */ - waitForLbPrivateNetworks = (request, options) => tryAtIntervals(async () => { - const value = await this.listLbPrivateNetworks({ - lbId: request.lbId, - zone: request.zone - }).all().then(list => ({ - privateNetwork: list, - totalCount: list.length - })); - return { - done: value.privateNetwork.find(elt => PRIVATE_NETWORK_TRANSIENT_STATUSES.includes(elt.status)) === undefined, - value - }; - }, createExponentialBackoffStrategy(options?.minDelay ?? 1, options?.maxDelay ?? 30), options?.timeout); - + destroySecretVersion = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/secret-manager/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam("secretId", request.secretId)}/versions/${marshalling.validatePathParam("revision", request.revision)}/destroy` + }, + marshalling_gen.unmarshalSecretVersion + ); + pageOfListTags = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/secret-manager/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/tags`, + urlParams: marshalling.urlParams( + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId] + ) + }, + marshalling_gen.unmarshalListTagsResponse + ); /** - * Waits for all instances of a (zoned) load balancer to be in a final state. + * List tags. List all tags associated with secrets within a given Project. * - * @param request - The request {@link GetLbRequest} - * @param options - The waiting options - * @returns A Promise of Lb + * @param request - The request {@link ListTagsRequest} + * @returns A Promise of ListTagsResponse */ - waitForLbInstances = (request, options) => tryAtIntervals(async () => { - const value = await this.getLb(request); - return { - done: !LB_TRANSIENT_STATUSES.includes(value.status) && value.instances.find(elt => INSTANCE_TRANSIENT_STATUSES$1.includes(elt.status)) === undefined, - value - }; - }, createExponentialBackoffStrategy(options?.minDelay ?? 1, options?.maxDelay ?? 30), options?.timeout); + listTags = (request = {}) => resourcePaginator.enrichForPagination("tags", this.pageOfListTags, request); } +exports.API = API; -var index$c = /*#__PURE__*/Object.freeze({ - __proto__: null, - API: LbV1UtilsAPI, - CERTIFICATE_TRANSIENT_STATUSES: CERTIFICATE_TRANSIENT_STATUSES, - INSTANCE_TRANSIENT_STATUSES: INSTANCE_TRANSIENT_STATUSES$1, - LB_TRANSIENT_STATUSES: LB_TRANSIENT_STATUSES, - PRIVATE_NETWORK_TRANSIENT_STATUSES: PRIVATE_NETWORK_TRANSIENT_STATUSES, - ZonedAPI: LbZonedV1UtilsAPI -}); -var index$b = /*#__PURE__*/Object.freeze({ - __proto__: null, - v1: index$c -}); +/***/ }), -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const unmarshalLocalImage$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'LocalImage' failed as data isn't a dictionary.`); - } - return { - arch: data.arch, - compatibleCommercialTypes: data.compatible_commercial_types, - id: data.id, - zone: data.zone - }; -}; -const unmarshalOrganization = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Organization' failed as data isn't a dictionary.`); - } - return { - id: data.id, - name: data.name - }; -}; -const unmarshalVersion$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Version' failed as data isn't a dictionary.`); - } - return { - creationDate: unmarshalDate(data.creation_date), - id: data.id, - localImages: unmarshalArrayOfObject(data.local_images, unmarshalLocalImage$1), - modificationDate: unmarshalDate(data.modification_date), - name: data.name - }; -}; -const unmarshalImage$2 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Image' failed as data isn't a dictionary.`); +/***/ 9147: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api_gen = __nccwpck_require__(4075); +exports.API = api_gen.API; + + +/***/ }), + +/***/ 3929: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const json = __nccwpck_require__(3746); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const unmarshalFolder = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Folder' failed as data isn't a dictionary.` + ); } return { - categories: data.categories, - creationDate: unmarshalDate(data.creation_date), - currentPublicVersion: data.current_public_version, - description: data.description, + createdAt: marshalling.unmarshalDate(data.created_at), id: data.id, - label: data.label, - logo: data.logo, - modificationDate: unmarshalDate(data.modification_date), name: data.name, - organization: data.organization ? unmarshalOrganization(data.organization) : undefined, - validUntil: unmarshalDate(data.valid_until), - versions: unmarshalArrayOfObject(data.versions, unmarshalVersion$1) - }; -}; -const unmarshalGetImageResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'GetImageResponse' failed as data isn't a dictionary.`); - } - return { - image: data.image ? unmarshalImage$2(data.image) : undefined - }; -}; -const unmarshalGetVersionResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'GetVersionResponse' failed as data isn't a dictionary.`); - } - return { - version: data.version ? unmarshalVersion$1(data.version) : undefined + path: data.path, + projectId: data.project_id, + region: data.region }; }; -const unmarshalListImagesResponse$2 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListImagesResponse' failed as data isn't a dictionary.`); +const unmarshalEphemeralProperties = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'EphemeralProperties' failed as data isn't a dictionary.` + ); } return { - images: unmarshalArrayOfObject(data.images, unmarshalImage$2), - totalCount: data.total_count + action: data.action, + expiresAt: marshalling.unmarshalDate(data.expires_at), + expiresOnceAccessed: data.expires_once_accessed }; }; -const unmarshalListVersionsResponse$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListVersionsResponse' failed as data isn't a dictionary.`); +const unmarshalSecretVersion = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SecretVersion' failed as data isn't a dictionary.` + ); } return { - totalCount: data.total_count, - versions: unmarshalArrayOfObject(data.versions, unmarshalVersion$1) + createdAt: marshalling.unmarshalDate(data.created_at), + description: data.description, + ephemeralProperties: data.ephemeral_properties ? unmarshalEphemeralProperties(data.ephemeral_properties) : void 0, + isLatest: data.is_latest, + revision: data.revision, + secretId: data.secret_id, + status: data.status, + updatedAt: marshalling.unmarshalDate(data.updated_at) }; }; - -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -/** Marketplace API. */ -let API$c = class API extends API$u { - pageOfListImages = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/marketplace/v1/images`, - urlParams: urlParams(['page', request.page], ['per_page', request.perPage ?? this.client.settings.defaultPageSize]) - }, unmarshalListImagesResponse$2); - - /** - * List marketplace images. - * - * @param request - The request {@link ListImagesRequest} - * @returns A Promise of ListImagesResponse - */ - listImages = (request = {}) => enrichForPagination('images', this.pageOfListImages, request); - - /** - * Get a specific marketplace image. - * - * @param request - The request {@link GetImageRequest} - * @returns A Promise of GetImageResponse - */ - getImage = request => this.client.fetch({ - method: 'GET', - path: `/marketplace/v1/images/${validatePathParam('imageId', request.imageId)}` - }, unmarshalGetImageResponse); - listVersions = request => this.client.fetch({ - method: 'GET', - path: `/marketplace/v1/images/${validatePathParam('imageId', request.imageId)}/versions` - }, unmarshalListVersionsResponse$1); - getVersion = request => this.client.fetch({ - method: 'GET', - path: `/marketplace/v1/images/${validatePathParam('imageId', request.imageId)}/versions/${validatePathParam('versionId', request.versionId)}` - }, unmarshalGetVersionResponse); -}; - -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. - -var index_gen$d = /*#__PURE__*/Object.freeze({ - __proto__: null, - API: API$c -}); - -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const unmarshalCategory = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Category' failed as data isn't a dictionary.`); +const unmarshalEphemeralPolicy = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'EphemeralPolicy' failed as data isn't a dictionary.` + ); } return { - description: data.description, - id: data.id, - name: data.name + action: data.action, + expiresOnceAccessed: data.expires_once_accessed, + timeToLive: data.time_to_live }; }; -const unmarshalImage$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Image' failed as data isn't a dictionary.`); +const unmarshalSecret = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Secret' failed as data isn't a dictionary.` + ); } return { - categories: data.categories, - createdAt: unmarshalDate(data.created_at), + createdAt: marshalling.unmarshalDate(data.created_at), description: data.description, + ephemeralPolicy: data.ephemeral_policy ? unmarshalEphemeralPolicy(data.ephemeral_policy) : void 0, id: data.id, - label: data.label, - logo: data.logo, + isManaged: data.is_managed, + isProtected: data.is_protected, name: data.name, - updatedAt: unmarshalDate(data.updated_at), - validUntil: unmarshalDate(data.valid_until) - }; -}; -const unmarshalLocalImage = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'LocalImage' failed as data isn't a dictionary.`); - } - return { - arch: data.arch, - compatibleCommercialTypes: data.compatible_commercial_types, - id: data.id, - label: data.label, + path: data.path, + projectId: data.project_id, + region: data.region, + status: data.status, + tags: data.tags, type: data.type, - zone: data.zone + updatedAt: marshalling.unmarshalDate(data.updated_at), + versionCount: data.version_count }; }; -const unmarshalVersion = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Version' failed as data isn't a dictionary.`); +const unmarshalAccessSecretVersionResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'AccessSecretVersionResponse' failed as data isn't a dictionary.` + ); } return { - createdAt: unmarshalDate(data.created_at), - id: data.id, - name: data.name, - publishedAt: unmarshalDate(data.published_at), - updatedAt: unmarshalDate(data.updated_at) + data: data.data, + dataCrc32: data.data_crc32, + revision: data.revision, + secretId: data.secret_id }; }; -const unmarshalListCategoriesResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListCategoriesResponse' failed as data isn't a dictionary.`); +const unmarshalListFoldersResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListFoldersResponse' failed as data isn't a dictionary.` + ); } return { - categories: unmarshalArrayOfObject(data.categories, unmarshalCategory), + folders: marshalling.unmarshalArrayOfObject(data.folders, unmarshalFolder), totalCount: data.total_count }; }; -const unmarshalListImagesResponse$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListImagesResponse' failed as data isn't a dictionary.`); +const unmarshalListSecretVersionsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListSecretVersionsResponse' failed as data isn't a dictionary.` + ); } return { - images: unmarshalArrayOfObject(data.images, unmarshalImage$1), - totalCount: data.total_count + totalCount: data.total_count, + versions: marshalling.unmarshalArrayOfObject(data.versions, unmarshalSecretVersion) }; }; -const unmarshalListLocalImagesResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListLocalImagesResponse' failed as data isn't a dictionary.`); +const unmarshalListSecretsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListSecretsResponse' failed as data isn't a dictionary.` + ); } return { - localImages: unmarshalArrayOfObject(data.local_images, unmarshalLocalImage), + secrets: marshalling.unmarshalArrayOfObject(data.secrets, unmarshalSecret), totalCount: data.total_count }; }; -const unmarshalListVersionsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListVersionsResponse' failed as data isn't a dictionary.`); +const unmarshalListTagsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListTagsResponse' failed as data isn't a dictionary.` + ); } return { - totalCount: data.total_count, - versions: unmarshalArrayOfObject(data.versions, unmarshalVersion) + tags: data.tags, + totalCount: data.total_count }; }; +const marshalAddSecretOwnerRequest = (request, defaults) => ({ + product: request.product, + product_name: request.productName +}); +const marshalCreateFolderRequest = (request, defaults) => ({ + name: request.name, + path: request.path, + project_id: request.projectId ?? defaults.defaultProjectId +}); +const marshalEphemeralPolicy = (request, defaults) => ({ + action: request.action, + expires_once_accessed: request.expiresOnceAccessed, + time_to_live: request.timeToLive +}); +const marshalCreateSecretRequest = (request, defaults) => ({ + description: request.description, + ephemeral_policy: request.ephemeralPolicy !== void 0 ? marshalEphemeralPolicy(request.ephemeralPolicy) : void 0, + is_protected: request.isProtected, + name: request.name, + path: request.path, + project_id: request.projectId ?? defaults.defaultProjectId, + tags: request.tags, + type: request.type +}); +const marshalPasswordGenerationParams = (request, defaults) => ({ + additional_chars: request.additionalChars, + length: request.length, + no_digits: request.noDigits, + no_lowercase_letters: request.noLowercaseLetters, + no_uppercase_letters: request.noUppercaseLetters +}); +const marshalCreateSecretVersionRequest = (request, defaults) => ({ + data: request.data, + data_crc32: request.dataCrc32, + description: request.description, + disable_previous: request.disablePrevious, + password_generation: request.passwordGeneration !== void 0 ? marshalPasswordGenerationParams(request.passwordGeneration) : void 0 +}); +const marshalGeneratePasswordRequest = (request, defaults) => ({ + additional_chars: request.additionalChars, + description: request.description, + disable_previous: request.disablePrevious, + length: request.length, + no_digits: request.noDigits, + no_lowercase_letters: request.noLowercaseLetters, + no_uppercase_letters: request.noUppercaseLetters +}); +const marshalUpdateSecretRequest = (request, defaults) => ({ + description: request.description, + ephemeral_policy: request.ephemeralPolicy !== void 0 ? marshalEphemeralPolicy(request.ephemeralPolicy) : void 0, + name: request.name, + path: request.path, + tags: request.tags +}); +const marshalEphemeralProperties = (request, defaults) => ({ + action: request.action, + expires_at: request.expiresAt, + expires_once_accessed: request.expiresOnceAccessed +}); +const marshalUpdateSecretVersionRequest = (request, defaults) => ({ + description: request.description, + ephemeral_properties: request.ephemeralProperties !== void 0 ? marshalEphemeralProperties(request.ephemeralProperties) : void 0 +}); +exports.marshalAddSecretOwnerRequest = marshalAddSecretOwnerRequest; +exports.marshalCreateFolderRequest = marshalCreateFolderRequest; +exports.marshalCreateSecretRequest = marshalCreateSecretRequest; +exports.marshalCreateSecretVersionRequest = marshalCreateSecretVersionRequest; +exports.marshalEphemeralPolicy = marshalEphemeralPolicy; +exports.marshalGeneratePasswordRequest = marshalGeneratePasswordRequest; +exports.marshalUpdateSecretRequest = marshalUpdateSecretRequest; +exports.marshalUpdateSecretVersionRequest = marshalUpdateSecretVersionRequest; +exports.unmarshalAccessSecretVersionResponse = unmarshalAccessSecretVersionResponse; +exports.unmarshalEphemeralPolicy = unmarshalEphemeralPolicy; +exports.unmarshalFolder = unmarshalFolder; +exports.unmarshalListFoldersResponse = unmarshalListFoldersResponse; +exports.unmarshalListSecretVersionsResponse = unmarshalListSecretVersionsResponse; +exports.unmarshalListSecretsResponse = unmarshalListSecretsResponse; +exports.unmarshalListTagsResponse = unmarshalListTagsResponse; +exports.unmarshalSecret = unmarshalSecret; +exports.unmarshalSecretVersion = unmarshalSecretVersion; + + +/***/ }), + +/***/ 5591: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -/** Marketplace API. */ -let API$b = class API extends API$u { - pageOfListImages = request => this.client.fetch({ - method: 'GET', - path: `/marketplace/v2/images`, - urlParams: urlParams(['arch', request.arch], ['category', request.category], ['include_eol', request.includeEol], ['order_by', request.orderBy ?? 'name_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]) - }, unmarshalListImagesResponse$1); +"use strict"; +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api = __nccwpck_require__(3042); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const resourcePaginator = __nccwpck_require__(4983); +const marshalling_gen = __nccwpck_require__(7117); +const jsonContentHeaders = { + "Content-Type": "application/json; charset=utf-8" +}; +class API extends api.API { + /** Lists the available regions of the API. */ + static LOCALITIES = ["fr-par", "nl-ams", "pl-waw"]; + /** + * Create a secret. Create a secret in a given region specified by the + * `region` parameter. + * + * @param request - The request {@link CreateSecretRequest} + * @returns A Promise of Secret + */ + createSecret = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateSecretRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/secret-manager/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets` + }, + marshalling_gen.unmarshalSecret + ); + /** + * Get metadata using the secret's ID. Retrieve the metadata of a secret + * specified by the `region` and `secret_id` parameters. + * + * @param request - The request {@link GetSecretRequest} + * @returns A Promise of Secret + */ + getSecret = (request) => this.client.fetch( + { + method: "GET", + path: `/secret-manager/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam("secretId", request.secretId)}` + }, + marshalling_gen.unmarshalSecret + ); + /** + * Update metadata of a secret. Edit a secret's metadata such as name, tag(s), + * description and ephemeral policy. The secret to update is specified by the + * `secret_id` and `region` parameters. + * + * @param request - The request {@link UpdateSecretRequest} + * @returns A Promise of Secret + */ + updateSecret = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateSecretRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/secret-manager/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam("secretId", request.secretId)}` + }, + marshalling_gen.unmarshalSecret + ); + /** + * Delete a secret. Delete a given secret specified by the `region` and + * `secret_id` parameters. + * + * @param request - The request {@link DeleteSecretRequest} + */ + deleteSecret = (request) => this.client.fetch({ + method: "DELETE", + path: `/secret-manager/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam("secretId", request.secretId)}` + }); + pageOfListSecrets = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/secret-manager/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets`, + urlParams: marshalling.urlParams( + ["ephemeral", request.ephemeral], + ["name", request.name], + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["path", request.path], + ["project_id", request.projectId], + ["tags", request.tags], + ["type", request.type] + ) + }, + marshalling_gen.unmarshalListSecretsResponse + ); + /** + * List secrets. Retrieve the list of secrets created within an Organization + * and/or Project. You must specify either the `organization_id` or the + * `project_id` and the `region`. + * + * @param request - The request {@link ListSecretsRequest} + * @returns A Promise of ListSecretsResponse + */ + listSecrets = (request = {}) => resourcePaginator.enrichForPagination("secrets", this.pageOfListSecrets, request); + /** + * Browse secrets. Retrieve the list of secrets and folders for the given + * prefix. You must specify either the `organization_id` or the `project_id` + * and the `region`. + * + * @param request - The request {@link BrowseSecretsRequest} + * @returns A Promise of BrowseSecretsResponse + */ + browseSecrets = (request) => this.client.fetch( + { + method: "GET", + path: `/secret-manager/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/browse`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["prefix", request.prefix], + ["project_id", request.projectId], + ["tags", request.tags], + ["type", request.type] + ) + }, + marshalling_gen.unmarshalBrowseSecretsResponse + ); + /** + * Enable secret protection. Enable secret protection for a given secret + * specified by the `secret_id` parameter. Enabling secret protection means + * that your secret can be read and modified, but it cannot be deleted. + * + * @param request - The request {@link ProtectSecretRequest} + * @returns A Promise of Secret + */ + protectSecret = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/secret-manager/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam("secretId", request.secretId)}/protect` + }, + marshalling_gen.unmarshalSecret + ); + /** + * Disable secret protection. Disable secret protection for a given secret + * specified by the `secret_id` parameter. Disabling secret protection means + * that your secret can be read, modified and deleted. + * + * @param request - The request {@link UnprotectSecretRequest} + * @returns A Promise of Secret + */ + unprotectSecret = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/secret-manager/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam("secretId", request.secretId)}/unprotect` + }, + marshalling_gen.unmarshalSecret + ); + /** + * Allow a product to use the secret. + * + * @param request - The request {@link AddSecretOwnerRequest} + */ + addSecretOwner = (request) => this.client.fetch({ + body: JSON.stringify( + marshalling_gen.marshalAddSecretOwnerRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/secret-manager/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam("secretId", request.secretId)}/add-owner` + }); + /** + * Create a version. Create a version of a given secret specified by the + * `region` and `secret_id` parameters. + * + * @param request - The request {@link CreateSecretVersionRequest} + * @returns A Promise of SecretVersion + */ + createSecretVersion = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateSecretVersionRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/secret-manager/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam("secretId", request.secretId)}/versions` + }, + marshalling_gen.unmarshalSecretVersion + ); /** - * List marketplace images. List all available images on the marketplace, - * their UUID, CPU architecture and description. + * Get metadata of a secret's version using the secret's ID. Retrieve the + * metadata of a secret's given version specified by the `region`, `secret_id` + * and `revision` parameters. * - * @param request - The request {@link ListImagesRequest} - * @returns A Promise of ListImagesResponse + * @param request - The request {@link GetSecretVersionRequest} + * @returns A Promise of SecretVersion */ - listImages = request => enrichForPagination('images', this.pageOfListImages, request); - + getSecretVersion = (request) => this.client.fetch( + { + method: "GET", + path: `/secret-manager/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam("secretId", request.secretId)}/versions/${marshalling.validatePathParam("revision", request.revision)}` + }, + marshalling_gen.unmarshalSecretVersion + ); /** - * Get a specific marketplace image. Get detailed information about a - * marketplace image, specified by its `image_id` (UUID format). + * Update metadata of a version. Edit the metadata of a secret's given + * version, specified by the `region`, `secret_id` and `revision` parameters. * - * @param request - The request {@link GetImageRequest} - * @returns A Promise of Image + * @param request - The request {@link UpdateSecretVersionRequest} + * @returns A Promise of SecretVersion */ - getImage = request => this.client.fetch({ - method: 'GET', - path: `/marketplace/v2/images/${validatePathParam('imageId', request.imageId)}` - }, unmarshalImage$1); - pageOfListVersions = request => this.client.fetch({ - method: 'GET', - path: `/marketplace/v2/versions`, - urlParams: urlParams(['image_id', request.imageId], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]) - }, unmarshalListVersionsResponse); - + updateSecretVersion = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateSecretVersionRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/secret-manager/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam("secretId", request.secretId)}/versions/${marshalling.validatePathParam("revision", request.revision)}` + }, + marshalling_gen.unmarshalSecretVersion + ); /** - * List versions of an Image. Get a list of all available version of an image, - * specified by its `image_id` (UUID format). + * Delete a version. Delete a secret's version and the sensitive data + * contained in it. Deleting a version is permanent and cannot be undone. * - * @param request - The request {@link ListVersionsRequest} - * @returns A Promise of ListVersionsResponse + * @param request - The request {@link DeleteSecretVersionRequest} */ - listVersions = request => enrichForPagination('versions', this.pageOfListVersions, request); - + deleteSecretVersion = (request) => this.client.fetch({ + method: "DELETE", + path: `/secret-manager/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam("secretId", request.secretId)}/versions/${marshalling.validatePathParam("revision", request.revision)}` + }); + pageOfListSecretVersions = (request) => this.client.fetch( + { + method: "GET", + path: `/secret-manager/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam("secretId", request.secretId)}/versions`, + urlParams: marshalling.urlParams( + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["status", request.status] + ) + }, + marshalling_gen.unmarshalListSecretVersionsResponse + ); /** - * Get a specific image version. Get information such as the name, creation - * date, last update and published date for an image version specified by its - * `version_id` (UUID format). + * List versions of a secret using the secret's ID. Retrieve the list of a + * given secret's versions specified by the `secret_id` and `region` + * parameters. * - * @param request - The request {@link GetVersionRequest} - * @returns A Promise of Version + * @param request - The request {@link ListSecretVersionsRequest} + * @returns A Promise of ListSecretVersionsResponse */ - getVersion = request => this.client.fetch({ - method: 'GET', - path: `/marketplace/v2/versions/${validatePathParam('versionId', request.versionId)}` - }, unmarshalVersion); - pageOfListLocalImages = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/marketplace/v2/local-images`, - urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['type', request.type ?? 'unknown_type'], ['zone', request.zone ?? this.client.settings.defaultZone], ...Object.entries(resolveOneOf([{ - param: 'image_id', - value: request.imageId - }, { - param: 'version_id', - value: request.versionId - }, { - param: 'image_label', - value: request.imageLabel - }]))) - }, unmarshalListLocalImagesResponse); - + listSecretVersions = (request) => resourcePaginator.enrichForPagination("versions", this.pageOfListSecretVersions, request); /** - * List local images from a specific image or version. List information about - * local images in a specific Availability Zone, specified by its `image_id` - * (UUID format), `version_id` (UUID format) or `image_label`. Only one of - * these three parameters may be set. + * Access a secret's version using the secret's ID. Access sensitive data in a + * secret's version specified by the `region`, `secret_id` and `revision` + * parameters. * - * @param request - The request {@link ListLocalImagesRequest} - * @returns A Promise of ListLocalImagesResponse + * @param request - The request {@link AccessSecretVersionRequest} + * @returns A Promise of AccessSecretVersionResponse */ - listLocalImages = (request = {}) => enrichForPagination('localImages', this.pageOfListLocalImages, request); - + accessSecretVersion = (request) => this.client.fetch( + { + method: "GET", + path: `/secret-manager/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam("secretId", request.secretId)}/versions/${marshalling.validatePathParam("revision", request.revision)}/access` + }, + marshalling_gen.unmarshalAccessSecretVersionResponse + ); /** - * Get a specific local image by ID. Get detailed information about a local - * image, including compatible commercial types, supported architecture, - * labels and the Availability Zone of the image, specified by its - * `local_image_id` (UUID format). + * Access a secret's version using the secret's name and path. Access + * sensitive data in a secret's version specified by the `region`, + * `secret_name`, `secret_path` and `revision` parameters. * - * @param request - The request {@link GetLocalImageRequest} - * @returns A Promise of LocalImage + * @param request - The request {@link AccessSecretVersionByPathRequest} + * @returns A Promise of AccessSecretVersionResponse */ - getLocalImage = request => this.client.fetch({ - method: 'GET', - path: `/marketplace/v2/local-images/${validatePathParam('localImageId', request.localImageId)}` - }, unmarshalLocalImage); - pageOfListCategories = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/marketplace/v2/categories`, - urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]) - }, unmarshalListCategoriesResponse); - + accessSecretVersionByPath = (request) => this.client.fetch( + { + method: "GET", + path: `/secret-manager/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets-by-path/versions/${marshalling.validatePathParam("revision", request.revision)}/access`, + urlParams: marshalling.urlParams( + [ + "project_id", + request.projectId ?? this.client.settings.defaultProjectId + ], + ["secret_name", request.secretName], + ["secret_path", request.secretPath] + ) + }, + marshalling_gen.unmarshalAccessSecretVersionResponse + ); /** - * List existing image categories. Get a list of all existing categories. The - * output can be paginated. + * Enable a version. Make a specific version accessible. You must specify the + * `region`, `secret_id` and `revision` parameters. * - * @param request - The request {@link ListCategoriesRequest} - * @returns A Promise of ListCategoriesResponse + * @param request - The request {@link EnableSecretVersionRequest} + * @returns A Promise of SecretVersion */ - listCategories = (request = {}) => enrichForPagination('categories', this.pageOfListCategories, request); - + enableSecretVersion = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/secret-manager/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam("secretId", request.secretId)}/versions/${marshalling.validatePathParam("revision", request.revision)}/enable` + }, + marshalling_gen.unmarshalSecretVersion + ); /** - * Get a specific category. Get information about a specific category of the - * marketplace catalog, specified by its `category_id` (UUID format). + * Disable a version. Make a specific version inaccessible. You must specify + * the `region`, `secret_id` and `revision` parameters. * - * @param request - The request {@link GetCategoryRequest} - * @returns A Promise of Category + * @param request - The request {@link DisableSecretVersionRequest} + * @returns A Promise of SecretVersion */ - getCategory = request => this.client.fetch({ - method: 'GET', - path: `/marketplace/v2/categories/${validatePathParam('categoryId', request.categoryId)}` - }, unmarshalCategory); -}; + disableSecretVersion = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/secret-manager/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam("secretId", request.secretId)}/versions/${marshalling.validatePathParam("revision", request.revision)}/disable` + }, + marshalling_gen.unmarshalSecretVersion + ); + pageOfListTags = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/secret-manager/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/tags`, + urlParams: marshalling.urlParams( + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + [ + "project_id", + request.projectId ?? this.client.settings.defaultProjectId + ] + ) + }, + marshalling_gen.unmarshalListTagsResponse + ); + /** + * List tags. List all tags associated with secrets within a given Project. + * + * @param request - The request {@link ListTagsRequest} + * @returns A Promise of ListTagsResponse + */ + listTags = (request = {}) => resourcePaginator.enrichForPagination("tags", this.pageOfListTags, request); + pageOfListSecretTypes = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/secret-manager/v1beta1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/secret-types`, + urlParams: marshalling.urlParams( + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + [ + "project_id", + request.projectId ?? this.client.settings.defaultProjectId + ] + ) + }, + marshalling_gen.unmarshalListSecretTypesResponse + ); + /** + * List secret types. List all secret types created within a given Project. + * + * @param request - The request {@link ListSecretTypesRequest} + * @returns A Promise of ListSecretTypesResponse + */ + listSecretTypes = (request = {}) => resourcePaginator.enrichForPagination("types", this.pageOfListSecretTypes, request); +} +exports.API = API; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -var index_gen$c = /*#__PURE__*/Object.freeze({ - __proto__: null, - API: API$b -}); +/***/ }), -var index$a = /*#__PURE__*/Object.freeze({ - __proto__: null, - v1: index_gen$d, - v2: index_gen$c -}); +/***/ 6095: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api_gen = __nccwpck_require__(5591); +const validationRules_gen = __nccwpck_require__(3706); +exports.API = api_gen.API; +exports.ValidationRules = validationRules_gen; + + +/***/ }), + +/***/ 7117: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const unmarshalPermissions = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Permissions' failed as data isn't a dictionary.`); +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const json = __nccwpck_require__(3746); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const unmarshalEphemeralProperties = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'EphemeralProperties' failed as data isn't a dictionary.` + ); } return { - canManage: data.can_manage, - canPublish: data.can_publish, - canReceive: data.can_receive + action: data.action, + expiresAt: marshalling.unmarshalDate(data.expires_at), + expiresOnceAccessed: data.expires_once_accessed }; }; -const unmarshalCredentialSummarySQSSNSCreds = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'CredentialSummarySQSSNSCreds' failed as data isn't a dictionary.`); +const unmarshalSecretVersion = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SecretVersion' failed as data isn't a dictionary.` + ); } return { - accessKey: data.access_key, - permissions: data.permissions ? unmarshalPermissions(data.permissions) : undefined + createdAt: marshalling.unmarshalDate(data.created_at), + description: data.description, + ephemeralProperties: data.ephemeral_properties ? unmarshalEphemeralProperties(data.ephemeral_properties) : void 0, + latest: data.latest, + revision: data.revision, + secretId: data.secret_id, + status: data.status, + updatedAt: marshalling.unmarshalDate(data.updated_at) }; }; -const unmarshalCredentialNATSCredsFile = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'CredentialNATSCredsFile' failed as data isn't a dictionary.`); +const unmarshalEphemeralPolicy = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'EphemeralPolicy' failed as data isn't a dictionary.` + ); } return { - content: data.content + action: data.action, + expiresOnceAccessed: data.expires_once_accessed, + timeToLive: data.time_to_live }; }; -const unmarshalCredentialSQSSNSCreds = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'CredentialSQSSNSCreds' failed as data isn't a dictionary.`); +const unmarshalSecret = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Secret' failed as data isn't a dictionary.` + ); } return { - accessKey: data.access_key, - permissions: data.permissions ? unmarshalPermissions(data.permissions) : undefined, - secretKey: data.secret_key + createdAt: marshalling.unmarshalDate(data.created_at), + description: data.description, + ephemeralPolicy: data.ephemeral_policy ? unmarshalEphemeralPolicy(data.ephemeral_policy) : void 0, + id: data.id, + managed: data.managed, + name: data.name, + path: data.path, + projectId: data.project_id, + protected: data.protected, + region: data.region, + status: data.status, + tags: data.tags, + type: data.type, + updatedAt: marshalling.unmarshalDate(data.updated_at), + usedBy: data.used_by, + versionCount: data.version_count }; }; -const unmarshalCredentialSummary = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'CredentialSummary' failed as data isn't a dictionary.`); +const unmarshalAccessSecretVersionResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'AccessSecretVersionResponse' failed as data isn't a dictionary.` + ); } return { - id: data.id, - name: data.name, - namespaceId: data.namespace_id, - protocol: data.protocol, - sqsSnsCredentials: data.sqs_sns_credentials ? unmarshalCredentialSummarySQSSNSCreds(data.sqs_sns_credentials) : undefined + data: data.data, + dataCrc32: data.data_crc32, + revision: data.revision, + secretId: data.secret_id, + type: data.type }; }; -const unmarshalNamespace$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Namespace' failed as data isn't a dictionary.`); +const unmarshalBrowseSecretsResponseItemFolderDetails = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'BrowseSecretsResponseItemFolderDetails' failed as data isn't a dictionary.` + ); + } + return {}; +}; +const unmarshalBrowseSecretsResponseItemSecretDetails = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'BrowseSecretsResponseItemSecretDetails' failed as data isn't a dictionary.` + ); } return { - createdAt: unmarshalDate(data.created_at), - endpoint: data.endpoint, + ephemeralPolicy: data.ephemeral_policy ? unmarshalEphemeralPolicy(data.ephemeral_policy) : void 0, id: data.id, - name: data.name, - projectId: data.project_id, - protocol: data.protocol, - region: data.region, - updatedAt: unmarshalDate(data.updated_at) + protected: data.protected, + tags: data.tags, + type: data.type, + versionCount: data.version_count }; }; -const unmarshalCredential = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Credential' failed as data isn't a dictionary.`); +const unmarshalBrowseSecretsResponseItem = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'BrowseSecretsResponseItem' failed as data isn't a dictionary.` + ); } return { - id: data.id, + createdAt: marshalling.unmarshalDate(data.created_at), + folder: data.folder ? unmarshalBrowseSecretsResponseItemFolderDetails(data.folder) : void 0, name: data.name, - namespaceId: data.namespace_id, - natsCredentials: data.nats_credentials ? unmarshalCredentialNATSCredsFile(data.nats_credentials) : undefined, - protocol: data.protocol, - sqsSnsCredentials: data.sqs_sns_credentials ? unmarshalCredentialSQSSNSCreds(data.sqs_sns_credentials) : undefined + secret: data.secret ? unmarshalBrowseSecretsResponseItemSecretDetails(data.secret) : void 0, + updatedAt: marshalling.unmarshalDate(data.updated_at) }; }; -const unmarshalListCredentialsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListCredentialsResponse' failed as data isn't a dictionary.`); +const unmarshalBrowseSecretsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'BrowseSecretsResponse' failed as data isn't a dictionary.` + ); } return { - credentials: unmarshalArrayOfObject(data.credentials, unmarshalCredentialSummary), + currentPath: data.current_path, + items: marshalling.unmarshalArrayOfObject( + data.items, + unmarshalBrowseSecretsResponseItem + ), totalCount: data.total_count }; }; -const unmarshalListNamespacesResponse$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListNamespacesResponse' failed as data isn't a dictionary.`); +const unmarshalListSecretTypesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListSecretTypesResponse' failed as data isn't a dictionary.` + ); + } + return { + totalCount: data.total_count, + types: data.types + }; +}; +const unmarshalListSecretVersionsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListSecretVersionsResponse' failed as data isn't a dictionary.` + ); } return { - namespaces: unmarshalArrayOfObject(data.namespaces, unmarshalNamespace$1), + totalCount: data.total_count, + versions: marshalling.unmarshalArrayOfObject(data.versions, unmarshalSecretVersion) + }; +}; +const unmarshalListSecretsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListSecretsResponse' failed as data isn't a dictionary.` + ); + } + return { + secrets: marshalling.unmarshalArrayOfObject(data.secrets, unmarshalSecret), totalCount: data.total_count }; }; -const marshalPermissions = (request, defaults) => ({ - can_manage: request.canManage, - can_publish: request.canPublish, - can_receive: request.canReceive +const unmarshalListTagsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListTagsResponse' failed as data isn't a dictionary.` + ); + } + return { + tags: data.tags, + totalCount: data.total_count + }; +}; +const marshalAddSecretOwnerRequest = (request, defaults) => ({ + product: request.product }); -const marshalCreateCredentialRequest = (request, defaults) => ({ - name: request.name || randomName('mnq'), - namespace_id: request.namespaceId, - permissions: request.permissions ? marshalPermissions(request.permissions) : undefined +const marshalEphemeralPolicy = (request, defaults) => ({ + action: request.action, + expires_once_accessed: request.expiresOnceAccessed, + time_to_live: request.timeToLive }); -const marshalCreateNamespaceRequest$1 = (request, defaults) => ({ - name: request.name || randomName('mnq'), +const marshalCreateSecretRequest = (request, defaults) => ({ + description: request.description, + ephemeral_policy: request.ephemeralPolicy !== void 0 ? marshalEphemeralPolicy(request.ephemeralPolicy) : void 0, + name: request.name, + path: request.path, project_id: request.projectId ?? defaults.defaultProjectId, - protocol: request.protocol + protected: request.protected, + tags: request.tags, + type: request.type }); -const marshalUpdateCredentialRequest = (request, defaults) => ({ - name: request.name, - permissions: request.permissions ? marshalPermissions(request.permissions) : undefined +const marshalCreateSecretVersionRequest = (request, defaults) => ({ + data: request.data, + data_crc32: request.dataCrc32, + description: request.description, + disable_previous: request.disablePrevious }); -const marshalUpdateNamespaceRequest$1 = (request, defaults) => ({ +const marshalUpdateSecretRequest = (request, defaults) => ({ + description: request.description, + ephemeral_policy: request.ephemeralPolicy !== void 0 ? marshalEphemeralPolicy(request.ephemeralPolicy) : void 0, name: request.name, - namespace_id: request.namespaceId + path: request.path, + tags: request.tags +}); +const marshalEphemeralProperties = (request, defaults) => ({ + action: request.action, + expires_at: request.expiresAt, + expires_once_accessed: request.expiresOnceAccessed }); +const marshalUpdateSecretVersionRequest = (request, defaults) => ({ + description: request.description, + ephemeral_properties: request.ephemeralProperties !== void 0 ? marshalEphemeralProperties(request.ephemeralProperties) : void 0 +}); +exports.marshalAddSecretOwnerRequest = marshalAddSecretOwnerRequest; +exports.marshalCreateSecretRequest = marshalCreateSecretRequest; +exports.marshalCreateSecretVersionRequest = marshalCreateSecretVersionRequest; +exports.marshalUpdateSecretRequest = marshalUpdateSecretRequest; +exports.marshalUpdateSecretVersionRequest = marshalUpdateSecretVersionRequest; +exports.unmarshalAccessSecretVersionResponse = unmarshalAccessSecretVersionResponse; +exports.unmarshalBrowseSecretsResponse = unmarshalBrowseSecretsResponse; +exports.unmarshalListSecretTypesResponse = unmarshalListSecretTypesResponse; +exports.unmarshalListSecretVersionsResponse = unmarshalListSecretVersionsResponse; +exports.unmarshalListSecretsResponse = unmarshalListSecretsResponse; +exports.unmarshalListTagsResponse = unmarshalListTagsResponse; +exports.unmarshalSecret = unmarshalSecret; +exports.unmarshalSecretVersion = unmarshalSecretVersion; + -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const jsonContentHeaders$b = { - 'Content-Type': 'application/json; charset=utf-8' +/***/ }), + +/***/ 3706: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const DatabaseCredentials = { + port: { + pattern: /^[0-9]+$/ + } }; +exports.DatabaseCredentials = DatabaseCredentials; -/** - * Messaging and Queuing API. - * - * This API allows you to manage Scaleway Messaging and Queueing brokers. - * Messaging and Queuing API. - */ -let API$a = class API extends API$u { - /** Lists the available regions of the API. */ - static LOCALITIES = ['fr-par']; - pageOfListNamespaces = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/mnq/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces`, - urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId]) - }, unmarshalListNamespacesResponse$1); +/***/ }), + +/***/ 5377: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const index_gen = __nccwpck_require__(6428); +exports.v1alpha1 = index_gen; + + +/***/ }), + +/***/ 5056: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const intervalRetrier = __nccwpck_require__(9052); +const api = __nccwpck_require__(3042); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const resourcePaginator = __nccwpck_require__(4983); +const content_gen = __nccwpck_require__(3203); +const marshalling_gen = __nccwpck_require__(3386); +const jsonContentHeaders = { + "Content-Type": "application/json; charset=utf-8" +}; +class API extends api.API { + /** Lists the available regions of the API. */ + static LOCALITIES = ["fr-par"]; /** - * List namespaces. List all Messaging and Queuing namespaces in the specified - * region, for a Scaleway Organization or Project. By default, the namespaces - * returned in the list are ordered by creation date in ascending order, - * though this can be modified via the `order_by` field. + * Create a new Serverless SQL Database. You must provide the following + * parameters: `organization_id`, `project_id`, `name`, `cpu_min`, `cpu_max`. + * You can also provide `from_backup_id` to create a database from a backup. * - * @param request - The request {@link ListNamespacesRequest} - * @returns A Promise of ListNamespacesResponse + * @param request - The request {@link CreateDatabaseRequest} + * @returns A Promise of Database */ - listNamespaces = (request = {}) => enrichForPagination('namespaces', this.pageOfListNamespaces, request); - + createDatabase = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateDatabaseRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/serverless-sqldb/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/databases` + }, + marshalling_gen.unmarshalDatabase + ); /** - * Create a namespace. Create a Messaging and Queuing namespace, set to the - * desired protocol. + * Get a database information. Retrieve information about your Serverless SQL + * Database. You must provide the `database_id` parameter. * - * @param request - The request {@link CreateNamespaceRequest} - * @returns A Promise of Namespace + * @param request - The request {@link GetDatabaseRequest} + * @returns A Promise of Database */ - createNamespace = request => this.client.fetch({ - body: JSON.stringify(marshalCreateNamespaceRequest$1(request, this.client.settings)), - headers: jsonContentHeaders$b, - method: 'POST', - path: `/mnq/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces` - }, unmarshalNamespace$1); - + getDatabase = (request) => this.client.fetch( + { + method: "GET", + path: `/serverless-sqldb/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/databases/${marshalling.validatePathParam("databaseId", request.databaseId)}` + }, + marshalling_gen.unmarshalDatabase + ); /** - * Update the name of a namespace. Update the name of a Messaging and Queuing - * namespace, specified by its namespace ID. + * Waits for {@link Database} to be in a final state. * - * @param request - The request {@link UpdateNamespaceRequest} - * @returns A Promise of Namespace + * @param request - The request {@link GetDatabaseRequest} + * @param options - The waiting options + * @returns A Promise of Database */ - updateNamespace = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateNamespaceRequest$1(request, this.client.settings)), - headers: jsonContentHeaders$b, - method: 'PATCH', - path: `/mnq/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces` - }, unmarshalNamespace$1); - + waitForDatabase = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve(!content_gen.DATABASE_TRANSIENT_STATUSES.includes(res.status))), + this.getDatabase, + request, + options + ); /** - * Get a namespace. Retrieve information about an existing Messaging and - * Queuing namespace, identified by its namespace ID. Its full details, - * including name, endpoint and protocol, are returned in the response. + * Delete a database. Deletes a database. You must provide the `database_id` + * parameter. All data stored in the database will be permanently deleted. * - * @param request - The request {@link GetNamespaceRequest} - * @returns A Promise of Namespace + * @param request - The request {@link DeleteDatabaseRequest} + * @returns A Promise of Database */ - getNamespace = request => this.client.fetch({ - method: 'GET', - path: `/mnq/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam('namespaceId', request.namespaceId)}` - }, unmarshalNamespace$1); - + deleteDatabase = (request) => this.client.fetch( + { + method: "DELETE", + path: `/serverless-sqldb/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/databases/${marshalling.validatePathParam("databaseId", request.databaseId)}` + }, + marshalling_gen.unmarshalDatabase + ); + pageOfListDatabases = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/serverless-sqldb/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/databases`, + urlParams: marshalling.urlParams( + ["name", request.name], + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + ["page_size", request.pageSize], + [ + "project_id", + request.projectId ?? this.client.settings.defaultProjectId + ] + ) + }, + marshalling_gen.unmarshalListDatabasesResponse + ); /** - * Delete a namespace. Delete a Messaging and Queuing namespace, specified by - * its namespace ID. Note that deleting a namespace is irreversible, and any - * URLs, credentials and queued messages belonging to this namespace will also - * be deleted. + * List your Serverless SQL Databases. List all Serverless SQL Databases for a + * given Scaleway Organization or Scaleway Project. By default, the databases + * returned in the list are ordered by creation date in ascending order, + * though this can be modified via the order_by field. For the `name` + * parameter, the value you include will be checked against the whole name + * string to see if it includes the string you put in the parameter. * - * @param request - The request {@link DeleteNamespaceRequest} + * @param request - The request {@link ListDatabasesRequest} + * @returns A Promise of ListDatabasesResponse */ - deleteNamespace = request => this.client.fetch({ - method: 'DELETE', - path: `/mnq/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam('namespaceId', request.namespaceId)}` - }); - + listDatabases = (request = {}) => resourcePaginator.enrichForPagination("databases", this.pageOfListDatabases, request); /** - * Create credentials. Create a set of credentials for a Messaging and Queuing - * namespace, specified by its namespace ID. If creating credentials for a - * NATS namespace, the `permissions` object must not be included in the - * request. If creating credentials for an SQS/SNS namespace, the - * `permissions` object is required, with all three of its child attributes. + * Update database information. Update CPU limits of your Serverless SQL + * Database. You must provide the `database_id` parameter. * - * @param request - The request {@link CreateCredentialRequest} - * @returns A Promise of Credential + * @param request - The request {@link UpdateDatabaseRequest} + * @returns A Promise of Database */ - createCredential = request => this.client.fetch({ - body: JSON.stringify(marshalCreateCredentialRequest(request, this.client.settings)), - headers: jsonContentHeaders$b, - method: 'POST', - path: `/mnq/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/credentials` - }, unmarshalCredential); - + updateDatabase = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateDatabaseRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/serverless-sqldb/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/databases/${marshalling.validatePathParam("databaseId", request.databaseId)}` + }, + marshalling_gen.unmarshalDatabase + ); /** - * Delete credentials. Delete a set of credentials, specified by their - * credential ID. Deleting credentials is irreversible and cannot be undone. - * The credentials can no longer be used to access the namespace. + * Restore a database from a backup. Restore a database from a backup. You + * must provide the `backup_id` parameter. * - * @param request - The request {@link DeleteCredentialRequest} + * @param request - The request {@link RestoreDatabaseFromBackupRequest} + * @returns A Promise of Database */ - deleteCredential = request => this.client.fetch({ - method: 'DELETE', - path: `/mnq/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/credentials/${validatePathParam('credentialId', request.credentialId)}` - }); - pageOfListCredentials = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/mnq/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/credentials`, - urlParams: urlParams(['namespace_id', request.namespaceId], ['order_by', request.orderBy ?? 'id_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]) - }, unmarshalListCredentialsResponse); - + restoreDatabaseFromBackup = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalRestoreDatabaseFromBackupRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/serverless-sqldb/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/databases/${marshalling.validatePathParam("databaseId", request.databaseId)}/restore` + }, + marshalling_gen.unmarshalDatabase + ); /** - * List credentials. List existing credentials in the specified region. The - * response contains only the metadata for the credentials, not the - * credentials themselves (for this, use **Get Credentials**). + * Get a database backup information. Retrieve information about your + * Serverless SQL Database backup. You must provide the `backup_id` + * parameter. * - * @param request - The request {@link ListCredentialsRequest} - * @returns A Promise of ListCredentialsResponse + * @param request - The request {@link GetDatabaseBackupRequest} + * @returns A Promise of DatabaseBackup */ - listCredentials = (request = {}) => enrichForPagination('credentials', this.pageOfListCredentials, request); - + getDatabaseBackup = (request) => this.client.fetch( + { + method: "GET", + path: `/serverless-sqldb/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/backups/${marshalling.validatePathParam("backupId", request.backupId)}` + }, + marshalling_gen.unmarshalDatabaseBackup + ); + pageOfListDatabaseBackups = (request) => this.client.fetch( + { + method: "GET", + path: `/serverless-sqldb/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/backups`, + urlParams: marshalling.urlParams( + ["database_id", request.databaseId], + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + ["page_size", request.pageSize], + ["project_id", request.projectId] + ) + }, + marshalling_gen.unmarshalListDatabaseBackupsResponse + ); /** - * Update credentials. Update a set of credentials. You can update the - * credentials' name, or (in the case of SQS/SNS credentials only) their - * permissions. To update the name of NATS credentials, do not include the - * `permissions` object in your request. + * List your Serverless SQL Database backups. List all Serverless SQL Database + * backups for a given Scaleway Project or Database. By default, the backups + * returned in the list are ordered by creation date in descending order, + * though this can be modified via the order_by field. * - * @param request - The request {@link UpdateCredentialRequest} - * @returns A Promise of Credential + * @param request - The request {@link ListDatabaseBackupsRequest} + * @returns A Promise of ListDatabaseBackupsResponse */ - updateCredential = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateCredentialRequest(request, this.client.settings)), - headers: jsonContentHeaders$b, - method: 'PATCH', - path: `/mnq/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/credentials/${validatePathParam('credentialId', request.credentialId)}` - }, unmarshalCredential); - + listDatabaseBackups = (request) => resourcePaginator.enrichForPagination("backups", this.pageOfListDatabaseBackups, request); /** - * Get credentials. Retrieve an existing set of credentials, identified by the - * `credential_id`. The credentials themselves, as well as their metadata - * (protocol, namespace ID etc), are returned in the response. + * Export a database backup. Export a database backup providing a download + * link once the export process is completed. You must provide the `backup_id` + * parameter. * - * @param request - The request {@link GetCredentialRequest} - * @returns A Promise of Credential + * @param request - The request {@link ExportDatabaseBackupRequest} + * @returns A Promise of DatabaseBackup */ - getCredential = request => this.client.fetch({ - method: 'GET', - path: `/mnq/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/credentials/${validatePathParam('credentialId', request.credentialId)}` - }, unmarshalCredential); -}; + exportDatabaseBackup = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/serverless-sqldb/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/backups/${marshalling.validatePathParam("backupId", request.backupId)}/export` + }, + marshalling_gen.unmarshalDatabaseBackup + ); +} +exports.API = API; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -var index_gen$b = /*#__PURE__*/Object.freeze({ - __proto__: null, - API: API$a -}); +/***/ }), -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const unmarshalFile = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'File' failed as data isn't a dictionary.`); - } - return { - content: data.content, - name: data.name - }; -}; -const unmarshalSnsPermissions = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'SnsPermissions' failed as data isn't a dictionary.`); - } - return { - canManage: data.can_manage, - canPublish: data.can_publish, - canReceive: data.can_receive - }; -}; -const unmarshalSqsPermissions = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'SqsPermissions' failed as data isn't a dictionary.`); - } - return { - canManage: data.can_manage, - canPublish: data.can_publish, - canReceive: data.can_receive - }; -}; -const unmarshalNatsAccount = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'NatsAccount' failed as data isn't a dictionary.`); - } - return { - createdAt: unmarshalDate(data.created_at), - endpoint: data.endpoint, - id: data.id, - name: data.name, - projectId: data.project_id, - region: data.region, - updatedAt: unmarshalDate(data.updated_at) - }; -}; -const unmarshalNatsCredentials = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'NatsCredentials' failed as data isn't a dictionary.`); - } - return { - checksum: data.checksum, - createdAt: unmarshalDate(data.created_at), - credentials: data.credentials ? unmarshalFile(data.credentials) : undefined, - id: data.id, - name: data.name, - natsAccountId: data.nats_account_id, - updatedAt: unmarshalDate(data.updated_at) - }; -}; -const unmarshalSnsCredentials = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'SnsCredentials' failed as data isn't a dictionary.`); +/***/ 3203: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const DATABASE_TRANSIENT_STATUSES = [ + "creating", + "deleting", + "restoring" +]; +exports.DATABASE_TRANSIENT_STATUSES = DATABASE_TRANSIENT_STATUSES; + + +/***/ }), + +/***/ 6428: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api_gen = __nccwpck_require__(5056); +const content_gen = __nccwpck_require__(3203); +const validationRules_gen = __nccwpck_require__(2427); +exports.API = api_gen.API; +exports.DATABASE_TRANSIENT_STATUSES = content_gen.DATABASE_TRANSIENT_STATUSES; +exports.ValidationRules = validationRules_gen; + + +/***/ }), + +/***/ 3386: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const json = __nccwpck_require__(3746); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const unmarshalDatabaseBackup = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DatabaseBackup' failed as data isn't a dictionary.` + ); } return { - accessKey: data.access_key, - createdAt: unmarshalDate(data.created_at), + createdAt: marshalling.unmarshalDate(data.created_at), + databaseId: data.database_id, + dbSize: data.db_size, + downloadUrl: data.download_url, + downloadUrlExpiresAt: marshalling.unmarshalDate(data.download_url_expires_at), + expiresAt: marshalling.unmarshalDate(data.expires_at), id: data.id, - name: data.name, - permissions: data.permissions ? unmarshalSnsPermissions(data.permissions) : undefined, + organizationId: data.organization_id, projectId: data.project_id, region: data.region, - secretChecksum: data.secret_checksum, - secretKey: data.secret_key, - updatedAt: unmarshalDate(data.updated_at) + size: data.size, + status: data.status }; }; -const unmarshalSqsCredentials = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'SqsCredentials' failed as data isn't a dictionary.`); +const unmarshalDatabase = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Database' failed as data isn't a dictionary.` + ); } return { - accessKey: data.access_key, - createdAt: unmarshalDate(data.created_at), + cpuCurrent: data.cpu_current, + cpuMax: data.cpu_max, + cpuMin: data.cpu_min, + createdAt: marshalling.unmarshalDate(data.created_at), + endpoint: data.endpoint, + engineMajorVersion: data.engine_major_version, id: data.id, name: data.name, - permissions: data.permissions ? unmarshalSqsPermissions(data.permissions) : undefined, + organizationId: data.organization_id, projectId: data.project_id, region: data.region, - secretChecksum: data.secret_checksum, - secretKey: data.secret_key, - updatedAt: unmarshalDate(data.updated_at) + started: data.started, + status: data.status }; }; -const unmarshalListNatsAccountsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListNatsAccountsResponse' failed as data isn't a dictionary.`); +const unmarshalListDatabaseBackupsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListDatabaseBackupsResponse' failed as data isn't a dictionary.` + ); } return { - natsAccounts: unmarshalArrayOfObject(data.nats_accounts, unmarshalNatsAccount), + backups: marshalling.unmarshalArrayOfObject(data.backups, unmarshalDatabaseBackup), totalCount: data.total_count }; }; -const unmarshalListNatsCredentialsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListNatsCredentialsResponse' failed as data isn't a dictionary.`); +const unmarshalListDatabasesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListDatabasesResponse' failed as data isn't a dictionary.` + ); } return { - natsCredentials: unmarshalArrayOfObject(data.nats_credentials, unmarshalNatsCredentials), + databases: marshalling.unmarshalArrayOfObject(data.databases, unmarshalDatabase), totalCount: data.total_count }; }; -const unmarshalListSnsCredentialsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListSnsCredentialsResponse' failed as data isn't a dictionary.`); +const marshalCreateDatabaseRequest = (request, defaults) => ({ + cpu_max: request.cpuMax, + cpu_min: request.cpuMin, + from_backup_id: request.fromBackupId, + name: request.name, + project_id: request.projectId ?? defaults.defaultProjectId +}); +const marshalRestoreDatabaseFromBackupRequest = (request, defaults) => ({ + backup_id: request.backupId +}); +const marshalUpdateDatabaseRequest = (request, defaults) => ({ + cpu_max: request.cpuMax, + cpu_min: request.cpuMin +}); +exports.marshalCreateDatabaseRequest = marshalCreateDatabaseRequest; +exports.marshalRestoreDatabaseFromBackupRequest = marshalRestoreDatabaseFromBackupRequest; +exports.marshalUpdateDatabaseRequest = marshalUpdateDatabaseRequest; +exports.unmarshalDatabase = unmarshalDatabase; +exports.unmarshalDatabaseBackup = unmarshalDatabaseBackup; +exports.unmarshalListDatabaseBackupsResponse = unmarshalListDatabaseBackupsResponse; +exports.unmarshalListDatabasesResponse = unmarshalListDatabasesResponse; + + +/***/ }), + +/***/ 2427: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const CreateDatabaseRequest = { + cpuMax: { + greaterThanOrEqual: 1, + lessThanOrEqual: 15 + }, + cpuMin: { + lessThanOrEqual: 15 + }, + fromBackupId: { + ignoreEmpty: true + }, + name: { + maxLength: 63, + minLength: 1 } - return { - snsCredentials: unmarshalArrayOfObject(data.sns_credentials, unmarshalSnsCredentials), - totalCount: data.total_count - }; }; -const unmarshalListSqsCredentialsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListSqsCredentialsResponse' failed as data isn't a dictionary.`); +const Database = { + cpuCurrent: { + lessThanOrEqual: 15 + }, + cpuMax: { + greaterThanOrEqual: 1, + lessThanOrEqual: 15 + }, + cpuMin: { + lessThanOrEqual: 15 } - return { - sqsCredentials: unmarshalArrayOfObject(data.sqs_credentials, unmarshalSqsCredentials), - totalCount: data.total_count - }; }; -const unmarshalSnsInfo = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'SnsInfo' failed as data isn't a dictionary.`); +const ListDatabaseBackupsRequest = { + page: { + greaterThanOrEqual: 1 + }, + pageSize: { + greaterThanOrEqual: 1, + lessThanOrEqual: 1e3 } - return { - createdAt: unmarshalDate(data.created_at), - projectId: data.project_id, - region: data.region, - snsEndpointUrl: data.sns_endpoint_url, - status: data.status, - updatedAt: unmarshalDate(data.updated_at) - }; }; -const unmarshalSqsInfo = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'SqsInfo' failed as data isn't a dictionary.`); +const ListDatabasesRequest = { + page: { + greaterThanOrEqual: 1 + }, + pageSize: { + greaterThanOrEqual: 1, + lessThanOrEqual: 1e3 } - return { - createdAt: unmarshalDate(data.created_at), - projectId: data.project_id, - region: data.region, - sqsEndpointUrl: data.sqs_endpoint_url, - status: data.status, - updatedAt: unmarshalDate(data.updated_at) - }; }; -const marshalSnsPermissions = (request, defaults) => ({ - can_manage: request.canManage, - can_publish: request.canPublish, - can_receive: request.canReceive -}); -const marshalSqsPermissions = (request, defaults) => ({ - can_manage: request.canManage, - can_publish: request.canPublish, - can_receive: request.canReceive -}); -const marshalNatsApiCreateNatsAccountRequest = (request, defaults) => ({ - name: request.name || randomName('mnq'), - project_id: request.projectId ?? defaults.defaultProjectId -}); -const marshalNatsApiCreateNatsCredentialsRequest = (request, defaults) => ({ - name: request.name || randomName('mnq'), - nats_account_id: request.natsAccountId -}); -const marshalNatsApiUpdateNatsAccountRequest = (request, defaults) => ({ - name: request.name -}); -const marshalSnsApiActivateSnsRequest = (request, defaults) => ({ - project_id: request.projectId ?? defaults.defaultProjectId -}); -const marshalSnsApiCreateSnsCredentialsRequest = (request, defaults) => ({ - name: request.name || randomName('mnq_sns'), - permissions: request.permissions ? marshalSnsPermissions(request.permissions) : undefined, - project_id: request.projectId ?? defaults.defaultProjectId -}); -const marshalSnsApiDeactivateSnsRequest = (request, defaults) => ({ - project_id: request.projectId ?? defaults.defaultProjectId -}); -const marshalSnsApiUpdateSnsCredentialsRequest = (request, defaults) => ({ - name: request.name, - permissions: request.permissions ? marshalSnsPermissions(request.permissions) : undefined -}); -const marshalSqsApiActivateSqsRequest = (request, defaults) => ({ - project_id: request.projectId ?? defaults.defaultProjectId -}); -const marshalSqsApiCreateSqsCredentialsRequest = (request, defaults) => ({ - name: request.name || randomName('mnq_sqs'), - permissions: request.permissions ? marshalSqsPermissions(request.permissions) : undefined, - project_id: request.projectId ?? defaults.defaultProjectId -}); -const marshalSqsApiDeactivateSqsRequest = (request, defaults) => ({ - project_id: request.projectId ?? defaults.defaultProjectId -}); -const marshalSqsApiUpdateSqsCredentialsRequest = (request, defaults) => ({ - name: request.name, - permissions: request.permissions ? marshalSqsPermissions(request.permissions) : undefined -}); - -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const jsonContentHeaders$a = { - 'Content-Type': 'application/json; charset=utf-8' +const UpdateDatabaseRequest = { + cpuMax: { + greaterThanOrEqual: 1, + lessThanOrEqual: 15 + }, + cpuMin: { + lessThanOrEqual: 15 + } }; +exports.CreateDatabaseRequest = CreateDatabaseRequest; +exports.Database = Database; +exports.ListDatabaseBackupsRequest = ListDatabaseBackupsRequest; +exports.ListDatabasesRequest = ListDatabasesRequest; +exports.UpdateDatabaseRequest = UpdateDatabaseRequest; -/** - * Messaging and Queuing NATS API. - * - * This API allows you to manage Scaleway Messaging and Queueing NATS accounts. - * Messaging and Queuing NATS API. - */ -class NatsAPI extends API$u { - /** Lists the available regions of the API. */ - static LOCALITIES = ['fr-par']; - - /** - * Create a NATS account. Create a NATS account associated with a Project. - * - * @param request - The request {@link NatsApiCreateNatsAccountRequest} - * @returns A Promise of NatsAccount - */ - createNatsAccount = (request = {}) => this.client.fetch({ - body: JSON.stringify(marshalNatsApiCreateNatsAccountRequest(request, this.client.settings)), - headers: jsonContentHeaders$a, - method: 'POST', - path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/nats-accounts` - }, unmarshalNatsAccount); - /** - * Delete a NATS account. Delete a NATS account, specified by its NATS account - * ID. Note that deleting a NATS account is irreversible, and any credentials, - * streams, consumer and stored messages belonging to this NATS account will - * also be deleted. - * - * @param request - The request {@link NatsApiDeleteNatsAccountRequest} - */ - deleteNatsAccount = request => this.client.fetch({ - method: 'DELETE', - path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/nats-accounts/${validatePathParam('natsAccountId', request.natsAccountId)}` - }); +/***/ }), - /** - * Update the name of a NATS account. Update the name of a NATS account, - * specified by its NATS account ID. - * - * @param request - The request {@link NatsApiUpdateNatsAccountRequest} - * @returns A Promise of NatsAccount - */ - updateNatsAccount = request => this.client.fetch({ - body: JSON.stringify(marshalNatsApiUpdateNatsAccountRequest(request, this.client.settings)), - headers: jsonContentHeaders$a, - method: 'PATCH', - path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/nats-accounts/${validatePathParam('natsAccountId', request.natsAccountId)}` - }, unmarshalNatsAccount); +/***/ 7597: +/***/ (() => { - /** - * Get a NATS account. Retrieve information about an existing NATS account - * identified by its NATS account ID. Its full details, including name and - * endpoint, are returned in the response. - * - * @param request - The request {@link NatsApiGetNatsAccountRequest} - * @returns A Promise of NatsAccount - */ - getNatsAccount = request => this.client.fetch({ - method: 'GET', - path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/nats-accounts/${validatePathParam('natsAccountId', request.natsAccountId)}` - }, unmarshalNatsAccount); - pageOfListNatsAccounts = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/nats-accounts`, - urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId]) - }, unmarshalListNatsAccountsResponse); +"use strict"; - /** - * List NATS accounts. List all NATS accounts in the specified region, for a - * Scaleway Organization or Project. By default, the NATS accounts returned in - * the list are ordered by creation date in ascending order, though this can - * be modified via the `order_by` field. - * - * @param request - The request {@link NatsApiListNatsAccountsRequest} - * @returns A Promise of ListNatsAccountsResponse - */ - listNatsAccounts = (request = {}) => enrichForPagination('natsAccounts', this.pageOfListNatsAccounts, request); - /** - * Create NATS credentials. Create a set of credentials for a NATS account, - * specified by its NATS account ID. - * - * @param request - The request {@link NatsApiCreateNatsCredentialsRequest} - * @returns A Promise of NatsCredentials - */ - createNatsCredentials = request => this.client.fetch({ - body: JSON.stringify(marshalNatsApiCreateNatsCredentialsRequest(request, this.client.settings)), - headers: jsonContentHeaders$a, - method: 'POST', - path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/nats-credentials` - }, unmarshalNatsCredentials); - /** - * Delete NATS credentials. Delete a set of credentials, specified by their - * credentials ID. Deleting credentials is irreversible and cannot be undone. - * The credentials can no longer be used to access the NATS account, and - * active connections using this credentials will be closed. - * - * @param request - The request {@link NatsApiDeleteNatsCredentialsRequest} - */ - deleteNatsCredentials = request => this.client.fetch({ - method: 'DELETE', - path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/nats-credentials/${validatePathParam('natsCredentialsId', request.natsCredentialsId)}` - }); +/***/ }), - /** - * Get NATS credentials. Retrieve an existing set of credentials, identified - * by the `nats_credentials_id`. The credentials themselves are NOT returned, - * only their metadata (NATS account ID, credentials name, etc), are returned - * in the response. - * - * @param request - The request {@link NatsApiGetNatsCredentialsRequest} - * @returns A Promise of NatsCredentials - */ - getNatsCredentials = request => this.client.fetch({ - method: 'GET', - path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/nats-credentials/${validatePathParam('natsCredentialsId', request.natsCredentialsId)}` - }, unmarshalNatsCredentials); - pageOfListNatsCredentials = request => this.client.fetch({ - method: 'GET', - path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/nats-credentials`, - urlParams: urlParams(['nats_account_id', request.natsAccountId], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]) - }, unmarshalListNatsCredentialsResponse); +/***/ 9136: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - /** - * List NATS credentials. List existing credentials in the specified NATS - * account. The response contains only the metadata for the credentials, not - * the credentials themselves, which are only returned after a **Create - * Credentials** call. - * - * @param request - The request {@link NatsApiListNatsCredentialsRequest} - * @returns A Promise of ListNatsCredentialsResponse - */ - listNatsCredentials = request => enrichForPagination('natsCredentials', this.pageOfListNatsCredentials, request); -} +"use strict"; -/** - * Messaging and Queuing SNS API. - * - * This API allows you to manage Scaleway Messaging and Queueing SNS brokers. - * Messaging and Queuing SNS API. - */ -class SnsAPI extends API$u { - /** Lists the available regions of the API. */ - static LOCALITIES = ['fr-par']; +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const index_gen = __nccwpck_require__(4951); +exports.v1alpha1 = index_gen; - /** - * Activate SNS. Activate SNS for the specified Project ID. SNS must be - * activated before any usage. Activating SNS does not trigger any billing, - * and you can deactivate at any time. - * - * @param request - The request {@link SnsApiActivateSnsRequest} - * @returns A Promise of SnsInfo - */ - activateSns = (request = {}) => this.client.fetch({ - body: JSON.stringify(marshalSnsApiActivateSnsRequest(request, this.client.settings)), - headers: jsonContentHeaders$a, - method: 'POST', - path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/activate-sns` - }, unmarshalSnsInfo); - /** - * Get SNS info. Retrieve the SNS information of the specified Project ID. - * Informations include the activation status and the SNS API endpoint URL. - * - * @param request - The request {@link SnsApiGetSnsInfoRequest} - * @returns A Promise of SnsInfo - */ - getSnsInfo = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/sns-info`, - urlParams: urlParams(['project_id', request.projectId ?? this.client.settings.defaultProjectId]) - }, unmarshalSnsInfo); +/***/ }), + +/***/ 1999: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const intervalRetrier = __nccwpck_require__(9052); +const api = __nccwpck_require__(3042); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const resourcePaginator = __nccwpck_require__(4983); +const content_gen = __nccwpck_require__(2916); +const marshalling_gen = __nccwpck_require__(1269); +const jsonContentHeaders = { + "Content-Type": "application/json; charset=utf-8" +}; +class API extends api.API { + /** Lists the available regions of the API. */ + static LOCALITIES = ["fr-par"]; /** - * Deactivate SNS. Deactivate SNS for the specified Project ID.You must delete - * all topics and credentials before this call or you need to set the - * force_delete parameter. + * Send an email. You must specify the `region`, the sender and the + * recipient's information and the `project_id` to send an email from a + * checked domain. The subject of the email must contain at least 6 + * characters. * - * @param request - The request {@link SnsApiDeactivateSnsRequest} - * @returns A Promise of SnsInfo + * @param request - The request {@link CreateEmailRequest} + * @returns A Promise of CreateEmailResponse */ - deactivateSns = (request = {}) => this.client.fetch({ - body: JSON.stringify(marshalSnsApiDeactivateSnsRequest(request, this.client.settings)), - headers: jsonContentHeaders$a, - method: 'POST', - path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/deactivate-sns` - }, unmarshalSnsInfo); - + createEmail = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateEmailRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/transactional-email/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/emails` + }, + marshalling_gen.unmarshalCreateEmailResponse + ); /** - * Create SNS credentials. Create a set of credentials for SNS, specified by a - * Project ID. Credentials give the bearer access to topics, and the level of - * permissions can be defined granularly. + * Get an email. Retrieve information about a specific email using the + * `email_id` and `region` parameters. * - * @param request - The request {@link SnsApiCreateSnsCredentialsRequest} - * @returns A Promise of SnsCredentials + * @param request - The request {@link GetEmailRequest} + * @returns A Promise of Email */ - createSnsCredentials = (request = {}) => this.client.fetch({ - body: JSON.stringify(marshalSnsApiCreateSnsCredentialsRequest(request, this.client.settings)), - headers: jsonContentHeaders$a, - method: 'POST', - path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/sns-credentials` - }, unmarshalSnsCredentials); - + getEmail = (request) => this.client.fetch( + { + method: "GET", + path: `/transactional-email/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/emails/${marshalling.validatePathParam("emailId", request.emailId)}` + }, + marshalling_gen.unmarshalEmail + ); /** - * Delete SNS credentials. Delete a set of SNS credentials, specified by their - * credentials ID. Deleting credentials is irreversible and cannot be undone. - * The credentials can then no longer be used to access SNS. + * Waits for {@link Email} to be in a final state. * - * @param request - The request {@link SnsApiDeleteSnsCredentialsRequest} + * @param request - The request {@link GetEmailRequest} + * @param options - The waiting options + * @returns A Promise of Email */ - deleteSnsCredentials = request => this.client.fetch({ - method: 'DELETE', - path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/sns-credentials/${validatePathParam('snsCredentialsId', request.snsCredentialsId)}` - }); - + waitForEmail = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve(!content_gen.EMAIL_TRANSIENT_STATUSES.includes(res.status))), + this.getEmail, + request, + options + ); + pageOfListEmails = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/transactional-email/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/emails`, + urlParams: marshalling.urlParams( + ["domain_id", request.domainId], + ["flags", request.flags], + ["mail_from", request.mailFrom], + ["mail_rcpt", request.mailRcpt], + ["mail_to", request.mailTo], + ["message_id", request.messageId], + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId], + ["search", request.search], + ["since", request.since], + ["statuses", request.statuses], + ["subject", request.subject], + ["until", request.until] + ) + }, + marshalling_gen.unmarshalListEmailsResponse + ); /** - * Update SNS credentials. Update a set of SNS credentials. You can update the - * credentials' name, or their permissions. + * List emails. Retrieve the list of emails sent from a specific domain or for + * a specific Project or Organization. You must specify the `region`. * - * @param request - The request {@link SnsApiUpdateSnsCredentialsRequest} - * @returns A Promise of SnsCredentials + * @param request - The request {@link ListEmailsRequest} + * @returns A Promise of ListEmailsResponse */ - updateSnsCredentials = request => this.client.fetch({ - body: JSON.stringify(marshalSnsApiUpdateSnsCredentialsRequest(request, this.client.settings)), - headers: jsonContentHeaders$a, - method: 'PATCH', - path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/sns-credentials/${validatePathParam('snsCredentialsId', request.snsCredentialsId)}` - }, unmarshalSnsCredentials); - + listEmails = (request = {}) => resourcePaginator.enrichForPagination("emails", this.pageOfListEmails, request); /** - * Get SNS credentials. Retrieve an existing set of credentials, identified by - * the `credentials_id`. The credentials themselves, as well as their metadata - * (name, project ID etc), are returned in the response. + * Email statuses. Get information on your emails' statuses. * - * @param request - The request {@link SnsApiGetSnsCredentialsRequest} - * @returns A Promise of SnsCredentials + * @param request - The request {@link GetStatisticsRequest} + * @returns A Promise of Statistics */ - getSnsCredentials = request => this.client.fetch({ - method: 'GET', - path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/sns-credentials/${validatePathParam('snsCredentialsId', request.snsCredentialsId)}` - }, unmarshalSnsCredentials); - pageOfListSnsCredentials = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/sns-credentials`, - urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId]) - }, unmarshalListSnsCredentialsResponse); - + getStatistics = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/transactional-email/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/statistics`, + urlParams: marshalling.urlParams( + ["domain_id", request.domainId], + ["mail_from", request.mailFrom], + ["project_id", request.projectId], + ["since", request.since], + ["until", request.until] + ) + }, + marshalling_gen.unmarshalStatistics + ); /** - * List SNS credentials. List existing SNS credentials in the specified - * region. The response contains only the metadata for the credentials, not - * the credentials themselves. + * Cancel an email. You can cancel the sending of an email if it has not been + * sent yet. You must specify the `region` and the `email_id` of the email you + * want to cancel. * - * @param request - The request {@link SnsApiListSnsCredentialsRequest} - * @returns A Promise of ListSnsCredentialsResponse + * @param request - The request {@link CancelEmailRequest} + * @returns A Promise of Email */ - listSnsCredentials = (request = {}) => enrichForPagination('snsCredentials', this.pageOfListSnsCredentials, request); -} - -/** - * Messaging and Queuing SQS API. - * - * This API allows you to manage Scaleway Messaging and Queueing SQS brokers. - * Messaging and Queuing SQS API. - */ -class SqsAPI extends API$u { - /** Lists the available regions of the API. */ - static LOCALITIES = ['fr-par']; - + cancelEmail = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/transactional-email/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/emails/${marshalling.validatePathParam("emailId", request.emailId)}/cancel` + }, + marshalling_gen.unmarshalEmail + ); /** - * Activate SQS. Activate SQS for the specified Project ID. SQS must be - * activated before any usage such as creating credentials and queues. - * Activating SQS does not trigger any billing, and you can deactivate at any - * time. + * Register a domain in a project. You must specify the `region`, `project_id` + * and `domain_name` to register a domain in a specific Project. * - * @param request - The request {@link SqsApiActivateSqsRequest} - * @returns A Promise of SqsInfo + * @param request - The request {@link CreateDomainRequest} + * @returns A Promise of Domain */ - activateSqs = (request = {}) => this.client.fetch({ - body: JSON.stringify(marshalSqsApiActivateSqsRequest(request, this.client.settings)), - headers: jsonContentHeaders$a, - method: 'POST', - path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/activate-sqs` - }, unmarshalSqsInfo); - + createDomain = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateDomainRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/transactional-email/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains` + }, + marshalling_gen.unmarshalDomain + ); /** - * Get SQS info. Retrieve the SQS information of the specified Project ID. - * Informations include the activation status and the SQS API endpoint URL. + * Get information about a domain. Retrieve information about a specific + * domain using the `region` and `domain_id` parameters. Monitor your domain's + * reputation and improve **average** and **bad** reputation statuses, using + * your domain's **Email activity** tab on the [Scaleway + * console](https://console.scaleway.com/transactional-email/domains) to get a + * more detailed report. Check out our [dedicated + * documentation](https://www.scaleway.com/en/docs/managed-services/transactional-email/reference-content/understanding-tem-reputation-score/) + * to improve your domain's reputation. * - * @param request - The request {@link SqsApiGetSqsInfoRequest} - * @returns A Promise of SqsInfo + * @param request - The request {@link GetDomainRequest} + * @returns A Promise of Domain */ - getSqsInfo = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/sqs-info`, - urlParams: urlParams(['project_id', request.projectId ?? this.client.settings.defaultProjectId]) - }, unmarshalSqsInfo); - + getDomain = (request) => this.client.fetch( + { + method: "GET", + path: `/transactional-email/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${marshalling.validatePathParam("domainId", request.domainId)}` + }, + marshalling_gen.unmarshalDomain + ); /** - * Deactivate SQS. Deactivate SQS for the specified Project ID. You must - * delete all queues and credentials before this call or you need to set the - * force_delete parameter. + * Waits for {@link Domain} to be in a final state. * - * @param request - The request {@link SqsApiDeactivateSqsRequest} - * @returns A Promise of SqsInfo + * @param request - The request {@link GetDomainRequest} + * @param options - The waiting options + * @returns A Promise of Domain */ - deactivateSqs = (request = {}) => this.client.fetch({ - body: JSON.stringify(marshalSqsApiDeactivateSqsRequest(request, this.client.settings)), - headers: jsonContentHeaders$a, - method: 'POST', - path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/deactivate-sqs` - }, unmarshalSqsInfo); - + waitForDomain = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve(!content_gen.DOMAIN_TRANSIENT_STATUSES.includes(res.status))), + this.getDomain, + request, + options + ); + pageOfListDomains = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/transactional-email/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains`, + urlParams: marshalling.urlParams( + ["name", request.name], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId], + ["status", request.status] + ) + }, + marshalling_gen.unmarshalListDomainsResponse + ); /** - * Create SQS credentials. Create a set of credentials for SQS, specified by a - * Project ID. Credentials give the bearer access to queues, and the level of - * permissions can be defined granularly. + * List domains. Retrieve domains in a specific Project or in a specific + * Organization using the `region` parameter. * - * @param request - The request {@link SqsApiCreateSqsCredentialsRequest} - * @returns A Promise of SqsCredentials + * @param request - The request {@link ListDomainsRequest} + * @returns A Promise of ListDomainsResponse */ - createSqsCredentials = (request = {}) => this.client.fetch({ - body: JSON.stringify(marshalSqsApiCreateSqsCredentialsRequest(request, this.client.settings)), - headers: jsonContentHeaders$a, - method: 'POST', - path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/sqs-credentials` - }, unmarshalSqsCredentials); - + listDomains = (request = {}) => resourcePaginator.enrichForPagination("domains", this.pageOfListDomains, request); /** - * Delete SQS credentials. Delete a set of SQS credentials, specified by their - * credentials ID. Deleting credentials is irreversible and cannot be undone. - * The credentials can then no longer be used to access SQS. + * Delete a domain. You must specify the domain you want to delete by the + * `region` and `domain_id`. Deleting a domain is permanent and cannot be + * undone. * - * @param request - The request {@link SqsApiDeleteSqsCredentialsRequest} + * @param request - The request {@link RevokeDomainRequest} + * @returns A Promise of Domain */ - deleteSqsCredentials = request => this.client.fetch({ - method: 'DELETE', - path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/sqs-credentials/${validatePathParam('sqsCredentialsId', request.sqsCredentialsId)}` - }); - + revokeDomain = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/transactional-email/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${marshalling.validatePathParam("domainId", request.domainId)}/revoke` + }, + marshalling_gen.unmarshalDomain + ); /** - * Update SQS credentials. Update a set of SQS credentials. You can update the - * credentials' name, or their permissions. + * Domain DNS check. Perform an immediate DNS check of a domain using the + * `region` and `domain_id` parameters. * - * @param request - The request {@link SqsApiUpdateSqsCredentialsRequest} - * @returns A Promise of SqsCredentials + * @param request - The request {@link CheckDomainRequest} + * @returns A Promise of Domain */ - updateSqsCredentials = request => this.client.fetch({ - body: JSON.stringify(marshalSqsApiUpdateSqsCredentialsRequest(request, this.client.settings)), - headers: jsonContentHeaders$a, - method: 'PATCH', - path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/sqs-credentials/${validatePathParam('sqsCredentialsId', request.sqsCredentialsId)}` - }, unmarshalSqsCredentials); - + checkDomain = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/transactional-email/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${marshalling.validatePathParam("domainId", request.domainId)}/check` + }, + marshalling_gen.unmarshalDomain + ); /** - * Get SQS credentials. Retrieve an existing set of credentials, identified by - * the `credentials_id`. The credentials themselves, as well as their metadata - * (name, project ID etc), are returned in the response. + * Display SPF and DKIM records status and potential errors. Display SPF and + * DKIM records status and potential errors, including the found records to + * make debugging easier. * - * @param request - The request {@link SqsApiGetSqsCredentialsRequest} - * @returns A Promise of SqsCredentials + * @param request - The request {@link GetDomainLastStatusRequest} + * @returns A Promise of DomainLastStatus */ - getSqsCredentials = request => this.client.fetch({ - method: 'GET', - path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/sqs-credentials/${validatePathParam('sqsCredentialsId', request.sqsCredentialsId)}` - }, unmarshalSqsCredentials); - pageOfListSqsCredentials = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/sqs-credentials`, - urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId]) - }, unmarshalListSqsCredentialsResponse); - + getDomainLastStatus = (request) => this.client.fetch( + { + method: "GET", + path: `/transactional-email/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${marshalling.validatePathParam("domainId", request.domainId)}/verification` + }, + marshalling_gen.unmarshalDomainLastStatus + ); /** - * List SQS credentials. List existing SQS credentials in the specified - * region. The response contains only the metadata for the credentials, not - * the credentials themselves. + * Update a domain. Update a domain auto-configuration. * - * @param request - The request {@link SqsApiListSqsCredentialsRequest} - * @returns A Promise of ListSqsCredentialsResponse - */ - listSqsCredentials = (request = {}) => enrichForPagination('sqsCredentials', this.pageOfListSqsCredentials, request); -} - -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. - -const NatsApiCreateNatsAccountRequest = { - name: { - maxLength: 64, - minLength: 1 - } -}; -const NatsApiCreateNatsCredentialsRequest = { - name: { - maxLength: 500, - minLength: 1 - } -}; -const NatsApiUpdateNatsAccountRequest = { - name: { - maxLength: 64, - minLength: 1 - } -}; -const SnsApiCreateSnsCredentialsRequest = { - name: { - maxLength: 500, - minLength: 1 - } -}; -const SnsApiUpdateSnsCredentialsRequest = { - name: { - maxLength: 500, - minLength: 1 - } -}; -const SqsApiCreateSqsCredentialsRequest = { - name: { - maxLength: 500, - minLength: 1 - } -}; -const SqsApiUpdateSqsCredentialsRequest = { - name: { - maxLength: 500, - minLength: 1 - } -}; + * @param request - The request {@link UpdateDomainRequest} + * @returns A Promise of Domain + */ + updateDomain = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateDomainRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/transactional-email/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${marshalling.validatePathParam("domainId", request.domainId)}` + }, + marshalling_gen.unmarshalDomain + ); + /** + * Create a Webhook. Create a new Webhook triggered by a list of event types + * and pushed to a Scaleway SNS ARN. + * + * @param request - The request {@link CreateWebhookRequest} + * @returns A Promise of Webhook + */ + createWebhook = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateWebhookRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/transactional-email/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/webhooks` + }, + marshalling_gen.unmarshalWebhook + ); + pageOfListWebhooks = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/transactional-email/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/webhooks`, + urlParams: marshalling.urlParams( + ["domain_id", request.domainId], + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId] + ) + }, + marshalling_gen.unmarshalListWebhooksResponse + ); + /** + * List Webhooks. Retrieve Webhooks in a specific Project or in a specific + * Organization using the `region` parameter. + * + * @param request - The request {@link ListWebhooksRequest} + * @returns A Promise of ListWebhooksResponse + */ + listWebhooks = (request = {}) => resourcePaginator.enrichForPagination("webhooks", this.pageOfListWebhooks, request); + /** + * Get information about a Webhook. Retrieve information about a specific + * Webhook using the `webhook_id` and `region` parameters. + * + * @param request - The request {@link GetWebhookRequest} + * @returns A Promise of Webhook + */ + getWebhook = (request) => this.client.fetch( + { + method: "GET", + path: `/transactional-email/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/webhooks/${marshalling.validatePathParam("webhookId", request.webhookId)}` + }, + marshalling_gen.unmarshalWebhook + ); + /** + * Update a Webhook. Update a Webhook events type, SNS ARN or name. + * + * @param request - The request {@link UpdateWebhookRequest} + * @returns A Promise of Webhook + */ + updateWebhook = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateWebhookRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/transactional-email/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/webhooks/${marshalling.validatePathParam("webhookId", request.webhookId)}` + }, + marshalling_gen.unmarshalWebhook + ); + /** + * Delete a Webhook. You must specify the Webhook you want to delete by the + * `region` and `webhook_id`. Deleting a Webhook is permanent and cannot be + * undone. + * + * @param request - The request {@link DeleteWebhookRequest} + */ + deleteWebhook = (request) => this.client.fetch({ + method: "DELETE", + path: `/transactional-email/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/webhooks/${marshalling.validatePathParam("webhookId", request.webhookId)}` + }); + pageOfListWebhookEvents = (request) => this.client.fetch( + { + method: "GET", + path: `/transactional-email/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/webhooks/${marshalling.validatePathParam("webhookId", request.webhookId)}/events`, + urlParams: marshalling.urlParams( + ["domain_id", request.domainId], + ["email_id", request.emailId], + ["event_types", request.eventTypes], + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId], + ["statuses", request.statuses] + ) + }, + marshalling_gen.unmarshalListWebhookEventsResponse + ); + /** + * List Webhook triggered events. Retrieve the list of Webhook events + * triggered from a specific Webhook or for a specific Project or + * Organization. You must specify the `region`. + * + * @param request - The request {@link ListWebhookEventsRequest} + * @returns A Promise of ListWebhookEventsResponse + */ + listWebhookEvents = (request) => resourcePaginator.enrichForPagination("webhookEvents", this.pageOfListWebhookEvents, request); + /** + * List project settings. Retrieve the project settings including periodic + * reports. + * + * @param request - The request {@link GetProjectSettingsRequest} + * @returns A Promise of ProjectSettings + */ + getProjectSettings = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/transactional-email/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/project/${marshalling.validatePathParam("projectId", request.projectId ?? this.client.settings.defaultProjectId)}/settings` + }, + marshalling_gen.unmarshalProjectSettings + ); + /** + * Update project settings. Update the project settings including periodic + * reports. + * + * @param request - The request {@link UpdateProjectSettingsRequest} + * @returns A Promise of ProjectSettings + */ + updateProjectSettings = (request = {}) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateProjectSettingsRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/transactional-email/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/project/${marshalling.validatePathParam("projectId", request.projectId ?? this.client.settings.defaultProjectId)}/settings` + }, + marshalling_gen.unmarshalProjectSettings + ); +} +exports.API = API; -var validationRules_gen$2 = /*#__PURE__*/Object.freeze({ - __proto__: null, - NatsApiCreateNatsAccountRequest: NatsApiCreateNatsAccountRequest, - NatsApiCreateNatsCredentialsRequest: NatsApiCreateNatsCredentialsRequest, - NatsApiUpdateNatsAccountRequest: NatsApiUpdateNatsAccountRequest, - SnsApiCreateSnsCredentialsRequest: SnsApiCreateSnsCredentialsRequest, - SnsApiUpdateSnsCredentialsRequest: SnsApiUpdateSnsCredentialsRequest, - SqsApiCreateSqsCredentialsRequest: SqsApiCreateSqsCredentialsRequest, - SqsApiUpdateSqsCredentialsRequest: SqsApiUpdateSqsCredentialsRequest -}); -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. +/***/ }), -var index_gen$a = /*#__PURE__*/Object.freeze({ - __proto__: null, - NatsAPI: NatsAPI, - SnsAPI: SnsAPI, - SqsAPI: SqsAPI, - ValidationRules: validationRules_gen$2 -}); +/***/ 2916: +/***/ ((__unused_webpack_module, exports) => { -var index$9 = /*#__PURE__*/Object.freeze({ - __proto__: null, - v1alpha1: index_gen$b, - v1beta1: index_gen$a -}); +"use strict"; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const DOMAIN_TRANSIENT_STATUSES = [ + "pending", + "autoconfiguring" +]; +const EMAIL_TRANSIENT_STATUSES = ["new", "sending"]; +exports.DOMAIN_TRANSIENT_STATUSES = DOMAIN_TRANSIENT_STATUSES; +exports.EMAIL_TRANSIENT_STATUSES = EMAIL_TRANSIENT_STATUSES; -/** Lists transient statutes of the enum {@link DatabaseBackupStatus}. */ -const DATABASE_BACKUP_TRANSIENT_STATUSES = ['creating', 'restoring', 'deleting', 'exporting']; -/** Lists transient statutes of the enum {@link InstanceLogStatus}. */ -const INSTANCE_LOG_TRANSIENT_STATUSES = ['creating']; +/***/ }), -/** Lists transient statutes of the enum {@link InstanceStatus}. */ -const INSTANCE_TRANSIENT_STATUSES = ['provisioning', 'configuring', 'deleting', 'autohealing', 'initializing', 'backuping', 'snapshotting', 'restarting']; +/***/ 4951: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/** Lists transient statutes of the enum {@link MaintenanceStatus}. */ -const MAINTENANCE_TRANSIENT_STATUSES = ['pending']; +"use strict"; -/** Lists transient statutes of the enum {@link ReadReplicaStatus}. */ -const READ_REPLICA_TRANSIENT_STATUSES = ['provisioning', 'initializing', 'deleting', 'configuring', 'promoting']; +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api_gen = __nccwpck_require__(1999); +const content_gen = __nccwpck_require__(2916); +const validationRules_gen = __nccwpck_require__(4386); +exports.API = api_gen.API; +exports.DOMAIN_TRANSIENT_STATUSES = content_gen.DOMAIN_TRANSIENT_STATUSES; +exports.EMAIL_TRANSIENT_STATUSES = content_gen.EMAIL_TRANSIENT_STATUSES; +exports.ValidationRules = validationRules_gen; -/** Lists transient statutes of the enum {@link SnapshotStatus}. */ -const SNAPSHOT_TRANSIENT_STATUSES = ['creating', 'restoring', 'deleting']; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const unmarshalEndpointDirectAccessDetails = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'EndpointDirectAccessDetails' failed as data isn't a dictionary.`); - } - return {}; -}; -const unmarshalEndpointLoadBalancerDetails = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'EndpointLoadBalancerDetails' failed as data isn't a dictionary.`); - } - return {}; -}; -const unmarshalEndpointPrivateNetworkDetails = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'EndpointPrivateNetworkDetails' failed as data isn't a dictionary.`); - } - return { - privateNetworkId: data.private_network_id, - serviceIp: data.service_ip, - zone: data.zone - }; -}; -const unmarshalEndpoint$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Endpoint' failed as data isn't a dictionary.`); - } - return { - directAccess: data.direct_access ? unmarshalEndpointDirectAccessDetails(data.direct_access) : undefined, - hostname: data.hostname, - id: data.id, - ip: data.ip, - loadBalancer: data.load_balancer ? unmarshalEndpointLoadBalancerDetails(data.load_balancer) : undefined, - name: data.name, - port: data.port, - privateNetwork: data.private_network ? unmarshalEndpointPrivateNetworkDetails(data.private_network) : undefined - }; -}; -const unmarshalEngineSetting = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'EngineSetting' failed as data isn't a dictionary.`); - } - return { - defaultValue: data.default_value, - description: data.description, - floatMax: data.float_max, - floatMin: data.float_min, - hotConfigurable: data.hot_configurable, - intMax: data.int_max, - intMin: data.int_min, - name: data.name, - propertyType: data.property_type, - stringConstraint: data.string_constraint, - unit: data.unit - }; -}; -const unmarshalBackupSchedule = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'BackupSchedule' failed as data isn't a dictionary.`); - } - return { - disabled: data.disabled, - frequency: data.frequency, - nextRunAt: unmarshalDate(data.next_run_at), - retention: data.retention - }; -}; -const unmarshalEngineVersion = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'EngineVersion' failed as data isn't a dictionary.`); - } - return { - availableInitSettings: unmarshalArrayOfObject(data.available_init_settings, unmarshalEngineSetting), - availableSettings: unmarshalArrayOfObject(data.available_settings, unmarshalEngineSetting), - beta: data.beta, - disabled: data.disabled, - endOfLife: unmarshalDate(data.end_of_life), - name: data.name, - version: data.version - }; -}; -const unmarshalInstanceSetting = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'InstanceSetting' failed as data isn't a dictionary.`); - } - return { - name: data.name, - value: data.value - }; -}; -const unmarshalLogsPolicy = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'LogsPolicy' failed as data isn't a dictionary.`); - } - return { - maxAgeRetention: data.max_age_retention, - totalDiskRetention: data.total_disk_retention - }; -}; -const unmarshalMaintenance = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Maintenance' failed as data isn't a dictionary.`); - } - return { - closedAt: unmarshalDate(data.closed_at), - reason: data.reason, - startsAt: unmarshalDate(data.starts_at), - status: data.status, - stopsAt: unmarshalDate(data.stops_at) - }; -}; -const unmarshalNodeTypeVolumeConstraintSizes = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'NodeTypeVolumeConstraintSizes' failed as data isn't a dictionary.`); - } - return { - maxSize: data.max_size, - minSize: data.min_size - }; -}; -const unmarshalNodeTypeVolumeType = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'NodeTypeVolumeType' failed as data isn't a dictionary.`); - } - return { - chunkSize: data.chunk_size, - class: data.class, - description: data.description, - maxSize: data.max_size, - minSize: data.min_size, - type: data.type - }; -}; -const unmarshalReadReplica = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ReadReplica' failed as data isn't a dictionary.`); - } - return { - endpoints: unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint$1), - id: data.id, - region: data.region, - sameZone: data.same_zone, - status: data.status - }; -}; -const unmarshalUpgradableVersion = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'UpgradableVersion' failed as data isn't a dictionary.`); - } - return { - id: data.id, - minorVersion: data.minor_version, - name: data.name, - version: data.version - }; -}; -const unmarshalVolume = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Volume' failed as data isn't a dictionary.`); - } - return { - class: data.class, - size: data.size, - type: data.type - }; -}; -const unmarshalACLRule$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ACLRule' failed as data isn't a dictionary.`); - } - return { - action: data.action, - description: data.description, - direction: data.direction, - ip: data.ip, - port: data.port, - protocol: data.protocol - }; -}; -const unmarshalDatabase = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Database' failed as data isn't a dictionary.`); - } - return { - managed: data.managed, - name: data.name, - owner: data.owner, - size: data.size - }; -}; -const unmarshalDatabaseBackup = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'DatabaseBackup' failed as data isn't a dictionary.`); - } - return { - createdAt: unmarshalDate(data.created_at), - databaseName: data.database_name, - downloadUrl: data.download_url, - downloadUrlExpiresAt: unmarshalDate(data.download_url_expires_at), - expiresAt: unmarshalDate(data.expires_at), - id: data.id, - instanceId: data.instance_id, - instanceName: data.instance_name, - name: data.name, - region: data.region, - sameRegion: data.same_region, - size: data.size, - status: data.status, - updatedAt: unmarshalDate(data.updated_at) - }; -}; -const unmarshalDatabaseEngine = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'DatabaseEngine' failed as data isn't a dictionary.`); +/***/ }), + +/***/ 1269: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const json = __nccwpck_require__(3746); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const unmarshalEmailTry = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'EmailTry' failed as data isn't a dictionary.` + ); } return { - logoUrl: data.logo_url, - name: data.name, - region: data.region, - versions: unmarshalArrayOfObject(data.versions, unmarshalEngineVersion) + code: data.code, + message: data.message, + rank: data.rank, + triedAt: marshalling.unmarshalDate(data.tried_at) }; }; -const unmarshalInstance = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Instance' failed as data isn't a dictionary.`); +const unmarshalEmail = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Email' failed as data isn't a dictionary.` + ); } return { - backupSameRegion: data.backup_same_region, - backupSchedule: data.backup_schedule ? unmarshalBackupSchedule(data.backup_schedule) : undefined, - createdAt: unmarshalDate(data.created_at), - endpoint: data.endpoint ? unmarshalEndpoint$1(data.endpoint) : undefined, - endpoints: unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint$1), - engine: data.engine, + createdAt: marshalling.unmarshalDate(data.created_at), + flags: data.flags, id: data.id, - initSettings: unmarshalArrayOfObject(data.init_settings, unmarshalInstanceSetting), - isHaCluster: data.is_ha_cluster, - logsPolicy: data.logs_policy ? unmarshalLogsPolicy(data.logs_policy) : undefined, - maintenances: unmarshalArrayOfObject(data.maintenances, unmarshalMaintenance), - name: data.name, - nodeType: data.node_type, - organizationId: data.organization_id, + lastTries: marshalling.unmarshalArrayOfObject(data.last_tries, unmarshalEmailTry), + mailFrom: data.mail_from, + mailRcpt: data.mail_rcpt, + messageId: data.message_id, projectId: data.project_id, - readReplicas: unmarshalArrayOfObject(data.read_replicas, unmarshalReadReplica), - region: data.region, - settings: unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting), - status: data.status, - tags: data.tags, - upgradableVersion: unmarshalArrayOfObject(data.upgradable_version, unmarshalUpgradableVersion), - volume: data.volume ? unmarshalVolume(data.volume) : undefined - }; -}; -const unmarshalInstanceLog = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'InstanceLog' failed as data isn't a dictionary.`); - } - return { - createdAt: unmarshalDate(data.created_at), - downloadUrl: data.download_url, - expiresAt: unmarshalDate(data.expires_at), - id: data.id, - nodeName: data.node_name, - region: data.region, - status: data.status - }; -}; -const unmarshalListInstanceLogsDetailsResponseInstanceLogDetail = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListInstanceLogsDetailsResponseInstanceLogDetail' failed as data isn't a dictionary.`); - } - return { - logName: data.log_name, - size: data.size - }; -}; -const unmarshalNodeType$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'NodeType' failed as data isn't a dictionary.`); - } - return { - availableVolumeTypes: unmarshalArrayOfObject(data.available_volume_types, unmarshalNodeTypeVolumeType), - beta: data.beta, - description: data.description, - disabled: data.disabled, - generation: data.generation, - instanceRange: data.instance_range, - isBssdCompatible: data.is_bssd_compatible, - isHaRequired: data.is_ha_required, - memory: data.memory, - name: data.name, - region: data.region, - stockStatus: data.stock_status, - vcpus: data.vcpus, - volumeConstraint: data.volume_constraint ? unmarshalNodeTypeVolumeConstraintSizes(data.volume_constraint) : undefined - }; -}; -const unmarshalPrivilege = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Privilege' failed as data isn't a dictionary.`); - } - return { - databaseName: data.database_name, - permission: data.permission, - userName: data.user_name - }; -}; -const unmarshalSnapshot = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Snapshot' failed as data isn't a dictionary.`); - } - return { - createdAt: unmarshalDate(data.created_at), - expiresAt: unmarshalDate(data.expires_at), - id: data.id, - instanceId: data.instance_id, - instanceName: data.instance_name, - name: data.name, - nodeType: data.node_type, - region: data.region, - size: data.size, + rcptTo: data.rcpt_to, + rcptType: data.rcpt_type, status: data.status, - updatedAt: unmarshalDate(data.updated_at) - }; -}; -const unmarshalUser = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'User' failed as data isn't a dictionary.`); - } - return { - isAdmin: data.is_admin, - name: data.name + statusDetails: data.status_details, + subject: data.subject, + tryCount: data.try_count, + updatedAt: marshalling.unmarshalDate(data.updated_at) }; }; -const unmarshalAddInstanceACLRulesResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'AddInstanceACLRulesResponse' failed as data isn't a dictionary.`); +const unmarshalDomainRecordsDMARC = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DomainRecordsDMARC' failed as data isn't a dictionary.` + ); } return { - rules: unmarshalArrayOfObject(data.rules, unmarshalACLRule$1) + name: data.name, + value: data.value }; }; -const unmarshalAddInstanceSettingsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'AddInstanceSettingsResponse' failed as data isn't a dictionary.`); +const unmarshalDomainRecords = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DomainRecords' failed as data isn't a dictionary.` + ); } return { - settings: unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting) + dmarc: data.dmarc ? unmarshalDomainRecordsDMARC(data.dmarc) : void 0 }; }; -const unmarshalDeleteInstanceACLRulesResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'DeleteInstanceACLRulesResponse' failed as data isn't a dictionary.`); +const unmarshalDomainReputation = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DomainReputation' failed as data isn't a dictionary.` + ); } return { - rules: unmarshalArrayOfObject(data.rules, unmarshalACLRule$1) + previousScore: data.previous_score, + previousScoredAt: marshalling.unmarshalDate(data.previous_scored_at), + score: data.score, + scoredAt: marshalling.unmarshalDate(data.scored_at), + status: data.status }; }; -const unmarshalDeleteInstanceSettingsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'DeleteInstanceSettingsResponse' failed as data isn't a dictionary.`); +const unmarshalDomainStatistics = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DomainStatistics' failed as data isn't a dictionary.` + ); } return { - settings: unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting) + canceledCount: data.canceled_count, + failedCount: data.failed_count, + sentCount: data.sent_count, + totalCount: data.total_count }; }; -const unmarshalInstanceMetrics = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'InstanceMetrics' failed as data isn't a dictionary.`); +const unmarshalDomain = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Domain' failed as data isn't a dictionary.` + ); } return { - timeseries: unmarshalArrayOfObject(data.timeseries, unmarshalTimeSeries) + autoconfig: data.autoconfig, + createdAt: marshalling.unmarshalDate(data.created_at), + dkimConfig: data.dkim_config, + id: data.id, + lastError: data.last_error, + lastValidAt: marshalling.unmarshalDate(data.last_valid_at), + name: data.name, + nextCheckAt: marshalling.unmarshalDate(data.next_check_at), + organizationId: data.organization_id, + projectId: data.project_id, + records: data.records ? unmarshalDomainRecords(data.records) : void 0, + region: data.region, + reputation: data.reputation ? unmarshalDomainReputation(data.reputation) : void 0, + revokedAt: marshalling.unmarshalDate(data.revoked_at), + spfConfig: data.spf_config, + statistics: data.statistics ? unmarshalDomainStatistics(data.statistics) : void 0, + status: data.status }; }; -const unmarshalListDatabaseBackupsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListDatabaseBackupsResponse' failed as data isn't a dictionary.`); +const unmarshalWebhook = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Webhook' failed as data isn't a dictionary.` + ); } return { - databaseBackups: unmarshalArrayOfObject(data.database_backups, unmarshalDatabaseBackup), - totalCount: data.total_count + createdAt: marshalling.unmarshalDate(data.created_at), + domainId: data.domain_id, + eventTypes: data.event_types, + id: data.id, + name: data.name, + organizationId: data.organization_id, + projectId: data.project_id, + snsArn: data.sns_arn, + updatedAt: marshalling.unmarshalDate(data.updated_at) }; }; -const unmarshalListDatabaseEnginesResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListDatabaseEnginesResponse' failed as data isn't a dictionary.`); +const unmarshalCreateEmailResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'CreateEmailResponse' failed as data isn't a dictionary.` + ); } return { - engines: unmarshalArrayOfObject(data.engines, unmarshalDatabaseEngine), - totalCount: data.total_count + emails: marshalling.unmarshalArrayOfObject(data.emails, unmarshalEmail) }; }; -const unmarshalListDatabasesResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListDatabasesResponse' failed as data isn't a dictionary.`); +const unmarshalDomainLastStatusDkimRecord = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DomainLastStatusDkimRecord' failed as data isn't a dictionary.` + ); } return { - databases: unmarshalArrayOfObject(data.databases, unmarshalDatabase), - totalCount: data.total_count + error: data.error, + lastValidAt: marshalling.unmarshalDate(data.last_valid_at), + status: data.status }; }; -const unmarshalListInstanceACLRulesResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListInstanceACLRulesResponse' failed as data isn't a dictionary.`); +const unmarshalDomainLastStatusDmarcRecord = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DomainLastStatusDmarcRecord' failed as data isn't a dictionary.` + ); } return { - rules: unmarshalArrayOfObject(data.rules, unmarshalACLRule$1), - totalCount: data.total_count + error: data.error, + lastValidAt: marshalling.unmarshalDate(data.last_valid_at), + status: data.status }; }; -const unmarshalListInstanceLogsDetailsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListInstanceLogsDetailsResponse' failed as data isn't a dictionary.`); +const unmarshalDomainLastStatusSpfRecord = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DomainLastStatusSpfRecord' failed as data isn't a dictionary.` + ); } return { - details: unmarshalArrayOfObject(data.details, unmarshalListInstanceLogsDetailsResponseInstanceLogDetail) + error: data.error, + lastValidAt: marshalling.unmarshalDate(data.last_valid_at), + status: data.status }; }; -const unmarshalListInstanceLogsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListInstanceLogsResponse' failed as data isn't a dictionary.`); +const unmarshalDomainLastStatus = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DomainLastStatus' failed as data isn't a dictionary.` + ); } return { - instanceLogs: unmarshalArrayOfObject(data.instance_logs, unmarshalInstanceLog) + dkimRecord: data.dkim_record ? unmarshalDomainLastStatusDkimRecord(data.dkim_record) : void 0, + dmarcRecord: data.dmarc_record ? unmarshalDomainLastStatusDmarcRecord(data.dmarc_record) : void 0, + domainId: data.domain_id, + domainName: data.domain_name, + spfRecord: data.spf_record ? unmarshalDomainLastStatusSpfRecord(data.spf_record) : void 0 }; }; -const unmarshalListInstancesResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListInstancesResponse' failed as data isn't a dictionary.`); +const unmarshalListDomainsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListDomainsResponse' failed as data isn't a dictionary.` + ); } return { - instances: unmarshalArrayOfObject(data.instances, unmarshalInstance), + domains: marshalling.unmarshalArrayOfObject(data.domains, unmarshalDomain), totalCount: data.total_count }; }; -const unmarshalListNodeTypesResponse$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListNodeTypesResponse' failed as data isn't a dictionary.`); +const unmarshalListEmailsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListEmailsResponse' failed as data isn't a dictionary.` + ); } return { - nodeTypes: unmarshalArrayOfObject(data.node_types, unmarshalNodeType$1), + emails: marshalling.unmarshalArrayOfObject(data.emails, unmarshalEmail), totalCount: data.total_count }; }; -const unmarshalListPrivilegesResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListPrivilegesResponse' failed as data isn't a dictionary.`); +const unmarshalWebhookEvent = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'WebhookEvent' failed as data isn't a dictionary.` + ); } return { - privileges: unmarshalArrayOfObject(data.privileges, unmarshalPrivilege), - totalCount: data.total_count + createdAt: marshalling.unmarshalDate(data.created_at), + data: data.data, + domainId: data.domain_id, + emailId: data.email_id, + id: data.id, + organizationId: data.organization_id, + projectId: data.project_id, + status: data.status, + type: data.type, + updatedAt: marshalling.unmarshalDate(data.updated_at), + webhookId: data.webhook_id }; }; -const unmarshalListSnapshotsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListSnapshotsResponse' failed as data isn't a dictionary.`); +const unmarshalListWebhookEventsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListWebhookEventsResponse' failed as data isn't a dictionary.` + ); } return { - snapshots: unmarshalArrayOfObject(data.snapshots, unmarshalSnapshot), - totalCount: data.total_count + totalCount: data.total_count, + webhookEvents: marshalling.unmarshalArrayOfObject( + data.webhook_events, + unmarshalWebhookEvent + ) }; }; -const unmarshalListUsersResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListUsersResponse' failed as data isn't a dictionary.`); +const unmarshalListWebhooksResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListWebhooksResponse' failed as data isn't a dictionary.` + ); } return { totalCount: data.total_count, - users: unmarshalArrayOfObject(data.users, unmarshalUser) + webhooks: marshalling.unmarshalArrayOfObject(data.webhooks, unmarshalWebhook) }; }; -const unmarshalPrepareInstanceLogsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'PrepareInstanceLogsResponse' failed as data isn't a dictionary.`); +const unmarshalProjectSettingsPeriodicReport = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ProjectSettingsPeriodicReport' failed as data isn't a dictionary.` + ); } return { - instanceLogs: unmarshalArrayOfObject(data.instance_logs, unmarshalInstanceLog) + enabled: data.enabled, + frequency: data.frequency, + sendingDay: data.sending_day, + sendingHour: data.sending_hour }; }; -const unmarshalSetInstanceACLRulesResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'SetInstanceACLRulesResponse' failed as data isn't a dictionary.`); +const unmarshalProjectSettings = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ProjectSettings' failed as data isn't a dictionary.` + ); } return { - rules: unmarshalArrayOfObject(data.rules, unmarshalACLRule$1) + periodicReport: data.periodic_report ? unmarshalProjectSettingsPeriodicReport(data.periodic_report) : void 0 }; }; -const unmarshalSetInstanceSettingsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'SetInstanceSettingsResponse' failed as data isn't a dictionary.`); +const unmarshalStatistics = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Statistics' failed as data isn't a dictionary.` + ); } return { - settings: unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting) + canceledCount: data.canceled_count, + failedCount: data.failed_count, + newCount: data.new_count, + sendingCount: data.sending_count, + sentCount: data.sent_count, + totalCount: data.total_count }; }; -const marshalEndpointSpecPrivateNetworkIpamConfig = (request, defaults) => ({}); -const marshalReadReplicaEndpointSpecPrivateNetworkIpamConfig = (request, defaults) => ({}); -const marshalEndpointSpecLoadBalancer = (request, defaults) => ({}); -const marshalEndpointSpecPrivateNetwork = (request, defaults) => ({ - private_network_id: request.privateNetworkId, - ...resolveOneOf([{ - param: 'service_ip', - value: request.serviceIp - }, { - param: 'ipam_config', - value: request.ipamConfig ? marshalEndpointSpecPrivateNetworkIpamConfig(request.ipamConfig) : undefined - }]) -}); -const marshalReadReplicaEndpointSpecDirectAccess = (request, defaults) => ({}); -const marshalReadReplicaEndpointSpecPrivateNetwork = (request, defaults) => ({ - private_network_id: request.privateNetworkId, - ...resolveOneOf([{ - param: 'service_ip', - value: request.serviceIp - }, { - param: 'ipam_config', - value: request.ipamConfig ? marshalReadReplicaEndpointSpecPrivateNetworkIpamConfig(request.ipamConfig) : undefined - }]) -}); -const marshalACLRuleRequest = (request, defaults) => ({ - description: request.description, - ip: request.ip -}); -const marshalEndpointSpec$1 = (request, defaults) => ({ - ...resolveOneOf([{ - param: 'load_balancer', - value: request.loadBalancer ? marshalEndpointSpecLoadBalancer(request.loadBalancer) : undefined - }, { - param: 'private_network', - value: request.privateNetwork ? marshalEndpointSpecPrivateNetwork(request.privateNetwork) : undefined - }]) -}); -const marshalInstanceSetting = (request, defaults) => ({ - name: request.name, - value: request.value -}); -const marshalLogsPolicy = (request, defaults) => ({ - max_age_retention: request.maxAgeRetention, - total_disk_retention: request.totalDiskRetention -}); -const marshalReadReplicaEndpointSpec = (request, defaults) => ({ - ...resolveOneOf([{ - param: 'direct_access', - value: request.directAccess ? marshalReadReplicaEndpointSpecDirectAccess(request.directAccess) : undefined - }, { - param: 'private_network', - value: request.privateNetwork ? marshalReadReplicaEndpointSpecPrivateNetwork(request.privateNetwork) : undefined - }]) -}); -const marshalAddInstanceACLRulesRequest = (request, defaults) => ({ - rules: request.rules.map(elt => marshalACLRuleRequest(elt)) -}); -const marshalAddInstanceSettingsRequest = (request, defaults) => ({ - settings: request.settings.map(elt => marshalInstanceSetting(elt)) -}); -const marshalCloneInstanceRequest = (request, defaults) => ({ - name: request.name, - node_type: request.nodeType -}); -const marshalCreateDatabaseBackupRequest = (request, defaults) => ({ - database_name: request.databaseName, - expires_at: request.expiresAt, - instance_id: request.instanceId, - name: request.name || randomName('bkp') -}); -const marshalCreateDatabaseRequest = (request, defaults) => ({ - name: request.name -}); -const marshalCreateEndpointRequest = (request, defaults) => ({ - endpoint_spec: request.endpointSpec ? marshalEndpointSpec$1(request.endpointSpec) : undefined -}); -const marshalCreateInstanceFromSnapshotRequest = (request, defaults) => ({ - instance_name: request.instanceName, - is_ha_cluster: request.isHaCluster, - node_type: request.nodeType -}); -const marshalCreateInstanceRequest = (request, defaults) => ({ - backup_same_region: request.backupSameRegion, - disable_backup: request.disableBackup, - engine: request.engine, - init_endpoints: request.initEndpoints ? request.initEndpoints.map(elt => marshalEndpointSpec$1(elt)) : undefined, - init_settings: request.initSettings ? request.initSettings.map(elt => marshalInstanceSetting(elt)) : undefined, - is_ha_cluster: request.isHaCluster, - name: request.name || randomName('ins'), - node_type: request.nodeType, - password: request.password, - tags: request.tags, - user_name: request.userName, - volume_size: request.volumeSize, - volume_type: request.volumeType ?? 'lssd', - ...resolveOneOf([{ - default: defaults.defaultProjectId, - param: 'project_id', - value: request.projectId - }, { - default: defaults.defaultOrganizationId, - param: 'organization_id', - value: request.organizationId - }]) -}); -const marshalCreateReadReplicaEndpointRequest = (request, defaults) => ({ - endpoint_spec: request.endpointSpec.map(elt => marshalReadReplicaEndpointSpec(elt)) -}); -const marshalCreateReadReplicaRequest = (request, defaults) => ({ - endpoint_spec: request.endpointSpec ? request.endpointSpec.map(elt => marshalReadReplicaEndpointSpec(elt)) : undefined, - instance_id: request.instanceId, - same_zone: request.sameZone -}); -const marshalCreateSnapshotRequest = (request, defaults) => ({ - expires_at: request.expiresAt, - name: request.name || randomName('snp') -}); -const marshalCreateUserRequest = (request, defaults) => ({ - is_admin: request.isAdmin, - name: request.name, - password: request.password -}); -const marshalDeleteInstanceACLRulesRequest = (request, defaults) => ({ - acl_rule_ips: request.aclRuleIps -}); -const marshalDeleteInstanceSettingsRequest = (request, defaults) => ({ - setting_names: request.settingNames -}); -const marshalMigrateEndpointRequest = (request, defaults) => ({ - instance_id: request.instanceId -}); -const marshalPrepareInstanceLogsRequest = (request, defaults) => ({ - end_date: request.endDate, - start_date: request.startDate -}); -const marshalPurgeInstanceLogsRequest = (request, defaults) => ({ - log_name: request.logName -}); -const marshalRestoreDatabaseBackupRequest = (request, defaults) => ({ - database_name: request.databaseName, - instance_id: request.instanceId -}); -const marshalSetInstanceACLRulesRequest = (request, defaults) => ({ - rules: request.rules.map(elt => marshalACLRuleRequest(elt)) -}); -const marshalSetInstanceSettingsRequest = (request, defaults) => ({ - settings: request.settings.map(elt => marshalInstanceSetting(elt)) -}); -const marshalSetPrivilegeRequest = (request, defaults) => ({ - database_name: request.databaseName, - permission: request.permission ?? 'readonly', - user_name: request.userName -}); -const marshalUpdateDatabaseBackupRequest = (request, defaults) => ({ - expires_at: request.expiresAt, - name: request.name -}); -const marshalUpdateInstanceRequest = (request, defaults) => ({ - backup_same_region: request.backupSameRegion, - backup_schedule_frequency: request.backupScheduleFrequency, - backup_schedule_retention: request.backupScheduleRetention, - backup_schedule_start_hour: request.backupScheduleStartHour, - is_backup_schedule_disabled: request.isBackupScheduleDisabled, - logs_policy: request.logsPolicy ? marshalLogsPolicy(request.logsPolicy) : undefined, - name: request.name, - tags: request.tags +const marshalCreateDomainRequest = (request, defaults) => ({ + accept_tos: request.acceptTos, + autoconfig: request.autoconfig, + domain_name: request.domainName, + project_id: request.projectId ?? defaults.defaultProjectId }); -const marshalUpdateSnapshotRequest = (request, defaults) => ({ - expires_at: request.expiresAt, +const marshalCreateEmailRequestAddress = (request, defaults) => ({ + email: request.email, name: request.name -}); -const marshalUpdateUserRequest = (request, defaults) => ({ - is_admin: request.isAdmin, - password: request.password -}); -const marshalUpgradeInstanceRequest = (request, defaults) => ({ - ...resolveOneOf([{ - param: 'node_type', - value: request.nodeType - }, { - param: 'enable_ha', - value: request.enableHa - }, { - param: 'volume_size', - value: request.volumeSize - }, { - param: 'volume_type', - value: request.volumeType - }, { - param: 'upgradable_version_id', - value: request.upgradableVersionId - }]) -}); - -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const jsonContentHeaders$9 = { - 'Content-Type': 'application/json; charset=utf-8' -}; - -/** Managed Database for PostgreSQL and MySQL API. */ -let API$9 = class API extends API$u { - /** Lists the available regions of the API. */ - static LOCALITIES = ['fr-par', 'nl-ams', 'pl-waw']; - pageOfListDatabaseEngines = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/database-engines`, - urlParams: urlParams(['name', request.name], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['version', request.version]) - }, unmarshalListDatabaseEnginesResponse); - - /** - * List available database engines. List the PostgreSQL and MySQL database - * engines available at Scaleway. - * - * @param request - The request {@link ListDatabaseEnginesRequest} - * @returns A Promise of ListDatabaseEnginesResponse - */ - listDatabaseEngines = (request = {}) => enrichForPagination('engines', this.pageOfListDatabaseEngines, request); - pageOfListNodeTypes = request => this.client.fetch({ - method: 'GET', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/node-types`, - urlParams: urlParams(['include_disabled_types', request.includeDisabledTypes], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]) - }, unmarshalListNodeTypesResponse$1); - - /** - * List available node types. List all available node types. By default, the - * node types returned in the list are ordered by creation date in ascending - * order, though this can be modified via the `order_by` field. - * - * @param request - The request {@link ListNodeTypesRequest} - * @returns A Promise of ListNodeTypesResponse - */ - listNodeTypes = request => enrichForPagination('nodeTypes', this.pageOfListNodeTypes, request); - pageOfListDatabaseBackups = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/backups`, - urlParams: urlParams(['instance_id', request.instanceId], ['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId]) - }, unmarshalListDatabaseBackupsResponse); - - /** - * List database backups. List all backups in a specified region, for a given - * Scaleway Organization or Scaleway Project. By default, the backups listed - * are ordered by creation date in ascending order. This can be modified via - * the `order_by` field. - * - * @param request - The request {@link ListDatabaseBackupsRequest} - * @returns A Promise of ListDatabaseBackupsResponse - */ - listDatabaseBackups = (request = {}) => enrichForPagination('databaseBackups', this.pageOfListDatabaseBackups, request); - - /** - * Create a database backup. Create a new backup. You must set the - * `instance_id`, `database_name`, `name` and `expires_at` parameters. - * - * @param request - The request {@link CreateDatabaseBackupRequest} - * @returns A Promise of DatabaseBackup - */ - createDatabaseBackup = request => this.client.fetch({ - body: JSON.stringify(marshalCreateDatabaseBackupRequest(request, this.client.settings)), - headers: jsonContentHeaders$9, - method: 'POST', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/backups` - }, unmarshalDatabaseBackup); - - /** - * Get a database backup. Retrieve information about a given backup, specified - * by its database backup ID and region. Full details about the backup, like - * size, URL and expiration date, are returned in the response. - * - * @param request - The request {@link GetDatabaseBackupRequest} - * @returns A Promise of DatabaseBackup - */ - getDatabaseBackup = request => this.client.fetch({ - method: 'GET', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/backups/${validatePathParam('databaseBackupId', request.databaseBackupId)}` - }, unmarshalDatabaseBackup); - - /** - * Waits for {@link DatabaseBackup} to be in a final state. - * - * @param request - The request {@link GetDatabaseBackupRequest} - * @param options - The waiting options - * @returns A Promise of DatabaseBackup - */ - waitForDatabaseBackup = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!DATABASE_BACKUP_TRANSIENT_STATUSES.includes(res.status))), this.getDatabaseBackup, request, options); - - /** - * Update a database backup. Update the parameters of a backup, including name - * and expiration date. - * - * @param request - The request {@link UpdateDatabaseBackupRequest} - * @returns A Promise of DatabaseBackup - */ - updateDatabaseBackup = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateDatabaseBackupRequest(request, this.client.settings)), - headers: jsonContentHeaders$9, - method: 'PATCH', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/backups/${validatePathParam('databaseBackupId', request.databaseBackupId)}` - }, unmarshalDatabaseBackup); - - /** - * Delete a database backup. Delete a backup, specified by its database backup - * ID and region. Deleting a backup is permanent, and cannot be undone. - * - * @param request - The request {@link DeleteDatabaseBackupRequest} - * @returns A Promise of DatabaseBackup - */ - deleteDatabaseBackup = request => this.client.fetch({ - method: 'DELETE', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/backups/${validatePathParam('databaseBackupId', request.databaseBackupId)}` - }, unmarshalDatabaseBackup); +}); +const marshalCreateEmailRequestAttachment = (request, defaults) => ({ + content: request.content, + name: request.name, + type: request.type +}); +const marshalCreateEmailRequestHeader = (request, defaults) => ({ + key: request.key, + value: request.value +}); +const marshalCreateEmailRequest = (request, defaults) => ({ + additional_headers: request.additionalHeaders !== void 0 ? request.additionalHeaders.map( + (elt) => marshalCreateEmailRequestHeader(elt) + ) : void 0, + attachments: request.attachments !== void 0 ? request.attachments.map( + (elt) => marshalCreateEmailRequestAttachment(elt) + ) : void 0, + bcc: request.bcc !== void 0 ? request.bcc.map((elt) => marshalCreateEmailRequestAddress(elt)) : void 0, + cc: request.cc !== void 0 ? request.cc.map((elt) => marshalCreateEmailRequestAddress(elt)) : void 0, + from: marshalCreateEmailRequestAddress(request.from), + html: request.html, + project_id: request.projectId ?? defaults.defaultProjectId, + send_before: request.sendBefore, + subject: request.subject, + text: request.text, + to: request.to !== void 0 ? request.to.map((elt) => marshalCreateEmailRequestAddress(elt)) : void 0 +}); +const marshalCreateWebhookRequest = (request, defaults) => ({ + domain_id: request.domainId, + event_types: request.eventTypes !== void 0 ? request.eventTypes : void 0, + name: request.name, + project_id: request.projectId ?? defaults.defaultProjectId, + sns_arn: request.snsArn +}); +const marshalUpdateDomainRequest = (request, defaults) => ({ + autoconfig: request.autoconfig +}); +const marshalUpdateProjectSettingsRequestUpdatePeriodicReport = (request, defaults) => ({ + enabled: request.enabled, + frequency: request.frequency, + sending_day: request.sendingDay, + sending_hour: request.sendingHour +}); +const marshalUpdateProjectSettingsRequest = (request, defaults) => ({ + periodic_report: request.periodicReport !== void 0 ? marshalUpdateProjectSettingsRequestUpdatePeriodicReport( + request.periodicReport + ) : void 0 +}); +const marshalUpdateWebhookRequest = (request, defaults) => ({ + event_types: request.eventTypes !== void 0 ? request.eventTypes : void 0, + name: request.name, + sns_arn: request.snsArn +}); +exports.marshalCreateDomainRequest = marshalCreateDomainRequest; +exports.marshalCreateEmailRequest = marshalCreateEmailRequest; +exports.marshalCreateWebhookRequest = marshalCreateWebhookRequest; +exports.marshalUpdateDomainRequest = marshalUpdateDomainRequest; +exports.marshalUpdateProjectSettingsRequest = marshalUpdateProjectSettingsRequest; +exports.marshalUpdateWebhookRequest = marshalUpdateWebhookRequest; +exports.unmarshalCreateEmailResponse = unmarshalCreateEmailResponse; +exports.unmarshalDomain = unmarshalDomain; +exports.unmarshalDomainLastStatus = unmarshalDomainLastStatus; +exports.unmarshalEmail = unmarshalEmail; +exports.unmarshalListDomainsResponse = unmarshalListDomainsResponse; +exports.unmarshalListEmailsResponse = unmarshalListEmailsResponse; +exports.unmarshalListWebhookEventsResponse = unmarshalListWebhookEventsResponse; +exports.unmarshalListWebhooksResponse = unmarshalListWebhooksResponse; +exports.unmarshalProjectSettings = unmarshalProjectSettings; +exports.unmarshalStatistics = unmarshalStatistics; +exports.unmarshalWebhook = unmarshalWebhook; - /** - * Restore a database backup. Launch the process of restoring database backup. - * You must specify the `instance_id` of the Database Instance of destination, - * where the backup will be restored. Note that large database backups can - * take up to several hours to restore. - * - * @param request - The request {@link RestoreDatabaseBackupRequest} - * @returns A Promise of DatabaseBackup - */ - restoreDatabaseBackup = request => this.client.fetch({ - body: JSON.stringify(marshalRestoreDatabaseBackupRequest(request, this.client.settings)), - headers: jsonContentHeaders$9, - method: 'POST', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/backups/${validatePathParam('databaseBackupId', request.databaseBackupId)}/restore` - }, unmarshalDatabaseBackup); - /** - * Export a database backup. Export a backup, specified by the - * `database_backup_id` and the `region` parameters. The download URL is - * returned in the response. - * - * @param request - The request {@link ExportDatabaseBackupRequest} - * @returns A Promise of DatabaseBackup - */ - exportDatabaseBackup = request => this.client.fetch({ - body: '{}', - headers: jsonContentHeaders$9, - method: 'POST', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/backups/${validatePathParam('databaseBackupId', request.databaseBackupId)}/export` - }, unmarshalDatabaseBackup); +/***/ }), - /** - * Upgrade a Database Instance. Upgrade your current Database Instance - * specifications like node type, high availability, volume, or the database - * engine version. Note that upon upgrade the `enable_ha` parameter can only - * be set to `true`. - * - * @param request - The request {@link UpgradeInstanceRequest} - * @returns A Promise of Instance - */ - upgradeInstance = request => this.client.fetch({ - body: JSON.stringify(marshalUpgradeInstanceRequest(request, this.client.settings)), - headers: jsonContentHeaders$9, - method: 'POST', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/upgrade` - }, unmarshalInstance); - pageOfListInstances = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances`, - urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId], ['tags', request.tags]) - }, unmarshalListInstancesResponse); +/***/ 4386: +/***/ ((__unused_webpack_module, exports) => { - /** - * List Database Instances. List all Database Instances in the specified - * region, for a given Scaleway Organization or Scaleway Project. By default, - * the Database Instances returned in the list are ordered by creation date in - * ascending order, though this can be modified via the order_by field. You - * can define additional parameters for your query, such as `tags` and `name`. - * For the `name` parameter, the value you include will be checked against the - * whole name string to see if it includes the string you put in the - * parameter. - * - * @param request - The request {@link ListInstancesRequest} - * @returns A Promise of ListInstancesResponse - */ - listInstances = (request = {}) => enrichForPagination('instances', this.pageOfListInstances, request); +"use strict"; - /** - * Get a Database Instance. Retrieve information about a given Database - * Instance, specified by the `region` and `instance_id` parameters. Its full - * details, including name, status, IP address and port, are returned in the - * response object. - * - * @param request - The request {@link GetInstanceRequest} - * @returns A Promise of Instance - */ - getInstance = request => this.client.fetch({ - method: 'GET', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}` - }, unmarshalInstance); +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const CreateDomainRequest = { + domainName: { + maxLength: 255, + minLength: 1 + } +}; +const CreateEmailRequest = { + subject: { + minLength: 6 + } +}; +const CreateEmailRequestAddress = { + email: { + minLength: 1 + } +}; +const CreateEmailRequestAttachment = { + name: { + minLength: 1 + }, + type: { + minLength: 1 + } +}; +const CreateEmailRequestHeader = { + key: { + minLength: 1 + }, + value: { + minLength: 1 + } +}; +const CreateWebhookRequest = { + name: { + maxLength: 127, + minLength: 3 + }, + snsArn: { + maxLength: 127, + minLength: 3 + } +}; +const ListDomainsRequest = { + page: { + greaterThan: 0 + }, + pageSize: { + greaterThanOrEqual: 1, + lessThanOrEqual: 1e3 + } +}; +const ListEmailsRequest = { + page: { + greaterThan: 0 + }, + pageSize: { + greaterThanOrEqual: 1, + lessThanOrEqual: 1e3 + }, + search: { + maxLength: 100, + minLength: 3 + }, + subject: { + minLength: 6 + } +}; +const ListWebhookEventsRequest = { + page: { + greaterThan: 0 + }, + pageSize: { + greaterThanOrEqual: 1, + lessThanOrEqual: 100 + } +}; +const ListWebhooksRequest = { + page: { + greaterThan: 0 + }, + pageSize: { + greaterThanOrEqual: 1, + lessThanOrEqual: 100 + } +}; +const UpdateProjectSettingsRequestUpdatePeriodicReport = { + sendingDay: { + greaterThanOrEqual: 1, + lessThanOrEqual: 28 + }, + sendingHour: { + greaterThanOrEqual: 0, + lessThanOrEqual: 23 + } +}; +const UpdateWebhookRequest = { + name: { + maxLength: 127, + minLength: 3 + }, + snsArn: { + maxLength: 127, + minLength: 3 + } +}; +exports.CreateDomainRequest = CreateDomainRequest; +exports.CreateEmailRequest = CreateEmailRequest; +exports.CreateEmailRequestAddress = CreateEmailRequestAddress; +exports.CreateEmailRequestAttachment = CreateEmailRequestAttachment; +exports.CreateEmailRequestHeader = CreateEmailRequestHeader; +exports.CreateWebhookRequest = CreateWebhookRequest; +exports.ListDomainsRequest = ListDomainsRequest; +exports.ListEmailsRequest = ListEmailsRequest; +exports.ListWebhookEventsRequest = ListWebhookEventsRequest; +exports.ListWebhooksRequest = ListWebhooksRequest; +exports.UpdateProjectSettingsRequestUpdatePeriodicReport = UpdateProjectSettingsRequestUpdatePeriodicReport; +exports.UpdateWebhookRequest = UpdateWebhookRequest; - /** - * Waits for {@link Instance} to be in a final state. - * - * @param request - The request {@link GetInstanceRequest} - * @param options - The waiting options - * @returns A Promise of Instance - */ - waitForInstance = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!INSTANCE_TRANSIENT_STATUSES.includes(res.status))), this.getInstance, request, options); - /** - * Create a Database Instance. Create a new Database Instance. You must set - * the `engine`, `user_name`, `password` and `node_type` parameters. - * Optionally, you can specify the volume type and size. - * - * @param request - The request {@link CreateInstanceRequest} - * @returns A Promise of Instance - */ - createInstance = request => this.client.fetch({ - body: JSON.stringify(marshalCreateInstanceRequest(request, this.client.settings)), - headers: jsonContentHeaders$9, - method: 'POST', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances` - }, unmarshalInstance); +/***/ }), - /** - * Update a Database Instance. Update the parameters of a Database Instance, - * including name, tags and backup schedule details. - * - * @param request - The request {@link UpdateInstanceRequest} - * @returns A Promise of Instance - */ - updateInstance = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateInstanceRequest(request, this.client.settings)), - headers: jsonContentHeaders$9, - method: 'PATCH', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}` - }, unmarshalInstance); +/***/ 9144: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - /** - * Delete a Database Instance. Delete a given Database Instance, specified by - * the `region` and `instance_id` parameters. Deleting a Database Instance is - * permanent, and cannot be undone. Note that upon deletion all your data will - * be lost. - * - * @param request - The request {@link DeleteInstanceRequest} - * @returns A Promise of Instance - */ - deleteInstance = request => this.client.fetch({ - method: 'DELETE', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}` - }, unmarshalInstance); +"use strict"; - /** - * Clone a Database Instance. Clone a given Database Instance, specified by - * the `region` and `instance_id` parameters. The clone feature allows you to - * create a new Database Instance from an existing one. The clone includes all - * existing databases, users and permissions. You can create a clone on a - * Database Instance bigger than your current one. - * - * @param request - The request {@link CloneInstanceRequest} - * @returns A Promise of Instance - */ - cloneInstance = request => this.client.fetch({ - body: JSON.stringify(marshalCloneInstanceRequest(request, this.client.settings)), - headers: jsonContentHeaders$9, - method: 'POST', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/clone` - }, unmarshalInstance); +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const index_gen = __nccwpck_require__(5002); +exports.v1 = index_gen; - /** - * Restart Database Instance. Restart a given Database Instance, specified by - * the `region` and `instance_id` parameters. The status of the Database - * Instance returned in the response. - * - * @param request - The request {@link RestartInstanceRequest} - * @returns A Promise of Instance - */ - restartInstance = request => this.client.fetch({ - body: '{}', - headers: jsonContentHeaders$9, - method: 'POST', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/restart` - }, unmarshalInstance); - /** - * Get the TLS certificate of a Database Instance. Retrieve information about - * the TLS certificate of a given Database Instance. Details like name and - * content are returned in the response. - * - * @param request - The request {@link GetInstanceCertificateRequest} - * @returns A Promise of Blob - */ - getInstanceCertificate = request => this.client.fetch({ - method: 'GET', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/certificate`, - urlParams: urlParams(['dl', 1]), - responseType: 'blob' - }); +/***/ }), - /** - * Renew the TLS certificate of a Database Instance. Renew a TLS for a - * Database Instance. Renewing a certificate means that you will not be able - * to connect to your Database Instance using the previous certificate. You - * will also need to download and update the new certificate for all database - * clients. - * - * @param request - The request {@link RenewInstanceCertificateRequest} - */ - renewInstanceCertificate = request => this.client.fetch({ - body: '{}', - headers: jsonContentHeaders$9, - method: 'POST', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/renew-certificate` - }); +/***/ 1714: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - /** - * Get Database Instance metrics. Retrieve the time series metrics of a given - * Database Instance. You can define the period from which to retrieve metrics - * by specifying the `start_date` and `end_date`. - * - * @param request - The request {@link GetInstanceMetricsRequest} - * @returns A Promise of InstanceMetrics - */ - getInstanceMetrics = request => this.client.fetch({ - method: 'GET', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/metrics`, - urlParams: urlParams(['end_date', request.endDate], ['metric_name', request.metricName], ['start_date', request.startDate]) - }, unmarshalInstanceMetrics); +"use strict"; +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const intervalRetrier = __nccwpck_require__(9052); +const api = __nccwpck_require__(3042); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const resourcePaginator = __nccwpck_require__(4983); +const content_gen = __nccwpck_require__(2245); +const marshalling_gen = __nccwpck_require__(1332); +const jsonContentHeaders = { + "Content-Type": "application/json; charset=utf-8" +}; +class API extends api.API { /** - * Create a Read Replica. Create a new Read Replica of a Database Instance. - * You must specify the `region` and the `instance_id`. You can only create a - * maximum of 3 Read Replicas per Database Instance. + * Register a user. Register a human and return a access-key and a secret-key + * that must be used in all other commands. * - * @param request - The request {@link CreateReadReplicaRequest} - * @returns A Promise of ReadReplica - */ - createReadReplica = request => this.client.fetch({ - body: JSON.stringify(marshalCreateReadReplicaRequest(request, this.client.settings)), - headers: jsonContentHeaders$9, - method: 'POST', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/read-replicas` - }, unmarshalReadReplica); - - /** - * Get a Read Replica. Retrieve information about a Database Instance Read - * Replica. Full details about the Read Replica, like `endpoints`, `status` - * and `region` are returned in the response. + * Hint: you can use other test commands by setting the SCW_SECRET_KEY env + * variable. * - * @param request - The request {@link GetReadReplicaRequest} - * @returns A Promise of ReadReplica + * @param request - The request {@link RegisterRequest} + * @returns A Promise of RegisterResponse */ - getReadReplica = request => this.client.fetch({ - method: 'GET', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/read-replicas/${validatePathParam('readReplicaId', request.readReplicaId)}` - }, unmarshalReadReplica); - + register = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalRegisterRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/test/v1/register` + }, + marshalling_gen.unmarshalRegisterResponse + ); + pageOfListHumans = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/test/v1/humans`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId] + ) + }, + marshalling_gen.unmarshalListHumansResponse + ); /** - * Waits for {@link ReadReplica} to be in a final state. + * List all your humans. * - * @param request - The request {@link GetReadReplicaRequest} - * @param options - The waiting options - * @returns A Promise of ReadReplica + * @param request - The request {@link ListHumansRequest} + * @returns A Promise of ListHumansResponse */ - waitForReadReplica = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!READ_REPLICA_TRANSIENT_STATUSES.includes(res.status))), this.getReadReplica, request, options); - + listHumans = (request = {}) => resourcePaginator.enrichForPagination("humans", this.pageOfListHumans, request); /** - * Delete a Read Replica. Delete a Read Replica of a Database Instance. You - * must specify the `region` and `read_replica_id` parameters of the Read - * Replica you want to delete. + * Get human details. Get the human details associated with the given id. * - * @param request - The request {@link DeleteReadReplicaRequest} - * @returns A Promise of ReadReplica + * @param request - The request {@link GetHumanRequest} + * @returns A Promise of Human */ - deleteReadReplica = request => this.client.fetch({ - method: 'DELETE', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/read-replicas/${validatePathParam('readReplicaId', request.readReplicaId)}` - }, unmarshalReadReplica); - + getHuman = (request) => this.client.fetch( + { + method: "GET", + path: `/test/v1/humans/${marshalling.validatePathParam("humanId", request.humanId)}` + }, + marshalling_gen.unmarshalHuman + ); /** - * Resync a Read Replica. When you resync a Read Replica, first it is reset, - * then its data is resynchronized from the primary node. Your Read Replica - * remains unavailable during the resync process. The duration of this process - * is proportional to the size of your Database Instance. The configured - * endpoints do not change. + * Waits for {@link Human} to be in a final state. * - * @param request - The request {@link ResetReadReplicaRequest} - * @returns A Promise of ReadReplica + * @param request - The request {@link GetHumanRequest} + * @param options - The waiting options + * @returns A Promise of Human */ - resetReadReplica = request => this.client.fetch({ - body: '{}', - headers: jsonContentHeaders$9, - method: 'POST', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/read-replicas/${validatePathParam('readReplicaId', request.readReplicaId)}/reset` - }, unmarshalReadReplica); - + waitForHuman = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve(!content_gen.HUMAN_TRANSIENT_STATUSES.includes(res.status))), + this.getHuman, + request, + options + ); /** - * Promote a Read Replica. Promote a Read Replica to Database Instance - * automatically. + * Create a new human. * - * @param request - The request {@link PromoteReadReplicaRequest} - * @returns A Promise of Instance + * @param request - The request {@link CreateHumanRequest} + * @returns A Promise of Human */ - promoteReadReplica = request => this.client.fetch({ - body: '{}', - headers: jsonContentHeaders$9, - method: 'POST', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/read-replicas/${validatePathParam('readReplicaId', request.readReplicaId)}/promote` - }, unmarshalInstance); - + createHuman = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateHumanRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/test/v1/humans` + }, + marshalling_gen.unmarshalHuman + ); /** - * Create an endpoint for a Read Replica. Create a new endpoint for a Read - * Replica. Read Replicas can have at most one direct access and one Private - * Network endpoint. + * Update an existing human. Update the human associated with the given id. * - * @param request - The request {@link CreateReadReplicaEndpointRequest} - * @returns A Promise of ReadReplica + * @param request - The request {@link UpdateHumanRequest} + * @returns A Promise of Human */ - createReadReplicaEndpoint = request => this.client.fetch({ - body: JSON.stringify(marshalCreateReadReplicaEndpointRequest(request, this.client.settings)), - headers: jsonContentHeaders$9, - method: 'POST', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/read-replicas/${validatePathParam('readReplicaId', request.readReplicaId)}/endpoints` - }, unmarshalReadReplica); - + updateHuman = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateHumanRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/test/v1/humans/${marshalling.validatePathParam("humanId", request.humanId)}` + }, + marshalling_gen.unmarshalHuman + ); /** - * Prepare logs of a Database Instance. Prepare your Database Instance logs. - * You can define the `start_date` and `end_date` parameters for your query. - * The download URL is returned in the response. Logs are recorded from 00h00 - * to 23h59 and then aggregated in a `.log` file once a day. Therefore, even - * if you specify a timeframe from which you want to get the logs, you will - * receive logs from the full 24 hours. + * Delete an existing human. Delete the human associated with the given id. * - * @param request - The request {@link PrepareInstanceLogsRequest} - * @returns A Promise of PrepareInstanceLogsResponse + * @param request - The request {@link DeleteHumanRequest} + * @returns A Promise of Human */ - prepareInstanceLogs = request => this.client.fetch({ - body: JSON.stringify(marshalPrepareInstanceLogsRequest(request, this.client.settings)), - headers: jsonContentHeaders$9, - method: 'POST', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/prepare-logs` - }, unmarshalPrepareInstanceLogsResponse); - + deleteHuman = (request) => this.client.fetch( + { + method: "DELETE", + path: `/test/v1/humans/${marshalling.validatePathParam("humanId", request.humanId)}` + }, + marshalling_gen.unmarshalHuman + ); /** - * List available logs of a Database Instance. List the available logs of a - * Database Instance. By default, the logs returned in the list are ordered by - * creation date in ascending order, though this can be modified via the - * order_by field. + * Start a 1h running for the given human. Start a one hour running for the + * given human. * - * @param request - The request {@link ListInstanceLogsRequest} - * @returns A Promise of ListInstanceLogsResponse + * @param request - The request {@link RunHumanRequest} + * @returns A Promise of Human */ - listInstanceLogs = request => this.client.fetch({ - method: 'GET', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/logs`, - urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc']) - }, unmarshalListInstanceLogsResponse); - + runHuman = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/test/v1/humans/${marshalling.validatePathParam("humanId", request.humanId)}/run` + }, + marshalling_gen.unmarshalHuman + ); /** - * Get given logs of a Database Instance. Retrieve information about the logs - * of a Database Instance. Specify the `instance_log_id` and `region` in your - * request to get information such as `download_url`, `status`, `expires_at` - * and `created_at` about your logs in the response. + * Make a human smoke. * - * @param request - The request {@link GetInstanceLogRequest} - * @returns A Promise of InstanceLog + * @deprecated + * @param request - The request {@link SmokeHumanRequest} + * @returns A Promise of Human */ - getInstanceLog = request => this.client.fetch({ - method: 'GET', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/logs/${validatePathParam('instanceLogId', request.instanceLogId)}` - }, unmarshalInstanceLog); + smokeHuman = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/test/v1/humans/${marshalling.validatePathParam("humanId", request.humanId)}/smoke` + }, + marshalling_gen.unmarshalHuman + ); +} +exports.API = API; + + +/***/ }), + +/***/ 2245: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const HUMAN_TRANSIENT_STATUSES = ["running"]; +exports.HUMAN_TRANSIENT_STATUSES = HUMAN_TRANSIENT_STATUSES; + + +/***/ }), + +/***/ 5002: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api_gen = __nccwpck_require__(1714); +const content_gen = __nccwpck_require__(2245); +exports.API = api_gen.API; +exports.HUMAN_TRANSIENT_STATUSES = content_gen.HUMAN_TRANSIENT_STATUSES; + + +/***/ }), + +/***/ 1332: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const json = __nccwpck_require__(3746); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const unmarshalHuman = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Human' failed as data isn't a dictionary.` + ); + } + return { + altitudeInMeter: data.altitude_in_meter, + altitudeInMillimeter: data.altitude_in_millimeter, + createdAt: marshalling.unmarshalDate(data.created_at), + eyesColor: data.eyes_color, + fingersCount: data.fingers_count, + hairCount: data.hair_count, + height: data.height, + id: data.id, + isHappy: data.is_happy, + name: data.name, + organizationId: data.organization_id, + projectId: data.project_id, + shoeSize: data.shoe_size, + status: data.status, + updatedAt: marshalling.unmarshalDate(data.updated_at) + }; +}; +const unmarshalListHumansResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListHumansResponse' failed as data isn't a dictionary.` + ); + } + return { + humans: marshalling.unmarshalArrayOfObject(data.humans, unmarshalHuman), + totalCount: data.total_count + }; +}; +const unmarshalRegisterResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'RegisterResponse' failed as data isn't a dictionary.` + ); + } + return { + accessKey: data.access_key, + secretKey: data.secret_key + }; +}; +const marshalCreateHumanRequest = (request, defaults) => ({ + altitude_in_meter: request.altitudeInMeter, + altitude_in_millimeter: request.altitudeInMillimeter, + eyes_color: request.eyesColor, + fingers_count: request.fingersCount, + hair_count: request.hairCount, + height: request.height, + is_happy: request.isHappy, + name: request.name, + shoe_size: request.shoeSize, + ...marshalling.resolveOneOf([ + { + default: defaults.defaultProjectId, + param: "project_id", + value: request.projectId + }, + { + default: defaults.defaultOrganizationId, + param: "organization_id", + value: request.organizationId + } + ]) +}); +const marshalRegisterRequest = (request, defaults) => ({ + username: request.username +}); +const marshalUpdateHumanRequest = (request, defaults) => ({ + altitude_in_meter: request.altitudeInMeter, + altitude_in_millimeter: request.altitudeInMillimeter, + eyes_color: request.eyesColor, + fingers_count: request.fingersCount, + hair_count: request.hairCount, + height: request.height, + is_happy: request.isHappy, + name: request.name, + shoe_size: request.shoeSize +}); +exports.marshalCreateHumanRequest = marshalCreateHumanRequest; +exports.marshalRegisterRequest = marshalRegisterRequest; +exports.marshalUpdateHumanRequest = marshalUpdateHumanRequest; +exports.unmarshalHuman = unmarshalHuman; +exports.unmarshalListHumansResponse = unmarshalListHumansResponse; +exports.unmarshalRegisterResponse = unmarshalRegisterResponse; + + +/***/ }), + +/***/ 911: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const index_gen = __nccwpck_require__(5595); +const index_gen$1 = __nccwpck_require__(924); +exports.v1 = index_gen; +exports.v2 = index_gen$1; + +/***/ }), + +/***/ 5675: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api = __nccwpck_require__(3042); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const resourcePaginator = __nccwpck_require__(4983); +const marshalling_gen = __nccwpck_require__(6217); +const jsonContentHeaders = { + "Content-Type": "application/json; charset=utf-8" +}; +class API extends api.API { + /** Lists the available zones of the API. */ + static LOCALITIES = [ + "fr-par-1", + "fr-par-2", + "fr-par-3", + "nl-ams-1", + "nl-ams-2", + "nl-ams-3", + "pl-waw-1", + "pl-waw-2" + ]; + pageOfListPrivateNetworks = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/vpc/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/private-networks`, + urlParams: marshalling.urlParams( + ["include_regional", request.includeRegional], + ["name", request.name], + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["private_network_ids", request.privateNetworkIds], + ["project_id", request.projectId], + ["tags", request.tags] + ) + }, + marshalling_gen.unmarshalListPrivateNetworksResponse + ); /** - * Waits for {@link InstanceLog} to be in a final state. + * List Private Networks. List existing Private Networks in a specified + * Availability Zone. By default, the Private Networks returned in the list + * are ordered by creation date in ascending order, though this can be + * modified via the order_by field. * - * @param request - The request {@link GetInstanceLogRequest} - * @param options - The waiting options - * @returns A Promise of InstanceLog + * @param request - The request {@link ListPrivateNetworksRequest} + * @returns A Promise of ListPrivateNetworksResponse */ - waitForInstanceLog = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!INSTANCE_LOG_TRANSIENT_STATUSES.includes(res.status))), this.getInstanceLog, request, options); - + listPrivateNetworks = (request = {}) => resourcePaginator.enrichForPagination( + "privateNetworks", + this.pageOfListPrivateNetworks, + request + ); /** - * Purge remote Database Instance logs. Purge a given remote log from a - * Database Instance. You can specify the `log_name` of the log you wish to - * clean from your Database Instance. + * Create a Private Network. Create a new Private Network. Once created, you + * can attach Scaleway resources in the same Availability Zone. * - * @param request - The request {@link PurgeInstanceLogsRequest} + * @param request - The request {@link CreatePrivateNetworkRequest} + * @returns A Promise of PrivateNetwork */ - purgeInstanceLogs = request => this.client.fetch({ - body: JSON.stringify(marshalPurgeInstanceLogsRequest(request, this.client.settings)), - headers: jsonContentHeaders$9, - method: 'POST', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/purge-logs` - }); - + createPrivateNetwork = (request = {}) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreatePrivateNetworkRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/vpc/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/private-networks` + }, + marshalling_gen.unmarshalPrivateNetwork + ); /** - * List remote Database Instance logs details. List remote log details. By - * default, the details returned in the list are ordered by creation date in - * ascending order, though this can be modified via the order_by field. + * Get a Private Network. Retrieve information about an existing Private + * Network, specified by its Private Network ID. Its full details are returned + * in the response object. * - * @param request - The request {@link ListInstanceLogsDetailsRequest} - * @returns A Promise of ListInstanceLogsDetailsResponse + * @param request - The request {@link GetPrivateNetworkRequest} + * @returns A Promise of PrivateNetwork */ - listInstanceLogsDetails = request => this.client.fetch({ - method: 'GET', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/logs-details` - }, unmarshalListInstanceLogsDetailsResponse); - + getPrivateNetwork = (request) => this.client.fetch( + { + method: "GET", + path: `/vpc/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/private-networks/${marshalling.validatePathParam("privateNetworkId", request.privateNetworkId)}` + }, + marshalling_gen.unmarshalPrivateNetwork + ); /** - * Add Database Instance advanced settings. Add an advanced setting to a - * Database Instance. You must set the `name` and the `value` of each - * setting. + * Update Private Network. Update parameters (such as name or tags) of an + * existing Private Network, specified by its Private Network ID. * - * @param request - The request {@link AddInstanceSettingsRequest} - * @returns A Promise of AddInstanceSettingsResponse + * @param request - The request {@link UpdatePrivateNetworkRequest} + * @returns A Promise of PrivateNetwork */ - addInstanceSettings = request => this.client.fetch({ - body: JSON.stringify(marshalAddInstanceSettingsRequest(request, this.client.settings)), - headers: jsonContentHeaders$9, - method: 'POST', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/settings` - }, unmarshalAddInstanceSettingsResponse); - + updatePrivateNetwork = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdatePrivateNetworkRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/vpc/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/private-networks/${marshalling.validatePathParam("privateNetworkId", request.privateNetworkId)}` + }, + marshalling_gen.unmarshalPrivateNetwork + ); /** - * Delete Database Instance advanced settings. Delete an advanced setting in a - * Database Instance. You must specify the names of the settings you want to - * delete in the request. + * Delete a Private Network. Delete an existing Private Network. Note that you + * must first detach all resources from the network, in order to delete it. * - * @param request - The request {@link DeleteInstanceSettingsRequest} - * @returns A Promise of DeleteInstanceSettingsResponse + * @param request - The request {@link DeletePrivateNetworkRequest} */ - deleteInstanceSettings = request => this.client.fetch({ - body: JSON.stringify(marshalDeleteInstanceSettingsRequest(request, this.client.settings)), - headers: jsonContentHeaders$9, - method: 'DELETE', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/settings` - }, unmarshalDeleteInstanceSettingsResponse); + deletePrivateNetwork = (request) => this.client.fetch({ + method: "DELETE", + path: `/vpc/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/private-networks/${marshalling.validatePathParam("privateNetworkId", request.privateNetworkId)}` + }); +} +exports.API = API; + + +/***/ }), + +/***/ 5595: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api_gen = __nccwpck_require__(5675); +exports.API = api_gen.API; + + +/***/ }), + +/***/ 6217: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const randomName = __nccwpck_require__(8141); +const json = __nccwpck_require__(3746); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const unmarshalPrivateNetwork = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'PrivateNetwork' failed as data isn't a dictionary.` + ); + } + return { + createdAt: marshalling.unmarshalDate(data.created_at), + id: data.id, + name: data.name, + organizationId: data.organization_id, + projectId: data.project_id, + subnets: data.subnets, + tags: data.tags, + updatedAt: marshalling.unmarshalDate(data.updated_at), + zone: data.zone + }; +}; +const unmarshalListPrivateNetworksResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListPrivateNetworksResponse' failed as data isn't a dictionary.` + ); + } + return { + privateNetworks: marshalling.unmarshalArrayOfObject( + data.private_networks, + unmarshalPrivateNetwork + ), + totalCount: data.total_count + }; +}; +const marshalCreatePrivateNetworkRequest = (request, defaults) => ({ + name: request.name || randomName("pn"), + project_id: request.projectId ?? defaults.defaultProjectId, + subnets: request.subnets, + tags: request.tags +}); +const marshalUpdatePrivateNetworkRequest = (request, defaults) => ({ + name: request.name, + subnets: request.subnets, + tags: request.tags +}); +exports.marshalCreatePrivateNetworkRequest = marshalCreatePrivateNetworkRequest; +exports.marshalUpdatePrivateNetworkRequest = marshalUpdatePrivateNetworkRequest; +exports.unmarshalListPrivateNetworksResponse = unmarshalListPrivateNetworksResponse; +exports.unmarshalPrivateNetwork = unmarshalPrivateNetwork; - /** - * Set Database Instance advanced settings. Update an advanced setting for a - * Database Instance. Settings added upon database engine initalization can - * only be defined once, and cannot, therefore, be updated. - * - * @param request - The request {@link SetInstanceSettingsRequest} - * @returns A Promise of SetInstanceSettingsResponse - */ - setInstanceSettings = request => this.client.fetch({ - body: JSON.stringify(marshalSetInstanceSettingsRequest(request, this.client.settings)), - headers: jsonContentHeaders$9, - method: 'PUT', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/settings` - }, unmarshalSetInstanceSettingsResponse); - pageOfListInstanceACLRules = request => this.client.fetch({ - method: 'GET', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/acls`, - urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]) - }, unmarshalListInstanceACLRulesResponse); - /** - * List ACL rules of a Database Instance. List the ACL rules for a given - * Database Instance. The response is an array of ACL objects, each one - * representing an ACL that denies, allows or redirects traffic based on - * certain conditions. - * - * @param request - The request {@link ListInstanceACLRulesRequest} - * @returns A Promise of ListInstanceACLRulesResponse - */ - listInstanceACLRules = request => enrichForPagination('rules', this.pageOfListInstanceACLRules, request); +/***/ }), - /** - * Add an ACL rule to a Database Instance. Add an additional ACL rule to a - * Database Instance. - * - * @param request - The request {@link AddInstanceACLRulesRequest} - * @returns A Promise of AddInstanceACLRulesResponse - */ - addInstanceACLRules = request => this.client.fetch({ - body: JSON.stringify(marshalAddInstanceACLRulesRequest(request, this.client.settings)), - headers: jsonContentHeaders$9, - method: 'POST', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/acls` - }, unmarshalAddInstanceACLRulesResponse); +/***/ 3424: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - /** - * Set ACL rules for a Database Instance. Replace all the ACL rules of a - * Database Instance. - * - * @param request - The request {@link SetInstanceACLRulesRequest} - * @returns A Promise of SetInstanceACLRulesResponse - */ - setInstanceACLRules = request => this.client.fetch({ - body: JSON.stringify(marshalSetInstanceACLRulesRequest(request, this.client.settings)), - headers: jsonContentHeaders$9, - method: 'PUT', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/acls` - }, unmarshalSetInstanceACLRulesResponse); +"use strict"; +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api = __nccwpck_require__(3042); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const resourcePaginator = __nccwpck_require__(4983); +const marshalling_gen = __nccwpck_require__(5626); +const jsonContentHeaders = { + "Content-Type": "application/json; charset=utf-8" +}; +class API extends api.API { + /** Lists the available regions of the API. */ + static LOCALITIES = ["fr-par", "nl-ams", "pl-waw"]; + pageOfListVPCs = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/vpc/v2/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs`, + urlParams: marshalling.urlParams( + ["is_default", request.isDefault], + ["name", request.name], + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId], + ["routing_enabled", request.routingEnabled], + ["tags", request.tags] + ) + }, + marshalling_gen.unmarshalListVPCsResponse + ); /** - * Delete ACL rules of a Database Instance. Delete one or more ACL rules of a - * Database Instance. + * List VPCs. List existing VPCs in the specified region. * - * @param request - The request {@link DeleteInstanceACLRulesRequest} - * @returns A Promise of DeleteInstanceACLRulesResponse + * @param request - The request {@link ListVPCsRequest} + * @returns A Promise of ListVPCsResponse */ - deleteInstanceACLRules = request => this.client.fetch({ - body: JSON.stringify(marshalDeleteInstanceACLRulesRequest(request, this.client.settings)), - headers: jsonContentHeaders$9, - method: 'DELETE', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/acls` - }, unmarshalDeleteInstanceACLRulesResponse); - pageOfListUsers = request => this.client.fetch({ - method: 'GET', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/users`, - urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'name_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]) - }, unmarshalListUsersResponse); - + listVPCs = (request = {}) => resourcePaginator.enrichForPagination("vpcs", this.pageOfListVPCs, request); /** - * List users of a Database Instance. List all users of a given Database - * Instance. By default, the users returned in the list are ordered by - * creation date in ascending order, though this can be modified via the - * order_by field. + * Create a VPC. Create a new VPC in the specified region. * - * @param request - The request {@link ListUsersRequest} - * @returns A Promise of ListUsersResponse + * @param request - The request {@link CreateVPCRequest} + * @returns A Promise of VPC */ - listUsers = request => enrichForPagination('users', this.pageOfListUsers, request); - + createVPC = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateVPCRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/vpc/v2/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs` + }, + marshalling_gen.unmarshalVPC + ); /** - * Create a user for a Database Instance. Create a new user for a Database - * Instance. You must define the `name`, `password` and `is_admin` - * parameters. + * Get a VPC. Retrieve details of an existing VPC, specified by its VPC ID. * - * @param request - The request {@link CreateUserRequest} - * @returns A Promise of User + * @param request - The request {@link GetVPCRequest} + * @returns A Promise of VPC */ - createUser = request => this.client.fetch({ - body: JSON.stringify(marshalCreateUserRequest(request, this.client.settings)), - headers: jsonContentHeaders$9, - method: 'POST', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/users` - }, unmarshalUser); - + getVPC = (request) => this.client.fetch( + { + method: "GET", + path: `/vpc/v2/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs/${marshalling.validatePathParam("vpcId", request.vpcId)}` + }, + marshalling_gen.unmarshalVPC + ); /** - * Update a user on a Database Instance. Update the parameters of a user on a - * Database Instance. You can update the `password` and `is_admin` parameters, - * but you cannot change the name of the user. + * Update VPC. Update parameters including name and tags of the specified VPC. * - * @param request - The request {@link UpdateUserRequest} - * @returns A Promise of User + * @param request - The request {@link UpdateVPCRequest} + * @returns A Promise of VPC */ - updateUser = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateUserRequest(request, this.client.settings)), - headers: jsonContentHeaders$9, - method: 'PATCH', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/users/${validatePathParam('name', request.name)}` - }, unmarshalUser); - + updateVPC = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateVPCRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/vpc/v2/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs/${marshalling.validatePathParam("vpcId", request.vpcId)}` + }, + marshalling_gen.unmarshalVPC + ); /** - * Delete a user on a Database Instance. Delete a given user on a Database - * Instance. You must specify, in the endpoint, the `region`, `instance_id` - * and `name` parameters of the user you want to delete. + * Delete a VPC. Delete a VPC specified by its VPC ID. * - * @param request - The request {@link DeleteUserRequest} + * @param request - The request {@link DeleteVPCRequest} */ - deleteUser = request => this.client.fetch({ - method: 'DELETE', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/users/${validatePathParam('name', request.name)}` + deleteVPC = (request) => this.client.fetch({ + method: "DELETE", + path: `/vpc/v2/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs/${marshalling.validatePathParam("vpcId", request.vpcId)}` }); - pageOfListDatabases = request => this.client.fetch({ - method: 'GET', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/databases`, - urlParams: urlParams(['managed', request.managed], ['name', request.name], ['order_by', request.orderBy ?? 'name_asc'], ['owner', request.owner], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]) - }, unmarshalListDatabasesResponse); - + pageOfListPrivateNetworks = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/vpc/v2/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks`, + urlParams: marshalling.urlParams( + ["dhcp_enabled", request.dhcpEnabled], + ["name", request.name], + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["private_network_ids", request.privateNetworkIds], + ["project_id", request.projectId], + ["tags", request.tags], + ["vpc_id", request.vpcId] + ) + }, + marshalling_gen.unmarshalListPrivateNetworksResponse + ); /** - * List databases in a Database Instance. List all databases of a given - * Database Instance. By default, the databases returned in the list are - * ordered by creation date in ascending order, though this can be modified - * via the order_by field. You can define additional parameters for your - * query, such as `name`, `managed` and `owner`. + * List Private Networks. List existing Private Networks in the specified + * region. By default, the Private Networks returned in the list are ordered + * by creation date in ascending order, though this can be modified via the + * order_by field. * - * @param request - The request {@link ListDatabasesRequest} - * @returns A Promise of ListDatabasesResponse + * @param request - The request {@link ListPrivateNetworksRequest} + * @returns A Promise of ListPrivateNetworksResponse */ - listDatabases = request => enrichForPagination('databases', this.pageOfListDatabases, request); - + listPrivateNetworks = (request = {}) => resourcePaginator.enrichForPagination( + "privateNetworks", + this.pageOfListPrivateNetworks, + request + ); /** - * Create a database in a Database Instance. Create a new database. You must - * define the `name` parameter in the request. + * Create a Private Network. Create a new Private Network. Once created, you + * can attach Scaleway resources which are in the same region. * - * @param request - The request {@link CreateDatabaseRequest} - * @returns A Promise of Database + * @param request - The request {@link CreatePrivateNetworkRequest} + * @returns A Promise of PrivateNetwork */ - createDatabase = request => this.client.fetch({ - body: JSON.stringify(marshalCreateDatabaseRequest(request, this.client.settings)), - headers: jsonContentHeaders$9, - method: 'POST', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/databases` - }, unmarshalDatabase); - + createPrivateNetwork = (request = {}) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreatePrivateNetworkRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/vpc/v2/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks` + }, + marshalling_gen.unmarshalPrivateNetwork + ); /** - * Delete a database in a Database Instance. Delete a given database on a - * Database Instance. You must specify, in the endpoint, the `region`, - * `instance_id` and `name` parameters of the database you want to delete. + * Get a Private Network. Retrieve information about an existing Private + * Network, specified by its Private Network ID. Its full details are returned + * in the response object. * - * @param request - The request {@link DeleteDatabaseRequest} + * @param request - The request {@link GetPrivateNetworkRequest} + * @returns A Promise of PrivateNetwork */ - deleteDatabase = request => this.client.fetch({ - method: 'DELETE', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/databases/${validatePathParam('name', request.name)}` - }); - pageOfListPrivileges = request => this.client.fetch({ - method: 'GET', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/privileges`, - urlParams: urlParams(['database_name', request.databaseName], ['order_by', request.orderBy ?? 'user_name_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['user_name', request.userName]) - }, unmarshalListPrivilegesResponse); - + getPrivateNetwork = (request) => this.client.fetch( + { + method: "GET", + path: `/vpc/v2/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks/${marshalling.validatePathParam("privateNetworkId", request.privateNetworkId)}` + }, + marshalling_gen.unmarshalPrivateNetwork + ); /** - * List user privileges for a database. List privileges of a user on a - * database. By default, the details returned in the list are ordered by - * creation date in ascending order, though this can be modified via the - * order_by field. You can define additional parameters for your query, such - * as `database_name` and `user_name`. + * Update Private Network. Update parameters (such as name or tags) of an + * existing Private Network, specified by its Private Network ID. * - * @param request - The request {@link ListPrivilegesRequest} - * @returns A Promise of ListPrivilegesResponse + * @param request - The request {@link UpdatePrivateNetworkRequest} + * @returns A Promise of PrivateNetwork */ - listPrivileges = request => enrichForPagination('privileges', this.pageOfListPrivileges, request); - + updatePrivateNetwork = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdatePrivateNetworkRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/vpc/v2/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks/${marshalling.validatePathParam("privateNetworkId", request.privateNetworkId)}` + }, + marshalling_gen.unmarshalPrivateNetwork + ); /** - * Set user privileges for a database. Set the privileges of a user on a - * database. You must define `database_name`, `user_name` and `permission` in - * the request body. + * Delete a Private Network. Delete an existing Private Network. Note that you + * must first detach all resources from the network, in order to delete it. * - * @param request - The request {@link SetPrivilegeRequest} - * @returns A Promise of Privilege + * @param request - The request {@link DeletePrivateNetworkRequest} */ - setPrivilege = request => this.client.fetch({ - body: JSON.stringify(marshalSetPrivilegeRequest(request, this.client.settings)), - headers: jsonContentHeaders$9, - method: 'PUT', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/privileges` - }, unmarshalPrivilege); - pageOfListSnapshots = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/snapshots`, - urlParams: urlParams(['instance_id', request.instanceId], ['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId]) - }, unmarshalListSnapshotsResponse); - + deletePrivateNetwork = (request) => this.client.fetch({ + method: "DELETE", + path: `/vpc/v2/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks/${marshalling.validatePathParam("privateNetworkId", request.privateNetworkId)}` + }); /** - * List snapshots. List snapshots. You can include the `instance_id` or - * `project_id` in your query to get the list of snapshots for specific - * Database Instances and/or Projects. By default, the details returned in the - * list are ordered by creation date in ascending order, though this can be - * modified via the `order_by` field. + * Migrate Private Networks from zoned to regional. Transform multiple + * existing zoned Private Networks (scoped to a single Availability Zone) into + * regional Private Networks, scoped to an entire region. You can transform + * one or many Private Networks (specified by their Private Network IDs) + * within a single Scaleway Organization or Project, with the same call. * - * @param request - The request {@link ListSnapshotsRequest} - * @returns A Promise of ListSnapshotsResponse + * @param request - The request {@link MigrateZonalPrivateNetworksRequest} */ - listSnapshots = (request = {}) => enrichForPagination('snapshots', this.pageOfListSnapshots, request); - + migrateZonalPrivateNetworks = (request = {}) => this.client.fetch({ + body: JSON.stringify( + marshalling_gen.marshalMigrateZonalPrivateNetworksRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/vpc/v2/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks/migrate-zonal` + }); /** - * Get a Database Instance snapshot. Retrieve information about a given - * snapshot, specified by its `snapshot_id` and `region`. Full details about - * the snapshot, like size and expiration date, are returned in the response. + * Enable DHCP on a Private Network. Enable DHCP managed on an existing + * Private Network. Note that you will not be able to deactivate it + * afterwards. * - * @param request - The request {@link GetSnapshotRequest} - * @returns A Promise of Snapshot + * @param request - The request {@link EnableDHCPRequest} + * @returns A Promise of PrivateNetwork */ - getSnapshot = request => this.client.fetch({ - method: 'GET', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/snapshots/${validatePathParam('snapshotId', request.snapshotId)}` - }, unmarshalSnapshot); - + enableDHCP = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/vpc/v2/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks/${marshalling.validatePathParam("privateNetworkId", request.privateNetworkId)}/enable-dhcp` + }, + marshalling_gen.unmarshalPrivateNetwork + ); /** - * Waits for {@link Snapshot} to be in a final state. + * Enable routing on a VPC. Enable routing on an existing VPC. Note that you + * will not be able to deactivate it afterwards. * - * @param request - The request {@link GetSnapshotRequest} - * @param options - The waiting options - * @returns A Promise of Snapshot + * @param request - The request {@link EnableRoutingRequest} + * @returns A Promise of VPC */ - waitForSnapshot = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!SNAPSHOT_TRANSIENT_STATUSES.includes(res.status))), this.getSnapshot, request, options); - + enableRouting = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/vpc/v2/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/vpcs/${marshalling.validatePathParam("vpcId", request.vpcId)}/enable-routing` + }, + marshalling_gen.unmarshalVPC + ); + pageOfListSubnets = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/vpc/v2/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/subnets`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId], + ["subnet_ids", request.subnetIds], + ["vpc_id", request.vpcId] + ) + }, + marshalling_gen.unmarshalListSubnetsResponse + ); /** - * Create a Database Instance snapshot. Create a new snapshot of a Database - * Instance. You must define the `name` parameter in the request. + * List subnets. List any Private Network's subnets. See ListPrivateNetworks + * to list a specific Private Network's subnets. * - * @param request - The request {@link CreateSnapshotRequest} - * @returns A Promise of Snapshot + * @param request - The request {@link ListSubnetsRequest} + * @returns A Promise of ListSubnetsResponse */ - createSnapshot = request => this.client.fetch({ - body: JSON.stringify(marshalCreateSnapshotRequest(request, this.client.settings)), - headers: jsonContentHeaders$9, - method: 'POST', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/snapshots` - }, unmarshalSnapshot); - + listSubnets = (request = {}) => resourcePaginator.enrichForPagination("subnets", this.pageOfListSubnets, request); /** - * Update a Database Instance snapshot. Update the parameters of a snapshot of - * a Database Instance. You can update the `name` and `expires_at` - * parameters. + * Set a Private Network's subnets. Set subnets for an existing Private + * Network. Note that the method is PUT and not PATCH. Any existing subnets + * will be removed in favor of the new specified set of subnets. * - * @param request - The request {@link UpdateSnapshotRequest} - * @returns A Promise of Snapshot + * @param request - The request {@link SetSubnetsRequest} + * @returns A Promise of SetSubnetsResponse */ - updateSnapshot = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateSnapshotRequest(request, this.client.settings)), - headers: jsonContentHeaders$9, - method: 'PATCH', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/snapshots/${validatePathParam('snapshotId', request.snapshotId)}` - }, unmarshalSnapshot); - + setSubnets = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalSetSubnetsRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PUT", + path: `/vpc/v2/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks/${marshalling.validatePathParam("privateNetworkId", request.privateNetworkId)}/subnets` + }, + marshalling_gen.unmarshalSetSubnetsResponse + ); /** - * Delete a Database Instance snapshot. Delete a given snapshot of a Database - * Instance. You must specify, in the endpoint, the `region` and `snapshot_id` - * parameters of the snapshot you want to delete. + * Add subnets to a Private Network. Add new subnets to an existing Private + * Network. * - * @param request - The request {@link DeleteSnapshotRequest} - * @returns A Promise of Snapshot + * @param request - The request {@link AddSubnetsRequest} + * @returns A Promise of AddSubnetsResponse */ - deleteSnapshot = request => this.client.fetch({ - method: 'DELETE', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/snapshots/${validatePathParam('snapshotId', request.snapshotId)}` - }, unmarshalSnapshot); - + addSubnets = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalAddSubnetsRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/vpc/v2/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks/${marshalling.validatePathParam("privateNetworkId", request.privateNetworkId)}/subnets` + }, + marshalling_gen.unmarshalAddSubnetsResponse + ); /** - * Create a new Database Instance from a snapshot. Restore a snapshot. When - * you restore a snapshot, a new Instance is created and billed to your - * account. Note that is possible to select a larger node type for your new - * Database Instance. However, the Block volume size will be the same as the - * size of the restored snapshot. All Instance settings will be restored if - * you chose a node type with the same or more memory size than the initial - * Instance. Settings will be reset to the default if your node type has less - * memory. + * Delete subnets from a Private Network. Delete the specified subnets from a + * Private Network. * - * @param request - The request {@link CreateInstanceFromSnapshotRequest} - * @returns A Promise of Instance + * @param request - The request {@link DeleteSubnetsRequest} + * @returns A Promise of DeleteSubnetsResponse */ - createInstanceFromSnapshot = request => this.client.fetch({ - body: JSON.stringify(marshalCreateInstanceFromSnapshotRequest(request, this.client.settings)), - headers: jsonContentHeaders$9, - method: 'POST', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/snapshots/${validatePathParam('snapshotId', request.snapshotId)}/create-instance` - }, unmarshalInstance); - + deleteSubnets = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalDeleteSubnetsRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "DELETE", + path: `/vpc/v2/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/private-networks/${marshalling.validatePathParam("privateNetworkId", request.privateNetworkId)}/subnets` + }, + marshalling_gen.unmarshalDeleteSubnetsResponse + ); /** - * Create a new Database Instance endpoint. Create a new endpoint for a - * Database Instance. You can add `load_balancer` and `private_network` - * specifications to the body of the request. + * Create a Route. Create a new custom Route. * - * @param request - The request {@link CreateEndpointRequest} - * @returns A Promise of Endpoint + * @param request - The request {@link CreateRouteRequest} + * @returns A Promise of Route */ - createEndpoint = request => this.client.fetch({ - body: JSON.stringify(marshalCreateEndpointRequest(request, this.client.settings)), - headers: jsonContentHeaders$9, - method: 'POST', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/endpoints` - }, unmarshalEndpoint$1); - + createRoute = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateRouteRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/vpc/v2/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes` + }, + marshalling_gen.unmarshalRoute + ); /** - * Delete a Database Instance endpoint. Delete the endpoint of a Database - * Instance. You must specify the `region` and `endpoint_id` parameters of the - * endpoint you want to delete. Note that might need to update any environment - * configurations that point to the deleted endpoint. + * Get a Route. Retrieve details of an existing Route, specified by its Route + * ID. * - * @param request - The request {@link DeleteEndpointRequest} + * @param request - The request {@link GetRouteRequest} + * @returns A Promise of Route */ - deleteEndpoint = request => this.client.fetch({ - method: 'DELETE', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/endpoints/${validatePathParam('endpointId', request.endpointId)}` - }); - + getRoute = (request) => this.client.fetch( + { + method: "GET", + path: `/vpc/v2/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes/${marshalling.validatePathParam("routeId", request.routeId)}` + }, + marshalling_gen.unmarshalRoute + ); /** - * Get a Database Instance endpoint. Retrieve information about a Database - * Instance endpoint. Full details about the endpoint, like `ip`, `port`, - * `private_network` and `load_balancer` specifications are returned in the - * response. + * Update Route. Update parameters of the specified Route. * - * @param request - The request {@link GetEndpointRequest} - * @returns A Promise of Endpoint + * @param request - The request {@link UpdateRouteRequest} + * @returns A Promise of Route */ - getEndpoint = request => this.client.fetch({ - method: 'GET', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/endpoints/${validatePathParam('endpointId', request.endpointId)}` - }, unmarshalEndpoint$1); - + updateRoute = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateRouteRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/vpc/v2/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes/${marshalling.validatePathParam("routeId", request.routeId)}` + }, + marshalling_gen.unmarshalRoute + ); /** - * Migrate an existing instance endpoint to another instance. + * Delete a Route. Delete a Route specified by its Route ID. * - * @param request - The request {@link MigrateEndpointRequest} - * @returns A Promise of Endpoint + * @param request - The request {@link DeleteRouteRequest} */ - migrateEndpoint = request => this.client.fetch({ - body: JSON.stringify(marshalMigrateEndpointRequest(request, this.client.settings)), - headers: jsonContentHeaders$9, - method: 'POST', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/endpoints/${validatePathParam('endpointId', request.endpointId)}/migrate` - }, unmarshalEndpoint$1); -}; + deleteRoute = (request) => this.client.fetch({ + method: "DELETE", + path: `/vpc/v2/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/routes/${marshalling.validatePathParam("routeId", request.routeId)}` + }); +} +exports.API = API; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const UpdateInstanceRequest = { - backupScheduleStartHour: { - lessThanOrEqual: 23 - } -}; +/***/ }), -var validationRules_gen$1 = /*#__PURE__*/Object.freeze({ - __proto__: null, - UpdateInstanceRequest: UpdateInstanceRequest -}); +/***/ 924: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. +"use strict"; -var index_gen$9 = /*#__PURE__*/Object.freeze({ - __proto__: null, - API: API$9, - DATABASE_BACKUP_TRANSIENT_STATUSES: DATABASE_BACKUP_TRANSIENT_STATUSES, - INSTANCE_LOG_TRANSIENT_STATUSES: INSTANCE_LOG_TRANSIENT_STATUSES, - INSTANCE_TRANSIENT_STATUSES: INSTANCE_TRANSIENT_STATUSES, - MAINTENANCE_TRANSIENT_STATUSES: MAINTENANCE_TRANSIENT_STATUSES, - READ_REPLICA_TRANSIENT_STATUSES: READ_REPLICA_TRANSIENT_STATUSES, - SNAPSHOT_TRANSIENT_STATUSES: SNAPSHOT_TRANSIENT_STATUSES, - ValidationRules: validationRules_gen$1 -}); +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api_gen = __nccwpck_require__(3424); +const validationRules_gen = __nccwpck_require__(9403); +exports.API = api_gen.API; +exports.ValidationRules = validationRules_gen; -var index$8 = /*#__PURE__*/Object.freeze({ - __proto__: null, - v1: index_gen$9 -}); -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. +/***/ }), + +/***/ 5626: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/** Lists transient statutes of the enum {@link ClusterStatus}. */ -const CLUSTER_TRANSIENT_STATUSES = ['provisioning', 'configuring', 'deleting', 'autohealing', 'initializing']; +"use strict"; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const unmarshalPrivateNetwork$2 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'PrivateNetwork' failed as data isn't a dictionary.`); +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const randomName = __nccwpck_require__(8141); +const json = __nccwpck_require__(3746); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const unmarshalSubnet = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Subnet' failed as data isn't a dictionary.` + ); } return { + createdAt: marshalling.unmarshalDate(data.created_at), id: data.id, - provisioningMode: data.provisioning_mode, - serviceIps: data.service_ips, - zone: data.zone + privateNetworkId: data.private_network_id, + projectId: data.project_id, + subnet: data.subnet, + updatedAt: marshalling.unmarshalDate(data.updated_at), + vpcId: data.vpc_id }; }; -const unmarshalPublicNetwork = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'PublicNetwork' failed as data isn't a dictionary.`); - } - return {}; -}; -const unmarshalACLRule = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ACLRule' failed as data isn't a dictionary.`); +const unmarshalPrivateNetwork = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'PrivateNetwork' failed as data isn't a dictionary.` + ); } return { - description: data.description, + createdAt: marshalling.unmarshalDate(data.created_at), + dhcpEnabled: data.dhcp_enabled, id: data.id, - ipCidr: data.ip_cidr - }; -}; -const unmarshalAvailableClusterSetting = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'AvailableClusterSetting' failed as data isn't a dictionary.`); - } - return { - defaultValue: data.default_value, - deprecated: data.deprecated, - description: data.description, - maxValue: data.max_value, - minValue: data.min_value, - name: data.name, - regex: data.regex, - type: data.type - }; -}; -const unmarshalClusterSetting = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ClusterSetting' failed as data isn't a dictionary.`); - } - return { name: data.name, - value: data.value + organizationId: data.organization_id, + projectId: data.project_id, + region: data.region, + subnets: marshalling.unmarshalArrayOfObject(data.subnets, unmarshalSubnet), + tags: data.tags, + updatedAt: marshalling.unmarshalDate(data.updated_at), + vpcId: data.vpc_id }; }; -const unmarshalEndpoint = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Endpoint' failed as data isn't a dictionary.`); +const unmarshalRoute = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Route' failed as data isn't a dictionary.` + ); } return { + createdAt: marshalling.unmarshalDate(data.created_at), + description: data.description, + destination: data.destination, id: data.id, - ips: data.ips, - port: data.port, - privateNetwork: data.private_network ? unmarshalPrivateNetwork$2(data.private_network) : undefined, - publicNetwork: data.public_network ? unmarshalPublicNetwork(data.public_network) : undefined + isReadOnly: data.is_read_only, + nexthopPrivateNetworkId: data.nexthop_private_network_id, + nexthopResourceId: data.nexthop_resource_id, + region: data.region, + tags: data.tags, + updatedAt: marshalling.unmarshalDate(data.updated_at), + vpcId: data.vpc_id }; }; -const unmarshalCluster = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Cluster' failed as data isn't a dictionary.`); +const unmarshalVPC = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'VPC' failed as data isn't a dictionary.` + ); } return { - aclRules: unmarshalArrayOfObject(data.acl_rules, unmarshalACLRule), - clusterSettings: unmarshalArrayOfObject(data.cluster_settings, unmarshalClusterSetting), - clusterSize: data.cluster_size, - createdAt: unmarshalDate(data.created_at), - endpoints: unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint), + createdAt: marshalling.unmarshalDate(data.created_at), id: data.id, + isDefault: data.is_default, name: data.name, - nodeType: data.node_type, + organizationId: data.organization_id, + privateNetworkCount: data.private_network_count, projectId: data.project_id, - status: data.status, + region: data.region, + routingEnabled: data.routing_enabled, tags: data.tags, - tlsEnabled: data.tls_enabled, - updatedAt: unmarshalDate(data.updated_at), - upgradableVersions: data.upgradable_versions, - userName: data.user_name, - version: data.version, - zone: data.zone + updatedAt: marshalling.unmarshalDate(data.updated_at) }; }; -const unmarshalClusterVersion = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ClusterVersion' failed as data isn't a dictionary.`); +const unmarshalAddSubnetsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'AddSubnetsResponse' failed as data isn't a dictionary.` + ); } return { - availableSettings: unmarshalArrayOfObject(data.available_settings, unmarshalAvailableClusterSetting), - endOfLifeAt: unmarshalDate(data.end_of_life_at), - logoUrl: data.logo_url, - version: data.version, - zone: data.zone + subnets: data.subnets }; }; -const unmarshalNodeType = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'NodeType' failed as data isn't a dictionary.`); +const unmarshalDeleteSubnetsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DeleteSubnetsResponse' failed as data isn't a dictionary.` + ); } return { - beta: data.beta, - description: data.description, - disabled: data.disabled, - memory: data.memory, - name: data.name, - stockStatus: data.stock_status, - vcpus: data.vcpus, - zone: data.zone + subnets: data.subnets }; }; -const unmarshalAddAclRulesResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'AddAclRulesResponse' failed as data isn't a dictionary.`); +const unmarshalListPrivateNetworksResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListPrivateNetworksResponse' failed as data isn't a dictionary.` + ); } return { - aclRules: unmarshalArrayOfObject(data.acl_rules, unmarshalACLRule), + privateNetworks: marshalling.unmarshalArrayOfObject( + data.private_networks, + unmarshalPrivateNetwork + ), totalCount: data.total_count }; }; -const unmarshalAddEndpointsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'AddEndpointsResponse' failed as data isn't a dictionary.`); +const unmarshalListSubnetsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListSubnetsResponse' failed as data isn't a dictionary.` + ); } return { - endpoints: unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint), + subnets: marshalling.unmarshalArrayOfObject(data.subnets, unmarshalSubnet), totalCount: data.total_count }; }; -const unmarshalClusterMetricsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ClusterMetricsResponse' failed as data isn't a dictionary.`); - } - return { - timeseries: unmarshalArrayOfObject(data.timeseries, unmarshalTimeSeries) - }; -}; -const unmarshalClusterSettingsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ClusterSettingsResponse' failed as data isn't a dictionary.`); - } - return { - settings: unmarshalArrayOfObject(data.settings, unmarshalClusterSetting) - }; -}; -const unmarshalListClusterVersionsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListClusterVersionsResponse' failed as data isn't a dictionary.`); +const unmarshalListVPCsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListVPCsResponse' failed as data isn't a dictionary.` + ); } return { totalCount: data.total_count, - versions: unmarshalArrayOfObject(data.versions, unmarshalClusterVersion) - }; -}; -const unmarshalListClustersResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListClustersResponse' failed as data isn't a dictionary.`); - } - return { - clusters: unmarshalArrayOfObject(data.clusters, unmarshalCluster), - totalCount: data.total_count + vpcs: marshalling.unmarshalArrayOfObject(data.vpcs, unmarshalVPC) }; }; -const unmarshalListNodeTypesResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListNodeTypesResponse' failed as data isn't a dictionary.`); +const unmarshalSetSubnetsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SetSubnetsResponse' failed as data isn't a dictionary.` + ); } return { - nodeTypes: unmarshalArrayOfObject(data.node_types, unmarshalNodeType), - totalCount: data.total_count - }; -}; -const unmarshalSetAclRulesResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'SetAclRulesResponse' failed as data isn't a dictionary.`); - } - return { - aclRules: unmarshalArrayOfObject(data.acl_rules, unmarshalACLRule) - }; -}; -const unmarshalSetEndpointsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'SetEndpointsResponse' failed as data isn't a dictionary.`); - } - return { - endpoints: unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint) + subnets: data.subnets }; }; -const marshalEndpointSpecPrivateNetworkSpecIpamConfig = (request, defaults) => ({}); -const marshalEndpointSpecPrivateNetworkSpec = (request, defaults) => ({ - id: request.id, - ipam_config: request.ipamConfig ? marshalEndpointSpecPrivateNetworkSpecIpamConfig(request.ipamConfig) : undefined, - service_ips: request.serviceIps -}); -const marshalEndpointSpecPublicNetworkSpec = (request, defaults) => ({}); -const marshalACLRuleSpec = (request, defaults) => ({ - description: request.description, - ip_cidr: request.ipCidr -}); -const marshalClusterSetting = (request, defaults) => ({ - name: request.name, - value: request.value -}); -const marshalEndpointSpec = (request, defaults) => ({ - ...resolveOneOf([{ - param: 'private_network', - value: request.privateNetwork ? marshalEndpointSpecPrivateNetworkSpec(request.privateNetwork) : undefined - }, { - param: 'public_network', - value: request.publicNetwork ? marshalEndpointSpecPublicNetworkSpec(request.publicNetwork) : undefined - }]) -}); -const marshalAddAclRulesRequest = (request, defaults) => ({ - acl_rules: request.aclRules.map(elt => marshalACLRuleSpec(elt)) -}); -const marshalAddClusterSettingsRequest = (request, defaults) => ({ - settings: request.settings.map(elt => marshalClusterSetting(elt)) -}); -const marshalAddEndpointsRequest = (request, defaults) => ({ - endpoints: request.endpoints.map(elt => marshalEndpointSpec(elt)) +const marshalAddSubnetsRequest = (request, defaults) => ({ + subnets: request.subnets }); -const marshalCreateClusterRequest = (request, defaults) => ({ - acl_rules: request.aclRules ? request.aclRules.map(elt => marshalACLRuleSpec(elt)) : undefined, - cluster_settings: request.clusterSettings ? request.clusterSettings.map(elt => marshalClusterSetting(elt)) : undefined, - cluster_size: request.clusterSize, - endpoints: request.endpoints ? request.endpoints.map(elt => marshalEndpointSpec(elt)) : undefined, - name: request.name || randomName('ins'), - node_type: request.nodeType, - password: request.password, +const marshalCreatePrivateNetworkRequest = (request, defaults) => ({ + name: request.name || randomName("pn"), project_id: request.projectId ?? defaults.defaultProjectId, + subnets: request.subnets, tags: request.tags, - tls_enabled: request.tlsEnabled, - user_name: request.userName, - version: request.version + vpc_id: request.vpcId }); -const marshalMigrateClusterRequest = (request, defaults) => ({ - ...resolveOneOf([{ - param: 'version', - value: request.version - }, { - param: 'node_type', - value: request.nodeType - }, { - param: 'cluster_size', - value: request.clusterSize - }]) +const marshalCreateRouteRequest = (request, defaults) => ({ + description: request.description, + destination: request.destination, + nexthop_private_network_id: request.nexthopPrivateNetworkId, + nexthop_resource_id: request.nexthopResourceId, + tags: request.tags, + vpc_id: request.vpcId }); -const marshalSetAclRulesRequest = (request, defaults) => ({ - acl_rules: request.aclRules.map(elt => marshalACLRuleSpec(elt)) +const marshalCreateVPCRequest = (request, defaults) => ({ + enable_routing: request.enableRouting, + name: request.name || randomName("vpc"), + project_id: request.projectId ?? defaults.defaultProjectId, + tags: request.tags }); -const marshalSetClusterSettingsRequest = (request, defaults) => ({ - settings: request.settings.map(elt => marshalClusterSetting(elt)) +const marshalDeleteSubnetsRequest = (request, defaults) => ({ + subnets: request.subnets }); -const marshalSetEndpointsRequest = (request, defaults) => ({ - endpoints: request.endpoints.map(elt => marshalEndpointSpec(elt)) +const marshalMigrateZonalPrivateNetworksRequest = (request, defaults) => ({ + private_network_ids: request.privateNetworkIds, + ...marshalling.resolveOneOf([ + { + default: defaults.defaultOrganizationId, + param: "organization_id", + value: request.organizationId + }, + { + default: defaults.defaultProjectId, + param: "project_id", + value: request.projectId + } + ]) }); -const marshalUpdateClusterRequest = (request, defaults) => ({ +const marshalSetSubnetsRequest = (request, defaults) => ({ + subnets: request.subnets +}); +const marshalUpdatePrivateNetworkRequest = (request, defaults) => ({ name: request.name, - password: request.password, - tags: request.tags, - user_name: request.userName + tags: request.tags }); -const marshalUpdateEndpointRequest = (request, defaults) => ({ - ...resolveOneOf([{ - param: 'private_network', - value: request.privateNetwork ? marshalEndpointSpecPrivateNetworkSpec(request.privateNetwork) : undefined - }, { - param: 'public_network', - value: request.publicNetwork ? marshalEndpointSpecPublicNetworkSpec(request.publicNetwork) : undefined - }]) +const marshalUpdateRouteRequest = (request, defaults) => ({ + description: request.description, + destination: request.destination, + nexthop_private_network_id: request.nexthopPrivateNetworkId, + nexthop_resource_id: request.nexthopResourceId, + tags: request.tags +}); +const marshalUpdateVPCRequest = (request, defaults) => ({ + name: request.name, + tags: request.tags }); +exports.marshalAddSubnetsRequest = marshalAddSubnetsRequest; +exports.marshalCreatePrivateNetworkRequest = marshalCreatePrivateNetworkRequest; +exports.marshalCreateRouteRequest = marshalCreateRouteRequest; +exports.marshalCreateVPCRequest = marshalCreateVPCRequest; +exports.marshalDeleteSubnetsRequest = marshalDeleteSubnetsRequest; +exports.marshalMigrateZonalPrivateNetworksRequest = marshalMigrateZonalPrivateNetworksRequest; +exports.marshalSetSubnetsRequest = marshalSetSubnetsRequest; +exports.marshalUpdatePrivateNetworkRequest = marshalUpdatePrivateNetworkRequest; +exports.marshalUpdateRouteRequest = marshalUpdateRouteRequest; +exports.marshalUpdateVPCRequest = marshalUpdateVPCRequest; +exports.unmarshalAddSubnetsResponse = unmarshalAddSubnetsResponse; +exports.unmarshalDeleteSubnetsResponse = unmarshalDeleteSubnetsResponse; +exports.unmarshalListPrivateNetworksResponse = unmarshalListPrivateNetworksResponse; +exports.unmarshalListSubnetsResponse = unmarshalListSubnetsResponse; +exports.unmarshalListVPCsResponse = unmarshalListVPCsResponse; +exports.unmarshalPrivateNetwork = unmarshalPrivateNetwork; +exports.unmarshalRoute = unmarshalRoute; +exports.unmarshalSetSubnetsResponse = unmarshalSetSubnetsResponse; +exports.unmarshalVPC = unmarshalVPC; + + +/***/ }), + +/***/ 9403: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const jsonContentHeaders$8 = { - 'Content-Type': 'application/json; charset=utf-8' +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const Route = { + description: { + maxLength: 200 + } }; +exports.Route = Route; -/** Managed Database for Redis™ API. */ -let API$8 = class API extends API$u { - /** Lists the available zones of the API. */ - static LOCALITIES = ['fr-par-1', 'fr-par-2', 'nl-ams-1', 'nl-ams-2', 'pl-waw-1', 'pl-waw-2']; +/***/ }), + +/***/ 7533: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const index_gen = __nccwpck_require__(2917); +exports.v1 = index_gen; + + +/***/ }), + +/***/ 8761: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const intervalRetrier = __nccwpck_require__(9052); +const api = __nccwpck_require__(3042); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const resourcePaginator = __nccwpck_require__(4983); +const content_gen = __nccwpck_require__(4662); +const marshalling_gen = __nccwpck_require__(6159); +const jsonContentHeaders = { + "Content-Type": "application/json; charset=utf-8" +}; +class API extends api.API { + /** Lists the available zones of the API. */ + static LOCALITIES = [ + "fr-par-1", + "fr-par-2", + "nl-ams-1", + "nl-ams-2", + "nl-ams-3", + "pl-waw-1", + "pl-waw-2", + "pl-waw-3" + ]; + pageOfListGateways = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/vpc-gw/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways`, + urlParams: marshalling.urlParams( + ["name", request.name], + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["private_network_id", request.privateNetworkId], + ["project_id", request.projectId], + ["status", request.status], + ["tags", request.tags], + ["type", request.type] + ) + }, + marshalling_gen.unmarshalListGatewaysResponse + ); + /** + * List Public Gateways. List Public Gateways in a given Scaleway Organization + * or Project. By default, results are displayed in ascending order of + * creation date. + * + * @param request - The request {@link ListGatewaysRequest} + * @returns A Promise of ListGatewaysResponse + */ + listGateways = (request = {}) => resourcePaginator.enrichForPagination("gateways", this.pageOfListGateways, request); + /** + * Get a Public Gateway. Get details of a Public Gateway, specified by its + * gateway ID. The response object contains full details of the gateway, + * including its **name**, **type**, **status** and more. + * + * @param request - The request {@link GetGatewayRequest} + * @returns A Promise of Gateway + */ + getGateway = (request) => this.client.fetch( + { + method: "GET", + path: `/vpc-gw/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${marshalling.validatePathParam("gatewayId", request.gatewayId)}` + }, + marshalling_gen.unmarshalGateway + ); + /** + * Waits for {@link Gateway} to be in a final state. + * + * @param request - The request {@link GetGatewayRequest} + * @param options - The waiting options + * @returns A Promise of Gateway + */ + waitForGateway = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve(!content_gen.GATEWAY_TRANSIENT_STATUSES.includes(res.status))), + this.getGateway, + request, + options + ); + /** + * Create a Public Gateway. Create a new Public Gateway in the specified + * Scaleway Project, defining its **name**, **type** and other configuration + * details such as whether to enable SSH bastion. + * + * @param request - The request {@link CreateGatewayRequest} + * @returns A Promise of Gateway + */ + createGateway = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateGatewayRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/vpc-gw/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways` + }, + marshalling_gen.unmarshalGateway + ); + /** + * Update a Public Gateway. Update the parameters of an existing Public + * Gateway, for example, its **name**, **tags**, **SSH bastion + * configuration**, and **DNS servers**. + * + * @param request - The request {@link UpdateGatewayRequest} + * @returns A Promise of Gateway + */ + updateGateway = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateGatewayRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/vpc-gw/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${marshalling.validatePathParam("gatewayId", request.gatewayId)}` + }, + marshalling_gen.unmarshalGateway + ); /** - * Create a Redis™ Database Instance. Create a new Redis™ Database Instance - * (Redis™ cluster). You must set the `zone`, `project_id`, `version`, - * `node_type`, `user_name` and `password` parameters. Optionally you can - * define `acl_rules`, `endpoints`, `tls_enabled` and `cluster_settings`. + * Delete a Public Gateway. Delete an existing Public Gateway, specified by + * its gateway ID. This action is irreversible. * - * @param request - The request {@link CreateClusterRequest} - * @returns A Promise of Cluster + * @param request - The request {@link DeleteGatewayRequest} */ - createCluster = request => this.client.fetch({ - body: JSON.stringify(marshalCreateClusterRequest(request, this.client.settings)), - headers: jsonContentHeaders$8, - method: 'POST', - path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters` - }, unmarshalCluster); - + deleteGateway = (request) => this.client.fetch({ + method: "DELETE", + path: `/vpc-gw/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${marshalling.validatePathParam("gatewayId", request.gatewayId)}`, + urlParams: marshalling.urlParams(["cleanup_dhcp", request.cleanupDhcp]) + }); /** - * Update a Redis™ Database Instance. Update the parameters of a Redis™ - * Database Instance (Redis™ cluster), including `name`, `tags`, `user_name` - * and `password`. + * Upgrade a Public Gateway to the latest version and/or to a different + * commercial offer type. Upgrade a given Public Gateway to the newest + * software version or to a different commercial offer type. This applies the + * latest bugfixes and features to your Public Gateway. Note that gateway + * service will be interrupted during the update. * - * @param request - The request {@link UpdateClusterRequest} - * @returns A Promise of Cluster + * @param request - The request {@link UpgradeGatewayRequest} + * @returns A Promise of Gateway */ - updateCluster = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateClusterRequest(request, this.client.settings)), - headers: jsonContentHeaders$8, - method: 'PATCH', - path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}` - }, unmarshalCluster); - + upgradeGateway = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpgradeGatewayRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/vpc-gw/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${marshalling.validatePathParam("gatewayId", request.gatewayId)}/upgrade` + }, + marshalling_gen.unmarshalGateway + ); /** - * Get a Redis™ Database Instance. Retrieve information about a Redis™ - * Database Instance (Redis™ cluster). Specify the `cluster_id` and `region` - * in your request to get information such as `id`, `status`, `version`, - * `tls_enabled`, `cluster_settings`, `upgradable_versions` and `endpoints` - * about your cluster in the response. + * Upgrade a Public Gateway to IP mobility. Upgrade a Public Gateway to IP + * mobility (move from NAT IP to routed IP). This is idempotent: repeated + * calls after the first will return no error but have no effect. * - * @param request - The request {@link GetClusterRequest} - * @returns A Promise of Cluster + * @param request - The request {@link EnableIPMobilityRequest} */ - getCluster = request => this.client.fetch({ - method: 'GET', - path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}` - }, unmarshalCluster); - + enableIPMobility = (request) => this.client.fetch({ + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/vpc-gw/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${marshalling.validatePathParam("gatewayId", request.gatewayId)}/enable-ip-mobility` + }); + pageOfListGatewayNetworks = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/vpc-gw/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateway-networks`, + urlParams: marshalling.urlParams( + ["dhcp_id", request.dhcpId], + ["enable_masquerade", request.enableMasquerade], + ["gateway_id", request.gatewayId], + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["private_network_id", request.privateNetworkId], + ["status", request.status] + ) + }, + marshalling_gen.unmarshalListGatewayNetworksResponse + ); /** - * Waits for {@link Cluster} to be in a final state. + * List Public Gateway connections to Private Networks. List the connections + * between Public Gateways and Private Networks (a connection = a + * GatewayNetwork). You can choose to filter by `gateway-id` to list all + * Private Networks attached to the specified Public Gateway, or by + * `private_network_id` to list all Public Gateways attached to the specified + * Private Network. Other query parameters are also available. The result is + * an array of GatewayNetwork objects, each giving details of the connection + * between a given Public Gateway and a given Private Network. * - * @param request - The request {@link GetClusterRequest} + * @param request - The request {@link ListGatewayNetworksRequest} + * @returns A Promise of ListGatewayNetworksResponse + */ + listGatewayNetworks = (request = {}) => resourcePaginator.enrichForPagination( + "gatewayNetworks", + this.pageOfListGatewayNetworks, + request + ); + /** + * Get a Public Gateway connection to a Private Network. Get details of a + * given connection between a Public Gateway and a Private Network (this + * connection = a GatewayNetwork), specified by its `gateway_network_id`. The + * response object contains details of the connection including the IDs of the + * Public Gateway and Private Network, the dates the connection was + * created/updated and its configuration settings. + * + * @param request - The request {@link GetGatewayNetworkRequest} + * @returns A Promise of GatewayNetwork + */ + getGatewayNetwork = (request) => this.client.fetch( + { + method: "GET", + path: `/vpc-gw/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateway-networks/${marshalling.validatePathParam("gatewayNetworkId", request.gatewayNetworkId)}` + }, + marshalling_gen.unmarshalGatewayNetwork + ); + /** + * Waits for {@link GatewayNetwork} to be in a final state. + * + * @param request - The request {@link GetGatewayNetworkRequest} * @param options - The waiting options - * @returns A Promise of Cluster + * @returns A Promise of GatewayNetwork */ - waitForCluster = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!CLUSTER_TRANSIENT_STATUSES.includes(res.status))), this.getCluster, request, options); - pageOfListClusters = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters`, - urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId], ['tags', request.tags], ['version', request.version]) - }, unmarshalListClustersResponse); - + waitForGatewayNetwork = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve( + !content_gen.GATEWAY_NETWORK_TRANSIENT_STATUSES.includes(res.status) + )), + this.getGatewayNetwork, + request, + options + ); /** - * List Redis™ Database Instances. List all Redis™ Database Instances (Redis™ - * cluster) in the specified zone. By default, the Database Instances returned - * in the list are ordered by creation date in ascending order, though this - * can be modified via the order_by field. You can define additional - * parameters for your query, such as `tags`, `name`, `organization_id` and - * `version`. + * Attach a Public Gateway to a Private Network. Attach a specific Public + * Gateway to a specific Private Network (create a GatewayNetwork). You can + * configure parameters for the connection including DHCP settings, whether to + * enable masquerade (dynamic NAT), and more. * - * @param request - The request {@link ListClustersRequest} - * @returns A Promise of ListClustersResponse + * @param request - The request {@link CreateGatewayNetworkRequest} + * @returns A Promise of GatewayNetwork */ - listClusters = (request = {}) => enrichForPagination('clusters', this.pageOfListClusters, request); - + createGatewayNetwork = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateGatewayNetworkRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/vpc-gw/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateway-networks` + }, + marshalling_gen.unmarshalGatewayNetwork + ); /** - * Scale up a Redis™ Database Instance. Upgrade your standalone Redis™ - * Database Instance node, either by upgrading to a bigger node type (vertical - * scaling) or by adding more nodes to your Database Instance to increase your - * number of endpoints and distribute cache (horizontal scaling). Note that - * scaling horizontally your Redis™ Database Instance will not renew its TLS - * certificate. In order to refresh the TLS certificate, you must use the - * Renew TLS certificate endpoint. + * Update a Public Gateway's connection to a Private Network. Update the + * configuration parameters of a connection between a given Public Gateway and + * Private Network (the connection = a GatewayNetwork). Updatable parameters + * include DHCP settings and whether to enable traffic masquerade (dynamic + * NAT). * - * @param request - The request {@link MigrateClusterRequest} - * @returns A Promise of Cluster + * @param request - The request {@link UpdateGatewayNetworkRequest} + * @returns A Promise of GatewayNetwork */ - migrateCluster = request => this.client.fetch({ - body: JSON.stringify(marshalMigrateClusterRequest(request, this.client.settings)), - headers: jsonContentHeaders$8, - method: 'POST', - path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}/migrate` - }, unmarshalCluster); - + updateGatewayNetwork = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateGatewayNetworkRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/vpc-gw/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateway-networks/${marshalling.validatePathParam("gatewayNetworkId", request.gatewayNetworkId)}` + }, + marshalling_gen.unmarshalGatewayNetwork + ); /** - * Delete a Redis™ Database Instance. Delete a Redis™ Database Instance - * (Redis™ cluster), specified by the `region` and `cluster_id` parameters. - * Deleting a Database Instance is permanent, and cannot be undone. Note that - * upon deletion all your data will be lost. + * Detach a Public Gateway from a Private Network. Detach a given Public + * Gateway from a given Private Network, i.e. delete a GatewayNetwork + * specified by a gateway_network_id. * - * @param request - The request {@link DeleteClusterRequest} - * @returns A Promise of Cluster + * @param request - The request {@link DeleteGatewayNetworkRequest} */ - deleteCluster = request => this.client.fetch({ - method: 'DELETE', - path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}` - }, unmarshalCluster); - + deleteGatewayNetwork = (request) => this.client.fetch({ + method: "DELETE", + path: `/vpc-gw/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateway-networks/${marshalling.validatePathParam("gatewayNetworkId", request.gatewayNetworkId)}`, + urlParams: marshalling.urlParams(["cleanup_dhcp", request.cleanupDhcp]) + }); + pageOfListDHCPs = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/vpc-gw/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/dhcps`, + urlParams: marshalling.urlParams( + ["address", request.address], + ["has_address", request.hasAddress], + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId] + ) + }, + marshalling_gen.unmarshalListDHCPsResponse + ); /** - * Get metrics of a Redis™ Database Instance. Retrieve the metrics of a Redis™ - * Database Instance (Redis™ cluster). You can define the period from which to - * retrieve metrics by specifying the `start_date` and `end_date`. + * List DHCP configurations. List DHCP configurations, optionally filtering by + * Organization, Project, Public Gateway IP address or more. The response is + * an array of DHCP configuration objects, each identified by a DHCP ID and + * containing configuration settings for the assignment of IP addresses to + * devices on a Private Network attached to a Public Gateway. Note that the + * response does not contain the IDs of any Private Network / Public Gateway + * the configuration is attached to. Use the `List Public Gateway connections + * to Private Networks` method for that purpose, filtering on DHCP ID. * - * @param request - The request {@link GetClusterMetricsRequest} - * @returns A Promise of ClusterMetricsResponse + * @param request - The request {@link ListDHCPsRequest} + * @returns A Promise of ListDHCPsResponse */ - getClusterMetrics = request => this.client.fetch({ - method: 'GET', - path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}/metrics`, - urlParams: urlParams(['end_at', request.endAt], ['metric_name', request.metricName], ['start_at', request.startAt]) - }, unmarshalClusterMetricsResponse); - pageOfListNodeTypes = request => this.client.fetch({ - method: 'GET', - path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/node-types`, - urlParams: urlParams(['include_disabled_types', request.includeDisabledTypes], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]) - }, unmarshalListNodeTypesResponse); - + listDHCPs = (request = {}) => resourcePaginator.enrichForPagination("dhcps", this.pageOfListDHCPs, request); /** - * List available node types. List all available node types. By default, the - * node types returned in the list are ordered by creation date in ascending - * order, though this can be modified via the `order_by` field. + * Get a DHCP configuration. Get a DHCP configuration object, identified by + * its DHCP ID. The response object contains configuration settings for the + * assignment of IP addresses to devices on a Private Network attached to a + * Public Gateway. Note that the response does not contain the IDs of any + * Private Network / Public Gateway the configuration is attached to. Use the + * `List Public Gateway connections to Private Networks` method for that + * purpose, filtering on DHCP ID. * - * @param request - The request {@link ListNodeTypesRequest} - * @returns A Promise of ListNodeTypesResponse + * @param request - The request {@link GetDHCPRequest} + * @returns A Promise of DHCP */ - listNodeTypes = request => enrichForPagination('nodeTypes', this.pageOfListNodeTypes, request); - pageOfListClusterVersions = request => this.client.fetch({ - method: 'GET', - path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/cluster-versions`, - urlParams: urlParams(['include_beta', request.includeBeta], ['include_deprecated', request.includeDeprecated], ['include_disabled', request.includeDisabled], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['version', request.version]) - }, unmarshalListClusterVersionsResponse); - + getDHCP = (request) => this.client.fetch( + { + method: "GET", + path: `/vpc-gw/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/dhcps/${marshalling.validatePathParam("dhcpId", request.dhcpId)}` + }, + marshalling_gen.unmarshalDHCP + ); /** - * List available Redis™ versions. List the Redis™ database engine versions - * available. You can define additional parameters for your query, such as - * `include_disabled`, `include_beta`, `include_deprecated` and `version`. + * Create a DHCP configuration. Create a new DHCP configuration object, + * containing settings for the assignment of IP addresses to devices on a + * Private Network attached to a Public Gateway. The response object includes + * the ID of the DHCP configuration object. You can use this ID as part of a + * call to `Create a Public Gateway connection to a Private Network` or + * `Update a Public Gateway connection to a Private Network` to directly apply + * this DHCP configuration. * - * @param request - The request {@link ListClusterVersionsRequest} - * @returns A Promise of ListClusterVersionsResponse + * @param request - The request {@link CreateDHCPRequest} + * @returns A Promise of DHCP */ - listClusterVersions = request => enrichForPagination('versions', this.pageOfListClusterVersions, request); - + createDHCP = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateDHCPRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/vpc-gw/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/dhcps` + }, + marshalling_gen.unmarshalDHCP + ); /** - * Get the TLS certificate of a cluster. Retrieve information about the TLS - * certificate of a Redis™ Database Instance (Redis™ cluster). Details like - * name and content are returned in the response. + * Update a DHCP configuration. Update a DHCP configuration object, identified + * by its DHCP ID. * - * @param request - The request {@link GetClusterCertificateRequest} - * @returns A Promise of Blob + * @param request - The request {@link UpdateDHCPRequest} + * @returns A Promise of DHCP + */ + updateDHCP = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateDHCPRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/vpc-gw/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/dhcps/${marshalling.validatePathParam("dhcpId", request.dhcpId)}` + }, + marshalling_gen.unmarshalDHCP + ); + /** + * Delete a DHCP configuration. Delete a DHCP configuration object, identified + * by its DHCP ID. Note that you cannot delete a DHCP configuration object + * that is currently being used by a Gateway Network. + * + * @param request - The request {@link DeleteDHCPRequest} */ - getClusterCertificate = request => this.client.fetch({ - method: 'GET', - path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}/certificate`, - urlParams: urlParams(['dl', 1]), - responseType: 'blob' + deleteDHCP = (request) => this.client.fetch({ + method: "DELETE", + path: `/vpc-gw/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/dhcps/${marshalling.validatePathParam("dhcpId", request.dhcpId)}` }); - + pageOfListDHCPEntries = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/vpc-gw/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/dhcp-entries`, + urlParams: marshalling.urlParams( + ["gateway_network_id", request.gatewayNetworkId], + ["hostname", request.hostname], + ["ip_address", request.ipAddress], + ["mac_address", request.macAddress], + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["type", request.type] + ) + }, + marshalling_gen.unmarshalListDHCPEntriesResponse + ); /** - * Renew the TLS certificate of a cluster. Renew a TLS certificate for a - * Redis™ Database Instance (Redis™ cluster). Renewing a certificate means - * that you will not be able to connect to your Database Instance using the - * previous certificate. You will also need to download and update the new - * certificate for all database clients. + * List DHCP entries. List DHCP entries, whether dynamically assigned and/or + * statically reserved. DHCP entries can be filtered by the Gateway Network + * they are on, their MAC address, IP address, type or hostname. * - * @param request - The request {@link RenewClusterCertificateRequest} - * @returns A Promise of Cluster + * @param request - The request {@link ListDHCPEntriesRequest} + * @returns A Promise of ListDHCPEntriesResponse */ - renewClusterCertificate = request => this.client.fetch({ - body: '{}', - headers: jsonContentHeaders$8, - method: 'POST', - path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}/renew-certificate` - }, unmarshalCluster); - + listDHCPEntries = (request = {}) => resourcePaginator.enrichForPagination("dhcpEntries", this.pageOfListDHCPEntries, request); /** - * Add advanced settings. Add an advanced setting to a Redis™ Database - * Instance (Redis™ cluster). You must set the `name` and the `value` of each - * setting. + * Get a DHCP entry. Get a DHCP entry, specified by its DHCP entry ID. * - * @param request - The request {@link AddClusterSettingsRequest} - * @returns A Promise of ClusterSettingsResponse + * @param request - The request {@link GetDHCPEntryRequest} + * @returns A Promise of DHCPEntry */ - addClusterSettings = request => this.client.fetch({ - body: JSON.stringify(marshalAddClusterSettingsRequest(request, this.client.settings)), - headers: jsonContentHeaders$8, - method: 'POST', - path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}/settings` - }, unmarshalClusterSettingsResponse); - + getDHCPEntry = (request) => this.client.fetch( + { + method: "GET", + path: `/vpc-gw/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/dhcp-entries/${marshalling.validatePathParam("dhcpEntryId", request.dhcpEntryId)}` + }, + marshalling_gen.unmarshalDHCPEntry + ); + /** + * Create a DHCP entry. Create a static DHCP reservation, specifying the + * Gateway Network for the reservation, the MAC address of the target device + * and the IP address to assign this device. The response is a DHCP entry + * object, confirming the ID and configuration details of the static DHCP + * reservation. + * + * @param request - The request {@link CreateDHCPEntryRequest} + * @returns A Promise of DHCPEntry + */ + createDHCPEntry = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateDHCPEntryRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/vpc-gw/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/dhcp-entries` + }, + marshalling_gen.unmarshalDHCPEntry + ); + /** + * Update a DHCP entry. Update the IP address for a DHCP entry, specified by + * its DHCP entry ID. You can update an existing DHCP entry of any type + * (`reservation` (static), `lease` (dynamic) or `unknown`), but in manually + * updating the IP address the entry will necessarily be of type `reservation` + * after the update. + * + * @param request - The request {@link UpdateDHCPEntryRequest} + * @returns A Promise of DHCPEntry + */ + updateDHCPEntry = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateDHCPEntryRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/vpc-gw/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/dhcp-entries/${marshalling.validatePathParam("dhcpEntryId", request.dhcpEntryId)}` + }, + marshalling_gen.unmarshalDHCPEntry + ); + /** + * Set all DHCP reservations on a Gateway Network. Set the list of DHCP + * reservations attached to a Gateway Network. Reservations are identified by + * their MAC address, and will sync the current DHCP entry list to the given + * list, creating, updating or deleting DHCP entries accordingly. + * + * @param request - The request {@link SetDHCPEntriesRequest} + * @returns A Promise of SetDHCPEntriesResponse + */ + setDHCPEntries = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalSetDHCPEntriesRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PUT", + path: `/vpc-gw/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/dhcp-entries` + }, + marshalling_gen.unmarshalSetDHCPEntriesResponse + ); + /** + * Delete a DHCP entry. Delete a static DHCP reservation, identified by its + * DHCP entry ID. Note that you cannot delete DHCP entries of type `lease`, + * these are deleted automatically when their time-to-live expires. + * + * @param request - The request {@link DeleteDHCPEntryRequest} + */ + deleteDHCPEntry = (request) => this.client.fetch({ + method: "DELETE", + path: `/vpc-gw/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/dhcp-entries/${marshalling.validatePathParam("dhcpEntryId", request.dhcpEntryId)}` + }); + pageOfListPATRules = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/vpc-gw/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/pat-rules`, + urlParams: marshalling.urlParams( + ["gateway_id", request.gatewayId], + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["private_ip", request.privateIp], + ["protocol", request.protocol] + ) + }, + marshalling_gen.unmarshalListPATRulesResponse + ); + /** + * List PAT rules. List PAT rules. You can filter by gateway ID to list all + * PAT rules for a particular gateway, or filter for PAT rules targeting a + * specific IP address or using a specific protocol. + * + * @param request - The request {@link ListPATRulesRequest} + * @returns A Promise of ListPATRulesResponse + */ + listPATRules = (request = {}) => resourcePaginator.enrichForPagination("patRules", this.pageOfListPATRules, request); + /** + * Get a PAT rule. Get a PAT rule, specified by its PAT rule ID. The response + * object gives full details of the PAT rule, including the Public Gateway it + * belongs to and the configuration settings in terms of public / private + * ports, private IP and protocol. + * + * @param request - The request {@link GetPATRuleRequest} + * @returns A Promise of PATRule + */ + getPATRule = (request) => this.client.fetch( + { + method: "GET", + path: `/vpc-gw/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/pat-rules/${marshalling.validatePathParam("patRuleId", request.patRuleId)}` + }, + marshalling_gen.unmarshalPATRule + ); /** - * Delete advanced setting. Delete an advanced setting in a Redis™ Database - * Instance (Redis™ cluster). You must specify the names of the settings you - * want to delete in the request body. + * Create a PAT rule. Create a new PAT rule on a specified Public Gateway, + * defining the protocol to use, public port to listen on, and private port / + * IP address to map to. * - * @param request - The request {@link DeleteClusterSettingRequest} - * @returns A Promise of Cluster + * @param request - The request {@link CreatePATRuleRequest} + * @returns A Promise of PATRule */ - deleteClusterSetting = request => this.client.fetch({ - method: 'DELETE', - path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}/settings/${validatePathParam('settingName', request.settingName)}` - }, unmarshalCluster); - + createPATRule = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreatePATRuleRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/vpc-gw/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/pat-rules` + }, + marshalling_gen.unmarshalPATRule + ); /** - * Set advanced settings. Update an advanced setting for a Redis™ Database - * Instance (Redis™ cluster). Settings added upon database engine - * initalization can only be defined once, and cannot, therefore, be updated. + * Update a PAT rule. Update a PAT rule, specified by its PAT rule ID. + * Configuration settings including private/public port, private IP address + * and protocol can all be updated. * - * @param request - The request {@link SetClusterSettingsRequest} - * @returns A Promise of ClusterSettingsResponse + * @param request - The request {@link UpdatePATRuleRequest} + * @returns A Promise of PATRule */ - setClusterSettings = request => this.client.fetch({ - body: JSON.stringify(marshalSetClusterSettingsRequest(request, this.client.settings)), - headers: jsonContentHeaders$8, - method: 'PUT', - path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}/settings` - }, unmarshalClusterSettingsResponse); - + updatePATRule = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdatePATRuleRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/vpc-gw/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/pat-rules/${marshalling.validatePathParam("patRuleId", request.patRuleId)}` + }, + marshalling_gen.unmarshalPATRule + ); /** - * Set ACL rules for a cluster. Replace all the ACL rules of a Redis™ Database - * Instance (Redis™ cluster). + * Set all PAT rules. Set a definitive list of PAT rules attached to a Public + * Gateway. Each rule is identified by its public port and protocol. This will + * sync the current PAT rule list on the gateway with the new list, creating, + * updating or deleting PAT rules accordingly. * - * @param request - The request {@link SetAclRulesRequest} - * @returns A Promise of SetAclRulesResponse + * @param request - The request {@link SetPATRulesRequest} + * @returns A Promise of SetPATRulesResponse */ - setAclRules = request => this.client.fetch({ - body: JSON.stringify(marshalSetAclRulesRequest(request, this.client.settings)), - headers: jsonContentHeaders$8, - method: 'PUT', - path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}/acls` - }, unmarshalSetAclRulesResponse); - + setPATRules = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalSetPATRulesRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PUT", + path: `/vpc-gw/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/pat-rules` + }, + marshalling_gen.unmarshalSetPATRulesResponse + ); /** - * Add ACL rules for a cluster. Add an additional ACL rule to a Redis™ - * Database Instance (Redis™ cluster). + * Delete a PAT rule. Delete a PAT rule, identified by its PAT rule ID. This + * action is irreversible. * - * @param request - The request {@link AddAclRulesRequest} - * @returns A Promise of AddAclRulesResponse + * @param request - The request {@link DeletePATRuleRequest} */ - addAclRules = request => this.client.fetch({ - body: JSON.stringify(marshalAddAclRulesRequest(request, this.client.settings)), - headers: jsonContentHeaders$8, - method: 'POST', - path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}/acls` - }, unmarshalAddAclRulesResponse); - + deletePATRule = (request) => this.client.fetch({ + method: "DELETE", + path: `/vpc-gw/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/pat-rules/${marshalling.validatePathParam("patRuleId", request.patRuleId)}` + }); /** - * Delete an ACL rule for a cluster. Delete an ACL rule of a Redis™ Database - * Instance (Redis™ cluster). You must specify the `acl_id` of the rule you - * want to delete in your request. + * List Public Gateway types. List the different Public Gateway commercial + * offer types available at Scaleway. The response is an array of objects + * describing the name and technical details of each available gateway type. * - * @param request - The request {@link DeleteAclRuleRequest} - * @returns A Promise of Cluster + * @param request - The request {@link ListGatewayTypesRequest} + * @returns A Promise of ListGatewayTypesResponse */ - deleteAclRule = request => this.client.fetch({ - method: 'DELETE', - path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/acls/${validatePathParam('aclId', request.aclId)}` - }, unmarshalCluster); - + listGatewayTypes = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/vpc-gw/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateway-types` + }, + marshalling_gen.unmarshalListGatewayTypesResponse + ); + pageOfListIPs = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/vpc-gw/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips`, + urlParams: marshalling.urlParams( + ["is_free", request.isFree], + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId], + ["reverse", request.reverse], + ["tags", request.tags] + ) + }, + marshalling_gen.unmarshalListIPsResponse + ); /** - * Get an ACL rule. Retrieve information about an ACL rule of a Redis™ - * Database Instance (Redis™ cluster). You must specify the `acl_id` of the - * rule in your request. + * List IPs. List Public Gateway flexible IP addresses. A number of filter + * options are available for limiting results in the response. * - * @param request - The request {@link GetAclRuleRequest} - * @returns A Promise of ACLRule + * @param request - The request {@link ListIPsRequest} + * @returns A Promise of ListIPsResponse */ - getAclRule = request => this.client.fetch({ - method: 'GET', - path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/acls/${validatePathParam('aclId', request.aclId)}` - }, unmarshalACLRule); - + listIPs = (request = {}) => resourcePaginator.enrichForPagination("ips", this.pageOfListIPs, request); /** - * Set endpoints for a cluster. Update an endpoint for a Redis™ Database - * Instance (Redis™ cluster). You must specify the `cluster_id` and the - * `endpoints` parameters in your request. + * Get an IP. Get details of a Public Gateway flexible IP address, identified + * by its IP ID. The response object contains information including which (if + * any) Public Gateway using this IP address, the reverse and various other + * metadata. * - * @param request - The request {@link SetEndpointsRequest} - * @returns A Promise of SetEndpointsResponse + * @param request - The request {@link GetIPRequest} + * @returns A Promise of IP */ - setEndpoints = request => this.client.fetch({ - body: JSON.stringify(marshalSetEndpointsRequest(request, this.client.settings)), - headers: jsonContentHeaders$8, - method: 'PUT', - path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}/endpoints` - }, unmarshalSetEndpointsResponse); - + getIP = (request) => this.client.fetch( + { + method: "GET", + path: `/vpc-gw/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips/${marshalling.validatePathParam("ipId", request.ipId)}` + }, + marshalling_gen.unmarshalIP + ); /** - * Add endpoints for a cluster. Add a new endpoint for a Redis™ Database - * Instance (Redis™ cluster). You can add `private_network` or - * `public_network` specifications to the body of the request. + * Reserve an IP. Create (reserve) a new flexible IP address that can be used + * for a Public Gateway in a specified Scaleway Project. * - * @param request - The request {@link AddEndpointsRequest} - * @returns A Promise of AddEndpointsResponse + * @param request - The request {@link CreateIPRequest} + * @returns A Promise of IP */ - addEndpoints = request => this.client.fetch({ - body: JSON.stringify(marshalAddEndpointsRequest(request, this.client.settings)), - headers: jsonContentHeaders$8, - method: 'POST', - path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}/endpoints` - }, unmarshalAddEndpointsResponse); - + createIP = (request = {}) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateIPRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/vpc-gw/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips` + }, + marshalling_gen.unmarshalIP + ); /** - * Delete an endpoint for a cluster. Delete the endpoint of a Redis™ Database - * Instance (Redis™ cluster). You must specify the `region` and `endpoint_id` - * parameters of the endpoint you want to delete. Note that might need to - * update any environment configurations that point to the deleted endpoint. + * Update an IP. Update details of an existing flexible IP address, including + * its tags, reverse and the Public Gateway it is assigned to. * - * @param request - The request {@link DeleteEndpointRequest} - * @returns A Promise of Cluster + * @param request - The request {@link UpdateIPRequest} + * @returns A Promise of IP */ - deleteEndpoint = request => this.client.fetch({ - method: 'DELETE', - path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/endpoints/${validatePathParam('endpointId', request.endpointId)}` - }, unmarshalCluster); - + updateIP = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateIPRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/vpc-gw/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips/${marshalling.validatePathParam("ipId", request.ipId)}` + }, + marshalling_gen.unmarshalIP + ); /** - * Get an endpoint. Retrieve information about a Redis™ Database Instance - * (Redis™ cluster) endpoint. Full details about the endpoint, like `ips`, - * `port`, `private_network` and `public_network` specifications are returned - * in the response. + * Delete an IP. Delete a flexible IP address from your account. This action + * is irreversible. * - * @param request - The request {@link GetEndpointRequest} - * @returns A Promise of Endpoint + * @param request - The request {@link DeleteIPRequest} */ - getEndpoint = request => this.client.fetch({ - method: 'GET', - path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/endpoints/${validatePathParam('endpointId', request.endpointId)}` - }, unmarshalEndpoint); - + deleteIP = (request) => this.client.fetch({ + method: "DELETE", + path: `/vpc-gw/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/ips/${marshalling.validatePathParam("ipId", request.ipId)}` + }); /** - * Update an endpoint. Update information about a Redis™ Database Instance - * (Redis™ cluster) endpoint. Full details about the endpoint, like `ips`, - * `port`, `private_network` and `public_network` specifications are returned - * in the response. + * Refresh a Public Gateway's SSH keys. Refresh the SSH keys of a given Public + * Gateway, specified by its gateway ID. This adds any new SSH keys in the + * gateway's Scaleway Project to the gateway itself. * - * @param request - The request {@link UpdateEndpointRequest} - * @returns A Promise of Endpoint + * @param request - The request {@link RefreshSSHKeysRequest} + * @returns A Promise of Gateway */ - updateEndpoint = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateEndpointRequest(request, this.client.settings)), - headers: jsonContentHeaders$8, - method: 'PATCH', - path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/endpoints/${validatePathParam('endpointId', request.endpointId)}` - }, unmarshalEndpoint); -}; + refreshSSHKeys = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/vpc-gw/v1/zones/${marshalling.validatePathParam("zone", request.zone ?? this.client.settings.defaultZone)}/gateways/${marshalling.validatePathParam("gatewayId", request.gatewayId)}/refresh-ssh-keys` + }, + marshalling_gen.unmarshalGateway + ); +} +exports.API = API; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -var index_gen$8 = /*#__PURE__*/Object.freeze({ - __proto__: null, - API: API$8, - CLUSTER_TRANSIENT_STATUSES: CLUSTER_TRANSIENT_STATUSES -}); +/***/ }), -var index$7 = /*#__PURE__*/Object.freeze({ - __proto__: null, - v1: index_gen$8 -}); +/***/ 4662: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const GATEWAY_NETWORK_TRANSIENT_STATUSES = [ + "attaching", + "configuring", + "detaching" +]; +const GATEWAY_TRANSIENT_STATUSES = [ + "allocating", + "configuring", + "stopping", + "deleting" +]; +exports.GATEWAY_NETWORK_TRANSIENT_STATUSES = GATEWAY_NETWORK_TRANSIENT_STATUSES; +exports.GATEWAY_TRANSIENT_STATUSES = GATEWAY_TRANSIENT_STATUSES; + + +/***/ }), + +/***/ 2917: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api_gen = __nccwpck_require__(8761); +const content_gen = __nccwpck_require__(4662); +exports.API = api_gen.API; +exports.GATEWAY_NETWORK_TRANSIENT_STATUSES = content_gen.GATEWAY_NETWORK_TRANSIENT_STATUSES; +exports.GATEWAY_TRANSIENT_STATUSES = content_gen.GATEWAY_TRANSIENT_STATUSES; -/** Lists transient statutes of the enum {@link ImageStatus}. */ -const IMAGE_TRANSIENT_STATUSES = ['deleting']; -/** Lists transient statutes of the enum {@link NamespaceStatus}. */ -const NAMESPACE_TRANSIENT_STATUSES = ['deleting']; +/***/ }), + +/***/ 6159: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/** Lists transient statutes of the enum {@link TagStatus}. */ -const TAG_TRANSIENT_STATUSES = ['deleting']; +"use strict"; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const unmarshalImage = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Image' failed as data isn't a dictionary.`); +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const randomName = __nccwpck_require__(8141); +const json = __nccwpck_require__(3746); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const unmarshalDHCP = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DHCP' failed as data isn't a dictionary.` + ); } return { - createdAt: unmarshalDate(data.created_at), + address: data.address, + createdAt: marshalling.unmarshalDate(data.created_at), + dnsLocalName: data.dns_local_name, + dnsSearch: data.dns_search, + dnsServersOverride: data.dns_servers_override, + enableDynamic: data.enable_dynamic, id: data.id, - name: data.name, - namespaceId: data.namespace_id, - size: data.size, + organizationId: data.organization_id, + poolHigh: data.pool_high, + poolLow: data.pool_low, + projectId: data.project_id, + pushDefaultRoute: data.push_default_route, + pushDnsServer: data.push_dns_server, + rebindTimer: data.rebind_timer, + renewTimer: data.renew_timer, + subnet: data.subnet, + updatedAt: marshalling.unmarshalDate(data.updated_at), + validLifetime: data.valid_lifetime, + zone: data.zone + }; +}; +const unmarshalIpamConfig = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'IpamConfig' failed as data isn't a dictionary.` + ); + } + return { + ipamIpId: data.ipam_ip_id, + pushDefaultRoute: data.push_default_route + }; +}; +const unmarshalGatewayNetwork = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'GatewayNetwork' failed as data isn't a dictionary.` + ); + } + return { + address: data.address, + createdAt: marshalling.unmarshalDate(data.created_at), + dhcp: data.dhcp ? unmarshalDHCP(data.dhcp) : void 0, + enableDhcp: data.enable_dhcp, + enableMasquerade: data.enable_masquerade, + gatewayId: data.gateway_id, + id: data.id, + ipamConfig: data.ipam_config ? unmarshalIpamConfig(data.ipam_config) : void 0, + macAddress: data.mac_address, + privateNetworkId: data.private_network_id, status: data.status, - statusMessage: data.status_message, + updatedAt: marshalling.unmarshalDate(data.updated_at), + zone: data.zone + }; +}; +const unmarshalIP = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'IP' failed as data isn't a dictionary.` + ); + } + return { + address: data.address, + createdAt: marshalling.unmarshalDate(data.created_at), + gatewayId: data.gateway_id, + id: data.id, + organizationId: data.organization_id, + projectId: data.project_id, + reverse: data.reverse, tags: data.tags, - updatedAt: unmarshalDate(data.updated_at), - visibility: data.visibility + updatedAt: marshalling.unmarshalDate(data.updated_at), + zone: data.zone }; }; -const unmarshalNamespace = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Namespace' failed as data isn't a dictionary.`); +const unmarshalDHCPEntry = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DHCPEntry' failed as data isn't a dictionary.` + ); } return { - createdAt: unmarshalDate(data.created_at), - description: data.description, - endpoint: data.endpoint, + createdAt: marshalling.unmarshalDate(data.created_at), + gatewayNetworkId: data.gateway_network_id, + hostname: data.hostname, id: data.id, - imageCount: data.image_count, - isPublic: data.is_public, + ipAddress: data.ip_address, + macAddress: data.mac_address, + type: data.type, + updatedAt: marshalling.unmarshalDate(data.updated_at), + zone: data.zone + }; +}; +const unmarshalGatewayType = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'GatewayType' failed as data isn't a dictionary.` + ); + } + return { + bandwidth: data.bandwidth, + name: data.name, + zone: data.zone + }; +}; +const unmarshalGateway = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Gateway' failed as data isn't a dictionary.` + ); + } + return { + bastionEnabled: data.bastion_enabled, + bastionPort: data.bastion_port, + canUpgradeTo: data.can_upgrade_to, + createdAt: marshalling.unmarshalDate(data.created_at), + gatewayNetworks: marshalling.unmarshalArrayOfObject( + data.gateway_networks, + unmarshalGatewayNetwork + ), + id: data.id, + ip: data.ip ? unmarshalIP(data.ip) : void 0, + ipMobilityEnabled: data.ip_mobility_enabled, + isLegacy: data.is_legacy, name: data.name, organizationId: data.organization_id, projectId: data.project_id, - region: data.region, - size: data.size, + smtpEnabled: data.smtp_enabled, status: data.status, - statusMessage: data.status_message, - updatedAt: unmarshalDate(data.updated_at) + tags: data.tags, + type: data.type ? unmarshalGatewayType(data.type) : void 0, + updatedAt: marshalling.unmarshalDate(data.updated_at), + upstreamDnsServers: data.upstream_dns_servers, + version: data.version, + zone: data.zone + }; +}; +const unmarshalPATRule = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'PATRule' failed as data isn't a dictionary.` + ); + } + return { + createdAt: marshalling.unmarshalDate(data.created_at), + gatewayId: data.gateway_id, + id: data.id, + privateIp: data.private_ip, + privatePort: data.private_port, + protocol: data.protocol, + publicPort: data.public_port, + updatedAt: marshalling.unmarshalDate(data.updated_at), + zone: data.zone + }; +}; +const unmarshalListDHCPEntriesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListDHCPEntriesResponse' failed as data isn't a dictionary.` + ); + } + return { + dhcpEntries: marshalling.unmarshalArrayOfObject(data.dhcp_entries, unmarshalDHCPEntry), + totalCount: data.total_count + }; +}; +const unmarshalListDHCPsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListDHCPsResponse' failed as data isn't a dictionary.` + ); + } + return { + dhcps: marshalling.unmarshalArrayOfObject(data.dhcps, unmarshalDHCP), + totalCount: data.total_count + }; +}; +const unmarshalListGatewayNetworksResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListGatewayNetworksResponse' failed as data isn't a dictionary.` + ); + } + return { + gatewayNetworks: marshalling.unmarshalArrayOfObject( + data.gateway_networks, + unmarshalGatewayNetwork + ), + totalCount: data.total_count }; }; -const unmarshalTag = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Tag' failed as data isn't a dictionary.`); +const unmarshalListGatewayTypesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListGatewayTypesResponse' failed as data isn't a dictionary.` + ); } return { - createdAt: unmarshalDate(data.created_at), - digest: data.digest, - id: data.id, - imageId: data.image_id, - name: data.name, - status: data.status, - updatedAt: unmarshalDate(data.updated_at) + types: marshalling.unmarshalArrayOfObject(data.types, unmarshalGatewayType) }; }; -const unmarshalListImagesResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListImagesResponse' failed as data isn't a dictionary.`); +const unmarshalListGatewaysResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListGatewaysResponse' failed as data isn't a dictionary.` + ); } return { - images: unmarshalArrayOfObject(data.images, unmarshalImage), + gateways: marshalling.unmarshalArrayOfObject(data.gateways, unmarshalGateway), totalCount: data.total_count }; }; -const unmarshalListNamespacesResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListNamespacesResponse' failed as data isn't a dictionary.`); +const unmarshalListIPsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListIPsResponse' failed as data isn't a dictionary.` + ); } return { - namespaces: unmarshalArrayOfObject(data.namespaces, unmarshalNamespace), + ips: marshalling.unmarshalArrayOfObject(data.ips, unmarshalIP), totalCount: data.total_count }; }; -const unmarshalListTagsResponse$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListTagsResponse' failed as data isn't a dictionary.`); +const unmarshalListPATRulesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListPATRulesResponse' failed as data isn't a dictionary.` + ); } return { - tags: unmarshalArrayOfObject(data.tags, unmarshalTag), + patRules: marshalling.unmarshalArrayOfObject(data.pat_rules, unmarshalPATRule), totalCount: data.total_count }; }; -const marshalCreateNamespaceRequest = (request, defaults) => ({ - description: request.description, - is_public: request.isPublic, - name: request.name || randomName('ns'), - ...resolveOneOf([{ - default: defaults.defaultProjectId, - param: 'project_id', - value: request.projectId - }, { - default: defaults.defaultOrganizationId, - param: 'organization_id', - value: request.organizationId - }]) +const unmarshalSetDHCPEntriesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SetDHCPEntriesResponse' failed as data isn't a dictionary.` + ); + } + return { + dhcpEntries: marshalling.unmarshalArrayOfObject(data.dhcp_entries, unmarshalDHCPEntry) + }; +}; +const unmarshalSetPATRulesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'SetPATRulesResponse' failed as data isn't a dictionary.` + ); + } + return { + patRules: marshalling.unmarshalArrayOfObject(data.pat_rules, unmarshalPATRule) + }; +}; +const marshalCreateDHCPRequest = (request, defaults) => ({ + address: request.address, + dns_local_name: request.dnsLocalName, + dns_search: request.dnsSearch, + dns_servers_override: request.dnsServersOverride, + enable_dynamic: request.enableDynamic, + pool_high: request.poolHigh, + pool_low: request.poolLow, + project_id: request.projectId ?? defaults.defaultProjectId, + push_default_route: request.pushDefaultRoute, + push_dns_server: request.pushDnsServer, + rebind_timer: request.rebindTimer, + renew_timer: request.renewTimer, + subnet: request.subnet, + valid_lifetime: request.validLifetime }); -const marshalUpdateImageRequest = (request, defaults) => ({ - visibility: request.visibility ?? 'visibility_unknown' +const marshalCreateDHCPEntryRequest = (request, defaults) => ({ + gateway_network_id: request.gatewayNetworkId, + ip_address: request.ipAddress, + mac_address: request.macAddress }); -const marshalUpdateNamespaceRequest = (request, defaults) => ({ - description: request.description, - is_public: request.isPublic +const marshalCreateGatewayNetworkRequestIpamConfig = (request, defaults) => ({ + ipam_ip_id: request.ipamIpId, + push_default_route: request.pushDefaultRoute +}); +const marshalCreateGatewayNetworkRequest = (request, defaults) => ({ + enable_dhcp: request.enableDhcp, + enable_masquerade: request.enableMasquerade, + gateway_id: request.gatewayId, + private_network_id: request.privateNetworkId, + ...marshalling.resolveOneOf([ + { param: "dhcp_id", value: request.dhcpId }, + { + param: "dhcp", + value: request.dhcp !== void 0 ? marshalCreateDHCPRequest(request.dhcp, defaults) : void 0 + }, + { param: "address", value: request.address }, + { + param: "ipam_config", + value: request.ipamConfig !== void 0 ? marshalCreateGatewayNetworkRequestIpamConfig( + request.ipamConfig + ) : void 0 + } + ]) +}); +const marshalCreateGatewayRequest = (request, defaults) => ({ + bastion_port: request.bastionPort, + enable_bastion: request.enableBastion, + enable_smtp: request.enableSmtp, + ip_id: request.ipId, + name: request.name || randomName("gw"), + project_id: request.projectId ?? defaults.defaultProjectId, + tags: request.tags, + type: request.type, + upstream_dns_servers: request.upstreamDnsServers +}); +const marshalCreateIPRequest = (request, defaults) => ({ + project_id: request.projectId ?? defaults.defaultProjectId, + tags: request.tags +}); +const marshalCreatePATRuleRequest = (request, defaults) => ({ + gateway_id: request.gatewayId, + private_ip: request.privateIp, + private_port: request.privatePort, + protocol: request.protocol, + public_port: request.publicPort +}); +const marshalSetDHCPEntriesRequestEntry = (request, defaults) => ({ + ip_address: request.ipAddress, + mac_address: request.macAddress +}); +const marshalSetDHCPEntriesRequest = (request, defaults) => ({ + dhcp_entries: request.dhcpEntries !== void 0 ? request.dhcpEntries.map( + (elt) => marshalSetDHCPEntriesRequestEntry(elt) + ) : void 0, + gateway_network_id: request.gatewayNetworkId +}); +const marshalSetPATRulesRequestRule = (request, defaults) => ({ + private_ip: request.privateIp, + private_port: request.privatePort, + protocol: request.protocol, + public_port: request.publicPort +}); +const marshalSetPATRulesRequest = (request, defaults) => ({ + gateway_id: request.gatewayId, + pat_rules: request.patRules.map( + (elt) => marshalSetPATRulesRequestRule(elt) + ) +}); +const marshalUpdateDHCPEntryRequest = (request, defaults) => ({ + ip_address: request.ipAddress +}); +const marshalUpdateDHCPRequest = (request, defaults) => ({ + address: request.address, + dns_local_name: request.dnsLocalName, + dns_search: request.dnsSearch, + dns_servers_override: request.dnsServersOverride, + enable_dynamic: request.enableDynamic, + pool_high: request.poolHigh, + pool_low: request.poolLow, + push_default_route: request.pushDefaultRoute, + push_dns_server: request.pushDnsServer, + rebind_timer: request.rebindTimer, + renew_timer: request.renewTimer, + subnet: request.subnet, + valid_lifetime: request.validLifetime +}); +const marshalUpdateGatewayNetworkRequestIpamConfig = (request, defaults) => ({ + ipam_ip_id: request.ipamIpId, + push_default_route: request.pushDefaultRoute +}); +const marshalUpdateGatewayNetworkRequest = (request, defaults) => ({ + enable_dhcp: request.enableDhcp, + enable_masquerade: request.enableMasquerade, + ...marshalling.resolveOneOf([ + { param: "dhcp_id", value: request.dhcpId }, + { param: "address", value: request.address }, + { + param: "ipam_config", + value: request.ipamConfig !== void 0 ? marshalUpdateGatewayNetworkRequestIpamConfig( + request.ipamConfig + ) : void 0 + } + ]) +}); +const marshalUpdateGatewayRequest = (request, defaults) => ({ + bastion_port: request.bastionPort, + enable_bastion: request.enableBastion, + enable_smtp: request.enableSmtp, + name: request.name, + tags: request.tags, + upstream_dns_servers: request.upstreamDnsServers +}); +const marshalUpdateIPRequest = (request, defaults) => ({ + gateway_id: request.gatewayId, + reverse: request.reverse, + tags: request.tags +}); +const marshalUpdatePATRuleRequest = (request, defaults) => ({ + private_ip: request.privateIp, + private_port: request.privatePort, + protocol: request.protocol, + public_port: request.publicPort +}); +const marshalUpgradeGatewayRequest = (request, defaults) => ({ + type: request.type }); +exports.marshalCreateDHCPEntryRequest = marshalCreateDHCPEntryRequest; +exports.marshalCreateDHCPRequest = marshalCreateDHCPRequest; +exports.marshalCreateGatewayNetworkRequest = marshalCreateGatewayNetworkRequest; +exports.marshalCreateGatewayRequest = marshalCreateGatewayRequest; +exports.marshalCreateIPRequest = marshalCreateIPRequest; +exports.marshalCreatePATRuleRequest = marshalCreatePATRuleRequest; +exports.marshalSetDHCPEntriesRequest = marshalSetDHCPEntriesRequest; +exports.marshalSetPATRulesRequest = marshalSetPATRulesRequest; +exports.marshalUpdateDHCPEntryRequest = marshalUpdateDHCPEntryRequest; +exports.marshalUpdateDHCPRequest = marshalUpdateDHCPRequest; +exports.marshalUpdateGatewayNetworkRequest = marshalUpdateGatewayNetworkRequest; +exports.marshalUpdateGatewayRequest = marshalUpdateGatewayRequest; +exports.marshalUpdateIPRequest = marshalUpdateIPRequest; +exports.marshalUpdatePATRuleRequest = marshalUpdatePATRuleRequest; +exports.marshalUpgradeGatewayRequest = marshalUpgradeGatewayRequest; +exports.unmarshalDHCP = unmarshalDHCP; +exports.unmarshalDHCPEntry = unmarshalDHCPEntry; +exports.unmarshalGateway = unmarshalGateway; +exports.unmarshalGatewayNetwork = unmarshalGatewayNetwork; +exports.unmarshalIP = unmarshalIP; +exports.unmarshalListDHCPEntriesResponse = unmarshalListDHCPEntriesResponse; +exports.unmarshalListDHCPsResponse = unmarshalListDHCPsResponse; +exports.unmarshalListGatewayNetworksResponse = unmarshalListGatewayNetworksResponse; +exports.unmarshalListGatewayTypesResponse = unmarshalListGatewayTypesResponse; +exports.unmarshalListGatewaysResponse = unmarshalListGatewaysResponse; +exports.unmarshalListIPsResponse = unmarshalListIPsResponse; +exports.unmarshalListPATRulesResponse = unmarshalListPATRulesResponse; +exports.unmarshalPATRule = unmarshalPATRule; +exports.unmarshalSetDHCPEntriesResponse = unmarshalSetDHCPEntriesResponse; +exports.unmarshalSetPATRulesResponse = unmarshalSetPATRulesResponse; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const jsonContentHeaders$7 = { - 'Content-Type': 'application/json; charset=utf-8' -}; -/** Container Registry API. */ -let API$7 = class API extends API$u { - /** Lists the available regions of the API. */ - static LOCALITIES = ['fr-par', 'nl-ams', 'pl-waw']; - pageOfListNamespaces = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/registry/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces`, - urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId]) - }, unmarshalListNamespacesResponse); +/***/ }), + +/***/ 8212: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const index_gen = __nccwpck_require__(8814); +const index_gen$1 = __nccwpck_require__(9803); +exports.v1 = index_gen; +exports.v1alpha1 = index_gen$1; + + +/***/ }), + +/***/ 9518: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const intervalRetrier = __nccwpck_require__(9052); +const api = __nccwpck_require__(3042); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const resourcePaginator = __nccwpck_require__(4983); +const content_gen = __nccwpck_require__(9617); +const marshalling_gen = __nccwpck_require__(4635); +const jsonContentHeaders = { + "Content-Type": "application/json; charset=utf-8" +}; +class ControlPanelAPI extends api.API { + /** Lists the available regions of the API. */ + static LOCALITIES = ["fr-par", "nl-ams"]; + pageOfListControlPanels = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/webhosting/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/control-panels`, + urlParams: marshalling.urlParams( + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListControlPanelsResponse + ); /** - * List namespaces. List all namespaces in a specified region. By default, the - * namespaces listed are ordered by creation date in ascending order. This can - * be modified via the order_by field. You can also define additional - * parameters for your query, such as the `instance_id` and `project_id` - * parameters. + * "List the control panels type: cpanel or plesk.". * - * @param request - The request {@link ListNamespacesRequest} - * @returns A Promise of ListNamespacesResponse + * @param request - The request {@link ControlPanelApiListControlPanelsRequest} + * @returns A Promise of ListControlPanelsResponse */ - listNamespaces = (request = {}) => enrichForPagination('namespaces', this.pageOfListNamespaces, request); - + listControlPanels = (request = {}) => resourcePaginator.enrichForPagination("controlPanels", this.pageOfListControlPanels, request); +} +class DatabaseAPI extends api.API { + /** Lists the available regions of the API. */ + static LOCALITIES = ["fr-par", "nl-ams", "pl-waw"]; /** - * Get a namespace. Retrieve information about a given namespace, specified by - * its `namespace_id` and region. Full details about the namespace, such as - * `description`, `project_id`, `status`, `endpoint`, `is_public`, `size`, and - * `image_count` are returned in the response. + * "Create a new database within your hosting plan". * - * @param request - The request {@link GetNamespaceRequest} - * @returns A Promise of Namespace + * @param request - The request {@link DatabaseApiCreateDatabaseRequest} + * @returns A Promise of Database */ - getNamespace = request => this.client.fetch({ - method: 'GET', - path: `/registry/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam('namespaceId', request.namespaceId)}` - }, unmarshalNamespace); - + createDatabase = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalDatabaseApiCreateDatabaseRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/webhosting/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam("hostingId", request.hostingId)}/databases` + }, + marshalling_gen.unmarshalDatabase + ); + pageOfListDatabases = (request) => this.client.fetch( + { + method: "GET", + path: `/webhosting/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam("hostingId", request.hostingId)}/databases`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListDatabasesResponse + ); /** - * Waits for {@link Namespace} to be in a final state. + * "List all databases within your hosting plan". * - * @param request - The request {@link GetNamespaceRequest} - * @param options - The waiting options - * @returns A Promise of Namespace + * @param request - The request {@link DatabaseApiListDatabasesRequest} + * @returns A Promise of ListDatabasesResponse */ - waitForNamespace = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!NAMESPACE_TRANSIENT_STATUSES.includes(res.status))), this.getNamespace, request, options); - + listDatabases = (request) => resourcePaginator.enrichForPagination("databases", this.pageOfListDatabases, request); /** - * Create a namespace. Create a new Container Registry namespace. You must - * specify the namespace name and region in which you want it to be created. - * Optionally, you can specify the `project_id` and `is_public` in the request - * payload. + * "Get details of a database within your hosting plan". * - * @param request - The request {@link CreateNamespaceRequest} - * @returns A Promise of Namespace + * @param request - The request {@link DatabaseApiGetDatabaseRequest} + * @returns A Promise of Database */ - createNamespace = request => this.client.fetch({ - body: JSON.stringify(marshalCreateNamespaceRequest(request, this.client.settings)), - headers: jsonContentHeaders$7, - method: 'POST', - path: `/registry/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces` - }, unmarshalNamespace); - + getDatabase = (request) => this.client.fetch( + { + method: "GET", + path: `/webhosting/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam("hostingId", request.hostingId)}/databases/${marshalling.validatePathParam("databaseName", request.databaseName)}` + }, + marshalling_gen.unmarshalDatabase + ); /** - * Update a namespace. Update the parameters of a given namespace, specified - * by its `namespace_id` and `region`. You can update the `description` and - * `is_public` parameters. + * "Delete a database within your hosting plan". * - * @param request - The request {@link UpdateNamespaceRequest} - * @returns A Promise of Namespace + * @param request - The request {@link DatabaseApiDeleteDatabaseRequest} + * @returns A Promise of Database */ - updateNamespace = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateNamespaceRequest(request, this.client.settings)), - headers: jsonContentHeaders$7, - method: 'PATCH', - path: `/registry/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam('namespaceId', request.namespaceId)}` - }, unmarshalNamespace); - + deleteDatabase = (request) => this.client.fetch( + { + method: "DELETE", + path: `/webhosting/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam("hostingId", request.hostingId)}/databases/${marshalling.validatePathParam("databaseName", request.databaseName)}` + }, + marshalling_gen.unmarshalDatabase + ); + /** + * "Create a new database user". + * + * @param request - The request {@link DatabaseApiCreateDatabaseUserRequest} + * @returns A Promise of DatabaseUser + */ + createDatabaseUser = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalDatabaseApiCreateDatabaseUserRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/webhosting/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam("hostingId", request.hostingId)}/databases-users` + }, + marshalling_gen.unmarshalDatabaseUser + ); + pageOfListDatabaseUsers = (request) => this.client.fetch( + { + method: "GET", + path: `/webhosting/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam("hostingId", request.hostingId)}/database-users`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListDatabaseUsersResponse + ); /** - * Delete a namespace. Delete a given namespace. You must specify, in the - * endpoint, the `region` and `namespace_id` parameters of the namespace you - * want to delete. + * "List all database users". * - * @param request - The request {@link DeleteNamespaceRequest} - * @returns A Promise of Namespace + * @param request - The request {@link DatabaseApiListDatabaseUsersRequest} + * @returns A Promise of ListDatabaseUsersResponse */ - deleteNamespace = request => this.client.fetch({ - method: 'DELETE', - path: `/registry/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam('namespaceId', request.namespaceId)}` - }, unmarshalNamespace); - pageOfListImages = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/registry/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/images`, - urlParams: urlParams(['name', request.name], ['namespace_id', request.namespaceId], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId]) - }, unmarshalListImagesResponse); - + listDatabaseUsers = (request) => resourcePaginator.enrichForPagination("users", this.pageOfListDatabaseUsers, request); /** - * List images. List all images in a specified region. By default, the images - * listed are ordered by creation date in ascending order. This can be - * modified via the order_by field. You can also define additional parameters - * for your query, such as the `namespace_id` and `project_id` parameters. + * "Get details of a database user". * - * @param request - The request {@link ListImagesRequest} - * @returns A Promise of ListImagesResponse + * @param request - The request {@link DatabaseApiGetDatabaseUserRequest} + * @returns A Promise of DatabaseUser + */ + getDatabaseUser = (request) => this.client.fetch( + { + method: "GET", + path: `/webhosting/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam("hostingId", request.hostingId)}/databases-users/${marshalling.validatePathParam("username", request.username)}` + }, + marshalling_gen.unmarshalDatabaseUser + ); + /** + * "Delete a database user". + * + * @param request - The request {@link DatabaseApiDeleteDatabaseUserRequest} + * @returns A Promise of DatabaseUser + */ + deleteDatabaseUser = (request) => this.client.fetch( + { + method: "DELETE", + path: `/webhosting/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam("hostingId", request.hostingId)}/database-users/${marshalling.validatePathParam("username", request.username)}` + }, + marshalling_gen.unmarshalDatabaseUser + ); + /** + * "Change the password of a database user". + * + * @param request - The request + * {@link DatabaseApiChangeDatabaseUserPasswordRequest} + * @returns A Promise of DatabaseUser + */ + changeDatabaseUserPassword = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalDatabaseApiChangeDatabaseUserPasswordRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/webhosting/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam("hostingId", request.hostingId)}/databases-users/${marshalling.validatePathParam("username", request.username)}/change-password` + }, + marshalling_gen.unmarshalDatabaseUser + ); + /** + * "Assign a database user to a database". + * + * @param request - The request {@link DatabaseApiAssignDatabaseUserRequest} + * @returns A Promise of DatabaseUser + */ + assignDatabaseUser = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalDatabaseApiAssignDatabaseUserRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/webhosting/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam("hostingId", request.hostingId)}/databases/${marshalling.validatePathParam("databaseName", request.databaseName)}/assign-user` + }, + marshalling_gen.unmarshalDatabaseUser + ); + /** + * "Unassign a database user from a database". + * + * @param request - The request {@link DatabaseApiUnassignDatabaseUserRequest} + * @returns A Promise of DatabaseUser + */ + unassignDatabaseUser = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalDatabaseApiUnassignDatabaseUserRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/webhosting/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam("hostingId", request.hostingId)}/databases/${marshalling.validatePathParam("databaseName", request.databaseName)}/unassign-user` + }, + marshalling_gen.unmarshalDatabaseUser + ); +} +class OfferAPI extends api.API { + /** Lists the available regions of the API. */ + static LOCALITIES = ["fr-par", "nl-ams", "pl-waw"]; + pageOfListOffers = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/webhosting/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/offers`, + urlParams: marshalling.urlParams( + ["control_panels", request.controlPanels], + ["hosting_id", request.hostingId], + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListOffersResponse + ); + /** + * List all available hosting offers along with their specific options.. List + * all available hosting offers along with their specific options. + * + * @param request - The request {@link OfferApiListOffersRequest} + * @returns A Promise of ListOffersResponse + */ + listOffers = (request = {}) => resourcePaginator.enrichForPagination("offers", this.pageOfListOffers, request); +} +class HostingAPI extends api.API { + /** Lists the available regions of the API. */ + static LOCALITIES = ["fr-par", "nl-ams"]; + /** + * Order a Web Hosting plan. Order a Web Hosting plan, specifying the offer + * type required via the `offer_id` parameter. + * + * @param request - The request {@link HostingApiCreateHostingRequest} + * @returns A Promise of Hosting + */ + createHosting = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalHostingApiCreateHostingRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/webhosting/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings` + }, + marshalling_gen.unmarshalHosting + ); + pageOfListHostings = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/webhosting/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings`, + urlParams: marshalling.urlParams( + ["control_panels", request.controlPanels], + ["domain", request.domain], + ["order_by", request.orderBy], + [ + "organization_id", + request.organizationId ?? this.client.settings.defaultOrganizationId + ], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + [ + "project_id", + request.projectId ?? this.client.settings.defaultProjectId + ], + ["statuses", request.statuses], + ["tags", request.tags] + ) + }, + marshalling_gen.unmarshalListHostingsResponse + ); + /** + * List all Web Hosting plans. List all of your existing Web Hosting plans. + * Various filters are available to limit the results, including filtering by + * domain, status, tag and Project ID. + * + * @param request - The request {@link HostingApiListHostingsRequest} + * @returns A Promise of ListHostingsResponse + */ + listHostings = (request = {}) => resourcePaginator.enrichForPagination("hostings", this.pageOfListHostings, request); + /** + * Get a Web Hosting plan. Get the details of one of your existing Web Hosting + * plans, specified by its `hosting_id`. + * + * @param request - The request {@link HostingApiGetHostingRequest} + * @returns A Promise of Hosting + */ + getHosting = (request) => this.client.fetch( + { + method: "GET", + path: `/webhosting/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam("hostingId", request.hostingId)}` + }, + marshalling_gen.unmarshalHosting + ); + /** + * Waits for {@link Hosting} to be in a final state. + * + * @param request - The request {@link HostingApiGetHostingRequest} + * @param options - The waiting options + * @returns A Promise of Hosting */ - listImages = (request = {}) => enrichForPagination('images', this.pageOfListImages, request); - + waitForHosting = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve(!content_gen.HOSTING_TRANSIENT_STATUSES.includes(res.status))), + this.getHosting, + request, + options + ); /** - * Get an image. Retrieve information about a given container image, specified - * by its `image_id` and region. Full details about the image, such as `name`, - * `namespace_id`, `status`, `visibility`, and `size` are returned in the - * response. + * Update a Web Hosting plan. Update the details of one of your existing Web + * Hosting plans, specified by its `hosting_id`. You can update parameters + * including the contact email address, tags, options and offer. * - * @param request - The request {@link GetImageRequest} - * @returns A Promise of Image + * @param request - The request {@link HostingApiUpdateHostingRequest} + * @returns A Promise of Hosting */ - getImage = request => this.client.fetch({ - method: 'GET', - path: `/registry/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/images/${validatePathParam('imageId', request.imageId)}` - }, unmarshalImage); - + updateHosting = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalHostingApiUpdateHostingRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/webhosting/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam("hostingId", request.hostingId)}` + }, + marshalling_gen.unmarshalHosting + ); /** - * Waits for {@link Image} to be in a final state. + * Delete a Web Hosting plan. Delete a Web Hosting plan, specified by its + * `hosting_id`. Note that deletion is not immediate: it will take place at + * the end of the calendar month, after which time your Web Hosting plan and + * all its data (files and emails) will be irreversibly lost. * - * @param request - The request {@link GetImageRequest} - * @param options - The waiting options - * @returns A Promise of Image + * @param request - The request {@link HostingApiDeleteHostingRequest} + * @returns A Promise of Hosting */ - waitForImage = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!IMAGE_TRANSIENT_STATUSES.includes(res.status))), this.getImage, request, options); - + deleteHosting = (request) => this.client.fetch( + { + method: "DELETE", + path: `/webhosting/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam("hostingId", request.hostingId)}` + }, + marshalling_gen.unmarshalHosting + ); /** - * Update an image. Update the parameters of a given image, specified by its - * `image_id` and `region`. You can update the `visibility` parameter. + * Create a user session. * - * @param request - The request {@link UpdateImageRequest} - * @returns A Promise of Image + * @param request - The request {@link HostingApiCreateSessionRequest} + * @returns A Promise of Session */ - updateImage = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateImageRequest(request, this.client.settings)), - headers: jsonContentHeaders$7, - method: 'PATCH', - path: `/registry/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/images/${validatePathParam('imageId', request.imageId)}` - }, unmarshalImage); - + createSession = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/webhosting/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam("hostingId", request.hostingId)}/sessions` + }, + marshalling_gen.unmarshalSession + ); /** - * Delete an image. Delete a given image. You must specify, in the endpoint, - * the `region` and `image_id` parameters of the image you want to delete. + * Reset a Web Hosting plan password. * - * @param request - The request {@link DeleteImageRequest} - * @returns A Promise of Image + * @param request - The request {@link HostingApiResetHostingPasswordRequest} + * @returns A Promise of ResetHostingPasswordResponse */ - deleteImage = request => this.client.fetch({ - method: 'DELETE', - path: `/registry/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/images/${validatePathParam('imageId', request.imageId)}` - }, unmarshalImage); - pageOfListTags = request => this.client.fetch({ - method: 'GET', - path: `/registry/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/images/${validatePathParam('imageId', request.imageId)}/tags`, - urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize]) - }, unmarshalListTagsResponse$1); - + resetHostingPassword = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/webhosting/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam("hostingId", request.hostingId)}/reset-password` + }, + marshalling_gen.unmarshalResetHostingPasswordResponse + ); +} +class FtpAccountAPI extends api.API { + /** Lists the available regions of the API. */ + static LOCALITIES = ["fr-par", "nl-ams", "pl-waw"]; + /** + * Create a new FTP account within your hosting plan.. Create a new FTP + * account within your hosting plan. + * + * @param request - The request {@link FtpAccountApiCreateFtpAccountRequest} + * @returns A Promise of FtpAccount + */ + createFtpAccount = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalFtpAccountApiCreateFtpAccountRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/webhosting/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam("hostingId", request.hostingId)}/ftp-accounts` + }, + marshalling_gen.unmarshalFtpAccount + ); + pageOfListFtpAccounts = (request) => this.client.fetch( + { + method: "GET", + path: `/webhosting/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam("hostingId", request.hostingId)}/ftp-accounts`, + urlParams: marshalling.urlParams( + ["domain", request.domain], + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListFtpAccountsResponse + ); /** - * List tags. List all tags for a given image, specified by region. By - * default, the tags listed are ordered by creation date in ascending order. - * This can be modified via the order_by field. You can also define additional - * parameters for your query, such as the `name`. + * List all FTP accounts within your hosting plan.. List all FTP accounts + * within your hosting plan. * - * @param request - The request {@link ListTagsRequest} - * @returns A Promise of ListTagsResponse + * @param request - The request {@link FtpAccountApiListFtpAccountsRequest} + * @returns A Promise of ListFtpAccountsResponse */ - listTags = request => enrichForPagination('tags', this.pageOfListTags, request); - + listFtpAccounts = (request) => resourcePaginator.enrichForPagination("ftpAccounts", this.pageOfListFtpAccounts, request); /** - * Get a tag. Retrieve information about a given image tag, specified by its - * `tag_id` and region. Full details about the tag, such as `name`, - * `image_id`, `status`, and `digest` are returned in the response. + * Delete a specific FTP account within your hosting plan.. Delete a specific + * FTP account within your hosting plan. * - * @param request - The request {@link GetTagRequest} - * @returns A Promise of Tag + * @param request - The request {@link FtpAccountApiRemoveFtpAccountRequest} + * @returns A Promise of FtpAccount */ - getTag = request => this.client.fetch({ - method: 'GET', - path: `/registry/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/tags/${validatePathParam('tagId', request.tagId)}` - }, unmarshalTag); - + removeFtpAccount = (request) => this.client.fetch( + { + method: "DELETE", + path: `/webhosting/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam("hostingId", request.hostingId)}/ftp-accounts/${marshalling.validatePathParam("username", request.username)}` + }, + marshalling_gen.unmarshalFtpAccount + ); + changeFtpAccountPassword = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalFtpAccountApiChangeFtpAccountPasswordRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/webhosting/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam("hostingId", request.hostingId)}/ftp-accounts/${marshalling.validatePathParam("username", request.username)}/change-password` + }, + marshalling_gen.unmarshalFtpAccount + ); +} +class MailAccountAPI extends api.API { + /** Lists the available regions of the API. */ + static LOCALITIES = ["fr-par", "nl-ams", "pl-waw"]; + /** + * Create a new mail account within your hosting plan.. Create a new mail + * account within your hosting plan. + * + * @param request - The request {@link MailAccountApiCreateMailAccountRequest} + * @returns A Promise of MailAccount + */ + createMailAccount = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalMailAccountApiCreateMailAccountRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/webhosting/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam("hostingId", request.hostingId)}/mail-accounts` + }, + marshalling_gen.unmarshalMailAccount + ); + pageOfListMailAccounts = (request) => this.client.fetch( + { + method: "GET", + path: `/webhosting/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam("hostingId", request.hostingId)}/mail-accounts`, + urlParams: marshalling.urlParams( + ["domain", request.domain], + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListMailAccountsResponse + ); + /** + * List all mail accounts within your hosting plan.. List all mail accounts + * within your hosting plan. + * + * @param request - The request {@link MailAccountApiListMailAccountsRequest} + * @returns A Promise of ListMailAccountsResponse + */ + listMailAccounts = (request) => resourcePaginator.enrichForPagination("mailAccounts", this.pageOfListMailAccounts, request); + /** + * Delete a mail account within your hosting plan.. Delete a mail account + * within your hosting plan. + * + * @param request - The request {@link MailAccountApiRemoveMailAccountRequest} + * @returns A Promise of MailAccount + */ + removeMailAccount = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalMailAccountApiRemoveMailAccountRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/webhosting/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam("hostingId", request.hostingId)}/remove-mail-account` + }, + marshalling_gen.unmarshalMailAccount + ); /** - * Waits for {@link Tag} to be in a final state. + * Update the password of a mail account within your hosting plan.. Update the + * password of a mail account within your hosting plan. * - * @param request - The request {@link GetTagRequest} - * @param options - The waiting options - * @returns A Promise of Tag - */ - waitForTag = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!TAG_TRANSIENT_STATUSES.includes(res.status))), this.getTag, request, options); - + * @param request - The request + * {@link MailAccountApiChangeMailAccountPasswordRequest} + * @returns A Promise of MailAccount + */ + changeMailAccountPassword = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalMailAccountApiChangeMailAccountPasswordRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/webhosting/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam("hostingId", request.hostingId)}/change-mail-password` + }, + marshalling_gen.unmarshalMailAccount + ); +} +class WebsiteAPI extends api.API { + /** Lists the available regions of the API. */ + static LOCALITIES = ["fr-par", "nl-ams", "pl-waw"]; + pageOfListWebsites = (request) => this.client.fetch( + { + method: "GET", + path: `/webhosting/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam("hostingId", request.hostingId)}/websites`, + urlParams: marshalling.urlParams( + ["order_by", request.orderBy], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListWebsitesResponse + ); /** - * Delete a tag. Delete a given image tag. You must specify, in the endpoint, - * the `region` and `tag_id` parameters of the tag you want to delete. + * List all websites for a specific hosting.. List all websites for a specific + * hosting. * - * @param request - The request {@link DeleteTagRequest} - * @returns A Promise of Tag + * @param request - The request {@link WebsiteApiListWebsitesRequest} + * @returns A Promise of ListWebsitesResponse */ - deleteTag = request => this.client.fetch({ - method: 'DELETE', - path: `/registry/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/tags/${validatePathParam('tagId', request.tagId)}`, - urlParams: urlParams(['force', request.force]) - }, unmarshalTag); -}; + listWebsites = (request) => resourcePaginator.enrichForPagination("websites", this.pageOfListWebsites, request); +} +exports.ControlPanelAPI = ControlPanelAPI; +exports.DatabaseAPI = DatabaseAPI; +exports.FtpAccountAPI = FtpAccountAPI; +exports.HostingAPI = HostingAPI; +exports.MailAccountAPI = MailAccountAPI; +exports.OfferAPI = OfferAPI; +exports.WebsiteAPI = WebsiteAPI; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -var index_gen$7 = /*#__PURE__*/Object.freeze({ - __proto__: null, - API: API$7, - IMAGE_TRANSIENT_STATUSES: IMAGE_TRANSIENT_STATUSES, - NAMESPACE_TRANSIENT_STATUSES: NAMESPACE_TRANSIENT_STATUSES, - TAG_TRANSIENT_STATUSES: TAG_TRANSIENT_STATUSES -}); +/***/ }), -var index$6 = /*#__PURE__*/Object.freeze({ - __proto__: null, - v1: index_gen$7 -}); +/***/ 9617: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const HOSTING_TRANSIENT_STATUSES = [ + "delivering", + "deleting", + "migrating" +]; +const HOSTING_SUMMARY_TRANSIENT_STATUSES = [ + "delivering", + "deleting", + "migrating" +]; +exports.HOSTING_SUMMARY_TRANSIENT_STATUSES = HOSTING_SUMMARY_TRANSIENT_STATUSES; +exports.HOSTING_TRANSIENT_STATUSES = HOSTING_TRANSIENT_STATUSES; + + +/***/ }), + +/***/ 8814: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api_gen = __nccwpck_require__(9518); +const content_gen = __nccwpck_require__(9617); +const validationRules_gen = __nccwpck_require__(9009); +exports.ControlPanelAPI = api_gen.ControlPanelAPI; +exports.DatabaseAPI = api_gen.DatabaseAPI; +exports.FtpAccountAPI = api_gen.FtpAccountAPI; +exports.HostingAPI = api_gen.HostingAPI; +exports.MailAccountAPI = api_gen.MailAccountAPI; +exports.OfferAPI = api_gen.OfferAPI; +exports.WebsiteAPI = api_gen.WebsiteAPI; +exports.HOSTING_SUMMARY_TRANSIENT_STATUSES = content_gen.HOSTING_SUMMARY_TRANSIENT_STATUSES; +exports.HOSTING_TRANSIENT_STATUSES = content_gen.HOSTING_TRANSIENT_STATUSES; +exports.ValidationRules = validationRules_gen; + + +/***/ }), + +/***/ 4635: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const unmarshalFolder = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Folder' failed as data isn't a dictionary.`); +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const json = __nccwpck_require__(3746); +const customMarshalling = __nccwpck_require__(7586); +const marshalling = __nccwpck_require__(1162); +const unmarshalDatabaseUser = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DatabaseUser' failed as data isn't a dictionary.` + ); + } + return { + databases: data.databases, + username: data.username + }; +}; +const unmarshalDatabase = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Database' failed as data isn't a dictionary.` + ); + } + return { + databaseName: data.database_name, + users: data.users + }; +}; +const unmarshalFtpAccount = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'FtpAccount' failed as data isn't a dictionary.` + ); } return { - createdAt: unmarshalDate(data.created_at), - id: data.id, - name: data.name, path: data.path, - projectId: data.project_id + username: data.username }; }; -const unmarshalSecret = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Secret' failed as data isn't a dictionary.`); +const unmarshalMailAccount = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'MailAccount' failed as data isn't a dictionary.` + ); + } + return { + domain: data.domain, + username: data.username + }; +}; +const unmarshalHostingCpanelUrls = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'HostingCpanelUrls' failed as data isn't a dictionary.` + ); + } + return { + dashboard: data.dashboard, + webmail: data.webmail + }; +}; +const unmarshalHostingOption = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'HostingOption' failed as data isn't a dictionary.` + ); } return { - createdAt: unmarshalDate(data.created_at), - description: data.description, id: data.id, - isManaged: data.is_managed, - isProtected: data.is_protected, name: data.name, - path: data.path, + quantity: data.quantity + }; +}; +const unmarshalHosting = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Hosting' failed as data isn't a dictionary.` + ); + } + return { + contactEmail: data.contact_email, + controlPanelName: data.control_panel_name, + cpanelUrls: data.cpanel_urls ? unmarshalHostingCpanelUrls(data.cpanel_urls) : void 0, + createdAt: marshalling.unmarshalDate(data.created_at), + dnsStatus: data.dns_status, + domain: data.domain, + id: data.id, + ipv4: data.ipv4, + ipv6: data.ipv6, + offerEndOfLife: data.offer_end_of_life, + offerId: data.offer_id, + offerName: data.offer_name, + oneTimePassword: data.one_time_password, + options: marshalling.unmarshalArrayOfObject(data.options, unmarshalHostingOption), + platformGroup: data.platform_group, + platformHostname: data.platform_hostname, + platformNumber: data.platform_number, projectId: data.project_id, + protected: data.protected, region: data.region, status: data.status, tags: data.tags, - type: data.type, - updatedAt: unmarshalDate(data.updated_at), - versionCount: data.version_count + updatedAt: marshalling.unmarshalDate(data.updated_at), + username: data.username }; }; -const unmarshalSecretVersion = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'SecretVersion' failed as data isn't a dictionary.`); +const unmarshalControlPanel = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ControlPanel' failed as data isn't a dictionary.` + ); } return { - createdAt: unmarshalDate(data.created_at), - description: data.description, - isLatest: data.is_latest, - revision: data.revision, - secretId: data.secret_id, - status: data.status, - updatedAt: unmarshalDate(data.updated_at) + available: data.available, + availableLanguages: data.available_languages, + logoUrl: data.logo_url, + name: data.name }; }; -const unmarshalAccessSecretVersionResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'AccessSecretVersionResponse' failed as data isn't a dictionary.`); +const unmarshalListControlPanelsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListControlPanelsResponse' failed as data isn't a dictionary.` + ); } return { - data: data.data, - dataCrc32: data.data_crc32, - revision: data.revision, - secretId: data.secret_id + controlPanels: marshalling.unmarshalArrayOfObject( + data.control_panels, + unmarshalControlPanel + ), + totalCount: data.total_count + }; +}; +const unmarshalListDatabaseUsersResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListDatabaseUsersResponse' failed as data isn't a dictionary.` + ); + } + return { + totalCount: data.total_count, + users: marshalling.unmarshalArrayOfObject(data.users, unmarshalDatabaseUser) }; }; -const unmarshalListFoldersResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListFoldersResponse' failed as data isn't a dictionary.`); +const unmarshalListDatabasesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListDatabasesResponse' failed as data isn't a dictionary.` + ); } return { - folders: unmarshalArrayOfObject(data.folders, unmarshalFolder), + databases: marshalling.unmarshalArrayOfObject(data.databases, unmarshalDatabase), totalCount: data.total_count }; }; -const unmarshalListSecretVersionsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListSecretVersionsResponse' failed as data isn't a dictionary.`); +const unmarshalListFtpAccountsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListFtpAccountsResponse' failed as data isn't a dictionary.` + ); } return { - totalCount: data.total_count, - versions: unmarshalArrayOfObject(data.versions, unmarshalSecretVersion) + ftpAccounts: marshalling.unmarshalArrayOfObject(data.ftp_accounts, unmarshalFtpAccount), + totalCount: data.total_count + }; +}; +const unmarshalHostingSummary = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'HostingSummary' failed as data isn't a dictionary.` + ); + } + return { + domain: data.domain, + id: data.id, + projectId: data.project_id, + protected: data.protected, + region: data.region, + status: data.status, + updatedAt: marshalling.unmarshalDate(data.updated_at) }; }; -const unmarshalListSecretsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListSecretsResponse' failed as data isn't a dictionary.`); +const unmarshalListHostingsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListHostingsResponse' failed as data isn't a dictionary.` + ); } return { - secrets: unmarshalArrayOfObject(data.secrets, unmarshalSecret), + hostings: marshalling.unmarshalArrayOfObject(data.hostings, unmarshalHostingSummary), totalCount: data.total_count }; }; -const unmarshalListTagsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListTagsResponse' failed as data isn't a dictionary.`); +const unmarshalListMailAccountsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListMailAccountsResponse' failed as data isn't a dictionary.` + ); } return { - tags: data.tags, + mailAccounts: marshalling.unmarshalArrayOfObject( + data.mail_accounts, + unmarshalMailAccount + ), totalCount: data.total_count }; }; -const marshalPasswordGenerationParams = (request, defaults) => ({ - additional_chars: request.additionalChars, - length: request.length, - no_digits: request.noDigits, - no_lowercase_letters: request.noLowercaseLetters, - no_uppercase_letters: request.noUppercaseLetters +const unmarshalOfferOption = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'OfferOption' failed as data isn't a dictionary.` + ); + } + return { + billingOperationPath: data.billing_operation_path, + currentValue: data.current_value, + id: data.id, + maxValue: data.max_value, + minValue: data.min_value, + name: data.name, + quotaWarning: data.quota_warning + }; +}; +const unmarshalOffer = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Offer' failed as data isn't a dictionary.` + ); + } + return { + available: data.available, + billingOperationPath: data.billing_operation_path, + controlPanelName: data.control_panel_name, + endOfLife: data.end_of_life, + id: data.id, + options: marshalling.unmarshalArrayOfObject(data.options, unmarshalOfferOption), + price: data.price ? customMarshalling.unmarshalMoney(data.price) : void 0 + }; +}; +const unmarshalListOffersResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListOffersResponse' failed as data isn't a dictionary.` + ); + } + return { + offers: marshalling.unmarshalArrayOfObject(data.offers, unmarshalOffer), + totalCount: data.total_count + }; +}; +const unmarshalWebsite = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Website' failed as data isn't a dictionary.` + ); + } + return { + domain: data.domain, + path: data.path, + sslStatus: data.ssl_status + }; +}; +const unmarshalListWebsitesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListWebsitesResponse' failed as data isn't a dictionary.` + ); + } + return { + totalCount: data.total_count, + websites: marshalling.unmarshalArrayOfObject(data.websites, unmarshalWebsite) + }; +}; +const unmarshalResetHostingPasswordResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ResetHostingPasswordResponse' failed as data isn't a dictionary.` + ); + } + return { + oneTimePassword: data.one_time_password + }; +}; +const unmarshalSession = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Session' failed as data isn't a dictionary.` + ); + } + return { + url: data.url + }; +}; +const marshalDatabaseApiAssignDatabaseUserRequest = (request, defaults) => ({ + username: request.username }); -const marshalAddSecretOwnerRequest = (request, defaults) => ({ - product: request.product ?? 'unknown', - product_name: request.productName +const marshalDatabaseApiChangeDatabaseUserPasswordRequest = (request, defaults) => ({ + password: request.password }); -const marshalCreateFolderRequest = (request, defaults) => ({ - name: request.name, - path: request.path, - project_id: request.projectId ?? defaults.defaultProjectId +const marshalDatabaseApiCreateDatabaseRequest = (request, defaults) => ({ + database_name: request.databaseName }); -const marshalCreateSecretRequest = (request, defaults) => ({ - description: request.description, - name: request.name, - path: request.path, - project_id: request.projectId ?? defaults.defaultProjectId, - tags: request.tags, - type: request.type ?? 'unknown_secret_type' +const marshalDatabaseApiCreateDatabaseUserRequest = (request, defaults) => ({ + password: request.password, + username: request.username }); -const marshalCreateSecretVersionRequest = (request, defaults) => ({ - data: request.data, - data_crc32: request.dataCrc32, - description: request.description, - disable_previous: request.disablePrevious, - ...resolveOneOf([{ - param: 'password_generation', - value: request.passwordGeneration ? marshalPasswordGenerationParams(request.passwordGeneration) : undefined - }]) +const marshalDatabaseApiUnassignDatabaseUserRequest = (request, defaults) => ({ + username: request.username }); -const marshalGeneratePasswordRequest = (request, defaults) => ({ - additional_chars: request.additionalChars, - description: request.description, - disable_previous: request.disablePrevious, - length: request.length, - no_digits: request.noDigits, - no_lowercase_letters: request.noLowercaseLetters, - no_uppercase_letters: request.noUppercaseLetters +const marshalFtpAccountApiChangeFtpAccountPasswordRequest = (request, defaults) => ({ + password: request.password }); -const marshalUpdateSecretRequest = (request, defaults) => ({ - description: request.description, - name: request.name, +const marshalFtpAccountApiCreateFtpAccountRequest = (request, defaults) => ({ + password: request.password, path: request.path, + username: request.username +}); +const marshalCreateHostingRequestDomainConfiguration = (request, defaults) => ({ + update_all_records: request.updateAllRecords, + update_mail_record: request.updateMailRecord, + update_nameservers: request.updateNameservers, + update_web_record: request.updateWebRecord +}); +const marshalOfferOptionRequest = (request, defaults) => ({ + id: request.id, + quantity: request.quantity +}); +const marshalHostingApiCreateHostingRequest = (request, defaults) => ({ + domain: request.domain, + domain_configuration: request.domainConfiguration !== void 0 ? marshalCreateHostingRequestDomainConfiguration( + request.domainConfiguration + ) : void 0, + email: request.email, + language: request.language, + offer_id: request.offerId, + offer_options: request.offerOptions !== void 0 ? request.offerOptions.map( + (elt) => marshalOfferOptionRequest(elt) + ) : void 0, + project_id: request.projectId ?? defaults.defaultProjectId, + skip_welcome_email: request.skipWelcomeEmail, tags: request.tags }); -const marshalUpdateSecretVersionRequest = (request, defaults) => ({ - description: request.description +const marshalHostingApiUpdateHostingRequest = (request, defaults) => ({ + email: request.email, + offer_id: request.offerId, + offer_options: request.offerOptions !== void 0 ? request.offerOptions.map( + (elt) => marshalOfferOptionRequest(elt) + ) : void 0, + protected: request.protected, + tags: request.tags }); +const marshalMailAccountApiChangeMailAccountPasswordRequest = (request, defaults) => ({ + domain: request.domain, + password: request.password, + username: request.username +}); +const marshalMailAccountApiCreateMailAccountRequest = (request, defaults) => ({ + domain: request.domain, + password: request.password, + username: request.username +}); +const marshalMailAccountApiRemoveMailAccountRequest = (request, defaults) => ({ + domain: request.domain, + username: request.username +}); +exports.marshalDatabaseApiAssignDatabaseUserRequest = marshalDatabaseApiAssignDatabaseUserRequest; +exports.marshalDatabaseApiChangeDatabaseUserPasswordRequest = marshalDatabaseApiChangeDatabaseUserPasswordRequest; +exports.marshalDatabaseApiCreateDatabaseRequest = marshalDatabaseApiCreateDatabaseRequest; +exports.marshalDatabaseApiCreateDatabaseUserRequest = marshalDatabaseApiCreateDatabaseUserRequest; +exports.marshalDatabaseApiUnassignDatabaseUserRequest = marshalDatabaseApiUnassignDatabaseUserRequest; +exports.marshalFtpAccountApiChangeFtpAccountPasswordRequest = marshalFtpAccountApiChangeFtpAccountPasswordRequest; +exports.marshalFtpAccountApiCreateFtpAccountRequest = marshalFtpAccountApiCreateFtpAccountRequest; +exports.marshalHostingApiCreateHostingRequest = marshalHostingApiCreateHostingRequest; +exports.marshalHostingApiUpdateHostingRequest = marshalHostingApiUpdateHostingRequest; +exports.marshalMailAccountApiChangeMailAccountPasswordRequest = marshalMailAccountApiChangeMailAccountPasswordRequest; +exports.marshalMailAccountApiCreateMailAccountRequest = marshalMailAccountApiCreateMailAccountRequest; +exports.marshalMailAccountApiRemoveMailAccountRequest = marshalMailAccountApiRemoveMailAccountRequest; +exports.unmarshalDatabase = unmarshalDatabase; +exports.unmarshalDatabaseUser = unmarshalDatabaseUser; +exports.unmarshalFtpAccount = unmarshalFtpAccount; +exports.unmarshalHosting = unmarshalHosting; +exports.unmarshalListControlPanelsResponse = unmarshalListControlPanelsResponse; +exports.unmarshalListDatabaseUsersResponse = unmarshalListDatabaseUsersResponse; +exports.unmarshalListDatabasesResponse = unmarshalListDatabasesResponse; +exports.unmarshalListFtpAccountsResponse = unmarshalListFtpAccountsResponse; +exports.unmarshalListHostingsResponse = unmarshalListHostingsResponse; +exports.unmarshalListMailAccountsResponse = unmarshalListMailAccountsResponse; +exports.unmarshalListOffersResponse = unmarshalListOffersResponse; +exports.unmarshalListWebsitesResponse = unmarshalListWebsitesResponse; +exports.unmarshalMailAccount = unmarshalMailAccount; +exports.unmarshalResetHostingPasswordResponse = unmarshalResetHostingPasswordResponse; +exports.unmarshalSession = unmarshalSession; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const jsonContentHeaders$6 = { - 'Content-Type': 'application/json; charset=utf-8' -}; - -/** - * Secret Manager API. - * - * Secret Manager API. This API allows you to conveniently store, access and - * share sensitive data. - */ -let API$6 = class API extends API$u { - /** Lists the available regions of the API. */ - static LOCALITIES = ['fr-par']; - - /** - * Create a secret. You must specify the `region` to create a secret. - * - * @param request - The request {@link CreateSecretRequest} - * @returns A Promise of Secret - */ - createSecret = request => this.client.fetch({ - body: JSON.stringify(marshalCreateSecretRequest(request, this.client.settings)), - headers: jsonContentHeaders$6, - method: 'POST', - path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets` - }, unmarshalSecret); - - /** - * Create folder. - * - * @param request - The request {@link CreateFolderRequest} - * @returns A Promise of Folder - */ - createFolder = request => this.client.fetch({ - body: JSON.stringify(marshalCreateFolderRequest(request, this.client.settings)), - headers: jsonContentHeaders$6, - method: 'POST', - path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/folders` - }, unmarshalFolder); - - /** - * Get metadata using the secret's ID. Retrieve the metadata of a secret - * specified by the `region` and `secret_id` parameters. - * - * @param request - The request {@link GetSecretRequest} - * @returns A Promise of Secret - */ - getSecret = request => this.client.fetch({ - method: 'GET', - path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}` - }, unmarshalSecret); - - /** - * Get metadata using the secret's name. Retrieve the metadata of a secret - * specified by the `region` and `secret_name` parameters. - * - * GetSecretByName usage is now deprecated. - * - * Scaleway recommends that you use the `ListSecrets` request with the `name` - * filter. - * - * @deprecated - * @param request - The request {@link GetSecretByNameRequest} - * @returns A Promise of Secret - */ - getSecretByName = request => this.client.fetch({ - method: 'GET', - path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets-by-name/${validatePathParam('secretName', request.secretName)}`, - urlParams: urlParams(['project_id', request.projectId]) - }, unmarshalSecret); - /** - * Update metadata of a secret. Edit a secret's metadata such as name, tag(s) - * and description. The secret to update is specified by the `secret_id` and - * `region` parameters. - * - * @param request - The request {@link UpdateSecretRequest} - * @returns A Promise of Secret - */ - updateSecret = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateSecretRequest(request, this.client.settings)), - headers: jsonContentHeaders$6, - method: 'PATCH', - path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}` - }, unmarshalSecret); - pageOfListSecrets = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets`, - urlParams: urlParams(['is_managed', request.isManaged], ['name', request.name], ['order_by', request.orderBy ?? 'name_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['path', request.path], ['project_id', request.projectId], ['tags', request.tags]) - }, unmarshalListSecretsResponse); +/***/ }), - /** - * List secrets. Retrieve the list of secrets created within an Organization - * and/or Project. You must specify either the `organization_id` or the - * `project_id` and the `region`. - * - * @param request - The request {@link ListSecretsRequest} - * @returns A Promise of ListSecretsResponse - */ - listSecrets = (request = {}) => enrichForPagination('secrets', this.pageOfListSecrets, request); - pageOfListFolders = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/folders`, - urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['path', request.path], ['project_id', request.projectId]) - }, unmarshalListFoldersResponse); +/***/ 9009: +/***/ ((__unused_webpack_module, exports) => { - /** - * List folders. Retrieve the list of folders created within a Project. - * - * @param request - The request {@link ListFoldersRequest} - * @returns A Promise of ListFoldersResponse - */ - listFolders = (request = {}) => enrichForPagination('folders', this.pageOfListFolders, request); +"use strict"; - /** - * Delete a secret. Delete a given secret specified by the `region` and - * `secret_id` parameters. - * - * @param request - The request {@link DeleteSecretRequest} - */ - deleteSecret = request => this.client.fetch({ - method: 'DELETE', - path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}` - }); +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const ControlPanelApiListControlPanelsRequest = { + page: { + greaterThan: 0 + }, + pageSize: { + greaterThan: 0, + lessThanOrEqual: 100 + } +}; +const DatabaseApiListDatabaseUsersRequest = { + page: { + greaterThan: 0 + }, + pageSize: { + greaterThan: 0, + lessThanOrEqual: 100 + } +}; +const DatabaseApiListDatabasesRequest = { + page: { + greaterThan: 0 + }, + pageSize: { + greaterThan: 0, + lessThanOrEqual: 100 + } +}; +const FtpAccountApiListFtpAccountsRequest = { + page: { + greaterThan: 0 + }, + pageSize: { + greaterThan: 0, + lessThanOrEqual: 100 + } +}; +const HostingApiListHostingsRequest = { + page: { + greaterThan: 0 + }, + pageSize: { + greaterThan: 0, + lessThanOrEqual: 100 + } +}; +const MailAccountApiListMailAccountsRequest = { + page: { + greaterThan: 0 + }, + pageSize: { + greaterThan: 0, + lessThanOrEqual: 100 + } +}; +const OfferApiListOffersRequest = { + page: { + greaterThan: 0 + }, + pageSize: { + greaterThan: 0, + lessThanOrEqual: 100 + } +}; +const WebsiteApiListWebsitesRequest = { + page: { + greaterThan: 0 + }, + pageSize: { + greaterThan: 0, + lessThanOrEqual: 100 + } +}; +exports.ControlPanelApiListControlPanelsRequest = ControlPanelApiListControlPanelsRequest; +exports.DatabaseApiListDatabaseUsersRequest = DatabaseApiListDatabaseUsersRequest; +exports.DatabaseApiListDatabasesRequest = DatabaseApiListDatabasesRequest; +exports.FtpAccountApiListFtpAccountsRequest = FtpAccountApiListFtpAccountsRequest; +exports.HostingApiListHostingsRequest = HostingApiListHostingsRequest; +exports.MailAccountApiListMailAccountsRequest = MailAccountApiListMailAccountsRequest; +exports.OfferApiListOffersRequest = OfferApiListOffersRequest; +exports.WebsiteApiListWebsitesRequest = WebsiteApiListWebsitesRequest; - /** - * Delete a given folder specified by the `region` and `folder_id` parameters. - * - * @param request - The request {@link DeleteFolderRequest} - */ - deleteFolder = request => this.client.fetch({ - method: 'DELETE', - path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/folders/${validatePathParam('folderId', request.folderId)}` - }); - /** - * Protect a secret. Protect a given secret specified by the `secret_id` - * parameter. A protected secret can be read and modified but cannot be - * deleted. - * - * @param request - The request {@link ProtectSecretRequest} - * @returns A Promise of Secret - */ - protectSecret = request => this.client.fetch({ - body: '{}', - headers: jsonContentHeaders$6, - method: 'POST', - path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/protect` - }, unmarshalSecret); +/***/ }), - /** - * Unprotect a secret. Unprotect a given secret specified by the `secret_id` - * parameter. An unprotected secret can be read, modified and deleted. - * - * @param request - The request {@link UnprotectSecretRequest} - * @returns A Promise of Secret - */ - unprotectSecret = request => this.client.fetch({ - body: '{}', - headers: jsonContentHeaders$6, - method: 'POST', - path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/unprotect` - }, unmarshalSecret); +/***/ 6395: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - /** - * Allow a product to use the secret. - * - * @param request - The request {@link AddSecretOwnerRequest} - */ - addSecretOwner = request => this.client.fetch({ - body: JSON.stringify(marshalAddSecretOwnerRequest(request, this.client.settings)), - headers: jsonContentHeaders$6, - method: 'POST', - path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/add-owner` - }); +"use strict"; +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const intervalRetrier = __nccwpck_require__(9052); +const api = __nccwpck_require__(3042); +const marshalling = __nccwpck_require__(1162); +__nccwpck_require__(1187); +const resourcePaginator = __nccwpck_require__(4983); +const content_gen = __nccwpck_require__(8560); +const marshalling_gen = __nccwpck_require__(1353); +const jsonContentHeaders = { + "Content-Type": "application/json; charset=utf-8" +}; +class API extends api.API { + /** Lists the available regions of the API. */ + static LOCALITIES = ["fr-par", "nl-ams"]; /** - * Create a version. Create a version of a given secret specified by the - * `region` and `secret_id` parameters. + * Order a Web Hosting plan. Order a Web Hosting plan, specifying the offer + * type required via the `offer_id` parameter. * - * @param request - The request {@link CreateSecretVersionRequest} - * @returns A Promise of SecretVersion + * @param request - The request {@link CreateHostingRequest} + * @returns A Promise of Hosting */ - createSecretVersion = request => this.client.fetch({ - body: JSON.stringify(marshalCreateSecretVersionRequest(request, this.client.settings)), - headers: jsonContentHeaders$6, - method: 'POST', - path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions` - }, unmarshalSecretVersion); - + createHosting = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCreateHostingRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/webhosting/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings` + }, + marshalling_gen.unmarshalHosting + ); + pageOfListHostings = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/webhosting/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings`, + urlParams: marshalling.urlParams( + ["control_panels", request.controlPanels], + ["domain", request.domain], + ["order_by", request.orderBy], + ["organization_id", request.organizationId], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ], + ["project_id", request.projectId], + ["statuses", request.statuses], + ["tags", request.tags] + ) + }, + marshalling_gen.unmarshalListHostingsResponse + ); /** - * Generate a password in a new version. Generate a password for the given - * secret specified by the `region` and `secret_id` parameters. This will also - * create a new version of the secret that will store the password. + * List all Web Hosting plans. List all of your existing Web Hosting plans. + * Various filters are available to limit the results, including filtering by + * domain, status, tag and Project ID. * - * @param request - The request {@link GeneratePasswordRequest} - * @returns A Promise of SecretVersion + * @param request - The request {@link ListHostingsRequest} + * @returns A Promise of ListHostingsResponse */ - generatePassword = request => this.client.fetch({ - body: JSON.stringify(marshalGeneratePasswordRequest(request, this.client.settings)), - headers: jsonContentHeaders$6, - method: 'POST', - path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/generate-password` - }, unmarshalSecretVersion); - + listHostings = (request = {}) => resourcePaginator.enrichForPagination("hostings", this.pageOfListHostings, request); /** - * Get metadata of a secret's version using the secret's ID. Retrieve the - * metadata of a secret's given version specified by the `region`, `secret_id` - * and `revision` parameters. + * Get a Web Hosting plan. Get the details of one of your existing Web Hosting + * plans, specified by its `hosting_id`. * - * @param request - The request {@link GetSecretVersionRequest} - * @returns A Promise of SecretVersion + * @param request - The request {@link GetHostingRequest} + * @returns A Promise of Hosting */ - getSecretVersion = request => this.client.fetch({ - method: 'GET', - path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions/${validatePathParam('revision', request.revision)}` - }, unmarshalSecretVersion); - + getHosting = (request) => this.client.fetch( + { + method: "GET", + path: `/webhosting/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam("hostingId", request.hostingId)}` + }, + marshalling_gen.unmarshalHosting + ); /** - * Get metadata of a secret's version using the secret's name. Retrieve the - * metadata of a secret's given version specified by the `region`, - * `secret_name`, `revision` and `project_id` parameters. + * Waits for {@link Hosting} to be in a final state. * - * @param request - The request {@link GetSecretVersionByNameRequest} - * @returns A Promise of SecretVersion + * @param request - The request {@link GetHostingRequest} + * @param options - The waiting options + * @returns A Promise of Hosting */ - getSecretVersionByName = request => this.client.fetch({ - method: 'GET', - path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets-by-name/${validatePathParam('secretName', request.secretName)}/versions/${validatePathParam('revision', request.revision)}`, - urlParams: urlParams(['project_id', request.projectId]) - }, unmarshalSecretVersion); - + waitForHosting = (request, options) => intervalRetrier.waitForResource( + options?.stop ?? ((res) => Promise.resolve(!content_gen.HOSTING_TRANSIENT_STATUSES.includes(res.status))), + this.getHosting, + request, + options + ); /** - * Update metadata of a version. Edit the metadata of a secret's given - * version, specified by the `region`, `secret_id` and `revision` parameters. + * Update a Web Hosting plan. Update the details of one of your existing Web + * Hosting plans, specified by its `hosting_id`. You can update parameters + * including the contact email address, tags, options and offer. * - * @param request - The request {@link UpdateSecretVersionRequest} - * @returns A Promise of SecretVersion + * @param request - The request {@link UpdateHostingRequest} + * @returns A Promise of Hosting */ - updateSecretVersion = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateSecretVersionRequest(request, this.client.settings)), - headers: jsonContentHeaders$6, - method: 'PATCH', - path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions/${validatePathParam('revision', request.revision)}` - }, unmarshalSecretVersion); - pageOfListSecretVersions = request => this.client.fetch({ - method: 'GET', - path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions`, - urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['status', request.status]) - }, unmarshalListSecretVersionsResponse); - + updateHosting = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalUpdateHostingRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/webhosting/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam("hostingId", request.hostingId)}` + }, + marshalling_gen.unmarshalHosting + ); /** - * List versions of a secret using the secret's ID. Retrieve the list of a - * given secret's versions specified by the `secret_id` and `region` - * parameters. + * Delete a Web Hosting plan. Delete a Web Hosting plan, specified by its + * `hosting_id`. Note that deletion is not immediate: it will take place at + * the end of the calendar month, after which time your Web Hosting plan and + * all its data (files and emails) will be irreversibly lost. * - * @param request - The request {@link ListSecretVersionsRequest} - * @returns A Promise of ListSecretVersionsResponse + * @param request - The request {@link DeleteHostingRequest} + * @returns A Promise of Hosting */ - listSecretVersions = request => enrichForPagination('versions', this.pageOfListSecretVersions, request); - pageOfListSecretVersionsByName = request => this.client.fetch({ - method: 'GET', - path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets-by-name/${validatePathParam('secretName', request.secretName)}/versions`, - urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId], ['status', request.status]) - }, unmarshalListSecretVersionsResponse); - + deleteHosting = (request) => this.client.fetch( + { + method: "DELETE", + path: `/webhosting/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam("hostingId", request.hostingId)}` + }, + marshalling_gen.unmarshalHosting + ); /** - * List versions of a secret using the secret's name. Retrieve the list of a - * given secret's versions specified by the `secret_name`,`region` and - * `project_id` parameters. + * Restore a Web Hosting plan. When you [delete a Web Hosting + * plan](#path-hostings-delete-a-hosting), definitive deletion does not take + * place until the end of the calendar month. In the time between initiating + * the deletion, and definitive deletion at the end of the month, you can + * choose to **restore** the Web Hosting plan, using this endpoint and + * specifying its `hosting_id`. * - * @param request - The request {@link ListSecretVersionsByNameRequest} - * @returns A Promise of ListSecretVersionsResponse + * @param request - The request {@link RestoreHostingRequest} + * @returns A Promise of Hosting */ - listSecretVersionsByName = request => enrichForPagination('versions', this.pageOfListSecretVersionsByName, request); - + restoreHosting = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/webhosting/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam("hostingId", request.hostingId)}/restore` + }, + marshalling_gen.unmarshalHosting + ); /** - * Enable a version. Make a specific version accessible. You must specify the - * `region`, `secret_id` and `revision` parameters. + * Get DNS records. Get the set of DNS records of a specified domain + * associated with a Web Hosting plan. * - * @param request - The request {@link EnableSecretVersionRequest} - * @returns A Promise of SecretVersion + * @param request - The request {@link GetDomainDnsRecordsRequest} + * @returns A Promise of DnsRecords */ - enableSecretVersion = request => this.client.fetch({ - body: '{}', - headers: jsonContentHeaders$6, - method: 'POST', - path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions/${validatePathParam('revision', request.revision)}/enable` - }, unmarshalSecretVersion); - + getDomainDnsRecords = (request) => this.client.fetch( + { + method: "GET", + path: `/webhosting/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${marshalling.validatePathParam("domain", request.domain)}/dns-records` + }, + marshalling_gen.unmarshalDnsRecords + ); + /** + * "Check whether you own this domain or not.". + * + * @param request - The request {@link CheckUserOwnsDomainRequest} + * @returns A Promise of CheckUserOwnsDomainResponse + */ + checkUserOwnsDomain = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalCheckUserOwnsDomainRequest(request, this.client.settings) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/webhosting/v1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/domains/${marshalling.validatePathParam("domain", request.domain)}/check-ownership` + }, + marshalling_gen.unmarshalCheckUserOwnsDomainResponse + ); /** - * Disable a version. Make a specific version inaccessible. You must specify - * the `region`, `secret_id` and `revision` parameters. + * List all offers. List the different Web Hosting offers, and their options, + * available to order from Scaleway. * - * @param request - The request {@link DisableSecretVersionRequest} - * @returns A Promise of SecretVersion + * @param request - The request {@link ListOffersRequest} + * @returns A Promise of ListOffersResponse */ - disableSecretVersion = request => this.client.fetch({ - body: '{}', - headers: jsonContentHeaders$6, - method: 'POST', - path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions/${validatePathParam('revision', request.revision)}/disable` - }, unmarshalSecretVersion); - + listOffers = (request) => this.client.fetch( + { + method: "GET", + path: `/webhosting/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/offers`, + urlParams: marshalling.urlParams( + ["control_panels", request.controlPanels], + ["hosting_id", request.hostingId], + ["only_options", request.onlyOptions], + ["order_by", request.orderBy], + ["without_options", request.withoutOptions] + ) + }, + marshalling_gen.unmarshalListOffersResponse + ); + pageOfListControlPanels = (request = {}) => this.client.fetch( + { + method: "GET", + path: `/webhosting/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/control-panels`, + urlParams: marshalling.urlParams( + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListControlPanelsResponse + ); /** - * Access a secret's version using the secret's ID. Access sensitive data in a - * secret's version specified by the `region`, `secret_id` and `revision` - * parameters. + * "List the control panels type: cpanel or plesk.". * - * @param request - The request {@link AccessSecretVersionRequest} - * @returns A Promise of AccessSecretVersionResponse + * @param request - The request {@link ListControlPanelsRequest} + * @returns A Promise of ListControlPanelsResponse */ - accessSecretVersion = request => this.client.fetch({ - method: 'GET', - path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions/${validatePathParam('revision', request.revision)}/access` - }, unmarshalAccessSecretVersionResponse); - + listControlPanels = (request = {}) => resourcePaginator.enrichForPagination("controlPanels", this.pageOfListControlPanels, request); /** - * Access a secret's version using the secret's name. Access sensitive data in - * a secret's version specified by the `region`, `secret_name`, `revision` and - * `project_id` parameters. + * Create a user session. * - * @param request - The request {@link AccessSecretVersionByNameRequest} - * @returns A Promise of AccessSecretVersionResponse + * @param request - The request {@link CreateSessionRequest} + * @returns A Promise of Session */ - accessSecretVersionByName = request => this.client.fetch({ - method: 'GET', - path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets-by-name/${validatePathParam('secretName', request.secretName)}/versions/${validatePathParam('revision', request.revision)}/access`, - urlParams: urlParams(['project_id', request.projectId]) - }, unmarshalAccessSecretVersionResponse); - + createSession = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/webhosting/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam("hostingId", request.hostingId)}/sessions` + }, + marshalling_gen.unmarshalSession + ); + resetHostingPassword = (request) => this.client.fetch( + { + body: "{}", + headers: jsonContentHeaders, + method: "POST", + path: `/webhosting/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam("hostingId", request.hostingId)}/reset-password` + }, + marshalling_gen.unmarshalResetHostingPasswordResponse + ); +} +class ClassicMailAPI extends api.API { + /** Lists the available regions of the API. */ + static LOCALITIES = ["fr-par", "nl-ams", "pl-waw"]; + /** + * Create a new mailbox within your hosting plan.. Create a new mailbox within + * your hosting plan. + * + * @param request - The request {@link ClassicMailApiCreateMailboxRequest} + * @returns A Promise of Mailbox + */ + createMailbox = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalClassicMailApiCreateMailboxRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "POST", + path: `/webhosting/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/classic-hostings/${marshalling.validatePathParam("onlineId", request.onlineId)}/mailboxes` + }, + marshalling_gen.unmarshalMailbox + ); /** - * Delete a version. Delete a secret's version and the sensitive data - * contained in it. Deleting a version is permanent and cannot be undone. + * Get a mailbox by id within your hosting plan.. Get a mailbox by id within + * your hosting plan. * - * @param request - The request {@link DestroySecretVersionRequest} - * @returns A Promise of SecretVersion + * @param request - The request {@link ClassicMailApiGetMailboxRequest} + * @returns A Promise of Mailbox */ - destroySecretVersion = request => this.client.fetch({ - body: '{}', - headers: jsonContentHeaders$6, - method: 'POST', - path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions/${validatePathParam('revision', request.revision)}/destroy` - }, unmarshalSecretVersion); - pageOfListTags = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/tags`, - urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId]) - }, unmarshalListTagsResponse); - + getMailbox = (request) => this.client.fetch( + { + method: "GET", + path: `/webhosting/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/classic-hostings/${marshalling.validatePathParam("onlineId", request.onlineId)}/mailboxes/${marshalling.validatePathParam("mailboxId", request.mailboxId)}` + }, + marshalling_gen.unmarshalMailbox + ); + pageOfListMailboxes = (request) => this.client.fetch( + { + method: "GET", + path: `/webhosting/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/classic-hostings/${marshalling.validatePathParam("onlineId", request.onlineId)}/mailboxes`, + urlParams: marshalling.urlParams( + ["domain", request.domain], + ["page", request.page], + [ + "page_size", + request.pageSize ?? this.client.settings.defaultPageSize + ] + ) + }, + marshalling_gen.unmarshalListMailboxesResponse + ); /** - * List tags. List all tags associated with secrets within a given Project. + * List all mailboxes within your hosting plan.. List all mailboxes within + * your hosting plan. * - * @param request - The request {@link ListTagsRequest} - * @returns A Promise of ListTagsResponse + * @param request - The request {@link ClassicMailApiListMailboxesRequest} + * @returns A Promise of ListMailboxesResponse */ - listTags = (request = {}) => enrichForPagination('tags', this.pageOfListTags, request); -}; + listMailboxes = (request) => resourcePaginator.enrichForPagination("mailboxes", this.pageOfListMailboxes, request); + deleteMailbox = (request) => this.client.fetch( + { + method: "DELETE", + path: `/webhosting/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/classic-hostings/${marshalling.validatePathParam("onlineId", request.onlineId)}/mailboxes/${marshalling.validatePathParam("mailboxId", request.mailboxId)}` + }, + marshalling_gen.unmarshalMailbox + ); + /** + * Update the mailbox within your hosting plan.. Update the mailbox within + * your hosting plan. + * + * @param request - The request {@link ClassicMailApiUpdateMailboxRequest} + * @returns A Promise of Mailbox + */ + updateMailbox = (request) => this.client.fetch( + { + body: JSON.stringify( + marshalling_gen.marshalClassicMailApiUpdateMailboxRequest( + request, + this.client.settings + ) + ), + headers: jsonContentHeaders, + method: "PATCH", + path: `/webhosting/v1alpha1/regions/${marshalling.validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/classic-hostings/${marshalling.validatePathParam("onlineId", request.onlineId)}/mailboxes/${marshalling.validatePathParam("mailboxId", request.mailboxId)}` + }, + marshalling_gen.unmarshalMailbox + ); +} +exports.API = API; +exports.ClassicMailAPI = ClassicMailAPI; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -var index_gen$6 = /*#__PURE__*/Object.freeze({ - __proto__: null, - API: API$6 -}); +/***/ }), -var index$5 = /*#__PURE__*/Object.freeze({ - __proto__: null, - v1alpha1: index_gen$6 -}); +/***/ 8560: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const HOSTING_TRANSIENT_STATUSES = [ + "delivering", + "deleting", + "migrating" +]; +exports.HOSTING_TRANSIENT_STATUSES = HOSTING_TRANSIENT_STATUSES; + + +/***/ }), + +/***/ 9803: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const api_gen = __nccwpck_require__(6395); +const content_gen = __nccwpck_require__(8560); +const validationRules_gen = __nccwpck_require__(342); +exports.API = api_gen.API; +exports.ClassicMailAPI = api_gen.ClassicMailAPI; +exports.HOSTING_TRANSIENT_STATUSES = content_gen.HOSTING_TRANSIENT_STATUSES; +exports.ValidationRules = validationRules_gen; + + +/***/ }), -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. +/***/ 1353: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/** Lists transient statutes of the enum {@link HumanStatus}. */ -const HUMAN_TRANSIENT_STATUSES = ['running']; +"use strict"; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const unmarshalHuman = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Human' failed as data isn't a dictionary.`); +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const json = __nccwpck_require__(3746); +const customMarshalling = __nccwpck_require__(7586); +const marshalling = __nccwpck_require__(1162); +const unmarshalHostingCpanelUrls = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'HostingCpanelUrls' failed as data isn't a dictionary.` + ); + } + return { + dashboard: data.dashboard, + webmail: data.webmail + }; +}; +const unmarshalHostingOption = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'HostingOption' failed as data isn't a dictionary.` + ); } return { - altitudeInMeter: data.altitude_in_meter, - altitudeInMillimeter: data.altitude_in_millimeter, - createdAt: unmarshalDate(data.created_at), - eyesColor: data.eyes_color, - fingersCount: data.fingers_count, - hairCount: data.hair_count, - height: data.height, id: data.id, - isHappy: data.is_happy, - name: data.name, + name: data.name + }; +}; +const unmarshalHosting = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Hosting' failed as data isn't a dictionary.` + ); + } + return { + controlPanelName: data.control_panel_name, + cpanelUrls: data.cpanel_urls ? unmarshalHostingCpanelUrls(data.cpanel_urls) : void 0, + createdAt: marshalling.unmarshalDate(data.created_at), + dnsStatus: data.dns_status, + domain: data.domain, + id: data.id, + ipv4: data.ipv4, + ipv6: data.ipv6, + offerEndOfLife: data.offer_end_of_life, + offerId: data.offer_id, + offerName: data.offer_name, + oneTimePassword: data.one_time_password, + options: marshalling.unmarshalArrayOfObject(data.options, unmarshalHostingOption), organizationId: data.organization_id, + platformGroup: data.platform_group, + platformHostname: data.platform_hostname, + platformNumber: data.platform_number, projectId: data.project_id, - shoeSize: data.shoe_size, + protected: data.protected, + region: data.region, status: data.status, - updatedAt: unmarshalDate(data.updated_at) + tags: data.tags, + updatedAt: marshalling.unmarshalDate(data.updated_at), + username: data.username }; }; -const unmarshalListHumansResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListHumansResponse' failed as data isn't a dictionary.`); +const unmarshalEmailAddress = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'EmailAddress' failed as data isn't a dictionary.` + ); } return { - humans: unmarshalArrayOfObject(data.humans, unmarshalHuman), - totalCount: data.total_count + domain: data.domain, + login: data.login }; }; -const unmarshalRegisterResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'RegisterResponse' failed as data isn't a dictionary.`); +const unmarshalMailbox = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Mailbox' failed as data isn't a dictionary.` + ); } return { - accessKey: data.access_key, - secretKey: data.secret_key + email: data.email ? unmarshalEmailAddress(data.email) : void 0, + mailboxId: data.mailbox_id }; }; -const marshalCreateHumanRequest = (request, defaults) => ({ - altitude_in_meter: request.altitudeInMeter, - altitude_in_millimeter: request.altitudeInMillimeter, - eyes_color: request.eyesColor ?? 'unknown', - fingers_count: request.fingersCount, - hair_count: request.hairCount, - height: request.height, - is_happy: request.isHappy, - name: request.name, - shoe_size: request.shoeSize, - ...resolveOneOf([{ - default: defaults.defaultProjectId, - param: 'project_id', - value: request.projectId - }, { - default: defaults.defaultOrganizationId, - param: 'organization_id', - value: request.organizationId - }]) -}); -const marshalRegisterRequest = (request, defaults) => ({ - username: request.username -}); -const marshalUpdateHumanRequest = (request, defaults) => ({ - altitude_in_meter: request.altitudeInMeter, - altitude_in_millimeter: request.altitudeInMillimeter, - eyes_color: request.eyesColor ?? 'unknown', - fingers_count: request.fingersCount, - hair_count: request.hairCount, - height: request.height, - is_happy: request.isHappy, - name: request.name, - shoe_size: request.shoeSize -}); - -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const jsonContentHeaders$5 = { - 'Content-Type': 'application/json; charset=utf-8' -}; - -/** - * Fake API. - * - * No Auth Service for end-to-end testing. Test is a fake service that aim to - * manage fake humans. It is used for internal and public end-to-end tests. - * - * This service don't use the Scaleway authentication service but a fake one. It - * allows to use this test service publicly without requiring a Scaleway - * account. - * - * First, you need to register a user with `scw test human register` to get an - * access-key. Then, you can use other test commands by setting the - * SCW_SECRET_KEY env variable. - */ -let API$5 = class API extends API$u { - /** - * Register a user. Register a human and return a access-key and a secret-key - * that must be used in all other commands. - * - * Hint: you can use other test commands by setting the SCW_SECRET_KEY env - * variable. - * - * @param request - The request {@link RegisterRequest} - * @returns A Promise of RegisterResponse - */ - register = request => this.client.fetch({ - body: JSON.stringify(marshalRegisterRequest(request, this.client.settings)), - headers: jsonContentHeaders$5, - method: 'POST', - path: `/test/v1/register` - }, unmarshalRegisterResponse); - pageOfListHumans = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/test/v1/humans`, - urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId]) - }, unmarshalListHumansResponse); - - /** - * List all your humans. - * - * @param request - The request {@link ListHumansRequest} - * @returns A Promise of ListHumansResponse - */ - listHumans = (request = {}) => enrichForPagination('humans', this.pageOfListHumans, request); - - /** - * Get human details. Get the human details associated with the given id. - * - * @param request - The request {@link GetHumanRequest} - * @returns A Promise of Human - */ - getHuman = request => this.client.fetch({ - method: 'GET', - path: `/test/v1/humans/${validatePathParam('humanId', request.humanId)}` - }, unmarshalHuman); - - /** - * Waits for {@link Human} to be in a final state. - * - * @param request - The request {@link GetHumanRequest} - * @param options - The waiting options - * @returns A Promise of Human - */ - waitForHuman = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!HUMAN_TRANSIENT_STATUSES.includes(res.status))), this.getHuman, request, options); - - /** - * Create a new human. - * - * @param request - The request {@link CreateHumanRequest} - * @returns A Promise of Human - */ - createHuman = request => this.client.fetch({ - body: JSON.stringify(marshalCreateHumanRequest(request, this.client.settings)), - headers: jsonContentHeaders$5, - method: 'POST', - path: `/test/v1/humans` - }, unmarshalHuman); - - /** - * Update an existing human. Update the human associated with the given id. - * - * @param request - The request {@link UpdateHumanRequest} - * @returns A Promise of Human - */ - updateHuman = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateHumanRequest(request, this.client.settings)), - headers: jsonContentHeaders$5, - method: 'PATCH', - path: `/test/v1/humans/${validatePathParam('humanId', request.humanId)}` - }, unmarshalHuman); - - /** - * Delete an existing human. Delete the human associated with the given id. - * - * @param request - The request {@link DeleteHumanRequest} - * @returns A Promise of Human - */ - deleteHuman = request => this.client.fetch({ - method: 'DELETE', - path: `/test/v1/humans/${validatePathParam('humanId', request.humanId)}` - }, unmarshalHuman); - - /** - * Start a 1h running for the given human. Start a one hour running for the - * given human. - * - * @param request - The request {@link RunHumanRequest} - * @returns A Promise of Human - */ - runHuman = request => this.client.fetch({ - body: '{}', - headers: jsonContentHeaders$5, - method: 'POST', - path: `/test/v1/humans/${validatePathParam('humanId', request.humanId)}/run` - }, unmarshalHuman); - - /** - * Make a human smoke. - * - * @deprecated - * @param request - The request {@link SmokeHumanRequest} - * @returns A Promise of Human - */ - smokeHuman = (request = {}) => this.client.fetch({ - body: '{}', - headers: jsonContentHeaders$5, - method: 'POST', - path: `/test/v1/humans/${validatePathParam('humanId', request.humanId)}/smoke` - }, unmarshalHuman); +const unmarshalCheckUserOwnsDomainResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'CheckUserOwnsDomainResponse' failed as data isn't a dictionary.` + ); + } + return { + ownsDomain: data.owns_domain + }; }; - -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. - -var index_gen$5 = /*#__PURE__*/Object.freeze({ - __proto__: null, - API: API$5, - HUMAN_TRANSIENT_STATUSES: HUMAN_TRANSIENT_STATUSES -}); - -var index$4 = /*#__PURE__*/Object.freeze({ - __proto__: null, - v1: index_gen$5 -}); - -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. - -/** Lists transient statutes of the enum {@link DomainStatus}. */ -const DOMAIN_TRANSIENT_STATUSES = ['pending']; - -/** Lists transient statutes of the enum {@link EmailStatus}. */ -const EMAIL_TRANSIENT_STATUSES = ['new', 'sending']; - -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const unmarshalDomainStatistics = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'DomainStatistics' failed as data isn't a dictionary.`); +const unmarshalDnsRecord = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DnsRecord' failed as data isn't a dictionary.` + ); } return { - canceledCount: data.canceled_count, - failedCount: data.failed_count, - sentCount: data.sent_count, - totalCount: data.total_count + name: data.name, + priority: data.priority, + status: data.status, + ttl: data.ttl, + type: data.type, + value: data.value }; }; -const unmarshalEmailTry = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'EmailTry' failed as data isn't a dictionary.`); +const unmarshalNameserver = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Nameserver' failed as data isn't a dictionary.` + ); } return { - code: data.code, - message: data.message, - rank: data.rank, - triedAt: unmarshalDate(data.tried_at) + hostname: data.hostname, + isDefault: data.is_default, + status: data.status }; }; -const unmarshalDomain = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Domain' failed as data isn't a dictionary.`); +const unmarshalDnsRecords = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DnsRecords' failed as data isn't a dictionary.` + ); } return { - createdAt: unmarshalDate(data.created_at), - dkimConfig: data.dkim_config, - id: data.id, - lastError: data.last_error, - lastValidAt: unmarshalDate(data.last_valid_at), - name: data.name, - nextCheckAt: unmarshalDate(data.next_check_at), - organizationId: data.organization_id, - projectId: data.project_id, - region: data.region, - revokedAt: unmarshalDate(data.revoked_at), - spfConfig: data.spf_config, - statistics: data.statistics ? unmarshalDomainStatistics(data.statistics) : undefined, + nameServers: marshalling.unmarshalArrayOfObject(data.name_servers, unmarshalNameserver), + records: marshalling.unmarshalArrayOfObject(data.records, unmarshalDnsRecord), status: data.status }; }; -const unmarshalDomainLastStatusDkimRecord = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'DomainLastStatusDkimRecord' failed as data isn't a dictionary.`); +const unmarshalControlPanel = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ControlPanel' failed as data isn't a dictionary.` + ); } return { - error: data.error, - lastValidAt: unmarshalDate(data.last_valid_at), - status: data.status + available: data.available, + availableLanguages: data.available_languages, + logoUrl: data.logo_url, + name: data.name }; }; -const unmarshalDomainLastStatusSpfRecord = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'DomainLastStatusSpfRecord' failed as data isn't a dictionary.`); +const unmarshalListControlPanelsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListControlPanelsResponse' failed as data isn't a dictionary.` + ); } return { - error: data.error, - lastValidAt: unmarshalDate(data.last_valid_at), - status: data.status + controlPanels: marshalling.unmarshalArrayOfObject( + data.control_panels, + unmarshalControlPanel + ), + totalCount: data.total_count }; }; -const unmarshalEmail = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Email' failed as data isn't a dictionary.`); +const unmarshalListHostingsResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListHostingsResponse' failed as data isn't a dictionary.` + ); } return { - createdAt: unmarshalDate(data.created_at), - flags: data.flags, - id: data.id, - lastTries: unmarshalArrayOfObject(data.last_tries, unmarshalEmailTry), - mailFrom: data.mail_from, - mailRcpt: data.mail_rcpt, - messageId: data.message_id, - projectId: data.project_id, - rcptTo: data.rcpt_to, - rcptType: data.rcpt_type, - status: data.status, - statusDetails: data.status_details, - subject: data.subject, - tryCount: data.try_count, - updatedAt: unmarshalDate(data.updated_at) + hostings: marshalling.unmarshalArrayOfObject(data.hostings, unmarshalHosting), + totalCount: data.total_count }; }; -const unmarshalCreateEmailResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'CreateEmailResponse' failed as data isn't a dictionary.`); +const unmarshalListMailboxesResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListMailboxesResponse' failed as data isn't a dictionary.` + ); } return { - emails: unmarshalArrayOfObject(data.emails, unmarshalEmail) + mailboxes: marshalling.unmarshalArrayOfObject(data.mailboxes, unmarshalMailbox), + totalCount: data.total_count }; }; -const unmarshalDomainLastStatus = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'DomainLastStatus' failed as data isn't a dictionary.`); +const unmarshalOfferProduct = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'OfferProduct' failed as data isn't a dictionary.` + ); } return { - dkimRecord: data.dkim_record ? unmarshalDomainLastStatusDkimRecord(data.dkim_record) : undefined, - domainId: data.domain_id, - domainName: data.domain_name, - spfRecord: data.spf_record ? unmarshalDomainLastStatusSpfRecord(data.spf_record) : undefined + databasesQuota: data.databases_quota, + emailAccountsQuota: data.email_accounts_quota, + emailStorageQuota: data.email_storage_quota, + hostingStorageQuota: data.hosting_storage_quota, + maxAddonDomains: data.max_addon_domains, + name: data.name, + option: data.option, + ram: data.ram, + supportIncluded: data.support_included, + vCpu: data.v_cpu }; }; -const unmarshalListDomainsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListDomainsResponse' failed as data isn't a dictionary.`); +const unmarshalOffer = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Offer' failed as data isn't a dictionary.` + ); } return { - domains: unmarshalArrayOfObject(data.domains, unmarshalDomain), - totalCount: data.total_count + available: data.available, + billingOperationPath: data.billing_operation_path, + controlPanelName: data.control_panel_name, + endOfLife: data.end_of_life, + id: data.id, + price: data.price ? customMarshalling.unmarshalMoney(data.price) : void 0, + product: data.product ? unmarshalOfferProduct(data.product) : void 0, + quotaWarnings: data.quota_warnings }; }; -const unmarshalListEmailsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListEmailsResponse' failed as data isn't a dictionary.`); +const unmarshalListOffersResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ListOffersResponse' failed as data isn't a dictionary.` + ); } return { - emails: unmarshalArrayOfObject(data.emails, unmarshalEmail), - totalCount: data.total_count + offers: marshalling.unmarshalArrayOfObject(data.offers, unmarshalOffer) }; }; -const unmarshalStatistics = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Statistics' failed as data isn't a dictionary.`); +const unmarshalResetHostingPasswordResponse = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ResetHostingPasswordResponse' failed as data isn't a dictionary.` + ); } return { - canceledCount: data.canceled_count, - failedCount: data.failed_count, - newCount: data.new_count, - sendingCount: data.sending_count, - sentCount: data.sent_count, - totalCount: data.total_count + password: data.password }; }; -const marshalCreateEmailRequestAddress = (request, defaults) => ({ - email: request.email, - name: request.name +const unmarshalSession = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Session' failed as data isn't a dictionary.` + ); + } + return { + url: data.url + }; +}; +const marshalCheckUserOwnsDomainRequest = (request, defaults) => ({ + project_id: request.projectId ?? defaults.defaultProjectId }); -const marshalCreateEmailRequestAttachment = (request, defaults) => ({ - content: request.content, - name: request.name, - type: request.type +const marshalEmailAddress = (request, defaults) => ({ + domain: request.domain, + login: request.login }); -const marshalCreateDomainRequest = (request, defaults) => ({ - accept_tos: request.acceptTos, - domain_name: request.domainName, - project_id: request.projectId ?? defaults.defaultProjectId +const marshalClassicMailApiCreateMailboxRequest = (request, defaults) => ({ + email: request.email !== void 0 ? marshalEmailAddress(request.email) : void 0, + password: request.password }); -const marshalCreateEmailRequest = (request, defaults) => ({ - attachments: request.attachments ? request.attachments.map(elt => marshalCreateEmailRequestAttachment(elt)) : undefined, - bcc: request.bcc ? request.bcc.map(elt => marshalCreateEmailRequestAddress(elt)) : undefined, - cc: request.cc ? request.cc.map(elt => marshalCreateEmailRequestAddress(elt)) : undefined, - from: request.from ? marshalCreateEmailRequestAddress(request.from) : undefined, - html: request.html, +const marshalClassicMailApiUpdateMailboxRequest = (request, defaults) => ({ + password: request.password +}); +const marshalCreateHostingRequestDomainConfiguration = (request, defaults) => ({ + update_all_records: request.updateAllRecords, + update_mail_record: request.updateMailRecord, + update_nameservers: request.updateNameservers, + update_web_record: request.updateWebRecord +}); +const marshalCreateHostingRequest = (request, defaults) => ({ + domain: request.domain, + domain_configuration: request.domainConfiguration !== void 0 ? marshalCreateHostingRequestDomainConfiguration( + request.domainConfiguration + ) : void 0, + email: request.email, + language: request.language, + offer_id: request.offerId, + option_ids: request.optionIds, project_id: request.projectId ?? defaults.defaultProjectId, - send_before: request.sendBefore, - subject: request.subject, - text: request.text, - to: request.to ? request.to.map(elt => marshalCreateEmailRequestAddress(elt)) : undefined + tags: request.tags +}); +const marshalUpdateHostingRequest = (request, defaults) => ({ + email: request.email, + offer_id: request.offerId, + option_ids: request.optionIds, + protected: request.protected, + tags: request.tags }); +exports.marshalCheckUserOwnsDomainRequest = marshalCheckUserOwnsDomainRequest; +exports.marshalClassicMailApiCreateMailboxRequest = marshalClassicMailApiCreateMailboxRequest; +exports.marshalClassicMailApiUpdateMailboxRequest = marshalClassicMailApiUpdateMailboxRequest; +exports.marshalCreateHostingRequest = marshalCreateHostingRequest; +exports.marshalUpdateHostingRequest = marshalUpdateHostingRequest; +exports.unmarshalCheckUserOwnsDomainResponse = unmarshalCheckUserOwnsDomainResponse; +exports.unmarshalDnsRecords = unmarshalDnsRecords; +exports.unmarshalHosting = unmarshalHosting; +exports.unmarshalListControlPanelsResponse = unmarshalListControlPanelsResponse; +exports.unmarshalListHostingsResponse = unmarshalListHostingsResponse; +exports.unmarshalListMailboxesResponse = unmarshalListMailboxesResponse; +exports.unmarshalListOffersResponse = unmarshalListOffersResponse; +exports.unmarshalMailbox = unmarshalMailbox; +exports.unmarshalResetHostingPasswordResponse = unmarshalResetHostingPasswordResponse; +exports.unmarshalSession = unmarshalSession; + + +/***/ }), + +/***/ 342: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const ClassicMailApiListMailboxesRequest = { + page: { + greaterThan: 0 + }, + pageSize: { + greaterThan: 0, + lessThanOrEqual: 100 + } +}; +const ListControlPanelsRequest = { + page: { + greaterThan: 0 + }, + pageSize: { + greaterThan: 0, + lessThanOrEqual: 100 + } +}; +const ListHostingsRequest = { + page: { + greaterThan: 0 + }, + pageSize: { + greaterThan: 0, + lessThanOrEqual: 100 + } +}; +exports.ClassicMailApiListMailboxesRequest = ClassicMailApiListMailboxesRequest; +exports.ListControlPanelsRequest = ListControlPanelsRequest; +exports.ListHostingsRequest = ListHostingsRequest; + + +/***/ }), + +/***/ 979: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const isBrowser = () => ( + // eslint-disable-next-line @typescript-eslint/prefer-optional-chain + typeof window !== "undefined" && typeof window.document !== "undefined" +); +exports.isBrowser = isBrowser; + + +/***/ }), + +/***/ 5600: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const isResponse = (obj) => obj !== null && obj !== void 0 && typeof obj === "object" && "status" in obj && typeof obj.status === "number" && "statusText" in obj && typeof obj.statusText === "string" && "headers" in obj && typeof obj.headers === "object" && "body" in obj && typeof obj.body !== "undefined"; +exports.isResponse = isResponse; + + +/***/ }), + +/***/ 3746: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const isJSONObject = (obj) => { + const objT = typeof obj; + return obj !== void 0 && obj !== null && objT !== "string" && objT !== "number" && objT !== "boolean" && !Array.isArray(obj) && objT === "object"; +}; +exports.isJSONObject = isJSONObject; + + +/***/ }), + +/***/ 1162: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +function validatePathParam(name, param) { + if (typeof param === "string" && param.length > 0) return param; + if (typeof param === "number") return param.toString(); + throw new TypeError(`param ${name} cannot be empty in request`); +} +const resolveOneOf = (list, isRequired = false) => { + const elt = list.find((obj) => obj.value !== void 0) ?? list.find((obj) => obj.default !== void 0); + const value = elt?.value ?? elt?.default; + if (elt && value !== void 0) { + return { [elt.param]: value }; + } + if (isRequired) { + const keyList = list.map((obj) => obj.param).join(" or "); + throw new TypeError(`one of ${keyList} must be indicated in the request`); + } + return {}; +}; +const urlParams = (...paramTuples) => { + const params = new URLSearchParams(); + for (const [key, value] of paramTuples) { + if (typeof key === "string" && value != null) { + if (Array.isArray(value)) { + for (const innerValue of value) { + if (innerValue !== null) { + params.append( + key, + innerValue instanceof Date ? innerValue.toISOString() : innerValue.toString() + ); + } + } + } else { + params.append( + key, + value instanceof Date ? value.toISOString() : value.toString() + ); + } + } + } + return params; +}; +const unmarshalDate = (data) => { + if (typeof data !== "string") { + return void 0; + } + const date = new Date(data); + if (Number.isNaN(date.getTime())) { + return void 0; + } + return date; +}; +const unmarshalArrayOfObject = (data, unmarshaller, emptyFallback = true) => { + if (!Array.isArray(data)) { + return emptyFallback ? [] : void 0; + } + return data.map((elt) => unmarshaller(elt)); +}; +const unmarshalMapOfObject = (data, unmarshaller, emptyFallback = true) => { + if (!data || typeof data !== "object" || !(data instanceof Object) || Array.isArray(data)) { + return emptyFallback ? {} : void 0; + } + return Object.entries(data).reduce( + (acc, [key, value]) => ({ + ...acc, + [key]: unmarshaller(value) + }), + {} + ); +}; +exports.resolveOneOf = resolveOneOf; +exports.unmarshalArrayOfObject = unmarshalArrayOfObject; +exports.unmarshalDate = unmarshalDate; +exports.unmarshalMapOfObject = unmarshalMapOfObject; +exports.urlParams = urlParams; +exports.validatePathParam = validatePathParam; + + +/***/ }), + +/***/ 1526: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const index = __nccwpck_require__(3009); +const client = __nccwpck_require__(971); +const clientIniFactory = __nccwpck_require__(1747); +const customTypes = __nccwpck_require__(2911); +const index$1 = __nccwpck_require__(4156); +const json = __nccwpck_require__(3746); +const intervalRetrier = __nccwpck_require__(9052); +const helpers = __nccwpck_require__(5130); +const api = __nccwpck_require__(3042); +const auth = __nccwpck_require__(6024); +const customMarshalling = __nccwpck_require__(7586); +const marshalling = __nccwpck_require__(1162); +const resourcePaginator = __nccwpck_require__(4983); +const index_gen$g = __nccwpck_require__(5939); +const index_gen = __nccwpck_require__(271); +const index_gen$1 = __nccwpck_require__(8147); +const index_gen$h = __nccwpck_require__(1567); +const index_gen$i = __nccwpck_require__(3937); +const index_gen$j = __nccwpck_require__(7169); +const index_gen$k = __nccwpck_require__(3523); +const index_gen$l = __nccwpck_require__(1157); +const index_gen$2 = __nccwpck_require__(390); +const index_gen$m = __nccwpck_require__(3728); +const index_gen$n = __nccwpck_require__(7520); +const index_gen$3 = __nccwpck_require__(8262); +const index_gen$o = __nccwpck_require__(8556); +const index_gen$4 = __nccwpck_require__(9453); +const index_gen$p = __nccwpck_require__(6519); +const index_gen$q = __nccwpck_require__(3693); +const index_gen$5 = __nccwpck_require__(5926); +const index_gen$6 = __nccwpck_require__(7337); +const index_gen$7 = __nccwpck_require__(5334); +const index_gen$r = __nccwpck_require__(364); +const index_gen$s = __nccwpck_require__(378); +const index_gen$t = __nccwpck_require__(4387); +const index_gen$8 = __nccwpck_require__(4542); +const index_gen$9 = __nccwpck_require__(9579); +const index_gen$u = __nccwpck_require__(6875); +const index_gen$a = __nccwpck_require__(9256); +const index_gen$v = __nccwpck_require__(1606); +const index_gen$b = __nccwpck_require__(8398); +const index_gen$w = __nccwpck_require__(7171); +const index_gen$x = __nccwpck_require__(9977); +const index_gen$y = __nccwpck_require__(6484); +const index_gen$c = __nccwpck_require__(5377); +const index_gen$z = __nccwpck_require__(7597); +const index_gen$d = __nccwpck_require__(9136); +const index_gen$A = __nccwpck_require__(9144); +const index_gen$e = __nccwpck_require__(911); +const index_gen$f = __nccwpck_require__(7533); +const index_gen$B = __nccwpck_require__(8212); +exports.enableConsoleLogger = index.enableConsoleLogger; +exports.setLogger = index.setLogger; +exports.createAdvancedClient = client.createAdvancedClient; +exports.createClient = client.createClient; +exports.withAdditionalInterceptors = clientIniFactory.withAdditionalInterceptors; +exports.withDefaultPageSize = clientIniFactory.withDefaultPageSize; +exports.withHTTPClient = clientIniFactory.withHTTPClient; +exports.withProfile = clientIniFactory.withProfile; +exports.withUserAgent = clientIniFactory.withUserAgent; +exports.withUserAgentSuffix = clientIniFactory.withUserAgentSuffix; +exports.Decimal = customTypes.Decimal; +exports.Errors = index$1; +exports.isJSONObject = json.isJSONObject; +exports.createExponentialBackoffStrategy = intervalRetrier.createExponentialBackoffStrategy; +exports.tryAtIntervals = intervalRetrier.tryAtIntervals; +exports.waitForResource = intervalRetrier.waitForResource; +exports.addAsyncHeaderInterceptor = helpers.addAsyncHeaderInterceptor; +exports.API = api.API; +exports.authenticateWithSessionToken = auth.authenticateWithSessionToken; +exports.marshalBlobToScwFile = customMarshalling.marshalBlobToScwFile; +exports.marshalDecimal = customMarshalling.marshalDecimal; +exports.marshalMoney = customMarshalling.marshalMoney; +exports.marshalScwFile = customMarshalling.marshalScwFile; +exports.marshalTimeSeries = customMarshalling.marshalTimeSeries; +exports.unmarshalDecimal = customMarshalling.unmarshalDecimal; +exports.unmarshalMoney = customMarshalling.unmarshalMoney; +exports.unmarshalScwFile = customMarshalling.unmarshalScwFile; +exports.unmarshalServiceInfo = customMarshalling.unmarshalServiceInfo; +exports.unmarshalTimeSeries = customMarshalling.unmarshalTimeSeries; +exports.unmarshalTimeSeriesPoint = customMarshalling.unmarshalTimeSeriesPoint; +exports.resolveOneOf = marshalling.resolveOneOf; +exports.unmarshalArrayOfObject = marshalling.unmarshalArrayOfObject; +exports.unmarshalDate = marshalling.unmarshalDate; +exports.unmarshalMapOfObject = marshalling.unmarshalMapOfObject; +exports.urlParams = marshalling.urlParams; +exports.validatePathParam = marshalling.validatePathParam; +exports.enrichForPagination = resourcePaginator.enrichForPagination; +exports.Account = index_gen$g; +exports.AppleSilicon = index_gen; +exports.Applesilicon = index_gen; +exports.BareMetal = index_gen$1; +exports.Baremetal = index_gen$1; +exports.Billing = index_gen$h; +exports.Block = index_gen$i; +exports.Cockpit = index_gen$j; +exports.Container = index_gen$k; +exports.Dedibox = index_gen$l; +exports.DocumentDB = index_gen$2; +exports.DocumentDb = index_gen$2; +exports.Domain = index_gen$m; +exports.EdgeServices = index_gen$n; +exports.FlexibleIP = index_gen$3; +exports.Flexibleip = index_gen$3; +exports.Function = index_gen$o; +exports.IAM = index_gen$4; +exports.Iam = index_gen$4; +exports.Inference = index_gen$p; +exports.Instance = index_gen$q; +exports.IOT = index_gen$5; +exports.Iot = index_gen$5; +exports.IPAM = index_gen$6; +exports.Ipam = index_gen$6; +exports.IPFS = index_gen$7; +exports.Ipfs = index_gen$7; +exports.Jobs = index_gen$r; +exports.K8s = index_gen$s; +exports.KeyManager = index_gen$t; +exports.LB = index_gen$8; +exports.Lb = index_gen$8; +exports.LLMInference = index_gen$9; +exports.LlmInference = index_gen$9; +exports.Marketplace = index_gen$u; +exports.MNQ = index_gen$a; +exports.Mnq = index_gen$a; +exports.Qaas = index_gen$v; +exports.RDB = index_gen$b; +exports.Rdb = index_gen$b; +exports.Redis = index_gen$w; +exports.Registry = index_gen$x; +exports.Secret = index_gen$y; +exports.ServerlessSQLDB = index_gen$c; +exports.ServerlessSqldb = index_gen$c; +exports.Std = index_gen$z; +exports.Tem = index_gen$d; +exports.TransactionalEmail = index_gen$d; +exports.Test = index_gen$A; +exports.VPC = index_gen$e; +exports.Vpc = index_gen$e; +exports.VPCGW = index_gen$f; +exports.Vpcgw = index_gen$f; +exports.Webhosting = index_gen$B; + + +/***/ }), + +/***/ 9052: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const sleep = __nccwpck_require__(7888); +const DEFAULT_TIMEOUT_SECONDS = 300; +const DEFAULT_MIN_DELAY_SECONDS = 1; +const DEFAULT_MAX_DELAY_SECONDS = 30; +function* createExponentialBackoffStrategy(minDelay, maxDelay) { + if (minDelay < 1 || maxDelay < 1 || minDelay > maxDelay) { + throw new Error( + "Waiter: minDelay must be >= 1 and maxDelay must be >= minDelay" + ); + } + let attempt = 1; + const ceiling = Math.log(maxDelay / minDelay) / Math.log(2) + 1; + const randomInRange = (min, max) => min + Math.random() * (max - min); + while (true) { + if (attempt > ceiling) { + yield maxDelay; + } else { + yield randomInRange(minDelay, minDelay * 2 ** (attempt - 1)); + } + attempt += 1; + } +} +const tryAtIntervals = async (retry, strategy, timeout = DEFAULT_TIMEOUT_SECONDS) => { + const timeoutTimestamp = Date.now() + timeout * 1e3; + let retryCount = 0; + while (Date.now() <= timeoutTimestamp) { + const delay = strategy.next(retryCount += 1).value * 1e3; + if (timeoutTimestamp <= Date.now() + delay) break; + await sleep.sleep(delay); + const { value, done } = await retry(); + if (done) return value; + } + throw new Error(`Timeout after ${timeout}s`); +}; +const waitForResource = (stop, fetcher, request, options, strategy = createExponentialBackoffStrategy( + options?.minDelay ?? DEFAULT_MIN_DELAY_SECONDS, + options?.maxDelay ?? DEFAULT_MAX_DELAY_SECONDS +)) => tryAtIntervals( + async () => { + const value = await fetcher(request); + return { + done: await stop(value), + value + }; + }, + strategy, + options?.timeout +); +exports.createExponentialBackoffStrategy = createExponentialBackoffStrategy; +exports.tryAtIntervals = tryAtIntervals; +exports.waitForResource = waitForResource; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const jsonContentHeaders$4 = { - 'Content-Type': 'application/json; charset=utf-8' -}; -/** Transactional Email API. */ -let API$4 = class API extends API$u { - /** Lists the available regions of the API. */ - static LOCALITIES = ['fr-par']; +/***/ }), - /** - * Send an email. You must specify the `region`, the sender and the - * recipient's information and the `project_id` to send an email from a - * checked domain. The subject of the email must contain at least 6 - * characters. - * - * @param request - The request {@link CreateEmailRequest} - * @returns A Promise of CreateEmailResponse - */ - createEmail = request => this.client.fetch({ - body: JSON.stringify(marshalCreateEmailRequest(request, this.client.settings)), - headers: jsonContentHeaders$4, - method: 'POST', - path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/emails` - }, unmarshalCreateEmailResponse); +/***/ 7888: +/***/ ((__unused_webpack_module, exports) => { - /** - * Get an email. Retrieve information about a specific email using the - * `email_id` and `region` parameters. - * - * @param request - The request {@link GetEmailRequest} - * @returns A Promise of Email - */ - getEmail = request => this.client.fetch({ - method: 'GET', - path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/emails/${validatePathParam('emailId', request.emailId)}` - }, unmarshalEmail); +"use strict"; - /** - * Waits for {@link Email} to be in a final state. - * - * @param request - The request {@link GetEmailRequest} - * @param options - The waiting options - * @returns A Promise of Email - */ - waitForEmail = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!EMAIL_TRANSIENT_STATUSES.includes(res.status))), this.getEmail, request, options); - pageOfListEmails = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/emails`, - urlParams: urlParams(['domain_id', request.domainId], ['flags', request.flags], ['mail_from', request.mailFrom], ['mail_rcpt', request.mailRcpt], ['mail_to', request.mailTo], ['message_id', request.messageId], ['order_by', request.orderBy ?? 'created_at_desc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId], ['search', request.search], ['since', request.since], ['statuses', request.statuses], ['subject', request.subject], ['until', request.until]) - }, unmarshalListEmailsResponse); +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const sleep = (ms) => new Promise((resolve) => { + setTimeout(resolve, ms); +}); +exports.sleep = sleep; - /** - * List emails. Retrieve the list of emails sent from a specific domain or for - * a specific Project or Organization. You must specify the `region`. - * - * @param request - The request {@link ListEmailsRequest} - * @returns A Promise of ListEmailsResponse - */ - listEmails = (request = {}) => enrichForPagination('emails', this.pageOfListEmails, request); - /** - * Email statuses. Get information on your emails' statuses. - * - * @param request - The request {@link GetStatisticsRequest} - * @returns A Promise of Statistics - */ - getStatistics = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/statistics`, - urlParams: urlParams(['domain_id', request.domainId], ['mail_from', request.mailFrom], ['project_id', request.projectId], ['since', request.since], ['until', request.until]) - }, unmarshalStatistics); +/***/ }), - /** - * Cancel an email. You can cancel the sending of an email if it has not been - * sent yet. You must specify the `region` and the `email_id` of the email you - * want to cancel. - * - * @param request - The request {@link CancelEmailRequest} - * @returns A Promise of Email - */ - cancelEmail = request => this.client.fetch({ - body: '{}', - headers: jsonContentHeaders$4, - method: 'POST', - path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/emails/${validatePathParam('emailId', request.emailId)}/cancel` - }, unmarshalEmail); +/***/ 3613: +/***/ ((__unused_webpack_module, exports) => { - /** - * Register a domain in a project. You must specify the `region`, `project_id` - * and `domain_name` to register a domain in a specific Project. - * - * @param request - The request {@link CreateDomainRequest} - * @returns A Promise of Domain - */ - createDomain = request => this.client.fetch({ - body: JSON.stringify(marshalCreateDomainRequest(request, this.client.settings)), - headers: jsonContentHeaders$4, - method: 'POST', - path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains` - }, unmarshalDomain); +"use strict"; - /** - * Get information about a domain. Retrieve information about a specific - * domain using the `region` and `domain_id` parameters. - * - * @param request - The request {@link GetDomainRequest} - * @returns A Promise of Domain - */ - getDomain = request => this.client.fetch({ - method: 'GET', - path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam('domainId', request.domainId)}` - }, unmarshalDomain); +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const composeRequestInterceptors = (interceptors) => async (request) => interceptors.reduce( + async (asyncResult, interceptor) => interceptor({ request: await asyncResult }), + Promise.resolve(request) +); +const composeResponseInterceptors = (interceptors) => async (response) => interceptors.reduce( + async (asyncResult, interceptor) => interceptor({ response: await asyncResult }), + Promise.resolve(response) +); +const composeResponseErrorInterceptors = (interceptors) => async (request, error) => { + let prevError = error; + for (const interceptor of interceptors) { + try { + const res = await interceptor({ request, error: prevError }); + return res; + } catch (err) { + prevError = err; + } + } + throw prevError; +}; +exports.composeRequestInterceptors = composeRequestInterceptors; +exports.composeResponseErrorInterceptors = composeResponseErrorInterceptors; +exports.composeResponseInterceptors = composeResponseInterceptors; - /** - * Waits for {@link Domain} to be in a final state. - * - * @param request - The request {@link GetDomainRequest} - * @param options - The waiting options - * @returns A Promise of Domain - */ - waitForDomain = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!DOMAIN_TRANSIENT_STATUSES.includes(res.status))), this.getDomain, request, options); - pageOfListDomains = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains`, - urlParams: urlParams(['name', request.name], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId], ['status', request.status]) - }, unmarshalListDomainsResponse); - /** - * List domains. Retrieve domains in a specific project or in a specific - * Organization using the `region` parameter. - * - * @param request - The request {@link ListDomainsRequest} - * @returns A Promise of ListDomainsResponse - */ - listDomains = (request = {}) => enrichForPagination('domains', this.pageOfListDomains, request); +/***/ }), - /** - * Delete a domain. You must specify the domain you want to delete by the - * `region` and `domain_id`. Deleting a domain is permanent and cannot be - * undone. - * - * @param request - The request {@link RevokeDomainRequest} - * @returns A Promise of Domain - */ - revokeDomain = request => this.client.fetch({ - body: '{}', - headers: jsonContentHeaders$4, - method: 'POST', - path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam('domainId', request.domainId)}/revoke` - }, unmarshalDomain); +/***/ 5130: +/***/ ((__unused_webpack_module, exports) => { - /** - * Domain DNS check. Perform an immediate DNS check of a domain using the - * `region` and `domain_id` parameters. - * - * @param request - The request {@link CheckDomainRequest} - * @returns A Promise of Domain - */ - checkDomain = request => this.client.fetch({ - body: '{}', - headers: jsonContentHeaders$4, - method: 'POST', - path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam('domainId', request.domainId)}/check` - }, unmarshalDomain); +"use strict"; - /** - * Display SPF and DKIM records status and potential errors. Display SPF and - * DKIM records status and potential errors, including the found records to - * make debugging easier. - * - * @param request - The request {@link GetDomainLastStatusRequest} - * @returns A Promise of DomainLastStatus - */ - getDomainLastStatus = request => this.client.fetch({ - method: 'GET', - path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam('domainId', request.domainId)}/verification` - }, unmarshalDomainLastStatus); +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const addHeaderInterceptor = (key, value) => ({ request }) => { + const clone = request.clone(); + if (value !== void 0) { + clone.headers.append(key, value); + } + return clone; }; +const addAsyncHeaderInterceptor = (key, getter) => async (request) => addHeaderInterceptor(key, await getter())(request); +exports.addAsyncHeaderInterceptor = addAsyncHeaderInterceptor; +exports.addHeaderInterceptor = addHeaderInterceptor; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -var index_gen$4 = /*#__PURE__*/Object.freeze({ - __proto__: null, - API: API$4, - DOMAIN_TRANSIENT_STATUSES: DOMAIN_TRANSIENT_STATUSES, - EMAIL_TRANSIENT_STATUSES: EMAIL_TRANSIENT_STATUSES -}); +/***/ }), -var index$3 = /*#__PURE__*/Object.freeze({ - __proto__: null, - v1alpha1: index_gen$4 -}); +/***/ 5631: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const unmarshalPrivateNetwork$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'PrivateNetwork' failed as data isn't a dictionary.`); +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const levelResolver = __nccwpck_require__(2486); +class ConsoleLogger { + constructor(logLevel, prefix = "", output = console) { + this.logLevel = logLevel; + this.prefix = prefix; + this.output = output; + this.level = levelResolver.LevelResolver[this.logLevel]; } - return { - createdAt: unmarshalDate(data.created_at), - id: data.id, - name: data.name, - organizationId: data.organization_id, - projectId: data.project_id, - subnets: data.subnets, - tags: data.tags, - updatedAt: unmarshalDate(data.updated_at), - zone: data.zone - }; -}; -const unmarshalListPrivateNetworksResponse$1 = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListPrivateNetworksResponse' failed as data isn't a dictionary.`); + level; + makeMethod(method) { + return (message) => { + if (levelResolver.shouldLog(this.level, method)) { + this.output[method](this.prefix ? `${this.prefix} ${message}` : message); + } + }; } - return { - privateNetworks: unmarshalArrayOfObject(data.private_networks, unmarshalPrivateNetwork$1), - totalCount: data.total_count - }; + debug = this.makeMethod("debug"); + error = this.makeMethod("error"); + info = this.makeMethod("info"); + warn = this.makeMethod("warn"); +} +exports.ConsoleLogger = ConsoleLogger; + + +/***/ }), + +/***/ 3009: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const consoleLogger = __nccwpck_require__(5631); +let sdkLogger = new consoleLogger.ConsoleLogger("silent"); +const setLogger = (logger) => { + sdkLogger = logger; }; -const marshalCreatePrivateNetworkRequest$1 = (request, defaults) => ({ - name: request.name || randomName('pn'), - project_id: request.projectId ?? defaults.defaultProjectId, - subnets: request.subnets, - tags: request.tags -}); -const marshalUpdatePrivateNetworkRequest$1 = (request, defaults) => ({ - name: request.name, - subnets: request.subnets, - tags: request.tags -}); +const enableConsoleLogger = (logLevel = "warn", prefix = "scaleway-sdk-js:") => setLogger(new consoleLogger.ConsoleLogger(logLevel, prefix)); +const getLogger = () => sdkLogger; +exports.enableConsoleLogger = enableConsoleLogger; +exports.getLogger = getLogger; +exports.setLogger = setLogger; + + +/***/ }), -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const jsonContentHeaders$3 = { - 'Content-Type': 'application/json; charset=utf-8' +/***/ 2486: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +var LevelResolver = /* @__PURE__ */ ((LevelResolver2) => { + LevelResolver2[LevelResolver2["silent"] = 0] = "silent"; + LevelResolver2[LevelResolver2["error"] = 1] = "error"; + LevelResolver2[LevelResolver2["warn"] = 2] = "warn"; + LevelResolver2[LevelResolver2["info"] = 3] = "info"; + LevelResolver2[LevelResolver2["debug"] = 4] = "debug"; + return LevelResolver2; +})(LevelResolver || {}); +const shouldLog = (currentLevel, level) => LevelResolver[level] <= currentLevel; +exports.LevelResolver = LevelResolver; +exports.shouldLog = shouldLog; + + +/***/ }), + +/***/ 1556: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const isAccessKeyRegex = /^SCW[A-Z0-9]{17}$/i; +const isRegionRegex = /^[a-z]{2}-[a-z]{3}$/i; +const isUUIDRegex = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/i; +const isZoneRegex = /^[a-z]{2}-[a-z]{3}-[1-9]$/i; +const isUUID = (str) => isUUIDRegex.test(str); +const isAccessKey = (str) => isAccessKeyRegex.test(str); +const isSecretKey = (str) => isUUID(str); +const isOrganizationId = (str) => isUUID(str); +const isProjectId = (str) => isUUID(str); +const isRegion = (str) => isRegionRegex.test(str); +const isZone = (str) => isZoneRegex.test(str); +const isURL = (str) => { + let url; + try { + url = new URL(str); + } catch { + return false; + } + return url.protocol === "http:" || url.protocol === "https:"; }; +exports.isAccessKey = isAccessKey; +exports.isOrganizationId = isOrganizationId; +exports.isProjectId = isProjectId; +exports.isRegion = isRegion; +exports.isSecretKey = isSecretKey; +exports.isURL = isURL; +exports.isUUID = isUUID; +exports.isZone = isZone; -/** VPC API. */ -let API$3 = class API extends API$u { - /** Lists the available zones of the API. */ - static LOCALITIES = ['fr-par-1', 'fr-par-2', 'fr-par-3', 'nl-ams-1', 'nl-ams-2', 'nl-ams-3', 'pl-waw-1', 'pl-waw-2']; - pageOfListPrivateNetworks = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/vpc/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/private-networks`, - urlParams: urlParams(['include_regional', request.includeRegional], ['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['private_network_ids', request.privateNetworkIds], ['project_id', request.projectId], ['tags', request.tags]) - }, unmarshalListPrivateNetworksResponse$1); - /** - * List Private Networks. List existing Private Networks in a specified - * Availability Zone. By default, the Private Networks returned in the list - * are ordered by creation date in ascending order, though this can be - * modified via the order_by field. - * - * @param request - The request {@link ListPrivateNetworksRequest} - * @returns A Promise of ListPrivateNetworksResponse - */ - listPrivateNetworks = (request = {}) => enrichForPagination('privateNetworks', this.pageOfListPrivateNetworks, request); +/***/ }), - /** - * Create a Private Network. Create a new Private Network. Once created, you - * can attach Scaleway resources in the same Availability Zone. - * - * @param request - The request {@link CreatePrivateNetworkRequest} - * @returns A Promise of PrivateNetwork - */ - createPrivateNetwork = (request = {}) => this.client.fetch({ - body: JSON.stringify(marshalCreatePrivateNetworkRequest$1(request, this.client.settings)), - headers: jsonContentHeaders$3, - method: 'POST', - path: `/vpc/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/private-networks` - }, unmarshalPrivateNetwork$1); +/***/ 3042: +/***/ ((__unused_webpack_module, exports) => { - /** - * Get a Private Network. Retrieve information about an existing Private - * Network, specified by its Private Network ID. Its full details are returned - * in the response object. - * - * @param request - The request {@link GetPrivateNetworkRequest} - * @returns A Promise of PrivateNetwork - */ - getPrivateNetwork = request => this.client.fetch({ - method: 'GET', - path: `/vpc/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}` - }, unmarshalPrivateNetwork$1); +"use strict"; - /** - * Update Private Network. Update parameters (such as name or tags) of an - * existing Private Network, specified by its Private Network ID. - * - * @param request - The request {@link UpdatePrivateNetworkRequest} - * @returns A Promise of PrivateNetwork - */ - updatePrivateNetwork = request => this.client.fetch({ - body: JSON.stringify(marshalUpdatePrivateNetworkRequest$1(request, this.client.settings)), - headers: jsonContentHeaders$3, - method: 'PATCH', - path: `/vpc/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}` - }, unmarshalPrivateNetwork$1); +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +let API$1 = class API { + constructor(client) { + this.client = client; + } +}; +exports.API = API$1; - /** - * Delete a Private Network. Delete an existing Private Network. Note that you - * must first detach all resources from the network, in order to delete it. - * - * @param request - The request {@link DeletePrivateNetworkRequest} - */ - deletePrivateNetwork = request => this.client.fetch({ - method: 'DELETE', - path: `/vpc/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}` - }); + +/***/ }), + +/***/ 6024: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const helpers = __nccwpck_require__(5130); +const clientIniProfile = __nccwpck_require__(2926); +const SESSION_HEADER_KEY = "x-session-token"; +const AUTH_HEADER_KEY = "x-auth-token"; +const authenticateWithSessionToken = (getToken) => helpers.addAsyncHeaderInterceptor(SESSION_HEADER_KEY, getToken); +const authenticateWithSecrets = (secrets) => { + clientIniProfile.assertValidAuthenticationSecrets(secrets); + return helpers.addHeaderInterceptor(AUTH_HEADER_KEY, secrets.secretKey); +}; +const obfuscateToken = (key) => `${key.substring(0, 5)}xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`; +const obfuscateUUID = (key) => `${key.substring(0, 8)}-xxxx-xxxx-xxxx-xxxxxxxxxxxx`; +const obfuscateAuthHeadersEntry = ([ + name, + value +]) => { + if (name === SESSION_HEADER_KEY) return [name, obfuscateToken(value)]; + if (name === AUTH_HEADER_KEY) return [name, obfuscateUUID(value)]; + return [name, value]; }; +exports.authenticateWithSecrets = authenticateWithSecrets; +exports.authenticateWithSessionToken = authenticateWithSessionToken; +exports.obfuscateAuthHeadersEntry = obfuscateAuthHeadersEntry; +exports.obfuscateToken = obfuscateToken; +exports.obfuscateUUID = obfuscateUUID; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -var index_gen$3 = /*#__PURE__*/Object.freeze({ - __proto__: null, - API: API$3 -}); +/***/ }), -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const unmarshalSubnet = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Subnet' failed as data isn't a dictionary.`); - } - return { - createdAt: unmarshalDate(data.created_at), - id: data.id, - subnet: data.subnet, - updatedAt: unmarshalDate(data.updated_at) - }; -}; -const unmarshalPrivateNetwork = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'PrivateNetwork' failed as data isn't a dictionary.`); +/***/ 1747: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const auth = __nccwpck_require__(6024); +const clientIniProfile = __nccwpck_require__(2926); +const withProfile = (profile) => (settings) => { + const newSettings = { ...settings }; + if (profile.apiURL) { + newSettings.apiURL = profile.apiURL; } - return { - createdAt: unmarshalDate(data.created_at), - dhcpEnabled: data.dhcp_enabled, - id: data.id, - name: data.name, - organizationId: data.organization_id, - projectId: data.project_id, - region: data.region, - subnets: unmarshalArrayOfObject(data.subnets, unmarshalSubnet), - tags: data.tags, - updatedAt: unmarshalDate(data.updated_at), - vpcId: data.vpc_id - }; -}; -const unmarshalVPC = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'VPC' failed as data isn't a dictionary.`); + if (profile.defaultOrganizationId) { + newSettings.defaultOrganizationId = profile.defaultOrganizationId; } - return { - createdAt: unmarshalDate(data.created_at), - id: data.id, - isDefault: data.is_default, - name: data.name, - organizationId: data.organization_id, - privateNetworkCount: data.private_network_count, - projectId: data.project_id, - region: data.region, - tags: data.tags, - updatedAt: unmarshalDate(data.updated_at) - }; -}; -const unmarshalAddSubnetsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'AddSubnetsResponse' failed as data isn't a dictionary.`); + if (profile.defaultProjectId) { + newSettings.defaultProjectId = profile.defaultProjectId; } - return { - subnets: data.subnets - }; -}; -const unmarshalDeleteSubnetsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'DeleteSubnetsResponse' failed as data isn't a dictionary.`); + if (profile.defaultRegion) { + newSettings.defaultRegion = profile.defaultRegion; } - return { - subnets: data.subnets - }; -}; -const unmarshalListPrivateNetworksResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListPrivateNetworksResponse' failed as data isn't a dictionary.`); + if (profile.defaultZone) { + newSettings.defaultZone = profile.defaultZone; } - return { - privateNetworks: unmarshalArrayOfObject(data.private_networks, unmarshalPrivateNetwork), - totalCount: data.total_count - }; -}; -const unmarshalListVPCsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListVPCsResponse' failed as data isn't a dictionary.`); + if (clientIniProfile.hasAuthenticationSecrets(profile)) { + newSettings.interceptors = [ + { + request: auth.authenticateWithSecrets(profile) + }, + ...newSettings.interceptors + ]; } - return { - totalCount: data.total_count, - vpcs: unmarshalArrayOfObject(data.vpcs, unmarshalVPC) - }; + return newSettings; }; -const unmarshalSetSubnetsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'SetSubnetsResponse' failed as data isn't a dictionary.`); +const withHTTPClient = (httpClient) => (settings) => ({ ...settings, httpClient }); +const withDefaultPageSize = (defaultPageSize) => (settings) => ({ ...settings, defaultPageSize }); +const withUserAgent = (userAgent) => (settings) => ({ ...settings, userAgent }); +const withUserAgentSuffix = (userAgent) => (settings) => ({ + ...settings, + userAgent: settings.userAgent ? `${settings.userAgent} ${userAgent}` : userAgent +}); +const withAdditionalInterceptors = (interceptors) => (settings) => ({ + ...settings, + interceptors: settings.interceptors.concat(interceptors) +}); +const withLegacyInterceptors = () => (settings) => { + if (!settings.requestInterceptors && !settings.responseInterceptors) { + return settings; } + const allInterceptors = settings.interceptors.concat( + (settings.requestInterceptors ?? []).map((obj) => ({ + request: obj + })), + (settings.responseInterceptors ?? []).map((obj) => ({ + response: obj + })) + ); return { - subnets: data.subnets + ...settings, + interceptors: allInterceptors }; }; -const marshalAddSubnetsRequest = (request, defaults) => ({ - subnets: request.subnets -}); -const marshalCreatePrivateNetworkRequest = (request, defaults) => ({ - name: request.name || randomName('pn'), - project_id: request.projectId ?? defaults.defaultProjectId, - subnets: request.subnets, - tags: request.tags, - vpc_id: request.vpcId -}); -const marshalCreateVPCRequest = (request, defaults) => ({ - name: request.name || randomName('vpc'), - project_id: request.projectId ?? defaults.defaultProjectId, - tags: request.tags -}); -const marshalDeleteSubnetsRequest = (request, defaults) => ({ - subnets: request.subnets -}); -const marshalMigrateZonalPrivateNetworksRequest = (request, defaults) => ({ - private_network_ids: request.privateNetworkIds, - ...resolveOneOf([{ - default: defaults.defaultProjectId, - param: 'project_id', - value: request.projectId - }, { - default: defaults.defaultOrganizationId, - param: 'organization_id', - value: request.organizationId - }]) -}); -const marshalSetSubnetsRequest = (request, defaults) => ({ - subnets: request.subnets -}); -const marshalUpdatePrivateNetworkRequest = (request, defaults) => ({ - name: request.name, - tags: request.tags -}); -const marshalUpdateVPCRequest = (request, defaults) => ({ - name: request.name, - tags: request.tags -}); - -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const jsonContentHeaders$2 = { - 'Content-Type': 'application/json; charset=utf-8' -}; - -/** VPC API. */ -let API$2 = class API extends API$u { - /** Lists the available regions of the API. */ - static LOCALITIES = ['fr-par', 'nl-ams', 'pl-waw']; - pageOfListVPCs = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/vpcs`, - urlParams: urlParams(['is_default', request.isDefault], ['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId], ['tags', request.tags]) - }, unmarshalListVPCsResponse); +exports.withAdditionalInterceptors = withAdditionalInterceptors; +exports.withDefaultPageSize = withDefaultPageSize; +exports.withHTTPClient = withHTTPClient; +exports.withLegacyInterceptors = withLegacyInterceptors; +exports.withProfile = withProfile; +exports.withUserAgent = withUserAgent; +exports.withUserAgentSuffix = withUserAgentSuffix; - /** - * List VPCs. List existing VPCs in the specified region. - * - * @param request - The request {@link ListVPCsRequest} - * @returns A Promise of ListVPCsResponse - */ - listVPCs = (request = {}) => enrichForPagination('vpcs', this.pageOfListVPCs, request); - /** - * Create a VPC. Create a new VPC in the specified region. - * - * @param request - The request {@link CreateVPCRequest} - * @returns A Promise of VPC - */ - createVPC = (request = {}) => this.client.fetch({ - body: JSON.stringify(marshalCreateVPCRequest(request, this.client.settings)), - headers: jsonContentHeaders$2, - method: 'POST', - path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/vpcs` - }, unmarshalVPC); +/***/ }), - /** - * Get a VPC. Retrieve details of an existing VPC, specified by its VPC ID. - * - * @param request - The request {@link GetVPCRequest} - * @returns A Promise of VPC - */ - getVPC = request => this.client.fetch({ - method: 'GET', - path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam('vpcId', request.vpcId)}` - }, unmarshalVPC); +/***/ 2926: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - /** - * Update VPC. Update parameters including name and tags of the specified VPC. - * - * @param request - The request {@link UpdateVPCRequest} - * @returns A Promise of VPC - */ - updateVPC = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateVPCRequest(request, this.client.settings)), - headers: jsonContentHeaders$2, - method: 'PATCH', - path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam('vpcId', request.vpcId)}` - }, unmarshalVPC); +"use strict"; - /** - * Delete a VPC. Delete a VPC specified by its VPC ID. - * - * @param request - The request {@link DeleteVPCRequest} - */ - deleteVPC = request => this.client.fetch({ - method: 'DELETE', - path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam('vpcId', request.vpcId)}` - }); - pageOfListPrivateNetworks = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/private-networks`, - urlParams: urlParams(['dhcp_enabled', request.dhcpEnabled], ['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['private_network_ids', request.privateNetworkIds], ['project_id', request.projectId], ['tags', request.tags], ['vpc_id', request.vpcId]) - }, unmarshalListPrivateNetworksResponse); +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const stringValidation = __nccwpck_require__(1556); +const hasAuthenticationSecrets = (obj) => typeof obj.accessKey === "string" && obj.accessKey !== "" && typeof obj.secretKey === "string" && obj.secretKey !== ""; +function assertValidAuthenticationSecrets(obj) { + if (!(obj.accessKey && obj.secretKey)) { + throw new Error( + `Invalid secrets, accessKey & secretKey must be defined. See https://www.scaleway.com/en/docs/identity-and-access-management/iam/how-to/create-api-keys/` + ); + } + if (!stringValidation.isAccessKey(obj.accessKey)) { + throw new Error( + `Invalid access key format '${obj.accessKey}', expected SCWXXXXXXXXXXXXXXXXX format. See https://www.scaleway.com/en/docs/identity-and-access-management/iam/how-to/create-api-keys/` + ); + } + if (!stringValidation.isSecretKey(obj.secretKey)) { + throw new Error( + `Invalid secret key format '${obj.secretKey}', expected a UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. See https://www.scaleway.com/en/docs/identity-and-access-management/iam/how-to/create-api-keys/` + ); + } +} +exports.assertValidAuthenticationSecrets = assertValidAuthenticationSecrets; +exports.hasAuthenticationSecrets = hasAuthenticationSecrets; - /** - * List Private Networks. List existing Private Networks in the specified - * region. By default, the Private Networks returned in the list are ordered - * by creation date in ascending order, though this can be modified via the - * order_by field. - * - * @param request - The request {@link ListPrivateNetworksRequest} - * @returns A Promise of ListPrivateNetworksResponse - */ - listPrivateNetworks = (request = {}) => enrichForPagination('privateNetworks', this.pageOfListPrivateNetworks, request); - /** - * Create a Private Network. Create a new Private Network. Once created, you - * can attach Scaleway resources which are in the same region. - * - * @param request - The request {@link CreatePrivateNetworkRequest} - * @returns A Promise of PrivateNetwork - */ - createPrivateNetwork = (request = {}) => this.client.fetch({ - body: JSON.stringify(marshalCreatePrivateNetworkRequest(request, this.client.settings)), - headers: jsonContentHeaders$2, - method: 'POST', - path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/private-networks` - }, unmarshalPrivateNetwork); +/***/ }), - /** - * Get a Private Network. Retrieve information about an existing Private - * Network, specified by its Private Network ID. Its full details are returned - * in the response object. - * - * @param request - The request {@link GetPrivateNetworkRequest} - * @returns A Promise of PrivateNetwork - */ - getPrivateNetwork = request => this.client.fetch({ - method: 'GET', - path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}` - }, unmarshalPrivateNetwork); +/***/ 1443: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - /** - * Update Private Network. Update parameters (such as name or tags) of an - * existing Private Network, specified by its Private Network ID. - * - * @param request - The request {@link UpdatePrivateNetworkRequest} - * @returns A Promise of PrivateNetwork - */ - updatePrivateNetwork = request => this.client.fetch({ - body: JSON.stringify(marshalUpdatePrivateNetworkRequest(request, this.client.settings)), - headers: jsonContentHeaders$2, - method: 'PATCH', - path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}` - }, unmarshalPrivateNetwork); +"use strict"; - /** - * Delete a Private Network. Delete an existing Private Network. Note that you - * must first detach all resources from the network, in order to delete it. - * - * @param request - The request {@link DeletePrivateNetworkRequest} - */ - deletePrivateNetwork = request => this.client.fetch({ - method: 'DELETE', - path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}` - }); +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const stringValidation = __nccwpck_require__(1556); +const assertValidSettings = (obj) => { + if (obj.defaultOrganizationId !== void 0) { + if (typeof obj.defaultOrganizationId !== "string" || obj.defaultOrganizationId.length === 0) { + throw new Error("Default organization ID cannot be empty"); + } + if (!stringValidation.isOrganizationId(obj.defaultOrganizationId)) { + throw new Error( + `Invalid organization ID format '${obj.defaultOrganizationId}', expected a UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` + ); + } + } + if (obj.defaultProjectId !== void 0) { + if (typeof obj.defaultProjectId !== "string" || obj.defaultProjectId.length === 0) { + throw new Error("Default project ID cannot be empty"); + } + if (!stringValidation.isProjectId(obj.defaultProjectId)) { + throw new Error( + `Invalid project ID format '${obj.defaultProjectId}', expected a UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` + ); + } + } + if (obj.defaultRegion && !stringValidation.isRegion(obj.defaultRegion)) { + throw new Error(`Invalid default region format '${obj.defaultRegion}'`); + } + if (obj.defaultZone && !stringValidation.isZone(obj.defaultZone)) { + throw new Error(`Invalid default zone format '${obj.defaultZone}'`); + } + if (!stringValidation.isURL(obj.apiURL)) { + throw new Error(`Invalid URL ${obj.apiURL}`); + } + if (obj.apiURL.endsWith("/")) { + throw new Error( + `Invalid URL ${obj.apiURL}: it should not have a trailing slash` + ); + } + if (typeof obj.httpClient !== typeof fetch) { + throw new Error(`Invalid HTTP Client`); + } + if (obj.defaultPageSize !== void 0 && (typeof obj.defaultPageSize !== "number" || Number.isNaN(obj.defaultPageSize) || obj.defaultPageSize <= 0)) { + throw new Error( + `Invalid defaultPageSize ${obj.defaultPageSize}: it should be a number above 0` + ); + } + if (typeof obj.userAgent !== "string") { + throw new Error(`Invalid User-Agent`); + } +}; +exports.assertValidSettings = assertValidSettings; - /** - * Migrate Private Networks from zoned to regional. Transform multiple - * existing zoned Private Networks (scoped to a single Availability Zone) into - * regional Private Networks, scoped to an entire region. You can transform - * one or many Private Networks (specified by their Private Network IDs) - * within a single Scaleway Organization or Project, with the same call. - * - * @param request - The request {@link MigrateZonalPrivateNetworksRequest} - */ - migrateZonalPrivateNetworks = (request = {}) => this.client.fetch({ - body: JSON.stringify(marshalMigrateZonalPrivateNetworksRequest(request, this.client.settings)), - headers: jsonContentHeaders$2, - method: 'POST', - path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/private-networks/migrate-zonal` - }); - /** - * Enable DHCP on a Private Network. Enable DHCP managed on an existing - * Private Network. Note that you will not be able to deactivate it - * afterwards. - * - * @param request - The request {@link EnableDHCPRequest} - * @returns A Promise of PrivateNetwork - */ - enableDHCP = request => this.client.fetch({ - body: '{}', - headers: jsonContentHeaders$2, - method: 'POST', - path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}/enable-dhcp` - }, unmarshalPrivateNetwork); +/***/ }), - /** - * Set the subnets of a Private Network. Set subnets for an existing Private - * Network. Note that the method is PUT and not PATCH. Any existing subnets - * will be removed in favor of the new specified set of subnets. - * - * @param request - The request {@link SetSubnetsRequest} - * @returns A Promise of SetSubnetsResponse - */ - setSubnets = request => this.client.fetch({ - body: JSON.stringify(marshalSetSubnetsRequest(request, this.client.settings)), - headers: jsonContentHeaders$2, - method: 'PUT', - path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}/subnets` - }, unmarshalSetSubnetsResponse); +/***/ 971: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - /** - * Add subnets to a Private Network. Add new subnets to an existing Private - * Network. - * - * @param request - The request {@link AddSubnetsRequest} - * @returns A Promise of AddSubnetsResponse - */ - addSubnets = request => this.client.fetch({ - body: JSON.stringify(marshalAddSubnetsRequest(request, this.client.settings)), - headers: jsonContentHeaders$2, - method: 'POST', - path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}/subnets` - }, unmarshalAddSubnetsResponse); +"use strict"; - /** - * Delete subnets from a Private Network. Delete the specified subnets from a - * Private Network. - * - * @param request - The request {@link DeleteSubnetsRequest} - * @returns A Promise of DeleteSubnetsResponse - */ - deleteSubnets = request => this.client.fetch({ - body: JSON.stringify(marshalDeleteSubnetsRequest(request, this.client.settings)), - headers: jsonContentHeaders$2, - method: 'DELETE', - path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}/subnets` - }, unmarshalDeleteSubnetsResponse); +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const index = __nccwpck_require__(3009); +const clientIniFactory = __nccwpck_require__(1747); +const clientSettings = __nccwpck_require__(1443); +const constants = __nccwpck_require__(3481); +const buildFetcher = __nccwpck_require__(7793); +const DEFAULT_SETTINGS = { + apiURL: "https://api.scaleway.com", + httpClient: fetch, + interceptors: [], + userAgent: constants.userAgent +}; +const createAdvancedClient = (...configs) => { + const settings = configs.concat([clientIniFactory.withLegacyInterceptors()]).reduce( + (currentSettings, config) => config(currentSettings), + DEFAULT_SETTINGS + ); + clientSettings.assertValidSettings(settings); + index.getLogger().info(`init Scaleway SDK version ${constants.version}`); + return { + fetch: buildFetcher.buildFetcher(settings, settings.httpClient), + settings + }; }; +const createClient = (profile = {}) => createAdvancedClient(clientIniFactory.withProfile(profile)); +exports.createAdvancedClient = createAdvancedClient; +exports.createClient = createClient; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -var index_gen$2 = /*#__PURE__*/Object.freeze({ - __proto__: null, - API: API$2 -}); +/***/ }), -var index$2 = /*#__PURE__*/Object.freeze({ - __proto__: null, - v1: index_gen$3, - v2: index_gen$2 -}); +/***/ 3481: +/***/ ((__unused_webpack_module, exports) => { -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. +"use strict"; -/** Lists transient statutes of the enum {@link GatewayNetworkStatus}. */ -const GATEWAY_NETWORK_TRANSIENT_STATUSES = ['attaching', 'configuring', 'detaching']; +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const version = "v2.49.0"; +const userAgent = `scaleway-sdk-js/${version}`; +exports.userAgent = userAgent; +exports.version = version; -/** Lists transient statutes of the enum {@link GatewayStatus}. */ -const GATEWAY_TRANSIENT_STATUSES = ['allocating', 'configuring', 'stopping', 'deleting']; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const unmarshalDHCP = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'DHCP' failed as data isn't a dictionary.`); - } - return { - address: data.address, - createdAt: unmarshalDate(data.created_at), - dnsLocalName: data.dns_local_name, - dnsSearch: data.dns_search, - dnsServersOverride: data.dns_servers_override, - enableDynamic: data.enable_dynamic, - id: data.id, - organizationId: data.organization_id, - poolHigh: data.pool_high, - poolLow: data.pool_low, - projectId: data.project_id, - pushDefaultRoute: data.push_default_route, - pushDnsServer: data.push_dns_server, - rebindTimer: data.rebind_timer, - renewTimer: data.renew_timer, - subnet: data.subnet, - updatedAt: unmarshalDate(data.updated_at), - validLifetime: data.valid_lifetime, - zone: data.zone - }; -}; -const unmarshalGatewayNetwork = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'GatewayNetwork' failed as data isn't a dictionary.`); +/***/ }), + +/***/ 7586: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const json = __nccwpck_require__(3746); +const marshalling = __nccwpck_require__(1162); +const index = __nccwpck_require__(1187); +const customTypes = __nccwpck_require__(2911); +const unmarshalMoney = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Money' failed as data isn't a dictionary.` + ); } return { - address: data.address, - createdAt: unmarshalDate(data.created_at), - dhcp: data.dhcp ? unmarshalDHCP(data.dhcp) : undefined, - enableDhcp: data.enable_dhcp, - enableMasquerade: data.enable_masquerade, - gatewayId: data.gateway_id, - id: data.id, - macAddress: data.mac_address, - privateNetworkId: data.private_network_id, - status: data.status, - updatedAt: unmarshalDate(data.updated_at), - zone: data.zone + currencyCode: data.currency_code, + nanos: data.nanos, + units: data.units }; }; -const unmarshalGatewayType = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'GatewayType' failed as data isn't a dictionary.`); +const unmarshalServiceInfo = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ServiceInfo' failed as data isn't a dictionary.` + ); } return { - bandwidth: data.bandwidth, + description: data.description, + documentationUrl: data.documentation_url, name: data.name, - zone: data.zone + version: data.version }; }; -const unmarshalIP = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'IP' failed as data isn't a dictionary.`); +const unmarshalScwFile = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'ScwFile' failed as data isn't a dictionary.` + ); } return { - address: data.address, - createdAt: unmarshalDate(data.created_at), - gatewayId: data.gateway_id, - id: data.id, - organizationId: data.organization_id, - projectId: data.project_id, - reverse: data.reverse, - tags: data.tags, - updatedAt: unmarshalDate(data.updated_at), - zone: data.zone + content: data.content, + contentType: data.content_type, + name: data.name }; }; -const unmarshalDHCPEntry = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'DHCPEntry' failed as data isn't a dictionary.`); +const unmarshalTimeSeriesPoint = (data) => { + if (!Array.isArray(data)) { + throw new TypeError( + `Unmarshalling the type 'TimeSeriesPoint' failed as data isn't an array.` + ); } return { - createdAt: unmarshalDate(data.created_at), - gatewayNetworkId: data.gateway_network_id, - hostname: data.hostname, - id: data.id, - ipAddress: data.ip_address, - macAddress: data.mac_address, - type: data.type, - updatedAt: unmarshalDate(data.updated_at), - zone: data.zone + timestamp: marshalling.unmarshalDate(data[0]), + value: data[1] }; }; -const unmarshalGateway = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Gateway' failed as data isn't a dictionary.`); +const unmarshalTimeSeries = (data) => { + if (!json.isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'TimeSeries' failed as data isn't a dictionary.` + ); } return { - bastionEnabled: data.bastion_enabled, - bastionPort: data.bastion_port, - canUpgradeTo: data.can_upgrade_to, - createdAt: unmarshalDate(data.created_at), - gatewayNetworks: unmarshalArrayOfObject(data.gateway_networks, unmarshalGatewayNetwork), - id: data.id, - ip: data.ip ? unmarshalIP(data.ip) : undefined, + metadata: data.metadata, name: data.name, - organizationId: data.organization_id, - projectId: data.project_id, - smtpEnabled: data.smtp_enabled, - status: data.status, - tags: data.tags, - type: data.type ? unmarshalGatewayType(data.type) : undefined, - updatedAt: unmarshalDate(data.updated_at), - upstreamDnsServers: data.upstream_dns_servers, - version: data.version, - zone: data.zone + points: marshalling.unmarshalArrayOfObject(data.points, unmarshalTimeSeriesPoint) }; }; -const unmarshalPATRule = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'PATRule' failed as data isn't a dictionary.`); +const unmarshalDecimal = (data) => { + if (!(typeof data === "object")) { + throw new TypeError( + `Unmarshalling the type 'Decimal' failed as data isn't an object.` + ); } - return { - createdAt: unmarshalDate(data.created_at), - gatewayId: data.gateway_id, - id: data.id, - privateIp: data.private_ip, - privatePort: data.private_port, - protocol: data.protocol, - publicPort: data.public_port, - updatedAt: unmarshalDate(data.updated_at), - zone: data.zone - }; -}; -const unmarshalListDHCPEntriesResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListDHCPEntriesResponse' failed as data isn't a dictionary.`); + if (data === null) { + return null; } - return { - dhcpEntries: unmarshalArrayOfObject(data.dhcp_entries, unmarshalDHCPEntry), - totalCount: data.total_count - }; -}; -const unmarshalListDHCPsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListDHCPsResponse' failed as data isn't a dictionary.`); + if (!("value" in data)) { + throw new TypeError( + `Unmarshalling the type 'Decimal' failed as data object does not have a 'value' key.` + ); } - return { - dhcps: unmarshalArrayOfObject(data.dhcps, unmarshalDHCP), - totalCount: data.total_count - }; + if (!(typeof data.value === "string")) { + throw new TypeError( + `Unmarshalling the type 'Decimal' failed as 'value' is not a string.` + ); + } + return new customTypes.Decimal(data.value); }; -const unmarshalListGatewayNetworksResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListGatewayNetworksResponse' failed as data isn't a dictionary.`); +const marshalScwFile = (obj) => ({ + content: obj.content, + content_type: obj.contentType, + name: obj.name +}); +const marshalBlobToScwFile = async (blob) => ({ + content: index.fromByteArray(new Uint8Array(await blob.arrayBuffer())), + content_type: blob.type, + name: "file" +}); +const marshalMoney = (obj) => ({ + currency_code: obj.currencyCode, + nanos: obj.nanos, + units: obj.units +}); +const marshalTimeSeriesPoint = (obj) => ({ + timestamp: obj.timestamp?.toISOString(), + value: obj.value +}); +const marshalTimeSeries = (obj) => ({ + metadata: obj.metadata, + name: obj.name, + points: obj.points.map((elt) => marshalTimeSeriesPoint(elt)) +}); +const marshalDecimal = (obj) => ({ + value: obj.toString() +}); +exports.marshalBlobToScwFile = marshalBlobToScwFile; +exports.marshalDecimal = marshalDecimal; +exports.marshalMoney = marshalMoney; +exports.marshalScwFile = marshalScwFile; +exports.marshalTimeSeries = marshalTimeSeries; +exports.marshalTimeSeriesPoint = marshalTimeSeriesPoint; +exports.unmarshalDecimal = unmarshalDecimal; +exports.unmarshalMoney = unmarshalMoney; +exports.unmarshalScwFile = unmarshalScwFile; +exports.unmarshalServiceInfo = unmarshalServiceInfo; +exports.unmarshalTimeSeries = unmarshalTimeSeries; +exports.unmarshalTimeSeriesPoint = unmarshalTimeSeriesPoint; + + +/***/ }), + +/***/ 2911: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +class Decimal { + str; + constructor(v) { + this.str = v; } - return { - gatewayNetworks: unmarshalArrayOfObject(data.gateway_networks, unmarshalGatewayNetwork), - totalCount: data.total_count - }; + toString = () => this.str; + marshal = () => ({ value: this.str }); +} +exports.Decimal = Decimal; + + +/***/ }), + +/***/ 7776: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const invalidRequestMapper = __nccwpck_require__(5311); +const unknownResourceMapper = __nccwpck_require__(6601); +const scwError = __nccwpck_require__(622); +const alreadyExistsError = __nccwpck_require__(7100); +const deniedAuthenticationError = __nccwpck_require__(7399); +const invalidArgumentsError = __nccwpck_require__(4955); +const outOfStockError = __nccwpck_require__(526); +const permissionsDeniedError = __nccwpck_require__(8173); +const preconditionFailedError = __nccwpck_require__(1721); +const quotasExceededError = __nccwpck_require__(9710); +const resourceExpiredError = __nccwpck_require__(7293); +const resourceLockedError = __nccwpck_require__(8954); +const resourceNotFoundError = __nccwpck_require__(1146); +const tooManyRequestsError = __nccwpck_require__(2668); +const transientStateError = __nccwpck_require__(3995); +const unmarshalStandardError = (type, status, body) => { + let error; + switch (type) { + case "denied_authentication": + error = deniedAuthenticationError.DeniedAuthenticationError; + break; + case "invalid_arguments": + error = invalidArgumentsError.InvalidArgumentsError; + break; + case "out_of_stock": + error = outOfStockError.OutOfStockError; + break; + case "permissions_denied": + error = permissionsDeniedError.PermissionsDeniedError; + break; + case "precondition_failed": + error = preconditionFailedError.PreconditionFailedError; + break; + case "quotas_exceeded": + error = quotasExceededError.QuotasExceededError; + break; + case "expired": + error = resourceExpiredError.ResourceExpiredError; + break; + case "not_found": + error = resourceNotFoundError.ResourceNotFoundError; + break; + case "locked": + error = resourceLockedError.ResourceLockedError; + break; + case "transient_state": + error = transientStateError.TransientStateError; + break; + case "already_exists": + error = alreadyExistsError.AlreadyExistsError; + break; + case "too_many_requests": + error = tooManyRequestsError.TooManyRequestsError; + break; + default: + return null; + } + return error.fromJSON(status, body); }; -const unmarshalListGatewayTypesResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListGatewayTypesResponse' failed as data isn't a dictionary.`); +const unmarshalNonStandardError = (type, status, body) => { + switch (type) { + case "unknown_resource": + return unknownResourceMapper.UnknownResourceMapper.fromJSON(status, body); + case "invalid_request_error": + return invalidRequestMapper.InvalidRequestMapper.fromJSON(status, body); + default: + return null; } - return { - types: unmarshalArrayOfObject(data.types, unmarshalGatewayType) - }; }; -const unmarshalListGatewaysResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListGatewaysResponse' failed as data isn't a dictionary.`); +const parseScalewayError = (status, body) => { + const parsableError = typeof body.type === "string" && (unmarshalStandardError(body.type, status, body) ?? unmarshalNonStandardError(body.type, status, body)); + return parsableError || new scwError.ScalewayError(status, body); +}; +exports.parseScalewayError = parseScalewayError; + + +/***/ }), + +/***/ 5311: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const scwError = __nccwpck_require__(622); +const invalidArgumentsError = __nccwpck_require__(4955); +const quotasExceededError = __nccwpck_require__(9710); +const types = __nccwpck_require__(5994); +class InvalidRequestMapper { + static fromJSON(status, obj) { + if (typeof obj.message === "string" && obj.message.toLowerCase().includes("quota exceeded for this resource")) { + return new quotasExceededError.QuotasExceededError(status, obj, [ + { + current: 0, + quota: 0, + resource: typeof obj.resource === "string" ? obj.resource : "" + } + ]); + } + const fields = obj.fields && types.isRecordOfStringArray(obj.fields) ? obj.fields : {}; + const fieldsMessages = Object.entries(fields); + if (fieldsMessages.length) { + return new invalidArgumentsError.InvalidArgumentsError( + status, + obj, + fieldsMessages.map( + ([argumentName, messages]) => messages.map((helpMessage) => ({ + argumentName, + helpMessage, + reason: "constraint" + })) + ).flat() + ); + } + return new scwError.ScalewayError(status, obj); } - return { - gateways: unmarshalArrayOfObject(data.gateways, unmarshalGateway), - totalCount: data.total_count - }; +} +exports.InvalidRequestMapper = InvalidRequestMapper; + + +/***/ }), + +/***/ 6601: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const stringValidation = __nccwpck_require__(1556); +const scwError = __nccwpck_require__(622); +const resourceNotFoundError = __nccwpck_require__(1146); +class UnknownResourceMapper { + static fromJSON(status, obj) { + const messageParts = typeof obj.message === "string" ? obj.message.split(/"|'/) : []; + if (messageParts.length === 3 && stringValidation.isUUID(messageParts[1])) { + return new resourceNotFoundError.ResourceNotFoundError( + status, + obj, + // transform `Security group ` to `security_group` + // `.replaceAll()` may be too recent to use yet. + // that's why we're using `.split(' ').join('_')` for now. + messageParts[0].trim().toLowerCase().split(" ").join("_"), + messageParts[1] + ); + } + return new scwError.ScalewayError(status, obj); + } +} +exports.UnknownResourceMapper = UnknownResourceMapper; + + +/***/ }), + +/***/ 622: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const json = __nccwpck_require__(3746); +const types = __nccwpck_require__(5994); +const buildDefaultMessage = (status, body) => { + const message = [`http error ${status}`]; + if (typeof body === "string") { + message.push(body); + } else if (json.isJSONObject(body)) { + if (typeof body.resource === "string") { + message.push(`resource ${body.resource}`); + } + if (typeof body.message === "string") { + message.push(body.message); + } + if (body.fields && types.isRecordOfStringArray(body.fields)) { + message.push( + Object.entries(body.fields).map(([name, list]) => `${name} (${list.join(", ")})`).join(", ") + ); + } + } + return message.join(": "); }; -const unmarshalListIPsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListIPsResponse' failed as data isn't a dictionary.`); +class ScalewayError extends Error { + constructor(status, body, message = buildDefaultMessage(status, body)) { + super(message); + this.status = status; + this.body = body; + this.message = message; + this.name = "ScalewayError"; + this.rawMessage = typeof body === "object" && typeof body.message === "string" ? body.message : void 0; + Object.setPrototypeOf(this, new.target.prototype); + } + /** The message originating from the payload. */ + rawMessage; + static fromJSON(status, obj) { + return new ScalewayError(status, obj); + } + toString() { + return `${this.name}: ${this.message}`; + } +} +exports.ScalewayError = ScalewayError; + + +/***/ }), + +/***/ 7100: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const scwError = __nccwpck_require__(622); +class AlreadyExistsError extends scwError.ScalewayError { + constructor(status, body, resource, resourceId, helpMessage) { + super( + status, + body, + `resource ${resource} with ID ${resourceId} already exists: ${helpMessage}` + ); + this.status = status; + this.body = body; + this.resource = resource; + this.resourceId = resourceId; + this.helpMessage = helpMessage; + this.name = "AlreadyExistsError"; + } + static fromJSON(status, obj) { + if (typeof obj.resource !== "string" || typeof obj.resource_id !== "string" || typeof obj.help_message !== "string") { + return null; + } + return new AlreadyExistsError( + status, + obj, + obj.resource, + obj.resource_id, + obj.help_message + ); } - return { - ips: unmarshalArrayOfObject(data.ips, unmarshalIP), - totalCount: data.total_count - }; -}; -const unmarshalListPATRulesResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListPATRulesResponse' failed as data isn't a dictionary.`); +} +exports.AlreadyExistsError = AlreadyExistsError; + + +/***/ }), + +/***/ 7399: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const scwError = __nccwpck_require__(622); +const buildMessage = (method, reason) => { + let reasonDesc; + switch (reason) { + case "invalid_argument": + reasonDesc = `invalid ${method} format or empty value`; + break; + case "not_found": + reasonDesc = `${method} does not exist`; + break; + case "expired": + reasonDesc = `${method} is expired`; + break; + default: + reasonDesc = `unknown reason for ${method}`; } - return { - patRules: unmarshalArrayOfObject(data.pat_rules, unmarshalPATRule), - totalCount: data.total_count - }; + return `denied authentication: ${reasonDesc}`; }; -const unmarshalSetDHCPEntriesResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'SetDHCPEntriesResponse' failed as data isn't a dictionary.`); +class DeniedAuthenticationError extends scwError.ScalewayError { + constructor(status, body, method, reason) { + super(status, body, buildMessage(method, reason)); + this.status = status; + this.body = body; + this.method = method; + this.reason = reason; + this.name = "DeniedAuthenticationError"; } - return { - dhcpEntries: unmarshalArrayOfObject(data.dhcp_entries, unmarshalDHCPEntry) - }; -}; -const unmarshalSetPATRulesResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'SetPATRulesResponse' failed as data isn't a dictionary.`); + static fromJSON(status, obj) { + if (typeof obj.method !== "string" || typeof obj.reason !== "string") { + return null; + } + return new DeniedAuthenticationError(status, obj, obj.method, obj.reason); } - return { - patRules: unmarshalArrayOfObject(data.pat_rules, unmarshalPATRule) - }; -}; -const marshalCreateDHCPRequest = (request, defaults) => ({ - address: request.address, - dns_local_name: request.dnsLocalName, - dns_search: request.dnsSearch, - dns_servers_override: request.dnsServersOverride, - enable_dynamic: request.enableDynamic, - pool_high: request.poolHigh, - pool_low: request.poolLow, - project_id: request.projectId ?? defaults.defaultProjectId, - push_default_route: request.pushDefaultRoute, - push_dns_server: request.pushDnsServer, - rebind_timer: request.rebindTimer, - renew_timer: request.renewTimer, - subnet: request.subnet, - valid_lifetime: request.validLifetime -}); -const marshalIpamConfig = (request, defaults) => ({ - push_default_route: request.pushDefaultRoute -}); -const marshalSetDHCPEntriesRequestEntry = (request, defaults) => ({ - ip_address: request.ipAddress, - mac_address: request.macAddress -}); -const marshalSetPATRulesRequestRule = (request, defaults) => ({ - private_ip: request.privateIp, - private_port: request.privatePort, - protocol: request.protocol, - public_port: request.publicPort -}); -const marshalCreateDHCPEntryRequest = (request, defaults) => ({ - gateway_network_id: request.gatewayNetworkId, - ip_address: request.ipAddress, - mac_address: request.macAddress -}); -const marshalCreateGatewayNetworkRequest = (request, defaults) => ({ - enable_dhcp: request.enableDhcp, - enable_masquerade: request.enableMasquerade, - gateway_id: request.gatewayId, - private_network_id: request.privateNetworkId, - ...resolveOneOf([{ - param: 'dhcp_id', - value: request.dhcpId - }, { - param: 'dhcp', - value: request.dhcp ? marshalCreateDHCPRequest(request.dhcp, defaults) : undefined - }, { - param: 'address', - value: request.address - }, { - param: 'ipam_config', - value: request.ipamConfig ? marshalIpamConfig(request.ipamConfig) : undefined - }]) -}); -const marshalCreateGatewayRequest = (request, defaults) => ({ - bastion_port: request.bastionPort, - enable_bastion: request.enableBastion, - enable_smtp: request.enableSmtp, - ip_id: request.ipId, - name: request.name || randomName('gw'), - project_id: request.projectId ?? defaults.defaultProjectId, - tags: request.tags, - type: request.type, - upstream_dns_servers: request.upstreamDnsServers -}); -const marshalCreateIPRequest = (request, defaults) => ({ - project_id: request.projectId ?? defaults.defaultProjectId, - tags: request.tags -}); -const marshalCreatePATRuleRequest = (request, defaults) => ({ - gateway_id: request.gatewayId, - private_ip: request.privateIp, - private_port: request.privatePort, - protocol: request.protocol ?? 'unknown', - public_port: request.publicPort -}); -const marshalSetDHCPEntriesRequest = (request, defaults) => ({ - dhcp_entries: request.dhcpEntries ? request.dhcpEntries.map(elt => marshalSetDHCPEntriesRequestEntry(elt)) : undefined, - gateway_network_id: request.gatewayNetworkId -}); -const marshalSetPATRulesRequest = (request, defaults) => ({ - gateway_id: request.gatewayId, - pat_rules: request.patRules.map(elt => marshalSetPATRulesRequestRule(elt)) -}); -const marshalUpdateDHCPEntryRequest = (request, defaults) => ({ - ip_address: request.ipAddress -}); -const marshalUpdateDHCPRequest = (request, defaults) => ({ - address: request.address, - dns_local_name: request.dnsLocalName, - dns_search: request.dnsSearch, - dns_servers_override: request.dnsServersOverride, - enable_dynamic: request.enableDynamic, - pool_high: request.poolHigh, - pool_low: request.poolLow, - push_default_route: request.pushDefaultRoute, - push_dns_server: request.pushDnsServer, - rebind_timer: request.rebindTimer, - renew_timer: request.renewTimer, - subnet: request.subnet, - valid_lifetime: request.validLifetime -}); -const marshalUpdateGatewayNetworkRequest = (request, defaults) => ({ - enable_dhcp: request.enableDhcp, - enable_masquerade: request.enableMasquerade, - ...resolveOneOf([{ - param: 'dhcp_id', - value: request.dhcpId - }, { - param: 'address', - value: request.address - }, { - param: 'ipam_config', - value: request.ipamConfig ? marshalIpamConfig(request.ipamConfig) : undefined - }]) -}); -const marshalUpdateGatewayRequest = (request, defaults) => ({ - bastion_port: request.bastionPort, - enable_bastion: request.enableBastion, - enable_smtp: request.enableSmtp, - name: request.name, - tags: request.tags, - upstream_dns_servers: request.upstreamDnsServers -}); -const marshalUpdateIPRequest = (request, defaults) => ({ - gateway_id: request.gatewayId, - reverse: request.reverse, - tags: request.tags -}); -const marshalUpdatePATRuleRequest = (request, defaults) => ({ - private_ip: request.privateIp, - private_port: request.privatePort, - protocol: request.protocol ?? 'unknown', - public_port: request.publicPort -}); +} +exports.DeniedAuthenticationError = DeniedAuthenticationError; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const jsonContentHeaders$1 = { - 'Content-Type': 'application/json; charset=utf-8' -}; -/** Public Gateways API. */ -let API$1 = class API extends API$u { - /** Lists the available zones of the API. */ - static LOCALITIES = ['fr-par-1', 'fr-par-2', 'nl-ams-1', 'nl-ams-2', 'nl-ams-3', 'pl-waw-1', 'pl-waw-2']; - pageOfListGateways = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateways`, - urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['private_network_id', request.privateNetworkId], ['project_id', request.projectId], ['status', request.status ?? 'unknown'], ['tags', request.tags], ['type', request.type]) - }, unmarshalListGatewaysResponse); +/***/ }), - /** - * List Public Gateways. List Public Gateways in a given Scaleway Organization - * or Project. By default, results are displayed in ascending order of - * creation date. - * - * @param request - The request {@link ListGatewaysRequest} - * @returns A Promise of ListGatewaysResponse - */ - listGateways = (request = {}) => enrichForPagination('gateways', this.pageOfListGateways, request); +/***/ 4156: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - /** - * Get a Public Gateway. Get details of a Public Gateway, specified by its - * gateway ID. The response object contains full details of the gateway, - * including its **name**, **type**, **status** and more. - * - * @param request - The request {@link GetGatewayRequest} - * @returns A Promise of Gateway - */ - getGateway = request => this.client.fetch({ - method: 'GET', - path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam('gatewayId', request.gatewayId)}` - }, unmarshalGateway); +"use strict"; - /** - * Waits for {@link Gateway} to be in a final state. - * - * @param request - The request {@link GetGatewayRequest} - * @param options - The waiting options - * @returns A Promise of Gateway - */ - waitForGateway = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!GATEWAY_TRANSIENT_STATUSES.includes(res.status))), this.getGateway, request, options); +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const scwError = __nccwpck_require__(622); +const alreadyExistsError = __nccwpck_require__(7100); +const deniedAuthenticationError = __nccwpck_require__(7399); +const invalidArgumentsError = __nccwpck_require__(4955); +const outOfStockError = __nccwpck_require__(526); +const permissionsDeniedError = __nccwpck_require__(8173); +const preconditionFailedError = __nccwpck_require__(1721); +const quotasExceededError = __nccwpck_require__(9710); +const resourceExpiredError = __nccwpck_require__(7293); +const resourceLockedError = __nccwpck_require__(8954); +const resourceNotFoundError = __nccwpck_require__(1146); +const tooManyRequestsError = __nccwpck_require__(2668); +const transientStateError = __nccwpck_require__(3995); +exports.ScalewayError = scwError.ScalewayError; +exports.AlreadyExistsError = alreadyExistsError.AlreadyExistsError; +exports.DeniedAuthenticationError = deniedAuthenticationError.DeniedAuthenticationError; +exports.InvalidArgumentsError = invalidArgumentsError.InvalidArgumentsError; +exports.OutOfStockError = outOfStockError.OutOfStockError; +exports.PermissionsDeniedError = permissionsDeniedError.PermissionsDeniedError; +exports.PreconditionFailedError = preconditionFailedError.PreconditionFailedError; +exports.QuotasExceededError = quotasExceededError.QuotasExceededError; +exports.ResourceExpiredError = resourceExpiredError.ResourceExpiredError; +exports.ResourceLockedError = resourceLockedError.ResourceLockedError; +exports.ResourceNotFoundError = resourceNotFoundError.ResourceNotFoundError; +exports.TooManyRequestsError = tooManyRequestsError.TooManyRequestsError; +exports.TransientStateError = transientStateError.TransientStateError; - /** - * Create a Public Gateway. Create a new Public Gateway in the specified - * Scaleway Project, defining its **name**, **type** and other configuration - * details such as whether to enable SSH bastion. - * - * @param request - The request {@link CreateGatewayRequest} - * @returns A Promise of Gateway - */ - createGateway = request => this.client.fetch({ - body: JSON.stringify(marshalCreateGatewayRequest(request, this.client.settings)), - headers: jsonContentHeaders$1, - method: 'POST', - path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateways` - }, unmarshalGateway); - /** - * Update a Public Gateway. Update the parameters of an existing Public - * Gateway, for example, its **name**, **tags**, **SSH bastion - * configuration**, and **DNS servers**. - * - * @param request - The request {@link UpdateGatewayRequest} - * @returns A Promise of Gateway - */ - updateGateway = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateGatewayRequest(request, this.client.settings)), - headers: jsonContentHeaders$1, - method: 'PATCH', - path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam('gatewayId', request.gatewayId)}` - }, unmarshalGateway); +/***/ }), - /** - * Delete a Public Gateway. Delete an existing Public Gateway, specified by - * its gateway ID. This action is irreversible. - * - * @param request - The request {@link DeleteGatewayRequest} - */ - deleteGateway = request => this.client.fetch({ - method: 'DELETE', - path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam('gatewayId', request.gatewayId)}`, - urlParams: urlParams(['cleanup_dhcp', request.cleanupDhcp]) - }); +/***/ 4955: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - /** - * Upgrade a Public Gateway to the latest version. Upgrade a given Public - * Gateway to the newest software version. This applies the latest bugfixes - * and features to your Public Gateway, but its service will be interrupted - * during the update. - * - * @param request - The request {@link UpgradeGatewayRequest} - * @returns A Promise of Gateway - */ - upgradeGateway = request => this.client.fetch({ - body: '{}', - headers: jsonContentHeaders$1, - method: 'POST', - path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam('gatewayId', request.gatewayId)}/upgrade` - }, unmarshalGateway); - pageOfListGatewayNetworks = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateway-networks`, - urlParams: urlParams(['dhcp_id', request.dhcpId], ['enable_masquerade', request.enableMasquerade], ['gateway_id', request.gatewayId], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['private_network_id', request.privateNetworkId], ['status', request.status ?? 'unknown']) - }, unmarshalListGatewayNetworksResponse); +"use strict"; - /** - * List Public Gateway connections to Private Networks. List the connections - * between Public Gateways and Private Networks (a connection = a - * GatewayNetwork). You can choose to filter by `gateway-id` to list all - * Private Networks attached to the specified Public Gateway, or by - * `private_network_id` to list all Public Gateways attached to the specified - * Private Network. Other query parameters are also available. The result is - * an array of GatewayNetwork objects, each giving details of the connection - * between a given Public Gateway and a given Private Network. - * - * @param request - The request {@link ListGatewayNetworksRequest} - * @returns A Promise of ListGatewayNetworksResponse - */ - listGatewayNetworks = (request = {}) => enrichForPagination('gatewayNetworks', this.pageOfListGatewayNetworks, request); +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const json = __nccwpck_require__(3746); +const scwError = __nccwpck_require__(622); +const buildMessage = (list) => { + const invalidArgs = list.reduce((acc, details) => { + let readableReason = ""; + switch (details.reason) { + case "required": + readableReason = `is required`; + break; + case "format": + readableReason = `is wrongly formatted`; + break; + case "constraint": + readableReason = `does not respect constraint`; + break; + default: + readableReason = `is invalid for unexpected reason`; + break; + } + if (details.helpMessage && details.helpMessage.length > 0) { + readableReason = readableReason.concat(`, `, details.helpMessage); + } + acc.push(`${details.argumentName} ${readableReason}`); + return acc; + }, []); + return `invalid argument(s): ${invalidArgs.join("; ")}`; +}; +class InvalidArgumentsError extends scwError.ScalewayError { + constructor(status, body, details) { + super(status, body, buildMessage(details)); + this.status = status; + this.body = body; + this.details = details; + this.name = "InvalidArgumentsError"; + } + static fromJSON(status, obj) { + if (!Array.isArray(obj.details)) return null; + return new InvalidArgumentsError( + status, + obj, + obj.details.reduce( + (list, detail) => json.isJSONObject(detail) && typeof detail.argument_name === "string" && typeof detail.reason === "string" ? list.concat({ + argumentName: detail.argument_name, + helpMessage: typeof detail.help_message === "string" ? detail.help_message : void 0, + reason: detail.reason + }) : list, + [] + ) + ); + } +} +exports.InvalidArgumentsError = InvalidArgumentsError; + + +/***/ }), + +/***/ 526: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - /** - * Get a Public Gateway connection to a Private Network. Get details of a - * given connection between a Public Gateway and a Private Network (this - * connection = a GatewayNetwork), specified by its `gateway_network_id`. The - * response object contains details of the connection including the IDs of the - * Public Gateway and Private Network, the dates the connection was - * created/updated and its configuration settings. - * - * @param request - The request {@link GetGatewayNetworkRequest} - * @returns A Promise of GatewayNetwork - */ - getGatewayNetwork = request => this.client.fetch({ - method: 'GET', - path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateway-networks/${validatePathParam('gatewayNetworkId', request.gatewayNetworkId)}` - }, unmarshalGatewayNetwork); +"use strict"; - /** - * Waits for {@link GatewayNetwork} to be in a final state. - * - * @param request - The request {@link GetGatewayNetworkRequest} - * @param options - The waiting options - * @returns A Promise of GatewayNetwork - */ - waitForGatewayNetwork = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!GATEWAY_NETWORK_TRANSIENT_STATUSES.includes(res.status))), this.getGatewayNetwork, request, options); +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const scwError = __nccwpck_require__(622); +class OutOfStockError extends scwError.ScalewayError { + constructor(status, body, resource) { + super(status, body, `resource ${resource} is out of stock`); + this.status = status; + this.body = body; + this.resource = resource; + this.name = "OutOfStockError"; + } + static fromJSON(status, obj) { + if (typeof obj.resource !== "string") return null; + return new OutOfStockError(status, obj, obj.resource); + } +} +exports.OutOfStockError = OutOfStockError; - /** - * Attach a Public Gateway to a Private Network. Attach a specific Public - * Gateway to a specific Private Network (create a GatewayNetwork). You can - * configure parameters for the connection including DHCP settings, whether to - * enable masquerade (dynamic NAT), and more. - * - * @param request - The request {@link CreateGatewayNetworkRequest} - * @returns A Promise of GatewayNetwork - */ - createGatewayNetwork = request => this.client.fetch({ - body: JSON.stringify(marshalCreateGatewayNetworkRequest(request, this.client.settings)), - headers: jsonContentHeaders$1, - method: 'POST', - path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateway-networks` - }, unmarshalGatewayNetwork); - /** - * Update a Public Gateway's connection to a Private Network. Update the - * configuration parameters of a connection between a given Public Gateway and - * Private Network (the connection = a GatewayNetwork). Updatable parameters - * include DHCP settings and whether to enable traffic masquerade (dynamic - * NAT). - * - * @param request - The request {@link UpdateGatewayNetworkRequest} - * @returns A Promise of GatewayNetwork - */ - updateGatewayNetwork = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateGatewayNetworkRequest(request, this.client.settings)), - headers: jsonContentHeaders$1, - method: 'PATCH', - path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateway-networks/${validatePathParam('gatewayNetworkId', request.gatewayNetworkId)}` - }, unmarshalGatewayNetwork); +/***/ }), - /** - * Detach a Public Gateway from a Private Network. Detach a given Public - * Gateway from a given Private Network, i.e. delete a GatewayNetwork - * specified by a gateway_network_id. - * - * @param request - The request {@link DeleteGatewayNetworkRequest} - */ - deleteGatewayNetwork = request => this.client.fetch({ - method: 'DELETE', - path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateway-networks/${validatePathParam('gatewayNetworkId', request.gatewayNetworkId)}`, - urlParams: urlParams(['cleanup_dhcp', request.cleanupDhcp]) - }); - pageOfListDHCPs = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/dhcps`, - urlParams: urlParams(['address', request.address], ['has_address', request.hasAddress], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId]) - }, unmarshalListDHCPsResponse); +/***/ 8173: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - /** - * List DHCP configurations. List DHCP configurations, optionally filtering by - * Organization, Project, Public Gateway IP address or more. The response is - * an array of DHCP configuration objects, each identified by a DHCP ID and - * containing configuration settings for the assignment of IP addresses to - * devices on a Private Network attached to a Public Gateway. Note that the - * response does not contain the IDs of any Private Network / Public Gateway - * the configuration is attached to. Use the `List Public Gateway connections - * to Private Networks` method for that purpose, filtering on DHCP ID. - * - * @param request - The request {@link ListDHCPsRequest} - * @returns A Promise of ListDHCPsResponse - */ - listDHCPs = (request = {}) => enrichForPagination('dhcps', this.pageOfListDHCPs, request); +"use strict"; - /** - * Get a DHCP configuration. Get a DHCP configuration object, identified by - * its DHCP ID. The response object contains configuration settings for the - * assignment of IP addresses to devices on a Private Network attached to a - * Public Gateway. Note that the response does not contain the IDs of any - * Private Network / Public Gateway the configuration is attached to. Use the - * `List Public Gateway connections to Private Networks` method for that - * purpose, filtering on DHCP ID. - * - * @param request - The request {@link GetDHCPRequest} - * @returns A Promise of DHCP - */ - getDHCP = request => this.client.fetch({ - method: 'GET', - path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/dhcps/${validatePathParam('dhcpId', request.dhcpId)}` - }, unmarshalDHCP); +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const json = __nccwpck_require__(3746); +const scwError = __nccwpck_require__(622); +const buildMessage = (list) => `insufficient permissions: ${list.map(({ action, resource }) => `${action} ${resource}`).join("; ")}`; +class PermissionsDeniedError extends scwError.ScalewayError { + constructor(status, body, list) { + super(status, body, buildMessage(list)); + this.status = status; + this.body = body; + this.list = list; + this.name = "PermissionsDeniedError"; + } + static fromJSON(status, obj) { + if (!Array.isArray(obj.details)) return null; + return new PermissionsDeniedError( + status, + obj, + obj.details.reduce( + (list, detail) => json.isJSONObject(detail) && typeof detail.resource === "string" && typeof detail.action === "string" ? list.concat({ + action: detail.action, + resource: detail.resource + }) : list, + [] + ) + ); + } +} +exports.PermissionsDeniedError = PermissionsDeniedError; - /** - * Create a DHCP configuration. Create a new DHCP configuration object, - * containing settings for the assignment of IP addresses to devices on a - * Private Network attached to a Public Gateway. The response object includes - * the ID of the DHCP configuration object. You can use this ID as part of a - * call to `Create a Public Gateway connection to a Private Network` or - * `Update a Public Gateway connection to a Private Network` to directly apply - * this DHCP configuration. - * - * @param request - The request {@link CreateDHCPRequest} - * @returns A Promise of DHCP - */ - createDHCP = request => this.client.fetch({ - body: JSON.stringify(marshalCreateDHCPRequest(request, this.client.settings)), - headers: jsonContentHeaders$1, - method: 'POST', - path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/dhcps` - }, unmarshalDHCP); - /** - * Update a DHCP configuration. Update a DHCP configuration object, identified - * by its DHCP ID. - * - * @param request - The request {@link UpdateDHCPRequest} - * @returns A Promise of DHCP - */ - updateDHCP = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateDHCPRequest(request, this.client.settings)), - headers: jsonContentHeaders$1, - method: 'PATCH', - path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/dhcps/${validatePathParam('dhcpId', request.dhcpId)}` - }, unmarshalDHCP); +/***/ }), - /** - * Delete a DHCP configuration. Delete a DHCP configuration object, identified - * by its DHCP ID. Note that you cannot delete a DHCP configuration object - * that is currently being used by a Gateway Network. - * - * @param request - The request {@link DeleteDHCPRequest} - */ - deleteDHCP = request => this.client.fetch({ - method: 'DELETE', - path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/dhcps/${validatePathParam('dhcpId', request.dhcpId)}` - }); - pageOfListDHCPEntries = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/dhcp-entries`, - urlParams: urlParams(['gateway_network_id', request.gatewayNetworkId], ['hostname', request.hostname], ['ip_address', request.ipAddress], ['mac_address', request.macAddress], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['type', request.type ?? 'unknown']) - }, unmarshalListDHCPEntriesResponse); +/***/ 1721: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - /** - * List DHCP entries. List DHCP entries, whether dynamically assigned and/or - * statically reserved. DHCP entries can be filtered by the Gateway Network - * they are on, their MAC address, IP address, type or hostname. - * - * @param request - The request {@link ListDHCPEntriesRequest} - * @returns A Promise of ListDHCPEntriesResponse - */ - listDHCPEntries = (request = {}) => enrichForPagination('dhcpEntries', this.pageOfListDHCPEntries, request); +"use strict"; - /** - * Get a DHCP entry. Get a DHCP entry, specified by its DHCP entry ID. - * - * @param request - The request {@link GetDHCPEntryRequest} - * @returns A Promise of DHCPEntry - */ - getDHCPEntry = request => this.client.fetch({ - method: 'GET', - path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/dhcp-entries/${validatePathParam('dhcpEntryId', request.dhcpEntryId)}` - }, unmarshalDHCPEntry); +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const scwError = __nccwpck_require__(622); +const buildMessage = (precondition, helpMessage) => { + let message = `precondition failed: ${precondition}`; + if (typeof helpMessage === "string" && helpMessage.length > 0) { + message = message.concat(", ", helpMessage); + } + return message; +}; +class PreconditionFailedError extends scwError.ScalewayError { + constructor(status, body, precondition, helpMessage) { + super(status, body, buildMessage(precondition, helpMessage)); + this.status = status; + this.body = body; + this.precondition = precondition; + this.helpMessage = helpMessage; + this.name = "PreconditionFailedError"; + } + static fromJSON(status, obj) { + if (typeof obj.precondition !== "string" || typeof obj.help_message !== "string") { + return null; + } + return new PreconditionFailedError( + status, + obj, + obj.precondition, + obj.help_message + ); + } +} +exports.PreconditionFailedError = PreconditionFailedError; - /** - * Create a DHCP entry. Create a static DHCP reservation, specifying the - * Gateway Network for the reservation, the MAC address of the target device - * and the IP address to assign this device. The response is a DHCP entry - * object, confirming the ID and configuration details of the static DHCP - * reservation. - * - * @param request - The request {@link CreateDHCPEntryRequest} - * @returns A Promise of DHCPEntry - */ - createDHCPEntry = request => this.client.fetch({ - body: JSON.stringify(marshalCreateDHCPEntryRequest(request, this.client.settings)), - headers: jsonContentHeaders$1, - method: 'POST', - path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/dhcp-entries` - }, unmarshalDHCPEntry); - /** - * Update a DHCP entry. Update the IP address for a DHCP entry, specified by - * its DHCP entry ID. You can update an existing DHCP entry of any type - * (`reservation` (static), `lease` (dynamic) or `unknown`), but in manually - * updating the IP address the entry will necessarily be of type `reservation` - * after the update. - * - * @param request - The request {@link UpdateDHCPEntryRequest} - * @returns A Promise of DHCPEntry - */ - updateDHCPEntry = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateDHCPEntryRequest(request, this.client.settings)), - headers: jsonContentHeaders$1, - method: 'PATCH', - path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/dhcp-entries/${validatePathParam('dhcpEntryId', request.dhcpEntryId)}` - }, unmarshalDHCPEntry); +/***/ }), - /** - * Set all DHCP reservations on a Gateway Network. Set the list of DHCP - * reservations attached to a Gateway Network. Reservations are identified by - * their MAC address, and will sync the current DHCP entry list to the given - * list, creating, updating or deleting DHCP entries accordingly. - * - * @param request - The request {@link SetDHCPEntriesRequest} - * @returns A Promise of SetDHCPEntriesResponse - */ - setDHCPEntries = request => this.client.fetch({ - body: JSON.stringify(marshalSetDHCPEntriesRequest(request, this.client.settings)), - headers: jsonContentHeaders$1, - method: 'PUT', - path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/dhcp-entries` - }, unmarshalSetDHCPEntriesResponse); +/***/ 9710: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - /** - * Delete a DHCP entry. Delete a static DHCP reservation, identified by its - * DHCP entry ID. Note that you cannot delete DHCP entries of type `lease`, - * these are deleted automatically when their time-to-live expires. - * - * @param request - The request {@link DeleteDHCPEntryRequest} - */ - deleteDHCPEntry = request => this.client.fetch({ - method: 'DELETE', - path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/dhcp-entries/${validatePathParam('dhcpEntryId', request.dhcpEntryId)}` - }); - pageOfListPATRules = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/pat-rules`, - urlParams: urlParams(['gateway_id', request.gatewayId], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['private_ip', request.privateIp], ['protocol', request.protocol ?? 'unknown']) - }, unmarshalListPATRulesResponse); +"use strict"; - /** - * List PAT rules. List PAT rules. You can filter by gateway ID to list all - * PAT rules for a particular gateway, or filter for PAT rules targeting a - * specific IP address or using a specific protocol. - * - * @param request - The request {@link ListPATRulesRequest} - * @returns A Promise of ListPATRulesResponse - */ - listPATRules = (request = {}) => enrichForPagination('patRules', this.pageOfListPATRules, request); +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const json = __nccwpck_require__(3746); +const scwError = __nccwpck_require__(622); +const buildMessage = (list) => `quota(s) exceeded: ${list.map((details) => { + const message = `${details.resource} has reached its quota (${details.current}/${details.quota})`; + return details.scope ? `${message} for ${details.scope.kind} '${details.scope.id}'` : message; +}).join("; ")}`; +const buildScope = (detail) => { + if (typeof detail.organization_id === "string" && detail.organization_id.length) { + return { id: detail.organization_id, kind: "organization" }; + } + if (typeof detail.project_id === "string" && detail.project_id.length) { + return { id: detail.project_id, kind: "project" }; + } + return void 0; +}; +class QuotasExceededError extends scwError.ScalewayError { + constructor(status, body, list) { + super(status, body, buildMessage(list)); + this.status = status; + this.body = body; + this.list = list; + this.name = "QuotasExceededError"; + } + static fromJSON(status, obj) { + if (!Array.isArray(obj.details)) return null; + return new QuotasExceededError( + status, + obj, + obj.details.reduce( + (list, detail) => json.isJSONObject(detail) && typeof detail.resource === "string" && typeof detail.quota === "number" && typeof detail.current === "number" ? list.concat({ + current: detail.current, + quota: detail.quota, + resource: detail.resource, + scope: buildScope(detail) + }) : list, + [] + ) + ); + } +} +exports.QuotasExceededError = QuotasExceededError; - /** - * Get a PAT rule. Get a PAT rule, specified by its PAT rule ID. The response - * object gives full details of the PAT rule, including the Public Gateway it - * belongs to and the configuration settings in terms of public / private - * ports, private IP and protocol. - * - * @param request - The request {@link GetPATRuleRequest} - * @returns A Promise of PATRule - */ - getPATRule = request => this.client.fetch({ - method: 'GET', - path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/pat-rules/${validatePathParam('patRuleId', request.patRuleId)}` - }, unmarshalPATRule); - /** - * Create a PAT rule. Create a new PAT rule on a specified Public Gateway, - * defining the protocol to use, public port to listen on, and private port / - * IP address to map to. - * - * @param request - The request {@link CreatePATRuleRequest} - * @returns A Promise of PATRule - */ - createPATRule = request => this.client.fetch({ - body: JSON.stringify(marshalCreatePATRuleRequest(request, this.client.settings)), - headers: jsonContentHeaders$1, - method: 'POST', - path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/pat-rules` - }, unmarshalPATRule); +/***/ }), - /** - * Update a PAT rule. Update a PAT rule, specified by its PAT rule ID. - * Configuration settings including private/public port, private IP address - * and protocol can all be updated. - * - * @param request - The request {@link UpdatePATRuleRequest} - * @returns A Promise of PATRule - */ - updatePATRule = request => this.client.fetch({ - body: JSON.stringify(marshalUpdatePATRuleRequest(request, this.client.settings)), - headers: jsonContentHeaders$1, - method: 'PATCH', - path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/pat-rules/${validatePathParam('patRuleId', request.patRuleId)}` - }, unmarshalPATRule); +/***/ 7293: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const scwError = __nccwpck_require__(622); +class ResourceExpiredError extends scwError.ScalewayError { + constructor(status, body, resource, resourceId, expiredSince) { + super( + status, + body, + `resource ${resource} with ID ${resourceId} expired since ${expiredSince.toISOString()}` + ); + this.status = status; + this.body = body; + this.resource = resource; + this.resourceId = resourceId; + this.expiredSince = expiredSince; + this.name = "ResourceExpiredError"; + } + static fromJSON(status, obj) { + if (typeof obj.resource !== "string" || typeof obj.resource_id !== "string" || typeof obj.expired_since !== "string") { + return null; + } + return new ResourceExpiredError( + status, + obj, + obj.resource, + obj.resource_id, + new Date(obj.expired_since) + ); + } +} +exports.ResourceExpiredError = ResourceExpiredError; - /** - * Set all PAT rules. Set a definitive list of PAT rules attached to a Public - * Gateway. Each rule is identified by its public port and protocol. This will - * sync the current PAT rule list on the gateway with the new list, creating, - * updating or deleting PAT rules accordingly. - * - * @param request - The request {@link SetPATRulesRequest} - * @returns A Promise of SetPATRulesResponse - */ - setPATRules = request => this.client.fetch({ - body: JSON.stringify(marshalSetPATRulesRequest(request, this.client.settings)), - headers: jsonContentHeaders$1, - method: 'PUT', - path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/pat-rules` - }, unmarshalSetPATRulesResponse); - /** - * Delete a PAT rule. Delete a PAT rule, identified by its PAT rule ID. This - * action is irreversible. - * - * @param request - The request {@link DeletePATRuleRequest} - */ - deletePATRule = request => this.client.fetch({ - method: 'DELETE', - path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/pat-rules/${validatePathParam('patRuleId', request.patRuleId)}` - }); +/***/ }), - /** - * List Public Gateway types. List the different Public Gateway commercial - * offer types available at Scaleway. The response is an array of objects - * describing the name and technical details of each available gateway type. - * - * @param request - The request {@link ListGatewayTypesRequest} - * @returns A Promise of ListGatewayTypesResponse - */ - listGatewayTypes = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateway-types` - }, unmarshalListGatewayTypesResponse); - pageOfListIPs = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips`, - urlParams: urlParams(['is_free', request.isFree], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId], ['reverse', request.reverse], ['tags', request.tags]) - }, unmarshalListIPsResponse); +/***/ 8954: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - /** - * List IPs. List Public Gateway flexible IP addresses. A number of filter - * options are available for limiting results in the response. - * - * @param request - The request {@link ListIPsRequest} - * @returns A Promise of ListIPsResponse - */ - listIPs = (request = {}) => enrichForPagination('ips', this.pageOfListIPs, request); +"use strict"; - /** - * Get an IP. Get details of a Public Gateway flexible IP address, identified - * by its IP ID. The response object contains information including which (if - * any) Public Gateway using this IP address, the reverse and various other - * metadata. - * - * @param request - The request {@link GetIPRequest} - * @returns A Promise of IP - */ - getIP = request => this.client.fetch({ - method: 'GET', - path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam('ipId', request.ipId)}` - }, unmarshalIP); +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const scwError = __nccwpck_require__(622); +class ResourceLockedError extends scwError.ScalewayError { + constructor(status, body, resource, resourceId) { + super(status, body, `resource ${resource} with ID ${resourceId} is locked`); + this.status = status; + this.body = body; + this.resource = resource; + this.resourceId = resourceId; + this.name = "ResourceLockedError"; + } + static fromJSON(status, obj) { + if (typeof obj.resource !== "string" || typeof obj.resource_id !== "string") { + return null; + } + return new ResourceLockedError(status, obj, obj.resource, obj.resource_id); + } +} +exports.ResourceLockedError = ResourceLockedError; - /** - * Reserve an IP. Create (reserve) a new flexible IP address that can be used - * for a Public Gateway in a specified Scaleway Project. - * - * @param request - The request {@link CreateIPRequest} - * @returns A Promise of IP - */ - createIP = (request = {}) => this.client.fetch({ - body: JSON.stringify(marshalCreateIPRequest(request, this.client.settings)), - headers: jsonContentHeaders$1, - method: 'POST', - path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips` - }, unmarshalIP); - /** - * Update an IP. Update details of an existing flexible IP address, including - * its tags, reverse and the Public Gateway it is assigned to. - * - * @param request - The request {@link UpdateIPRequest} - * @returns A Promise of IP - */ - updateIP = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateIPRequest(request, this.client.settings)), - headers: jsonContentHeaders$1, - method: 'PATCH', - path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam('ipId', request.ipId)}` - }, unmarshalIP); +/***/ }), - /** - * Delete an IP. Delete a flexible IP address from your account. This action - * is irreversible. - * - * @param request - The request {@link DeleteIPRequest} - */ - deleteIP = request => this.client.fetch({ - method: 'DELETE', - path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam('ipId', request.ipId)}` - }); +/***/ 1146: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - /** - * Refresh a Public Gateway's SSH keys. Refresh the SSH keys of a given Public - * Gateway, specified by its gateway ID. This adds any new SSH keys in the - * gateway's Scaleway Project to the gateway itself. - * - * @param request - The request {@link RefreshSSHKeysRequest} - * @returns A Promise of Gateway - */ - refreshSSHKeys = request => this.client.fetch({ - body: '{}', - headers: jsonContentHeaders$1, - method: 'POST', - path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam('gatewayId', request.gatewayId)}/refresh-ssh-keys` - }, unmarshalGateway); -}; +"use strict"; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const scwError = __nccwpck_require__(622); +class ResourceNotFoundError extends scwError.ScalewayError { + constructor(status, body, resource, resourceId) { + super( + status, + body, + `resource ${resource} with ID ${resourceId} is not found` + ); + this.status = status; + this.body = body; + this.resource = resource; + this.resourceId = resourceId; + this.name = "ResourceNotFoundError"; + } + static fromJSON(status, obj) { + if (typeof obj.resource !== "string" || typeof obj.resource_id !== "string") { + return null; + } + return new ResourceNotFoundError(status, obj, obj.resource, obj.resource_id); + } +} +exports.ResourceNotFoundError = ResourceNotFoundError; -var index_gen$1 = /*#__PURE__*/Object.freeze({ - __proto__: null, - API: API$1, - GATEWAY_NETWORK_TRANSIENT_STATUSES: GATEWAY_NETWORK_TRANSIENT_STATUSES, - GATEWAY_TRANSIENT_STATUSES: GATEWAY_TRANSIENT_STATUSES -}); -var index$1 = /*#__PURE__*/Object.freeze({ - __proto__: null, - v1: index_gen$1 -}); +/***/ }), -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. +/***/ 2668: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -/** Lists transient statutes of the enum {@link HostingStatus}. */ -const HOSTING_TRANSIENT_STATUSES = ['delivering', 'deleting', 'migrating']; +"use strict"; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const unmarshalHostingCpanelUrls = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'HostingCpanelUrls' failed as data isn't a dictionary.`); +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const json = __nccwpck_require__(3746); +const scwError = __nccwpck_require__(622); +const buildMessage = (helpMessage, limit, resetSeconds, resetAt) => { + const details = []; + if (limit) { + if (limit.windowSeconds) { + details.push(`quota is ${limit.quota} for ${limit.windowSeconds}s`); + } else { + details.push(`quota is ${limit.quota}`); + } } - return { - dashboard: data.dashboard, - webmail: data.webmail - }; -}; -const unmarshalHostingOption = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'HostingOption' failed as data isn't a dictionary.`); + if (resetSeconds) { + details.push(`resets in ${resetSeconds}s`); + } else if (resetAt) { + details.push(`resets at ${resetAt.toISOString()}`); } - return { - id: data.id, - name: data.name - }; -}; -const unmarshalOfferProduct = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'OfferProduct' failed as data isn't a dictionary.`); + let output = `too many requests`; + if (details.length > 0) { + output += ` (${details.join(", ")})`; } - return { - databasesQuota: data.databases_quota, - emailAccountsQuota: data.email_accounts_quota, - emailStorageQuota: data.email_storage_quota, - hostingStorageQuota: data.hosting_storage_quota, - maxAddonDomains: data.max_addon_domains, - name: data.name, - option: data.option, - ram: data.ram, - supportIncluded: data.support_included, - vCpu: data.v_cpu - }; + if (helpMessage.length > 0) { + output += `: ${helpMessage}`; + } + return output; }; -const unmarshalDnsRecord = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'DnsRecord' failed as data isn't a dictionary.`); +class TooManyRequestsError extends scwError.ScalewayError { + constructor(status, body, helpMessage, limit, resetSeconds, resetAt) { + super(status, body, buildMessage(helpMessage, limit, resetSeconds, resetAt)); + this.status = status; + this.body = body; + this.helpMessage = helpMessage; + this.limit = limit; + this.resetSeconds = resetSeconds; + this.resetAt = resetAt; + this.name = "TooManyRequestsError"; } - return { - name: data.name, - priority: data.priority, - status: data.status, - ttl: data.ttl, - type: data.type, - value: data.value - }; + static fromJSON(status, obj) { + if (typeof obj.help_message !== "string") return null; + let limit; + if (json.isJSONObject(obj.limit) && typeof obj.limit.quota === "number") { + limit = { + quota: obj.limit.quota, + windowSeconds: typeof obj.limit.window_seconds === "number" ? obj.limit.window_seconds : void 0 + }; + } + return new TooManyRequestsError( + status, + obj, + obj.help_message, + limit, + typeof obj.reset_seconds === "number" ? obj.reset_seconds : void 0, + typeof obj.reset_at === "string" ? new Date(obj.reset_at) : void 0 + ); + } +} +exports.TooManyRequestsError = TooManyRequestsError; + + +/***/ }), + +/***/ 3995: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const scwError = __nccwpck_require__(622); +class TransientStateError extends scwError.ScalewayError { + constructor(status, body, resource, resourceId, currentState) { + super( + status, + body, + `resource ${resource} with ID ${resourceId} is in a transient state: ${currentState}` + ); + this.status = status; + this.body = body; + this.resource = resource; + this.resourceId = resourceId; + this.currentState = currentState; + this.name = "TransientStateError"; + } + static fromJSON(status, obj) { + if (typeof obj.resource !== "string" || typeof obj.resource_id !== "string" || typeof obj.current_state !== "string") { + return null; + } + return new TransientStateError( + status, + obj, + obj.resource, + obj.resource_id, + obj.current_state + ); + } +} +exports.TransientStateError = TransientStateError; + + +/***/ }), + +/***/ 5994: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const json = __nccwpck_require__(3746); +const isRecordOfStringArray = (obj) => { + if (!json.isJSONObject(obj)) { + return false; + } + for (const elt of Object.values(obj)) { + if (!Array.isArray(elt) || Object.values(elt).find((x) => typeof x !== "string") !== void 0) { + return false; + } + } + return true; }; -const unmarshalHosting = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Hosting' failed as data isn't a dictionary.`); +exports.isRecordOfStringArray = isRecordOfStringArray; + + +/***/ }), + +/***/ 7793: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const isBrowser = __nccwpck_require__(979); +const composer = __nccwpck_require__(3613); +const auth = __nccwpck_require__(6024); +const httpInterceptors = __nccwpck_require__(4342); +const responseParser = __nccwpck_require__(3072); +const buildRequest = (request, settings) => { + let { path } = request; + if (request.urlParams instanceof URLSearchParams) { + path = path.concat(`?${request.urlParams.toString()}`); } - return { - cpanelUrls: data.cpanel_urls ? unmarshalHostingCpanelUrls(data.cpanel_urls) : undefined, - createdAt: unmarshalDate(data.created_at), - dnsStatus: data.dns_status, - domain: data.domain, - id: data.id, - offerEndOfLife: data.offer_end_of_life, - offerId: data.offer_id, - offerName: data.offer_name, - options: unmarshalArrayOfObject(data.options, unmarshalHostingOption), - organizationId: data.organization_id, - platformHostname: data.platform_hostname, - platformNumber: data.platform_number, - projectId: data.project_id, - region: data.region, - status: data.status, - tags: data.tags, - updatedAt: unmarshalDate(data.updated_at), - username: data.username + return new Request(`${settings.apiURL}${path}`, { + body: request.body, + headers: { + Accept: "application/json", + .../* istanbul ignore next */ + !isBrowser.isBrowser() ? { "User-Agent": settings.userAgent } : {}, + ...request.headers + }, + method: request.method + }); +}; +const asIs = (response) => response; +const buildFetcher = (settings, httpClient) => { + let requestNumber = 0; + const prepareRequest = (requestId) => composer.composeRequestInterceptors([ + ...settings.interceptors.map((obj) => obj.request).filter((obj) => obj), + httpInterceptors.logRequest(requestId, httpInterceptors.obfuscateInterceptor(auth.obfuscateAuthHeadersEntry)) + ]); + const prepareResponse = (requestId) => composer.composeResponseInterceptors([ + ...settings.interceptors.map((obj) => obj.response).filter((obj) => obj), + httpInterceptors.logResponse(requestId) + ]); + const prepareResponseErrors = () => composer.composeResponseErrorInterceptors( + settings.interceptors.map((obj) => obj.responseError).filter((obj) => obj) + ); + return async (request, unwrapper = asIs) => { + const requestId = `${requestNumber += 1}`; + const reqInterceptors = prepareRequest(requestId); + const finalRequest = await reqInterceptors(buildRequest(request, settings)); + try { + const response = await httpClient(finalRequest); + const resInterceptors = prepareResponse(requestId); + const finalResponse = await resInterceptors(response); + const resUnmarshaller = responseParser.responseParser( + unwrapper, + request.responseType ?? "json" + ); + const unmarshaledResponse = await resUnmarshaller(finalResponse); + return unmarshaledResponse; + } catch (err) { + const resErrorInterceptors = prepareResponseErrors(); + const handledError = await resErrorInterceptors(finalRequest, err); + return unwrapper(handledError); + } }; }; -const unmarshalNameserver = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Nameserver' failed as data isn't a dictionary.`); +exports.buildFetcher = buildFetcher; +exports.buildRequest = buildRequest; + + +/***/ }), + +/***/ 5541: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const toPascalCase = (str) => str.replace( + /\w+/g, + (word) => `${word[0].toUpperCase()}${word.slice(1).toLowerCase()}` +); +const serializeHeadersEntry = ([name, value]) => `${toPascalCase(name)}: ${value}`; +const serializeHeaders = (headers) => Array.from(headers.entries(), serializeHeadersEntry); +const dumpRequest = async (request) => [ + `${request.method.toUpperCase()}: ${request.url}`, + ...serializeHeaders(request.headers), + await request.clone().text() +].join("\r\n"); +const dumpResponse = async (response) => [ + `HTTP ${response.status} ${response.ok ? "OK" : "NOK"}`, + ...serializeHeaders(response.headers), + await response.clone().text() +].join("\r\n"); +exports.dumpRequest = dumpRequest; +exports.dumpResponse = dumpResponse; + + +/***/ }), + +/***/ 4342: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const index = __nccwpck_require__(3009); +const levelResolver = __nccwpck_require__(2486); +const httpDumper = __nccwpck_require__(5541); +class ObfuscatedRequest extends Request { + constructor(request, obfuscate) { + super(request); + this.request = request; + this.obfuscate = obfuscate; } - return { - hostname: data.hostname, - isDefault: data.is_default, - status: data.status - }; -}; -const unmarshalOffer = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'Offer' failed as data isn't a dictionary.`); + get headers() { + return new Headers(Array.from(this.request.headers, this.obfuscate)); } - return { - available: data.available, - billingOperationPath: data.billing_operation_path, - endOfLife: data.end_of_life, - id: data.id, - price: data.price ? unmarshalMoney(data.price) : undefined, - product: data.product ? unmarshalOfferProduct(data.product) : undefined, - quotaWarnings: data.quota_warnings - }; -}; -const unmarshalDnsRecords = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'DnsRecords' failed as data isn't a dictionary.`); + clone() { + return new ObfuscatedRequest(this.request, this.obfuscate); } - return { - nameServers: unmarshalArrayOfObject(data.name_servers, unmarshalNameserver), - records: unmarshalArrayOfObject(data.records, unmarshalDnsRecord), - status: data.status - }; -}; -const unmarshalListHostingsResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListHostingsResponse' failed as data isn't a dictionary.`); +} +const obfuscateInterceptor = (obfuscate) => ({ request }) => new ObfuscatedRequest(request, obfuscate); +const identity = ({ request }) => request; +const logRequest = (identifier, obfuscate = identity) => async ({ request }) => { + if (levelResolver.shouldLog(levelResolver.LevelResolver[index.getLogger().logLevel], "debug")) { + index.getLogger().debug( + `--------------- Scaleway SDK REQUEST ${identifier} --------------- +${await httpDumper.dumpRequest(await obfuscate({ request }))} +---------------------------------------------------------` + ); } - return { - hostings: unmarshalArrayOfObject(data.hostings, unmarshalHosting), - totalCount: data.total_count - }; + return request; }; -const unmarshalListOffersResponse = data => { - if (!isJSONObject(data)) { - throw new TypeError(`Unmarshalling the type 'ListOffersResponse' failed as data isn't a dictionary.`); +const logResponse = (identifier) => async ({ response }) => { + if (levelResolver.shouldLog(levelResolver.LevelResolver[index.getLogger().logLevel], "debug")) { + index.getLogger().debug( + `--------------- Scaleway SDK RESPONSE ${identifier} --------------- +${await httpDumper.dumpResponse(response)} +---------------------------------------------------------` + ); } - return { - offers: unmarshalArrayOfObject(data.offers, unmarshalOffer) - }; + return response; }; -const marshalCreateHostingRequest = (request, defaults) => ({ - domain: request.domain, - email: request.email, - offer_id: request.offerId, - option_ids: request.optionIds, - project_id: request.projectId ?? defaults.defaultProjectId, - tags: request.tags -}); -const marshalUpdateHostingRequest = (request, defaults) => ({ - email: request.email, - offer_id: request.offerId, - option_ids: request.optionIds, - tags: request.tags -}); +exports.logRequest = logRequest; +exports.logResponse = logResponse; +exports.obfuscateInterceptor = obfuscateInterceptor; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const jsonContentHeaders = { - 'Content-Type': 'application/json; charset=utf-8' + +/***/ }), + +/***/ 4983: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const extract = (key) => (result) => result[key]; +function* pages(key, fetcher, request, firstPage) { + if (!Array.isArray(firstPage[key])) { + throw new Error(`Property ${key} is not a list in paginated result`); + } + const getList = extract(key); + let page = request.page || 1; + if (page === 1) { + yield Promise.resolve(getList(firstPage)); + page += 1; + } + const { length } = firstPage[key]; + if (!length) return; + const { totalCount } = firstPage; + while (page <= Math.floor((totalCount + length - 1) / length)) { + yield fetcher({ ...request, page }).then(getList); + page += 1; + } +} +async function* fetchPaginated(key, fetcher, request, initial = fetcher(request)) { + yield* pages(key, fetcher, request, await initial); +} +const fetchAll = async (key, fetcher, request, initial = fetcher(request)) => (await Promise.all(Array.from(pages(key, fetcher, request, await initial)))).flat(); +const enrichForPagination = (key, fetcher, request) => { + const firstPage = fetcher(request); + return Object.assign(firstPage, { + all: () => fetchAll(key, fetcher, request, firstPage), + [Symbol.asyncIterator]: () => fetchPaginated(key, fetcher, request, firstPage) + }); }; +exports.enrichForPagination = enrichForPagination; +exports.extract = extract; +exports.fetchAll = fetchAll; +exports.fetchPaginated = fetchPaginated; -/** Web Hosting API. */ -class API extends API$u { - /** Lists the available regions of the API. */ - static LOCALITIES = ['fr-par']; - /** - * Order a Web Hosting plan. Order a Web Hosting plan, specifying the offer - * type required via the `offer_id` parameter. - * - * @param request - The request {@link CreateHostingRequest} - * @returns A Promise of Hosting - */ - createHosting = request => this.client.fetch({ - body: JSON.stringify(marshalCreateHostingRequest(request, this.client.settings)), - headers: jsonContentHeaders, - method: 'POST', - path: `/webhosting/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hostings` - }, unmarshalHosting); - pageOfListHostings = (request = {}) => this.client.fetch({ - method: 'GET', - path: `/webhosting/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hostings`, - urlParams: urlParams(['domain', request.domain], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId], ['statuses', request.statuses], ['tags', request.tags]) - }, unmarshalListHostingsResponse); +/***/ }), - /** - * List all Web Hosting plans. List all of your existing Web Hosting plans. - * Various filters are available to limit the results, including filtering by - * domain, status, tag and Project ID. - * - * @param request - The request {@link ListHostingsRequest} - * @returns A Promise of ListHostingsResponse - */ - listHostings = (request = {}) => enrichForPagination('hostings', this.pageOfListHostings, request); +/***/ 3072: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - /** - * Get a Web Hosting plan. Get the details of one of your existing Web Hosting - * plans, specified by its `hosting_id`. - * - * @param request - The request {@link GetHostingRequest} - * @returns A Promise of Hosting - */ - getHosting = request => this.client.fetch({ - method: 'GET', - path: `/webhosting/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam('hostingId', request.hostingId)}` - }, unmarshalHosting); +"use strict"; - /** - * Waits for {@link Hosting} to be in a final state. - * - * @param request - The request {@link GetHostingRequest} - * @param options - The waiting options - * @returns A Promise of Hosting - */ - waitForHosting = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!HOSTING_TRANSIENT_STATUSES.includes(res.status))), this.getHosting, request, options); +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const isResponse = __nccwpck_require__(5600); +const json = __nccwpck_require__(3746); +const errorParser = __nccwpck_require__(7776); +const scwError = __nccwpck_require__(622); +const X_TOTAL_COUNT_HEADER_KEY = "x-total-count"; +const TOTAL_COUNT_RES_KEY = "total_count"; +const fixLegacyTotalCount = (obj, headers) => { + const headerVal = headers.get(X_TOTAL_COUNT_HEADER_KEY); + if (!headerVal) { + return obj; + } + const totalCount = parseInt(headerVal, 10); + if (Number.isNaN(totalCount)) { + return obj; + } + if (json.isJSONObject(obj) && !(TOTAL_COUNT_RES_KEY in obj)) { + return Object.assign(obj, { [TOTAL_COUNT_RES_KEY]: totalCount }); + } + return obj; +}; +const responseParser = (unmarshaller, responseType) => async (response) => { + if (!isResponse.isResponse(response)) { + throw new TypeError("Invalid response object"); + } + if (response.ok) { + if (response.status === 204) return unmarshaller(void 0); + const contentType = response.headers.get("Content-Type"); + try { + if (responseType === "json" && contentType === "application/json") { + return unmarshaller( + fixLegacyTotalCount(await response.json(), response.headers) + ); + } + if (responseType === "blob") { + return unmarshaller(await response.blob()); + } + return unmarshaller(await response.text()); + } catch (err) { + throw new scwError.ScalewayError( + response.status, + `could not parse '${contentType ?? ""}' response${err instanceof Error ? `: ${err.message}` : ""}` + ); + } + } + const error = await response.clone().json().catch(() => response.text()); + if (json.isJSONObject(error)) throw errorParser.parseScalewayError(response.status, error); + throw new scwError.ScalewayError( + response.status, + typeof error === "string" ? error : "cannot read error response body" + ); +}; +exports.fixLegacyTotalCount = fixLegacyTotalCount; +exports.responseParser = responseParser; - /** - * Update a Web Hosting plan. Update the details of one of your existing Web - * Hosting plans, specified by its `hosting_id`. You can update parameters - * including the contact email address, tags, options and offer. - * - * @param request - The request {@link UpdateHostingRequest} - * @returns A Promise of Hosting - */ - updateHosting = request => this.client.fetch({ - body: JSON.stringify(marshalUpdateHostingRequest(request, this.client.settings)), - headers: jsonContentHeaders, - method: 'PATCH', - path: `/webhosting/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam('hostingId', request.hostingId)}` - }, unmarshalHosting); - /** - * Delete a Web Hosting plan. Delete a Web Hosting plan, specified by its - * `hosting_id`. Note that deletion is not immediate: it will take place at - * the end of the calendar month, after which time your Web Hosting plan and - * all its data (files and emails) will be irreversibly lost. - * - * @param request - The request {@link DeleteHostingRequest} - * @returns A Promise of Hosting - */ - deleteHosting = request => this.client.fetch({ - method: 'DELETE', - path: `/webhosting/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam('hostingId', request.hostingId)}` - }, unmarshalHosting); +/***/ }), - /** - * Restore a Web Hosting plan. When you [delete a Web Hosting - * plan](#path-hostings-delete-a-hosting), definitive deletion does not take - * place until the end of the calendar month. In the time between initiating - * the deletion, and definitive deletion at the end of the month, you can - * choose to **restore** the Web Hosting plan, using this endpoint and - * specifying its `hosting_id`. - * - * @param request - The request {@link RestoreHostingRequest} - * @returns A Promise of Hosting - */ - restoreHosting = request => this.client.fetch({ - body: '{}', - headers: jsonContentHeaders, - method: 'POST', - path: `/webhosting/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam('hostingId', request.hostingId)}/restore` - }, unmarshalHosting); +/***/ 1187: +/***/ ((__unused_webpack_module, exports) => { - /** - * Get DNS records. Get the set of DNS records of a specified domain - * associated with a Web Hosting plan. - * - * @param request - The request {@link GetDomainDnsRecordsRequest} - * @returns A Promise of DnsRecords - */ - getDomainDnsRecords = request => this.client.fetch({ - method: 'GET', - path: `/webhosting/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam('domain', request.domain)}/dns-records` - }, unmarshalDnsRecords); +"use strict"; - /** - * List all offers. List the different Web Hosting offers, and their options, - * available to order from Scaleway. - * - * @param request - The request {@link ListOffersRequest} - * @returns A Promise of ListOffersResponse - */ - listOffers = request => this.client.fetch({ - method: 'GET', - path: `/webhosting/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/offers`, - urlParams: urlParams(['hosting_id', request.hostingId], ['only_options', request.onlyOptions], ['order_by', request.orderBy ?? 'price_asc'], ['without_options', request.withoutOptions]) - }, unmarshalListOffersResponse); +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +var lookup = []; +var code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; +for (var i = 0, len = code.length; i < len; ++i) { + lookup[i] = code[i]; +} +function tripletToBase64(num) { + return lookup[num >> 18 & 63] + lookup[num >> 12 & 63] + lookup[num >> 6 & 63] + lookup[num & 63]; +} +function encodeChunk(uint8, start, end) { + var tmp; + var output = []; + for (var i = start; i < end; i += 3) { + tmp = (uint8[i] << 16 & 16711680) + (uint8[i + 1] << 8 & 65280) + (uint8[i + 2] & 255); + output.push(tripletToBase64(tmp)); + } + return output.join(""); +} +function fromByteArray(uint8) { + var tmp; + var len = uint8.length; + var extraBytes = len % 3; + var parts = []; + var maxChunkLength = 16383; + for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { + parts.push(encodeChunk(uint8, i, i + maxChunkLength > len2 ? len2 : i + maxChunkLength)); + } + if (extraBytes === 1) { + tmp = uint8[len - 1]; + parts.push( + lookup[tmp >> 2] + lookup[tmp << 4 & 63] + "==" + ); + } else if (extraBytes === 2) { + tmp = (uint8[len - 2] << 8) + uint8[len - 1]; + parts.push( + lookup[tmp >> 10] + lookup[tmp >> 4 & 63] + lookup[tmp << 2 & 63] + "=" + ); + } + return parts.join(""); } +exports.fromByteArray = fromByteArray; -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. -const ListHostingsRequest = { - page: { - greaterThan: 0 - }, - pageSize: { - greaterThan: 0, - lessThanOrEqual: 100 +/***/ }), + +/***/ 8141: +/***/ ((module) => { + +"use strict"; + +const ADJECTIVES = [ + "admiring", + "adoring", + "affectionate", + "agitated", + "amazing", + "angry", + "awesome", + "beautiful", + "blissful", + "bold", + "boring", + "brave", + "busy", + "charming", + "clever", + "cool", + "compassionate", + "competent", + "condescending", + "confident", + "cranky", + "crazy", + "dazzling", + "determined", + "distracted", + "dreamy", + "eager", + "ecstatic", + "elastic", + "elated", + "elegant", + "eloquent", + "epic", + "exciting", + "fervent", + "festive", + "flamboyant", + "focused", + "friendly", + "frosty", + "funny", + "gallant", + "gifted", + "goofy", + "gracious", + "great", + "happy", + "hardcore", + "heuristic", + "hopeful", + "hungry", + "infallible", + "inspiring", + "interesting", + "intelligent", + "jolly", + "jovial", + "keen", + "kind", + "laughing", + "loving", + "lucid", + "magical", + "mystifying", + "modest", + "musing", + "naughty", + "nervous", + "nice", + "nifty", + "nostalgic", + "objective", + "optimistic", + "peaceful", + "pedantic", + "pensive", + "practical", + "priceless", + "quirky", + "quizzical", + "recursing", + "relaxed", + "reverent", + "romantic", + "sad", + "serene", + "sharp", + "silly", + "sleepy", + "stoic", + "strange", + "stupefied", + "suspicious", + "sweet", + "tender", + "thirsty", + "trusting", + "unruffled", + "upbeat", + "vibrant", + "vigilant", + "vigorous", + "wizardly", + "wonderful", + "xenodochial", + "youthful", + "zealous", + "zen" +]; +const NAMES = [ + // Muhammad ibn Jābir al-Ḥarrānī al-Battānī was a founding father of astronomy. https://en.wikipedia.org/wiki/Mu%E1%B8%A5ammad_ibn_J%C4%81bir_al-%E1%B8%A4arr%C4%81n%C4%AB_al-Batt%C4%81n%C4%AB + "albattani", + // Frances E. Allen, became the first female IBM Fellow in 1989. In 2006, she became the first female recipient of the ACM's Turing Award. https://en.wikipedia.org/wiki/Frances_E._Allen + "allen", + // June Almeida - Scottish virologist who took the first pictures of the rubella virus - https://en.wikipedia.org/wiki/June_Almeida + "almeida", + // Kathleen Antonelli, American computer programmer and one of the six original programmers of the ENIAC - https://en.wikipedia.org/wiki/Kathleen_Antonelli + "antonelli", + // Maria Gaetana Agnesi - Italian mathematician, philosopher, theologian and humanitarian. She was the first woman to write a mathematics handbook and the first woman appointed as a Mathematics Professor at a University. https://en.wikipedia.org/wiki/Maria_Gaetana_Agnesi + "agnesi", + // Archimedes was a physicist, engineer and mathematician who invented too many things to list them here. https://en.wikipedia.org/wiki/Archimedes + "archimedes", + // Maria Ardinghelli - Italian translator, mathematician and physicist - https://en.wikipedia.org/wiki/Maria_Ardinghelli + "ardinghelli", + // Aryabhata - Ancient Indian mathematician-astronomer during 476-550 CE https://en.wikipedia.org/wiki/Aryabhata + "aryabhata", + // Wanda Austin - Wanda Austin is the President and CEO of The Aerospace Corporation, a leading architect for the US security space programs. https://en.wikipedia.org/wiki/Wanda_Austin + "austin", + // Charles Babbage invented the concept of a programmable computer. https://en.wikipedia.org/wiki/Charles_Babbage. + "babbage", + // Stefan Banach - Polish mathematician, was one of the founders of modern functional analysis. https://en.wikipedia.org/wiki/Stefan_Banach + "banach", + // Buckaroo Banzai and his mentor Dr. Hikita perfected the "oscillation overthruster", a device that allows one to pass through solid matter. - https://en.wikipedia.org/wiki/The_Adventures_of_Buckaroo_Banzai_Across_the_8th_Dimension + "banzai", + // John Bardeen co-invented the transistor - https://en.wikipedia.org/wiki/John_Bardeen + "bardeen", + // Jean Bartik, born Betty Jean Jennings, was one of the original programmers for the ENIAC computer. https://en.wikipedia.org/wiki/Jean_Bartik + "bartik", + // Laura Bassi, the world's first female professor https://en.wikipedia.org/wiki/Laura_Bassi + "bassi", + // Hugh Beaver, British engineer, founder of the Guinness Book of World Records https://en.wikipedia.org/wiki/Hugh_Beaver + "beaver", + // Alexander Graham Bell - an eminent Scottish-born scientist, inventor, engineer and innovator who is credited with inventing the first practical telephone - https://en.wikipedia.org/wiki/Alexander_Graham_Bell + "bell", + // Karl Friedrich Benz - a German automobile engineer. Inventor of the first practical motorcar. https://en.wikipedia.org/wiki/Karl_Benz + "benz", + // Homi J Bhabha - was an Indian nuclear physicist, founding director, and professor of physics at the Tata Institute of Fundamental Research. Colloquially known as "father of Indian nuclear programme"- https://en.wikipedia.org/wiki/Homi_J._Bhabha + "bhabha", + // Bhaskara II - Ancient Indian mathematician-astronomer whose work on calculus predates Newton and Leibniz by over half a millennium - https://en.wikipedia.org/wiki/Bh%C4%81skara_II#Calculus + "bhaskara", + // Sue Black - British computer scientist and campaigner. She has been instrumental in saving Bletchley Park, the site of World War II codebreaking - https://en.wikipedia.org/wiki/Sue_Black_(computer_scientist) + "black", + // Elizabeth Helen Blackburn - Australian-American Nobel laureate; best known for co-discovering telomerase. https://en.wikipedia.org/wiki/Elizabeth_Blackburn + "blackburn", + // Elizabeth Blackwell - American doctor and first American woman to receive a medical degree - https://en.wikipedia.org/wiki/Elizabeth_Blackwell + "blackwell", + // Niels Bohr is the father of quantum theory. https://en.wikipedia.org/wiki/Niels_Bohr. + "bohr", + // Kathleen Booth, she's credited with writing the first assembly language. https://en.wikipedia.org/wiki/Kathleen_Booth + "booth", + // Anita Borg - Anita Borg was the founding director of the Institute for Women and Technology (IWT). https://en.wikipedia.org/wiki/Anita_Borg + "borg", + // Satyendra Nath Bose - He provided the foundation for Bose–Einstein statistics and the theory of the Bose–Einstein condensate. - https://en.wikipedia.org/wiki/Satyendra_Nath_Bose + "bose", + // Katherine Louise Bouman is an imaging scientist and Assistant Professor of Computer Science at the California Institute of Technology. She researches computational methods for imaging, and developed an algorithm that made possible the picture first visualization of a black hole using the Event Horizon Telescope. - https://en.wikipedia.org/wiki/Katie_Bouman + "bouman", + // Evelyn Boyd Granville - She was one of the first African-American woman to receive a Ph.D. in mathematics; she earned it in 1949 from Yale University. https://en.wikipedia.org/wiki/Evelyn_Boyd_Granville + "boyd", + // Brahmagupta - Ancient Indian mathematician during 598-670 CE who gave rules to compute with zero - https://en.wikipedia.org/wiki/Brahmagupta#Zero + "brahmagupta", + // Walter Houser Brattain co-invented the transistor - https://en.wikipedia.org/wiki/Walter_Houser_Brattain + "brattain", + // Emmett Brown invented time travel. https://en.wikipedia.org/wiki/Emmett_Brown (thanks Brian Goff) + "brown", + // Linda Brown Buck - American biologist and Nobel laureate best known for her genetic and molecular analyses of the mechanisms of smell. https://en.wikipedia.org/wiki/Linda_B._Buck + "buck", + // Dame Susan Jocelyn Bell Burnell - Northern Irish astrophysicist who discovered radio pulsars and was the first to analyse them. https://en.wikipedia.org/wiki/Jocelyn_Bell_Burnell + "burnell", + // Annie Jump Cannon - pioneering female astronomer who classified hundreds of thousands of stars and created the system we use to understand stars today. https://en.wikipedia.org/wiki/Annie_Jump_Cannon + "cannon", + // Rachel Carson - American marine biologist and conservationist, her book Silent Spring and other writings are credited with advancing the global environmental movement. https://en.wikipedia.org/wiki/Rachel_Carson + "carson", + // Dame Mary Lucy Cartwright - British mathematician who was one of the first to study what is now known as chaos theory. Also known for Cartwright's theorem which finds applications in signal processing. https://en.wikipedia.org/wiki/Mary_Cartwright + "cartwright", + // George Washington Carver - American agricultural scientist and inventor. He was the most prominent black scientist of the early 20th century. https://en.wikipedia.org/wiki/George_Washington_Carver + "carver", + // Vinton Gray Cerf - American Internet pioneer, recognised as one of "the fathers of the Internet". With Robert Elliot Kahn, he designed TCP and IP, the primary data communication protocols of the Internet and other computer networks. https://en.wikipedia.org/wiki/Vint_Cerf + "cerf", + // Subrahmanyan Chandrasekhar - Astrophysicist known for his mathematical theory on different stages and evolution in structures of the stars. He has won nobel prize for physics - https://en.wikipedia.org/wiki/Subrahmanyan_Chandrasekhar + "chandrasekhar", + // Sergey Alexeyevich Chaplygin (Russian: Серге́й Алексе́евич Чаплы́гин; April 5, 1869 – October 8, 1942) was a Russian and Soviet physicist, mathematician, and mechanical engineer. He is known for mathematical formulas such as Chaplygin's equation and for a hypothetical substance in cosmology called Chaplygin gas, named after him. https://en.wikipedia.org/wiki/Sergey_Chaplygin + "chaplygin", + // Émilie du Châtelet - French natural philosopher, mathematician, physicist, and author during the early 1730s, known for her translation of and commentary on Isaac Newton's book Principia containing basic laws of physics. https://en.wikipedia.org/wiki/%C3%89milie_du_Ch%C3%A2telet + "chatelet", + // Asima Chatterjee was an Indian organic chemist noted for her research on vinca alkaloids, development of drugs for treatment of epilepsy and malaria - https://en.wikipedia.org/wiki/Asima_Chatterjee + "chatterjee", + // Pafnuty Chebyshev - Russian mathematician. He is known fo his works on probability, statistics, mechanics, analytical geometry and number theory https://en.wikipedia.org/wiki/Pafnuty_Chebyshev + "chebyshev", + // Bram Cohen - American computer programmer and author of the BitTorrent peer-to-peer protocol. https://en.wikipedia.org/wiki/Bram_Cohen + "cohen", + // David Lee Chaum - American computer scientist and cryptographer. Known for his seminal contributions in the field of anonymous communication. https://en.wikipedia.org/wiki/David_Chaum + "chaum", + // Joan Clarke - Bletchley Park code breaker during the Second World War who pioneered techniques that remained top secret for decades. Also an accomplished numismatist https://en.wikipedia.org/wiki/Joan_Clarke + "clarke", + // Jane Colden - American botanist widely considered the first female American botanist - https://en.wikipedia.org/wiki/Jane_Colden + "colden", + // Gerty Theresa Cori - American biochemist who became the third woman—and first American woman—to win a Nobel Prize in science, and the first woman to be awarded the Nobel Prize in Physiology or Medicine. Cori was born in Prague. https://en.wikipedia.org/wiki/Gerty_Cori + "cori", + // Seymour Roger Cray was an American electrical engineer and supercomputer architect who designed a series of computers that were the fastest in the world for decades. https://en.wikipedia.org/wiki/Seymour_Cray + "cray", + // This entry reflects a husband and wife team who worked together: + // Joan Curran was a Welsh scientist who developed radar and invented chaff, a radar countermeasure. https://en.wikipedia.org/wiki/Joan_Curran + // Samuel Curran was an Irish physicist who worked alongside his wife during WWII and invented the proximity fuse. https://en.wikipedia.org/wiki/Samuel_Curran + "curran", + // Marie Curie discovered radioactivity. https://en.wikipedia.org/wiki/Marie_Curie. + "curie", + // Charles Darwin established the principles of natural evolution. https://en.wikipedia.org/wiki/Charles_Darwin. + "darwin", + // Leonardo Da Vinci invented too many things to list here. https://en.wikipedia.org/wiki/Leonardo_da_Vinci. + "davinci", + // A. K. (Alexander Keewatin) Dewdney, Canadian mathematician, computer scientist, author and filmmaker. Contributor to Scientific American's "Computer Recreations" from 1984 to 1991. Author of Core War (program), The Planiverse, The Armchair Universe, The Magic Machine, The New Turing Omnibus, and more. https://en.wikipedia.org/wiki/Alexander_Dewdney + "dewdney", + // Satish Dhawan - Indian mathematician and aerospace engineer, known for leading the successful and indigenous development of the Indian space programme. https://en.wikipedia.org/wiki/Satish_Dhawan + "dhawan", + // Bailey Whitfield Diffie - American cryptographer and one of the pioneers of public-key cryptography. https://en.wikipedia.org/wiki/Whitfield_Diffie + "diffie", + // Edsger Wybe Dijkstra was a Dutch computer scientist and mathematical scientist. https://en.wikipedia.org/wiki/Edsger_W._Dijkstra. + "dijkstra", + // Paul Adrien Maurice Dirac - English theoretical physicist who made fundamental contributions to the early development of both quantum mechanics and quantum electrodynamics. https://en.wikipedia.org/wiki/Paul_Dirac + "dirac", + // Agnes Meyer Driscoll - American cryptanalyst during World Wars I and II who successfully cryptanalysed a number of Japanese ciphers. She was also the co-developer of one of the cipher machines of the US Navy, the CM. https://en.wikipedia.org/wiki/Agnes_Meyer_Driscoll + "driscoll", + // Donna Dubinsky - played an integral role in the development of personal digital assistants (PDAs) serving as CEO of Palm, Inc. and co-founding Handspring. https://en.wikipedia.org/wiki/Donna_Dubinsky + "dubinsky", + // Annie Easley - She was a leading member of the team which developed software for the Centaur rocket stage and one of the first African-Americans in her field. https://en.wikipedia.org/wiki/Annie_Easley + "easley", + // Thomas Alva Edison, prolific inventor https://en.wikipedia.org/wiki/Thomas_Edison + "edison", + // Albert Einstein invented the general theory of relativity. https://en.wikipedia.org/wiki/Albert_Einstein + "einstein", + // Alexandra Asanovna Elbakyan (Russian: Алекса́ндра Аса́новна Элбакя́н) is a Kazakhstani graduate student, computer programmer, internet pirate in hiding, and the creator of the site Sci-Hub. Nature has listed her in 2016 in the top ten people that mattered in science, and Ars Technica has compared her to Aaron Swartz. - https://en.wikipedia.org/wiki/Alexandra_Elbakyan + "elbakyan", + // Taher A. ElGamal - Egyptian cryptographer best known for the ElGamal discrete log cryptosystem and the ElGamal digital signature scheme. https://en.wikipedia.org/wiki/Taher_Elgamal + "elgamal", + // Gertrude Elion - American biochemist, pharmacologist and the 1988 recipient of the Nobel Prize in Medicine - https://en.wikipedia.org/wiki/Gertrude_Elion + "elion", + // James Henry Ellis - British engineer and cryptographer employed by the GCHQ. Best known for conceiving for the first time, the idea of public-key cryptography. https://en.wikipedia.org/wiki/James_H._Ellis + "ellis", + // Douglas Engelbart gave the mother of all demos: https://en.wikipedia.org/wiki/Douglas_Engelbart + "engelbart", + // Euclid invented geometry. https://en.wikipedia.org/wiki/Euclid + "euclid", + // Leonhard Euler invented large parts of modern mathematics. https://de.wikipedia.org/wiki/Leonhard_Euler + "euler", + // Michael Faraday - British scientist who contributed to the study of electromagnetism and electrochemistry. https://en.wikipedia.org/wiki/Michael_Faraday + "faraday", + // Horst Feistel - German-born American cryptographer who was one of the earliest non-government researchers to study the design and theory of block ciphers. Co-developer of DES and Lucifer. Feistel networks, a symmetric structure used in the construction of block ciphers are named after him. https://en.wikipedia.org/wiki/Horst_Feistel + "feistel", + // Pierre de Fermat pioneered several aspects of modern mathematics. https://en.wikipedia.org/wiki/Pierre_de_Fermat + "fermat", + // Enrico Fermi invented the first nuclear reactor. https://en.wikipedia.org/wiki/Enrico_Fermi. + "fermi", + // Richard Feynman was a key contributor to quantum mechanics and particle physics. https://en.wikipedia.org/wiki/Richard_Feynman + "feynman", + // Benjamin Franklin is famous for his experiments in electricity and the invention of the lightning rod. + "franklin", + // Yuri Alekseyevich Gagarin - Soviet pilot and cosmonaut, best known as the first human to journey into outer space. https://en.wikipedia.org/wiki/Yuri_Gagarin + "gagarin", + // Galileo was a founding father of modern astronomy, and faced politics and obscurantism to establish scientific truth. https://en.wikipedia.org/wiki/Galileo_Galilei + "galileo", + // Évariste Galois - French mathematician whose work laid the foundations of Galois theory and group theory, two major branches of abstract algebra, and the subfield of Galois connections, all while still in his late teens. https://en.wikipedia.org/wiki/%C3%89variste_Galois + "galois", + // Kadambini Ganguly - Indian physician, known for being the first South Asian female physician, trained in western medicine, to graduate in South Asia. https://en.wikipedia.org/wiki/Kadambini_Ganguly + "ganguly", + // William Henry "Bill" Gates III is an American business magnate, philanthropist, investor, computer programmer, and inventor. https://en.wikipedia.org/wiki/Bill_Gates + "gates", + // Johann Carl Friedrich Gauss - German mathematician who made significant contributions to many fields, including number theory, algebra, statistics, analysis, differential geometry, geodesy, geophysics, mechanics, electrostatics, magnetic fields, astronomy, matrix theory, and optics. https://en.wikipedia.org/wiki/Carl_Friedrich_Gauss + "gauss", + // Marie-Sophie Germain - French mathematician, physicist and philosopher. Known for her work on elasticity theory, number theory and philosophy. https://en.wikipedia.org/wiki/Sophie_Germain + "germain", + // Adele Goldberg, was one of the designers and developers of the Smalltalk language. https://en.wikipedia.org/wiki/Adele_Goldberg_(computer_scientist) + "goldberg", + // Adele Goldstine, born Adele Katz, wrote the complete technical description for the first electronic digital computer, ENIAC. https://en.wikipedia.org/wiki/Adele_Goldstine + "goldstine", + // Shafi Goldwasser is a computer scientist known for creating theoretical foundations of modern cryptography. Winner of 2012 ACM Turing Award. https://en.wikipedia.org/wiki/Shafi_Goldwasser + "goldwasser", + // James Golick, all around gangster. + "golick", + // Jane Goodall - British primatologist, ethologist, and anthropologist who is considered to be the world's foremost expert on chimpanzees - https://en.wikipedia.org/wiki/Jane_Goodall + "goodall", + // Stephen Jay Gould was was an American paleontologist, evolutionary biologist, and historian of science. He is most famous for the theory of punctuated equilibrium - https://en.wikipedia.org/wiki/Stephen_Jay_Gould + "gould", + // Carolyn Widney Greider - American molecular biologist and joint winner of the 2009 Nobel Prize for Physiology or Medicine for the discovery of telomerase. https://en.wikipedia.org/wiki/Carol_W._Greider + "greider", + // Alexander Grothendieck - German-born French mathematician who became a leading figure in the creation of modern algebraic geometry. https://en.wikipedia.org/wiki/Alexander_Grothendieck + "grothendieck", + // Lois Haibt - American computer scientist, part of the team at IBM that developed FORTRAN - https://en.wikipedia.org/wiki/Lois_Haibt + "haibt", + // Margaret Hamilton - Director of the Software Engineering Division of the MIT Instrumentation Laboratory, which developed on-board flight software for the Apollo space program. https://en.wikipedia.org/wiki/Margaret_Hamilton_(scientist) + "hamilton", + // Caroline Harriet Haslett - English electrical engineer, electricity industry administrator and champion of women's rights. Co-author of British Standard 1363 that specifies AC power plugs and sockets used across the United Kingdom (which is widely considered as one of the safest designs). https://en.wikipedia.org/wiki/Caroline_Haslett + "haslett", + // Stephen Hawking pioneered the field of cosmology by combining general relativity and quantum mechanics. https://en.wikipedia.org/wiki/Stephen_Hawking + "hawking", + // Martin Edward Hellman - American cryptologist, best known for his invention of public-key cryptography in co-operation with Whitfield Diffie and Ralph Merkle. https://en.wikipedia.org/wiki/Martin_Hellman + "hellman", + // Werner Heisenberg was a founding father of quantum mechanics. https://en.wikipedia.org/wiki/Werner_Heisenberg + "heisenberg", + // Grete Hermann was a German philosopher noted for her philosophical work on the foundations of quantum mechanics. https://en.wikipedia.org/wiki/Grete_Hermann + "hermann", + // Caroline Lucretia Herschel - German astronomer and discoverer of several comets. https://en.wikipedia.org/wiki/Caroline_Herschel + "herschel", + // Heinrich Rudolf Hertz - German physicist who first conclusively proved the existence of the electromagnetic waves. https://en.wikipedia.org/wiki/Heinrich_Hertz + "hertz", + // Jaroslav Heyrovský was the inventor of the polarographic method, father of the electroanalytical method, and recipient of the Nobel Prize in 1959. His main field of work was polarography. https://en.wikipedia.org/wiki/Jaroslav_Heyrovsk%C3%BD + "heyrovsky", + // Dorothy Hodgkin was a British biochemist, credited with the development of protein crystallography. She was awarded the Nobel Prize in Chemistry in 1964. https://en.wikipedia.org/wiki/Dorothy_Hodgkin + "hodgkin", + // Douglas R. Hofstadter is an American professor of cognitive science and author of the Pulitzer Prize and American Book Award-winning work Goedel, Escher, Bach: An Eternal Golden Braid in 1979. A mind-bending work which coined Hofstadter's Law: "It always takes longer than you expect, even when you take into account Hofstadter's Law." https://en.wikipedia.org/wiki/Douglas_Hofstadter + "hofstadter", + // Erna Schneider Hoover revolutionized modern communication by inventing a computerized telephone switching method. https://en.wikipedia.org/wiki/Erna_Schneider_Hoover + "hoover", + // Grace Hopper developed the first compiler for a computer programming language and is credited with popularizing the term "debugging" for fixing computer glitches. https://en.wikipedia.org/wiki/Grace_Hopper + "hopper", + // Frances Hugle, she was an American scientist, engineer, and inventor who contributed to the understanding of semiconductors, integrated circuitry, and the unique electrical principles of microscopic materials. https://en.wikipedia.org/wiki/Frances_Hugle + "hugle", + // Hypatia - Greek Alexandrine Neoplatonist philosopher in Egypt who was one of the earliest mothers of mathematics - https://en.wikipedia.org/wiki/Hypatia + "hypatia", + // Teruko Ishizaka - Japanese scientist and immunologist who co-discovered the antibody class Immunoglobulin E. https://en.wikipedia.org/wiki/Teruko_Ishizaka + "ishizaka", + // Mary Jackson, American mathematician and aerospace engineer who earned the highest title within NASA's engineering department - https://en.wikipedia.org/wiki/Mary_Jackson_(engineer) + "jackson", + // Yeong-Sil Jang was a Korean scientist and astronomer during the Joseon Dynasty; he invented the first metal printing press and water gauge. https://en.wikipedia.org/wiki/Jang_Yeong-sil + "jang", + // Mae Carol Jemison - is an American engineer, physician, and former NASA astronaut. She became the first black woman to travel in space when she served as a mission specialist aboard the Space Shuttle Endeavour - https://en.wikipedia.org/wiki/Mae_Jemison + "jemison", + // Betty Jennings - one of the original programmers of the ENIAC. https://en.wikipedia.org/wiki/ENIAC - https://en.wikipedia.org/wiki/Jean_Bartik + "jennings", + // Mary Lou Jepsen, was the founder and chief technology officer of One Laptop Per Child (OLPC), and the founder of Pixel Qi. https://en.wikipedia.org/wiki/Mary_Lou_Jepsen + "jepsen", + // Katherine Coleman Goble Johnson - American physicist and mathematician contributed to the NASA. https://en.wikipedia.org/wiki/Katherine_Johnson + "johnson", + // Irène Joliot-Curie - French scientist who was awarded the Nobel Prize for Chemistry in 1935. Daughter of Marie and Pierre Curie. https://en.wikipedia.org/wiki/Ir%C3%A8ne_Joliot-Curie + "joliot", + // Karen Spärck Jones came up with the concept of inverse document frequency, which is used in most search engines today. https://en.wikipedia.org/wiki/Karen_Sp%C3%A4rck_Jones + "jones", + // A. P. J. Abdul Kalam - is an Indian scientist aka Missile Man of India for his work on the development of ballistic missile and launch vehicle technology - https://en.wikipedia.org/wiki/A._P._J._Abdul_Kalam + "kalam", + // Sergey Petrovich Kapitsa (Russian: Серге́й Петро́вич Капи́ца; 14 February 1928 – 14 August 2012) was a Russian physicist and demographer. He was best known as host of the popular and long-running Russian scientific TV show, Evident, but Incredible. His father was the Nobel laureate Soviet-era physicist Pyotr Kapitsa, and his brother was the geographer and Antarctic explorer Andrey Kapitsa. - https://en.wikipedia.org/wiki/Sergey_Kapitsa + "kapitsa", + // Susan Kare, created the icons and many of the interface elements for the original Apple Macintosh in the 1980s, and was an original employee of NeXT, working as the Creative Director. https://en.wikipedia.org/wiki/Susan_Kare + "kare", + // Mstislav Keldysh - a Soviet scientist in the field of mathematics and mechanics, academician of the USSR Academy of Sciences (1946), President of the USSR Academy of Sciences (1961–1975), three times Hero of Socialist Labor (1956, 1961, 1971), fellow of the Royal Society of Edinburgh (1968). https://en.wikipedia.org/wiki/Mstislav_Keldysh + "keldysh", + // Mary Kenneth Keller, Sister Mary Kenneth Keller became the first American woman to earn a PhD in Computer Science in 1965. https://en.wikipedia.org/wiki/Mary_Kenneth_Keller + "keller", + // Johannes Kepler, German astronomer known for his three laws of planetary motion - https://en.wikipedia.org/wiki/Johannes_Kepler + "kepler", + // Omar Khayyam - Persian mathematician, astronomer and poet. Known for his work on the classification and solution of cubic equations, for his contribution to the understanding of Euclid's fifth postulate and for computing the length of a year very accurately. https://en.wikipedia.org/wiki/Omar_Khayyam + "khayyam", + // Har Gobind Khorana - Indian-American biochemist who shared the 1968 Nobel Prize for Physiology - https://en.wikipedia.org/wiki/Har_Gobind_Khorana + "khorana", + // Jack Kilby invented silicon integrated circuits and gave Silicon Valley its name. - https://en.wikipedia.org/wiki/Jack_Kilby + "kilby", + // Maria Kirch - German astronomer and first woman to discover a comet - https://en.wikipedia.org/wiki/Maria_Margarethe_Kirch + "kirch", + // Donald Knuth - American computer scientist, author of "The Art of Computer Programming" and creator of the TeX typesetting system. https://en.wikipedia.org/wiki/Donald_Knuth + "knuth", + // Sophie Kowalevski - Russian mathematician responsible for important original contributions to analysis, differential equations and mechanics - https://en.wikipedia.org/wiki/Sofia_Kovalevskaya + "kowalevski", + // Marie-Jeanne de Lalande - French astronomer, mathematician and cataloguer of stars - https://en.wikipedia.org/wiki/Marie-Jeanne_de_Lalande + "lalande", + // Hedy Lamarr - Actress and inventor. The principles of her work are now incorporated into modern Wi-Fi, CDMA and Bluetooth technology. https://en.wikipedia.org/wiki/Hedy_Lamarr + "lamarr", + // Leslie B. Lamport - American computer scientist. Lamport is best known for his seminal work in distributed systems and was the winner of the 2013 Turing Award. https://en.wikipedia.org/wiki/Leslie_Lamport + "lamport", + // Mary Leakey - British paleoanthropologist who discovered the first fossilized Proconsul skull - https://en.wikipedia.org/wiki/Mary_Leakey + "leakey", + // Henrietta Swan Leavitt - she was an American astronomer who discovered the relation between the luminosity and the period of Cepheid variable stars. https://en.wikipedia.org/wiki/Henrietta_Swan_Leavitt + "leavitt", + // Esther Miriam Zimmer Lederberg - American microbiologist and a pioneer of bacterial genetics. https://en.wikipedia.org/wiki/Esther_Lederberg + "lederberg", + // Inge Lehmann - Danish seismologist and geophysicist. Known for discovering in 1936 that the Earth has a solid inner core inside a molten outer core. https://en.wikipedia.org/wiki/Inge_Lehmann + "lehmann", + // Daniel Lewin - Mathematician, Akamai co-founder, soldier, 9/11 victim-- Developed optimization techniques for routing traffic on the internet. Died attempting to stop the 9-11 hijackers. https://en.wikipedia.org/wiki/Daniel_Lewin + "lewin", + // Ruth Lichterman - one of the original programmers of the ENIAC. https://en.wikipedia.org/wiki/ENIAC - https://en.wikipedia.org/wiki/Ruth_Teitelbaum + "lichterman", + // Barbara Liskov - co-developed the Liskov substitution principle. Liskov was also the winner of the Turing Prize in 2008. - https://en.wikipedia.org/wiki/Barbara_Liskov + "liskov", + // Ada Lovelace invented the first algorithm. https://en.wikipedia.org/wiki/Ada_Lovelace (thanks James Turnbull) + "lovelace", + // Auguste and Louis Lumière - the first filmmakers in history - https://en.wikipedia.org/wiki/Auguste_and_Louis_Lumi%C3%A8re + "lumiere", + // Mahavira - Ancient Indian mathematician during 9th century AD who discovered basic algebraic identities - https://en.wikipedia.org/wiki/Mah%C4%81v%C4%ABra_(mathematician) + "mahavira", + // Lynn Margulis (b. Lynn Petra Alexander) - an American evolutionary theorist and biologist, science author, educator, and popularizer, and was the primary modern proponent for the significance of symbiosis in evolution. - https://en.wikipedia.org/wiki/Lynn_Margulis + "margulis", + // Yukihiro Matsumoto - Japanese computer scientist and software programmer best known as the chief designer of the Ruby programming language. https://en.wikipedia.org/wiki/Yukihiro_Matsumoto + "matsumoto", + // James Clerk Maxwell - Scottish physicist, best known for his formulation of electromagnetic theory. https://en.wikipedia.org/wiki/James_Clerk_Maxwell + "maxwell", + // Maria Mayer - American theoretical physicist and Nobel laureate in Physics for proposing the nuclear shell model of the atomic nucleus - https://en.wikipedia.org/wiki/Maria_Mayer + "mayer", + // John McCarthy invented LISP: https://en.wikipedia.org/wiki/John_McCarthy_(computer_scientist) + "mccarthy", + // Barbara McClintock - a distinguished American cytogeneticist, 1983 Nobel Laureate in Physiology or Medicine for discovering transposons. https://en.wikipedia.org/wiki/Barbara_McClintock + "mcclintock", + // Anne Laura Dorinthea McLaren - British developmental biologist whose work helped lead to human in-vitro fertilisation. https://en.wikipedia.org/wiki/Anne_McLaren + "mclaren", + // Malcolm McLean invented the modern shipping container: https://en.wikipedia.org/wiki/Malcom_McLean + "mclean", + // Kay McNulty - one of the original programmers of the ENIAC. https://en.wikipedia.org/wiki/ENIAC - https://en.wikipedia.org/wiki/Kathleen_Antonelli + "mcnulty", + // Gregor Johann Mendel - Czech scientist and founder of genetics. https://en.wikipedia.org/wiki/Gregor_Mendel + "mendel", + // Dmitri Mendeleev - a chemist and inventor. He formulated the Periodic Law, created a farsighted version of the periodic table of elements, and used it to correct the properties of some already discovered elements and also to predict the properties of eight elements yet to be discovered. https://en.wikipedia.org/wiki/Dmitri_Mendeleev + "mendeleev", + // Lise Meitner - Austrian/Swedish physicist who was involved in the discovery of nuclear fission. The element meitnerium is named after her - https://en.wikipedia.org/wiki/Lise_Meitner + "meitner", + // Carla Meninsky, was the game designer and programmer for Atari 2600 games Dodge 'Em and Warlords. https://en.wikipedia.org/wiki/Carla_Meninsky + "meninsky", + // Ralph C. Merkle - American computer scientist, known for devising Merkle's puzzles - one of the very first schemes for public-key cryptography. Also, inventor of Merkle trees and co-inventor of the Merkle-Damgård construction for building collision-resistant cryptographic hash functions and the Merkle-Hellman knapsack cryptosystem. https://en.wikipedia.org/wiki/Ralph_Merkle + "merkle", + // Johanna Mestorf - German prehistoric archaeologist and first female museum director in Germany - https://en.wikipedia.org/wiki/Johanna_Mestorf + "mestorf", + // Maryam Mirzakhani - an Iranian mathematician and the first woman to win the Fields Medal. https://en.wikipedia.org/wiki/Maryam_Mirzakhani + "mirzakhani", + // Rita Levi-Montalcini - Won Nobel Prize in Physiology or Medicine jointly with colleague Stanley Cohen for the discovery of nerve growth factor (https://en.wikipedia.org/wiki/Rita_Levi-Montalcini) + "montalcini", + // Gordon Earle Moore - American engineer, Silicon Valley founding father, author of Moore's law. https://en.wikipedia.org/wiki/Gordon_Moore + "moore", + // Samuel Morse - contributed to the invention of a single-wire telegraph system based on European telegraphs and was a co-developer of the Morse code - https://en.wikipedia.org/wiki/Samuel_Morse + "morse", + // Ian Murdock - founder of the Debian project - https://en.wikipedia.org/wiki/Ian_Murdock + "murdock", + // May-Britt Moser - Nobel prize winner neuroscientist who contributed to the discovery of grid cells in the brain. https://en.wikipedia.org/wiki/May-Britt_Moser + "moser", + // John Napier of Merchiston - Scottish landowner known as an astronomer, mathematician and physicist. Best known for his discovery of logarithms. https://en.wikipedia.org/wiki/John_Napier + "napier", + // John Forbes Nash, Jr. - American mathematician who made fundamental contributions to game theory, differential geometry, and the study of partial differential equations. https://en.wikipedia.org/wiki/John_Forbes_Nash_Jr. + "nash", + // John von Neumann - todays computer architectures are based on the von Neumann architecture. https://en.wikipedia.org/wiki/Von_Neumann_architecture + "neumann", + // Isaac Newton invented classic mechanics and modern optics. https://en.wikipedia.org/wiki/Isaac_Newton + "newton", + // Xavier Niel - ;) https://en.wikipedia.org/wiki/Xavier_Niel + "niel", + // Florence Nightingale, more prominently known as a nurse, was also the first female member of the Royal Statistical Society and a pioneer in statistical graphics https://en.wikipedia.org/wiki/Florence_Nightingale#Statistics_and_sanitary_reform + "nightingale", + // Alfred Nobel - a Swedish chemist, engineer, innovator, and armaments manufacturer (inventor of dynamite) - https://en.wikipedia.org/wiki/Alfred_Nobel + "nobel", + // Emmy Noether, German mathematician. Noether's Theorem is named after her. https://en.wikipedia.org/wiki/Emmy_Noether + "noether", + // Poppy Northcutt. Poppy Northcutt was the first woman to work as part of NASA’s Mission Control. http://www.businessinsider.com/poppy-northcutt-helped-apollo-astronauts-2014-12?op=1 + "northcutt", + // Robert Noyce invented silicon integrated circuits and gave Silicon Valley its name. - https://en.wikipedia.org/wiki/Robert_Noyce + "noyce", + // Panini - Ancient Indian linguist and grammarian from 4th century CE who worked on the world's first formal system - https://en.wikipedia.org/wiki/P%C4%81%E1%B9%87ini#Comparison_with_modern_formal_systems + "panini", + // Ambroise Pare invented modern surgery. https://en.wikipedia.org/wiki/Ambroise_Par%C3%A9 + "pare", + // Blaise Pascal, French mathematician, physicist, and inventor - https://en.wikipedia.org/wiki/Blaise_Pascal + "pascal", + // Louis Pasteur discovered vaccination, fermentation and pasteurization. https://en.wikipedia.org/wiki/Louis_Pasteur. + "pasteur", + // Cecilia Payne-Gaposchkin was an astronomer and astrophysicist who, in 1925, proposed in her Ph.D. thesis an explanation for the composition of stars in terms of the relative abundances of hydrogen and helium. https://en.wikipedia.org/wiki/Cecilia_Payne-Gaposchkin + "payne", + // Radia Perlman is a software designer and network engineer and most famous for her invention of the spanning-tree protocol (STP). https://en.wikipedia.org/wiki/Radia_Perlman + "perlman", + // Rob Pike was a key contributor to Unix, Plan 9, the X graphic system, utf-8, and the Go programming language. https://en.wikipedia.org/wiki/Rob_Pike + "pike", + // Henri Poincaré made fundamental contributions in several fields of mathematics. https://en.wikipedia.org/wiki/Henri_Poincar%C3%A9 + "poincare", + // Laura Poitras is a director and producer whose work, made possible by open source crypto tools, advances the causes of truth and freedom of information by reporting disclosures by whistleblowers such as Edward Snowden. https://en.wikipedia.org/wiki/Laura_Poitras + "poitras", + // Tat’yana Avenirovna Proskuriakova (Russian: Татья́на Авени́ровна Проскуряко́ва) (January 23 [O.S. January 10] 1909 – August 30, 1985) was a Russian-American Mayanist scholar and archaeologist who contributed significantly to the deciphering of Maya hieroglyphs, the writing system of the pre-Columbian Maya civilization of Mesoamerica. https://en.wikipedia.org/wiki/Tatiana_Proskouriakoff + "proskuriakova", + // Claudius Ptolemy - a Greco-Egyptian writer of Alexandria, known as a mathematician, astronomer, geographer, astrologer, and poet of a single epigram in the Greek Anthology - https://en.wikipedia.org/wiki/Ptolemy + "ptolemy", + // C. V. Raman - Indian physicist who won the Nobel Prize in 1930 for proposing the Raman effect. - https://en.wikipedia.org/wiki/C._V._Raman + "raman", + // Srinivasa Ramanujan - Indian mathematician and autodidact who made extraordinary contributions to mathematical analysis, number theory, infinite series, and continued fractions. - https://en.wikipedia.org/wiki/Srinivasa_Ramanujan + "ramanujan", + // Sally Kristen Ride was an American physicist and astronaut. She was the first American woman in space, and the youngest American astronaut. https://en.wikipedia.org/wiki/Sally_Ride + "ride", + // Dennis Ritchie - co-creator of UNIX and the C programming language. - https://en.wikipedia.org/wiki/Dennis_Ritchie + "ritchie", + // Ida Rhodes - American pioneer in computer programming, designed the first computer used for Social Security. https://en.wikipedia.org/wiki/Ida_Rhodes + "rhodes", + // Julia Hall Bowman Robinson - American mathematician renowned for her contributions to the fields of computability theory and computational complexity theory. https://en.wikipedia.org/wiki/Julia_Robinson + "robinson", + // Wilhelm Conrad Röntgen - German physicist who was awarded the first Nobel Prize in Physics in 1901 for the discovery of X-rays (Röntgen rays). https://en.wikipedia.org/wiki/Wilhelm_R%C3%B6ntgen + "roentgen", + // Rosalind Franklin - British biophysicist and X-ray crystallographer whose research was critical to the understanding of DNA - https://en.wikipedia.org/wiki/Rosalind_Franklin + "rosalind", + // Vera Rubin - American astronomer who pioneered work on galaxy rotation rates. https://en.wikipedia.org/wiki/Vera_Rubin + "rubin", + // Meghnad Saha - Indian astrophysicist best known for his development of the Saha equation, used to describe chemical and physical conditions in stars - https://en.wikipedia.org/wiki/Meghnad_Saha + "saha", + // Jean E. Sammet developed FORMAC, the first widely used computer language for symbolic manipulation of mathematical formulas. https://en.wikipedia.org/wiki/Jean_E._Sammet + "sammet", + // Mildred Sanderson - American mathematician best known for Sanderson's theorem concerning modular invariants. https://en.wikipedia.org/wiki/Mildred_Sanderson + "sanderson", + // Satoshi Nakamoto is the name used by the unknown person or group of people who developed bitcoin, authored the bitcoin white paper, and created and deployed bitcoin's original reference implementation. https://en.wikipedia.org/wiki/Satoshi_Nakamoto + "satoshi", + // Adi Shamir - Israeli cryptographer whose numerous inventions and contributions to cryptography include the Ferge Fiat Shamir identification scheme, the Rivest Shamir Adleman (RSA) public-key cryptosystem, the Shamir's secret sharing scheme, the breaking of the Merkle-Hellman cryptosystem, the TWINKLE and TWIRL factoring devices and the discovery of differential cryptanalysis (with Eli Biham). https://en.wikipedia.org/wiki/Adi_Shamir + "shamir", + // Claude Shannon - The father of information theory and founder of digital circuit design theory. (https://en.wikipedia.org/wiki/Claude_Shannon) + "shannon", + // Carol Shaw - Originally an Atari employee, Carol Shaw is said to be the first female video game designer. https://en.wikipedia.org/wiki/Carol_Shaw_(video_game_designer) + "shaw", + // Dame Stephanie "Steve" Shirley - Founded a software company in 1962 employing women working from home. https://en.wikipedia.org/wiki/Steve_Shirley + "shirley", + // William Shockley co-invented the transistor - https://en.wikipedia.org/wiki/William_Shockley + "shockley", + // Lina Solomonovna Stern (or Shtern; Russian: Лина Соломоновна Штерн; 26 August 1878 – 7 March 1968) was a Soviet biochemist, physiologist and humanist whose medical discoveries saved thousands of lives at the fronts of World War II. She is best known for her pioneering work on blood–brain barrier, which she described as hemato-encephalic barrier in 1921. https://en.wikipedia.org/wiki/Lina_Stern + "shtern", + // Françoise Barré-Sinoussi - French virologist and Nobel Prize Laureate in Physiology or Medicine; her work was fundamental in identifying HIV as the cause of AIDS. https://en.wikipedia.org/wiki/Fran%C3%A7oise_Barr%C3%A9-Sinoussi + "sinoussi", + // Betty Snyder - one of the original programmers of the ENIAC. https://en.wikipedia.org/wiki/ENIAC - https://en.wikipedia.org/wiki/Betty_Holberton + "snyder", + // Cynthia Solomon - Pioneer in the fields of artificial intelligence, computer science and educational computing. Known for creation of Logo, an educational programming language. https://en.wikipedia.org/wiki/Cynthia_Solomon + "solomon", + // Frances Spence - one of the original programmers of the ENIAC. https://en.wikipedia.org/wiki/ENIAC - https://en.wikipedia.org/wiki/Frances_Spence + "spence", + // Michael Stonebraker is a database research pioneer and architect of Ingres, Postgres, VoltDB and SciDB. Winner of 2014 ACM Turing Award. https://en.wikipedia.org/wiki/Michael_Stonebraker + "stonebraker", + // Ivan Edward Sutherland - American computer scientist and Internet pioneer, widely regarded as the father of computer graphics. https://en.wikipedia.org/wiki/Ivan_Sutherland + "sutherland", + // Janese Swanson (with others) developed the first of the Carmen Sandiego games. She went on to found Girl Tech. https://en.wikipedia.org/wiki/Janese_Swanson + "swanson", + // Aaron Swartz was influential in creating RSS, Markdown, Creative Commons, Reddit, and much of the internet as we know it today. He was devoted to freedom of information on the web. https://en.wikiquote.org/wiki/Aaron_Swartz + "swartz", + // Bertha Swirles was a theoretical physicist who made a number of contributions to early quantum theory. https://en.wikipedia.org/wiki/Bertha_Swirles + "swirles", + // Helen Brooke Taussig - American cardiologist and founder of the field of paediatric cardiology. https://en.wikipedia.org/wiki/Helen_B._Taussig + "taussig", + // Valentina Tereshkova is a Russian engineer, cosmonaut and politician. She was the first woman to fly to space in 1963. In 2013, at the age of 76, she offered to go on a one-way mission to Mars. https://en.wikipedia.org/wiki/Valentina_Tereshkova + "tereshkova", + // Nikola Tesla invented the AC electric system and every gadget ever used by a James Bond villain. https://en.wikipedia.org/wiki/Nikola_Tesla + "tesla", + // Marie Tharp - American geologist and oceanic cartographer who co-created the first scientific map of the Atlantic Ocean floor. Her work led to the acceptance of the theories of plate tectonics and continental drift. https://en.wikipedia.org/wiki/Marie_Tharp + "tharp", + // Ken Thompson - co-creator of UNIX and the C programming language - https://en.wikipedia.org/wiki/Ken_Thompson + "thompson", + // Linus Torvalds invented Linux and Git. https://en.wikipedia.org/wiki/Linus_Torvalds + "torvalds", + // Youyou Tu - Chinese pharmaceutical chemist and educator known for discovering artemisinin and dihydroartemisinin, used to treat malaria, which has saved millions of lives. Joint winner of the 2015 Nobel Prize in Physiology or Medicine. https://en.wikipedia.org/wiki/Tu_Youyou + "tu", + // Alan Turing was a founding father of computer science. https://en.wikipedia.org/wiki/Alan_Turing. + "turing", + // Varahamihira - Ancient Indian mathematician who discovered trigonometric formulae during 505-587 CE - https://en.wikipedia.org/wiki/Var%C4%81hamihira#Contributions + "varahamihira", + // Dorothy Vaughan was a NASA mathematician and computer programmer on the SCOUT launch vehicle program that put America's first satellites into space - https://en.wikipedia.org/wiki/Dorothy_Vaughan + "vaughan", + // Sir Mokshagundam Visvesvaraya - is a notable Indian engineer. He is a recipient of the Indian Republic's highest honour, the Bharat Ratna, in 1955. On his birthday, 15 September is celebrated as Engineer's Day in India in his memory - https://en.wikipedia.org/wiki/Visvesvaraya + "visvesvaraya", + // Christiane Nüsslein-Volhard - German biologist, won Nobel Prize in Physiology or Medicine in 1995 for research on the genetic control of embryonic development. https://en.wikipedia.org/wiki/Christiane_N%C3%BCsslein-Volhard + "volhard", + // Cédric Villani - French mathematician, won Fields Medal, Fermat Prize and Poincaré Price for his work in differential geometry and statistical mechanics. https://en.wikipedia.org/wiki/C%C3%A9dric_Villani + "villani", + // Marlyn Wescoff - one of the original programmers of the ENIAC. https://en.wikipedia.org/wiki/ENIAC - https://en.wikipedia.org/wiki/Marlyn_Meltzer + "wescoff", + // Sylvia B. Wilbur - British computer scientist who helped develop the ARPANET, was one of the first to exchange email in the UK and a leading researcher in computer-supported collaborative work. https://en.wikipedia.org/wiki/Sylvia_Wilbur + "wilbur", + // Andrew Wiles - Notable British mathematician who proved the enigmatic Fermat's Last Theorem - https://en.wikipedia.org/wiki/Andrew_Wiles + "wiles", + // Roberta Williams, did pioneering work in graphical adventure games for personal computers, particularly the King's Quest series. https://en.wikipedia.org/wiki/Roberta_Williams + "williams", + // Malcolm John Williamson - British mathematician and cryptographer employed by the GCHQ. Developed in 1974 what is now known as Diffie-Hellman key exchange (Diffie and Hellman first published the scheme in 1976). https://en.wikipedia.org/wiki/Malcolm_J._Williamson + "williamson", + // Sophie Wilson designed the first Acorn Micro-Computer and the instruction set for ARM processors. https://en.wikipedia.org/wiki/Sophie_Wilson + "wilson", + // Jeannette Wing - co-developed the Liskov substitution principle. - https://en.wikipedia.org/wiki/Jeannette_Wing + "wing", + // Steve Wozniak invented the Apple I and Apple II. https://en.wikipedia.org/wiki/Steve_Wozniak + "wozniak", + // The Wright brothers, Orville and Wilbur - credited with inventing and building the world's first successful airplane and making the first controlled, powered and sustained heavier-than-air human flight - https://en.wikipedia.org/wiki/Wright_brothers + "wright", + // Chien-Shiung Wu - Chinese-American experimental physicist who made significant contributions to nuclear physics. https://en.wikipedia.org/wiki/Chien-Shiung_Wu + "wu", + // Rosalyn Sussman Yalow - Rosalyn Sussman Yalow was an American medical physicist, and a co-winner of the 1977 Nobel Prize in Physiology or Medicine for development of the radioimmunoassay technique. https://en.wikipedia.org/wiki/Rosalyn_Sussman_Yalow + "yalow", + // Ada Yonath - an Israeli crystallographer, the first woman from the Middle East to win a Nobel prize in the sciences. https://en.wikipedia.org/wiki/Ada_Yonath + "yonath", + // Nikolay Yegorovich Zhukovsky (Russian: Никола́й Его́рович Жуко́вский, January 17 1847 – March 17, 1921) was a Russian scientist, mathematician and engineer, and a founding father of modern aero- and hydrodynamics. Whereas contemporary scientists scoffed at the idea of human flight, Zhukovsky was the first to undertake the study of airflow. He is often called the Father of Russian Aviation. https://en.wikipedia.org/wiki/Nikolay_Yegorovich_Zhukovsky + "zhukovsky" +]; +const randomName = (prefix = "", separator = "-") => { + const name = `${ADJECTIVES[Math.floor(Math.random() * ADJECTIVES.length)] ?? ""}${separator}${NAMES[Math.floor(Math.random() * NAMES.length)] ?? ""}`; + if (name === `boring${separator}wozniak`) { + return randomName(prefix, separator); } + return prefix.length > 0 ? `${prefix}${separator}${name}` : name; }; - -var validationRules_gen = /*#__PURE__*/Object.freeze({ - __proto__: null, - ListHostingsRequest: ListHostingsRequest -}); - -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. - -var index_gen = /*#__PURE__*/Object.freeze({ - __proto__: null, - API: API, - HOSTING_TRANSIENT_STATUSES: HOSTING_TRANSIENT_STATUSES, - ValidationRules: validationRules_gen -}); - -var index = /*#__PURE__*/Object.freeze({ - __proto__: null, - v1alpha1: index_gen -}); - -exports.API = API$u; -exports.Account = index$v; -exports.AppleSilicon = index$u; -exports.BareMetal = index$s; -exports.Billing = index$r; -exports.Block = index$q; -exports.Cockpit = index$p; -exports.Container = index$o; -exports.DocumentDB = index$n; -exports.Domain = index$m; -exports.Errors = index$w; -exports.FlexibleIP = index$l; -exports.Function = index$k; -exports.IAM = index$j; -exports.IOT = index$g; -exports.IPFS = index$f; -exports.Instance = index$h; -exports.K8S = index$d; -exports.LB = index$b; -exports.MNQ = index$9; -exports.Marketplace = index$a; -exports.RDB = index$8; -exports.Redis = index$7; -exports.Registry = index$6; -exports.Secret = index$5; -exports.Test = index$4; -exports.TransactionalEmail = index$3; -exports.VPC = index$2; -exports.VPCGW = index$1; -exports.Webhosting = index; -exports.addAsyncHeaderInterceptor = addAsyncHeaderInterceptor; -exports.authenticateWithSessionToken = authenticateWithSessionToken; -exports.createAdvancedClient = createAdvancedClient; -exports.createClient = createClient; -exports.enableConsoleLogger = enableConsoleLogger; -exports.enrichForPagination = enrichForPagination; -exports.isJSONObject = isJSONObject; -exports.marshalMoney = marshalMoney; -exports.marshalScwFile = marshalScwFile; -exports.marshalTimeSeries = marshalTimeSeries; -exports.resolveOneOf = resolveOneOf; -exports.setLogger = setLogger; -exports.unmarshalArrayOfObject = unmarshalArrayOfObject; -exports.unmarshalDate = unmarshalDate; -exports.unmarshalMapOfObject = unmarshalMapOfObject; -exports.unmarshalMoney = unmarshalMoney; -exports.unmarshalScwFile = unmarshalScwFile; -exports.unmarshalServiceInfo = unmarshalServiceInfo; -exports.unmarshalTimeSeries = unmarshalTimeSeries; -exports.unmarshalTimeSeriesPoint = unmarshalTimeSeriesPoint; -exports.urlParams = urlParams; -exports.validatePathParam = validatePathParam; -exports.waitForResource = waitForResource; -exports.withAdditionalInterceptors = withAdditionalInterceptors; -exports.withDefaultPageSize = withDefaultPageSize; -exports.withHTTPClient = withHTTPClient; -exports.withProfile = withProfile; -exports.withUserAgent = withUserAgent; -exports.withUserAgentSuffix = withUserAgentSuffix; +module.exports = randomName; /***/ }), -/***/ 472: +/***/ 2472: /***/ ((module) => { "use strict"; diff --git a/dist/index.js.map b/dist/index.js.map index 74d6da2..cacfc3d 100644 --- a/dist/index.js.map +++ b/dist/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC1EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACzEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1RA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACzmBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5lBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AC1SA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC7vDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChMA;;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACvQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC5LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACvMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACnMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AChxCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACnBA;;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;ACtizBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC7BA;AACA;;;;AEDA;AACA;AACA;AACA","sources":[".././dist/index.js",".././dist/utils.js",".././node_modules/@actions/core/lib/command.js",".././node_modules/@actions/core/lib/core.js",".././node_modules/@actions/core/lib/file-command.js",".././node_modules/@actions/core/lib/oidc-utils.js",".././node_modules/@actions/core/lib/path-utils.js",".././node_modules/@actions/core/lib/platform.js",".././node_modules/@actions/core/lib/summary.js",".././node_modules/@actions/core/lib/utils.js",".././node_modules/@actions/exec/lib/exec.js",".././node_modules/@actions/exec/lib/toolrunner.js",".././node_modules/@actions/http-client/lib/auth.js",".././node_modules/@actions/http-client/lib/index.js",".././node_modules/@actions/http-client/lib/proxy.js",".././node_modules/@actions/io/lib/io-util.js",".././node_modules/@actions/io/lib/io.js",".././node_modules/cross-fetch/dist/node-polyfill.js",".././node_modules/cross-fetch/dist/node-ponyfill.js",".././node_modules/node-fetch/lib/index.js",".././node_modules/tr46/index.js",".././node_modules/tunnel/index.js",".././node_modules/tunnel/lib/tunnel.js",".././node_modules/webidl-conversions/lib/index.js",".././node_modules/whatwg-url/lib/URL-impl.js",".././node_modules/whatwg-url/lib/URL.js",".././node_modules/whatwg-url/lib/public-api.js",".././node_modules/whatwg-url/lib/url-state-machine.js",".././node_modules/whatwg-url/lib/utils.js",".././node_modules/@vercel/ncc/dist/ncc/@@notfound.js","../external node-commonjs \"assert\"","../external node-commonjs \"child_process\"","../external node-commonjs \"crypto\"","../external node-commonjs \"events\"","../external node-commonjs \"fs\"","../external node-commonjs \"http\"","../external node-commonjs \"https\"","../external node-commonjs \"net\"","../external node-commonjs \"os\"","../external node-commonjs \"path\"","../external node-commonjs \"punycode\"","../external node-commonjs \"stream\"","../external node-commonjs \"string_decoder\"","../external node-commonjs \"timers\"","../external node-commonjs \"tls\"","../external node-commonjs \"url\"","../external node-commonjs \"util\"","../external node-commonjs \"zlib\"",".././node_modules/@scaleway/sdk/dist/index.cjs","../webpack/bootstrap","../webpack/runtime/compat","../webpack/before-startup","../webpack/startup","../webpack/after-startup"],"sourcesContent":["\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.run = void 0;\nconst core = __importStar(require(\"@actions/core\"));\nrequire(\"cross-fetch/polyfill\");\nconst sdk_1 = require(\"@scaleway/sdk\");\nconst utils_1 = require(\"./utils\");\nfunction run() {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n const client = (0, sdk_1.createClient)({\n accessKey: core.getInput(\"access-key\"),\n secretKey: core.getInput(\"secret-key\"),\n defaultProjectId: core.getInput(\"default-project-id\"),\n defaultOrganizationId: core.getInput(\"default-organization-id\"),\n defaultRegion: core.getInput(\"default-region\"),\n defaultZone: core.getInput(\"default-zone\"),\n });\n const api = new sdk_1.Secret.v1alpha1.API(client);\n const secretConfigInputs = [\n ...new Set(core.getMultilineInput(\"secret-names\")),\n ];\n for (let secretConf of secretConfigInputs) {\n const [envName, secret] = (0, utils_1.extractAlias)(secretConf);\n try {\n const secretValue = yield (0, utils_1.getSecretValue)(api, secret);\n core.setSecret(secretValue);\n core.debug(`Injecting secret ${secret} as environment variable '${envName}'.`);\n core.exportVariable(envName, secretValue);\n }\n catch (error) {\n core.setFailed(`Failed to fetch secret: '${secret}'. Error: ${error}.`);\n }\n }\n }\n catch (error) {\n if (error instanceof Error)\n core.setFailed(error.message);\n }\n });\n}\nexports.run = run;\nrun();\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getSecretValue = exports.splitNameAndPath = exports.extractAlias = exports.transformToValidEnvName = void 0;\nfunction transformToValidEnvName(secretName) {\n // Leading digits are invalid\n if (secretName.match(/^[0-9]/)) {\n secretName = \"_\".concat(secretName);\n }\n // Remove invalid characters\n return secretName.replace(/[^a-zA-Z0-9_]/g, \"_\").toUpperCase();\n}\nexports.transformToValidEnvName = transformToValidEnvName;\nfunction extractAlias(input) {\n const parsedInput = input.split(\",\");\n let secretRef = input.trim();\n let secretPath = \"/\";\n let alias = transformToValidEnvName(secretRef);\n let secretName = secretRef;\n if (parsedInput.length > 1) {\n alias = parsedInput[0].trim();\n secretRef = parsedInput[1].trim();\n secretName = secretRef;\n const validateEnvName = transformToValidEnvName(alias);\n if (alias !== validateEnvName) {\n throw new Error(`The alias '${alias}' is not a valid environment name. Please verify that it has uppercase letters, numbers, and underscore only.`);\n }\n }\n if (secretRef.startsWith(\"/\")) {\n [secretName, secretPath] = splitNameAndPath(secretRef);\n if (parsedInput.length == 1) {\n alias = transformToValidEnvName(secretName);\n }\n }\n return [alias, { name: secretName, path: secretPath }];\n}\nexports.extractAlias = extractAlias;\nfunction splitNameAndPath(ref) {\n let path = \"/\";\n const sep = ref.lastIndexOf(\"/\");\n if (sep > 0) {\n path = ref.substring(0, sep);\n }\n const name = ref.substring(sep + 1);\n return [name, path];\n}\nexports.splitNameAndPath = splitNameAndPath;\nfunction getSecretValue(api, secret) {\n return __awaiter(this, void 0, void 0, function* () {\n const secretList = yield api.listSecrets({\n name: secret.name,\n path: secret.path,\n page: 1,\n pageSize: 1,\n });\n if (secretList.totalCount < 1) {\n throw new Error(`No secret found with '${secret.name}' name and '${secret.path}' path`);\n }\n const secretResponse = yield api.accessSecretVersion({\n secretId: secretList.secrets[0].id,\n revision: \"latest_enabled\",\n });\n return Buffer.from(secretResponse.data, \"base64\").toString(\"binary\");\n });\n}\nexports.getSecretValue = getSecretValue;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.issue = exports.issueCommand = void 0;\nconst os = __importStar(require(\"os\"));\nconst utils_1 = require(\"./utils\");\n/**\n * Commands\n *\n * Command Format:\n * ::name key=value,key=value::message\n *\n * Examples:\n * ::warning::This is the message\n * ::set-env name=MY_VAR::some value\n */\nfunction issueCommand(command, properties, message) {\n const cmd = new Command(command, properties, message);\n process.stdout.write(cmd.toString() + os.EOL);\n}\nexports.issueCommand = issueCommand;\nfunction issue(name, message = '') {\n issueCommand(name, {}, message);\n}\nexports.issue = issue;\nconst CMD_STRING = '::';\nclass Command {\n constructor(command, properties, message) {\n if (!command) {\n command = 'missing.command';\n }\n this.command = command;\n this.properties = properties;\n this.message = message;\n }\n toString() {\n let cmdStr = CMD_STRING + this.command;\n if (this.properties && Object.keys(this.properties).length > 0) {\n cmdStr += ' ';\n let first = true;\n for (const key in this.properties) {\n if (this.properties.hasOwnProperty(key)) {\n const val = this.properties[key];\n if (val) {\n if (first) {\n first = false;\n }\n else {\n cmdStr += ',';\n }\n cmdStr += `${key}=${escapeProperty(val)}`;\n }\n }\n }\n }\n cmdStr += `${CMD_STRING}${escapeData(this.message)}`;\n return cmdStr;\n }\n}\nfunction escapeData(s) {\n return (0, utils_1.toCommandValue)(s)\n .replace(/%/g, '%25')\n .replace(/\\r/g, '%0D')\n .replace(/\\n/g, '%0A');\n}\nfunction escapeProperty(s) {\n return (0, utils_1.toCommandValue)(s)\n .replace(/%/g, '%25')\n .replace(/\\r/g, '%0D')\n .replace(/\\n/g, '%0A')\n .replace(/:/g, '%3A')\n .replace(/,/g, '%2C');\n}\n//# sourceMappingURL=command.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.platform = exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = exports.markdownSummary = exports.summary = exports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0;\nconst command_1 = require(\"./command\");\nconst file_command_1 = require(\"./file-command\");\nconst utils_1 = require(\"./utils\");\nconst os = __importStar(require(\"os\"));\nconst path = __importStar(require(\"path\"));\nconst oidc_utils_1 = require(\"./oidc-utils\");\n/**\n * The code to exit an action\n */\nvar ExitCode;\n(function (ExitCode) {\n /**\n * A code indicating that the action was successful\n */\n ExitCode[ExitCode[\"Success\"] = 0] = \"Success\";\n /**\n * A code indicating that the action was a failure\n */\n ExitCode[ExitCode[\"Failure\"] = 1] = \"Failure\";\n})(ExitCode || (exports.ExitCode = ExitCode = {}));\n//-----------------------------------------------------------------------\n// Variables\n//-----------------------------------------------------------------------\n/**\n * Sets env variable for this action and future actions in the job\n * @param name the name of the variable to set\n * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction exportVariable(name, val) {\n const convertedVal = (0, utils_1.toCommandValue)(val);\n process.env[name] = convertedVal;\n const filePath = process.env['GITHUB_ENV'] || '';\n if (filePath) {\n return (0, file_command_1.issueFileCommand)('ENV', (0, file_command_1.prepareKeyValueMessage)(name, val));\n }\n (0, command_1.issueCommand)('set-env', { name }, convertedVal);\n}\nexports.exportVariable = exportVariable;\n/**\n * Registers a secret which will get masked from logs\n * @param secret value of the secret\n */\nfunction setSecret(secret) {\n (0, command_1.issueCommand)('add-mask', {}, secret);\n}\nexports.setSecret = setSecret;\n/**\n * Prepends inputPath to the PATH (for this action and future actions)\n * @param inputPath\n */\nfunction addPath(inputPath) {\n const filePath = process.env['GITHUB_PATH'] || '';\n if (filePath) {\n (0, file_command_1.issueFileCommand)('PATH', inputPath);\n }\n else {\n (0, command_1.issueCommand)('add-path', {}, inputPath);\n }\n process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;\n}\nexports.addPath = addPath;\n/**\n * Gets the value of an input.\n * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.\n * Returns an empty string if the value is not defined.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string\n */\nfunction getInput(name, options) {\n const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';\n if (options && options.required && !val) {\n throw new Error(`Input required and not supplied: ${name}`);\n }\n if (options && options.trimWhitespace === false) {\n return val;\n }\n return val.trim();\n}\nexports.getInput = getInput;\n/**\n * Gets the values of an multiline input. Each value is also trimmed.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string[]\n *\n */\nfunction getMultilineInput(name, options) {\n const inputs = getInput(name, options)\n .split('\\n')\n .filter(x => x !== '');\n if (options && options.trimWhitespace === false) {\n return inputs;\n }\n return inputs.map(input => input.trim());\n}\nexports.getMultilineInput = getMultilineInput;\n/**\n * Gets the input value of the boolean type in the YAML 1.2 \"core schema\" specification.\n * Support boolean input list: `true | True | TRUE | false | False | FALSE` .\n * The return value is also in boolean type.\n * ref: https://yaml.org/spec/1.2/spec.html#id2804923\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns boolean\n */\nfunction getBooleanInput(name, options) {\n const trueValue = ['true', 'True', 'TRUE'];\n const falseValue = ['false', 'False', 'FALSE'];\n const val = getInput(name, options);\n if (trueValue.includes(val))\n return true;\n if (falseValue.includes(val))\n return false;\n throw new TypeError(`Input does not meet YAML 1.2 \"Core Schema\" specification: ${name}\\n` +\n `Support boolean input list: \\`true | True | TRUE | false | False | FALSE\\``);\n}\nexports.getBooleanInput = getBooleanInput;\n/**\n * Sets the value of an output.\n *\n * @param name name of the output to set\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction setOutput(name, value) {\n const filePath = process.env['GITHUB_OUTPUT'] || '';\n if (filePath) {\n return (0, file_command_1.issueFileCommand)('OUTPUT', (0, file_command_1.prepareKeyValueMessage)(name, value));\n }\n process.stdout.write(os.EOL);\n (0, command_1.issueCommand)('set-output', { name }, (0, utils_1.toCommandValue)(value));\n}\nexports.setOutput = setOutput;\n/**\n * Enables or disables the echoing of commands into stdout for the rest of the step.\n * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.\n *\n */\nfunction setCommandEcho(enabled) {\n (0, command_1.issue)('echo', enabled ? 'on' : 'off');\n}\nexports.setCommandEcho = setCommandEcho;\n//-----------------------------------------------------------------------\n// Results\n//-----------------------------------------------------------------------\n/**\n * Sets the action status to failed.\n * When the action exits it will be with an exit code of 1\n * @param message add error issue message\n */\nfunction setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}\nexports.setFailed = setFailed;\n//-----------------------------------------------------------------------\n// Logging Commands\n//-----------------------------------------------------------------------\n/**\n * Gets whether Actions Step Debug is on or not\n */\nfunction isDebug() {\n return process.env['RUNNER_DEBUG'] === '1';\n}\nexports.isDebug = isDebug;\n/**\n * Writes debug message to user log\n * @param message debug message\n */\nfunction debug(message) {\n (0, command_1.issueCommand)('debug', {}, message);\n}\nexports.debug = debug;\n/**\n * Adds an error issue\n * @param message error issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction error(message, properties = {}) {\n (0, command_1.issueCommand)('error', (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message);\n}\nexports.error = error;\n/**\n * Adds a warning issue\n * @param message warning issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction warning(message, properties = {}) {\n (0, command_1.issueCommand)('warning', (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message);\n}\nexports.warning = warning;\n/**\n * Adds a notice issue\n * @param message notice issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction notice(message, properties = {}) {\n (0, command_1.issueCommand)('notice', (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message);\n}\nexports.notice = notice;\n/**\n * Writes info to log with console.log.\n * @param message info message\n */\nfunction info(message) {\n process.stdout.write(message + os.EOL);\n}\nexports.info = info;\n/**\n * Begin an output group.\n *\n * Output until the next `groupEnd` will be foldable in this group\n *\n * @param name The name of the output group\n */\nfunction startGroup(name) {\n (0, command_1.issue)('group', name);\n}\nexports.startGroup = startGroup;\n/**\n * End an output group.\n */\nfunction endGroup() {\n (0, command_1.issue)('endgroup');\n}\nexports.endGroup = endGroup;\n/**\n * Wrap an asynchronous function call in a group.\n *\n * Returns the same type as the function itself.\n *\n * @param name The name of the group\n * @param fn The function to wrap in the group\n */\nfunction group(name, fn) {\n return __awaiter(this, void 0, void 0, function* () {\n startGroup(name);\n let result;\n try {\n result = yield fn();\n }\n finally {\n endGroup();\n }\n return result;\n });\n}\nexports.group = group;\n//-----------------------------------------------------------------------\n// Wrapper action state\n//-----------------------------------------------------------------------\n/**\n * Saves state for current action, the state can only be retrieved by this action's post job execution.\n *\n * @param name name of the state to store\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction saveState(name, value) {\n const filePath = process.env['GITHUB_STATE'] || '';\n if (filePath) {\n return (0, file_command_1.issueFileCommand)('STATE', (0, file_command_1.prepareKeyValueMessage)(name, value));\n }\n (0, command_1.issueCommand)('save-state', { name }, (0, utils_1.toCommandValue)(value));\n}\nexports.saveState = saveState;\n/**\n * Gets the value of an state set by this action's main execution.\n *\n * @param name name of the state to get\n * @returns string\n */\nfunction getState(name) {\n return process.env[`STATE_${name}`] || '';\n}\nexports.getState = getState;\nfunction getIDToken(aud) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield oidc_utils_1.OidcClient.getIDToken(aud);\n });\n}\nexports.getIDToken = getIDToken;\n/**\n * Summary exports\n */\nvar summary_1 = require(\"./summary\");\nObject.defineProperty(exports, \"summary\", { enumerable: true, get: function () { return summary_1.summary; } });\n/**\n * @deprecated use core.summary\n */\nvar summary_2 = require(\"./summary\");\nObject.defineProperty(exports, \"markdownSummary\", { enumerable: true, get: function () { return summary_2.markdownSummary; } });\n/**\n * Path exports\n */\nvar path_utils_1 = require(\"./path-utils\");\nObject.defineProperty(exports, \"toPosixPath\", { enumerable: true, get: function () { return path_utils_1.toPosixPath; } });\nObject.defineProperty(exports, \"toWin32Path\", { enumerable: true, get: function () { return path_utils_1.toWin32Path; } });\nObject.defineProperty(exports, \"toPlatformPath\", { enumerable: true, get: function () { return path_utils_1.toPlatformPath; } });\n/**\n * Platform utilities exports\n */\nexports.platform = __importStar(require(\"./platform\"));\n//# sourceMappingURL=core.js.map","\"use strict\";\n// For internal use, subject to change.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.prepareKeyValueMessage = exports.issueFileCommand = void 0;\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nconst crypto = __importStar(require(\"crypto\"));\nconst fs = __importStar(require(\"fs\"));\nconst os = __importStar(require(\"os\"));\nconst utils_1 = require(\"./utils\");\nfunction issueFileCommand(command, message) {\n const filePath = process.env[`GITHUB_${command}`];\n if (!filePath) {\n throw new Error(`Unable to find environment variable for file command ${command}`);\n }\n if (!fs.existsSync(filePath)) {\n throw new Error(`Missing file at path: ${filePath}`);\n }\n fs.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os.EOL}`, {\n encoding: 'utf8'\n });\n}\nexports.issueFileCommand = issueFileCommand;\nfunction prepareKeyValueMessage(key, value) {\n const delimiter = `ghadelimiter_${crypto.randomUUID()}`;\n const convertedValue = (0, utils_1.toCommandValue)(value);\n // These should realistically never happen, but just in case someone finds a\n // way to exploit uuid generation let's not allow keys or values that contain\n // the delimiter.\n if (key.includes(delimiter)) {\n throw new Error(`Unexpected input: name should not contain the delimiter \"${delimiter}\"`);\n }\n if (convertedValue.includes(delimiter)) {\n throw new Error(`Unexpected input: value should not contain the delimiter \"${delimiter}\"`);\n }\n return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`;\n}\nexports.prepareKeyValueMessage = prepareKeyValueMessage;\n//# sourceMappingURL=file-command.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.OidcClient = void 0;\nconst http_client_1 = require(\"@actions/http-client\");\nconst auth_1 = require(\"@actions/http-client/lib/auth\");\nconst core_1 = require(\"./core\");\nclass OidcClient {\n static createHttpClient(allowRetry = true, maxRetry = 10) {\n const requestOptions = {\n allowRetries: allowRetry,\n maxRetries: maxRetry\n };\n return new http_client_1.HttpClient('actions/oidc-client', [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions);\n }\n static getRequestToken() {\n const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN'];\n if (!token) {\n throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable');\n }\n return token;\n }\n static getIDTokenUrl() {\n const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL'];\n if (!runtimeUrl) {\n throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable');\n }\n return runtimeUrl;\n }\n static getCall(id_token_url) {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n const httpclient = OidcClient.createHttpClient();\n const res = yield httpclient\n .getJson(id_token_url)\n .catch(error => {\n throw new Error(`Failed to get ID Token. \\n \n Error Code : ${error.statusCode}\\n \n Error Message: ${error.message}`);\n });\n const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;\n if (!id_token) {\n throw new Error('Response json body do not have ID Token field');\n }\n return id_token;\n });\n }\n static getIDToken(audience) {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n // New ID Token is requested from action service\n let id_token_url = OidcClient.getIDTokenUrl();\n if (audience) {\n const encodedAudience = encodeURIComponent(audience);\n id_token_url = `${id_token_url}&audience=${encodedAudience}`;\n }\n (0, core_1.debug)(`ID token url is ${id_token_url}`);\n const id_token = yield OidcClient.getCall(id_token_url);\n (0, core_1.setSecret)(id_token);\n return id_token;\n }\n catch (error) {\n throw new Error(`Error message: ${error.message}`);\n }\n });\n }\n}\nexports.OidcClient = OidcClient;\n//# sourceMappingURL=oidc-utils.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0;\nconst path = __importStar(require(\"path\"));\n/**\n * toPosixPath converts the given path to the posix form. On Windows, \\\\ will be\n * replaced with /.\n *\n * @param pth. Path to transform.\n * @return string Posix path.\n */\nfunction toPosixPath(pth) {\n return pth.replace(/[\\\\]/g, '/');\n}\nexports.toPosixPath = toPosixPath;\n/**\n * toWin32Path converts the given path to the win32 form. On Linux, / will be\n * replaced with \\\\.\n *\n * @param pth. Path to transform.\n * @return string Win32 path.\n */\nfunction toWin32Path(pth) {\n return pth.replace(/[/]/g, '\\\\');\n}\nexports.toWin32Path = toWin32Path;\n/**\n * toPlatformPath converts the given path to a platform-specific path. It does\n * this by replacing instances of / and \\ with the platform-specific path\n * separator.\n *\n * @param pth The path to platformize.\n * @return string The platform-specific path.\n */\nfunction toPlatformPath(pth) {\n return pth.replace(/[/\\\\]/g, path.sep);\n}\nexports.toPlatformPath = toPlatformPath;\n//# sourceMappingURL=path-utils.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getDetails = exports.isLinux = exports.isMacOS = exports.isWindows = exports.arch = exports.platform = void 0;\nconst os_1 = __importDefault(require(\"os\"));\nconst exec = __importStar(require(\"@actions/exec\"));\nconst getWindowsInfo = () => __awaiter(void 0, void 0, void 0, function* () {\n const { stdout: version } = yield exec.getExecOutput('powershell -command \"(Get-CimInstance -ClassName Win32_OperatingSystem).Version\"', undefined, {\n silent: true\n });\n const { stdout: name } = yield exec.getExecOutput('powershell -command \"(Get-CimInstance -ClassName Win32_OperatingSystem).Caption\"', undefined, {\n silent: true\n });\n return {\n name: name.trim(),\n version: version.trim()\n };\n});\nconst getMacOsInfo = () => __awaiter(void 0, void 0, void 0, function* () {\n var _a, _b, _c, _d;\n const { stdout } = yield exec.getExecOutput('sw_vers', undefined, {\n silent: true\n });\n const version = (_b = (_a = stdout.match(/ProductVersion:\\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : '';\n const name = (_d = (_c = stdout.match(/ProductName:\\s*(.+)/)) === null || _c === void 0 ? void 0 : _c[1]) !== null && _d !== void 0 ? _d : '';\n return {\n name,\n version\n };\n});\nconst getLinuxInfo = () => __awaiter(void 0, void 0, void 0, function* () {\n const { stdout } = yield exec.getExecOutput('lsb_release', ['-i', '-r', '-s'], {\n silent: true\n });\n const [name, version] = stdout.trim().split('\\n');\n return {\n name,\n version\n };\n});\nexports.platform = os_1.default.platform();\nexports.arch = os_1.default.arch();\nexports.isWindows = exports.platform === 'win32';\nexports.isMacOS = exports.platform === 'darwin';\nexports.isLinux = exports.platform === 'linux';\nfunction getDetails() {\n return __awaiter(this, void 0, void 0, function* () {\n return Object.assign(Object.assign({}, (yield (exports.isWindows\n ? getWindowsInfo()\n : exports.isMacOS\n ? getMacOsInfo()\n : getLinuxInfo()))), { platform: exports.platform,\n arch: exports.arch,\n isWindows: exports.isWindows,\n isMacOS: exports.isMacOS,\n isLinux: exports.isLinux });\n });\n}\nexports.getDetails = getDetails;\n//# sourceMappingURL=platform.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0;\nconst os_1 = require(\"os\");\nconst fs_1 = require(\"fs\");\nconst { access, appendFile, writeFile } = fs_1.promises;\nexports.SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY';\nexports.SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary';\nclass Summary {\n constructor() {\n this._buffer = '';\n }\n /**\n * Finds the summary file path from the environment, rejects if env var is not found or file does not exist\n * Also checks r/w permissions.\n *\n * @returns step summary file path\n */\n filePath() {\n return __awaiter(this, void 0, void 0, function* () {\n if (this._filePath) {\n return this._filePath;\n }\n const pathFromEnv = process.env[exports.SUMMARY_ENV_VAR];\n if (!pathFromEnv) {\n throw new Error(`Unable to find environment variable for $${exports.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);\n }\n try {\n yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK);\n }\n catch (_a) {\n throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`);\n }\n this._filePath = pathFromEnv;\n return this._filePath;\n });\n }\n /**\n * Wraps content in an HTML tag, adding any HTML attributes\n *\n * @param {string} tag HTML tag to wrap\n * @param {string | null} content content within the tag\n * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add\n *\n * @returns {string} content wrapped in HTML element\n */\n wrap(tag, content, attrs = {}) {\n const htmlAttrs = Object.entries(attrs)\n .map(([key, value]) => ` ${key}=\"${value}\"`)\n .join('');\n if (!content) {\n return `<${tag}${htmlAttrs}>`;\n }\n return `<${tag}${htmlAttrs}>${content}`;\n }\n /**\n * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default.\n *\n * @param {SummaryWriteOptions} [options] (optional) options for write operation\n *\n * @returns {Promise} summary instance\n */\n write(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite);\n const filePath = yield this.filePath();\n const writeFunc = overwrite ? writeFile : appendFile;\n yield writeFunc(filePath, this._buffer, { encoding: 'utf8' });\n return this.emptyBuffer();\n });\n }\n /**\n * Clears the summary buffer and wipes the summary file\n *\n * @returns {Summary} summary instance\n */\n clear() {\n return __awaiter(this, void 0, void 0, function* () {\n return this.emptyBuffer().write({ overwrite: true });\n });\n }\n /**\n * Returns the current summary buffer as a string\n *\n * @returns {string} string of summary buffer\n */\n stringify() {\n return this._buffer;\n }\n /**\n * If the summary buffer is empty\n *\n * @returns {boolen} true if the buffer is empty\n */\n isEmptyBuffer() {\n return this._buffer.length === 0;\n }\n /**\n * Resets the summary buffer without writing to summary file\n *\n * @returns {Summary} summary instance\n */\n emptyBuffer() {\n this._buffer = '';\n return this;\n }\n /**\n * Adds raw text to the summary buffer\n *\n * @param {string} text content to add\n * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false)\n *\n * @returns {Summary} summary instance\n */\n addRaw(text, addEOL = false) {\n this._buffer += text;\n return addEOL ? this.addEOL() : this;\n }\n /**\n * Adds the operating system-specific end-of-line marker to the buffer\n *\n * @returns {Summary} summary instance\n */\n addEOL() {\n return this.addRaw(os_1.EOL);\n }\n /**\n * Adds an HTML codeblock to the summary buffer\n *\n * @param {string} code content to render within fenced code block\n * @param {string} lang (optional) language to syntax highlight code\n *\n * @returns {Summary} summary instance\n */\n addCodeBlock(code, lang) {\n const attrs = Object.assign({}, (lang && { lang }));\n const element = this.wrap('pre', this.wrap('code', code), attrs);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML list to the summary buffer\n *\n * @param {string[]} items list of items to render\n * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false)\n *\n * @returns {Summary} summary instance\n */\n addList(items, ordered = false) {\n const tag = ordered ? 'ol' : 'ul';\n const listItems = items.map(item => this.wrap('li', item)).join('');\n const element = this.wrap(tag, listItems);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML table to the summary buffer\n *\n * @param {SummaryTableCell[]} rows table rows\n *\n * @returns {Summary} summary instance\n */\n addTable(rows) {\n const tableBody = rows\n .map(row => {\n const cells = row\n .map(cell => {\n if (typeof cell === 'string') {\n return this.wrap('td', cell);\n }\n const { header, data, colspan, rowspan } = cell;\n const tag = header ? 'th' : 'td';\n const attrs = Object.assign(Object.assign({}, (colspan && { colspan })), (rowspan && { rowspan }));\n return this.wrap(tag, data, attrs);\n })\n .join('');\n return this.wrap('tr', cells);\n })\n .join('');\n const element = this.wrap('table', tableBody);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds a collapsable HTML details element to the summary buffer\n *\n * @param {string} label text for the closed state\n * @param {string} content collapsable content\n *\n * @returns {Summary} summary instance\n */\n addDetails(label, content) {\n const element = this.wrap('details', this.wrap('summary', label) + content);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML image tag to the summary buffer\n *\n * @param {string} src path to the image you to embed\n * @param {string} alt text description of the image\n * @param {SummaryImageOptions} options (optional) addition image attributes\n *\n * @returns {Summary} summary instance\n */\n addImage(src, alt, options) {\n const { width, height } = options || {};\n const attrs = Object.assign(Object.assign({}, (width && { width })), (height && { height }));\n const element = this.wrap('img', null, Object.assign({ src, alt }, attrs));\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML section heading element\n *\n * @param {string} text heading text\n * @param {number | string} [level=1] (optional) the heading level, default: 1\n *\n * @returns {Summary} summary instance\n */\n addHeading(text, level) {\n const tag = `h${level}`;\n const allowedTag = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tag)\n ? tag\n : 'h1';\n const element = this.wrap(allowedTag, text);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML thematic break (
) to the summary buffer\n *\n * @returns {Summary} summary instance\n */\n addSeparator() {\n const element = this.wrap('hr', null);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML line break (
) to the summary buffer\n *\n * @returns {Summary} summary instance\n */\n addBreak() {\n const element = this.wrap('br', null);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML blockquote to the summary buffer\n *\n * @param {string} text quote text\n * @param {string} cite (optional) citation url\n *\n * @returns {Summary} summary instance\n */\n addQuote(text, cite) {\n const attrs = Object.assign({}, (cite && { cite }));\n const element = this.wrap('blockquote', text, attrs);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML anchor tag to the summary buffer\n *\n * @param {string} text link text/content\n * @param {string} href hyperlink\n *\n * @returns {Summary} summary instance\n */\n addLink(text, href) {\n const element = this.wrap('a', text, { href });\n return this.addRaw(element).addEOL();\n }\n}\nconst _summary = new Summary();\n/**\n * @deprecated use `core.summary`\n */\nexports.markdownSummary = _summary;\nexports.summary = _summary;\n//# sourceMappingURL=summary.js.map","\"use strict\";\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toCommandProperties = exports.toCommandValue = void 0;\n/**\n * Sanitizes an input into a string so it can be passed into issueCommand safely\n * @param input input to sanitize into a string\n */\nfunction toCommandValue(input) {\n if (input === null || input === undefined) {\n return '';\n }\n else if (typeof input === 'string' || input instanceof String) {\n return input;\n }\n return JSON.stringify(input);\n}\nexports.toCommandValue = toCommandValue;\n/**\n *\n * @param annotationProperties\n * @returns The command properties to send with the actual annotation command\n * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646\n */\nfunction toCommandProperties(annotationProperties) {\n if (!Object.keys(annotationProperties).length) {\n return {};\n }\n return {\n title: annotationProperties.title,\n file: annotationProperties.file,\n line: annotationProperties.startLine,\n endLine: annotationProperties.endLine,\n col: annotationProperties.startColumn,\n endColumn: annotationProperties.endColumn\n };\n}\nexports.toCommandProperties = toCommandProperties;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getExecOutput = exports.exec = void 0;\nconst string_decoder_1 = require(\"string_decoder\");\nconst tr = __importStar(require(\"./toolrunner\"));\n/**\n * Exec a command.\n * Output will be streamed to the live console.\n * Returns promise with return code\n *\n * @param commandLine command to execute (can include additional args). Must be correctly escaped.\n * @param args optional arguments for tool. Escaping is handled by the lib.\n * @param options optional exec options. See ExecOptions\n * @returns Promise exit code\n */\nfunction exec(commandLine, args, options) {\n return __awaiter(this, void 0, void 0, function* () {\n const commandArgs = tr.argStringToArray(commandLine);\n if (commandArgs.length === 0) {\n throw new Error(`Parameter 'commandLine' cannot be null or empty.`);\n }\n // Path to tool to execute should be first arg\n const toolPath = commandArgs[0];\n args = commandArgs.slice(1).concat(args || []);\n const runner = new tr.ToolRunner(toolPath, args, options);\n return runner.exec();\n });\n}\nexports.exec = exec;\n/**\n * Exec a command and get the output.\n * Output will be streamed to the live console.\n * Returns promise with the exit code and collected stdout and stderr\n *\n * @param commandLine command to execute (can include additional args). Must be correctly escaped.\n * @param args optional arguments for tool. Escaping is handled by the lib.\n * @param options optional exec options. See ExecOptions\n * @returns Promise exit code, stdout, and stderr\n */\nfunction getExecOutput(commandLine, args, options) {\n var _a, _b;\n return __awaiter(this, void 0, void 0, function* () {\n let stdout = '';\n let stderr = '';\n //Using string decoder covers the case where a mult-byte character is split\n const stdoutDecoder = new string_decoder_1.StringDecoder('utf8');\n const stderrDecoder = new string_decoder_1.StringDecoder('utf8');\n const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.stdout;\n const originalStdErrListener = (_b = options === null || options === void 0 ? void 0 : options.listeners) === null || _b === void 0 ? void 0 : _b.stderr;\n const stdErrListener = (data) => {\n stderr += stderrDecoder.write(data);\n if (originalStdErrListener) {\n originalStdErrListener(data);\n }\n };\n const stdOutListener = (data) => {\n stdout += stdoutDecoder.write(data);\n if (originalStdoutListener) {\n originalStdoutListener(data);\n }\n };\n const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener });\n const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners }));\n //flush any remaining characters\n stdout += stdoutDecoder.end();\n stderr += stderrDecoder.end();\n return {\n exitCode,\n stdout,\n stderr\n };\n });\n}\nexports.getExecOutput = getExecOutput;\n//# sourceMappingURL=exec.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.argStringToArray = exports.ToolRunner = void 0;\nconst os = __importStar(require(\"os\"));\nconst events = __importStar(require(\"events\"));\nconst child = __importStar(require(\"child_process\"));\nconst path = __importStar(require(\"path\"));\nconst io = __importStar(require(\"@actions/io\"));\nconst ioUtil = __importStar(require(\"@actions/io/lib/io-util\"));\nconst timers_1 = require(\"timers\");\n/* eslint-disable @typescript-eslint/unbound-method */\nconst IS_WINDOWS = process.platform === 'win32';\n/*\n * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way.\n */\nclass ToolRunner extends events.EventEmitter {\n constructor(toolPath, args, options) {\n super();\n if (!toolPath) {\n throw new Error(\"Parameter 'toolPath' cannot be null or empty.\");\n }\n this.toolPath = toolPath;\n this.args = args || [];\n this.options = options || {};\n }\n _debug(message) {\n if (this.options.listeners && this.options.listeners.debug) {\n this.options.listeners.debug(message);\n }\n }\n _getCommandString(options, noPrefix) {\n const toolPath = this._getSpawnFileName();\n const args = this._getSpawnArgs(options);\n let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool\n if (IS_WINDOWS) {\n // Windows + cmd file\n if (this._isCmdFile()) {\n cmd += toolPath;\n for (const a of args) {\n cmd += ` ${a}`;\n }\n }\n // Windows + verbatim\n else if (options.windowsVerbatimArguments) {\n cmd += `\"${toolPath}\"`;\n for (const a of args) {\n cmd += ` ${a}`;\n }\n }\n // Windows (regular)\n else {\n cmd += this._windowsQuoteCmdArg(toolPath);\n for (const a of args) {\n cmd += ` ${this._windowsQuoteCmdArg(a)}`;\n }\n }\n }\n else {\n // OSX/Linux - this can likely be improved with some form of quoting.\n // creating processes on Unix is fundamentally different than Windows.\n // on Unix, execvp() takes an arg array.\n cmd += toolPath;\n for (const a of args) {\n cmd += ` ${a}`;\n }\n }\n return cmd;\n }\n _processLineBuffer(data, strBuffer, onLine) {\n try {\n let s = strBuffer + data.toString();\n let n = s.indexOf(os.EOL);\n while (n > -1) {\n const line = s.substring(0, n);\n onLine(line);\n // the rest of the string ...\n s = s.substring(n + os.EOL.length);\n n = s.indexOf(os.EOL);\n }\n return s;\n }\n catch (err) {\n // streaming lines to console is best effort. Don't fail a build.\n this._debug(`error processing line. Failed with error ${err}`);\n return '';\n }\n }\n _getSpawnFileName() {\n if (IS_WINDOWS) {\n if (this._isCmdFile()) {\n return process.env['COMSPEC'] || 'cmd.exe';\n }\n }\n return this.toolPath;\n }\n _getSpawnArgs(options) {\n if (IS_WINDOWS) {\n if (this._isCmdFile()) {\n let argline = `/D /S /C \"${this._windowsQuoteCmdArg(this.toolPath)}`;\n for (const a of this.args) {\n argline += ' ';\n argline += options.windowsVerbatimArguments\n ? a\n : this._windowsQuoteCmdArg(a);\n }\n argline += '\"';\n return [argline];\n }\n }\n return this.args;\n }\n _endsWith(str, end) {\n return str.endsWith(end);\n }\n _isCmdFile() {\n const upperToolPath = this.toolPath.toUpperCase();\n return (this._endsWith(upperToolPath, '.CMD') ||\n this._endsWith(upperToolPath, '.BAT'));\n }\n _windowsQuoteCmdArg(arg) {\n // for .exe, apply the normal quoting rules that libuv applies\n if (!this._isCmdFile()) {\n return this._uvQuoteCmdArg(arg);\n }\n // otherwise apply quoting rules specific to the cmd.exe command line parser.\n // the libuv rules are generic and are not designed specifically for cmd.exe\n // command line parser.\n //\n // for a detailed description of the cmd.exe command line parser, refer to\n // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912\n // need quotes for empty arg\n if (!arg) {\n return '\"\"';\n }\n // determine whether the arg needs to be quoted\n const cmdSpecialChars = [\n ' ',\n '\\t',\n '&',\n '(',\n ')',\n '[',\n ']',\n '{',\n '}',\n '^',\n '=',\n ';',\n '!',\n \"'\",\n '+',\n ',',\n '`',\n '~',\n '|',\n '<',\n '>',\n '\"'\n ];\n let needsQuotes = false;\n for (const char of arg) {\n if (cmdSpecialChars.some(x => x === char)) {\n needsQuotes = true;\n break;\n }\n }\n // short-circuit if quotes not needed\n if (!needsQuotes) {\n return arg;\n }\n // the following quoting rules are very similar to the rules that by libuv applies.\n //\n // 1) wrap the string in quotes\n //\n // 2) double-up quotes - i.e. \" => \"\"\n //\n // this is different from the libuv quoting rules. libuv replaces \" with \\\", which unfortunately\n // doesn't work well with a cmd.exe command line.\n //\n // note, replacing \" with \"\" also works well if the arg is passed to a downstream .NET console app.\n // for example, the command line:\n // foo.exe \"myarg:\"\"my val\"\"\"\n // is parsed by a .NET console app into an arg array:\n // [ \"myarg:\\\"my val\\\"\" ]\n // which is the same end result when applying libuv quoting rules. although the actual\n // command line from libuv quoting rules would look like:\n // foo.exe \"myarg:\\\"my val\\\"\"\n //\n // 3) double-up slashes that precede a quote,\n // e.g. hello \\world => \"hello \\world\"\n // hello\\\"world => \"hello\\\\\"\"world\"\n // hello\\\\\"world => \"hello\\\\\\\\\"\"world\"\n // hello world\\ => \"hello world\\\\\"\n //\n // technically this is not required for a cmd.exe command line, or the batch argument parser.\n // the reasons for including this as a .cmd quoting rule are:\n //\n // a) this is optimized for the scenario where the argument is passed from the .cmd file to an\n // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule.\n //\n // b) it's what we've been doing previously (by deferring to node default behavior) and we\n // haven't heard any complaints about that aspect.\n //\n // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be\n // escaped when used on the command line directly - even though within a .cmd file % can be escaped\n // by using %%.\n //\n // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts\n // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing.\n //\n // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would\n // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the\n // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args\n // to an external program.\n //\n // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file.\n // % can be escaped within a .cmd file.\n let reverse = '\"';\n let quoteHit = true;\n for (let i = arg.length; i > 0; i--) {\n // walk the string in reverse\n reverse += arg[i - 1];\n if (quoteHit && arg[i - 1] === '\\\\') {\n reverse += '\\\\'; // double the slash\n }\n else if (arg[i - 1] === '\"') {\n quoteHit = true;\n reverse += '\"'; // double the quote\n }\n else {\n quoteHit = false;\n }\n }\n reverse += '\"';\n return reverse\n .split('')\n .reverse()\n .join('');\n }\n _uvQuoteCmdArg(arg) {\n // Tool runner wraps child_process.spawn() and needs to apply the same quoting as\n // Node in certain cases where the undocumented spawn option windowsVerbatimArguments\n // is used.\n //\n // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV,\n // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details),\n // pasting copyright notice from Node within this function:\n //\n // Copyright Joyent, Inc. and other Node contributors. All rights reserved.\n //\n // Permission is hereby granted, free of charge, to any person obtaining a copy\n // of this software and associated documentation files (the \"Software\"), to\n // deal in the Software without restriction, including without limitation the\n // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n // sell copies of the Software, and to permit persons to whom the Software is\n // furnished to do so, subject to the following conditions:\n //\n // The above copyright notice and this permission notice shall be included in\n // all copies or substantial portions of the Software.\n //\n // THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n // IN THE SOFTWARE.\n if (!arg) {\n // Need double quotation for empty argument\n return '\"\"';\n }\n if (!arg.includes(' ') && !arg.includes('\\t') && !arg.includes('\"')) {\n // No quotation needed\n return arg;\n }\n if (!arg.includes('\"') && !arg.includes('\\\\')) {\n // No embedded double quotes or backslashes, so I can just wrap\n // quote marks around the whole thing.\n return `\"${arg}\"`;\n }\n // Expected input/output:\n // input : hello\"world\n // output: \"hello\\\"world\"\n // input : hello\"\"world\n // output: \"hello\\\"\\\"world\"\n // input : hello\\world\n // output: hello\\world\n // input : hello\\\\world\n // output: hello\\\\world\n // input : hello\\\"world\n // output: \"hello\\\\\\\"world\"\n // input : hello\\\\\"world\n // output: \"hello\\\\\\\\\\\"world\"\n // input : hello world\\\n // output: \"hello world\\\\\" - note the comment in libuv actually reads \"hello world\\\"\n // but it appears the comment is wrong, it should be \"hello world\\\\\"\n let reverse = '\"';\n let quoteHit = true;\n for (let i = arg.length; i > 0; i--) {\n // walk the string in reverse\n reverse += arg[i - 1];\n if (quoteHit && arg[i - 1] === '\\\\') {\n reverse += '\\\\';\n }\n else if (arg[i - 1] === '\"') {\n quoteHit = true;\n reverse += '\\\\';\n }\n else {\n quoteHit = false;\n }\n }\n reverse += '\"';\n return reverse\n .split('')\n .reverse()\n .join('');\n }\n _cloneExecOptions(options) {\n options = options || {};\n const result = {\n cwd: options.cwd || process.cwd(),\n env: options.env || process.env,\n silent: options.silent || false,\n windowsVerbatimArguments: options.windowsVerbatimArguments || false,\n failOnStdErr: options.failOnStdErr || false,\n ignoreReturnCode: options.ignoreReturnCode || false,\n delay: options.delay || 10000\n };\n result.outStream = options.outStream || process.stdout;\n result.errStream = options.errStream || process.stderr;\n return result;\n }\n _getSpawnOptions(options, toolPath) {\n options = options || {};\n const result = {};\n result.cwd = options.cwd;\n result.env = options.env;\n result['windowsVerbatimArguments'] =\n options.windowsVerbatimArguments || this._isCmdFile();\n if (options.windowsVerbatimArguments) {\n result.argv0 = `\"${toolPath}\"`;\n }\n return result;\n }\n /**\n * Exec a tool.\n * Output will be streamed to the live console.\n * Returns promise with return code\n *\n * @param tool path to tool to exec\n * @param options optional exec options. See ExecOptions\n * @returns number\n */\n exec() {\n return __awaiter(this, void 0, void 0, function* () {\n // root the tool path if it is unrooted and contains relative pathing\n if (!ioUtil.isRooted(this.toolPath) &&\n (this.toolPath.includes('/') ||\n (IS_WINDOWS && this.toolPath.includes('\\\\')))) {\n // prefer options.cwd if it is specified, however options.cwd may also need to be rooted\n this.toolPath = path.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath);\n }\n // if the tool is only a file name, then resolve it from the PATH\n // otherwise verify it exists (add extension on Windows if necessary)\n this.toolPath = yield io.which(this.toolPath, true);\n return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {\n this._debug(`exec tool: ${this.toolPath}`);\n this._debug('arguments:');\n for (const arg of this.args) {\n this._debug(` ${arg}`);\n }\n const optionsNonNull = this._cloneExecOptions(this.options);\n if (!optionsNonNull.silent && optionsNonNull.outStream) {\n optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL);\n }\n const state = new ExecState(optionsNonNull, this.toolPath);\n state.on('debug', (message) => {\n this._debug(message);\n });\n if (this.options.cwd && !(yield ioUtil.exists(this.options.cwd))) {\n return reject(new Error(`The cwd: ${this.options.cwd} does not exist!`));\n }\n const fileName = this._getSpawnFileName();\n const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName));\n let stdbuffer = '';\n if (cp.stdout) {\n cp.stdout.on('data', (data) => {\n if (this.options.listeners && this.options.listeners.stdout) {\n this.options.listeners.stdout(data);\n }\n if (!optionsNonNull.silent && optionsNonNull.outStream) {\n optionsNonNull.outStream.write(data);\n }\n stdbuffer = this._processLineBuffer(data, stdbuffer, (line) => {\n if (this.options.listeners && this.options.listeners.stdline) {\n this.options.listeners.stdline(line);\n }\n });\n });\n }\n let errbuffer = '';\n if (cp.stderr) {\n cp.stderr.on('data', (data) => {\n state.processStderr = true;\n if (this.options.listeners && this.options.listeners.stderr) {\n this.options.listeners.stderr(data);\n }\n if (!optionsNonNull.silent &&\n optionsNonNull.errStream &&\n optionsNonNull.outStream) {\n const s = optionsNonNull.failOnStdErr\n ? optionsNonNull.errStream\n : optionsNonNull.outStream;\n s.write(data);\n }\n errbuffer = this._processLineBuffer(data, errbuffer, (line) => {\n if (this.options.listeners && this.options.listeners.errline) {\n this.options.listeners.errline(line);\n }\n });\n });\n }\n cp.on('error', (err) => {\n state.processError = err.message;\n state.processExited = true;\n state.processClosed = true;\n state.CheckComplete();\n });\n cp.on('exit', (code) => {\n state.processExitCode = code;\n state.processExited = true;\n this._debug(`Exit code ${code} received from tool '${this.toolPath}'`);\n state.CheckComplete();\n });\n cp.on('close', (code) => {\n state.processExitCode = code;\n state.processExited = true;\n state.processClosed = true;\n this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);\n state.CheckComplete();\n });\n state.on('done', (error, exitCode) => {\n if (stdbuffer.length > 0) {\n this.emit('stdline', stdbuffer);\n }\n if (errbuffer.length > 0) {\n this.emit('errline', errbuffer);\n }\n cp.removeAllListeners();\n if (error) {\n reject(error);\n }\n else {\n resolve(exitCode);\n }\n });\n if (this.options.input) {\n if (!cp.stdin) {\n throw new Error('child process missing stdin');\n }\n cp.stdin.end(this.options.input);\n }\n }));\n });\n }\n}\nexports.ToolRunner = ToolRunner;\n/**\n * Convert an arg string to an array of args. Handles escaping\n *\n * @param argString string of arguments\n * @returns string[] array of arguments\n */\nfunction argStringToArray(argString) {\n const args = [];\n let inQuotes = false;\n let escaped = false;\n let arg = '';\n function append(c) {\n // we only escape double quotes.\n if (escaped && c !== '\"') {\n arg += '\\\\';\n }\n arg += c;\n escaped = false;\n }\n for (let i = 0; i < argString.length; i++) {\n const c = argString.charAt(i);\n if (c === '\"') {\n if (!escaped) {\n inQuotes = !inQuotes;\n }\n else {\n append(c);\n }\n continue;\n }\n if (c === '\\\\' && escaped) {\n append(c);\n continue;\n }\n if (c === '\\\\' && inQuotes) {\n escaped = true;\n continue;\n }\n if (c === ' ' && !inQuotes) {\n if (arg.length > 0) {\n args.push(arg);\n arg = '';\n }\n continue;\n }\n append(c);\n }\n if (arg.length > 0) {\n args.push(arg.trim());\n }\n return args;\n}\nexports.argStringToArray = argStringToArray;\nclass ExecState extends events.EventEmitter {\n constructor(options, toolPath) {\n super();\n this.processClosed = false; // tracks whether the process has exited and stdio is closed\n this.processError = '';\n this.processExitCode = 0;\n this.processExited = false; // tracks whether the process has exited\n this.processStderr = false; // tracks whether stderr was written to\n this.delay = 10000; // 10 seconds\n this.done = false;\n this.timeout = null;\n if (!toolPath) {\n throw new Error('toolPath must not be empty');\n }\n this.options = options;\n this.toolPath = toolPath;\n if (options.delay) {\n this.delay = options.delay;\n }\n }\n CheckComplete() {\n if (this.done) {\n return;\n }\n if (this.processClosed) {\n this._setResult();\n }\n else if (this.processExited) {\n this.timeout = timers_1.setTimeout(ExecState.HandleTimeout, this.delay, this);\n }\n }\n _debug(message) {\n this.emit('debug', message);\n }\n _setResult() {\n // determine whether there is an error\n let error;\n if (this.processExited) {\n if (this.processError) {\n error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`);\n }\n else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) {\n error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);\n }\n else if (this.processStderr && this.options.failOnStdErr) {\n error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`);\n }\n }\n // clear the timeout\n if (this.timeout) {\n clearTimeout(this.timeout);\n this.timeout = null;\n }\n this.done = true;\n this.emit('done', error, this.processExitCode);\n }\n static HandleTimeout(state) {\n if (state.done) {\n return;\n }\n if (!state.processClosed && state.processExited) {\n const message = `The STDIO streams did not close within ${state.delay /\n 1000} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`;\n state._debug(message);\n }\n state._setResult();\n }\n}\n//# sourceMappingURL=toolrunner.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PersonalAccessTokenCredentialHandler = exports.BearerCredentialHandler = exports.BasicCredentialHandler = void 0;\nclass BasicCredentialHandler {\n constructor(username, password) {\n this.username = username;\n this.password = password;\n }\n prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`;\n }\n // This handler cannot handle 401\n canHandleAuthentication() {\n return false;\n }\n handleAuthentication() {\n return __awaiter(this, void 0, void 0, function* () {\n throw new Error('not implemented');\n });\n }\n}\nexports.BasicCredentialHandler = BasicCredentialHandler;\nclass BearerCredentialHandler {\n constructor(token) {\n this.token = token;\n }\n // currently implements pre-authorization\n // TODO: support preAuth = false where it hooks on 401\n prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Bearer ${this.token}`;\n }\n // This handler cannot handle 401\n canHandleAuthentication() {\n return false;\n }\n handleAuthentication() {\n return __awaiter(this, void 0, void 0, function* () {\n throw new Error('not implemented');\n });\n }\n}\nexports.BearerCredentialHandler = BearerCredentialHandler;\nclass PersonalAccessTokenCredentialHandler {\n constructor(token) {\n this.token = token;\n }\n // currently implements pre-authorization\n // TODO: support preAuth = false where it hooks on 401\n prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`;\n }\n // This handler cannot handle 401\n canHandleAuthentication() {\n return false;\n }\n handleAuthentication() {\n return __awaiter(this, void 0, void 0, function* () {\n throw new Error('not implemented');\n });\n }\n}\nexports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler;\n//# sourceMappingURL=auth.js.map","\"use strict\";\n/* eslint-disable @typescript-eslint/no-explicit-any */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0;\nconst http = __importStar(require(\"http\"));\nconst https = __importStar(require(\"https\"));\nconst pm = __importStar(require(\"./proxy\"));\nconst tunnel = __importStar(require(\"tunnel\"));\nvar HttpCodes;\n(function (HttpCodes) {\n HttpCodes[HttpCodes[\"OK\"] = 200] = \"OK\";\n HttpCodes[HttpCodes[\"MultipleChoices\"] = 300] = \"MultipleChoices\";\n HttpCodes[HttpCodes[\"MovedPermanently\"] = 301] = \"MovedPermanently\";\n HttpCodes[HttpCodes[\"ResourceMoved\"] = 302] = \"ResourceMoved\";\n HttpCodes[HttpCodes[\"SeeOther\"] = 303] = \"SeeOther\";\n HttpCodes[HttpCodes[\"NotModified\"] = 304] = \"NotModified\";\n HttpCodes[HttpCodes[\"UseProxy\"] = 305] = \"UseProxy\";\n HttpCodes[HttpCodes[\"SwitchProxy\"] = 306] = \"SwitchProxy\";\n HttpCodes[HttpCodes[\"TemporaryRedirect\"] = 307] = \"TemporaryRedirect\";\n HttpCodes[HttpCodes[\"PermanentRedirect\"] = 308] = \"PermanentRedirect\";\n HttpCodes[HttpCodes[\"BadRequest\"] = 400] = \"BadRequest\";\n HttpCodes[HttpCodes[\"Unauthorized\"] = 401] = \"Unauthorized\";\n HttpCodes[HttpCodes[\"PaymentRequired\"] = 402] = \"PaymentRequired\";\n HttpCodes[HttpCodes[\"Forbidden\"] = 403] = \"Forbidden\";\n HttpCodes[HttpCodes[\"NotFound\"] = 404] = \"NotFound\";\n HttpCodes[HttpCodes[\"MethodNotAllowed\"] = 405] = \"MethodNotAllowed\";\n HttpCodes[HttpCodes[\"NotAcceptable\"] = 406] = \"NotAcceptable\";\n HttpCodes[HttpCodes[\"ProxyAuthenticationRequired\"] = 407] = \"ProxyAuthenticationRequired\";\n HttpCodes[HttpCodes[\"RequestTimeout\"] = 408] = \"RequestTimeout\";\n HttpCodes[HttpCodes[\"Conflict\"] = 409] = \"Conflict\";\n HttpCodes[HttpCodes[\"Gone\"] = 410] = \"Gone\";\n HttpCodes[HttpCodes[\"TooManyRequests\"] = 429] = \"TooManyRequests\";\n HttpCodes[HttpCodes[\"InternalServerError\"] = 500] = \"InternalServerError\";\n HttpCodes[HttpCodes[\"NotImplemented\"] = 501] = \"NotImplemented\";\n HttpCodes[HttpCodes[\"BadGateway\"] = 502] = \"BadGateway\";\n HttpCodes[HttpCodes[\"ServiceUnavailable\"] = 503] = \"ServiceUnavailable\";\n HttpCodes[HttpCodes[\"GatewayTimeout\"] = 504] = \"GatewayTimeout\";\n})(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));\nvar Headers;\n(function (Headers) {\n Headers[\"Accept\"] = \"accept\";\n Headers[\"ContentType\"] = \"content-type\";\n})(Headers = exports.Headers || (exports.Headers = {}));\nvar MediaTypes;\n(function (MediaTypes) {\n MediaTypes[\"ApplicationJson\"] = \"application/json\";\n})(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {}));\n/**\n * Returns the proxy URL, depending upon the supplied url and proxy environment variables.\n * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com\n */\nfunction getProxyUrl(serverUrl) {\n const proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}\nexports.getProxyUrl = getProxyUrl;\nconst HttpRedirectCodes = [\n HttpCodes.MovedPermanently,\n HttpCodes.ResourceMoved,\n HttpCodes.SeeOther,\n HttpCodes.TemporaryRedirect,\n HttpCodes.PermanentRedirect\n];\nconst HttpResponseRetryCodes = [\n HttpCodes.BadGateway,\n HttpCodes.ServiceUnavailable,\n HttpCodes.GatewayTimeout\n];\nconst RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];\nconst ExponentialBackoffCeiling = 10;\nconst ExponentialBackoffTimeSlice = 5;\nclass HttpClientError extends Error {\n constructor(message, statusCode) {\n super(message);\n this.name = 'HttpClientError';\n this.statusCode = statusCode;\n Object.setPrototypeOf(this, HttpClientError.prototype);\n }\n}\nexports.HttpClientError = HttpClientError;\nclass HttpClientResponse {\n constructor(message) {\n this.message = message;\n }\n readBody() {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {\n let output = Buffer.alloc(0);\n this.message.on('data', (chunk) => {\n output = Buffer.concat([output, chunk]);\n });\n this.message.on('end', () => {\n resolve(output.toString());\n });\n }));\n });\n }\n}\nexports.HttpClientResponse = HttpClientResponse;\nfunction isHttps(requestUrl) {\n const parsedUrl = new URL(requestUrl);\n return parsedUrl.protocol === 'https:';\n}\nexports.isHttps = isHttps;\nclass HttpClient {\n constructor(userAgent, handlers, requestOptions) {\n this._ignoreSslError = false;\n this._allowRedirects = true;\n this._allowRedirectDowngrade = false;\n this._maxRedirects = 50;\n this._allowRetries = false;\n this._maxRetries = 1;\n this._keepAlive = false;\n this._disposed = false;\n this.userAgent = userAgent;\n this.handlers = handlers || [];\n this.requestOptions = requestOptions;\n if (requestOptions) {\n if (requestOptions.ignoreSslError != null) {\n this._ignoreSslError = requestOptions.ignoreSslError;\n }\n this._socketTimeout = requestOptions.socketTimeout;\n if (requestOptions.allowRedirects != null) {\n this._allowRedirects = requestOptions.allowRedirects;\n }\n if (requestOptions.allowRedirectDowngrade != null) {\n this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;\n }\n if (requestOptions.maxRedirects != null) {\n this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);\n }\n if (requestOptions.keepAlive != null) {\n this._keepAlive = requestOptions.keepAlive;\n }\n if (requestOptions.allowRetries != null) {\n this._allowRetries = requestOptions.allowRetries;\n }\n if (requestOptions.maxRetries != null) {\n this._maxRetries = requestOptions.maxRetries;\n }\n }\n }\n options(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});\n });\n }\n get(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('GET', requestUrl, null, additionalHeaders || {});\n });\n }\n del(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('DELETE', requestUrl, null, additionalHeaders || {});\n });\n }\n post(requestUrl, data, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('POST', requestUrl, data, additionalHeaders || {});\n });\n }\n patch(requestUrl, data, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('PATCH', requestUrl, data, additionalHeaders || {});\n });\n }\n put(requestUrl, data, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('PUT', requestUrl, data, additionalHeaders || {});\n });\n }\n head(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('HEAD', requestUrl, null, additionalHeaders || {});\n });\n }\n sendStream(verb, requestUrl, stream, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request(verb, requestUrl, stream, additionalHeaders);\n });\n }\n /**\n * Gets a typed object from an endpoint\n * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise\n */\n getJson(requestUrl, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n const res = yield this.get(requestUrl, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n postJson(requestUrl, obj, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n const data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n const res = yield this.post(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n putJson(requestUrl, obj, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n const data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n const res = yield this.put(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n patchJson(requestUrl, obj, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n const data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n const res = yield this.patch(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n /**\n * Makes a raw http request.\n * All other methods such as get, post, patch, and request ultimately call this.\n * Prefer get, del, post and patch\n */\n request(verb, requestUrl, data, headers) {\n return __awaiter(this, void 0, void 0, function* () {\n if (this._disposed) {\n throw new Error('Client has already been disposed.');\n }\n const parsedUrl = new URL(requestUrl);\n let info = this._prepareRequest(verb, parsedUrl, headers);\n // Only perform retries on reads since writes may not be idempotent.\n const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb)\n ? this._maxRetries + 1\n : 1;\n let numTries = 0;\n let response;\n do {\n response = yield this.requestRaw(info, data);\n // Check if it's an authentication challenge\n if (response &&\n response.message &&\n response.message.statusCode === HttpCodes.Unauthorized) {\n let authenticationHandler;\n for (const handler of this.handlers) {\n if (handler.canHandleAuthentication(response)) {\n authenticationHandler = handler;\n break;\n }\n }\n if (authenticationHandler) {\n return authenticationHandler.handleAuthentication(this, info, data);\n }\n else {\n // We have received an unauthorized response but have no handlers to handle it.\n // Let the response return to the caller.\n return response;\n }\n }\n let redirectsRemaining = this._maxRedirects;\n while (response.message.statusCode &&\n HttpRedirectCodes.includes(response.message.statusCode) &&\n this._allowRedirects &&\n redirectsRemaining > 0) {\n const redirectUrl = response.message.headers['location'];\n if (!redirectUrl) {\n // if there's no location to redirect to, we won't\n break;\n }\n const parsedRedirectUrl = new URL(redirectUrl);\n if (parsedUrl.protocol === 'https:' &&\n parsedUrl.protocol !== parsedRedirectUrl.protocol &&\n !this._allowRedirectDowngrade) {\n throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.');\n }\n // we need to finish reading the response before reassigning response\n // which will leak the open socket.\n yield response.readBody();\n // strip authorization header if redirected to a different hostname\n if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {\n for (const header in headers) {\n // header names are case insensitive\n if (header.toLowerCase() === 'authorization') {\n delete headers[header];\n }\n }\n }\n // let's make the request with the new redirectUrl\n info = this._prepareRequest(verb, parsedRedirectUrl, headers);\n response = yield this.requestRaw(info, data);\n redirectsRemaining--;\n }\n if (!response.message.statusCode ||\n !HttpResponseRetryCodes.includes(response.message.statusCode)) {\n // If not a retry code, return immediately instead of retrying\n return response;\n }\n numTries += 1;\n if (numTries < maxTries) {\n yield response.readBody();\n yield this._performExponentialBackoff(numTries);\n }\n } while (numTries < maxTries);\n return response;\n });\n }\n /**\n * Needs to be called if keepAlive is set to true in request options.\n */\n dispose() {\n if (this._agent) {\n this._agent.destroy();\n }\n this._disposed = true;\n }\n /**\n * Raw request.\n * @param info\n * @param data\n */\n requestRaw(info, data) {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve, reject) => {\n function callbackForResult(err, res) {\n if (err) {\n reject(err);\n }\n else if (!res) {\n // If `err` is not passed, then `res` must be passed.\n reject(new Error('Unknown error'));\n }\n else {\n resolve(res);\n }\n }\n this.requestRawWithCallback(info, data, callbackForResult);\n });\n });\n }\n /**\n * Raw request with callback.\n * @param info\n * @param data\n * @param onResult\n */\n requestRawWithCallback(info, data, onResult) {\n if (typeof data === 'string') {\n if (!info.options.headers) {\n info.options.headers = {};\n }\n info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');\n }\n let callbackCalled = false;\n function handleResult(err, res) {\n if (!callbackCalled) {\n callbackCalled = true;\n onResult(err, res);\n }\n }\n const req = info.httpModule.request(info.options, (msg) => {\n const res = new HttpClientResponse(msg);\n handleResult(undefined, res);\n });\n let socket;\n req.on('socket', sock => {\n socket = sock;\n });\n // If we ever get disconnected, we want the socket to timeout eventually\n req.setTimeout(this._socketTimeout || 3 * 60000, () => {\n if (socket) {\n socket.end();\n }\n handleResult(new Error(`Request timeout: ${info.options.path}`));\n });\n req.on('error', function (err) {\n // err has statusCode property\n // res should have headers\n handleResult(err);\n });\n if (data && typeof data === 'string') {\n req.write(data, 'utf8');\n }\n if (data && typeof data !== 'string') {\n data.on('close', function () {\n req.end();\n });\n data.pipe(req);\n }\n else {\n req.end();\n }\n }\n /**\n * Gets an http agent. This function is useful when you need an http agent that handles\n * routing through a proxy server - depending upon the url and proxy environment variables.\n * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com\n */\n getAgent(serverUrl) {\n const parsedUrl = new URL(serverUrl);\n return this._getAgent(parsedUrl);\n }\n _prepareRequest(method, requestUrl, headers) {\n const info = {};\n info.parsedUrl = requestUrl;\n const usingSsl = info.parsedUrl.protocol === 'https:';\n info.httpModule = usingSsl ? https : http;\n const defaultPort = usingSsl ? 443 : 80;\n info.options = {};\n info.options.host = info.parsedUrl.hostname;\n info.options.port = info.parsedUrl.port\n ? parseInt(info.parsedUrl.port)\n : defaultPort;\n info.options.path =\n (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');\n info.options.method = method;\n info.options.headers = this._mergeHeaders(headers);\n if (this.userAgent != null) {\n info.options.headers['user-agent'] = this.userAgent;\n }\n info.options.agent = this._getAgent(info.parsedUrl);\n // gives handlers an opportunity to participate\n if (this.handlers) {\n for (const handler of this.handlers) {\n handler.prepareRequest(info.options);\n }\n }\n return info;\n }\n _mergeHeaders(headers) {\n if (this.requestOptions && this.requestOptions.headers) {\n return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {}));\n }\n return lowercaseKeys(headers || {});\n }\n _getExistingOrDefaultHeader(additionalHeaders, header, _default) {\n let clientHeader;\n if (this.requestOptions && this.requestOptions.headers) {\n clientHeader = lowercaseKeys(this.requestOptions.headers)[header];\n }\n return additionalHeaders[header] || clientHeader || _default;\n }\n _getAgent(parsedUrl) {\n let agent;\n const proxyUrl = pm.getProxyUrl(parsedUrl);\n const useProxy = proxyUrl && proxyUrl.hostname;\n if (this._keepAlive && useProxy) {\n agent = this._proxyAgent;\n }\n if (this._keepAlive && !useProxy) {\n agent = this._agent;\n }\n // if agent is already assigned use that agent.\n if (agent) {\n return agent;\n }\n const usingSsl = parsedUrl.protocol === 'https:';\n let maxSockets = 100;\n if (this.requestOptions) {\n maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;\n }\n // This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis.\n if (proxyUrl && proxyUrl.hostname) {\n const agentOptions = {\n maxSockets,\n keepAlive: this._keepAlive,\n proxy: Object.assign(Object.assign({}, ((proxyUrl.username || proxyUrl.password) && {\n proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`\n })), { host: proxyUrl.hostname, port: proxyUrl.port })\n };\n let tunnelAgent;\n const overHttps = proxyUrl.protocol === 'https:';\n if (usingSsl) {\n tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;\n }\n else {\n tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;\n }\n agent = tunnelAgent(agentOptions);\n this._proxyAgent = agent;\n }\n // if reusing agent across request and tunneling agent isn't assigned create a new agent\n if (this._keepAlive && !agent) {\n const options = { keepAlive: this._keepAlive, maxSockets };\n agent = usingSsl ? new https.Agent(options) : new http.Agent(options);\n this._agent = agent;\n }\n // if not using private agent and tunnel agent isn't setup then use global agent\n if (!agent) {\n agent = usingSsl ? https.globalAgent : http.globalAgent;\n }\n if (usingSsl && this._ignoreSslError) {\n // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process\n // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options\n // we have to cast it to any and change it directly\n agent.options = Object.assign(agent.options || {}, {\n rejectUnauthorized: false\n });\n }\n return agent;\n }\n _performExponentialBackoff(retryNumber) {\n return __awaiter(this, void 0, void 0, function* () {\n retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);\n const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);\n return new Promise(resolve => setTimeout(() => resolve(), ms));\n });\n }\n _processResponse(res, options) {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {\n const statusCode = res.message.statusCode || 0;\n const response = {\n statusCode,\n result: null,\n headers: {}\n };\n // not found leads to null obj returned\n if (statusCode === HttpCodes.NotFound) {\n resolve(response);\n }\n // get the result from the body\n function dateTimeDeserializer(key, value) {\n if (typeof value === 'string') {\n const a = new Date(value);\n if (!isNaN(a.valueOf())) {\n return a;\n }\n }\n return value;\n }\n let obj;\n let contents;\n try {\n contents = yield res.readBody();\n if (contents && contents.length > 0) {\n if (options && options.deserializeDates) {\n obj = JSON.parse(contents, dateTimeDeserializer);\n }\n else {\n obj = JSON.parse(contents);\n }\n response.result = obj;\n }\n response.headers = res.message.headers;\n }\n catch (err) {\n // Invalid resource (contents not json); leaving result obj null\n }\n // note that 3xx redirects are handled by the http layer.\n if (statusCode > 299) {\n let msg;\n // if exception/error in body, attempt to get better error\n if (obj && obj.message) {\n msg = obj.message;\n }\n else if (contents && contents.length > 0) {\n // it may be the case that the exception is in the body message as string\n msg = contents;\n }\n else {\n msg = `Failed request: (${statusCode})`;\n }\n const err = new HttpClientError(msg, statusCode);\n err.result = response.result;\n reject(err);\n }\n else {\n resolve(response);\n }\n }));\n });\n }\n}\nexports.HttpClient = HttpClient;\nconst lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.checkBypass = exports.getProxyUrl = void 0;\nfunction getProxyUrl(reqUrl) {\n const usingSsl = reqUrl.protocol === 'https:';\n if (checkBypass(reqUrl)) {\n return undefined;\n }\n const proxyVar = (() => {\n if (usingSsl) {\n return process.env['https_proxy'] || process.env['HTTPS_PROXY'];\n }\n else {\n return process.env['http_proxy'] || process.env['HTTP_PROXY'];\n }\n })();\n if (proxyVar) {\n return new URL(proxyVar);\n }\n else {\n return undefined;\n }\n}\nexports.getProxyUrl = getProxyUrl;\nfunction checkBypass(reqUrl) {\n if (!reqUrl.hostname) {\n return false;\n }\n const reqHost = reqUrl.hostname;\n if (isLoopbackAddress(reqHost)) {\n return true;\n }\n const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';\n if (!noProxy) {\n return false;\n }\n // Determine the request port\n let reqPort;\n if (reqUrl.port) {\n reqPort = Number(reqUrl.port);\n }\n else if (reqUrl.protocol === 'http:') {\n reqPort = 80;\n }\n else if (reqUrl.protocol === 'https:') {\n reqPort = 443;\n }\n // Format the request hostname and hostname with port\n const upperReqHosts = [reqUrl.hostname.toUpperCase()];\n if (typeof reqPort === 'number') {\n upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);\n }\n // Compare request host against noproxy\n for (const upperNoProxyItem of noProxy\n .split(',')\n .map(x => x.trim().toUpperCase())\n .filter(x => x)) {\n if (upperNoProxyItem === '*' ||\n upperReqHosts.some(x => x === upperNoProxyItem ||\n x.endsWith(`.${upperNoProxyItem}`) ||\n (upperNoProxyItem.startsWith('.') &&\n x.endsWith(`${upperNoProxyItem}`)))) {\n return true;\n }\n }\n return false;\n}\nexports.checkBypass = checkBypass;\nfunction isLoopbackAddress(host) {\n const hostLower = host.toLowerCase();\n return (hostLower === 'localhost' ||\n hostLower.startsWith('127.') ||\n hostLower.startsWith('[::1]') ||\n hostLower.startsWith('[0:0:0:0:0:0:0:1]'));\n}\n//# sourceMappingURL=proxy.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar _a;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getCmdPath = exports.tryGetExecutablePath = exports.isRooted = exports.isDirectory = exports.exists = exports.READONLY = exports.UV_FS_O_EXLOCK = exports.IS_WINDOWS = exports.unlink = exports.symlink = exports.stat = exports.rmdir = exports.rm = exports.rename = exports.readlink = exports.readdir = exports.open = exports.mkdir = exports.lstat = exports.copyFile = exports.chmod = void 0;\nconst fs = __importStar(require(\"fs\"));\nconst path = __importStar(require(\"path\"));\n_a = fs.promises\n// export const {open} = 'fs'\n, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.open = _a.open, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rm = _a.rm, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink;\n// export const {open} = 'fs'\nexports.IS_WINDOWS = process.platform === 'win32';\n// See https://github.com/nodejs/node/blob/d0153aee367422d0858105abec186da4dff0a0c5/deps/uv/include/uv/win.h#L691\nexports.UV_FS_O_EXLOCK = 0x10000000;\nexports.READONLY = fs.constants.O_RDONLY;\nfunction exists(fsPath) {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n yield exports.stat(fsPath);\n }\n catch (err) {\n if (err.code === 'ENOENT') {\n return false;\n }\n throw err;\n }\n return true;\n });\n}\nexports.exists = exists;\nfunction isDirectory(fsPath, useStat = false) {\n return __awaiter(this, void 0, void 0, function* () {\n const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);\n return stats.isDirectory();\n });\n}\nexports.isDirectory = isDirectory;\n/**\n * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:\n * \\, \\hello, \\\\hello\\share, C:, and C:\\hello (and corresponding alternate separator cases).\n */\nfunction isRooted(p) {\n p = normalizeSeparators(p);\n if (!p) {\n throw new Error('isRooted() parameter \"p\" cannot be empty');\n }\n if (exports.IS_WINDOWS) {\n return (p.startsWith('\\\\') || /^[A-Z]:/i.test(p) // e.g. \\ or \\hello or \\\\hello\n ); // e.g. C: or C:\\hello\n }\n return p.startsWith('/');\n}\nexports.isRooted = isRooted;\n/**\n * Best effort attempt to determine whether a file exists and is executable.\n * @param filePath file path to check\n * @param extensions additional file extensions to try\n * @return if file exists and is executable, returns the file path. otherwise empty string.\n */\nfunction tryGetExecutablePath(filePath, extensions) {\n return __awaiter(this, void 0, void 0, function* () {\n let stats = undefined;\n try {\n // test file exists\n stats = yield exports.stat(filePath);\n }\n catch (err) {\n if (err.code !== 'ENOENT') {\n // eslint-disable-next-line no-console\n console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);\n }\n }\n if (stats && stats.isFile()) {\n if (exports.IS_WINDOWS) {\n // on Windows, test for valid extension\n const upperExt = path.extname(filePath).toUpperCase();\n if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {\n return filePath;\n }\n }\n else {\n if (isUnixExecutable(stats)) {\n return filePath;\n }\n }\n }\n // try each extension\n const originalFilePath = filePath;\n for (const extension of extensions) {\n filePath = originalFilePath + extension;\n stats = undefined;\n try {\n stats = yield exports.stat(filePath);\n }\n catch (err) {\n if (err.code !== 'ENOENT') {\n // eslint-disable-next-line no-console\n console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);\n }\n }\n if (stats && stats.isFile()) {\n if (exports.IS_WINDOWS) {\n // preserve the case of the actual file (since an extension was appended)\n try {\n const directory = path.dirname(filePath);\n const upperName = path.basename(filePath).toUpperCase();\n for (const actualName of yield exports.readdir(directory)) {\n if (upperName === actualName.toUpperCase()) {\n filePath = path.join(directory, actualName);\n break;\n }\n }\n }\n catch (err) {\n // eslint-disable-next-line no-console\n console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);\n }\n return filePath;\n }\n else {\n if (isUnixExecutable(stats)) {\n return filePath;\n }\n }\n }\n }\n return '';\n });\n}\nexports.tryGetExecutablePath = tryGetExecutablePath;\nfunction normalizeSeparators(p) {\n p = p || '';\n if (exports.IS_WINDOWS) {\n // convert slashes on Windows\n p = p.replace(/\\//g, '\\\\');\n // remove redundant slashes\n return p.replace(/\\\\\\\\+/g, '\\\\');\n }\n // remove redundant slashes\n return p.replace(/\\/\\/+/g, '/');\n}\n// on Mac/Linux, test the execute bit\n// R W X R W X R W X\n// 256 128 64 32 16 8 4 2 1\nfunction isUnixExecutable(stats) {\n return ((stats.mode & 1) > 0 ||\n ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||\n ((stats.mode & 64) > 0 && stats.uid === process.getuid()));\n}\n// Get the path of cmd.exe in windows\nfunction getCmdPath() {\n var _a;\n return (_a = process.env['COMSPEC']) !== null && _a !== void 0 ? _a : `cmd.exe`;\n}\nexports.getCmdPath = getCmdPath;\n//# sourceMappingURL=io-util.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.findInPath = exports.which = exports.mkdirP = exports.rmRF = exports.mv = exports.cp = void 0;\nconst assert_1 = require(\"assert\");\nconst path = __importStar(require(\"path\"));\nconst ioUtil = __importStar(require(\"./io-util\"));\n/**\n * Copies a file or folder.\n * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js\n *\n * @param source source path\n * @param dest destination path\n * @param options optional. See CopyOptions.\n */\nfunction cp(source, dest, options = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n const { force, recursive, copySourceDirectory } = readCopyOptions(options);\n const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null;\n // Dest is an existing file, but not forcing\n if (destStat && destStat.isFile() && !force) {\n return;\n }\n // If dest is an existing directory, should copy inside.\n const newDest = destStat && destStat.isDirectory() && copySourceDirectory\n ? path.join(dest, path.basename(source))\n : dest;\n if (!(yield ioUtil.exists(source))) {\n throw new Error(`no such file or directory: ${source}`);\n }\n const sourceStat = yield ioUtil.stat(source);\n if (sourceStat.isDirectory()) {\n if (!recursive) {\n throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`);\n }\n else {\n yield cpDirRecursive(source, newDest, 0, force);\n }\n }\n else {\n if (path.relative(source, newDest) === '') {\n // a file cannot be copied to itself\n throw new Error(`'${newDest}' and '${source}' are the same file`);\n }\n yield copyFile(source, newDest, force);\n }\n });\n}\nexports.cp = cp;\n/**\n * Moves a path.\n *\n * @param source source path\n * @param dest destination path\n * @param options optional. See MoveOptions.\n */\nfunction mv(source, dest, options = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n if (yield ioUtil.exists(dest)) {\n let destExists = true;\n if (yield ioUtil.isDirectory(dest)) {\n // If dest is directory copy src into dest\n dest = path.join(dest, path.basename(source));\n destExists = yield ioUtil.exists(dest);\n }\n if (destExists) {\n if (options.force == null || options.force) {\n yield rmRF(dest);\n }\n else {\n throw new Error('Destination already exists');\n }\n }\n }\n yield mkdirP(path.dirname(dest));\n yield ioUtil.rename(source, dest);\n });\n}\nexports.mv = mv;\n/**\n * Remove a path recursively with force\n *\n * @param inputPath path to remove\n */\nfunction rmRF(inputPath) {\n return __awaiter(this, void 0, void 0, function* () {\n if (ioUtil.IS_WINDOWS) {\n // Check for invalid characters\n // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file\n if (/[*\"<>|]/.test(inputPath)) {\n throw new Error('File path must not contain `*`, `\"`, `<`, `>` or `|` on Windows');\n }\n }\n try {\n // note if path does not exist, error is silent\n yield ioUtil.rm(inputPath, {\n force: true,\n maxRetries: 3,\n recursive: true,\n retryDelay: 300\n });\n }\n catch (err) {\n throw new Error(`File was unable to be removed ${err}`);\n }\n });\n}\nexports.rmRF = rmRF;\n/**\n * Make a directory. Creates the full path with folders in between\n * Will throw if it fails\n *\n * @param fsPath path to create\n * @returns Promise\n */\nfunction mkdirP(fsPath) {\n return __awaiter(this, void 0, void 0, function* () {\n assert_1.ok(fsPath, 'a path argument must be provided');\n yield ioUtil.mkdir(fsPath, { recursive: true });\n });\n}\nexports.mkdirP = mkdirP;\n/**\n * Returns path of a tool had the tool actually been invoked. Resolves via paths.\n * If you check and the tool does not exist, it will throw.\n *\n * @param tool name of the tool\n * @param check whether to check if tool exists\n * @returns Promise path to tool\n */\nfunction which(tool, check) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!tool) {\n throw new Error(\"parameter 'tool' is required\");\n }\n // recursive when check=true\n if (check) {\n const result = yield which(tool, false);\n if (!result) {\n if (ioUtil.IS_WINDOWS) {\n throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`);\n }\n else {\n throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`);\n }\n }\n return result;\n }\n const matches = yield findInPath(tool);\n if (matches && matches.length > 0) {\n return matches[0];\n }\n return '';\n });\n}\nexports.which = which;\n/**\n * Returns a list of all occurrences of the given tool on the system path.\n *\n * @returns Promise the paths of the tool\n */\nfunction findInPath(tool) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!tool) {\n throw new Error(\"parameter 'tool' is required\");\n }\n // build the list of extensions to try\n const extensions = [];\n if (ioUtil.IS_WINDOWS && process.env['PATHEXT']) {\n for (const extension of process.env['PATHEXT'].split(path.delimiter)) {\n if (extension) {\n extensions.push(extension);\n }\n }\n }\n // if it's rooted, return it if exists. otherwise return empty.\n if (ioUtil.isRooted(tool)) {\n const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);\n if (filePath) {\n return [filePath];\n }\n return [];\n }\n // if any path separators, return empty\n if (tool.includes(path.sep)) {\n return [];\n }\n // build the list of directories\n //\n // Note, technically \"where\" checks the current directory on Windows. From a toolkit perspective,\n // it feels like we should not do this. Checking the current directory seems like more of a use\n // case of a shell, and the which() function exposed by the toolkit should strive for consistency\n // across platforms.\n const directories = [];\n if (process.env.PATH) {\n for (const p of process.env.PATH.split(path.delimiter)) {\n if (p) {\n directories.push(p);\n }\n }\n }\n // find all matches\n const matches = [];\n for (const directory of directories) {\n const filePath = yield ioUtil.tryGetExecutablePath(path.join(directory, tool), extensions);\n if (filePath) {\n matches.push(filePath);\n }\n }\n return matches;\n });\n}\nexports.findInPath = findInPath;\nfunction readCopyOptions(options) {\n const force = options.force == null ? true : options.force;\n const recursive = Boolean(options.recursive);\n const copySourceDirectory = options.copySourceDirectory == null\n ? true\n : Boolean(options.copySourceDirectory);\n return { force, recursive, copySourceDirectory };\n}\nfunction cpDirRecursive(sourceDir, destDir, currentDepth, force) {\n return __awaiter(this, void 0, void 0, function* () {\n // Ensure there is not a run away recursive copy\n if (currentDepth >= 255)\n return;\n currentDepth++;\n yield mkdirP(destDir);\n const files = yield ioUtil.readdir(sourceDir);\n for (const fileName of files) {\n const srcFile = `${sourceDir}/${fileName}`;\n const destFile = `${destDir}/${fileName}`;\n const srcFileStat = yield ioUtil.lstat(srcFile);\n if (srcFileStat.isDirectory()) {\n // Recurse\n yield cpDirRecursive(srcFile, destFile, currentDepth, force);\n }\n else {\n yield copyFile(srcFile, destFile, force);\n }\n }\n // Change the mode for the newly created directory\n yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode);\n });\n}\n// Buffered file copy\nfunction copyFile(srcFile, destFile, force) {\n return __awaiter(this, void 0, void 0, function* () {\n if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) {\n // unlink/re-link it\n try {\n yield ioUtil.lstat(destFile);\n yield ioUtil.unlink(destFile);\n }\n catch (e) {\n // Try to override file permission\n if (e.code === 'EPERM') {\n yield ioUtil.chmod(destFile, '0666');\n yield ioUtil.unlink(destFile);\n }\n // other errors = it doesn't exist, no work to do\n }\n // Copy over symlink\n const symlinkFull = yield ioUtil.readlink(srcFile);\n yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null);\n }\n else if (!(yield ioUtil.exists(destFile)) || force) {\n yield ioUtil.copyFile(srcFile, destFile);\n }\n });\n}\n//# sourceMappingURL=io.js.map","const fetchNode = require('./node-ponyfill')\n\nif (!global.fetch) {\n const fetch = fetchNode.fetch.bind({})\n\n global.fetch = fetch\n global.fetch.polyfill = true\n global.Response = fetchNode.Response\n global.Headers = fetchNode.Headers\n global.Request = fetchNode.Request\n}\n","const nodeFetch = require('node-fetch')\nconst realFetch = nodeFetch.default || nodeFetch\n\nconst fetch = function (url, options) {\n // Support schemaless URIs on the server for parity with the browser.\n // Ex: //github.com/ -> https://github.com/\n if (/^\\/\\//.test(url)) {\n url = 'https:' + url\n }\n return realFetch.call(this, url, options)\n}\n\nfetch.ponyfill = true\n\nmodule.exports = exports = fetch\nexports.fetch = fetch\nexports.Headers = nodeFetch.Headers\nexports.Request = nodeFetch.Request\nexports.Response = nodeFetch.Response\n\n// Needed for TypeScript consumers without esModuleInterop.\nexports.default = fetch\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }\n\nvar Stream = _interopDefault(require('stream'));\nvar http = _interopDefault(require('http'));\nvar Url = _interopDefault(require('url'));\nvar whatwgUrl = _interopDefault(require('whatwg-url'));\nvar https = _interopDefault(require('https'));\nvar zlib = _interopDefault(require('zlib'));\n\n// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js\n\n// fix for \"Readable\" isn't a named export issue\nconst Readable = Stream.Readable;\n\nconst BUFFER = Symbol('buffer');\nconst TYPE = Symbol('type');\n\nclass Blob {\n\tconstructor() {\n\t\tthis[TYPE] = '';\n\n\t\tconst blobParts = arguments[0];\n\t\tconst options = arguments[1];\n\n\t\tconst buffers = [];\n\t\tlet size = 0;\n\n\t\tif (blobParts) {\n\t\t\tconst a = blobParts;\n\t\t\tconst length = Number(a.length);\n\t\t\tfor (let i = 0; i < length; i++) {\n\t\t\t\tconst element = a[i];\n\t\t\t\tlet buffer;\n\t\t\t\tif (element instanceof Buffer) {\n\t\t\t\t\tbuffer = element;\n\t\t\t\t} else if (ArrayBuffer.isView(element)) {\n\t\t\t\t\tbuffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);\n\t\t\t\t} else if (element instanceof ArrayBuffer) {\n\t\t\t\t\tbuffer = Buffer.from(element);\n\t\t\t\t} else if (element instanceof Blob) {\n\t\t\t\t\tbuffer = element[BUFFER];\n\t\t\t\t} else {\n\t\t\t\t\tbuffer = Buffer.from(typeof element === 'string' ? element : String(element));\n\t\t\t\t}\n\t\t\t\tsize += buffer.length;\n\t\t\t\tbuffers.push(buffer);\n\t\t\t}\n\t\t}\n\n\t\tthis[BUFFER] = Buffer.concat(buffers);\n\n\t\tlet type = options && options.type !== undefined && String(options.type).toLowerCase();\n\t\tif (type && !/[^\\u0020-\\u007E]/.test(type)) {\n\t\t\tthis[TYPE] = type;\n\t\t}\n\t}\n\tget size() {\n\t\treturn this[BUFFER].length;\n\t}\n\tget type() {\n\t\treturn this[TYPE];\n\t}\n\ttext() {\n\t\treturn Promise.resolve(this[BUFFER].toString());\n\t}\n\tarrayBuffer() {\n\t\tconst buf = this[BUFFER];\n\t\tconst ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\treturn Promise.resolve(ab);\n\t}\n\tstream() {\n\t\tconst readable = new Readable();\n\t\treadable._read = function () {};\n\t\treadable.push(this[BUFFER]);\n\t\treadable.push(null);\n\t\treturn readable;\n\t}\n\ttoString() {\n\t\treturn '[object Blob]';\n\t}\n\tslice() {\n\t\tconst size = this.size;\n\n\t\tconst start = arguments[0];\n\t\tconst end = arguments[1];\n\t\tlet relativeStart, relativeEnd;\n\t\tif (start === undefined) {\n\t\t\trelativeStart = 0;\n\t\t} else if (start < 0) {\n\t\t\trelativeStart = Math.max(size + start, 0);\n\t\t} else {\n\t\t\trelativeStart = Math.min(start, size);\n\t\t}\n\t\tif (end === undefined) {\n\t\t\trelativeEnd = size;\n\t\t} else if (end < 0) {\n\t\t\trelativeEnd = Math.max(size + end, 0);\n\t\t} else {\n\t\t\trelativeEnd = Math.min(end, size);\n\t\t}\n\t\tconst span = Math.max(relativeEnd - relativeStart, 0);\n\n\t\tconst buffer = this[BUFFER];\n\t\tconst slicedBuffer = buffer.slice(relativeStart, relativeStart + span);\n\t\tconst blob = new Blob([], { type: arguments[2] });\n\t\tblob[BUFFER] = slicedBuffer;\n\t\treturn blob;\n\t}\n}\n\nObject.defineProperties(Blob.prototype, {\n\tsize: { enumerable: true },\n\ttype: { enumerable: true },\n\tslice: { enumerable: true }\n});\n\nObject.defineProperty(Blob.prototype, Symbol.toStringTag, {\n\tvalue: 'Blob',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\n/**\n * fetch-error.js\n *\n * FetchError interface for operational errors\n */\n\n/**\n * Create FetchError instance\n *\n * @param String message Error message for human\n * @param String type Error type for machine\n * @param String systemError For Node.js system error\n * @return FetchError\n */\nfunction FetchError(message, type, systemError) {\n Error.call(this, message);\n\n this.message = message;\n this.type = type;\n\n // when err.type is `system`, err.code contains system error code\n if (systemError) {\n this.code = this.errno = systemError.code;\n }\n\n // hide custom error implementation details from end-users\n Error.captureStackTrace(this, this.constructor);\n}\n\nFetchError.prototype = Object.create(Error.prototype);\nFetchError.prototype.constructor = FetchError;\nFetchError.prototype.name = 'FetchError';\n\nlet convert;\ntry {\n\tconvert = require('encoding').convert;\n} catch (e) {}\n\nconst INTERNALS = Symbol('Body internals');\n\n// fix an issue where \"PassThrough\" isn't a named export for node <10\nconst PassThrough = Stream.PassThrough;\n\n/**\n * Body mixin\n *\n * Ref: https://fetch.spec.whatwg.org/#body\n *\n * @param Stream body Readable stream\n * @param Object opts Response options\n * @return Void\n */\nfunction Body(body) {\n\tvar _this = this;\n\n\tvar _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n\t _ref$size = _ref.size;\n\n\tlet size = _ref$size === undefined ? 0 : _ref$size;\n\tvar _ref$timeout = _ref.timeout;\n\tlet timeout = _ref$timeout === undefined ? 0 : _ref$timeout;\n\n\tif (body == null) {\n\t\t// body is undefined or null\n\t\tbody = null;\n\t} else if (isURLSearchParams(body)) {\n\t\t// body is a URLSearchParams\n\t\tbody = Buffer.from(body.toString());\n\t} else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {\n\t\t// body is ArrayBuffer\n\t\tbody = Buffer.from(body);\n\t} else if (ArrayBuffer.isView(body)) {\n\t\t// body is ArrayBufferView\n\t\tbody = Buffer.from(body.buffer, body.byteOffset, body.byteLength);\n\t} else if (body instanceof Stream) ; else {\n\t\t// none of the above\n\t\t// coerce to string then buffer\n\t\tbody = Buffer.from(String(body));\n\t}\n\tthis[INTERNALS] = {\n\t\tbody,\n\t\tdisturbed: false,\n\t\terror: null\n\t};\n\tthis.size = size;\n\tthis.timeout = timeout;\n\n\tif (body instanceof Stream) {\n\t\tbody.on('error', function (err) {\n\t\t\tconst error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);\n\t\t\t_this[INTERNALS].error = error;\n\t\t});\n\t}\n}\n\nBody.prototype = {\n\tget body() {\n\t\treturn this[INTERNALS].body;\n\t},\n\n\tget bodyUsed() {\n\t\treturn this[INTERNALS].disturbed;\n\t},\n\n\t/**\n * Decode response as ArrayBuffer\n *\n * @return Promise\n */\n\tarrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t},\n\n\t/**\n * Return raw response as Blob\n *\n * @return Promise\n */\n\tblob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t},\n\n\t/**\n * Decode response as json\n *\n * @return Promise\n */\n\tjson() {\n\t\tvar _this2 = this;\n\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\ttry {\n\t\t\t\treturn JSON.parse(buffer.toString());\n\t\t\t} catch (err) {\n\t\t\t\treturn Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));\n\t\t\t}\n\t\t});\n\t},\n\n\t/**\n * Decode response as text\n *\n * @return Promise\n */\n\ttext() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t},\n\n\t/**\n * Decode response as buffer (non-spec api)\n *\n * @return Promise\n */\n\tbuffer() {\n\t\treturn consumeBody.call(this);\n\t},\n\n\t/**\n * Decode response as text, while automatically detecting the encoding and\n * trying to decode to UTF-8 (non-spec api)\n *\n * @return Promise\n */\n\ttextConverted() {\n\t\tvar _this3 = this;\n\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn convertBody(buffer, _this3.headers);\n\t\t});\n\t}\n};\n\n// In browsers, all properties are enumerable.\nObject.defineProperties(Body.prototype, {\n\tbody: { enumerable: true },\n\tbodyUsed: { enumerable: true },\n\tarrayBuffer: { enumerable: true },\n\tblob: { enumerable: true },\n\tjson: { enumerable: true },\n\ttext: { enumerable: true }\n});\n\nBody.mixIn = function (proto) {\n\tfor (const name of Object.getOwnPropertyNames(Body.prototype)) {\n\t\t// istanbul ignore else: future proof\n\t\tif (!(name in proto)) {\n\t\t\tconst desc = Object.getOwnPropertyDescriptor(Body.prototype, name);\n\t\t\tObject.defineProperty(proto, name, desc);\n\t\t}\n\t}\n};\n\n/**\n * Consume and convert an entire Body to a Buffer.\n *\n * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body\n *\n * @return Promise\n */\nfunction consumeBody() {\n\tvar _this4 = this;\n\n\tif (this[INTERNALS].disturbed) {\n\t\treturn Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));\n\t}\n\n\tthis[INTERNALS].disturbed = true;\n\n\tif (this[INTERNALS].error) {\n\t\treturn Body.Promise.reject(this[INTERNALS].error);\n\t}\n\n\tlet body = this.body;\n\n\t// body is null\n\tif (body === null) {\n\t\treturn Body.Promise.resolve(Buffer.alloc(0));\n\t}\n\n\t// body is blob\n\tif (isBlob(body)) {\n\t\tbody = body.stream();\n\t}\n\n\t// body is buffer\n\tif (Buffer.isBuffer(body)) {\n\t\treturn Body.Promise.resolve(body);\n\t}\n\n\t// istanbul ignore if: should never happen\n\tif (!(body instanceof Stream)) {\n\t\treturn Body.Promise.resolve(Buffer.alloc(0));\n\t}\n\n\t// body is stream\n\t// get ready to actually consume the body\n\tlet accum = [];\n\tlet accumBytes = 0;\n\tlet abort = false;\n\n\treturn new Body.Promise(function (resolve, reject) {\n\t\tlet resTimeout;\n\n\t\t// allow timeout on slow response body\n\t\tif (_this4.timeout) {\n\t\t\tresTimeout = setTimeout(function () {\n\t\t\t\tabort = true;\n\t\t\t\treject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));\n\t\t\t}, _this4.timeout);\n\t\t}\n\n\t\t// handle stream errors\n\t\tbody.on('error', function (err) {\n\t\t\tif (err.name === 'AbortError') {\n\t\t\t\t// if the request was aborted, reject with this Error\n\t\t\t\tabort = true;\n\t\t\t\treject(err);\n\t\t\t} else {\n\t\t\t\t// other errors, such as incorrect content-encoding\n\t\t\t\treject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));\n\t\t\t}\n\t\t});\n\n\t\tbody.on('data', function (chunk) {\n\t\t\tif (abort || chunk === null) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (_this4.size && accumBytes + chunk.length > _this4.size) {\n\t\t\t\tabort = true;\n\t\t\t\treject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\taccumBytes += chunk.length;\n\t\t\taccum.push(chunk);\n\t\t});\n\n\t\tbody.on('end', function () {\n\t\t\tif (abort) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tclearTimeout(resTimeout);\n\n\t\t\ttry {\n\t\t\t\tresolve(Buffer.concat(accum, accumBytes));\n\t\t\t} catch (err) {\n\t\t\t\t// handle streams that have accumulated too much data (issue #414)\n\t\t\t\treject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));\n\t\t\t}\n\t\t});\n\t});\n}\n\n/**\n * Detect buffer encoding and convert to target encoding\n * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding\n *\n * @param Buffer buffer Incoming buffer\n * @param String encoding Target encoding\n * @return String\n */\nfunction convertBody(buffer, headers) {\n\tif (typeof convert !== 'function') {\n\t\tthrow new Error('The package `encoding` must be installed to use the textConverted() function');\n\t}\n\n\tconst ct = headers.get('content-type');\n\tlet charset = 'utf-8';\n\tlet res, str;\n\n\t// header\n\tif (ct) {\n\t\tres = /charset=([^;]*)/i.exec(ct);\n\t}\n\n\t// no charset in content type, peek at response body for at most 1024 bytes\n\tstr = buffer.slice(0, 1024).toString();\n\n\t// html5\n\tif (!res && str) {\n\t\tres = / 0 && arguments[0] !== undefined ? arguments[0] : undefined;\n\n\t\tthis[MAP] = Object.create(null);\n\n\t\tif (init instanceof Headers) {\n\t\t\tconst rawHeaders = init.raw();\n\t\t\tconst headerNames = Object.keys(rawHeaders);\n\n\t\t\tfor (const headerName of headerNames) {\n\t\t\t\tfor (const value of rawHeaders[headerName]) {\n\t\t\t\t\tthis.append(headerName, value);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\t// We don't worry about converting prop to ByteString here as append()\n\t\t// will handle it.\n\t\tif (init == null) ; else if (typeof init === 'object') {\n\t\t\tconst method = init[Symbol.iterator];\n\t\t\tif (method != null) {\n\t\t\t\tif (typeof method !== 'function') {\n\t\t\t\t\tthrow new TypeError('Header pairs must be iterable');\n\t\t\t\t}\n\n\t\t\t\t// sequence>\n\t\t\t\t// Note: per spec we have to first exhaust the lists then process them\n\t\t\t\tconst pairs = [];\n\t\t\t\tfor (const pair of init) {\n\t\t\t\t\tif (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {\n\t\t\t\t\t\tthrow new TypeError('Each header pair must be iterable');\n\t\t\t\t\t}\n\t\t\t\t\tpairs.push(Array.from(pair));\n\t\t\t\t}\n\n\t\t\t\tfor (const pair of pairs) {\n\t\t\t\t\tif (pair.length !== 2) {\n\t\t\t\t\t\tthrow new TypeError('Each header pair must be a name/value tuple');\n\t\t\t\t\t}\n\t\t\t\t\tthis.append(pair[0], pair[1]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// record\n\t\t\t\tfor (const key of Object.keys(init)) {\n\t\t\t\t\tconst value = init[key];\n\t\t\t\t\tthis.append(key, value);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new TypeError('Provided initializer must be an object');\n\t\t}\n\t}\n\n\t/**\n * Return combined header value given name\n *\n * @param String name Header name\n * @return Mixed\n */\n\tget(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\tconst key = find(this[MAP], name);\n\t\tif (key === undefined) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this[MAP][key].join(', ');\n\t}\n\n\t/**\n * Iterate over all headers\n *\n * @param Function callback Executed for each item with parameters (value, name, thisArg)\n * @param Boolean thisArg `this` context for callback function\n * @return Void\n */\n\tforEach(callback) {\n\t\tlet thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;\n\n\t\tlet pairs = getHeaders(this);\n\t\tlet i = 0;\n\t\twhile (i < pairs.length) {\n\t\t\tvar _pairs$i = pairs[i];\n\t\t\tconst name = _pairs$i[0],\n\t\t\t value = _pairs$i[1];\n\n\t\t\tcallback.call(thisArg, value, name, this);\n\t\t\tpairs = getHeaders(this);\n\t\t\ti++;\n\t\t}\n\t}\n\n\t/**\n * Overwrite header values given name\n *\n * @param String name Header name\n * @param String value Header value\n * @return Void\n */\n\tset(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}\n\n\t/**\n * Append a value onto existing header\n *\n * @param String name Header name\n * @param String value Header value\n * @return Void\n */\n\tappend(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tif (key !== undefined) {\n\t\t\tthis[MAP][key].push(value);\n\t\t} else {\n\t\t\tthis[MAP][name] = [value];\n\t\t}\n\t}\n\n\t/**\n * Check for header name existence\n *\n * @param String name Header name\n * @return Boolean\n */\n\thas(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\treturn find(this[MAP], name) !== undefined;\n\t}\n\n\t/**\n * Delete all header values given name\n *\n * @param String name Header name\n * @return Void\n */\n\tdelete(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\tconst key = find(this[MAP], name);\n\t\tif (key !== undefined) {\n\t\t\tdelete this[MAP][key];\n\t\t}\n\t}\n\n\t/**\n * Return raw headers (non-spec api)\n *\n * @return Object\n */\n\traw() {\n\t\treturn this[MAP];\n\t}\n\n\t/**\n * Get an iterator on keys.\n *\n * @return Iterator\n */\n\tkeys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}\n\n\t/**\n * Get an iterator on values.\n *\n * @return Iterator\n */\n\tvalues() {\n\t\treturn createHeadersIterator(this, 'value');\n\t}\n\n\t/**\n * Get an iterator on entries.\n *\n * This is the default iterator of the Headers object.\n *\n * @return Iterator\n */\n\t[Symbol.iterator]() {\n\t\treturn createHeadersIterator(this, 'key+value');\n\t}\n}\nHeaders.prototype.entries = Headers.prototype[Symbol.iterator];\n\nObject.defineProperty(Headers.prototype, Symbol.toStringTag, {\n\tvalue: 'Headers',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\nObject.defineProperties(Headers.prototype, {\n\tget: { enumerable: true },\n\tforEach: { enumerable: true },\n\tset: { enumerable: true },\n\tappend: { enumerable: true },\n\thas: { enumerable: true },\n\tdelete: { enumerable: true },\n\tkeys: { enumerable: true },\n\tvalues: { enumerable: true },\n\tentries: { enumerable: true }\n});\n\nfunction getHeaders(headers) {\n\tlet kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';\n\n\tconst keys = Object.keys(headers[MAP]).sort();\n\treturn keys.map(kind === 'key' ? function (k) {\n\t\treturn k.toLowerCase();\n\t} : kind === 'value' ? function (k) {\n\t\treturn headers[MAP][k].join(', ');\n\t} : function (k) {\n\t\treturn [k.toLowerCase(), headers[MAP][k].join(', ')];\n\t});\n}\n\nconst INTERNAL = Symbol('internal');\n\nfunction createHeadersIterator(target, kind) {\n\tconst iterator = Object.create(HeadersIteratorPrototype);\n\titerator[INTERNAL] = {\n\t\ttarget,\n\t\tkind,\n\t\tindex: 0\n\t};\n\treturn iterator;\n}\n\nconst HeadersIteratorPrototype = Object.setPrototypeOf({\n\tnext() {\n\t\t// istanbul ignore if\n\t\tif (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {\n\t\t\tthrow new TypeError('Value of `this` is not a HeadersIterator');\n\t\t}\n\n\t\tvar _INTERNAL = this[INTERNAL];\n\t\tconst target = _INTERNAL.target,\n\t\t kind = _INTERNAL.kind,\n\t\t index = _INTERNAL.index;\n\n\t\tconst values = getHeaders(target, kind);\n\t\tconst len = values.length;\n\t\tif (index >= len) {\n\t\t\treturn {\n\t\t\t\tvalue: undefined,\n\t\t\t\tdone: true\n\t\t\t};\n\t\t}\n\n\t\tthis[INTERNAL].index = index + 1;\n\n\t\treturn {\n\t\t\tvalue: values[index],\n\t\t\tdone: false\n\t\t};\n\t}\n}, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));\n\nObject.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {\n\tvalue: 'HeadersIterator',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\n/**\n * Export the Headers object in a form that Node.js can consume.\n *\n * @param Headers headers\n * @return Object\n */\nfunction exportNodeCompatibleHeaders(headers) {\n\tconst obj = Object.assign({ __proto__: null }, headers[MAP]);\n\n\t// http.request() only supports string as Host header. This hack makes\n\t// specifying custom Host header possible.\n\tconst hostHeaderKey = find(headers[MAP], 'Host');\n\tif (hostHeaderKey !== undefined) {\n\t\tobj[hostHeaderKey] = obj[hostHeaderKey][0];\n\t}\n\n\treturn obj;\n}\n\n/**\n * Create a Headers object from an object of headers, ignoring those that do\n * not conform to HTTP grammar productions.\n *\n * @param Object obj Object of headers\n * @return Headers\n */\nfunction createHeadersLenient(obj) {\n\tconst headers = new Headers();\n\tfor (const name of Object.keys(obj)) {\n\t\tif (invalidTokenRegex.test(name)) {\n\t\t\tcontinue;\n\t\t}\n\t\tif (Array.isArray(obj[name])) {\n\t\t\tfor (const val of obj[name]) {\n\t\t\t\tif (invalidHeaderCharRegex.test(val)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (headers[MAP][name] === undefined) {\n\t\t\t\t\theaders[MAP][name] = [val];\n\t\t\t\t} else {\n\t\t\t\t\theaders[MAP][name].push(val);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (!invalidHeaderCharRegex.test(obj[name])) {\n\t\t\theaders[MAP][name] = [obj[name]];\n\t\t}\n\t}\n\treturn headers;\n}\n\nconst INTERNALS$1 = Symbol('Response internals');\n\n// fix an issue where \"STATUS_CODES\" aren't a named export for node <10\nconst STATUS_CODES = http.STATUS_CODES;\n\n/**\n * Response class\n *\n * @param Stream body Readable stream\n * @param Object opts Response options\n * @return Void\n */\nclass Response {\n\tconstructor() {\n\t\tlet body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n\t\tlet opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n\t\tBody.call(this, body, opts);\n\n\t\tconst status = opts.status || 200;\n\t\tconst headers = new Headers(opts.headers);\n\n\t\tif (body != null && !headers.has('Content-Type')) {\n\t\t\tconst contentType = extractContentType(body);\n\t\t\tif (contentType) {\n\t\t\t\theaders.append('Content-Type', contentType);\n\t\t\t}\n\t\t}\n\n\t\tthis[INTERNALS$1] = {\n\t\t\turl: opts.url,\n\t\t\tstatus,\n\t\t\tstatusText: opts.statusText || STATUS_CODES[status],\n\t\t\theaders,\n\t\t\tcounter: opts.counter\n\t\t};\n\t}\n\n\tget url() {\n\t\treturn this[INTERNALS$1].url || '';\n\t}\n\n\tget status() {\n\t\treturn this[INTERNALS$1].status;\n\t}\n\n\t/**\n * Convenience property representing if the request ended normally\n */\n\tget ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}\n\n\tget redirected() {\n\t\treturn this[INTERNALS$1].counter > 0;\n\t}\n\n\tget statusText() {\n\t\treturn this[INTERNALS$1].statusText;\n\t}\n\n\tget headers() {\n\t\treturn this[INTERNALS$1].headers;\n\t}\n\n\t/**\n * Clone this response\n *\n * @return Response\n */\n\tclone() {\n\t\treturn new Response(clone(this), {\n\t\t\turl: this.url,\n\t\t\tstatus: this.status,\n\t\t\tstatusText: this.statusText,\n\t\t\theaders: this.headers,\n\t\t\tok: this.ok,\n\t\t\tredirected: this.redirected\n\t\t});\n\t}\n}\n\nBody.mixIn(Response.prototype);\n\nObject.defineProperties(Response.prototype, {\n\turl: { enumerable: true },\n\tstatus: { enumerable: true },\n\tok: { enumerable: true },\n\tredirected: { enumerable: true },\n\tstatusText: { enumerable: true },\n\theaders: { enumerable: true },\n\tclone: { enumerable: true }\n});\n\nObject.defineProperty(Response.prototype, Symbol.toStringTag, {\n\tvalue: 'Response',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\nconst INTERNALS$2 = Symbol('Request internals');\nconst URL = Url.URL || whatwgUrl.URL;\n\n// fix an issue where \"format\", \"parse\" aren't a named export for node <10\nconst parse_url = Url.parse;\nconst format_url = Url.format;\n\n/**\n * Wrapper around `new URL` to handle arbitrary URLs\n *\n * @param {string} urlStr\n * @return {void}\n */\nfunction parseURL(urlStr) {\n\t/*\n \tCheck whether the URL is absolute or not\n \t\tScheme: https://tools.ietf.org/html/rfc3986#section-3.1\n \tAbsolute URL: https://tools.ietf.org/html/rfc3986#section-4.3\n */\n\tif (/^[a-zA-Z][a-zA-Z\\d+\\-.]*:/.exec(urlStr)) {\n\t\turlStr = new URL(urlStr).toString();\n\t}\n\n\t// Fallback to old implementation for arbitrary URLs\n\treturn parse_url(urlStr);\n}\n\nconst streamDestructionSupported = 'destroy' in Stream.Readable.prototype;\n\n/**\n * Check if a value is an instance of Request.\n *\n * @param Mixed input\n * @return Boolean\n */\nfunction isRequest(input) {\n\treturn typeof input === 'object' && typeof input[INTERNALS$2] === 'object';\n}\n\nfunction isAbortSignal(signal) {\n\tconst proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);\n\treturn !!(proto && proto.constructor.name === 'AbortSignal');\n}\n\n/**\n * Request class\n *\n * @param Mixed input Url or Request instance\n * @param Object init Custom options\n * @return Void\n */\nclass Request {\n\tconstructor(input) {\n\t\tlet init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n\t\tlet parsedURL;\n\n\t\t// normalize input\n\t\tif (!isRequest(input)) {\n\t\t\tif (input && input.href) {\n\t\t\t\t// in order to support Node.js' Url objects; though WHATWG's URL objects\n\t\t\t\t// will fall into this branch also (since their `toString()` will return\n\t\t\t\t// `href` property anyway)\n\t\t\t\tparsedURL = parseURL(input.href);\n\t\t\t} else {\n\t\t\t\t// coerce input to a string before attempting to parse\n\t\t\t\tparsedURL = parseURL(`${input}`);\n\t\t\t}\n\t\t\tinput = {};\n\t\t} else {\n\t\t\tparsedURL = parseURL(input.url);\n\t\t}\n\n\t\tlet method = init.method || input.method || 'GET';\n\t\tmethod = method.toUpperCase();\n\n\t\tif ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {\n\t\t\tthrow new TypeError('Request with GET/HEAD method cannot have body');\n\t\t}\n\n\t\tlet inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;\n\n\t\tBody.call(this, inputBody, {\n\t\t\ttimeout: init.timeout || input.timeout || 0,\n\t\t\tsize: init.size || input.size || 0\n\t\t});\n\n\t\tconst headers = new Headers(init.headers || input.headers || {});\n\n\t\tif (inputBody != null && !headers.has('Content-Type')) {\n\t\t\tconst contentType = extractContentType(inputBody);\n\t\t\tif (contentType) {\n\t\t\t\theaders.append('Content-Type', contentType);\n\t\t\t}\n\t\t}\n\n\t\tlet signal = isRequest(input) ? input.signal : null;\n\t\tif ('signal' in init) signal = init.signal;\n\n\t\tif (signal != null && !isAbortSignal(signal)) {\n\t\t\tthrow new TypeError('Expected signal to be an instanceof AbortSignal');\n\t\t}\n\n\t\tthis[INTERNALS$2] = {\n\t\t\tmethod,\n\t\t\tredirect: init.redirect || input.redirect || 'follow',\n\t\t\theaders,\n\t\t\tparsedURL,\n\t\t\tsignal\n\t\t};\n\n\t\t// node-fetch-only options\n\t\tthis.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;\n\t\tthis.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;\n\t\tthis.counter = init.counter || input.counter || 0;\n\t\tthis.agent = init.agent || input.agent;\n\t}\n\n\tget method() {\n\t\treturn this[INTERNALS$2].method;\n\t}\n\n\tget url() {\n\t\treturn format_url(this[INTERNALS$2].parsedURL);\n\t}\n\n\tget headers() {\n\t\treturn this[INTERNALS$2].headers;\n\t}\n\n\tget redirect() {\n\t\treturn this[INTERNALS$2].redirect;\n\t}\n\n\tget signal() {\n\t\treturn this[INTERNALS$2].signal;\n\t}\n\n\t/**\n * Clone this request\n *\n * @return Request\n */\n\tclone() {\n\t\treturn new Request(this);\n\t}\n}\n\nBody.mixIn(Request.prototype);\n\nObject.defineProperty(Request.prototype, Symbol.toStringTag, {\n\tvalue: 'Request',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\nObject.defineProperties(Request.prototype, {\n\tmethod: { enumerable: true },\n\turl: { enumerable: true },\n\theaders: { enumerable: true },\n\tredirect: { enumerable: true },\n\tclone: { enumerable: true },\n\tsignal: { enumerable: true }\n});\n\n/**\n * Convert a Request to Node.js http request options.\n *\n * @param Request A Request instance\n * @return Object The options object to be passed to http.request\n */\nfunction getNodeRequestOptions(request) {\n\tconst parsedURL = request[INTERNALS$2].parsedURL;\n\tconst headers = new Headers(request[INTERNALS$2].headers);\n\n\t// fetch step 1.3\n\tif (!headers.has('Accept')) {\n\t\theaders.set('Accept', '*/*');\n\t}\n\n\t// Basic fetch\n\tif (!parsedURL.protocol || !parsedURL.hostname) {\n\t\tthrow new TypeError('Only absolute URLs are supported');\n\t}\n\n\tif (!/^https?:$/.test(parsedURL.protocol)) {\n\t\tthrow new TypeError('Only HTTP(S) protocols are supported');\n\t}\n\n\tif (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {\n\t\tthrow new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');\n\t}\n\n\t// HTTP-network-or-cache fetch steps 2.4-2.7\n\tlet contentLengthValue = null;\n\tif (request.body == null && /^(POST|PUT)$/i.test(request.method)) {\n\t\tcontentLengthValue = '0';\n\t}\n\tif (request.body != null) {\n\t\tconst totalBytes = getTotalBytes(request);\n\t\tif (typeof totalBytes === 'number') {\n\t\t\tcontentLengthValue = String(totalBytes);\n\t\t}\n\t}\n\tif (contentLengthValue) {\n\t\theaders.set('Content-Length', contentLengthValue);\n\t}\n\n\t// HTTP-network-or-cache fetch step 2.11\n\tif (!headers.has('User-Agent')) {\n\t\theaders.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');\n\t}\n\n\t// HTTP-network-or-cache fetch step 2.15\n\tif (request.compress && !headers.has('Accept-Encoding')) {\n\t\theaders.set('Accept-Encoding', 'gzip,deflate');\n\t}\n\n\tlet agent = request.agent;\n\tif (typeof agent === 'function') {\n\t\tagent = agent(parsedURL);\n\t}\n\n\tif (!headers.has('Connection') && !agent) {\n\t\theaders.set('Connection', 'close');\n\t}\n\n\t// HTTP-network fetch step 4.2\n\t// chunked encoding is handled by Node.js\n\n\treturn Object.assign({}, parsedURL, {\n\t\tmethod: request.method,\n\t\theaders: exportNodeCompatibleHeaders(headers),\n\t\tagent\n\t});\n}\n\n/**\n * abort-error.js\n *\n * AbortError interface for cancelled requests\n */\n\n/**\n * Create AbortError instance\n *\n * @param String message Error message for human\n * @return AbortError\n */\nfunction AbortError(message) {\n Error.call(this, message);\n\n this.type = 'aborted';\n this.message = message;\n\n // hide custom error implementation details from end-users\n Error.captureStackTrace(this, this.constructor);\n}\n\nAbortError.prototype = Object.create(Error.prototype);\nAbortError.prototype.constructor = AbortError;\nAbortError.prototype.name = 'AbortError';\n\nconst URL$1 = Url.URL || whatwgUrl.URL;\n\n// fix an issue where \"PassThrough\", \"resolve\" aren't a named export for node <10\nconst PassThrough$1 = Stream.PassThrough;\n\nconst isDomainOrSubdomain = function isDomainOrSubdomain(destination, original) {\n\tconst orig = new URL$1(original).hostname;\n\tconst dest = new URL$1(destination).hostname;\n\n\treturn orig === dest || orig[orig.length - dest.length - 1] === '.' && orig.endsWith(dest);\n};\n\n/**\n * isSameProtocol reports whether the two provided URLs use the same protocol.\n *\n * Both domains must already be in canonical form.\n * @param {string|URL} original\n * @param {string|URL} destination\n */\nconst isSameProtocol = function isSameProtocol(destination, original) {\n\tconst orig = new URL$1(original).protocol;\n\tconst dest = new URL$1(destination).protocol;\n\n\treturn orig === dest;\n};\n\n/**\n * Fetch function\n *\n * @param Mixed url Absolute url or Request instance\n * @param Object opts Fetch options\n * @return Promise\n */\nfunction fetch(url, opts) {\n\n\t// allow custom promise\n\tif (!fetch.Promise) {\n\t\tthrow new Error('native promise missing, set fetch.Promise to your favorite alternative');\n\t}\n\n\tBody.Promise = fetch.Promise;\n\n\t// wrap http.request into fetch\n\treturn new fetch.Promise(function (resolve, reject) {\n\t\t// build request object\n\t\tconst request = new Request(url, opts);\n\t\tconst options = getNodeRequestOptions(request);\n\n\t\tconst send = (options.protocol === 'https:' ? https : http).request;\n\t\tconst signal = request.signal;\n\n\t\tlet response = null;\n\n\t\tconst abort = function abort() {\n\t\t\tlet error = new AbortError('The user aborted a request.');\n\t\t\treject(error);\n\t\t\tif (request.body && request.body instanceof Stream.Readable) {\n\t\t\t\tdestroyStream(request.body, error);\n\t\t\t}\n\t\t\tif (!response || !response.body) return;\n\t\t\tresponse.body.emit('error', error);\n\t\t};\n\n\t\tif (signal && signal.aborted) {\n\t\t\tabort();\n\t\t\treturn;\n\t\t}\n\n\t\tconst abortAndFinalize = function abortAndFinalize() {\n\t\t\tabort();\n\t\t\tfinalize();\n\t\t};\n\n\t\t// send request\n\t\tconst req = send(options);\n\t\tlet reqTimeout;\n\n\t\tif (signal) {\n\t\t\tsignal.addEventListener('abort', abortAndFinalize);\n\t\t}\n\n\t\tfunction finalize() {\n\t\t\treq.abort();\n\t\t\tif (signal) signal.removeEventListener('abort', abortAndFinalize);\n\t\t\tclearTimeout(reqTimeout);\n\t\t}\n\n\t\tif (request.timeout) {\n\t\t\treq.once('socket', function (socket) {\n\t\t\t\treqTimeout = setTimeout(function () {\n\t\t\t\t\treject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));\n\t\t\t\t\tfinalize();\n\t\t\t\t}, request.timeout);\n\t\t\t});\n\t\t}\n\n\t\treq.on('error', function (err) {\n\t\t\treject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));\n\n\t\t\tif (response && response.body) {\n\t\t\t\tdestroyStream(response.body, err);\n\t\t\t}\n\n\t\t\tfinalize();\n\t\t});\n\n\t\tfixResponseChunkedTransferBadEnding(req, function (err) {\n\t\t\tif (signal && signal.aborted) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (response && response.body) {\n\t\t\t\tdestroyStream(response.body, err);\n\t\t\t}\n\t\t});\n\n\t\t/* c8 ignore next 18 */\n\t\tif (parseInt(process.version.substring(1)) < 14) {\n\t\t\t// Before Node.js 14, pipeline() does not fully support async iterators and does not always\n\t\t\t// properly handle when the socket close/end events are out of order.\n\t\t\treq.on('socket', function (s) {\n\t\t\t\ts.addListener('close', function (hadError) {\n\t\t\t\t\t// if a data listener is still present we didn't end cleanly\n\t\t\t\t\tconst hasDataListener = s.listenerCount('data') > 0;\n\n\t\t\t\t\t// if end happened before close but the socket didn't emit an error, do it now\n\t\t\t\t\tif (response && hasDataListener && !hadError && !(signal && signal.aborted)) {\n\t\t\t\t\t\tconst err = new Error('Premature close');\n\t\t\t\t\t\terr.code = 'ERR_STREAM_PREMATURE_CLOSE';\n\t\t\t\t\t\tresponse.body.emit('error', err);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\treq.on('response', function (res) {\n\t\t\tclearTimeout(reqTimeout);\n\n\t\t\tconst headers = createHeadersLenient(res.headers);\n\n\t\t\t// HTTP fetch step 5\n\t\t\tif (fetch.isRedirect(res.statusCode)) {\n\t\t\t\t// HTTP fetch step 5.2\n\t\t\t\tconst location = headers.get('Location');\n\n\t\t\t\t// HTTP fetch step 5.3\n\t\t\t\tlet locationURL = null;\n\t\t\t\ttry {\n\t\t\t\t\tlocationURL = location === null ? null : new URL$1(location, request.url).toString();\n\t\t\t\t} catch (err) {\n\t\t\t\t\t// error here can only be invalid URL in Location: header\n\t\t\t\t\t// do not throw when options.redirect == manual\n\t\t\t\t\t// let the user extract the errorneous redirect URL\n\t\t\t\t\tif (request.redirect !== 'manual') {\n\t\t\t\t\t\treject(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, 'invalid-redirect'));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// HTTP fetch step 5.5\n\t\t\t\tswitch (request.redirect) {\n\t\t\t\t\tcase 'error':\n\t\t\t\t\t\treject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect'));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t\tcase 'manual':\n\t\t\t\t\t\t// node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.\n\t\t\t\t\t\tif (locationURL !== null) {\n\t\t\t\t\t\t\t// handle corrupted header\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\theaders.set('Location', locationURL);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\t// istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request\n\t\t\t\t\t\t\t\treject(err);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'follow':\n\t\t\t\t\t\t// HTTP-redirect fetch step 2\n\t\t\t\t\t\tif (locationURL === null) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 5\n\t\t\t\t\t\tif (request.counter >= request.follow) {\n\t\t\t\t\t\t\treject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));\n\t\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 6 (counter increment)\n\t\t\t\t\t\t// Create a new Request object.\n\t\t\t\t\t\tconst requestOpts = {\n\t\t\t\t\t\t\theaders: new Headers(request.headers),\n\t\t\t\t\t\t\tfollow: request.follow,\n\t\t\t\t\t\t\tcounter: request.counter + 1,\n\t\t\t\t\t\t\tagent: request.agent,\n\t\t\t\t\t\t\tcompress: request.compress,\n\t\t\t\t\t\t\tmethod: request.method,\n\t\t\t\t\t\t\tbody: request.body,\n\t\t\t\t\t\t\tsignal: request.signal,\n\t\t\t\t\t\t\ttimeout: request.timeout,\n\t\t\t\t\t\t\tsize: request.size\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tif (!isDomainOrSubdomain(request.url, locationURL) || !isSameProtocol(request.url, locationURL)) {\n\t\t\t\t\t\t\tfor (const name of ['authorization', 'www-authenticate', 'cookie', 'cookie2']) {\n\t\t\t\t\t\t\t\trequestOpts.headers.delete(name);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 9\n\t\t\t\t\t\tif (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {\n\t\t\t\t\t\t\treject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));\n\t\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 11\n\t\t\t\t\t\tif (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {\n\t\t\t\t\t\t\trequestOpts.method = 'GET';\n\t\t\t\t\t\t\trequestOpts.body = undefined;\n\t\t\t\t\t\t\trequestOpts.headers.delete('content-length');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 15\n\t\t\t\t\t\tresolve(fetch(new Request(locationURL, requestOpts)));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// prepare response\n\t\t\tres.once('end', function () {\n\t\t\t\tif (signal) signal.removeEventListener('abort', abortAndFinalize);\n\t\t\t});\n\t\t\tlet body = res.pipe(new PassThrough$1());\n\n\t\t\tconst response_options = {\n\t\t\t\turl: request.url,\n\t\t\t\tstatus: res.statusCode,\n\t\t\t\tstatusText: res.statusMessage,\n\t\t\t\theaders: headers,\n\t\t\t\tsize: request.size,\n\t\t\t\ttimeout: request.timeout,\n\t\t\t\tcounter: request.counter\n\t\t\t};\n\n\t\t\t// HTTP-network fetch step 12.1.1.3\n\t\t\tconst codings = headers.get('Content-Encoding');\n\n\t\t\t// HTTP-network fetch step 12.1.1.4: handle content codings\n\n\t\t\t// in following scenarios we ignore compression support\n\t\t\t// 1. compression support is disabled\n\t\t\t// 2. HEAD request\n\t\t\t// 3. no Content-Encoding header\n\t\t\t// 4. no content response (204)\n\t\t\t// 5. content not modified response (304)\n\t\t\tif (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {\n\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// For Node v6+\n\t\t\t// Be less strict when decoding compressed responses, since sometimes\n\t\t\t// servers send slightly invalid responses that are still accepted\n\t\t\t// by common browsers.\n\t\t\t// Always using Z_SYNC_FLUSH is what cURL does.\n\t\t\tconst zlibOptions = {\n\t\t\t\tflush: zlib.Z_SYNC_FLUSH,\n\t\t\t\tfinishFlush: zlib.Z_SYNC_FLUSH\n\t\t\t};\n\n\t\t\t// for gzip\n\t\t\tif (codings == 'gzip' || codings == 'x-gzip') {\n\t\t\t\tbody = body.pipe(zlib.createGunzip(zlibOptions));\n\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// for deflate\n\t\t\tif (codings == 'deflate' || codings == 'x-deflate') {\n\t\t\t\t// handle the infamous raw deflate response from old servers\n\t\t\t\t// a hack for old IIS and Apache servers\n\t\t\t\tconst raw = res.pipe(new PassThrough$1());\n\t\t\t\traw.once('data', function (chunk) {\n\t\t\t\t\t// see http://stackoverflow.com/questions/37519828\n\t\t\t\t\tif ((chunk[0] & 0x0F) === 0x08) {\n\t\t\t\t\t\tbody = body.pipe(zlib.createInflate());\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbody = body.pipe(zlib.createInflateRaw());\n\t\t\t\t\t}\n\t\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\t\tresolve(response);\n\t\t\t\t});\n\t\t\t\traw.on('end', function () {\n\t\t\t\t\t// some old IIS servers return zero-length OK deflate responses, so 'data' is never emitted.\n\t\t\t\t\tif (!response) {\n\t\t\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\t\t\tresolve(response);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// for br\n\t\t\tif (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {\n\t\t\t\tbody = body.pipe(zlib.createBrotliDecompress());\n\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// otherwise, use response as-is\n\t\t\tresponse = new Response(body, response_options);\n\t\t\tresolve(response);\n\t\t});\n\n\t\twriteToStream(req, request);\n\t});\n}\nfunction fixResponseChunkedTransferBadEnding(request, errorCallback) {\n\tlet socket;\n\n\trequest.on('socket', function (s) {\n\t\tsocket = s;\n\t});\n\n\trequest.on('response', function (response) {\n\t\tconst headers = response.headers;\n\n\t\tif (headers['transfer-encoding'] === 'chunked' && !headers['content-length']) {\n\t\t\tresponse.once('close', function (hadError) {\n\t\t\t\t// tests for socket presence, as in some situations the\n\t\t\t\t// the 'socket' event is not triggered for the request\n\t\t\t\t// (happens in deno), avoids `TypeError`\n\t\t\t\t// if a data listener is still present we didn't end cleanly\n\t\t\t\tconst hasDataListener = socket && socket.listenerCount('data') > 0;\n\n\t\t\t\tif (hasDataListener && !hadError) {\n\t\t\t\t\tconst err = new Error('Premature close');\n\t\t\t\t\terr.code = 'ERR_STREAM_PREMATURE_CLOSE';\n\t\t\t\t\terrorCallback(err);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t});\n}\n\nfunction destroyStream(stream, err) {\n\tif (stream.destroy) {\n\t\tstream.destroy(err);\n\t} else {\n\t\t// node < 8\n\t\tstream.emit('error', err);\n\t\tstream.end();\n\t}\n}\n\n/**\n * Redirect code matching\n *\n * @param Number code Status code\n * @return Boolean\n */\nfetch.isRedirect = function (code) {\n\treturn code === 301 || code === 302 || code === 303 || code === 307 || code === 308;\n};\n\n// expose Promise\nfetch.Promise = global.Promise;\n\nmodule.exports = exports = fetch;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = exports;\nexports.Headers = Headers;\nexports.Request = Request;\nexports.Response = Response;\nexports.FetchError = FetchError;\n","\"use strict\";\n\nvar punycode = require(\"punycode\");\nvar mappingTable = require(\"./lib/mappingTable.json\");\n\nvar PROCESSING_OPTIONS = {\n TRANSITIONAL: 0,\n NONTRANSITIONAL: 1\n};\n\nfunction normalize(str) { // fix bug in v8\n return str.split('\\u0000').map(function (s) { return s.normalize('NFC'); }).join('\\u0000');\n}\n\nfunction findStatus(val) {\n var start = 0;\n var end = mappingTable.length - 1;\n\n while (start <= end) {\n var mid = Math.floor((start + end) / 2);\n\n var target = mappingTable[mid];\n if (target[0][0] <= val && target[0][1] >= val) {\n return target;\n } else if (target[0][0] > val) {\n end = mid - 1;\n } else {\n start = mid + 1;\n }\n }\n\n return null;\n}\n\nvar regexAstralSymbols = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n\nfunction countSymbols(string) {\n return string\n // replace every surrogate pair with a BMP symbol\n .replace(regexAstralSymbols, '_')\n // then get the length\n .length;\n}\n\nfunction mapChars(domain_name, useSTD3, processing_option) {\n var hasError = false;\n var processed = \"\";\n\n var len = countSymbols(domain_name);\n for (var i = 0; i < len; ++i) {\n var codePoint = domain_name.codePointAt(i);\n var status = findStatus(codePoint);\n\n switch (status[1]) {\n case \"disallowed\":\n hasError = true;\n processed += String.fromCodePoint(codePoint);\n break;\n case \"ignored\":\n break;\n case \"mapped\":\n processed += String.fromCodePoint.apply(String, status[2]);\n break;\n case \"deviation\":\n if (processing_option === PROCESSING_OPTIONS.TRANSITIONAL) {\n processed += String.fromCodePoint.apply(String, status[2]);\n } else {\n processed += String.fromCodePoint(codePoint);\n }\n break;\n case \"valid\":\n processed += String.fromCodePoint(codePoint);\n break;\n case \"disallowed_STD3_mapped\":\n if (useSTD3) {\n hasError = true;\n processed += String.fromCodePoint(codePoint);\n } else {\n processed += String.fromCodePoint.apply(String, status[2]);\n }\n break;\n case \"disallowed_STD3_valid\":\n if (useSTD3) {\n hasError = true;\n }\n\n processed += String.fromCodePoint(codePoint);\n break;\n }\n }\n\n return {\n string: processed,\n error: hasError\n };\n}\n\nvar combiningMarksRegex = /[\\u0300-\\u036F\\u0483-\\u0489\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u065F\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07EB-\\u07F3\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u08E4-\\u0903\\u093A-\\u093C\\u093E-\\u094F\\u0951-\\u0957\\u0962\\u0963\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u0A01-\\u0A03\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A70\\u0A71\\u0A75\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AE2\\u0AE3\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B62\\u0B63\\u0B82\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0C00-\\u0C03\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0C81-\\u0C83\\u0CBC\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CE2\\u0CE3\\u0D01-\\u0D03\\u0D3E-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4D\\u0D57\\u0D62\\u0D63\\u0D82\\u0D83\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0EB1\\u0EB4-\\u0EB9\\u0EBB\\u0EBC\\u0EC8-\\u0ECD\\u0F18\\u0F19\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102B-\\u103E\\u1056-\\u1059\\u105E-\\u1060\\u1062-\\u1064\\u1067-\\u106D\\u1071-\\u1074\\u1082-\\u108D\\u108F\\u109A-\\u109D\\u135D-\\u135F\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B4-\\u17D3\\u17DD\\u180B-\\u180D\\u18A9\\u1920-\\u192B\\u1930-\\u193B\\u19B0-\\u19C0\\u19C8\\u19C9\\u1A17-\\u1A1B\\u1A55-\\u1A5E\\u1A60-\\u1A7C\\u1A7F\\u1AB0-\\u1ABE\\u1B00-\\u1B04\\u1B34-\\u1B44\\u1B6B-\\u1B73\\u1B80-\\u1B82\\u1BA1-\\u1BAD\\u1BE6-\\u1BF3\\u1C24-\\u1C37\\u1CD0-\\u1CD2\\u1CD4-\\u1CE8\\u1CED\\u1CF2-\\u1CF4\\u1CF8\\u1CF9\\u1DC0-\\u1DF5\\u1DFC-\\u1DFF\\u20D0-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA66F-\\uA672\\uA674-\\uA67D\\uA69F\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA823-\\uA827\\uA880\\uA881\\uA8B4-\\uA8C4\\uA8E0-\\uA8F1\\uA926-\\uA92D\\uA947-\\uA953\\uA980-\\uA983\\uA9B3-\\uA9C0\\uA9E5\\uAA29-\\uAA36\\uAA43\\uAA4C\\uAA4D\\uAA7B-\\uAA7D\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uAAEB-\\uAAEF\\uAAF5\\uAAF6\\uABE3-\\uABEA\\uABEC\\uABED\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE2D]|\\uD800[\\uDDFD\\uDEE0\\uDF76-\\uDF7A]|\\uD802[\\uDE01-\\uDE03\\uDE05\\uDE06\\uDE0C-\\uDE0F\\uDE38-\\uDE3A\\uDE3F\\uDEE5\\uDEE6]|\\uD804[\\uDC00-\\uDC02\\uDC38-\\uDC46\\uDC7F-\\uDC82\\uDCB0-\\uDCBA\\uDD00-\\uDD02\\uDD27-\\uDD34\\uDD73\\uDD80-\\uDD82\\uDDB3-\\uDDC0\\uDE2C-\\uDE37\\uDEDF-\\uDEEA\\uDF01-\\uDF03\\uDF3C\\uDF3E-\\uDF44\\uDF47\\uDF48\\uDF4B-\\uDF4D\\uDF57\\uDF62\\uDF63\\uDF66-\\uDF6C\\uDF70-\\uDF74]|\\uD805[\\uDCB0-\\uDCC3\\uDDAF-\\uDDB5\\uDDB8-\\uDDC0\\uDE30-\\uDE40\\uDEAB-\\uDEB7]|\\uD81A[\\uDEF0-\\uDEF4\\uDF30-\\uDF36]|\\uD81B[\\uDF51-\\uDF7E\\uDF8F-\\uDF92]|\\uD82F[\\uDC9D\\uDC9E]|\\uD834[\\uDD65-\\uDD69\\uDD6D-\\uDD72\\uDD7B-\\uDD82\\uDD85-\\uDD8B\\uDDAA-\\uDDAD\\uDE42-\\uDE44]|\\uD83A[\\uDCD0-\\uDCD6]|\\uDB40[\\uDD00-\\uDDEF]/;\n\nfunction validateLabel(label, processing_option) {\n if (label.substr(0, 4) === \"xn--\") {\n label = punycode.toUnicode(label);\n processing_option = PROCESSING_OPTIONS.NONTRANSITIONAL;\n }\n\n var error = false;\n\n if (normalize(label) !== label ||\n (label[3] === \"-\" && label[4] === \"-\") ||\n label[0] === \"-\" || label[label.length - 1] === \"-\" ||\n label.indexOf(\".\") !== -1 ||\n label.search(combiningMarksRegex) === 0) {\n error = true;\n }\n\n var len = countSymbols(label);\n for (var i = 0; i < len; ++i) {\n var status = findStatus(label.codePointAt(i));\n if ((processing === PROCESSING_OPTIONS.TRANSITIONAL && status[1] !== \"valid\") ||\n (processing === PROCESSING_OPTIONS.NONTRANSITIONAL &&\n status[1] !== \"valid\" && status[1] !== \"deviation\")) {\n error = true;\n break;\n }\n }\n\n return {\n label: label,\n error: error\n };\n}\n\nfunction processing(domain_name, useSTD3, processing_option) {\n var result = mapChars(domain_name, useSTD3, processing_option);\n result.string = normalize(result.string);\n\n var labels = result.string.split(\".\");\n for (var i = 0; i < labels.length; ++i) {\n try {\n var validation = validateLabel(labels[i]);\n labels[i] = validation.label;\n result.error = result.error || validation.error;\n } catch(e) {\n result.error = true;\n }\n }\n\n return {\n string: labels.join(\".\"),\n error: result.error\n };\n}\n\nmodule.exports.toASCII = function(domain_name, useSTD3, processing_option, verifyDnsLength) {\n var result = processing(domain_name, useSTD3, processing_option);\n var labels = result.string.split(\".\");\n labels = labels.map(function(l) {\n try {\n return punycode.toASCII(l);\n } catch(e) {\n result.error = true;\n return l;\n }\n });\n\n if (verifyDnsLength) {\n var total = labels.slice(0, labels.length - 1).join(\".\").length;\n if (total.length > 253 || total.length === 0) {\n result.error = true;\n }\n\n for (var i=0; i < labels.length; ++i) {\n if (labels.length > 63 || labels.length === 0) {\n result.error = true;\n break;\n }\n }\n }\n\n if (result.error) return null;\n return labels.join(\".\");\n};\n\nmodule.exports.toUnicode = function(domain_name, useSTD3) {\n var result = processing(domain_name, useSTD3, PROCESSING_OPTIONS.NONTRANSITIONAL);\n\n return {\n domain: result.string,\n error: result.error\n };\n};\n\nmodule.exports.PROCESSING_OPTIONS = PROCESSING_OPTIONS;\n","module.exports = require('./lib/tunnel');\n","'use strict';\n\nvar net = require('net');\nvar tls = require('tls');\nvar http = require('http');\nvar https = require('https');\nvar events = require('events');\nvar assert = require('assert');\nvar util = require('util');\n\n\nexports.httpOverHttp = httpOverHttp;\nexports.httpsOverHttp = httpsOverHttp;\nexports.httpOverHttps = httpOverHttps;\nexports.httpsOverHttps = httpsOverHttps;\n\n\nfunction httpOverHttp(options) {\n var agent = new TunnelingAgent(options);\n agent.request = http.request;\n return agent;\n}\n\nfunction httpsOverHttp(options) {\n var agent = new TunnelingAgent(options);\n agent.request = http.request;\n agent.createSocket = createSecureSocket;\n agent.defaultPort = 443;\n return agent;\n}\n\nfunction httpOverHttps(options) {\n var agent = new TunnelingAgent(options);\n agent.request = https.request;\n return agent;\n}\n\nfunction httpsOverHttps(options) {\n var agent = new TunnelingAgent(options);\n agent.request = https.request;\n agent.createSocket = createSecureSocket;\n agent.defaultPort = 443;\n return agent;\n}\n\n\nfunction TunnelingAgent(options) {\n var self = this;\n self.options = options || {};\n self.proxyOptions = self.options.proxy || {};\n self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;\n self.requests = [];\n self.sockets = [];\n\n self.on('free', function onFree(socket, host, port, localAddress) {\n var options = toOptions(host, port, localAddress);\n for (var i = 0, len = self.requests.length; i < len; ++i) {\n var pending = self.requests[i];\n if (pending.host === options.host && pending.port === options.port) {\n // Detect the request to connect same origin server,\n // reuse the connection.\n self.requests.splice(i, 1);\n pending.request.onSocket(socket);\n return;\n }\n }\n socket.destroy();\n self.removeSocket(socket);\n });\n}\nutil.inherits(TunnelingAgent, events.EventEmitter);\n\nTunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {\n var self = this;\n var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));\n\n if (self.sockets.length >= this.maxSockets) {\n // We are over limit so we'll add it to the queue.\n self.requests.push(options);\n return;\n }\n\n // If we are under maxSockets create a new one.\n self.createSocket(options, function(socket) {\n socket.on('free', onFree);\n socket.on('close', onCloseOrRemove);\n socket.on('agentRemove', onCloseOrRemove);\n req.onSocket(socket);\n\n function onFree() {\n self.emit('free', socket, options);\n }\n\n function onCloseOrRemove(err) {\n self.removeSocket(socket);\n socket.removeListener('free', onFree);\n socket.removeListener('close', onCloseOrRemove);\n socket.removeListener('agentRemove', onCloseOrRemove);\n }\n });\n};\n\nTunnelingAgent.prototype.createSocket = function createSocket(options, cb) {\n var self = this;\n var placeholder = {};\n self.sockets.push(placeholder);\n\n var connectOptions = mergeOptions({}, self.proxyOptions, {\n method: 'CONNECT',\n path: options.host + ':' + options.port,\n agent: false,\n headers: {\n host: options.host + ':' + options.port\n }\n });\n if (options.localAddress) {\n connectOptions.localAddress = options.localAddress;\n }\n if (connectOptions.proxyAuth) {\n connectOptions.headers = connectOptions.headers || {};\n connectOptions.headers['Proxy-Authorization'] = 'Basic ' +\n new Buffer(connectOptions.proxyAuth).toString('base64');\n }\n\n debug('making CONNECT request');\n var connectReq = self.request(connectOptions);\n connectReq.useChunkedEncodingByDefault = false; // for v0.6\n connectReq.once('response', onResponse); // for v0.6\n connectReq.once('upgrade', onUpgrade); // for v0.6\n connectReq.once('connect', onConnect); // for v0.7 or later\n connectReq.once('error', onError);\n connectReq.end();\n\n function onResponse(res) {\n // Very hacky. This is necessary to avoid http-parser leaks.\n res.upgrade = true;\n }\n\n function onUpgrade(res, socket, head) {\n // Hacky.\n process.nextTick(function() {\n onConnect(res, socket, head);\n });\n }\n\n function onConnect(res, socket, head) {\n connectReq.removeAllListeners();\n socket.removeAllListeners();\n\n if (res.statusCode !== 200) {\n debug('tunneling socket could not be established, statusCode=%d',\n res.statusCode);\n socket.destroy();\n var error = new Error('tunneling socket could not be established, ' +\n 'statusCode=' + res.statusCode);\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n return;\n }\n if (head.length > 0) {\n debug('got illegal response body from proxy');\n socket.destroy();\n var error = new Error('got illegal response body from proxy');\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n return;\n }\n debug('tunneling connection has established');\n self.sockets[self.sockets.indexOf(placeholder)] = socket;\n return cb(socket);\n }\n\n function onError(cause) {\n connectReq.removeAllListeners();\n\n debug('tunneling socket could not be established, cause=%s\\n',\n cause.message, cause.stack);\n var error = new Error('tunneling socket could not be established, ' +\n 'cause=' + cause.message);\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n }\n};\n\nTunnelingAgent.prototype.removeSocket = function removeSocket(socket) {\n var pos = this.sockets.indexOf(socket)\n if (pos === -1) {\n return;\n }\n this.sockets.splice(pos, 1);\n\n var pending = this.requests.shift();\n if (pending) {\n // If we have pending requests and a socket gets closed a new one\n // needs to be created to take over in the pool for the one that closed.\n this.createSocket(pending, function(socket) {\n pending.request.onSocket(socket);\n });\n }\n};\n\nfunction createSecureSocket(options, cb) {\n var self = this;\n TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {\n var hostHeader = options.request.getHeader('host');\n var tlsOptions = mergeOptions({}, self.options, {\n socket: socket,\n servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host\n });\n\n // 0 is dummy port for v0.6\n var secureSocket = tls.connect(0, tlsOptions);\n self.sockets[self.sockets.indexOf(socket)] = secureSocket;\n cb(secureSocket);\n });\n}\n\n\nfunction toOptions(host, port, localAddress) {\n if (typeof host === 'string') { // since v0.10\n return {\n host: host,\n port: port,\n localAddress: localAddress\n };\n }\n return host; // for v0.11 or later\n}\n\nfunction mergeOptions(target) {\n for (var i = 1, len = arguments.length; i < len; ++i) {\n var overrides = arguments[i];\n if (typeof overrides === 'object') {\n var keys = Object.keys(overrides);\n for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {\n var k = keys[j];\n if (overrides[k] !== undefined) {\n target[k] = overrides[k];\n }\n }\n }\n }\n return target;\n}\n\n\nvar debug;\nif (process.env.NODE_DEBUG && /\\btunnel\\b/.test(process.env.NODE_DEBUG)) {\n debug = function() {\n var args = Array.prototype.slice.call(arguments);\n if (typeof args[0] === 'string') {\n args[0] = 'TUNNEL: ' + args[0];\n } else {\n args.unshift('TUNNEL:');\n }\n console.error.apply(console, args);\n }\n} else {\n debug = function() {};\n}\nexports.debug = debug; // for test\n","\"use strict\";\n\nvar conversions = {};\nmodule.exports = conversions;\n\nfunction sign(x) {\n return x < 0 ? -1 : 1;\n}\n\nfunction evenRound(x) {\n // Round x to the nearest integer, choosing the even integer if it lies halfway between two.\n if ((x % 1) === 0.5 && (x & 1) === 0) { // [even number].5; round down (i.e. floor)\n return Math.floor(x);\n } else {\n return Math.round(x);\n }\n}\n\nfunction createNumberConversion(bitLength, typeOpts) {\n if (!typeOpts.unsigned) {\n --bitLength;\n }\n const lowerBound = typeOpts.unsigned ? 0 : -Math.pow(2, bitLength);\n const upperBound = Math.pow(2, bitLength) - 1;\n\n const moduloVal = typeOpts.moduloBitLength ? Math.pow(2, typeOpts.moduloBitLength) : Math.pow(2, bitLength);\n const moduloBound = typeOpts.moduloBitLength ? Math.pow(2, typeOpts.moduloBitLength - 1) : Math.pow(2, bitLength - 1);\n\n return function(V, opts) {\n if (!opts) opts = {};\n\n let x = +V;\n\n if (opts.enforceRange) {\n if (!Number.isFinite(x)) {\n throw new TypeError(\"Argument is not a finite number\");\n }\n\n x = sign(x) * Math.floor(Math.abs(x));\n if (x < lowerBound || x > upperBound) {\n throw new TypeError(\"Argument is not in byte range\");\n }\n\n return x;\n }\n\n if (!isNaN(x) && opts.clamp) {\n x = evenRound(x);\n\n if (x < lowerBound) x = lowerBound;\n if (x > upperBound) x = upperBound;\n return x;\n }\n\n if (!Number.isFinite(x) || x === 0) {\n return 0;\n }\n\n x = sign(x) * Math.floor(Math.abs(x));\n x = x % moduloVal;\n\n if (!typeOpts.unsigned && x >= moduloBound) {\n return x - moduloVal;\n } else if (typeOpts.unsigned) {\n if (x < 0) {\n x += moduloVal;\n } else if (x === -0) { // don't return negative zero\n return 0;\n }\n }\n\n return x;\n }\n}\n\nconversions[\"void\"] = function () {\n return undefined;\n};\n\nconversions[\"boolean\"] = function (val) {\n return !!val;\n};\n\nconversions[\"byte\"] = createNumberConversion(8, { unsigned: false });\nconversions[\"octet\"] = createNumberConversion(8, { unsigned: true });\n\nconversions[\"short\"] = createNumberConversion(16, { unsigned: false });\nconversions[\"unsigned short\"] = createNumberConversion(16, { unsigned: true });\n\nconversions[\"long\"] = createNumberConversion(32, { unsigned: false });\nconversions[\"unsigned long\"] = createNumberConversion(32, { unsigned: true });\n\nconversions[\"long long\"] = createNumberConversion(32, { unsigned: false, moduloBitLength: 64 });\nconversions[\"unsigned long long\"] = createNumberConversion(32, { unsigned: true, moduloBitLength: 64 });\n\nconversions[\"double\"] = function (V) {\n const x = +V;\n\n if (!Number.isFinite(x)) {\n throw new TypeError(\"Argument is not a finite floating-point value\");\n }\n\n return x;\n};\n\nconversions[\"unrestricted double\"] = function (V) {\n const x = +V;\n\n if (isNaN(x)) {\n throw new TypeError(\"Argument is NaN\");\n }\n\n return x;\n};\n\n// not quite valid, but good enough for JS\nconversions[\"float\"] = conversions[\"double\"];\nconversions[\"unrestricted float\"] = conversions[\"unrestricted double\"];\n\nconversions[\"DOMString\"] = function (V, opts) {\n if (!opts) opts = {};\n\n if (opts.treatNullAsEmptyString && V === null) {\n return \"\";\n }\n\n return String(V);\n};\n\nconversions[\"ByteString\"] = function (V, opts) {\n const x = String(V);\n let c = undefined;\n for (let i = 0; (c = x.codePointAt(i)) !== undefined; ++i) {\n if (c > 255) {\n throw new TypeError(\"Argument is not a valid bytestring\");\n }\n }\n\n return x;\n};\n\nconversions[\"USVString\"] = function (V) {\n const S = String(V);\n const n = S.length;\n const U = [];\n for (let i = 0; i < n; ++i) {\n const c = S.charCodeAt(i);\n if (c < 0xD800 || c > 0xDFFF) {\n U.push(String.fromCodePoint(c));\n } else if (0xDC00 <= c && c <= 0xDFFF) {\n U.push(String.fromCodePoint(0xFFFD));\n } else {\n if (i === n - 1) {\n U.push(String.fromCodePoint(0xFFFD));\n } else {\n const d = S.charCodeAt(i + 1);\n if (0xDC00 <= d && d <= 0xDFFF) {\n const a = c & 0x3FF;\n const b = d & 0x3FF;\n U.push(String.fromCodePoint((2 << 15) + (2 << 9) * a + b));\n ++i;\n } else {\n U.push(String.fromCodePoint(0xFFFD));\n }\n }\n }\n }\n\n return U.join('');\n};\n\nconversions[\"Date\"] = function (V, opts) {\n if (!(V instanceof Date)) {\n throw new TypeError(\"Argument is not a Date object\");\n }\n if (isNaN(V)) {\n return undefined;\n }\n\n return V;\n};\n\nconversions[\"RegExp\"] = function (V, opts) {\n if (!(V instanceof RegExp)) {\n V = new RegExp(V);\n }\n\n return V;\n};\n","\"use strict\";\nconst usm = require(\"./url-state-machine\");\n\nexports.implementation = class URLImpl {\n constructor(constructorArgs) {\n const url = constructorArgs[0];\n const base = constructorArgs[1];\n\n let parsedBase = null;\n if (base !== undefined) {\n parsedBase = usm.basicURLParse(base);\n if (parsedBase === \"failure\") {\n throw new TypeError(\"Invalid base URL\");\n }\n }\n\n const parsedURL = usm.basicURLParse(url, { baseURL: parsedBase });\n if (parsedURL === \"failure\") {\n throw new TypeError(\"Invalid URL\");\n }\n\n this._url = parsedURL;\n\n // TODO: query stuff\n }\n\n get href() {\n return usm.serializeURL(this._url);\n }\n\n set href(v) {\n const parsedURL = usm.basicURLParse(v);\n if (parsedURL === \"failure\") {\n throw new TypeError(\"Invalid URL\");\n }\n\n this._url = parsedURL;\n }\n\n get origin() {\n return usm.serializeURLOrigin(this._url);\n }\n\n get protocol() {\n return this._url.scheme + \":\";\n }\n\n set protocol(v) {\n usm.basicURLParse(v + \":\", { url: this._url, stateOverride: \"scheme start\" });\n }\n\n get username() {\n return this._url.username;\n }\n\n set username(v) {\n if (usm.cannotHaveAUsernamePasswordPort(this._url)) {\n return;\n }\n\n usm.setTheUsername(this._url, v);\n }\n\n get password() {\n return this._url.password;\n }\n\n set password(v) {\n if (usm.cannotHaveAUsernamePasswordPort(this._url)) {\n return;\n }\n\n usm.setThePassword(this._url, v);\n }\n\n get host() {\n const url = this._url;\n\n if (url.host === null) {\n return \"\";\n }\n\n if (url.port === null) {\n return usm.serializeHost(url.host);\n }\n\n return usm.serializeHost(url.host) + \":\" + usm.serializeInteger(url.port);\n }\n\n set host(v) {\n if (this._url.cannotBeABaseURL) {\n return;\n }\n\n usm.basicURLParse(v, { url: this._url, stateOverride: \"host\" });\n }\n\n get hostname() {\n if (this._url.host === null) {\n return \"\";\n }\n\n return usm.serializeHost(this._url.host);\n }\n\n set hostname(v) {\n if (this._url.cannotBeABaseURL) {\n return;\n }\n\n usm.basicURLParse(v, { url: this._url, stateOverride: \"hostname\" });\n }\n\n get port() {\n if (this._url.port === null) {\n return \"\";\n }\n\n return usm.serializeInteger(this._url.port);\n }\n\n set port(v) {\n if (usm.cannotHaveAUsernamePasswordPort(this._url)) {\n return;\n }\n\n if (v === \"\") {\n this._url.port = null;\n } else {\n usm.basicURLParse(v, { url: this._url, stateOverride: \"port\" });\n }\n }\n\n get pathname() {\n if (this._url.cannotBeABaseURL) {\n return this._url.path[0];\n }\n\n if (this._url.path.length === 0) {\n return \"\";\n }\n\n return \"/\" + this._url.path.join(\"/\");\n }\n\n set pathname(v) {\n if (this._url.cannotBeABaseURL) {\n return;\n }\n\n this._url.path = [];\n usm.basicURLParse(v, { url: this._url, stateOverride: \"path start\" });\n }\n\n get search() {\n if (this._url.query === null || this._url.query === \"\") {\n return \"\";\n }\n\n return \"?\" + this._url.query;\n }\n\n set search(v) {\n // TODO: query stuff\n\n const url = this._url;\n\n if (v === \"\") {\n url.query = null;\n return;\n }\n\n const input = v[0] === \"?\" ? v.substring(1) : v;\n url.query = \"\";\n usm.basicURLParse(input, { url, stateOverride: \"query\" });\n }\n\n get hash() {\n if (this._url.fragment === null || this._url.fragment === \"\") {\n return \"\";\n }\n\n return \"#\" + this._url.fragment;\n }\n\n set hash(v) {\n if (v === \"\") {\n this._url.fragment = null;\n return;\n }\n\n const input = v[0] === \"#\" ? v.substring(1) : v;\n this._url.fragment = \"\";\n usm.basicURLParse(input, { url: this._url, stateOverride: \"fragment\" });\n }\n\n toJSON() {\n return this.href;\n }\n};\n","\"use strict\";\n\nconst conversions = require(\"webidl-conversions\");\nconst utils = require(\"./utils.js\");\nconst Impl = require(\".//URL-impl.js\");\n\nconst impl = utils.implSymbol;\n\nfunction URL(url) {\n if (!this || this[impl] || !(this instanceof URL)) {\n throw new TypeError(\"Failed to construct 'URL': Please use the 'new' operator, this DOM object constructor cannot be called as a function.\");\n }\n if (arguments.length < 1) {\n throw new TypeError(\"Failed to construct 'URL': 1 argument required, but only \" + arguments.length + \" present.\");\n }\n const args = [];\n for (let i = 0; i < arguments.length && i < 2; ++i) {\n args[i] = arguments[i];\n }\n args[0] = conversions[\"USVString\"](args[0]);\n if (args[1] !== undefined) {\n args[1] = conversions[\"USVString\"](args[1]);\n }\n\n module.exports.setup(this, args);\n}\n\nURL.prototype.toJSON = function toJSON() {\n if (!this || !module.exports.is(this)) {\n throw new TypeError(\"Illegal invocation\");\n }\n const args = [];\n for (let i = 0; i < arguments.length && i < 0; ++i) {\n args[i] = arguments[i];\n }\n return this[impl].toJSON.apply(this[impl], args);\n};\nObject.defineProperty(URL.prototype, \"href\", {\n get() {\n return this[impl].href;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].href = V;\n },\n enumerable: true,\n configurable: true\n});\n\nURL.prototype.toString = function () {\n if (!this || !module.exports.is(this)) {\n throw new TypeError(\"Illegal invocation\");\n }\n return this.href;\n};\n\nObject.defineProperty(URL.prototype, \"origin\", {\n get() {\n return this[impl].origin;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"protocol\", {\n get() {\n return this[impl].protocol;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].protocol = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"username\", {\n get() {\n return this[impl].username;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].username = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"password\", {\n get() {\n return this[impl].password;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].password = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"host\", {\n get() {\n return this[impl].host;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].host = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"hostname\", {\n get() {\n return this[impl].hostname;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].hostname = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"port\", {\n get() {\n return this[impl].port;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].port = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"pathname\", {\n get() {\n return this[impl].pathname;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].pathname = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"search\", {\n get() {\n return this[impl].search;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].search = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"hash\", {\n get() {\n return this[impl].hash;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].hash = V;\n },\n enumerable: true,\n configurable: true\n});\n\n\nmodule.exports = {\n is(obj) {\n return !!obj && obj[impl] instanceof Impl.implementation;\n },\n create(constructorArgs, privateData) {\n let obj = Object.create(URL.prototype);\n this.setup(obj, constructorArgs, privateData);\n return obj;\n },\n setup(obj, constructorArgs, privateData) {\n if (!privateData) privateData = {};\n privateData.wrapper = obj;\n\n obj[impl] = new Impl.implementation(constructorArgs, privateData);\n obj[impl][utils.wrapperSymbol] = obj;\n },\n interface: URL,\n expose: {\n Window: { URL: URL },\n Worker: { URL: URL }\n }\n};\n\n","\"use strict\";\n\nexports.URL = require(\"./URL\").interface;\nexports.serializeURL = require(\"./url-state-machine\").serializeURL;\nexports.serializeURLOrigin = require(\"./url-state-machine\").serializeURLOrigin;\nexports.basicURLParse = require(\"./url-state-machine\").basicURLParse;\nexports.setTheUsername = require(\"./url-state-machine\").setTheUsername;\nexports.setThePassword = require(\"./url-state-machine\").setThePassword;\nexports.serializeHost = require(\"./url-state-machine\").serializeHost;\nexports.serializeInteger = require(\"./url-state-machine\").serializeInteger;\nexports.parseURL = require(\"./url-state-machine\").parseURL;\n","\"use strict\";\r\nconst punycode = require(\"punycode\");\r\nconst tr46 = require(\"tr46\");\r\n\r\nconst specialSchemes = {\r\n ftp: 21,\r\n file: null,\r\n gopher: 70,\r\n http: 80,\r\n https: 443,\r\n ws: 80,\r\n wss: 443\r\n};\r\n\r\nconst failure = Symbol(\"failure\");\r\n\r\nfunction countSymbols(str) {\r\n return punycode.ucs2.decode(str).length;\r\n}\r\n\r\nfunction at(input, idx) {\r\n const c = input[idx];\r\n return isNaN(c) ? undefined : String.fromCodePoint(c);\r\n}\r\n\r\nfunction isASCIIDigit(c) {\r\n return c >= 0x30 && c <= 0x39;\r\n}\r\n\r\nfunction isASCIIAlpha(c) {\r\n return (c >= 0x41 && c <= 0x5A) || (c >= 0x61 && c <= 0x7A);\r\n}\r\n\r\nfunction isASCIIAlphanumeric(c) {\r\n return isASCIIAlpha(c) || isASCIIDigit(c);\r\n}\r\n\r\nfunction isASCIIHex(c) {\r\n return isASCIIDigit(c) || (c >= 0x41 && c <= 0x46) || (c >= 0x61 && c <= 0x66);\r\n}\r\n\r\nfunction isSingleDot(buffer) {\r\n return buffer === \".\" || buffer.toLowerCase() === \"%2e\";\r\n}\r\n\r\nfunction isDoubleDot(buffer) {\r\n buffer = buffer.toLowerCase();\r\n return buffer === \"..\" || buffer === \"%2e.\" || buffer === \".%2e\" || buffer === \"%2e%2e\";\r\n}\r\n\r\nfunction isWindowsDriveLetterCodePoints(cp1, cp2) {\r\n return isASCIIAlpha(cp1) && (cp2 === 58 || cp2 === 124);\r\n}\r\n\r\nfunction isWindowsDriveLetterString(string) {\r\n return string.length === 2 && isASCIIAlpha(string.codePointAt(0)) && (string[1] === \":\" || string[1] === \"|\");\r\n}\r\n\r\nfunction isNormalizedWindowsDriveLetterString(string) {\r\n return string.length === 2 && isASCIIAlpha(string.codePointAt(0)) && string[1] === \":\";\r\n}\r\n\r\nfunction containsForbiddenHostCodePoint(string) {\r\n return string.search(/\\u0000|\\u0009|\\u000A|\\u000D|\\u0020|#|%|\\/|:|\\?|@|\\[|\\\\|\\]/) !== -1;\r\n}\r\n\r\nfunction containsForbiddenHostCodePointExcludingPercent(string) {\r\n return string.search(/\\u0000|\\u0009|\\u000A|\\u000D|\\u0020|#|\\/|:|\\?|@|\\[|\\\\|\\]/) !== -1;\r\n}\r\n\r\nfunction isSpecialScheme(scheme) {\r\n return specialSchemes[scheme] !== undefined;\r\n}\r\n\r\nfunction isSpecial(url) {\r\n return isSpecialScheme(url.scheme);\r\n}\r\n\r\nfunction defaultPort(scheme) {\r\n return specialSchemes[scheme];\r\n}\r\n\r\nfunction percentEncode(c) {\r\n let hex = c.toString(16).toUpperCase();\r\n if (hex.length === 1) {\r\n hex = \"0\" + hex;\r\n }\r\n\r\n return \"%\" + hex;\r\n}\r\n\r\nfunction utf8PercentEncode(c) {\r\n const buf = new Buffer(c);\r\n\r\n let str = \"\";\r\n\r\n for (let i = 0; i < buf.length; ++i) {\r\n str += percentEncode(buf[i]);\r\n }\r\n\r\n return str;\r\n}\r\n\r\nfunction utf8PercentDecode(str) {\r\n const input = new Buffer(str);\r\n const output = [];\r\n for (let i = 0; i < input.length; ++i) {\r\n if (input[i] !== 37) {\r\n output.push(input[i]);\r\n } else if (input[i] === 37 && isASCIIHex(input[i + 1]) && isASCIIHex(input[i + 2])) {\r\n output.push(parseInt(input.slice(i + 1, i + 3).toString(), 16));\r\n i += 2;\r\n } else {\r\n output.push(input[i]);\r\n }\r\n }\r\n return new Buffer(output).toString();\r\n}\r\n\r\nfunction isC0ControlPercentEncode(c) {\r\n return c <= 0x1F || c > 0x7E;\r\n}\r\n\r\nconst extraPathPercentEncodeSet = new Set([32, 34, 35, 60, 62, 63, 96, 123, 125]);\r\nfunction isPathPercentEncode(c) {\r\n return isC0ControlPercentEncode(c) || extraPathPercentEncodeSet.has(c);\r\n}\r\n\r\nconst extraUserinfoPercentEncodeSet =\r\n new Set([47, 58, 59, 61, 64, 91, 92, 93, 94, 124]);\r\nfunction isUserinfoPercentEncode(c) {\r\n return isPathPercentEncode(c) || extraUserinfoPercentEncodeSet.has(c);\r\n}\r\n\r\nfunction percentEncodeChar(c, encodeSetPredicate) {\r\n const cStr = String.fromCodePoint(c);\r\n\r\n if (encodeSetPredicate(c)) {\r\n return utf8PercentEncode(cStr);\r\n }\r\n\r\n return cStr;\r\n}\r\n\r\nfunction parseIPv4Number(input) {\r\n let R = 10;\r\n\r\n if (input.length >= 2 && input.charAt(0) === \"0\" && input.charAt(1).toLowerCase() === \"x\") {\r\n input = input.substring(2);\r\n R = 16;\r\n } else if (input.length >= 2 && input.charAt(0) === \"0\") {\r\n input = input.substring(1);\r\n R = 8;\r\n }\r\n\r\n if (input === \"\") {\r\n return 0;\r\n }\r\n\r\n const regex = R === 10 ? /[^0-9]/ : (R === 16 ? /[^0-9A-Fa-f]/ : /[^0-7]/);\r\n if (regex.test(input)) {\r\n return failure;\r\n }\r\n\r\n return parseInt(input, R);\r\n}\r\n\r\nfunction parseIPv4(input) {\r\n const parts = input.split(\".\");\r\n if (parts[parts.length - 1] === \"\") {\r\n if (parts.length > 1) {\r\n parts.pop();\r\n }\r\n }\r\n\r\n if (parts.length > 4) {\r\n return input;\r\n }\r\n\r\n const numbers = [];\r\n for (const part of parts) {\r\n if (part === \"\") {\r\n return input;\r\n }\r\n const n = parseIPv4Number(part);\r\n if (n === failure) {\r\n return input;\r\n }\r\n\r\n numbers.push(n);\r\n }\r\n\r\n for (let i = 0; i < numbers.length - 1; ++i) {\r\n if (numbers[i] > 255) {\r\n return failure;\r\n }\r\n }\r\n if (numbers[numbers.length - 1] >= Math.pow(256, 5 - numbers.length)) {\r\n return failure;\r\n }\r\n\r\n let ipv4 = numbers.pop();\r\n let counter = 0;\r\n\r\n for (const n of numbers) {\r\n ipv4 += n * Math.pow(256, 3 - counter);\r\n ++counter;\r\n }\r\n\r\n return ipv4;\r\n}\r\n\r\nfunction serializeIPv4(address) {\r\n let output = \"\";\r\n let n = address;\r\n\r\n for (let i = 1; i <= 4; ++i) {\r\n output = String(n % 256) + output;\r\n if (i !== 4) {\r\n output = \".\" + output;\r\n }\r\n n = Math.floor(n / 256);\r\n }\r\n\r\n return output;\r\n}\r\n\r\nfunction parseIPv6(input) {\r\n const address = [0, 0, 0, 0, 0, 0, 0, 0];\r\n let pieceIndex = 0;\r\n let compress = null;\r\n let pointer = 0;\r\n\r\n input = punycode.ucs2.decode(input);\r\n\r\n if (input[pointer] === 58) {\r\n if (input[pointer + 1] !== 58) {\r\n return failure;\r\n }\r\n\r\n pointer += 2;\r\n ++pieceIndex;\r\n compress = pieceIndex;\r\n }\r\n\r\n while (pointer < input.length) {\r\n if (pieceIndex === 8) {\r\n return failure;\r\n }\r\n\r\n if (input[pointer] === 58) {\r\n if (compress !== null) {\r\n return failure;\r\n }\r\n ++pointer;\r\n ++pieceIndex;\r\n compress = pieceIndex;\r\n continue;\r\n }\r\n\r\n let value = 0;\r\n let length = 0;\r\n\r\n while (length < 4 && isASCIIHex(input[pointer])) {\r\n value = value * 0x10 + parseInt(at(input, pointer), 16);\r\n ++pointer;\r\n ++length;\r\n }\r\n\r\n if (input[pointer] === 46) {\r\n if (length === 0) {\r\n return failure;\r\n }\r\n\r\n pointer -= length;\r\n\r\n if (pieceIndex > 6) {\r\n return failure;\r\n }\r\n\r\n let numbersSeen = 0;\r\n\r\n while (input[pointer] !== undefined) {\r\n let ipv4Piece = null;\r\n\r\n if (numbersSeen > 0) {\r\n if (input[pointer] === 46 && numbersSeen < 4) {\r\n ++pointer;\r\n } else {\r\n return failure;\r\n }\r\n }\r\n\r\n if (!isASCIIDigit(input[pointer])) {\r\n return failure;\r\n }\r\n\r\n while (isASCIIDigit(input[pointer])) {\r\n const number = parseInt(at(input, pointer));\r\n if (ipv4Piece === null) {\r\n ipv4Piece = number;\r\n } else if (ipv4Piece === 0) {\r\n return failure;\r\n } else {\r\n ipv4Piece = ipv4Piece * 10 + number;\r\n }\r\n if (ipv4Piece > 255) {\r\n return failure;\r\n }\r\n ++pointer;\r\n }\r\n\r\n address[pieceIndex] = address[pieceIndex] * 0x100 + ipv4Piece;\r\n\r\n ++numbersSeen;\r\n\r\n if (numbersSeen === 2 || numbersSeen === 4) {\r\n ++pieceIndex;\r\n }\r\n }\r\n\r\n if (numbersSeen !== 4) {\r\n return failure;\r\n }\r\n\r\n break;\r\n } else if (input[pointer] === 58) {\r\n ++pointer;\r\n if (input[pointer] === undefined) {\r\n return failure;\r\n }\r\n } else if (input[pointer] !== undefined) {\r\n return failure;\r\n }\r\n\r\n address[pieceIndex] = value;\r\n ++pieceIndex;\r\n }\r\n\r\n if (compress !== null) {\r\n let swaps = pieceIndex - compress;\r\n pieceIndex = 7;\r\n while (pieceIndex !== 0 && swaps > 0) {\r\n const temp = address[compress + swaps - 1];\r\n address[compress + swaps - 1] = address[pieceIndex];\r\n address[pieceIndex] = temp;\r\n --pieceIndex;\r\n --swaps;\r\n }\r\n } else if (compress === null && pieceIndex !== 8) {\r\n return failure;\r\n }\r\n\r\n return address;\r\n}\r\n\r\nfunction serializeIPv6(address) {\r\n let output = \"\";\r\n const seqResult = findLongestZeroSequence(address);\r\n const compress = seqResult.idx;\r\n let ignore0 = false;\r\n\r\n for (let pieceIndex = 0; pieceIndex <= 7; ++pieceIndex) {\r\n if (ignore0 && address[pieceIndex] === 0) {\r\n continue;\r\n } else if (ignore0) {\r\n ignore0 = false;\r\n }\r\n\r\n if (compress === pieceIndex) {\r\n const separator = pieceIndex === 0 ? \"::\" : \":\";\r\n output += separator;\r\n ignore0 = true;\r\n continue;\r\n }\r\n\r\n output += address[pieceIndex].toString(16);\r\n\r\n if (pieceIndex !== 7) {\r\n output += \":\";\r\n }\r\n }\r\n\r\n return output;\r\n}\r\n\r\nfunction parseHost(input, isSpecialArg) {\r\n if (input[0] === \"[\") {\r\n if (input[input.length - 1] !== \"]\") {\r\n return failure;\r\n }\r\n\r\n return parseIPv6(input.substring(1, input.length - 1));\r\n }\r\n\r\n if (!isSpecialArg) {\r\n return parseOpaqueHost(input);\r\n }\r\n\r\n const domain = utf8PercentDecode(input);\r\n const asciiDomain = tr46.toASCII(domain, false, tr46.PROCESSING_OPTIONS.NONTRANSITIONAL, false);\r\n if (asciiDomain === null) {\r\n return failure;\r\n }\r\n\r\n if (containsForbiddenHostCodePoint(asciiDomain)) {\r\n return failure;\r\n }\r\n\r\n const ipv4Host = parseIPv4(asciiDomain);\r\n if (typeof ipv4Host === \"number\" || ipv4Host === failure) {\r\n return ipv4Host;\r\n }\r\n\r\n return asciiDomain;\r\n}\r\n\r\nfunction parseOpaqueHost(input) {\r\n if (containsForbiddenHostCodePointExcludingPercent(input)) {\r\n return failure;\r\n }\r\n\r\n let output = \"\";\r\n const decoded = punycode.ucs2.decode(input);\r\n for (let i = 0; i < decoded.length; ++i) {\r\n output += percentEncodeChar(decoded[i], isC0ControlPercentEncode);\r\n }\r\n return output;\r\n}\r\n\r\nfunction findLongestZeroSequence(arr) {\r\n let maxIdx = null;\r\n let maxLen = 1; // only find elements > 1\r\n let currStart = null;\r\n let currLen = 0;\r\n\r\n for (let i = 0; i < arr.length; ++i) {\r\n if (arr[i] !== 0) {\r\n if (currLen > maxLen) {\r\n maxIdx = currStart;\r\n maxLen = currLen;\r\n }\r\n\r\n currStart = null;\r\n currLen = 0;\r\n } else {\r\n if (currStart === null) {\r\n currStart = i;\r\n }\r\n ++currLen;\r\n }\r\n }\r\n\r\n // if trailing zeros\r\n if (currLen > maxLen) {\r\n maxIdx = currStart;\r\n maxLen = currLen;\r\n }\r\n\r\n return {\r\n idx: maxIdx,\r\n len: maxLen\r\n };\r\n}\r\n\r\nfunction serializeHost(host) {\r\n if (typeof host === \"number\") {\r\n return serializeIPv4(host);\r\n }\r\n\r\n // IPv6 serializer\r\n if (host instanceof Array) {\r\n return \"[\" + serializeIPv6(host) + \"]\";\r\n }\r\n\r\n return host;\r\n}\r\n\r\nfunction trimControlChars(url) {\r\n return url.replace(/^[\\u0000-\\u001F\\u0020]+|[\\u0000-\\u001F\\u0020]+$/g, \"\");\r\n}\r\n\r\nfunction trimTabAndNewline(url) {\r\n return url.replace(/\\u0009|\\u000A|\\u000D/g, \"\");\r\n}\r\n\r\nfunction shortenPath(url) {\r\n const path = url.path;\r\n if (path.length === 0) {\r\n return;\r\n }\r\n if (url.scheme === \"file\" && path.length === 1 && isNormalizedWindowsDriveLetter(path[0])) {\r\n return;\r\n }\r\n\r\n path.pop();\r\n}\r\n\r\nfunction includesCredentials(url) {\r\n return url.username !== \"\" || url.password !== \"\";\r\n}\r\n\r\nfunction cannotHaveAUsernamePasswordPort(url) {\r\n return url.host === null || url.host === \"\" || url.cannotBeABaseURL || url.scheme === \"file\";\r\n}\r\n\r\nfunction isNormalizedWindowsDriveLetter(string) {\r\n return /^[A-Za-z]:$/.test(string);\r\n}\r\n\r\nfunction URLStateMachine(input, base, encodingOverride, url, stateOverride) {\r\n this.pointer = 0;\r\n this.input = input;\r\n this.base = base || null;\r\n this.encodingOverride = encodingOverride || \"utf-8\";\r\n this.stateOverride = stateOverride;\r\n this.url = url;\r\n this.failure = false;\r\n this.parseError = false;\r\n\r\n if (!this.url) {\r\n this.url = {\r\n scheme: \"\",\r\n username: \"\",\r\n password: \"\",\r\n host: null,\r\n port: null,\r\n path: [],\r\n query: null,\r\n fragment: null,\r\n\r\n cannotBeABaseURL: false\r\n };\r\n\r\n const res = trimControlChars(this.input);\r\n if (res !== this.input) {\r\n this.parseError = true;\r\n }\r\n this.input = res;\r\n }\r\n\r\n const res = trimTabAndNewline(this.input);\r\n if (res !== this.input) {\r\n this.parseError = true;\r\n }\r\n this.input = res;\r\n\r\n this.state = stateOverride || \"scheme start\";\r\n\r\n this.buffer = \"\";\r\n this.atFlag = false;\r\n this.arrFlag = false;\r\n this.passwordTokenSeenFlag = false;\r\n\r\n this.input = punycode.ucs2.decode(this.input);\r\n\r\n for (; this.pointer <= this.input.length; ++this.pointer) {\r\n const c = this.input[this.pointer];\r\n const cStr = isNaN(c) ? undefined : String.fromCodePoint(c);\r\n\r\n // exec state machine\r\n const ret = this[\"parse \" + this.state](c, cStr);\r\n if (!ret) {\r\n break; // terminate algorithm\r\n } else if (ret === failure) {\r\n this.failure = true;\r\n break;\r\n }\r\n }\r\n}\r\n\r\nURLStateMachine.prototype[\"parse scheme start\"] = function parseSchemeStart(c, cStr) {\r\n if (isASCIIAlpha(c)) {\r\n this.buffer += cStr.toLowerCase();\r\n this.state = \"scheme\";\r\n } else if (!this.stateOverride) {\r\n this.state = \"no scheme\";\r\n --this.pointer;\r\n } else {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse scheme\"] = function parseScheme(c, cStr) {\r\n if (isASCIIAlphanumeric(c) || c === 43 || c === 45 || c === 46) {\r\n this.buffer += cStr.toLowerCase();\r\n } else if (c === 58) {\r\n if (this.stateOverride) {\r\n if (isSpecial(this.url) && !isSpecialScheme(this.buffer)) {\r\n return false;\r\n }\r\n\r\n if (!isSpecial(this.url) && isSpecialScheme(this.buffer)) {\r\n return false;\r\n }\r\n\r\n if ((includesCredentials(this.url) || this.url.port !== null) && this.buffer === \"file\") {\r\n return false;\r\n }\r\n\r\n if (this.url.scheme === \"file\" && (this.url.host === \"\" || this.url.host === null)) {\r\n return false;\r\n }\r\n }\r\n this.url.scheme = this.buffer;\r\n this.buffer = \"\";\r\n if (this.stateOverride) {\r\n return false;\r\n }\r\n if (this.url.scheme === \"file\") {\r\n if (this.input[this.pointer + 1] !== 47 || this.input[this.pointer + 2] !== 47) {\r\n this.parseError = true;\r\n }\r\n this.state = \"file\";\r\n } else if (isSpecial(this.url) && this.base !== null && this.base.scheme === this.url.scheme) {\r\n this.state = \"special relative or authority\";\r\n } else if (isSpecial(this.url)) {\r\n this.state = \"special authority slashes\";\r\n } else if (this.input[this.pointer + 1] === 47) {\r\n this.state = \"path or authority\";\r\n ++this.pointer;\r\n } else {\r\n this.url.cannotBeABaseURL = true;\r\n this.url.path.push(\"\");\r\n this.state = \"cannot-be-a-base-URL path\";\r\n }\r\n } else if (!this.stateOverride) {\r\n this.buffer = \"\";\r\n this.state = \"no scheme\";\r\n this.pointer = -1;\r\n } else {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse no scheme\"] = function parseNoScheme(c) {\r\n if (this.base === null || (this.base.cannotBeABaseURL && c !== 35)) {\r\n return failure;\r\n } else if (this.base.cannotBeABaseURL && c === 35) {\r\n this.url.scheme = this.base.scheme;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = this.base.query;\r\n this.url.fragment = \"\";\r\n this.url.cannotBeABaseURL = true;\r\n this.state = \"fragment\";\r\n } else if (this.base.scheme === \"file\") {\r\n this.state = \"file\";\r\n --this.pointer;\r\n } else {\r\n this.state = \"relative\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse special relative or authority\"] = function parseSpecialRelativeOrAuthority(c) {\r\n if (c === 47 && this.input[this.pointer + 1] === 47) {\r\n this.state = \"special authority ignore slashes\";\r\n ++this.pointer;\r\n } else {\r\n this.parseError = true;\r\n this.state = \"relative\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse path or authority\"] = function parsePathOrAuthority(c) {\r\n if (c === 47) {\r\n this.state = \"authority\";\r\n } else {\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse relative\"] = function parseRelative(c) {\r\n this.url.scheme = this.base.scheme;\r\n if (isNaN(c)) {\r\n this.url.username = this.base.username;\r\n this.url.password = this.base.password;\r\n this.url.host = this.base.host;\r\n this.url.port = this.base.port;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = this.base.query;\r\n } else if (c === 47) {\r\n this.state = \"relative slash\";\r\n } else if (c === 63) {\r\n this.url.username = this.base.username;\r\n this.url.password = this.base.password;\r\n this.url.host = this.base.host;\r\n this.url.port = this.base.port;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = \"\";\r\n this.state = \"query\";\r\n } else if (c === 35) {\r\n this.url.username = this.base.username;\r\n this.url.password = this.base.password;\r\n this.url.host = this.base.host;\r\n this.url.port = this.base.port;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = this.base.query;\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n } else if (isSpecial(this.url) && c === 92) {\r\n this.parseError = true;\r\n this.state = \"relative slash\";\r\n } else {\r\n this.url.username = this.base.username;\r\n this.url.password = this.base.password;\r\n this.url.host = this.base.host;\r\n this.url.port = this.base.port;\r\n this.url.path = this.base.path.slice(0, this.base.path.length - 1);\r\n\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse relative slash\"] = function parseRelativeSlash(c) {\r\n if (isSpecial(this.url) && (c === 47 || c === 92)) {\r\n if (c === 92) {\r\n this.parseError = true;\r\n }\r\n this.state = \"special authority ignore slashes\";\r\n } else if (c === 47) {\r\n this.state = \"authority\";\r\n } else {\r\n this.url.username = this.base.username;\r\n this.url.password = this.base.password;\r\n this.url.host = this.base.host;\r\n this.url.port = this.base.port;\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse special authority slashes\"] = function parseSpecialAuthoritySlashes(c) {\r\n if (c === 47 && this.input[this.pointer + 1] === 47) {\r\n this.state = \"special authority ignore slashes\";\r\n ++this.pointer;\r\n } else {\r\n this.parseError = true;\r\n this.state = \"special authority ignore slashes\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse special authority ignore slashes\"] = function parseSpecialAuthorityIgnoreSlashes(c) {\r\n if (c !== 47 && c !== 92) {\r\n this.state = \"authority\";\r\n --this.pointer;\r\n } else {\r\n this.parseError = true;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse authority\"] = function parseAuthority(c, cStr) {\r\n if (c === 64) {\r\n this.parseError = true;\r\n if (this.atFlag) {\r\n this.buffer = \"%40\" + this.buffer;\r\n }\r\n this.atFlag = true;\r\n\r\n // careful, this is based on buffer and has its own pointer (this.pointer != pointer) and inner chars\r\n const len = countSymbols(this.buffer);\r\n for (let pointer = 0; pointer < len; ++pointer) {\r\n const codePoint = this.buffer.codePointAt(pointer);\r\n\r\n if (codePoint === 58 && !this.passwordTokenSeenFlag) {\r\n this.passwordTokenSeenFlag = true;\r\n continue;\r\n }\r\n const encodedCodePoints = percentEncodeChar(codePoint, isUserinfoPercentEncode);\r\n if (this.passwordTokenSeenFlag) {\r\n this.url.password += encodedCodePoints;\r\n } else {\r\n this.url.username += encodedCodePoints;\r\n }\r\n }\r\n this.buffer = \"\";\r\n } else if (isNaN(c) || c === 47 || c === 63 || c === 35 ||\r\n (isSpecial(this.url) && c === 92)) {\r\n if (this.atFlag && this.buffer === \"\") {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n this.pointer -= countSymbols(this.buffer) + 1;\r\n this.buffer = \"\";\r\n this.state = \"host\";\r\n } else {\r\n this.buffer += cStr;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse hostname\"] =\r\nURLStateMachine.prototype[\"parse host\"] = function parseHostName(c, cStr) {\r\n if (this.stateOverride && this.url.scheme === \"file\") {\r\n --this.pointer;\r\n this.state = \"file host\";\r\n } else if (c === 58 && !this.arrFlag) {\r\n if (this.buffer === \"\") {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n\r\n const host = parseHost(this.buffer, isSpecial(this.url));\r\n if (host === failure) {\r\n return failure;\r\n }\r\n\r\n this.url.host = host;\r\n this.buffer = \"\";\r\n this.state = \"port\";\r\n if (this.stateOverride === \"hostname\") {\r\n return false;\r\n }\r\n } else if (isNaN(c) || c === 47 || c === 63 || c === 35 ||\r\n (isSpecial(this.url) && c === 92)) {\r\n --this.pointer;\r\n if (isSpecial(this.url) && this.buffer === \"\") {\r\n this.parseError = true;\r\n return failure;\r\n } else if (this.stateOverride && this.buffer === \"\" &&\r\n (includesCredentials(this.url) || this.url.port !== null)) {\r\n this.parseError = true;\r\n return false;\r\n }\r\n\r\n const host = parseHost(this.buffer, isSpecial(this.url));\r\n if (host === failure) {\r\n return failure;\r\n }\r\n\r\n this.url.host = host;\r\n this.buffer = \"\";\r\n this.state = \"path start\";\r\n if (this.stateOverride) {\r\n return false;\r\n }\r\n } else {\r\n if (c === 91) {\r\n this.arrFlag = true;\r\n } else if (c === 93) {\r\n this.arrFlag = false;\r\n }\r\n this.buffer += cStr;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse port\"] = function parsePort(c, cStr) {\r\n if (isASCIIDigit(c)) {\r\n this.buffer += cStr;\r\n } else if (isNaN(c) || c === 47 || c === 63 || c === 35 ||\r\n (isSpecial(this.url) && c === 92) ||\r\n this.stateOverride) {\r\n if (this.buffer !== \"\") {\r\n const port = parseInt(this.buffer);\r\n if (port > Math.pow(2, 16) - 1) {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n this.url.port = port === defaultPort(this.url.scheme) ? null : port;\r\n this.buffer = \"\";\r\n }\r\n if (this.stateOverride) {\r\n return false;\r\n }\r\n this.state = \"path start\";\r\n --this.pointer;\r\n } else {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nconst fileOtherwiseCodePoints = new Set([47, 92, 63, 35]);\r\n\r\nURLStateMachine.prototype[\"parse file\"] = function parseFile(c) {\r\n this.url.scheme = \"file\";\r\n\r\n if (c === 47 || c === 92) {\r\n if (c === 92) {\r\n this.parseError = true;\r\n }\r\n this.state = \"file slash\";\r\n } else if (this.base !== null && this.base.scheme === \"file\") {\r\n if (isNaN(c)) {\r\n this.url.host = this.base.host;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = this.base.query;\r\n } else if (c === 63) {\r\n this.url.host = this.base.host;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = \"\";\r\n this.state = \"query\";\r\n } else if (c === 35) {\r\n this.url.host = this.base.host;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = this.base.query;\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n } else {\r\n if (this.input.length - this.pointer - 1 === 0 || // remaining consists of 0 code points\r\n !isWindowsDriveLetterCodePoints(c, this.input[this.pointer + 1]) ||\r\n (this.input.length - this.pointer - 1 >= 2 && // remaining has at least 2 code points\r\n !fileOtherwiseCodePoints.has(this.input[this.pointer + 2]))) {\r\n this.url.host = this.base.host;\r\n this.url.path = this.base.path.slice();\r\n shortenPath(this.url);\r\n } else {\r\n this.parseError = true;\r\n }\r\n\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n } else {\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse file slash\"] = function parseFileSlash(c) {\r\n if (c === 47 || c === 92) {\r\n if (c === 92) {\r\n this.parseError = true;\r\n }\r\n this.state = \"file host\";\r\n } else {\r\n if (this.base !== null && this.base.scheme === \"file\") {\r\n if (isNormalizedWindowsDriveLetterString(this.base.path[0])) {\r\n this.url.path.push(this.base.path[0]);\r\n } else {\r\n this.url.host = this.base.host;\r\n }\r\n }\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse file host\"] = function parseFileHost(c, cStr) {\r\n if (isNaN(c) || c === 47 || c === 92 || c === 63 || c === 35) {\r\n --this.pointer;\r\n if (!this.stateOverride && isWindowsDriveLetterString(this.buffer)) {\r\n this.parseError = true;\r\n this.state = \"path\";\r\n } else if (this.buffer === \"\") {\r\n this.url.host = \"\";\r\n if (this.stateOverride) {\r\n return false;\r\n }\r\n this.state = \"path start\";\r\n } else {\r\n let host = parseHost(this.buffer, isSpecial(this.url));\r\n if (host === failure) {\r\n return failure;\r\n }\r\n if (host === \"localhost\") {\r\n host = \"\";\r\n }\r\n this.url.host = host;\r\n\r\n if (this.stateOverride) {\r\n return false;\r\n }\r\n\r\n this.buffer = \"\";\r\n this.state = \"path start\";\r\n }\r\n } else {\r\n this.buffer += cStr;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse path start\"] = function parsePathStart(c) {\r\n if (isSpecial(this.url)) {\r\n if (c === 92) {\r\n this.parseError = true;\r\n }\r\n this.state = \"path\";\r\n\r\n if (c !== 47 && c !== 92) {\r\n --this.pointer;\r\n }\r\n } else if (!this.stateOverride && c === 63) {\r\n this.url.query = \"\";\r\n this.state = \"query\";\r\n } else if (!this.stateOverride && c === 35) {\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n } else if (c !== undefined) {\r\n this.state = \"path\";\r\n if (c !== 47) {\r\n --this.pointer;\r\n }\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse path\"] = function parsePath(c) {\r\n if (isNaN(c) || c === 47 || (isSpecial(this.url) && c === 92) ||\r\n (!this.stateOverride && (c === 63 || c === 35))) {\r\n if (isSpecial(this.url) && c === 92) {\r\n this.parseError = true;\r\n }\r\n\r\n if (isDoubleDot(this.buffer)) {\r\n shortenPath(this.url);\r\n if (c !== 47 && !(isSpecial(this.url) && c === 92)) {\r\n this.url.path.push(\"\");\r\n }\r\n } else if (isSingleDot(this.buffer) && c !== 47 &&\r\n !(isSpecial(this.url) && c === 92)) {\r\n this.url.path.push(\"\");\r\n } else if (!isSingleDot(this.buffer)) {\r\n if (this.url.scheme === \"file\" && this.url.path.length === 0 && isWindowsDriveLetterString(this.buffer)) {\r\n if (this.url.host !== \"\" && this.url.host !== null) {\r\n this.parseError = true;\r\n this.url.host = \"\";\r\n }\r\n this.buffer = this.buffer[0] + \":\";\r\n }\r\n this.url.path.push(this.buffer);\r\n }\r\n this.buffer = \"\";\r\n if (this.url.scheme === \"file\" && (c === undefined || c === 63 || c === 35)) {\r\n while (this.url.path.length > 1 && this.url.path[0] === \"\") {\r\n this.parseError = true;\r\n this.url.path.shift();\r\n }\r\n }\r\n if (c === 63) {\r\n this.url.query = \"\";\r\n this.state = \"query\";\r\n }\r\n if (c === 35) {\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n }\r\n } else {\r\n // TODO: If c is not a URL code point and not \"%\", parse error.\r\n\r\n if (c === 37 &&\r\n (!isASCIIHex(this.input[this.pointer + 1]) ||\r\n !isASCIIHex(this.input[this.pointer + 2]))) {\r\n this.parseError = true;\r\n }\r\n\r\n this.buffer += percentEncodeChar(c, isPathPercentEncode);\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse cannot-be-a-base-URL path\"] = function parseCannotBeABaseURLPath(c) {\r\n if (c === 63) {\r\n this.url.query = \"\";\r\n this.state = \"query\";\r\n } else if (c === 35) {\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n } else {\r\n // TODO: Add: not a URL code point\r\n if (!isNaN(c) && c !== 37) {\r\n this.parseError = true;\r\n }\r\n\r\n if (c === 37 &&\r\n (!isASCIIHex(this.input[this.pointer + 1]) ||\r\n !isASCIIHex(this.input[this.pointer + 2]))) {\r\n this.parseError = true;\r\n }\r\n\r\n if (!isNaN(c)) {\r\n this.url.path[0] = this.url.path[0] + percentEncodeChar(c, isC0ControlPercentEncode);\r\n }\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse query\"] = function parseQuery(c, cStr) {\r\n if (isNaN(c) || (!this.stateOverride && c === 35)) {\r\n if (!isSpecial(this.url) || this.url.scheme === \"ws\" || this.url.scheme === \"wss\") {\r\n this.encodingOverride = \"utf-8\";\r\n }\r\n\r\n const buffer = new Buffer(this.buffer); // TODO: Use encoding override instead\r\n for (let i = 0; i < buffer.length; ++i) {\r\n if (buffer[i] < 0x21 || buffer[i] > 0x7E || buffer[i] === 0x22 || buffer[i] === 0x23 ||\r\n buffer[i] === 0x3C || buffer[i] === 0x3E) {\r\n this.url.query += percentEncode(buffer[i]);\r\n } else {\r\n this.url.query += String.fromCodePoint(buffer[i]);\r\n }\r\n }\r\n\r\n this.buffer = \"\";\r\n if (c === 35) {\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n }\r\n } else {\r\n // TODO: If c is not a URL code point and not \"%\", parse error.\r\n if (c === 37 &&\r\n (!isASCIIHex(this.input[this.pointer + 1]) ||\r\n !isASCIIHex(this.input[this.pointer + 2]))) {\r\n this.parseError = true;\r\n }\r\n\r\n this.buffer += cStr;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse fragment\"] = function parseFragment(c) {\r\n if (isNaN(c)) { // do nothing\r\n } else if (c === 0x0) {\r\n this.parseError = true;\r\n } else {\r\n // TODO: If c is not a URL code point and not \"%\", parse error.\r\n if (c === 37 &&\r\n (!isASCIIHex(this.input[this.pointer + 1]) ||\r\n !isASCIIHex(this.input[this.pointer + 2]))) {\r\n this.parseError = true;\r\n }\r\n\r\n this.url.fragment += percentEncodeChar(c, isC0ControlPercentEncode);\r\n }\r\n\r\n return true;\r\n};\r\n\r\nfunction serializeURL(url, excludeFragment) {\r\n let output = url.scheme + \":\";\r\n if (url.host !== null) {\r\n output += \"//\";\r\n\r\n if (url.username !== \"\" || url.password !== \"\") {\r\n output += url.username;\r\n if (url.password !== \"\") {\r\n output += \":\" + url.password;\r\n }\r\n output += \"@\";\r\n }\r\n\r\n output += serializeHost(url.host);\r\n\r\n if (url.port !== null) {\r\n output += \":\" + url.port;\r\n }\r\n } else if (url.host === null && url.scheme === \"file\") {\r\n output += \"//\";\r\n }\r\n\r\n if (url.cannotBeABaseURL) {\r\n output += url.path[0];\r\n } else {\r\n for (const string of url.path) {\r\n output += \"/\" + string;\r\n }\r\n }\r\n\r\n if (url.query !== null) {\r\n output += \"?\" + url.query;\r\n }\r\n\r\n if (!excludeFragment && url.fragment !== null) {\r\n output += \"#\" + url.fragment;\r\n }\r\n\r\n return output;\r\n}\r\n\r\nfunction serializeOrigin(tuple) {\r\n let result = tuple.scheme + \"://\";\r\n result += serializeHost(tuple.host);\r\n\r\n if (tuple.port !== null) {\r\n result += \":\" + tuple.port;\r\n }\r\n\r\n return result;\r\n}\r\n\r\nmodule.exports.serializeURL = serializeURL;\r\n\r\nmodule.exports.serializeURLOrigin = function (url) {\r\n // https://url.spec.whatwg.org/#concept-url-origin\r\n switch (url.scheme) {\r\n case \"blob\":\r\n try {\r\n return module.exports.serializeURLOrigin(module.exports.parseURL(url.path[0]));\r\n } catch (e) {\r\n // serializing an opaque origin returns \"null\"\r\n return \"null\";\r\n }\r\n case \"ftp\":\r\n case \"gopher\":\r\n case \"http\":\r\n case \"https\":\r\n case \"ws\":\r\n case \"wss\":\r\n return serializeOrigin({\r\n scheme: url.scheme,\r\n host: url.host,\r\n port: url.port\r\n });\r\n case \"file\":\r\n // spec says \"exercise to the reader\", chrome says \"file://\"\r\n return \"file://\";\r\n default:\r\n // serializing an opaque origin returns \"null\"\r\n return \"null\";\r\n }\r\n};\r\n\r\nmodule.exports.basicURLParse = function (input, options) {\r\n if (options === undefined) {\r\n options = {};\r\n }\r\n\r\n const usm = new URLStateMachine(input, options.baseURL, options.encodingOverride, options.url, options.stateOverride);\r\n if (usm.failure) {\r\n return \"failure\";\r\n }\r\n\r\n return usm.url;\r\n};\r\n\r\nmodule.exports.setTheUsername = function (url, username) {\r\n url.username = \"\";\r\n const decoded = punycode.ucs2.decode(username);\r\n for (let i = 0; i < decoded.length; ++i) {\r\n url.username += percentEncodeChar(decoded[i], isUserinfoPercentEncode);\r\n }\r\n};\r\n\r\nmodule.exports.setThePassword = function (url, password) {\r\n url.password = \"\";\r\n const decoded = punycode.ucs2.decode(password);\r\n for (let i = 0; i < decoded.length; ++i) {\r\n url.password += percentEncodeChar(decoded[i], isUserinfoPercentEncode);\r\n }\r\n};\r\n\r\nmodule.exports.serializeHost = serializeHost;\r\n\r\nmodule.exports.cannotHaveAUsernamePasswordPort = cannotHaveAUsernamePasswordPort;\r\n\r\nmodule.exports.serializeInteger = function (integer) {\r\n return String(integer);\r\n};\r\n\r\nmodule.exports.parseURL = function (input, options) {\r\n if (options === undefined) {\r\n options = {};\r\n }\r\n\r\n // We don't handle blobs, so this just delegates:\r\n return module.exports.basicURLParse(input, { baseURL: options.baseURL, encodingOverride: options.encodingOverride });\r\n};\r\n","\"use strict\";\n\nmodule.exports.mixin = function mixin(target, source) {\n const keys = Object.getOwnPropertyNames(source);\n for (let i = 0; i < keys.length; ++i) {\n Object.defineProperty(target, keys[i], Object.getOwnPropertyDescriptor(source, keys[i]));\n }\n};\n\nmodule.exports.wrapperSymbol = Symbol(\"wrapper\");\nmodule.exports.implSymbol = Symbol(\"impl\");\n\nmodule.exports.wrapperForImpl = function (impl) {\n return impl[module.exports.wrapperSymbol];\n};\n\nmodule.exports.implForWrapper = function (wrapper) {\n return wrapper[module.exports.implSymbol];\n};\n\n",null,"module.exports = require(\"assert\");","module.exports = require(\"child_process\");","module.exports = require(\"crypto\");","module.exports = require(\"events\");","module.exports = require(\"fs\");","module.exports = require(\"http\");","module.exports = require(\"https\");","module.exports = require(\"net\");","module.exports = require(\"os\");","module.exports = require(\"path\");","module.exports = require(\"punycode\");","module.exports = require(\"stream\");","module.exports = require(\"string_decoder\");","module.exports = require(\"timers\");","module.exports = require(\"tls\");","module.exports = require(\"url\");","module.exports = require(\"util\");","module.exports = require(\"zlib\");","'use strict';\n\n// eslint-disable-next-line eslint-comments/disable-enable-pair\n/* eslint-disable @typescript-eslint/naming-convention */\nlet LevelResolver = /*#__PURE__*/function (LevelResolver) {\n LevelResolver[LevelResolver[\"silent\"] = 0] = \"silent\";\n LevelResolver[LevelResolver[\"error\"] = 1] = \"error\";\n LevelResolver[LevelResolver[\"warn\"] = 2] = \"warn\";\n LevelResolver[LevelResolver[\"info\"] = 3] = \"info\";\n LevelResolver[LevelResolver[\"debug\"] = 4] = \"debug\";\n return LevelResolver;\n}({});\nconst shouldLog = (currentLevel, level) => LevelResolver[level] <= currentLevel;\n\n/**\n * A Logger using console output.\n *\n * @param logLevel - The logger level name\n * @param prefix - An optional logger message prefix\n * @param output - The output to print logs, using by default the global console object\n *\n * @internal\n */\nclass ConsoleLogger {\n constructor(logLevel, prefix = '', output = console) {\n this.logLevel = logLevel;\n this.prefix = prefix;\n this.output = output;\n this.level = LevelResolver[this.logLevel];\n }\n makeMethod(method) {\n return message => {\n if (shouldLog(this.level, method)) {\n this.output[method](this.prefix ? `${this.prefix} ${message}` : message);\n }\n };\n }\n debug = this.makeMethod('debug');\n error = this.makeMethod('error');\n info = this.makeMethod('info');\n warn = this.makeMethod('warn');\n}\n\nlet sdkLogger = /*#__PURE__*/new ConsoleLogger('silent');\n\n/**\n * Sets a logger to be used within the SDK.\n *\n * @param logger - The Logger instance\n *\n * @public\n */\nconst setLogger = logger => {\n sdkLogger = logger;\n};\n\n/**\n * Sets the logger to console logger with given logLevel (log is disabled by default).\n *\n * @param logLevel - The Log level (default to 'warn')\n * @param prefix - A Log message prefix (default to 'scaleway-sdk-js:')\n *\n * @public\n */\nconst enableConsoleLogger = (logLevel = 'warn', prefix = 'scaleway-sdk-js:') => setLogger(new ConsoleLogger(logLevel, prefix));\n\n/**\n * Returns the active SDK logger.\n *\n * @internal\n */\nconst getLogger = () => sdkLogger;\n\n/**\n * Adds an header to a request through an interceptor.\n *\n * @param key - The header key\n * @param value - The header value\n * @returns The Request interceptor\n *\n * @internal\n */\nconst addHeaderInterceptor = (key, value) => ({\n request\n}) => {\n const clone = request.clone();\n if (value !== undefined) {\n clone.headers.append(key, value);\n }\n return clone;\n};\n\n/**\n * Adds asynchronously an header to a request through an interceptor.\n *\n * @param key - The header key\n * @param value - The header value as a Promise\n * @returns The Request interceptor\n *\n * @internal\n */\nconst addAsyncHeaderInterceptor = (key, getter) => async request => addHeaderInterceptor(key, await getter())(request);\n\nconst isAccessKeyRegex = /^SCW[A-Z0-9]{17}$/i;\nconst isRegionRegex = /^[a-z]{2}-[a-z]{3}$/i;\nconst isUUIDRegex = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/i;\nconst isZoneRegex = /^[a-z]{2}-[a-z]{3}-[1-9]$/i;\n\n/** Returns true if the given string has a valid UUID format. */\nconst isUUID = str => isUUIDRegex.test(str);\n\n/** Returns true if the given string has a valid Scaleway access key format. */\nconst isAccessKey = str => isAccessKeyRegex.test(str);\n\n/** Returns true if the given string has a valid Scaleway secret key format. */\nconst isSecretKey = str => isUUID(str);\n\n/** Returns true if the given string has a valid Scaleway organization ID format. */\nconst isOrganizationId = str => isUUID(str);\n\n/** Returns true if the given string has a valid Scaleway project ID format. */\nconst isProjectId = str => isUUID(str);\n\n/** Returns true if the given string has a valid region format. */\nconst isRegion = str => isRegionRegex.test(str);\n\n/** Returns true if the given string has a valid zone format. */\nconst isZone = str => isZoneRegex.test(str);\n\n/** Returns true if the given string has a valid URL format and starts by `http(s):`. */\nconst isURL = str => {\n let url;\n try {\n url = new URL(str);\n } catch {\n return false;\n }\n return url.protocol === 'http:' || url.protocol === 'https:';\n};\n\n/**\n * Holds access key and secret key.\n *\n * @public\n */\n\n/**\n * Holds default values of a Scaleway profile.\n *\n * @public\n */\n\n/**\n * Holds values of a Scaleway profile.\n *\n * @public\n */\n\n/**\n * Verifies that the payload contains both the accessKey and the secretKey.\n *\n * @param obj - The secrets\n * @returns Whether the secrets are not empty.\n *\n * @internal\n */\nconst hasAuthenticationSecrets = obj => typeof obj.accessKey === 'string' && obj.accessKey !== '' && typeof obj.secretKey === 'string' && obj.secretKey !== '';\n\n/**\n * Asserts the format of secrets.\n *\n * @param obj - The secrets\n * @returns Whether the secrets use a valid format\n *\n * @throws Error\n * Thrown if either the accessKey or the secretKey has en invalid format.\n *\n * @internal\n */\nfunction assertValidAuthenticationSecrets(obj) {\n if (!(obj.accessKey && obj.secretKey)) {\n throw new Error(`Invalid secrets, accessKey & secretKey must be defined. See https://www.scaleway.com/en/docs/identity-and-access-management/iam/how-to/create-api-keys/`);\n }\n if (!isAccessKey(obj.accessKey)) {\n throw new Error(`Invalid access key format '${obj.accessKey}', expected SCWXXXXXXXXXXXXXXXXX format. See https://www.scaleway.com/en/docs/identity-and-access-management/iam/how-to/create-api-keys/`);\n }\n if (!isSecretKey(obj.secretKey)) {\n throw new Error(`Invalid secret key format '${obj.secretKey}', expected a UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. See https://www.scaleway.com/en/docs/identity-and-access-management/iam/how-to/create-api-keys/`);\n }\n}\n\nconst SESSION_HEADER_KEY = 'x-session-token';\nconst AUTH_HEADER_KEY = 'x-auth-token';\n/**\n * Authenticates with a session token.\n *\n * @param getToken - The token accessor\n * @returns The request interceptor\n *\n * @deprecated Please use addAsyncHeaderInterceptor instead.\n *\n * @internal\n */\nconst authenticateWithSessionToken = getToken => addAsyncHeaderInterceptor(SESSION_HEADER_KEY, getToken);\n\n/**\n * Authenticates with a secrets.\n *\n * @param getToken - The secrets\n * @returns The request interceptor\n *\n * @throws Error\n * Thrown if the secrets are invalid.\n *\n * @internal\n */\nconst authenticateWithSecrets = secrets => {\n assertValidAuthenticationSecrets(secrets);\n return addHeaderInterceptor(AUTH_HEADER_KEY, secrets.secretKey);\n};\n\n/**\n * Obfuscates a token.\n *\n * @param key - The token\n * @returns The obfuscated token\n *\n * @internal\n */\nconst obfuscateToken = key => `${key.substring(0, 5)}xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`;\n\n/**\n * Obfuscates an UUID.\n *\n * @param key - The UUID\n * @returns The obfuscated UUID\n *\n * @internal\n */\nconst obfuscateUUID = key => `${key.substring(0, 8)}-xxxx-xxxx-xxxx-xxxxxxxxxxxx`;\n/**\n * Obfuscates headers entry.\n *\n * @param array - The header entry\n * @returns The obfuscated entry\n *\n * @internal\n */\nconst obfuscateAuthHeadersEntry = ([name, value]) => {\n if (name === SESSION_HEADER_KEY) return [name, obfuscateToken(value)];\n if (name === AUTH_HEADER_KEY) return [name, obfuscateUUID(value)];\n return [name, value];\n};\n\n/**\n * A factory to build {@link Settings}.\n *\n * @public\n */\n\n/**\n * Instantiates the SDK from a configuration {@link Profile}.\n *\n * @param profile - The profile\n * @returns A factory {@link ClientConfig}\n *\n * @remarks This method should be used in conjunction with the initializer `createAdvancedClient`.\n *\n * @public\n */\nconst withProfile = profile => settings => {\n const newSettings = {\n ...settings\n };\n if (profile.apiURL) {\n newSettings.apiURL = profile.apiURL;\n }\n if (profile.defaultOrganizationId) {\n newSettings.defaultOrganizationId = profile.defaultOrganizationId;\n }\n if (profile.defaultProjectId) {\n newSettings.defaultProjectId = profile.defaultProjectId;\n }\n if (profile.defaultRegion) {\n newSettings.defaultRegion = profile.defaultRegion;\n }\n if (profile.defaultZone) {\n newSettings.defaultZone = profile.defaultZone;\n }\n if (hasAuthenticationSecrets(profile)) {\n newSettings.interceptors = [{\n request: authenticateWithSecrets(profile)\n }, ...newSettings.interceptors];\n }\n return newSettings;\n};\n\n/**\n * Instantiates the SDK with a different HTTP client.\n *\n * @param httpClient - A fetch compatible HTTP client\n * @returns A factory {@link ClientConfig}\n *\n * @remarks This method should be used in conjunction with the initializer `createAdvancedClient`.\n *\n * @public\n */\nconst withHTTPClient = httpClient => settings => ({\n ...settings,\n httpClient\n});\n\n/**\n * Instantiates the SDK with a default page size.\n *\n * @param defaultPageSize - The default page size\n * @returns A factory {@link ClientConfig}\n *\n * @remarks This method should be used in conjunction with the initializer `createAdvancedClient`.\n *\n * @public\n */\nconst withDefaultPageSize = defaultPageSize => settings => ({\n ...settings,\n defaultPageSize\n});\n\n/**\n * Instantiates the SDK with a different default user agent.\n *\n * @param userAgent - The default user agent\n * @returns A factory {@link ClientConfig}\n *\n * @remarks This method should be used in conjunction with the initializer `createAdvancedClient`.\n *\n * @public\n */\nconst withUserAgent = userAgent => settings => ({\n ...settings,\n userAgent\n});\n\n/**\n * Instantiates the SDK with an additional user agent.\n *\n * @param userAgent - The suffix to append to default user agent\n * @returns A factory {@link ClientConfig}\n *\n * @remarks This method should be used in conjunction with the initializer `createAdvancedClient`.\n *\n * @public\n */\nconst withUserAgentSuffix = userAgent => settings => ({\n ...settings,\n userAgent: settings.userAgent ? `${settings.userAgent} ${userAgent}` : userAgent\n});\n\n/**\n * Instantiates the SDK with additional interceptors.\n *\n * @param interceptors - The additional {@link NetworkInterceptors} interceptors\n * @returns A factory {@link ClientConfig}\n *\n * @remarks\n * It doesn't override the existing interceptors, but instead push more to the list.\n * This method should be used in conjunction with the initializer `createAdvancedClient`.\n *\n * @example\n * ```\n * withAdditionalInterceptors([\n * {\n * request: ({ request }) => {\n * console.log(`Do something with ${JSON.stringify(request)}`)\n * return request\n * },\n * response: ({ response }) => {\n * console.log(`Do something with ${JSON.stringify(response)}`)\n * return response\n * },\n * responseError: async ({\n * request,\n * error,\n * }: {\n * request: Request\n * error: unknown\n * }) => {\n * console.log(\n * `Do something with ${JSON.stringify(request)} and ${JSON.stringify(\n * error,\n * )}`,\n * )\n * throw error // or return Promise.resolve(someData)\n * },\n * },\n * ])\n * ```\n *\n * @public\n */\nconst withAdditionalInterceptors = interceptors => settings => ({\n ...settings,\n interceptors: settings.interceptors.concat(interceptors)\n});\n\n/**\n * Instantiates the SDK with legacy interceptors.\n */\n/* eslint-disable deprecation/deprecation */\nconst withLegacyInterceptors = () => settings => {\n if (!settings.requestInterceptors && !settings.responseInterceptors) {\n return settings;\n }\n const allInterceptors = settings.interceptors.concat((settings.requestInterceptors ?? []).map(obj => ({\n request: obj\n })), (settings.responseInterceptors ?? []).map(obj => ({\n response: obj\n })));\n return {\n ...settings,\n interceptors: allInterceptors\n };\n};\n/* eslint-enable deprecation/deprecation */\n\n/**\n * Holds default values of settings.\n *\n * @public\n */\n\n/**\n * Settings hold the values of all client options.\n *\n * @public\n */\n\n/**\n * Validates the content of a {@link Settings} object.\n *\n * @throws Error\n * Thrown if {@link Settings} aren't valid.\n *\n * @internal\n */\nconst assertValidSettings = obj => {\n // Default Organization ID.\n if (obj.defaultOrganizationId !== undefined) {\n if (typeof obj.defaultOrganizationId !== 'string' || obj.defaultOrganizationId.length === 0) {\n throw new Error('Default organization ID cannot be empty');\n }\n if (!isOrganizationId(obj.defaultOrganizationId)) {\n throw new Error(`Invalid organization ID format '${obj.defaultOrganizationId}', expected a UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`);\n }\n }\n\n // Default Project ID.\n if (obj.defaultProjectId !== undefined) {\n if (typeof obj.defaultProjectId !== 'string' || obj.defaultProjectId.length === 0) {\n throw new Error('Default project ID cannot be empty');\n }\n if (!isProjectId(obj.defaultProjectId)) {\n throw new Error(`Invalid project ID format '${obj.defaultProjectId}', expected a UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`);\n }\n }\n\n // Default Region.\n if (obj.defaultRegion && !isRegion(obj.defaultRegion)) {\n throw new Error(`Invalid default region format '${obj.defaultRegion}'`);\n }\n\n // Default Zone.\n if (obj.defaultZone && !isZone(obj.defaultZone)) {\n throw new Error(`Invalid default zone format '${obj.defaultZone}'`);\n }\n\n // API URL.\n if (!isURL(obj.apiURL)) {\n throw new Error(`Invalid URL ${obj.apiURL}`);\n }\n if (obj.apiURL.endsWith('/')) {\n throw new Error(`Invalid URL ${obj.apiURL}: it should not have a trailing slash`);\n }\n\n // HTTP Client.\n if (typeof obj.httpClient !== typeof fetch) {\n throw new Error(`Invalid HTTP Client`);\n }\n\n // Default Page Size.\n if (obj.defaultPageSize !== undefined && (typeof obj.defaultPageSize !== 'number' || Number.isNaN(obj.defaultPageSize) || obj.defaultPageSize <= 0)) {\n throw new Error(`Invalid defaultPageSize ${obj.defaultPageSize}: it should be a number above 0`);\n }\n\n // User Agent.\n if (typeof obj.userAgent !== 'string') {\n throw new Error(`Invalid User-Agent`);\n }\n};\n\nconst version = 'v1.36.0';\nconst userAgent = `scaleway-sdk-js/${version}`;\n\nconst isBrowser = () =>\n// eslint-disable-next-line @typescript-eslint/prefer-optional-chain\ntypeof window !== 'undefined' && typeof window.document !== 'undefined';\n\n/**\n * Composes request interceptors.\n *\n * @param interceptors - A list of request interceptors\n * @returns An async composed interceptor\n *\n * @internal\n */\nconst composeRequestInterceptors = interceptors => async request => interceptors.reduce(async (asyncResult, interceptor) => interceptor({\n request: await asyncResult\n}), Promise.resolve(request));\n\n/**\n * Composes response interceptors.\n *\n * @param interceptors - A list of response interceptors\n * @returns An async composed interceptor\n *\n * @internal\n */\nconst composeResponseInterceptors = interceptors => async response => interceptors.reduce(async (asyncResult, interceptor) => interceptor({\n response: await asyncResult\n}), Promise.resolve(response));\n\n/**\n * Compose response error interceptors.\n *\n * @internal\n */\nconst composeResponseErrorInterceptors = interceptors => async (request, error) => {\n let prevError = error;\n for (const interceptor of interceptors) {\n try {\n const res = await interceptor({\n request,\n error: prevError\n });\n return res;\n } catch (err) {\n prevError = err;\n }\n }\n throw prevError;\n};\n\n/**\n * Converts a string to PascalCase.\n *\n * @param str - The input string\n * @returns The string in PascalCase\n *\n * @internal\n */\nconst toPascalCase = str => str.replace(/\\w+/g, word => `${word[0].toUpperCase()}${word.slice(1).toLowerCase()}`);\n\n/**\n * Converts a Headers entry to string.\n *\n * @param entry - The header entry as a string tuple\n * @returns A serialized string\n *\n * @internal\n */\nconst serializeHeadersEntry = ([name, value]) => `${toPascalCase(name)}: ${value}`;\n\n/**\n * Converts Headers to safe to log strings (with obfuscated auth secrets).\n *\n * @param headers - The Headers\n * @returns Serialized headers strings\n *\n * @internal\n */\nconst serializeHeaders = headers => Array.from(headers.entries(), serializeHeadersEntry);\n\n/**\n * Dumps a Request into a readable string.\n *\n * @param request - The request\n * @returns The readable string\n *\n * @internal\n */\nconst dumpRequest = async request => [`${request.method.toUpperCase()}: ${request.url}`, ...serializeHeaders(request.headers), await request.clone().text()].join('\\r\\n');\n\n/**\n * Dumps a Response into a readable string.\n *\n * @param response - The response\n * @returns The readable string\n *\n * @internal\n */\nconst dumpResponse = async response => [`HTTP ${response.status} ${response.ok ? 'OK' : 'NOK'}`, ...serializeHeaders(response.headers), await response.clone().text()].join('\\r\\n');\n\n/**\n * Mapper of an header entry.\n *\n * @internal\n */\n\n/**\n * HTTP Request with obfuscated secrets.\n *\n * @internal\n */\nclass ObfuscatedRequest extends Request {\n constructor(request, obfuscate) {\n super(request);\n this.request = request;\n this.obfuscate = obfuscate;\n }\n get headers() {\n return new Headers(Array.from(this.request.headers, this.obfuscate));\n }\n clone() {\n return new ObfuscatedRequest(this.request, this.obfuscate);\n }\n}\n\n/**\n * Creates an interceptor to obfuscate the requests.\n *\n * @param obfuscate - The Header entries obfuscator mapper\n * @returns The obfuscated Request\n *\n * @internal\n */\nconst obfuscateInterceptor = obfuscate => ({\n request\n}) => new ObfuscatedRequest(request, obfuscate);\nconst identity = ({\n request\n}) => request;\n\n/**\n * Creates an interceptor to log the requests.\n *\n * @param identifier - The request identifier\n * @param obfuscate - The obfuscation interceptor\n * @returns The interceptor\n *\n * @internal\n */\nconst logRequest = (identifier, obfuscate = identity) => async ({\n request\n}) => {\n if (shouldLog(LevelResolver[getLogger().logLevel], 'debug')) {\n getLogger().debug(`--------------- Scaleway SDK REQUEST ${identifier} ---------------\n${await dumpRequest(await obfuscate({\n request\n }))}\n---------------------------------------------------------`);\n }\n return request;\n};\n\n/**\n * Creates an interceptor to log the responses.\n *\n * @param identifier - The request identifier\n * @returns The interceptor\n *\n * @internal\n */\nconst logResponse = identifier => async ({\n response\n}) => {\n if (shouldLog(LevelResolver[getLogger().logLevel], 'debug')) {\n getLogger().debug(`--------------- Scaleway SDK RESPONSE ${identifier} ---------------\n${await dumpResponse(response)}\n---------------------------------------------------------`);\n }\n return response;\n};\n\n/**\n * Validates an object is of type Response without using `instanceof`.\n *\n * @remarks Check issue #509 for more context.\n *\n * @internal\n */\nconst isResponse = obj => obj !== null && obj !== undefined && typeof obj === 'object' && 'status' in obj && typeof obj.status === 'number' && 'statusText' in obj && typeof obj.statusText === 'string' && 'headers' in obj && typeof obj.headers === 'object' && 'body' in obj && typeof obj.body !== 'undefined';\n\n/**\n * Validates an unknown object is a JSON Object.\n *\n * @internal\n */\nconst isJSONObject = obj => {\n const objT = typeof obj;\n return obj !== undefined && obj !== null && objT !== 'string' && objT !== 'number' && objT !== 'boolean' && !Array.isArray(obj) && objT === 'object';\n};\n\n/**\n * Verifies the object is a record of string to string[].\n *\n * @param obj - The object\n * @returns Whether the object is of the expected type\n *\n * @internal\n */\nconst isRecordOfStringArray = obj => {\n if (!isJSONObject(obj)) {\n return false;\n }\n for (const elt of Object.values(obj)) {\n if (!Array.isArray(elt) || Object.values(elt).find(x => typeof x !== 'string') !== undefined) {\n return false;\n }\n }\n return true;\n};\n\n/**\n * Builds the default message for {@link ScalewayError}.\n *\n * @param status - The response code\n * @param body - The response body\n * @returns The error message\n *\n * @internal\n */\nconst buildDefaultMessage = (status, body) => {\n const message = [`http error ${status}`];\n if (typeof body === 'string') {\n message.push(body);\n } else if (isJSONObject(body)) {\n if (typeof body.resource === 'string') {\n message.push(`resource ${body.resource}`);\n }\n if (typeof body.message === 'string') {\n message.push(body.message);\n }\n if (body.fields && isRecordOfStringArray(body.fields)) {\n message.push(Object.entries(body.fields).map(([name, list]) => `${name} (${list.join(', ')})`).join(', '));\n }\n }\n return message.join(': ');\n};\n\n/**\n * Scaleway error.\n *\n * @public\n */\nclass ScalewayError extends Error {\n /** The message originating from the payload. */\n\n constructor( /** The response status. */\n status, /** The response payload. */\n body, /** The augmented message. */\n message = buildDefaultMessage(status, body)) {\n super(message); // 'Error' breaks prototype chain here\n this.status = status;\n this.body = body;\n this.message = message;\n this.name = 'ScalewayError';\n this.rawMessage = typeof body === 'object' && typeof body.message === 'string' ? body.message : undefined;\n Object.setPrototypeOf(this, new.target.prototype); // restore prototype chain\n }\n\n static fromJSON(status, obj) {\n return new ScalewayError(status, obj);\n }\n toString() {\n return `${this.name}: ${this.message}`;\n }\n}\n\n/**\n * Details of an {@link InvalidArgumentsError} error.\n *\n * @public\n */\n\n/**\n * Build the default message for {@link InvalidArgumentsError}.\n *\n * @param list - The list of {@link InvalidArgumentsErrorDetails}\n * @returns The error message\n *\n * @internal\n */\nconst buildMessage$5 = list => {\n const invalidArgs = list.reduce((acc, details) => {\n let readableReason = '';\n switch (details.reason) {\n case 'required':\n readableReason = `is required`;\n break;\n case 'format':\n readableReason = `is wrongly formatted`;\n break;\n case 'constraint':\n readableReason = `does not respect constraint`;\n break;\n default:\n readableReason = `is invalid for unexpected reason`;\n break;\n }\n if (details.helpMessage && details.helpMessage.length > 0) {\n readableReason = readableReason.concat(`, `, details.helpMessage);\n }\n acc.push(`${details.argumentName} ${readableReason}`);\n return acc;\n }, []);\n return `invalid argument(s): ${invalidArgs.join('; ')}`;\n};\n\n/**\n * InvalidArguments error happens when one or many fields are invalid in the request message.\n *\n * @public\n */\nclass InvalidArgumentsError extends ScalewayError {\n constructor(status, body, details) {\n super(status, body, buildMessage$5(details));\n this.status = status;\n this.body = body;\n this.details = details;\n this.name = 'InvalidArgumentsError';\n }\n static fromJSON(status, obj) {\n if (!Array.isArray(obj.details)) return null;\n return new InvalidArgumentsError(status, obj, obj.details.reduce((list, detail) => isJSONObject(detail) && typeof detail.argument_name === 'string' && typeof detail.reason === 'string' ? list.concat({\n argumentName: detail.argument_name,\n helpMessage: typeof detail.help_message === 'string' ? detail.help_message : undefined,\n reason: detail.reason\n }) : list, []));\n }\n}\n\n/**\n * Scope of an {@link QuotasExceededErrorDetails} error.\n *\n * @public\n */\n\n/**\n * Details of an {@link QuotasExceededError} error.\n *\n * @public\n */\n\n/**\n * Build the default message for {@link QuotasExceededError}.\n *\n * @param list - The list of {@link QuotasExceededErrorDetails}\n * @returns The error message\n *\n * @internal\n */\nconst buildMessage$4 = list => `quota(s) exceeded: ${list.map(details => {\n const message = `${details.resource} has reached its quota (${details.current}/${details.quota})`;\n return details.scope ? `${message} for ${details.scope.kind} '${details.scope.id}'` : message;\n}).join('; ')}`;\nconst buildScope = detail => {\n if (typeof detail.organization_id === 'string' && detail.organization_id.length) {\n return {\n id: detail.organization_id,\n kind: 'organization'\n };\n }\n if (typeof detail.project_id === 'string' && detail.project_id.length) {\n return {\n id: detail.project_id,\n kind: 'project'\n };\n }\n return undefined;\n};\n\n/**\n * QuotasExceeded error happens when one or many resource exceed quotas during the creation of a resource.\n *\n * @public\n */\nclass QuotasExceededError extends ScalewayError {\n constructor(status, body, list) {\n super(status, body, buildMessage$4(list));\n this.status = status;\n this.body = body;\n this.list = list;\n this.name = 'QuotasExceededError';\n }\n static fromJSON(status, obj) {\n if (!Array.isArray(obj.details)) return null;\n return new QuotasExceededError(status, obj, obj.details.reduce((list, detail) => isJSONObject(detail) && typeof detail.resource === 'string' && typeof detail.quota === 'number' && typeof detail.current === 'number' ? list.concat({\n current: detail.current,\n quota: detail.quota,\n resource: detail.resource,\n scope: buildScope(detail)\n }) : list, []));\n }\n}\n\n/**\n * InvalidRequest error is only returned by the instance API.\n *\n * @public\n */\nclass InvalidRequestMapper {\n static fromJSON(status, obj) {\n if (typeof obj.message === 'string' && obj.message.toLowerCase().includes('quota exceeded for this resource')) {\n return new QuotasExceededError(status, obj, [{\n current: 0,\n quota: 0,\n resource: typeof obj.resource === 'string' ? obj.resource : ''\n }]);\n }\n const fields = obj.fields && isRecordOfStringArray(obj.fields) ? obj.fields : {};\n const fieldsMessages = Object.entries(fields);\n if (fieldsMessages.length) {\n return new InvalidArgumentsError(status, obj, fieldsMessages.map(([argumentName, messages]) => messages.map(helpMessage => ({\n argumentName,\n helpMessage,\n reason: 'constraint'\n }))).flat());\n }\n return new ScalewayError(status, obj);\n }\n}\n\n/**\n * ResourceNotFound error happens when getting a resource that does not exist anymore.\n *\n * @public\n */\nclass ResourceNotFoundError extends ScalewayError {\n constructor(status, body, resource, resourceId) {\n super(status, body, `resource ${resource} with ID ${resourceId} is not found`);\n this.status = status;\n this.body = body;\n this.resource = resource;\n this.resourceId = resourceId;\n this.name = 'ResourceNotFoundError';\n }\n static fromJSON(status, obj) {\n if (typeof obj.resource !== 'string' || typeof obj.resource_id !== 'string') {\n return null;\n }\n return new ResourceNotFoundError(status, obj, obj.resource, obj.resource_id);\n }\n}\n\n/**\n * UnknownResource error is only returned by the instance API.\n *\n * @public\n */\nclass UnknownResourceMapper {\n static fromJSON(status, obj) {\n // Split the message\n // Note: some errors uses ' and not \"\n // Examples: `\"111...\" not found` or `Security Group '111...' not found`\n const messageParts = typeof obj.message === 'string' ? obj.message.split(/\"|'/) : [];\n if (messageParts.length === 3 && isUUID(messageParts[1])) {\n return new ResourceNotFoundError(status, obj,\n // transform `Security group ` to `security_group`\n // `.replaceAll()` may be too recent to use yet.\n // that's why we're using `.split(' ').join('_')` for now.\n messageParts[0].trim().toLowerCase().split(' ').join('_'), messageParts[1]);\n }\n return new ScalewayError(status, obj);\n }\n}\n\n/**\n * AlreadyExists error is used when a resource already exists.\n *\n * @public\n */\nclass AlreadyExistsError extends ScalewayError {\n constructor(status, body, resource, resourceId, helpMessage) {\n super(status, body, `resource ${resource} with ID ${resourceId} already exists: ${helpMessage}`);\n this.status = status;\n this.body = body;\n this.resource = resource;\n this.resourceId = resourceId;\n this.helpMessage = helpMessage;\n this.name = 'AlreadyExistsError';\n }\n static fromJSON(status, obj) {\n if (typeof obj.resource !== 'string' || typeof obj.resource_id !== 'string' || typeof obj.help_message !== 'string') {\n return null;\n }\n return new AlreadyExistsError(status, obj, obj.resource, obj.resource_id, obj.help_message);\n }\n}\n\n/**\n * Build the default message for {@link DeniedAuthenticationError}.\n *\n * @param method - The authentication method\n * @param reason - The deny reason\n * @returns The error message\n *\n * @internal\n */\nconst buildMessage$3 = (method, reason) => {\n let reasonDesc;\n switch (reason) {\n case 'invalid_argument':\n reasonDesc = `invalid ${method} format or empty value`;\n break;\n case 'not_found':\n reasonDesc = `${method} does not exist`;\n break;\n case 'expired':\n reasonDesc = `${method} is expired`;\n break;\n default:\n reasonDesc = `unknown reason for ${method}`;\n }\n return `denied authentication: ${reasonDesc}`;\n};\n\n/**\n * DeniedAuthentication error is used by the API Gateway auth service to deny a request.\n *\n * @public\n */\nclass DeniedAuthenticationError extends ScalewayError {\n constructor(status, body, method, reason) {\n super(status, body, buildMessage$3(method, reason));\n this.status = status;\n this.body = body;\n this.method = method;\n this.reason = reason;\n this.name = 'DeniedAuthenticationError';\n }\n static fromJSON(status, obj) {\n if (typeof obj.method !== 'string' || typeof obj.reason !== 'string') {\n return null;\n }\n return new DeniedAuthenticationError(status, obj, obj.method, obj.reason);\n }\n}\n\n/**\n * OutOfStock error happens when stocks are empty for the resource.\n *\n * @public\n */\nclass OutOfStockError extends ScalewayError {\n constructor(status, body, resource) {\n super(status, body, `resource ${resource} is out of stock`);\n this.status = status;\n this.body = body;\n this.resource = resource;\n this.name = 'OutOfStockError';\n }\n static fromJSON(status, obj) {\n if (typeof obj.resource !== 'string') return null;\n return new OutOfStockError(status, obj, obj.resource);\n }\n}\n\n/**\n * Details of an {@link PermissionsDeniedError} error.\n *\n * @public\n */\n\n/**\n * Build the default message for {@link PermissionsDeniedError}.\n *\n * @param list - The list of {@link PermissionsDeniedErrorDetails}\n * @returns The error message\n *\n * @internal\n */\nconst buildMessage$2 = list => `insufficient permissions: ${list.map(({\n action,\n resource\n}) => `${action} ${resource}`).join('; ')}`;\n\n/**\n * PermissionsDenied error happens when one or many permissions are not accorded to the user making the request.\n *\n * @public\n */\nclass PermissionsDeniedError extends ScalewayError {\n constructor(status, body, list) {\n super(status, body, buildMessage$2(list));\n this.status = status;\n this.body = body;\n this.list = list;\n this.name = 'PermissionsDeniedError';\n }\n static fromJSON(status, obj) {\n if (!Array.isArray(obj.details)) return null;\n return new PermissionsDeniedError(status, obj, obj.details.reduce((list, detail) => isJSONObject(detail) && typeof detail.resource === 'string' && typeof detail.action === 'string' ? list.concat({\n action: detail.action,\n resource: detail.resource\n }) : list, []));\n }\n}\n\n/**\n * Build the default message for {@link PreconditionFailedError}.\n *\n * @param precondition - The precondition\n * @param helpMessage - The message which should help the user to fix the root cause\n * @returns The error message\n *\n * @internal\n */\nconst buildMessage$1 = (precondition, helpMessage) => {\n let message = `precondition failed: ${precondition}`;\n if (typeof helpMessage === 'string' && helpMessage.length > 0) {\n message = message.concat(', ', helpMessage);\n }\n return message;\n};\n\n/**\n * PreconditionFailed error is used when a precondition is not respected.\n *\n * @public\n */\nclass PreconditionFailedError extends ScalewayError {\n constructor(status, body, precondition, helpMessage) {\n super(status, body, buildMessage$1(precondition, helpMessage));\n this.status = status;\n this.body = body;\n this.precondition = precondition;\n this.helpMessage = helpMessage;\n this.name = 'PreconditionFailedError';\n }\n static fromJSON(status, obj) {\n if (typeof obj.precondition !== 'string' || typeof obj.help_message !== 'string') {\n return null;\n }\n return new PreconditionFailedError(status, obj, obj.precondition, obj.help_message);\n }\n}\n\n/**\n * ResourceExpired error happens when trying to access a resource that has expired.\n *\n * @public\n */\nclass ResourceExpiredError extends ScalewayError {\n constructor(status, body, resource, resourceId, expiredSince) {\n super(status, body, `resource ${resource} with ID ${resourceId} expired since ${expiredSince.toISOString()}`);\n this.status = status;\n this.body = body;\n this.resource = resource;\n this.resourceId = resourceId;\n this.expiredSince = expiredSince;\n this.name = 'ResourceExpiredError';\n }\n static fromJSON(status, obj) {\n if (typeof obj.resource !== 'string' || typeof obj.resource_id !== 'string' || typeof obj.expired_since !== 'string') {\n return null;\n }\n return new ResourceExpiredError(status, obj, obj.resource, obj.resource_id, new Date(obj.expired_since));\n }\n}\n\n/**\n * ResourceLocked error happens when a resource is locked by trust and safety.\n *\n * @public\n */\nclass ResourceLockedError extends ScalewayError {\n constructor(status, body, resource, resourceId) {\n super(status, body, `resource ${resource} with ID ${resourceId} is locked`);\n this.status = status;\n this.body = body;\n this.resource = resource;\n this.resourceId = resourceId;\n this.name = 'ResourceLockedError';\n }\n static fromJSON(status, obj) {\n if (typeof obj.resource !== 'string' || typeof obj.resource_id !== 'string') {\n return null;\n }\n return new ResourceLockedError(status, obj, obj.resource, obj.resource_id);\n }\n}\n\n/**\n * Quota policy of {@link TooManyRequestsError}.\n *\n * @public\n */\n\n/**\n * Build the default message for {@link TooManyRequestsError}.\n *\n * @internal\n */\nconst buildMessage = (helpMessage, limit, resetSeconds, resetAt) => {\n const details = [];\n if (limit) {\n if (limit.windowSeconds) {\n details.push(`quota is ${limit.quota} for ${limit.windowSeconds}s`);\n } else {\n details.push(`quota is ${limit.quota}`);\n }\n }\n if (resetSeconds) {\n details.push(`resets in ${resetSeconds}s`);\n } else if (resetAt) {\n details.push(`resets at ${resetAt.toISOString()}`);\n }\n let output = `too many requests`;\n if (details.length > 0) {\n output += ` (${details.join(', ')})`;\n }\n if (helpMessage.length > 0) {\n output += `: ${helpMessage}`;\n }\n return output;\n};\n\n/**\n * TooManyRequestsError error happens when fetching too many times a resource.\n *\n * @public\n */\nclass TooManyRequestsError extends ScalewayError {\n constructor(status, body, helpMessage, limit, /** The number of seconds until the quota resets */\n resetSeconds, /** The timestamp when the quota resets */\n resetAt) {\n super(status, body, buildMessage(helpMessage, limit, resetSeconds, resetAt));\n this.status = status;\n this.body = body;\n this.helpMessage = helpMessage;\n this.limit = limit;\n this.resetSeconds = resetSeconds;\n this.resetAt = resetAt;\n this.name = 'TooManyRequestsError';\n }\n static fromJSON(status, obj) {\n if (typeof obj.help_message !== 'string') return null;\n let limit;\n if (isJSONObject(obj.limit) && typeof obj.limit.quota === 'number') {\n limit = {\n quota: obj.limit.quota,\n windowSeconds: typeof obj.limit.window_seconds === 'number' ? obj.limit.window_seconds : undefined\n };\n }\n return new TooManyRequestsError(status, obj, obj.help_message, limit, typeof obj.reset_seconds === 'number' ? obj.reset_seconds : undefined, typeof obj.reset_at === 'string' ? new Date(obj.reset_at) : undefined);\n }\n}\n\n/**\n * TransientState error happens when trying to perform an action on a resource in a transient state.\n *\n * @public\n */\nclass TransientStateError extends ScalewayError {\n constructor(status, body, resource, resourceId, currentState) {\n super(status, body, `resource ${resource} with ID ${resourceId} is in a transient state: ${currentState}`);\n this.status = status;\n this.body = body;\n this.resource = resource;\n this.resourceId = resourceId;\n this.currentState = currentState;\n this.name = 'TransientStateError';\n }\n static fromJSON(status, obj) {\n if (typeof obj.resource !== 'string' || typeof obj.resource_id !== 'string' || typeof obj.current_state !== 'string') {\n return null;\n }\n return new TransientStateError(status, obj, obj.resource, obj.resource_id, obj.current_state);\n }\n}\n\n/**\n * Unmarshals a standard error from raw body.\n *\n * @param type - The error type\n * @param status - The status code\n * @param body - The error response\n * @returns The standard error if found\n *\n * @internal\n */\nconst unmarshalStandardError = (type, status, body) => {\n let error;\n switch (type) {\n case 'denied_authentication':\n error = DeniedAuthenticationError;\n break;\n case 'invalid_arguments':\n error = InvalidArgumentsError;\n break;\n case 'out_of_stock':\n error = OutOfStockError;\n break;\n case 'permissions_denied':\n error = PermissionsDeniedError;\n break;\n case 'precondition_failed':\n error = PreconditionFailedError;\n break;\n case 'quotas_exceeded':\n error = QuotasExceededError;\n break;\n case 'expired':\n error = ResourceExpiredError;\n break;\n case 'not_found':\n error = ResourceNotFoundError;\n break;\n case 'locked':\n error = ResourceLockedError;\n break;\n case 'transient_state':\n error = TransientStateError;\n break;\n case 'already_exists':\n error = AlreadyExistsError;\n break;\n case 'too_many_requests':\n error = TooManyRequestsError;\n break;\n default:\n return null;\n }\n return error.fromJSON(status, body);\n};\n\n/**\n * Unmarshals a non-standard error from raw body.\n *\n * @param type - The error type\n * @param status - The status code\n * @param body - The error response\n * @returns The non-standard error if found\n *\n * @internal\n */\nconst unmarshalNonStandardError = (type, status, body) => {\n switch (type) {\n case 'unknown_resource':\n return UnknownResourceMapper.fromJSON(status, body);\n case 'invalid_request_error':\n return InvalidRequestMapper.fromJSON(status, body);\n default:\n return null;\n }\n};\n\n/**\n * Parses Scaleway error from raw body.\n *\n * @param status - The status code\n * @param body - The error response\n * @returns The resolved error\n *\n * @internal\n */\nconst parseScalewayError = (status, body) => {\n const parsableError = typeof body.type === 'string' && (unmarshalStandardError(body.type, status, body) ?? unmarshalNonStandardError(body.type, status, body));\n return parsableError || new ScalewayError(status, body);\n};\n\nconst X_TOTAL_COUNT_HEADER_KEY = 'x-total-count';\nconst TOTAL_COUNT_RES_KEY = 'total_count';\n\n/**\n * Fixes the totalCount property for old APIs.\n *\n * @internal\n */\nconst fixLegacyTotalCount = (obj, headers) => {\n const headerVal = headers.get(X_TOTAL_COUNT_HEADER_KEY);\n if (!headerVal) {\n return obj;\n }\n const totalCount = parseInt(headerVal, 10);\n if (Number.isNaN(totalCount)) {\n return obj;\n }\n if (isJSONObject(obj) && !(TOTAL_COUNT_RES_KEY in obj)) {\n return Object.assign(obj, {\n [TOTAL_COUNT_RES_KEY]: totalCount\n });\n }\n return obj;\n};\n\n/**\n * Makes response parser.\n *\n * @param unmarshaller - The response payload unmarshaller\n * @returns An async converter of HTTP Response to desired result\n *\n * @throws {@link ScalewayError}\n * Thrown by the API if the request couldn't be completed.\n *\n * @throws TypeError\n * Thrown if the response parameter isn't of the expected type.\n *\n * @throws Error\n * JSON parsing could trigger an error.\n *\n * @internal\n */\nconst responseParser = (unmarshaller, responseType) => async response => {\n if (!isResponse(response)) {\n throw new TypeError('Invalid response object');\n }\n if (response.ok) {\n if (response.status === 204) return unmarshaller(undefined);\n const contentType = response.headers.get('Content-Type');\n try {\n if (responseType === 'json' && contentType === 'application/json') {\n return unmarshaller(fixLegacyTotalCount(await response.json(), response.headers));\n }\n if (responseType === 'blob') {\n return unmarshaller(await response.blob());\n }\n return unmarshaller(await response.text());\n } catch (err) {\n throw new ScalewayError(response.status, `could not parse '${contentType ?? ''}' response${err instanceof Error ? `: ${err.message}` : ''}`);\n }\n }\n const error = await response.clone().json().catch(() => response.text());\n if (isJSONObject(error)) throw parseScalewayError(response.status, error);\n throw new ScalewayError(response.status, typeof error === 'string' ? error : 'cannot read error response body');\n};\n\n/**\n * Builds Request from {@link ScwRequest} & {@link Settings}.\n *\n * @param request - A scaleway request\n * @param settings - The settings\n * @returns A fetch Request\n *\n * @internal\n */\nconst buildRequest = (request, settings) => {\n let {\n path\n } = request;\n if (request.urlParams instanceof URLSearchParams) {\n path = path.concat(`?${request.urlParams.toString()}`);\n }\n return new Request(`${settings.apiURL}${path}`, {\n body: request.body,\n headers: {\n Accept: 'application/json',\n ...( /* istanbul ignore next */!isBrowser() ? {\n 'User-Agent': settings.userAgent\n } : {}),\n ...request.headers\n },\n method: request.method\n });\n};\nconst asIs = response => response;\n/**\n * Builds a resource fetcher.\n *\n * @param settings - The {@link Settings} object\n * @param httpClient - The HTTP client that should be used to call the API\n * @returns The fetcher\n *\n * @internal\n */\nconst buildFetcher = (settings, httpClient) => {\n let requestNumber = 0;\n const prepareRequest = requestId => composeRequestInterceptors([...settings.interceptors.map(obj => obj.request).filter(obj => obj), logRequest(requestId, obfuscateInterceptor(obfuscateAuthHeadersEntry))]);\n const prepareResponse = requestId => composeResponseInterceptors([...settings.interceptors.map(obj => obj.response).filter(obj => obj), logResponse(requestId)]);\n const prepareResponseErrors = () => composeResponseErrorInterceptors(settings.interceptors.map(obj => obj.responseError).filter(obj => obj));\n return async (request, unwrapper = asIs) => {\n const requestId = `${requestNumber += 1}`;\n const reqInterceptors = prepareRequest(requestId);\n const finalRequest = await reqInterceptors(buildRequest(request, settings));\n try {\n const response = await httpClient(finalRequest);\n const resInterceptors = prepareResponse(requestId);\n const finalResponse = await resInterceptors(response);\n const resUnmarshaller = responseParser(unwrapper, request.responseType ?? 'json');\n const unmarshaledResponse = await resUnmarshaller(finalResponse);\n return unmarshaledResponse;\n } catch (err) {\n const resErrorInterceptors = prepareResponseErrors();\n const handledError = await resErrorInterceptors(finalRequest, err);\n return unwrapper(handledError);\n }\n };\n};\n\n/** Default {@link Settings} values. */\nconst DEFAULT_SETTINGS = {\n apiURL: 'https://api.scaleway.com',\n httpClient: fetch,\n interceptors: [],\n userAgent\n};\n\n/**\n * Scaleway client.\n */\n\n/**\n * Creates a Scaleway client with advanced options.\n * You can either use existing factories\n * (like `withProfile`, `withUserAgentSuffix`, etc)\n * or write your own using the interface `ClientConfig`.\n *\n * @example\n * Creates a client with factories:\n * ```\n * createAdvancedClient(\n * (obj: Settings) => ({\n * ...obj,\n * defaultPageSize: 100 ,\n * httpClient: myFetchWrapper,\n * }),\n * withUserAgentSuffix('bot-name/1.0'),\n * )\n * ```\n *\n * @throws Error\n * Thrown if the setup fails.\n *\n * @public\n */\nconst createAdvancedClient = (...configs) => {\n const settings = configs.concat([withLegacyInterceptors()]).reduce((currentSettings, config) => config(currentSettings), DEFAULT_SETTINGS);\n assertValidSettings(settings);\n getLogger().info(`init Scaleway SDK version ${version}`);\n return {\n fetch: buildFetcher(settings, settings.httpClient),\n settings\n };\n};\n\n/**\n * Creates a Scaleway client with a profile.\n *\n * @example\n * Creates a client with credentials & default values (see https://www.scaleway.com/en/docs/identity-and-access-management/iam/how-to/create-api-keys/):\n * ```\n * import { createClient } from '@scaleway/sdk'\n *\n * createClient({\n * accessKey: 'SCWXXXXXXXXXXXXXXXXX',\n * secretKey: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',\n * defaultProjectId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',\n * defaultRegion: 'fr-par',\n * defaultZone: 'fr-par-1',\n * })\n * ```\n *\n * @example\n * Creates a client by loading values from the environment (see https://www.scaleway.com/en/docs/identity-and-access-management/iam/how-to/create-api-keys/)\n * or the config file created by CLI `scw init` (see https://www.scaleway.com/en/cli/):\n * ```\n * import { loadProfileFromConfigurationFile } from '@scaleway/configuration-loader'\n * import { createClient } from '@scaleway/sdk'\n *\n * createClient({\n * ...await loadProfileFromConfigurationFile(),\n * defaultZone: 'fr-par-3',\n * })\n * ```\n *\n * @throws Error\n * Thrown if the setup fails.\n *\n * @public\n */\nconst createClient = (profile = {}) => createAdvancedClient(withProfile(profile));\n\nvar index$w = /*#__PURE__*/Object.freeze({\n __proto__: null,\n AlreadyExistsError: AlreadyExistsError,\n DeniedAuthenticationError: DeniedAuthenticationError,\n InvalidArgumentsError: InvalidArgumentsError,\n OutOfStockError: OutOfStockError,\n PermissionsDeniedError: PermissionsDeniedError,\n PreconditionFailedError: PreconditionFailedError,\n QuotasExceededError: QuotasExceededError,\n ResourceExpiredError: ResourceExpiredError,\n ResourceLockedError: ResourceLockedError,\n ResourceNotFoundError: ResourceNotFoundError,\n ScalewayError: ScalewayError,\n TooManyRequestsError: TooManyRequestsError,\n TransientStateError: TransientStateError\n});\n\n/**\n * Sleep for a specified number of time.\n *\n * @param ms - The number of milliseconds\n * @returns The sleep promise\n *\n * @internal\n */\nconst sleep = ms => new Promise(resolve => {\n setTimeout(resolve, ms);\n});\n\nconst DEFAULT_TIMEOUT_SECONDS = 300;\nconst DEFAULT_MIN_DELAY_SECONDS = 1;\nconst DEFAULT_MAX_DELAY_SECONDS = 30;\n\n/**\n * Creates an exponential backoff interval strategy.\n *\n * @param minDelay - The minimum delay before the next try in seconds\n * @param maxDelay - The maximum delay before the next try in seconds\n * @returns An exponential backoff generator\n *\n * @internal\n */\nfunction* createExponentialBackoffStrategy(minDelay, maxDelay) {\n if (minDelay < 1 || maxDelay < 1 || minDelay > maxDelay) {\n throw new Error('Waiter: minDelay must be >= 1 and maxDelay must be >= minDelay');\n }\n let attempt = 1;\n const ceiling = Math.log(maxDelay / minDelay) / Math.log(2) + 1;\n const randomInRange = (min, max) => min + Math.random() * (max - min);\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n while (true) {\n if (attempt > ceiling) {\n yield maxDelay;\n } else {\n yield randomInRange(minDelay, minDelay * 2 ** (attempt - 1));\n }\n attempt += 1;\n }\n}\n\n/**\n * Tries a specific logic several times until it succeeds, timeouts, or throws an exception.\n *\n * @param retry - The function to retry logic between each interval\n * @param strategy - A generated interval strategy iterator\n * @param timeout - The maximum time elapsed before timeout error\n *\n * @throws An timeout exception or error thrown by the logic being run\n *\n * @internal\n */\nconst tryAtIntervals = async (retry, strategy, timeout = DEFAULT_TIMEOUT_SECONDS) => {\n const timeoutTimestamp = Date.now() + timeout * 1000;\n let retryCount = 0;\n while (Date.now() <= timeoutTimestamp) {\n const delay = strategy.next(retryCount += 1).value * 1000;\n // Break if timeout has been reached\n if (timeoutTimestamp <= Date.now() + delay) break;\n // Wait before the next retry\n await sleep(delay);\n // Retry\n const {\n value,\n done\n } = await retry();\n if (done) return value;\n }\n throw new Error(`Timeout after ${timeout}s`);\n};\n\n/**\n * Represents the condition to stop waiting for a resource.\n *\n * @public\n */\n\n/**\n * The options to wait until a resource is ready.\n *\n * @public\n */\n\n/**\n * Fetches resource several times until an expected condition is reached, timeouts, or throws an exception.\n *\n * @param stop - The condition to stop waiting\n * @param fetcher - The method to retrieve resource\n * @param request - The resource request options\n * @param options - The retry strategy options\n * @param strategy - An optional custom strategy\n *\n * @returns A promise of resource\n *\n * @public\n */\nconst waitForResource = (stop, fetcher, request, options, strategy = createExponentialBackoffStrategy(options?.minDelay ?? DEFAULT_MIN_DELAY_SECONDS, options?.maxDelay ?? DEFAULT_MAX_DELAY_SECONDS)) => tryAtIntervals(async () => {\n const value = await fetcher(request);\n return {\n done: await stop(value),\n value\n };\n}, strategy, options?.timeout);\n\n/**\n * Abstract class to instantiate API from a {@link Client}.\n *\n * @internal\n */\nlet API$u = class API {\n constructor(client) {\n this.client = client;\n }\n};\n\n/**\n * Returns the parameter if it's valid as path parameter\n * (string and not empty, or number), else throws an exception.\n *\n * @param name - The parameter name\n * @param param - The parameter value\n * @returns The parameter value\n *\n * @throws TypeError\n * Thrown if the parameter is invalid.\n *\n * @internal\n */\nfunction validatePathParam(name, param) {\n if (typeof param === 'string' && param.length > 0) return param;\n if (typeof param === 'number') return param.toString();\n throw new TypeError(`param ${name} cannot be empty in request`);\n}\n\n/**\n * Resolves the ideal parameter and value amongst an optional list.\n *\n * @param list - The list to be looking into\n * @param isRequired - If at least one \"one-of\" should be found, false by default\n * @returns The parameter and value\n *\n * @throws TypeError\n * Thrown if isRequired is true, and no value or default value is specified.\n *\n * @internal\n */\nconst resolveOneOf = (list, isRequired = false) => {\n const elt = list.find(obj => obj.value !== undefined) ?? list.find(obj => obj.default !== undefined);\n const value = elt?.value ?? elt?.default;\n if (elt && value !== undefined) {\n return {\n [elt.param]: value\n };\n }\n if (isRequired) {\n const keyList = list.map(obj => obj.param).join(' or ');\n throw new TypeError(`one of ${keyList} must be indicated in the request`);\n }\n return {};\n};\n/**\n * Filters defined parameters tuples and converts them to URLSearchParams.\n *\n * @param paramTuples - The key/value pairs\n * @returns URLSearchParams\n *\n * @internal\n */\nconst urlParams = (...paramTuples) => {\n const params = new URLSearchParams();\n for (const [key, value] of paramTuples) {\n if (typeof key === 'string' && value != null) {\n if (Array.isArray(value)) {\n for (const innerValue of value) {\n if (innerValue !== null) {\n params.append(key, innerValue instanceof Date ? innerValue.toISOString() : innerValue.toString());\n }\n }\n } else {\n params.append(key, value instanceof Date ? value.toISOString() : value.toString());\n }\n }\n }\n return params;\n};\n\n/**\n * Unmarshals data to Date object.\n *\n * @internal\n */\nconst unmarshalDate = data => {\n if (typeof data !== 'string') {\n return undefined;\n }\n const date = new Date(data);\n if (Number.isNaN(date.getTime())) {\n return undefined;\n }\n return date;\n};\n\n/**\n * Unmarshals array of object.\n *\n * @internal\n */\nconst unmarshalArrayOfObject = (data, unmarshaller, emptyFallback = true) => {\n if (!Array.isArray(data)) {\n return emptyFallback ? [] : undefined;\n }\n return data.map(elt => unmarshaller(elt));\n};\n\n/**\n * Unmarshals map of object.\n *\n * @internal\n */\nconst unmarshalMapOfObject = (data, unmarshaller, emptyFallback = true) => {\n if (!data || typeof data !== 'object' || !(data instanceof Object) || Array.isArray(data)) {\n return emptyFallback ? {} : undefined;\n }\n return Object.entries(data).reduce((acc, [key, value]) => ({\n ...acc,\n [key]: unmarshaller(value)\n }), {});\n};\n\n/**\n * Unmarshals {@link Money}\n *\n * @internal\n */\nconst unmarshalMoney = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Money' failed as data isn't a dictionary.`);\n }\n return {\n currencyCode: data.currency_code,\n nanos: data.nanos,\n units: data.units\n };\n};\n\n/**\n * Unmarshals {@link ServiceInfo}.\n *\n * @internal\n */\nconst unmarshalServiceInfo = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ServiceInfo' failed as data isn't a dictionary.`);\n }\n return {\n description: data.description,\n documentationUrl: data.documentation_url,\n name: data.name,\n version: data.version\n };\n};\n\n/**\n * Unmarshals {@link ScwFile}.\n *\n * @internal\n */\nconst unmarshalScwFile = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ScwFile' failed as data isn't a dictionary.`);\n }\n return {\n content: data.content,\n contentType: data.content_type,\n name: data.name\n };\n};\n\n/**\n * Unmarshals {@link TimeSeriesPoint}\n *\n * @remarks To optimize the size of this message,\n * the JSON is compressed in an array instead of a dictionary.\n * Example: `[\"2019-08-08T15:00:00Z\", 0.2]`.\n *\n * @internal\n */\nconst unmarshalTimeSeriesPoint = data => {\n if (!Array.isArray(data)) {\n throw new TypeError(`Unmarshalling the type 'TimeSeriesPoint' failed as data isn't an array.`);\n }\n return {\n timestamp: unmarshalDate(data[0]),\n value: data[1]\n };\n};\n\n/**\n * Unmarshals {@link TimeSeries}\n *\n * @internal\n */\nconst unmarshalTimeSeries = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'TimeSeries' failed as data isn't a dictionary.`);\n }\n return {\n metadata: data.metadata,\n name: data.name,\n points: unmarshalArrayOfObject(data.points, unmarshalTimeSeriesPoint)\n };\n};\n\n/**\n * Marshals {@link ScwFile}.\n *\n * @internal\n */\nconst marshalScwFile = obj => ({\n content: obj.content,\n content_type: obj.contentType,\n name: obj.name\n});\n\n/**\n * Marshals {@link Money}\n *\n * @internal\n */\nconst marshalMoney = obj => ({\n currency_code: obj.currencyCode,\n nanos: obj.nanos,\n units: obj.units\n});\n\n/**\n * Marshals {@link TimeSeriesPoint}\n *\n * @internal\n */\nconst marshalTimeSeriesPoint = obj => ({\n timestamp: obj.timestamp?.toISOString(),\n value: obj.value\n});\n\n/**\n * Marshals {@link TimeSeries}\n *\n * @internal\n */\nconst marshalTimeSeries = obj => ({\n metadata: obj.metadata,\n name: obj.name,\n points: obj.points.map(elt => marshalTimeSeriesPoint(elt))\n});\n\nconst extract = key => result => result[key];\nfunction* pages(key, fetcher, request, firstPage) {\n if (!Array.isArray(firstPage[key])) {\n throw new Error(`Property ${key} is not a list in paginated result`);\n }\n const getList = extract(key);\n let page = request.page || 1;\n if (page === 1) {\n yield Promise.resolve(getList(firstPage));\n page += 1;\n }\n const {\n length\n } = firstPage[key];\n if (!length) return;\n const {\n totalCount\n } = firstPage;\n while (page <= Math.floor((totalCount + length - 1) / length)) {\n yield fetcher({\n ...request,\n page\n }).then(getList);\n page += 1;\n }\n}\n\n/**\n * Fetches a paginated resource.\n *\n * @param key - The resource key of values list\n * @param fetcher - The method to retrieve paginated resources\n * @param request - A request with pagination options\n * @param initial - The first page\n * @returns An async generator of resources arrays\n */\nasync function* fetchPaginated(key, fetcher, request, initial = fetcher(request)) {\n yield* pages(key, fetcher, request, await initial);\n}\n\n/**\n * Fetches all paginated resource.\n *\n * @param key - The resource key of values list\n * @param fetcher - The method to retrieve paginated resources\n * @param request - A request with pagination options\n * @param initial - The first page\n * @returns A resources array Promise\n */\nconst fetchAll = async (key, fetcher, request, initial = fetcher(request)) => (await Promise.all(Array.from(pages(key, fetcher, request, await initial)))).flat();\n\n/**\n * Enriches a listing method with helpers.\n *\n * @param key - The resource key of values list\n * @param fetcher - The method to retrieve paginated resources\n * @param request - A request with pagination options\n * @returns A resource Promise with the pagination helpers\n *\n * @internal\n */\nconst enrichForPagination = (key, fetcher, request) => {\n const firstPage = fetcher(request);\n return Object.assign(firstPage, {\n all: () => fetchAll(key, fetcher, request, firstPage),\n [Symbol.asyncIterator]: () => fetchPaginated(key, fetcher, request, firstPage)\n });\n};\n\nconst ADJECTIVES = ['admiring', 'adoring', 'affectionate', 'agitated', 'amazing', 'angry', 'awesome', 'beautiful', 'blissful', 'bold', 'boring', 'brave', 'busy', 'charming', 'clever', 'cool', 'compassionate', 'competent', 'condescending', 'confident', 'cranky', 'crazy', 'dazzling', 'determined', 'distracted', 'dreamy', 'eager', 'ecstatic', 'elastic', 'elated', 'elegant', 'eloquent', 'epic', 'exciting', 'fervent', 'festive', 'flamboyant', 'focused', 'friendly', 'frosty', 'funny', 'gallant', 'gifted', 'goofy', 'gracious', 'great', 'happy', 'hardcore', 'heuristic', 'hopeful', 'hungry', 'infallible', 'inspiring', 'interesting', 'intelligent', 'jolly', 'jovial', 'keen', 'kind', 'laughing', 'loving', 'lucid', 'magical', 'mystifying', 'modest', 'musing', 'naughty', 'nervous', 'nice', 'nifty', 'nostalgic', 'objective', 'optimistic', 'peaceful', 'pedantic', 'pensive', 'practical', 'priceless', 'quirky', 'quizzical', 'recursing', 'relaxed', 'reverent', 'romantic', 'sad', 'serene', 'sharp', 'silly', 'sleepy', 'stoic', 'strange', 'stupefied', 'suspicious', 'sweet', 'tender', 'thirsty', 'trusting', 'unruffled', 'upbeat', 'vibrant', 'vigilant', 'vigorous', 'wizardly', 'wonderful', 'xenodochial', 'youthful', 'zealous', 'zen'];\nconst NAMES = ['albattani', 'allen', 'almeida', 'antonelli', 'agnesi', 'archimedes', 'ardinghelli', 'aryabhata', 'austin', 'babbage', 'banach', 'banzai', 'bardeen', 'bartik', 'bassi', 'beaver', 'bell', 'benz', 'bhabha', 'bhaskara', 'black', 'blackburn', 'blackwell', 'bohr', 'booth', 'borg', 'bose', 'bouman', 'boyd', 'brahmagupta', 'brattain', 'brown', 'buck', 'burnell', 'cannon', 'carson', 'cartwright', 'carver', 'cerf', 'chandrasekhar', 'chaplygin', 'chatelet', 'chatterjee', 'chebyshev', 'cohen', 'chaum', 'clarke', 'colden', 'cori', 'cray', 'curran', 'curie', 'darwin', 'davinci', 'dewdney', 'dhawan', 'diffie', 'dijkstra', 'dirac', 'driscoll', 'dubinsky', 'easley', 'edison', 'einstein', 'elbakyan', 'elgamal', 'elion', 'ellis', 'engelbart', 'euclid', 'euler', 'faraday', 'feistel', 'fermat', 'fermi', 'feynman', 'franklin', 'gagarin', 'galileo', 'galois', 'ganguly', 'gates', 'gauss', 'germain', 'goldberg', 'goldstine', 'goldwasser', 'golick', 'goodall', 'gould', 'greider', 'grothendieck', 'haibt', 'hamilton', 'haslett', 'hawking', 'hellman', 'heisenberg', 'hermann', 'herschel', 'hertz', 'heyrovsky', 'hodgkin', 'hofstadter', 'hoover', 'hopper', 'hugle', 'hypatia', 'ishizaka', 'jackson', 'jang', 'jemison', 'jennings', 'jepsen', 'johnson', 'joliot', 'jones', 'kalam', 'kapitsa', 'kare', 'keldysh', 'keller', 'kepler', 'khayyam', 'khorana', 'kilby', 'kirch', 'knuth', 'kowalevski', 'lalande', 'lamarr', 'lamport', 'leakey', 'leavitt', 'lederberg', 'lehmann', 'lewin', 'lichterman', 'liskov', 'lovelace', 'lumiere', 'mahavira', 'margulis', 'matsumoto', 'maxwell', 'mayer', 'mccarthy', 'mcclintock', 'mclaren', 'mclean', 'mcnulty', 'mendel', 'mendeleev', 'meitner', 'meninsky', 'merkle', 'mestorf', 'mirzakhani', 'montalcini', 'moore', 'morse', 'murdock', 'moser', 'napier', 'nash', 'neumann', 'newton', 'nightingale', 'nobel', 'noether', 'northcutt', 'noyce', 'panini', 'pare', 'pascal', 'pasteur', 'payne', 'perlman', 'pike', 'poincare', 'poitras', 'proskuriakova', 'ptolemy', 'raman', 'ramanujan', 'ride', 'ritchie', 'rhodes', 'robinson', 'roentgen', 'rosalind', 'rubin', 'saha', 'sammet', 'sanderson', 'satoshi', 'shamir', 'shannon', 'shaw', 'shirley', 'shockley', 'shtern', 'sinoussi', 'snyder', 'solomon', 'spence', 'stonebraker', 'sutherland', 'swanson', 'swartz', 'swirles', 'taussig', 'tereshkova', 'tesla', 'tharp', 'thompson', 'torvalds', 'tu', 'turing', 'varahamihira', 'vaughan', 'visvesvaraya', 'volhard', 'villani', 'wescoff', 'wilbur', 'wiles', 'williams', 'williamson', 'wilson', 'wing', 'wozniak', 'wright', 'wu', 'yalow', 'yonath', 'zhukovsky'];\nconst randomName = function () {\n let prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n let separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '-';\n const name = `${ADJECTIVES[Math.floor(Math.random() * ADJECTIVES.length)] ?? ''}${separator}${NAMES[Math.floor(Math.random() * NAMES.length)] ?? ''}`;\n if (name === `boring${separator}wozniak`) {\n return randomName(prefix, separator);\n }\n return prefix.length > 0 ? `${prefix}${separator}${name}` : name;\n};\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst unmarshalProject$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Project' failed as data isn't a dictionary.`);\n }\n return {\n createdAt: unmarshalDate(data.created_at),\n description: data.description,\n id: data.id,\n name: data.name,\n organizationId: data.organization_id,\n updatedAt: unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalListProjectsResponse$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListProjectsResponse' failed as data isn't a dictionary.`);\n }\n return {\n projects: unmarshalArrayOfObject(data.projects, unmarshalProject$1),\n totalCount: data.total_count\n };\n};\nconst marshalCreateProjectRequest = (request, defaults) => ({\n description: request.description,\n name: request.name || randomName('proj'),\n organization_id: request.organizationId ?? defaults.defaultOrganizationId\n});\nconst marshalUpdateProjectRequest = (request, defaults) => ({\n description: request.description,\n name: request.name\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst jsonContentHeaders$s = {\n 'Content-Type': 'application/json; charset=utf-8'\n};\n\n/**\n * Account API.\n *\n * User related data. This API allows you to manage projects.\n */\nlet API$t = class API extends API$u {\n /**\n * Create a new Project for an Organization. Deprecated in favor of Account\n * API v3. Generate a new Project for an Organization, specifying its\n * configuration including name and description.\n *\n * @deprecated\n * @param request - The request {@link CreateProjectRequest}\n * @returns A Promise of Project\n */\n createProject = (request = {}) => this.client.fetch({\n body: JSON.stringify(marshalCreateProjectRequest(request, this.client.settings)),\n headers: jsonContentHeaders$s,\n method: 'POST',\n path: `/account/v2/projects`\n }, unmarshalProject$1);\n pageOfListProjects = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/account/v2/projects`,\n urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_ids', request.projectIds])\n }, unmarshalListProjectsResponse$1);\n\n /**\n * List all Projects of an Organization. Deprecated in favor of Account API\n * v3. List all Projects of an Organization. The response will include the\n * total number of Projects as well as their associated Organizations, names\n * and IDs. Other information include the creation and update date of the\n * Project.\n *\n * @deprecated\n * @param request - The request {@link ListProjectsRequest}\n * @returns A Promise of ListProjectsResponse\n */\n listProjects = (request = {}) => enrichForPagination('projects', this.pageOfListProjects, request);\n\n /**\n * Get an existing Project. Deprecated in favor of Account API v3. Retrieve\n * information about an existing Project, specified by its Project ID. Its\n * full details, including ID, name and description, are returned in the\n * response object.\n *\n * @deprecated\n * @param request - The request {@link GetProjectRequest}\n * @returns A Promise of Project\n */\n getProject = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/account/v2/projects/${validatePathParam('projectId', request.projectId ?? this.client.settings.defaultProjectId)}`\n }, unmarshalProject$1);\n\n /**\n * Delete an existing Project. Deprecated in favor of Account API v3. Delete\n * an existing Project, specified by its Project ID. The Project needs to be\n * empty (meaning there are no resources left in it) to be deleted\n * effectively. Note that deleting a Project is permanent, and cannot be\n * undone.\n *\n * @deprecated\n * @param request - The request {@link DeleteProjectRequest}\n */\n deleteProject = (request = {}) => this.client.fetch({\n method: 'DELETE',\n path: `/account/v2/projects/${validatePathParam('projectId', request.projectId ?? this.client.settings.defaultProjectId)}`\n });\n\n /**\n * Update Project. Deprecated in favor of Account API v3. Update the\n * parameters of an existing Project, specified by its Project ID. These\n * parameters include the name and description.\n *\n * @deprecated\n * @param request - The request {@link UpdateProjectRequest}\n * @returns A Promise of Project\n */\n updateProject = (request = {}) => this.client.fetch({\n body: JSON.stringify(marshalUpdateProjectRequest(request, this.client.settings)),\n headers: jsonContentHeaders$s,\n method: 'PATCH',\n path: `/account/v2/projects/${validatePathParam('projectId', request.projectId ?? this.client.settings.defaultProjectId)}`\n }, unmarshalProject$1);\n};\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\nvar index_gen$r = /*#__PURE__*/Object.freeze({\n __proto__: null,\n API: API$t\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst unmarshalProject = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Project' failed as data isn't a dictionary.`);\n }\n return {\n createdAt: unmarshalDate(data.created_at),\n description: data.description,\n id: data.id,\n name: data.name,\n organizationId: data.organization_id,\n updatedAt: unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalListProjectsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListProjectsResponse' failed as data isn't a dictionary.`);\n }\n return {\n projects: unmarshalArrayOfObject(data.projects, unmarshalProject),\n totalCount: data.total_count\n };\n};\nconst marshalProjectApiCreateProjectRequest = (request, defaults) => ({\n description: request.description,\n name: request.name || randomName('proj'),\n organization_id: request.organizationId ?? defaults.defaultOrganizationId\n});\nconst marshalProjectApiUpdateProjectRequest = (request, defaults) => ({\n description: request.description,\n name: request.name\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst jsonContentHeaders$r = {\n 'Content-Type': 'application/json; charset=utf-8'\n};\n\n/**\n * Account API.\n *\n * This API allows you to manage projects.\n */\nclass ProjectAPI extends API$u {\n /**\n * Create a new Project for an Organization. Generate a new Project for an\n * Organization, specifying its configuration including name and description.\n *\n * @param request - The request {@link ProjectApiCreateProjectRequest}\n * @returns A Promise of Project\n */\n createProject = request => this.client.fetch({\n body: JSON.stringify(marshalProjectApiCreateProjectRequest(request, this.client.settings)),\n headers: jsonContentHeaders$r,\n method: 'POST',\n path: `/account/v3/projects`\n }, unmarshalProject);\n pageOfListProjects = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/account/v3/projects`,\n urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_ids', request.projectIds])\n }, unmarshalListProjectsResponse);\n\n /**\n * List all Projects of an Organization. List all Projects of an Organization.\n * The response will include the total number of Projects as well as their\n * associated Organizations, names, and IDs. Other information includes the\n * creation and update date of the Project.\n *\n * @param request - The request {@link ProjectApiListProjectsRequest}\n * @returns A Promise of ListProjectsResponse\n */\n listProjects = (request = {}) => enrichForPagination('projects', this.pageOfListProjects, request);\n\n /**\n * Get an existing Project. Retrieve information about an existing Project,\n * specified by its Project ID. Its full details, including ID, name and\n * description, are returned in the response object.\n *\n * @param request - The request {@link ProjectApiGetProjectRequest}\n * @returns A Promise of Project\n */\n getProject = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/account/v3/projects/${validatePathParam('projectId', request.projectId ?? this.client.settings.defaultProjectId)}`\n }, unmarshalProject);\n\n /**\n * Delete an existing Project. Delete an existing Project, specified by its\n * Project ID. The Project needs to be empty (meaning there are no resources\n * left in it) to be deleted effectively. Note that deleting a Project is\n * permanent, and cannot be undone.\n *\n * @param request - The request {@link ProjectApiDeleteProjectRequest}\n */\n deleteProject = (request = {}) => this.client.fetch({\n method: 'DELETE',\n path: `/account/v3/projects/${validatePathParam('projectId', request.projectId ?? this.client.settings.defaultProjectId)}`\n });\n\n /**\n * Update Project. Update the parameters of an existing Project, specified by\n * its Project ID. These parameters include the name and description.\n *\n * @param request - The request {@link ProjectApiUpdateProjectRequest}\n * @returns A Promise of Project\n */\n updateProject = (request = {}) => this.client.fetch({\n body: JSON.stringify(marshalProjectApiUpdateProjectRequest(request, this.client.settings)),\n headers: jsonContentHeaders$r,\n method: 'PATCH',\n path: `/account/v3/projects/${validatePathParam('projectId', request.projectId ?? this.client.settings.defaultProjectId)}`\n }, unmarshalProject);\n}\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\nconst ProjectApiCreateProjectRequest = {\n description: {\n maxLength: 200\n },\n name: {\n maxLength: 64,\n minLength: 1,\n pattern: /^[a-zA-Z0-9\\._\\- ]+$/\n }\n};\nconst ProjectApiListProjectsRequest = {\n name: {\n maxLength: 64,\n minLength: 1,\n pattern: /^[a-zA-Z0-9\\._\\- ]+$/\n },\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThanOrEqual: 1,\n lessThanOrEqual: 100\n }\n};\nconst ProjectApiUpdateProjectRequest = {\n description: {\n maxLength: 200\n },\n name: {\n maxLength: 64,\n minLength: 1,\n pattern: /^[a-zA-Z0-9\\._\\- ]+$/\n }\n};\n\nvar validationRules_gen$9 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n ProjectApiCreateProjectRequest: ProjectApiCreateProjectRequest,\n ProjectApiListProjectsRequest: ProjectApiListProjectsRequest,\n ProjectApiUpdateProjectRequest: ProjectApiUpdateProjectRequest\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\nvar index_gen$q = /*#__PURE__*/Object.freeze({\n __proto__: null,\n ProjectAPI: ProjectAPI,\n ValidationRules: validationRules_gen$9\n});\n\nvar index$v = /*#__PURE__*/Object.freeze({\n __proto__: null,\n v2: index_gen$r,\n v3: index_gen$q\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\n/** Lists transient statutes of the enum {@link ServerStatus}. */\nconst SERVER_TRANSIENT_STATUSES$2 = ['starting', 'rebooting', 'updating', 'locking', 'unlocking', 'reinstalling'];\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst unmarshalServerTypeCPU = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ServerTypeCPU' failed as data isn't a dictionary.`);\n }\n return {\n coreCount: data.core_count,\n name: data.name\n };\n};\nconst unmarshalServerTypeDisk = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ServerTypeDisk' failed as data isn't a dictionary.`);\n }\n return {\n capacity: data.capacity,\n type: data.type\n };\n};\nconst unmarshalServerTypeMemory = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ServerTypeMemory' failed as data isn't a dictionary.`);\n }\n return {\n capacity: data.capacity,\n type: data.type\n };\n};\nconst unmarshalOS$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'OS' failed as data isn't a dictionary.`);\n }\n return {\n compatibleServerTypes: data.compatible_server_types,\n id: data.id,\n imageUrl: data.image_url,\n label: data.label,\n name: data.name\n };\n};\nconst unmarshalServer$2 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Server' failed as data isn't a dictionary.`);\n }\n return {\n createdAt: unmarshalDate(data.created_at),\n deletableAt: unmarshalDate(data.deletable_at),\n id: data.id,\n ip: data.ip,\n name: data.name,\n organizationId: data.organization_id,\n projectId: data.project_id,\n status: data.status,\n type: data.type,\n updatedAt: unmarshalDate(data.updated_at),\n vncUrl: data.vnc_url,\n zone: data.zone\n };\n};\nconst unmarshalServerType$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ServerType' failed as data isn't a dictionary.`);\n }\n return {\n cpu: data.cpu ? unmarshalServerTypeCPU(data.cpu) : undefined,\n disk: data.disk ? unmarshalServerTypeDisk(data.disk) : undefined,\n memory: data.memory ? unmarshalServerTypeMemory(data.memory) : undefined,\n minimumLeaseDuration: data.minimum_lease_duration,\n name: data.name,\n stock: data.stock\n };\n};\nconst unmarshalListOSResponse$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListOSResponse' failed as data isn't a dictionary.`);\n }\n return {\n os: unmarshalArrayOfObject(data.os, unmarshalOS$1),\n totalCount: data.total_count\n };\n};\nconst unmarshalListServerTypesResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListServerTypesResponse' failed as data isn't a dictionary.`);\n }\n return {\n serverTypes: unmarshalArrayOfObject(data.server_types, unmarshalServerType$1)\n };\n};\nconst unmarshalListServersResponse$2 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListServersResponse' failed as data isn't a dictionary.`);\n }\n return {\n servers: unmarshalArrayOfObject(data.servers, unmarshalServer$2),\n totalCount: data.total_count\n };\n};\nconst marshalCreateServerRequest$2 = (request, defaults) => ({\n name: request.name || randomName('as'),\n project_id: request.projectId ?? defaults.defaultProjectId,\n type: request.type\n});\nconst marshalUpdateServerRequest$2 = (request, defaults) => ({\n name: request.name\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst jsonContentHeaders$q = {\n 'Content-Type': 'application/json; charset=utf-8'\n};\n\n/** Apple silicon API. */\nlet API$s = class API extends API$u {\n /** Lists the available zones of the API. */\n static LOCALITIES = ['fr-par-3'];\n\n /**\n * List server types. List all technical details about Apple silicon server\n * types available in the specified zone. Since there is only one Availability\n * Zone for Apple silicon servers, the targeted value is `fr-par-3`.\n *\n * @param request - The request {@link ListServerTypesRequest}\n * @returns A Promise of ListServerTypesResponse\n */\n listServerTypes = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/server-types`\n }, unmarshalListServerTypesResponse);\n\n /**\n * Get a server type. Get technical details (CPU, disk size etc.) of a server\n * type.\n *\n * @param request - The request {@link GetServerTypeRequest}\n * @returns A Promise of ServerType\n */\n getServerType = request => this.client.fetch({\n method: 'GET',\n path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/server-type/${validatePathParam('serverType', request.serverType)}`\n }, unmarshalServerType$1);\n\n /**\n * Create a server. Create a new server in the targeted zone, specifying its\n * configuration including name and type.\n *\n * @param request - The request {@link CreateServerRequest}\n * @returns A Promise of Server\n */\n createServer = request => this.client.fetch({\n body: JSON.stringify(marshalCreateServerRequest$2(request, this.client.settings)),\n headers: jsonContentHeaders$q,\n method: 'POST',\n path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers`\n }, unmarshalServer$2);\n pageOfListServers = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers`,\n urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])\n }, unmarshalListServersResponse$2);\n\n /**\n * List all servers. List all servers in the specified zone. By default,\n * returned servers in the list are ordered by creation date in ascending\n * order, though this can be modified via the `order_by` field.\n *\n * @param request - The request {@link ListServersRequest}\n * @returns A Promise of ListServersResponse\n */\n listServers = (request = {}) => enrichForPagination('servers', this.pageOfListServers, request);\n pageOfListOS = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/os`,\n urlParams: urlParams(['name', request.name], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['server_type', request.serverType])\n }, unmarshalListOSResponse$1);\n\n /**\n * List all Operating Systems (OS). List all Operating Systems (OS). The\n * response will include the total number of OS as well as their associated\n * IDs, names and labels.\n *\n * @param request - The request {@link ListOSRequest}\n * @returns A Promise of ListOSResponse\n */\n listOS = (request = {}) => enrichForPagination('os', this.pageOfListOS, request);\n\n /**\n * Get an Operating System (OS). Get an Operating System (OS). The response\n * will include the OS's unique ID as well as its name and label.\n *\n * @param request - The request {@link GetOSRequest}\n * @returns A Promise of OS\n */\n getOS = request => this.client.fetch({\n method: 'GET',\n path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/os/${validatePathParam('osId', request.osId)}`\n }, unmarshalOS$1);\n\n /**\n * Get a server. Retrieve information about an existing Apple silicon server,\n * specified by its server ID. Its full details, including name, status and IP\n * address, are returned in the response object.\n *\n * @param request - The request {@link GetServerRequest}\n * @returns A Promise of Server\n */\n getServer = request => this.client.fetch({\n method: 'GET',\n path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`\n }, unmarshalServer$2);\n\n /**\n * Waits for {@link Server} to be in a final state.\n *\n * @param request - The request {@link GetServerRequest}\n * @param options - The waiting options\n * @returns A Promise of Server\n */\n waitForServer = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!SERVER_TRANSIENT_STATUSES$2.includes(res.status))), this.getServer, request, options);\n\n /**\n * Update a server. Update the parameters of an existing Apple silicon server,\n * specified by its server ID.\n *\n * @param request - The request {@link UpdateServerRequest}\n * @returns A Promise of Server\n */\n updateServer = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateServerRequest$2(request, this.client.settings)),\n headers: jsonContentHeaders$q,\n method: 'PATCH',\n path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`\n }, unmarshalServer$2);\n\n /**\n * Delete a server. Delete an existing Apple silicon server, specified by its\n * server ID. Deleting a server is permanent, and cannot be undone. Note that\n * the minimum allocation period for Apple silicon-as-a-service is 24 hours,\n * meaning you cannot delete your server prior to that.\n *\n * @param request - The request {@link DeleteServerRequest}\n */\n deleteServer = request => this.client.fetch({\n method: 'DELETE',\n path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`\n });\n\n /**\n * Reboot a server. Reboot an existing Apple silicon server, specified by its\n * server ID.\n *\n * @param request - The request {@link RebootServerRequest}\n * @returns A Promise of Server\n */\n rebootServer = request => this.client.fetch({\n body: '{}',\n headers: jsonContentHeaders$q,\n method: 'POST',\n path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/reboot`\n }, unmarshalServer$2);\n\n /**\n * Reinstall a server. Reinstall an existing Apple silicon server (specified\n * by its server ID) from a new image (OS). All the data on the disk is\n * deleted and all configuration is reset to the defailt configuration values\n * of the image (OS).\n *\n * @param request - The request {@link ReinstallServerRequest}\n * @returns A Promise of Server\n */\n reinstallServer = request => this.client.fetch({\n body: '{}',\n headers: jsonContentHeaders$q,\n method: 'POST',\n path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/reinstall`\n }, unmarshalServer$2);\n};\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\nvar index_gen$p = /*#__PURE__*/Object.freeze({\n __proto__: null,\n API: API$s,\n SERVER_TRANSIENT_STATUSES: SERVER_TRANSIENT_STATUSES$2\n});\n\nvar index$u = /*#__PURE__*/Object.freeze({\n __proto__: null,\n v1alpha1: index_gen$p\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\n/** Lists transient statutes of the enum {@link ServerInstallStatus}. */\nconst SERVER_INSTALL_TRANSIENT_STATUSES = ['to_install', 'installing'];\n\n/** Lists transient statutes of the enum {@link ServerPrivateNetworkStatus}. */\nconst SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES = ['attaching', 'detaching'];\n\n/** Lists transient statutes of the enum {@link ServerStatus}. */\nconst SERVER_TRANSIENT_STATUSES$1 = ['delivering', 'stopping', 'starting', 'deleting', 'ordered', 'resetting'];\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst unmarshalCPU = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'CPU' failed as data isn't a dictionary.`);\n }\n return {\n benchmark: data.benchmark,\n coreCount: data.core_count,\n frequency: data.frequency,\n name: data.name,\n threadCount: data.thread_count\n };\n};\nconst unmarshalDisk = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Disk' failed as data isn't a dictionary.`);\n }\n return {\n capacity: data.capacity,\n type: data.type\n };\n};\nconst unmarshalIP$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'IP' failed as data isn't a dictionary.`);\n }\n return {\n address: data.address,\n id: data.id,\n reverse: data.reverse,\n reverseStatus: data.reverse_status,\n reverseStatusMessage: data.reverse_status_message,\n version: data.version\n };\n};\nconst unmarshalMemory = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Memory' failed as data isn't a dictionary.`);\n }\n return {\n capacity: data.capacity,\n frequency: data.frequency,\n isEcc: data.is_ecc,\n type: data.type\n };\n};\nconst unmarshalOSOSField = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'OSOSField' failed as data isn't a dictionary.`);\n }\n return {\n defaultValue: data.default_value,\n editable: data.editable,\n required: data.required\n };\n};\nconst unmarshalOfferOptionOffer = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'OfferOptionOffer' failed as data isn't a dictionary.`);\n }\n return {\n enabled: data.enabled,\n id: data.id,\n manageable: data.manageable,\n name: data.name,\n osId: data.os_id,\n price: data.price ? unmarshalMoney(data.price) : undefined,\n subscriptionPeriod: data.subscription_period\n };\n};\nconst unmarshalPersistentMemory = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'PersistentMemory' failed as data isn't a dictionary.`);\n }\n return {\n capacity: data.capacity,\n frequency: data.frequency,\n type: data.type\n };\n};\nconst unmarshalRaidController = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'RaidController' failed as data isn't a dictionary.`);\n }\n return {\n model: data.model,\n raidLevel: data.raid_level\n };\n};\nconst unmarshalServerInstall = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ServerInstall' failed as data isn't a dictionary.`);\n }\n return {\n hostname: data.hostname,\n osId: data.os_id,\n serviceUrl: data.service_url,\n serviceUser: data.service_user,\n sshKeyIds: data.ssh_key_ids,\n status: data.status,\n user: data.user\n };\n};\nconst unmarshalServerOption = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ServerOption' failed as data isn't a dictionary.`);\n }\n return {\n expiresAt: unmarshalDate(data.expires_at),\n id: data.id,\n manageable: data.manageable,\n name: data.name,\n status: data.status\n };\n};\nconst unmarshalServerRescueServer = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ServerRescueServer' failed as data isn't a dictionary.`);\n }\n return {\n password: data.password,\n user: data.user\n };\n};\nconst unmarshalOS = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'OS' failed as data isn't a dictionary.`);\n }\n return {\n allowed: data.allowed,\n enabled: data.enabled,\n id: data.id,\n licenseRequired: data.license_required,\n logoUrl: data.logo_url,\n name: data.name,\n password: data.password ? unmarshalOSOSField(data.password) : undefined,\n servicePassword: data.service_password ? unmarshalOSOSField(data.service_password) : undefined,\n serviceUser: data.service_user ? unmarshalOSOSField(data.service_user) : undefined,\n ssh: data.ssh ? unmarshalOSOSField(data.ssh) : undefined,\n user: data.user ? unmarshalOSOSField(data.user) : undefined,\n version: data.version\n };\n};\nconst unmarshalOffer$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Offer' failed as data isn't a dictionary.`);\n }\n return {\n bandwidth: data.bandwidth,\n commercialRange: data.commercial_range,\n cpus: unmarshalArrayOfObject(data.cpus, unmarshalCPU),\n disks: unmarshalArrayOfObject(data.disks, unmarshalDisk),\n enable: data.enable,\n fee: data.fee ? unmarshalMoney(data.fee) : undefined,\n id: data.id,\n incompatibleOsIds: data.incompatible_os_ids,\n memories: unmarshalArrayOfObject(data.memories, unmarshalMemory),\n name: data.name,\n operationPath: data.operation_path,\n options: unmarshalArrayOfObject(data.options, unmarshalOfferOptionOffer),\n persistentMemories: unmarshalArrayOfObject(data.persistent_memories, unmarshalPersistentMemory),\n pricePerHour: data.price_per_hour ? unmarshalMoney(data.price_per_hour) : undefined,\n pricePerMonth: data.price_per_month ? unmarshalMoney(data.price_per_month) : undefined,\n privateBandwidth: data.private_bandwidth,\n quotaName: data.quota_name,\n raidControllers: unmarshalArrayOfObject(data.raid_controllers, unmarshalRaidController),\n sharedBandwidth: data.shared_bandwidth,\n stock: data.stock,\n subscriptionPeriod: data.subscription_period,\n tags: data.tags\n };\n};\nconst unmarshalOption = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Option' failed as data isn't a dictionary.`);\n }\n return {\n id: data.id,\n manageable: data.manageable,\n name: data.name\n };\n};\nconst unmarshalServer$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Server' failed as data isn't a dictionary.`);\n }\n return {\n bootType: data.boot_type,\n createdAt: unmarshalDate(data.created_at),\n description: data.description,\n domain: data.domain,\n id: data.id,\n install: data.install ? unmarshalServerInstall(data.install) : undefined,\n ips: unmarshalArrayOfObject(data.ips, unmarshalIP$1),\n name: data.name,\n offerId: data.offer_id,\n offerName: data.offer_name,\n options: unmarshalArrayOfObject(data.options, unmarshalServerOption),\n organizationId: data.organization_id,\n pingStatus: data.ping_status,\n projectId: data.project_id,\n rescueServer: data.rescue_server ? unmarshalServerRescueServer(data.rescue_server) : undefined,\n status: data.status,\n tags: data.tags,\n updatedAt: unmarshalDate(data.updated_at),\n zone: data.zone\n };\n};\nconst unmarshalServerEvent = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ServerEvent' failed as data isn't a dictionary.`);\n }\n return {\n action: data.action,\n createdAt: unmarshalDate(data.created_at),\n id: data.id,\n updatedAt: unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalServerPrivateNetwork = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ServerPrivateNetwork' failed as data isn't a dictionary.`);\n }\n return {\n createdAt: unmarshalDate(data.created_at),\n id: data.id,\n privateNetworkId: data.private_network_id,\n projectId: data.project_id,\n serverId: data.server_id,\n status: data.status,\n updatedAt: unmarshalDate(data.updated_at),\n vlan: data.vlan\n };\n};\nconst unmarshalSetting = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Setting' failed as data isn't a dictionary.`);\n }\n return {\n enabled: data.enabled,\n id: data.id,\n projectId: data.project_id,\n type: data.type\n };\n};\nconst unmarshalBMCAccess = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'BMCAccess' failed as data isn't a dictionary.`);\n }\n return {\n expiresAt: unmarshalDate(data.expires_at),\n login: data.login,\n password: data.password,\n url: data.url\n };\n};\nconst unmarshalGetServerMetricsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'GetServerMetricsResponse' failed as data isn't a dictionary.`);\n }\n return {\n pings: data.pings ? unmarshalTimeSeries(data.pings) : undefined\n };\n};\nconst unmarshalListOSResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListOSResponse' failed as data isn't a dictionary.`);\n }\n return {\n os: unmarshalArrayOfObject(data.os, unmarshalOS),\n totalCount: data.total_count\n };\n};\nconst unmarshalListOffersResponse$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListOffersResponse' failed as data isn't a dictionary.`);\n }\n return {\n offers: unmarshalArrayOfObject(data.offers, unmarshalOffer$1),\n totalCount: data.total_count\n };\n};\nconst unmarshalListOptionsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListOptionsResponse' failed as data isn't a dictionary.`);\n }\n return {\n options: unmarshalArrayOfObject(data.options, unmarshalOption),\n totalCount: data.total_count\n };\n};\nconst unmarshalListServerEventsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListServerEventsResponse' failed as data isn't a dictionary.`);\n }\n return {\n events: unmarshalArrayOfObject(data.events, unmarshalServerEvent),\n totalCount: data.total_count\n };\n};\nconst unmarshalListServerPrivateNetworksResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListServerPrivateNetworksResponse' failed as data isn't a dictionary.`);\n }\n return {\n serverPrivateNetworks: unmarshalArrayOfObject(data.server_private_networks, unmarshalServerPrivateNetwork),\n totalCount: data.total_count\n };\n};\nconst unmarshalListServersResponse$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListServersResponse' failed as data isn't a dictionary.`);\n }\n return {\n servers: unmarshalArrayOfObject(data.servers, unmarshalServer$1),\n totalCount: data.total_count\n };\n};\nconst unmarshalListSettingsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListSettingsResponse' failed as data isn't a dictionary.`);\n }\n return {\n settings: unmarshalArrayOfObject(data.settings, unmarshalSetting),\n totalCount: data.total_count\n };\n};\nconst unmarshalSetServerPrivateNetworksResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'SetServerPrivateNetworksResponse' failed as data isn't a dictionary.`);\n }\n return {\n serverPrivateNetworks: unmarshalArrayOfObject(data.server_private_networks, unmarshalServerPrivateNetwork)\n };\n};\nconst marshalCreateServerRequestInstall = (request, defaults) => ({\n hostname: request.hostname,\n os_id: request.osId,\n password: request.password,\n service_password: request.servicePassword,\n service_user: request.serviceUser,\n ssh_key_ids: request.sshKeyIds,\n user: request.user\n});\nconst marshalAddOptionServerRequest = (request, defaults) => ({\n expires_at: request.expiresAt\n});\nconst marshalCreateServerRequest$1 = (request, defaults) => ({\n description: request.description,\n install: request.install ? marshalCreateServerRequestInstall(request.install) : undefined,\n name: request.name,\n offer_id: request.offerId,\n option_ids: request.optionIds,\n tags: request.tags,\n ...resolveOneOf([{\n default: defaults.defaultProjectId,\n param: 'project_id',\n value: request.projectId\n }, {\n default: defaults.defaultOrganizationId,\n param: 'organization_id',\n value: request.organizationId\n }])\n});\nconst marshalInstallServerRequest = (request, defaults) => ({\n hostname: request.hostname,\n os_id: request.osId,\n password: request.password,\n service_password: request.servicePassword,\n service_user: request.serviceUser,\n ssh_key_ids: request.sshKeyIds,\n user: request.user\n});\nconst marshalPrivateNetworkApiAddServerPrivateNetworkRequest = (request, defaults) => ({\n private_network_id: request.privateNetworkId\n});\nconst marshalPrivateNetworkApiSetServerPrivateNetworksRequest = (request, defaults) => ({\n private_network_ids: request.privateNetworkIds\n});\nconst marshalRebootServerRequest = (request, defaults) => ({\n boot_type: request.bootType ?? 'unknown_boot_type'\n});\nconst marshalStartBMCAccessRequest = (request, defaults) => ({\n ip: request.ip\n});\nconst marshalStartServerRequest = (request, defaults) => ({\n boot_type: request.bootType ?? 'unknown_boot_type'\n});\nconst marshalUpdateIPRequest$1 = (request, defaults) => ({\n reverse: request.reverse\n});\nconst marshalUpdateServerRequest$1 = (request, defaults) => ({\n description: request.description,\n name: request.name,\n tags: request.tags\n});\nconst marshalUpdateSettingRequest = (request, defaults) => ({\n enabled: request.enabled\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst jsonContentHeaders$p = {\n 'Content-Type': 'application/json; charset=utf-8'\n};\n\n/**\n * Elastic Metal API.\n *\n * This API allows to manage your Elastic Metal server. Elastic Metal API.\n */\nlet API$r = class API extends API$u {\n /** Lists the available zones of the API. */\n static LOCALITIES = ['fr-par-1', 'fr-par-2', 'nl-ams-1', 'nl-ams-2'];\n pageOfListServers = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers`,\n urlParams: urlParams(['name', request.name], ['option_id', request.optionId], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId], ['status', request.status], ['tags', request.tags])\n }, unmarshalListServersResponse$1);\n\n /**\n * List Elastic Metal servers for an Organization. List Elastic Metal servers\n * for a specific Organization.\n *\n * @param request - The request {@link ListServersRequest}\n * @returns A Promise of ListServersResponse\n */\n listServers = (request = {}) => enrichForPagination('servers', this.pageOfListServers, request);\n\n /**\n * Get a specific Elastic Metal server. Get full details of an existing\n * Elastic Metal server associated with the ID.\n *\n * @param request - The request {@link GetServerRequest}\n * @returns A Promise of Server\n */\n getServer = request => this.client.fetch({\n method: 'GET',\n path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`\n }, unmarshalServer$1);\n\n /**\n * Waits for {@link Server} to be in a final state.\n *\n * @param request - The request {@link GetServerRequest}\n * @param options - The waiting options\n * @returns A Promise of Server\n */\n waitForServer = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!SERVER_TRANSIENT_STATUSES$1.includes(res.status))), this.getServer, request, options);\n\n /**\n * Create an Elastic Metal server. Create a new Elastic Metal server. Once the\n * server is created, proceed with the [installation of an OS](#post-3e949e).\n *\n * @param request - The request {@link CreateServerRequest}\n * @returns A Promise of Server\n */\n createServer = request => this.client.fetch({\n body: JSON.stringify(marshalCreateServerRequest$1(request, this.client.settings)),\n headers: jsonContentHeaders$p,\n method: 'POST',\n path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers`\n }, unmarshalServer$1);\n\n /**\n * Update an Elastic Metal server. Update the server associated with the ID.\n * You can update parameters such as the server's name, tags and description.\n * Any parameters left null in the request body are not updated.\n *\n * @param request - The request {@link UpdateServerRequest}\n * @returns A Promise of Server\n */\n updateServer = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateServerRequest$1(request, this.client.settings)),\n headers: jsonContentHeaders$p,\n method: 'PATCH',\n path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`\n }, unmarshalServer$1);\n\n /**\n * Install an Elastic Metal server. Install an Operating System (OS) on the\n * Elastic Metal server with a specific ID.\n *\n * @param request - The request {@link InstallServerRequest}\n * @returns A Promise of Server\n */\n installServer = request => this.client.fetch({\n body: JSON.stringify(marshalInstallServerRequest(request, this.client.settings)),\n headers: jsonContentHeaders$p,\n method: 'POST',\n path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/install`\n }, unmarshalServer$1);\n\n /**\n * Return server metrics. Get the ping status of the server associated with\n * the ID.\n *\n * @param request - The request {@link GetServerMetricsRequest}\n * @returns A Promise of GetServerMetricsResponse\n */\n getServerMetrics = request => this.client.fetch({\n method: 'GET',\n path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/metrics`\n }, unmarshalGetServerMetricsResponse);\n\n /**\n * Delete an Elastic Metal server. Delete the server associated with the ID.\n *\n * @param request - The request {@link DeleteServerRequest}\n * @returns A Promise of Server\n */\n deleteServer = request => this.client.fetch({\n method: 'DELETE',\n path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`\n }, unmarshalServer$1);\n\n /**\n * Reboot an Elastic Metal server. Reboot the Elastic Metal server associated\n * with the ID, use the `boot_type` `rescue` to reboot the server in rescue\n * mode.\n *\n * @param request - The request {@link RebootServerRequest}\n * @returns A Promise of Server\n */\n rebootServer = request => this.client.fetch({\n body: JSON.stringify(marshalRebootServerRequest(request, this.client.settings)),\n headers: jsonContentHeaders$p,\n method: 'POST',\n path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/reboot`\n }, unmarshalServer$1);\n\n /**\n * Start an Elastic Metal server. Start the server associated with the ID.\n *\n * @param request - The request {@link StartServerRequest}\n * @returns A Promise of Server\n */\n startServer = request => this.client.fetch({\n body: JSON.stringify(marshalStartServerRequest(request, this.client.settings)),\n headers: jsonContentHeaders$p,\n method: 'POST',\n path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/start`\n }, unmarshalServer$1);\n\n /**\n * Stop an Elastic Metal server. Stop the server associated with the ID. The\n * server remains allocated to your account and all data remains on the local\n * storage of the server.\n *\n * @param request - The request {@link StopServerRequest}\n * @returns A Promise of Server\n */\n stopServer = request => this.client.fetch({\n body: '{}',\n headers: jsonContentHeaders$p,\n method: 'POST',\n path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/stop`\n }, unmarshalServer$1);\n pageOfListServerEvents = request => this.client.fetch({\n method: 'GET',\n path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/events`,\n urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])\n }, unmarshalListServerEventsResponse);\n\n /**\n * List server events. List event (i.e. start/stop/reboot) associated to the\n * server ID.\n *\n * @param request - The request {@link ListServerEventsRequest}\n * @returns A Promise of ListServerEventsResponse\n */\n listServerEvents = request => enrichForPagination('events', this.pageOfListServerEvents, request);\n\n /**\n * Start BMC access. Start BMC (Baseboard Management Controller) access\n * associated with the ID. The BMC (Baseboard Management Controller) access is\n * available one hour after the installation of the server. You need first to\n * create an option Remote Access. You will find the ID and the price with a\n * call to listOffers\n * (https://developers.scaleway.com/en/products/baremetal/api/#get-78db92).\n * Then add the option\n * https://developers.scaleway.com/en/products/baremetal/api/#post-b14abd.\n * After adding the BMC option, you need to Get Remote Access to get the\n * login/password\n * https://developers.scaleway.com/en/products/baremetal/api/#get-cefc0f. Do\n * not forget to delete the Option after use.\n *\n * @param request - The request {@link StartBMCAccessRequest}\n * @returns A Promise of BMCAccess\n */\n startBMCAccess = request => this.client.fetch({\n body: JSON.stringify(marshalStartBMCAccessRequest(request, this.client.settings)),\n headers: jsonContentHeaders$p,\n method: 'POST',\n path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/bmc-access`\n }, unmarshalBMCAccess);\n\n /**\n * Get BMC access. Get the BMC (Baseboard Management Controller) access\n * associated with the ID, including the URL and login information needed to\n * connect.\n *\n * @param request - The request {@link GetBMCAccessRequest}\n * @returns A Promise of BMCAccess\n */\n getBMCAccess = request => this.client.fetch({\n method: 'GET',\n path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/bmc-access`\n }, unmarshalBMCAccess);\n\n /**\n * Stop BMC access. Stop BMC (Baseboard Management Controller) access\n * associated with the ID.\n *\n * @param request - The request {@link StopBMCAccessRequest}\n */\n stopBMCAccess = request => this.client.fetch({\n method: 'DELETE',\n path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/bmc-access`\n });\n\n /**\n * Update IP. Configure the IP address associated with the server ID and IP\n * ID. You can use this method to set a reverse DNS for an IP address.\n *\n * @param request - The request {@link UpdateIPRequest}\n * @returns A Promise of IP\n */\n updateIP = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateIPRequest$1(request, this.client.settings)),\n headers: jsonContentHeaders$p,\n method: 'PATCH',\n path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/ips/${validatePathParam('ipId', request.ipId)}`\n }, unmarshalIP$1);\n\n /**\n * Add server option. Add an option, such as Private Networks, to a specific\n * server.\n *\n * @param request - The request {@link AddOptionServerRequest}\n * @returns A Promise of Server\n */\n addOptionServer = request => this.client.fetch({\n body: JSON.stringify(marshalAddOptionServerRequest(request, this.client.settings)),\n headers: jsonContentHeaders$p,\n method: 'POST',\n path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/options/${validatePathParam('optionId', request.optionId)}`\n }, unmarshalServer$1);\n\n /**\n * Delete server option. Delete an option from a specific server.\n *\n * @param request - The request {@link DeleteOptionServerRequest}\n * @returns A Promise of Server\n */\n deleteOptionServer = request => this.client.fetch({\n method: 'DELETE',\n path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/options/${validatePathParam('optionId', request.optionId)}`\n }, unmarshalServer$1);\n pageOfListOffers = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/offers`,\n urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['subscription_period', request.subscriptionPeriod ?? 'unknown_subscription_period'])\n }, unmarshalListOffersResponse$1);\n\n /**\n * List offers. List all available Elastic Metal server configurations.\n *\n * @param request - The request {@link ListOffersRequest}\n * @returns A Promise of ListOffersResponse\n */\n listOffers = (request = {}) => enrichForPagination('offers', this.pageOfListOffers, request);\n\n /**\n * Get offer. Get details of an offer identified by its offer ID.\n *\n * @param request - The request {@link GetOfferRequest}\n * @returns A Promise of Offer\n */\n getOffer = request => this.client.fetch({\n method: 'GET',\n path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/offers/${validatePathParam('offerId', request.offerId)}`\n }, unmarshalOffer$1);\n\n /**\n * Get option. Return specific option for the ID.\n *\n * @param request - The request {@link GetOptionRequest}\n * @returns A Promise of Option\n */\n getOption = request => this.client.fetch({\n method: 'GET',\n path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/options/${validatePathParam('optionId', request.optionId)}`\n }, unmarshalOption);\n pageOfListOptions = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/options`,\n urlParams: urlParams(['name', request.name], ['offer_id', request.offerId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])\n }, unmarshalListOptionsResponse);\n\n /**\n * List options. List all options matching with filters.\n *\n * @param request - The request {@link ListOptionsRequest}\n * @returns A Promise of ListOptionsResponse\n */\n listOptions = (request = {}) => enrichForPagination('options', this.pageOfListOptions, request);\n pageOfListSettings = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/settings`,\n urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId ?? this.client.settings.defaultProjectId])\n }, unmarshalListSettingsResponse);\n\n /**\n * List all settings. Return all settings for a Project ID.\n *\n * @param request - The request {@link ListSettingsRequest}\n * @returns A Promise of ListSettingsResponse\n */\n listSettings = (request = {}) => enrichForPagination('settings', this.pageOfListSettings, request);\n\n /**\n * Update setting. Update a setting for a Project ID (enable or disable).\n *\n * @param request - The request {@link UpdateSettingRequest}\n * @returns A Promise of Setting\n */\n updateSetting = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateSettingRequest(request, this.client.settings)),\n headers: jsonContentHeaders$p,\n method: 'PATCH',\n path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/settings/${validatePathParam('settingId', request.settingId)}`\n }, unmarshalSetting);\n pageOfListOS = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/os`,\n urlParams: urlParams(['offer_id', request.offerId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])\n }, unmarshalListOSResponse);\n\n /**\n * List available OSes. List all OSes that are available for installation on\n * Elastic Metal servers.\n *\n * @param request - The request {@link ListOSRequest}\n * @returns A Promise of ListOSResponse\n */\n listOS = (request = {}) => enrichForPagination('os', this.pageOfListOS, request);\n\n /**\n * Get OS with an ID. Return the specific OS for the ID.\n *\n * @param request - The request {@link GetOSRequest}\n * @returns A Promise of OS\n */\n getOS = request => this.client.fetch({\n method: 'GET',\n path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/os/${validatePathParam('osId', request.osId)}`\n }, unmarshalOS);\n};\n\n/** Elastic Metal Private Network API. */\nclass PrivateNetworkAPI extends API$u {\n /** Lists the available zones of the API. */\n static LOCALITIES = ['fr-par-2'];\n\n /**\n * Add a server to a Private Network.\n *\n * @param request - The request\n * {@link PrivateNetworkApiAddServerPrivateNetworkRequest}\n * @returns A Promise of ServerPrivateNetwork\n */\n addServerPrivateNetwork = request => this.client.fetch({\n body: JSON.stringify(marshalPrivateNetworkApiAddServerPrivateNetworkRequest(request, this.client.settings)),\n headers: jsonContentHeaders$p,\n method: 'POST',\n path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/private-networks`\n }, unmarshalServerPrivateNetwork);\n\n /**\n * Set multiple Private Networks on a server.\n *\n * @param request - The request\n * {@link PrivateNetworkApiSetServerPrivateNetworksRequest}\n * @returns A Promise of SetServerPrivateNetworksResponse\n */\n setServerPrivateNetworks = request => this.client.fetch({\n body: JSON.stringify(marshalPrivateNetworkApiSetServerPrivateNetworksRequest(request, this.client.settings)),\n headers: jsonContentHeaders$p,\n method: 'PUT',\n path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/private-networks`\n }, unmarshalSetServerPrivateNetworksResponse);\n pageOfListServerPrivateNetworks = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/server-private-networks`,\n urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['private_network_id', request.privateNetworkId], ['project_id', request.projectId], ['server_id', request.serverId])\n }, unmarshalListServerPrivateNetworksResponse);\n\n /**\n * List the Private Networks of a server.\n *\n * @param request - The request\n * {@link PrivateNetworkApiListServerPrivateNetworksRequest}\n * @returns A Promise of ListServerPrivateNetworksResponse\n */\n listServerPrivateNetworks = (request = {}) => enrichForPagination('serverPrivateNetworks', this.pageOfListServerPrivateNetworks, request);\n\n /**\n * Delete a Private Network.\n *\n * @param request - The request\n * {@link PrivateNetworkApiDeleteServerPrivateNetworkRequest}\n */\n deleteServerPrivateNetwork = request => this.client.fetch({\n method: 'DELETE',\n path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}`\n });\n}\n\nclass BaremetalV1UtilsAPI extends API$r {\n /**\n * Waits for {@link ServerInstall} to be in a final state.\n *\n * @param request - The request {@link GetServerRequest}\n * @param options - The waiting options\n * @returns A Promise of ServerInstall\n */\n waitForServerInstall = (request, options) => tryAtIntervals(async () => {\n const value = await this.getServer(request).then(server => {\n if (!server.install) {\n throw new Error(`Server creation has not begun for server ${request.serverId}`);\n }\n return server.install;\n });\n return {\n done: !SERVER_INSTALL_TRANSIENT_STATUSES.includes(value.status),\n value\n };\n }, createExponentialBackoffStrategy(options?.minDelay ?? 1, options?.maxDelay ?? 30), options?.timeout);\n}\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\nconst CreateServerRequest = {\n description: {\n maxLength: 255\n },\n name: {\n minLength: 1\n }\n};\nconst CreateServerRequestInstall = {\n hostname: {\n maxLength: 255\n },\n password: {\n maxLength: 255\n },\n servicePassword: {\n maxLength: 255\n },\n serviceUser: {\n maxLength: 255\n },\n user: {\n maxLength: 255\n }\n};\nconst InstallServerRequest = {\n hostname: {\n maxLength: 255\n },\n password: {\n maxLength: 255\n },\n servicePassword: {\n maxLength: 255\n },\n serviceUser: {\n maxLength: 255\n },\n user: {\n maxLength: 255\n }\n};\nconst ListOSRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nconst ListOffersRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nconst ListOptionsRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nconst ListServerEventsRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nconst ListServersRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nconst ListSettingsRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nconst UpdateServerRequest = {\n description: {\n maxLength: 255\n },\n name: {\n maxLength: 255\n }\n};\n\nvar validationRules_gen$8 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n CreateServerRequest: CreateServerRequest,\n CreateServerRequestInstall: CreateServerRequestInstall,\n InstallServerRequest: InstallServerRequest,\n ListOSRequest: ListOSRequest,\n ListOffersRequest: ListOffersRequest,\n ListOptionsRequest: ListOptionsRequest,\n ListServerEventsRequest: ListServerEventsRequest,\n ListServersRequest: ListServersRequest,\n ListSettingsRequest: ListSettingsRequest,\n UpdateServerRequest: UpdateServerRequest\n});\n\nvar index$t = /*#__PURE__*/Object.freeze({\n __proto__: null,\n API: BaremetalV1UtilsAPI,\n PrivateNetworkAPI: PrivateNetworkAPI,\n SERVER_INSTALL_TRANSIENT_STATUSES: SERVER_INSTALL_TRANSIENT_STATUSES,\n SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES: SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES,\n SERVER_TRANSIENT_STATUSES: SERVER_TRANSIENT_STATUSES$1,\n ValidationRules: validationRules_gen$8\n});\n\nvar index$s = /*#__PURE__*/Object.freeze({\n __proto__: null,\n v1: index$t\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst unmarshalGetConsumptionResponseConsumption = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'GetConsumptionResponseConsumption' failed as data isn't a dictionary.`);\n }\n return {\n category: data.category,\n description: data.description,\n operationPath: data.operation_path,\n projectId: data.project_id,\n value: data.value ? unmarshalMoney(data.value) : undefined\n };\n};\nconst unmarshalInvoice = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Invoice' failed as data isn't a dictionary.`);\n }\n return {\n dueDate: unmarshalDate(data.due_date),\n id: data.id,\n invoiceType: data.invoice_type,\n issuedDate: unmarshalDate(data.issued_date),\n number: data.number,\n startDate: unmarshalDate(data.start_date),\n totalTaxed: data.total_taxed ? unmarshalMoney(data.total_taxed) : undefined,\n totalUntaxed: data.total_untaxed ? unmarshalMoney(data.total_untaxed) : undefined\n };\n};\nconst unmarshalGetConsumptionResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'GetConsumptionResponse' failed as data isn't a dictionary.`);\n }\n return {\n consumptions: unmarshalArrayOfObject(data.consumptions, unmarshalGetConsumptionResponseConsumption),\n updatedAt: unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalListInvoicesResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListInvoicesResponse' failed as data isn't a dictionary.`);\n }\n return {\n invoices: unmarshalArrayOfObject(data.invoices, unmarshalInvoice),\n totalCount: data.total_count\n };\n};\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n/**\n * Billing API.\n *\n * This API allows you to query your consumption. Billing API.\n */\nlet API$q = class API extends API$u {\n /**\n * Get current month's consumption. The consumption reflects the amount of\n * money you have spent for the products you have used. The consumption value\n * is monetary and is not computed in real time.\n *\n * @param request - The request {@link GetConsumptionRequest}\n * @returns A Promise of GetConsumptionResponse\n */\n getConsumption = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/billing/v2alpha1/consumption`,\n urlParams: urlParams(['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId])\n }, unmarshalGetConsumptionResponse);\n pageOfListInvoices = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/billing/v2alpha1/invoices`,\n urlParams: urlParams(['invoice_type', request.invoiceType ?? 'unknown_type'], ['order_by', request.orderBy ?? 'invoice_number_desc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['started_after', request.startedAfter], ['started_before', request.startedBefore])\n }, unmarshalListInvoicesResponse);\n\n /**\n * List invoices. List all your invoices, filtering by `start_date` and\n * `invoice_type`. Each invoice has its own ID.\n *\n * @param request - The request {@link ListInvoicesRequest}\n * @returns A Promise of ListInvoicesResponse\n */\n listInvoices = (request = {}) => enrichForPagination('invoices', this.pageOfListInvoices, request);\n\n /**\n * Download an invoice. Download a specific invoice, specified by its ID.\n *\n * @param request - The request {@link DownloadInvoiceRequest}\n * @returns A Promise of Blob\n */\n downloadInvoice = request => this.client.fetch({\n method: 'GET',\n path: `/billing/v2alpha1/invoices/${validatePathParam('invoiceId', request.invoiceId)}/download`,\n urlParams: urlParams(['dl', 1], ['file_type', request.fileType ?? 'pdf']),\n responseType: 'blob'\n });\n};\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\nvar index_gen$o = /*#__PURE__*/Object.freeze({\n __proto__: null,\n API: API$q\n});\n\nvar index$r = /*#__PURE__*/Object.freeze({\n __proto__: null,\n v2alpha1: index_gen$o\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\n/** Lists transient statutes of the enum {@link ReferenceStatus}. */\nconst REFERENCE_TRANSIENT_STATUSES = ['attaching', 'detaching', 'snapshotting'];\n\n/** Lists transient statutes of the enum {@link SnapshotStatus}. */\nconst SNAPSHOT_TRANSIENT_STATUSES$3 = ['creating', 'deleting'];\n\n/** Lists transient statutes of the enum {@link VolumeStatus}. */\nconst VOLUME_TRANSIENT_STATUSES$1 = ['creating', 'deleting', 'resizing', 'snapshotting'];\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst unmarshalReference = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Reference' failed as data isn't a dictionary.`);\n }\n return {\n createdAt: unmarshalDate(data.created_at),\n id: data.id,\n productResourceId: data.product_resource_id,\n productResourceType: data.product_resource_type,\n status: data.status,\n type: data.type\n };\n};\nconst unmarshalSnapshotParentVolume = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'SnapshotParentVolume' failed as data isn't a dictionary.`);\n }\n return {\n id: data.id,\n name: data.name,\n status: data.status,\n type: data.type\n };\n};\nconst unmarshalVolumeSpecifications = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'VolumeSpecifications' failed as data isn't a dictionary.`);\n }\n return {\n class: data.class,\n perfIops: data.perf_iops\n };\n};\nconst unmarshalSnapshotSummary = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'SnapshotSummary' failed as data isn't a dictionary.`);\n }\n return {\n class: data.class,\n createdAt: unmarshalDate(data.created_at),\n id: data.id,\n name: data.name,\n parentVolume: data.parent_volume ? unmarshalSnapshotParentVolume(data.parent_volume) : undefined,\n projectId: data.project_id,\n size: data.size,\n status: data.status,\n tags: data.tags,\n updatedAt: unmarshalDate(data.updated_at),\n zone: data.zone\n };\n};\nconst unmarshalVolume$4 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Volume' failed as data isn't a dictionary.`);\n }\n return {\n createdAt: unmarshalDate(data.created_at),\n id: data.id,\n name: data.name,\n parentSnapshotId: data.parent_snapshot_id,\n projectId: data.project_id,\n references: unmarshalArrayOfObject(data.references, unmarshalReference),\n size: data.size,\n specs: data.specs ? unmarshalVolumeSpecifications(data.specs) : undefined,\n status: data.status,\n tags: data.tags,\n type: data.type,\n updatedAt: unmarshalDate(data.updated_at),\n zone: data.zone\n };\n};\nconst unmarshalVolumeType$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'VolumeType' failed as data isn't a dictionary.`);\n }\n return {\n pricing: data.pricing ? unmarshalMoney(data.pricing) : undefined,\n snapshotPricing: data.snapshot_pricing ? unmarshalMoney(data.snapshot_pricing) : undefined,\n specs: data.specs ? unmarshalVolumeSpecifications(data.specs) : undefined,\n type: data.type\n };\n};\nconst unmarshalListSnapshotsResponse$3 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListSnapshotsResponse' failed as data isn't a dictionary.`);\n }\n return {\n snapshots: unmarshalArrayOfObject(data.snapshots, unmarshalSnapshotSummary),\n totalCount: data.total_count\n };\n};\nconst unmarshalListVolumeTypesResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListVolumeTypesResponse' failed as data isn't a dictionary.`);\n }\n return {\n totalCount: data.total_count,\n volumeTypes: unmarshalArrayOfObject(data.volume_types, unmarshalVolumeType$1)\n };\n};\nconst unmarshalListVolumesResponse$2 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListVolumesResponse' failed as data isn't a dictionary.`);\n }\n return {\n totalCount: data.total_count,\n volumes: unmarshalArrayOfObject(data.volumes, unmarshalVolume$4)\n };\n};\nconst unmarshalSnapshot$3 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Snapshot' failed as data isn't a dictionary.`);\n }\n return {\n class: data.class,\n createdAt: unmarshalDate(data.created_at),\n id: data.id,\n name: data.name,\n parentVolume: data.parent_volume ? unmarshalSnapshotParentVolume(data.parent_volume) : undefined,\n projectId: data.project_id,\n references: unmarshalArrayOfObject(data.references, unmarshalReference),\n size: data.size,\n status: data.status,\n tags: data.tags,\n updatedAt: unmarshalDate(data.updated_at),\n zone: data.zone\n };\n};\nconst marshalCreateVolumeRequestFromEmpty = (request, defaults) => ({\n size: request.size\n});\nconst marshalCreateVolumeRequestFromSnapshot = (request, defaults) => ({\n size: request.size,\n snapshot_id: request.snapshotId\n});\nconst marshalCreateSnapshotRequest$3 = (request, defaults) => ({\n name: request.name,\n project_id: request.projectId ?? defaults.defaultProjectId,\n tags: request.tags,\n volume_id: request.volumeId\n});\nconst marshalCreateVolumeRequest$2 = (request, defaults) => ({\n name: request.name,\n project_id: request.projectId ?? defaults.defaultProjectId,\n tags: request.tags,\n ...resolveOneOf([{\n param: 'from_empty',\n value: request.fromEmpty ? marshalCreateVolumeRequestFromEmpty(request.fromEmpty) : undefined\n }, {\n param: 'from_snapshot',\n value: request.fromSnapshot ? marshalCreateVolumeRequestFromSnapshot(request.fromSnapshot) : undefined\n }]),\n ...resolveOneOf([{\n param: 'perf_iops',\n value: request.perfIops\n }], true)\n});\nconst marshalImportSnapshotFromS3Request = (request, defaults) => ({\n bucket: request.bucket,\n key: request.key,\n name: request.name,\n project_id: request.projectId ?? defaults.defaultProjectId,\n tags: request.tags\n});\nconst marshalUpdateSnapshotRequest$2 = (request, defaults) => ({\n name: request.name,\n tags: request.tags\n});\nconst marshalUpdateVolumeRequest$2 = (request, defaults) => ({\n name: request.name,\n perf_iops: request.perfIops,\n size: request.size,\n tags: request.tags\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst jsonContentHeaders$o = {\n 'Content-Type': 'application/json; charset=utf-8'\n};\n\n/**\n * Scaleway Block Storage API.\n *\n * This API allows you to use and manage your Block Storage volumes. Scaleway\n * Block Storage API.\n */\nlet API$p = class API extends API$u {\n /** Lists the available zones of the API. */\n static LOCALITIES = ['fr-par-1', 'pl-waw-3'];\n pageOfListVolumeTypes = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/volume-types`,\n urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])\n }, unmarshalListVolumeTypesResponse);\n\n /**\n * List volume types. List all available volume types in a specified zone. The\n * volume types listed are ordered by name in ascending order.\n *\n * @param request - The request {@link ListVolumeTypesRequest}\n * @returns A Promise of ListVolumeTypesResponse\n */\n listVolumeTypes = (request = {}) => enrichForPagination('volumeTypes', this.pageOfListVolumeTypes, request);\n pageOfListVolumes = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/volumes`,\n urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['product_resource_id', request.productResourceId], ['project_id', request.projectId])\n }, unmarshalListVolumesResponse$2);\n\n /**\n * List volumes. List all existing volumes in a specified zone. By default,\n * the volumes listed are ordered by creation date in ascending order. This\n * can be modified via the `order_by` field.\n *\n * @param request - The request {@link ListVolumesRequest}\n * @returns A Promise of ListVolumesResponse\n */\n listVolumes = (request = {}) => enrichForPagination('volumes', this.pageOfListVolumes, request);\n\n /**\n * Create a volume. To create a new volume from scratch, you must specify\n * `from_empty` and the `size`. To create a volume from an existing snapshot,\n * specify `from_snapshot` and the `snapshot_id` in the request payload\n * instead, size is optional and can be specified if you need to extend the\n * original size. The volume will take on the same volume class and underlying\n * IOPS limitations as the original snapshot.\n *\n * @param request - The request {@link CreateVolumeRequest}\n * @returns A Promise of Volume\n */\n createVolume = request => this.client.fetch({\n body: JSON.stringify(marshalCreateVolumeRequest$2(request, this.client.settings)),\n headers: jsonContentHeaders$o,\n method: 'POST',\n path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/volumes`\n }, unmarshalVolume$4);\n\n /**\n * Get a volume. Retrieve technical information about a specific volume.\n * Details such as size, type, and status are returned in the response.\n *\n * @param request - The request {@link GetVolumeRequest}\n * @returns A Promise of Volume\n */\n getVolume = request => this.client.fetch({\n method: 'GET',\n path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/volumes/${validatePathParam('volumeId', request.volumeId)}`\n }, unmarshalVolume$4);\n\n /**\n * Waits for {@link Volume} to be in a final state.\n *\n * @param request - The request {@link GetVolumeRequest}\n * @param options - The waiting options\n * @returns A Promise of Volume\n */\n waitForVolume = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!VOLUME_TRANSIENT_STATUSES$1.includes(res.status))), this.getVolume, request, options);\n\n /**\n * Delete a detached volume. You must specify the `volume_id` of the volume\n * you want to delete. The volume must not be in the `in_use` status.\n *\n * @param request - The request {@link DeleteVolumeRequest}\n */\n deleteVolume = request => this.client.fetch({\n method: 'DELETE',\n path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/volumes/${validatePathParam('volumeId', request.volumeId)}`\n });\n\n /**\n * Update a volume. Update the technical details of a volume, such as its\n * name, tags, or its new size and `volume_type` (within the same Block\n * Storage class). You can only resize a volume to a larger size. It is\n * currently not possible to change your Block Storage Class.\n *\n * @param request - The request {@link UpdateVolumeRequest}\n * @returns A Promise of Volume\n */\n updateVolume = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateVolumeRequest$2(request, this.client.settings)),\n headers: jsonContentHeaders$o,\n method: 'PATCH',\n path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/volumes/${validatePathParam('volumeId', request.volumeId)}`\n }, unmarshalVolume$4);\n pageOfListSnapshots = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/snapshots`,\n urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId], ['volume_id', request.volumeId])\n }, unmarshalListSnapshotsResponse$3);\n\n /**\n * List all snapshots. List all available snapshots in a specified zone. By\n * default, the snapshots listed are ordered by creation date in ascending\n * order. This can be modified via the `order_by` field.\n *\n * @param request - The request {@link ListSnapshotsRequest}\n * @returns A Promise of ListSnapshotsResponse\n */\n listSnapshots = (request = {}) => enrichForPagination('snapshots', this.pageOfListSnapshots, request);\n\n /**\n * Get a snapshot. Retrieve technical information about a specific snapshot.\n * Details such as size, volume type, and status are returned in the\n * response.\n *\n * @param request - The request {@link GetSnapshotRequest}\n * @returns A Promise of Snapshot\n */\n getSnapshot = request => this.client.fetch({\n method: 'GET',\n path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam('snapshotId', request.snapshotId)}`\n }, unmarshalSnapshot$3);\n\n /**\n * Waits for {@link Snapshot} to be in a final state.\n *\n * @param request - The request {@link GetSnapshotRequest}\n * @param options - The waiting options\n * @returns A Promise of Snapshot\n */\n waitForSnapshot = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!SNAPSHOT_TRANSIENT_STATUSES$3.includes(res.status))), this.getSnapshot, request, options);\n\n /**\n * Create a snapshot of a volume. To create a snapshot, the volume must be in\n * the `in_use` or the `available` status. If your volume is in a transient\n * state, you need to wait until the end of the current operation.\n *\n * @param request - The request {@link CreateSnapshotRequest}\n * @returns A Promise of Snapshot\n */\n createSnapshot = request => this.client.fetch({\n body: JSON.stringify(marshalCreateSnapshotRequest$3(request, this.client.settings)),\n headers: jsonContentHeaders$o,\n method: 'POST',\n path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/snapshots`\n }, unmarshalSnapshot$3);\n importSnapshotFromS3 = request => this.client.fetch({\n body: JSON.stringify(marshalImportSnapshotFromS3Request(request, this.client.settings)),\n headers: jsonContentHeaders$o,\n method: 'POST',\n path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/snapshots/import-from-s3`\n }, unmarshalSnapshot$3);\n\n /**\n * Delete a snapshot. You must specify the `snapshot_id` of the snapshot you\n * want to delete. The snapshot must not be in use.\n *\n * @param request - The request {@link DeleteSnapshotRequest}\n */\n deleteSnapshot = request => this.client.fetch({\n method: 'DELETE',\n path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam('snapshotId', request.snapshotId)}`\n });\n\n /**\n * Update a snapshot. Update the name or tags of the snapshot.\n *\n * @param request - The request {@link UpdateSnapshotRequest}\n * @returns A Promise of Snapshot\n */\n updateSnapshot = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateSnapshotRequest$2(request, this.client.settings)),\n headers: jsonContentHeaders$o,\n method: 'PATCH',\n path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam('snapshotId', request.snapshotId)}`\n }, unmarshalSnapshot$3);\n};\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\nconst CreateSnapshotRequest = {\n name: {\n minLength: 1\n }\n};\nconst CreateVolumeRequest = {\n name: {\n minLength: 1\n }\n};\nconst ImportSnapshotFromS3Request = {\n name: {\n minLength: 1\n }\n};\nconst ListSnapshotsRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nconst ListVolumeTypesRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nconst ListVolumesRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\n\nvar validationRules_gen$7 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n CreateSnapshotRequest: CreateSnapshotRequest,\n CreateVolumeRequest: CreateVolumeRequest,\n ImportSnapshotFromS3Request: ImportSnapshotFromS3Request,\n ListSnapshotsRequest: ListSnapshotsRequest,\n ListVolumeTypesRequest: ListVolumeTypesRequest,\n ListVolumesRequest: ListVolumesRequest\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\nvar index_gen$n = /*#__PURE__*/Object.freeze({\n __proto__: null,\n API: API$p,\n REFERENCE_TRANSIENT_STATUSES: REFERENCE_TRANSIENT_STATUSES,\n SNAPSHOT_TRANSIENT_STATUSES: SNAPSHOT_TRANSIENT_STATUSES$3,\n VOLUME_TRANSIENT_STATUSES: VOLUME_TRANSIENT_STATUSES$1,\n ValidationRules: validationRules_gen$7\n});\n\nvar index$q = /*#__PURE__*/Object.freeze({\n __proto__: null,\n v1alpha1: index_gen$n\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\n/** Lists transient statutes of the enum {@link CockpitStatus}. */\nconst COCKPIT_TRANSIENT_STATUSES = ['creating', 'deleting', 'updating'];\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst unmarshalContactPointEmail = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ContactPointEmail' failed as data isn't a dictionary.`);\n }\n return {\n to: data.to\n };\n};\nconst unmarshalTokenScopes = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'TokenScopes' failed as data isn't a dictionary.`);\n }\n return {\n queryLogs: data.query_logs,\n queryMetrics: data.query_metrics,\n queryTraces: data.query_traces,\n setupAlerts: data.setup_alerts,\n setupLogsRules: data.setup_logs_rules,\n setupMetricsRules: data.setup_metrics_rules,\n writeLogs: data.write_logs,\n writeMetrics: data.write_metrics,\n writeTraces: data.write_traces\n };\n};\nconst unmarshalCockpitEndpoints = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'CockpitEndpoints' failed as data isn't a dictionary.`);\n }\n return {\n alertmanagerUrl: data.alertmanager_url,\n grafanaUrl: data.grafana_url,\n logsUrl: data.logs_url,\n metricsUrl: data.metrics_url\n };\n};\nconst unmarshalContactPoint = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ContactPoint' failed as data isn't a dictionary.`);\n }\n return {\n email: data.email ? unmarshalContactPointEmail(data.email) : undefined\n };\n};\nconst unmarshalDatasource = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Datasource' failed as data isn't a dictionary.`);\n }\n return {\n id: data.id,\n name: data.name,\n projectId: data.project_id,\n type: data.type,\n url: data.url\n };\n};\nconst unmarshalGrafanaProductDashboard = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'GrafanaProductDashboard' failed as data isn't a dictionary.`);\n }\n return {\n dashboardName: data.dashboard_name,\n tags: data.tags,\n title: data.title,\n url: data.url,\n variables: data.variables\n };\n};\nconst unmarshalGrafanaUser = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'GrafanaUser' failed as data isn't a dictionary.`);\n }\n return {\n id: data.id,\n login: data.login,\n password: data.password,\n role: data.role\n };\n};\nconst unmarshalPlan = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Plan' failed as data isn't a dictionary.`);\n }\n return {\n id: data.id,\n logsIngestionPrice: data.logs_ingestion_price,\n name: data.name,\n retentionLogsInterval: data.retention_logs_interval,\n retentionMetricsInterval: data.retention_metrics_interval,\n retentionPrice: data.retention_price,\n sampleIngestionPrice: data.sample_ingestion_price\n };\n};\nconst unmarshalToken$2 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Token' failed as data isn't a dictionary.`);\n }\n return {\n createdAt: unmarshalDate(data.created_at),\n id: data.id,\n name: data.name,\n projectId: data.project_id,\n scopes: data.scopes ? unmarshalTokenScopes(data.scopes) : undefined,\n secretKey: data.secret_key,\n updatedAt: unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalCockpit = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Cockpit' failed as data isn't a dictionary.`);\n }\n return {\n createdAt: unmarshalDate(data.created_at),\n endpoints: data.endpoints ? unmarshalCockpitEndpoints(data.endpoints) : undefined,\n managedAlertsEnabled: data.managed_alerts_enabled,\n plan: data.plan ? unmarshalPlan(data.plan) : undefined,\n projectId: data.project_id,\n status: data.status,\n updatedAt: unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalCockpitMetrics = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'CockpitMetrics' failed as data isn't a dictionary.`);\n }\n return {\n timeseries: unmarshalArrayOfObject(data.timeseries, unmarshalTimeSeries)\n };\n};\nconst unmarshalListContactPointsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListContactPointsResponse' failed as data isn't a dictionary.`);\n }\n return {\n contactPoints: unmarshalArrayOfObject(data.contact_points, unmarshalContactPoint),\n hasAdditionalContactPoints: data.has_additional_contact_points,\n hasAdditionalReceivers: data.has_additional_receivers,\n totalCount: data.total_count\n };\n};\nconst unmarshalListDatasourcesResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListDatasourcesResponse' failed as data isn't a dictionary.`);\n }\n return {\n datasources: unmarshalArrayOfObject(data.datasources, unmarshalDatasource),\n totalCount: data.total_count\n };\n};\nconst unmarshalListGrafanaProductDashboardsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListGrafanaProductDashboardsResponse' failed as data isn't a dictionary.`);\n }\n return {\n dashboards: unmarshalArrayOfObject(data.dashboards, unmarshalGrafanaProductDashboard),\n totalCount: data.total_count\n };\n};\nconst unmarshalListGrafanaUsersResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListGrafanaUsersResponse' failed as data isn't a dictionary.`);\n }\n return {\n grafanaUsers: unmarshalArrayOfObject(data.grafana_users, unmarshalGrafanaUser),\n totalCount: data.total_count\n };\n};\nconst unmarshalListPlansResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListPlansResponse' failed as data isn't a dictionary.`);\n }\n return {\n plans: unmarshalArrayOfObject(data.plans, unmarshalPlan),\n totalCount: data.total_count\n };\n};\nconst unmarshalListTokensResponse$2 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListTokensResponse' failed as data isn't a dictionary.`);\n }\n return {\n tokens: unmarshalArrayOfObject(data.tokens, unmarshalToken$2),\n totalCount: data.total_count\n };\n};\nconst unmarshalSelectPlanResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'SelectPlanResponse' failed as data isn't a dictionary.`);\n }\n return {};\n};\nconst marshalContactPointEmail = (request, defaults) => ({\n to: request.to\n});\nconst marshalContactPoint = (request, defaults) => ({\n ...resolveOneOf([{\n param: 'email',\n value: request.email ? marshalContactPointEmail(request.email) : undefined\n }])\n});\nconst marshalTokenScopes = (request, defaults) => ({\n query_logs: request.queryLogs,\n query_metrics: request.queryMetrics,\n query_traces: request.queryTraces,\n setup_alerts: request.setupAlerts,\n setup_logs_rules: request.setupLogsRules,\n setup_metrics_rules: request.setupMetricsRules,\n write_logs: request.writeLogs,\n write_metrics: request.writeMetrics,\n write_traces: request.writeTraces\n});\nconst marshalActivateCockpitRequest = (request, defaults) => ({\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalCreateContactPointRequest = (request, defaults) => ({\n contact_point: request.contactPoint ? marshalContactPoint(request.contactPoint) : undefined,\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalCreateDatasourceRequest = (request, defaults) => ({\n name: request.name,\n project_id: request.projectId ?? defaults.defaultProjectId,\n type: request.type ?? 'unknown_datasource_type'\n});\nconst marshalCreateGrafanaUserRequest = (request, defaults) => ({\n login: request.login,\n project_id: request.projectId ?? defaults.defaultProjectId,\n role: request.role ?? 'unknown_role'\n});\nconst marshalCreateTokenRequest$2 = (request, defaults) => ({\n name: request.name || randomName('token'),\n project_id: request.projectId ?? defaults.defaultProjectId,\n scopes: request.scopes ? marshalTokenScopes(request.scopes) : undefined\n});\nconst marshalDeactivateCockpitRequest = (request, defaults) => ({\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalDeleteContactPointRequest = (request, defaults) => ({\n contact_point: request.contactPoint ? marshalContactPoint(request.contactPoint) : undefined,\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalDeleteGrafanaUserRequest = (request, defaults) => ({\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalDisableManagedAlertsRequest = (request, defaults) => ({\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalEnableManagedAlertsRequest = (request, defaults) => ({\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalResetCockpitGrafanaRequest = (request, defaults) => ({\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalResetGrafanaUserPasswordRequest = (request, defaults) => ({\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalSelectPlanRequest = (request, defaults) => ({\n plan_id: request.planId,\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalTriggerTestAlertRequest = (request, defaults) => ({\n project_id: request.projectId ?? defaults.defaultProjectId\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst jsonContentHeaders$n = {\n 'Content-Type': 'application/json; charset=utf-8'\n};\n\n/**\n * Cockpit API.\n *\n * Cockpit's API allows you to activate your Cockpit on your Projects.\n * Scaleway's Cockpit stores metrics and logs and provides a dedicated Grafana\n * for dashboarding to visualize them. Cockpit API.\n */\nlet API$o = class API extends API$u {\n /**\n * Activate the Cockpit of the specified Project ID.\n *\n * @param request - The request {@link ActivateCockpitRequest}\n * @returns A Promise of Cockpit\n */\n activateCockpit = (request = {}) => this.client.fetch({\n body: JSON.stringify(marshalActivateCockpitRequest(request, this.client.settings)),\n headers: jsonContentHeaders$n,\n method: 'POST',\n path: `/cockpit/v1beta1/activate`\n }, unmarshalCockpit);\n\n /**\n * Retrieve the Cockpit of the specified Project ID.\n *\n * @param request - The request {@link GetCockpitRequest}\n * @returns A Promise of Cockpit\n */\n getCockpit = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/cockpit/v1beta1/cockpit`,\n urlParams: urlParams(['project_id', request.projectId ?? this.client.settings.defaultProjectId])\n }, unmarshalCockpit);\n\n /**\n * Waits for {@link Cockpit} to be in a final state.\n *\n * @param request - The request {@link GetCockpitRequest}\n * @param options - The waiting options\n * @returns A Promise of Cockpit\n */\n waitForCockpit = (request = {}, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!COCKPIT_TRANSIENT_STATUSES.includes(res.status))), this.getCockpit, request, options);\n\n /**\n * Get metrics from your Cockpit with the specified Project ID.\n *\n * @param request - The request {@link GetCockpitMetricsRequest}\n * @returns A Promise of CockpitMetrics\n */\n getCockpitMetrics = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/cockpit/v1beta1/cockpit/metrics`,\n urlParams: urlParams(['end_date', request.endDate], ['metric_name', request.metricName], ['project_id', request.projectId ?? this.client.settings.defaultProjectId], ['start_date', request.startDate])\n }, unmarshalCockpitMetrics);\n\n /**\n * Deactivate the Cockpit of the specified Project ID.\n *\n * @param request - The request {@link DeactivateCockpitRequest}\n * @returns A Promise of Cockpit\n */\n deactivateCockpit = (request = {}) => this.client.fetch({\n body: JSON.stringify(marshalDeactivateCockpitRequest(request, this.client.settings)),\n headers: jsonContentHeaders$n,\n method: 'POST',\n path: `/cockpit/v1beta1/deactivate`\n }, unmarshalCockpit);\n\n /**\n * Reset your Cockpit's Grafana associated with the specified Project ID.\n *\n * @param request - The request {@link ResetCockpitGrafanaRequest}\n * @returns A Promise of Cockpit\n */\n resetCockpitGrafana = (request = {}) => this.client.fetch({\n body: JSON.stringify(marshalResetCockpitGrafanaRequest(request, this.client.settings)),\n headers: jsonContentHeaders$n,\n method: 'POST',\n path: `/cockpit/v1beta1/reset-grafana`\n }, unmarshalCockpit);\n\n /**\n * Create a datasource for the specified Project ID and the given type.\n *\n * @param request - The request {@link CreateDatasourceRequest}\n * @returns A Promise of Datasource\n */\n createDatasource = request => this.client.fetch({\n body: JSON.stringify(marshalCreateDatasourceRequest(request, this.client.settings)),\n headers: jsonContentHeaders$n,\n method: 'POST',\n path: `/cockpit/v1beta1/datasources`\n }, unmarshalDatasource);\n pageOfListDatasources = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/cockpit/v1beta1/datasources`,\n urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId ?? this.client.settings.defaultProjectId], ['types', request.types])\n }, unmarshalListDatasourcesResponse);\n\n /**\n * Get a list of datasources for the specified Project ID.\n *\n * @param request - The request {@link ListDatasourcesRequest}\n * @returns A Promise of ListDatasourcesResponse\n */\n listDatasources = (request = {}) => enrichForPagination('datasources', this.pageOfListDatasources, request);\n\n /**\n * Create a token associated with the specified Project ID.\n *\n * @param request - The request {@link CreateTokenRequest}\n * @returns A Promise of Token\n */\n createToken = (request = {}) => this.client.fetch({\n body: JSON.stringify(marshalCreateTokenRequest$2(request, this.client.settings)),\n headers: jsonContentHeaders$n,\n method: 'POST',\n path: `/cockpit/v1beta1/tokens`\n }, unmarshalToken$2);\n pageOfListTokens = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/cockpit/v1beta1/tokens`,\n urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId ?? this.client.settings.defaultProjectId])\n }, unmarshalListTokensResponse$2);\n\n /**\n * Get a list of tokens associated with the specified Project ID.\n *\n * @param request - The request {@link ListTokensRequest}\n * @returns A Promise of ListTokensResponse\n */\n listTokens = (request = {}) => enrichForPagination('tokens', this.pageOfListTokens, request);\n\n /**\n * Retrieve the token associated with the specified token ID.\n *\n * @param request - The request {@link GetTokenRequest}\n * @returns A Promise of Token\n */\n getToken = request => this.client.fetch({\n method: 'GET',\n path: `/cockpit/v1beta1/tokens/${validatePathParam('tokenId', request.tokenId)}`\n }, unmarshalToken$2);\n\n /**\n * Delete the token associated with the specified token ID.\n *\n * @param request - The request {@link DeleteTokenRequest}\n */\n deleteToken = request => this.client.fetch({\n method: 'DELETE',\n path: `/cockpit/v1beta1/tokens/${validatePathParam('tokenId', request.tokenId)}`\n });\n\n /**\n * Create a contact point to receive alerts for the default receiver.\n *\n * @param request - The request {@link CreateContactPointRequest}\n * @returns A Promise of ContactPoint\n */\n createContactPoint = (request = {}) => this.client.fetch({\n body: JSON.stringify(marshalCreateContactPointRequest(request, this.client.settings)),\n headers: jsonContentHeaders$n,\n method: 'POST',\n path: `/cockpit/v1beta1/contact-points`\n }, unmarshalContactPoint);\n pageOfListContactPoints = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/cockpit/v1beta1/contact-points`,\n urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId ?? this.client.settings.defaultProjectId])\n }, unmarshalListContactPointsResponse);\n\n /**\n * Get a list of contact points for the Cockpit associated with the specified\n * Project ID.\n *\n * @param request - The request {@link ListContactPointsRequest}\n * @returns A Promise of ListContactPointsResponse\n */\n listContactPoints = (request = {}) => enrichForPagination('contactPoints', this.pageOfListContactPoints, request);\n\n /**\n * Delete a contact point for the default receiver.\n *\n * @param request - The request {@link DeleteContactPointRequest}\n */\n deleteContactPoint = (request = {}) => this.client.fetch({\n body: JSON.stringify(marshalDeleteContactPointRequest(request, this.client.settings)),\n headers: jsonContentHeaders$n,\n method: 'POST',\n path: `/cockpit/v1beta1/delete-contact-point`\n });\n\n /**\n * Enable the sending of managed alerts for the specified Project's Cockpit.\n *\n * @param request - The request {@link EnableManagedAlertsRequest}\n */\n enableManagedAlerts = (request = {}) => this.client.fetch({\n body: JSON.stringify(marshalEnableManagedAlertsRequest(request, this.client.settings)),\n headers: jsonContentHeaders$n,\n method: 'POST',\n path: `/cockpit/v1beta1/enable-managed-alerts`\n });\n\n /**\n * Disable the sending of managed alerts for the specified Project's Cockpit.\n *\n * @param request - The request {@link DisableManagedAlertsRequest}\n */\n disableManagedAlerts = (request = {}) => this.client.fetch({\n body: JSON.stringify(marshalDisableManagedAlertsRequest(request, this.client.settings)),\n headers: jsonContentHeaders$n,\n method: 'POST',\n path: `/cockpit/v1beta1/disable-managed-alerts`\n });\n\n /**\n * Trigger a test alert to all of the Cockpit's receivers.\n *\n * @param request - The request {@link TriggerTestAlertRequest}\n */\n triggerTestAlert = (request = {}) => this.client.fetch({\n body: JSON.stringify(marshalTriggerTestAlertRequest(request, this.client.settings)),\n headers: jsonContentHeaders$n,\n method: 'POST',\n path: `/cockpit/v1beta1/trigger-test-alert`\n });\n\n /**\n * Create a Grafana user for your Cockpit's Grafana instance. Make sure you\n * save the automatically-generated password and the Grafana user ID.\n *\n * @param request - The request {@link CreateGrafanaUserRequest}\n * @returns A Promise of GrafanaUser\n */\n createGrafanaUser = request => this.client.fetch({\n body: JSON.stringify(marshalCreateGrafanaUserRequest(request, this.client.settings)),\n headers: jsonContentHeaders$n,\n method: 'POST',\n path: `/cockpit/v1beta1/grafana-users`\n }, unmarshalGrafanaUser);\n pageOfListGrafanaUsers = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/cockpit/v1beta1/grafana-users`,\n urlParams: urlParams(['order_by', request.orderBy ?? 'login_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId ?? this.client.settings.defaultProjectId])\n }, unmarshalListGrafanaUsersResponse);\n\n /**\n * Get a list of Grafana users who are able to connect to the Cockpit's\n * Grafana instance.\n *\n * @param request - The request {@link ListGrafanaUsersRequest}\n * @returns A Promise of ListGrafanaUsersResponse\n */\n listGrafanaUsers = (request = {}) => enrichForPagination('grafanaUsers', this.pageOfListGrafanaUsers, request);\n\n /**\n * Delete a Grafana user from a Grafana instance, specified by the Cockpit's\n * Project ID and the Grafana user ID.\n *\n * @param request - The request {@link DeleteGrafanaUserRequest}\n */\n deleteGrafanaUser = request => this.client.fetch({\n body: JSON.stringify(marshalDeleteGrafanaUserRequest(request, this.client.settings)),\n headers: jsonContentHeaders$n,\n method: 'POST',\n path: `/cockpit/v1beta1/grafana-users/${validatePathParam('grafanaUserId', request.grafanaUserId)}/delete`\n });\n\n /**\n * Reset a Grafana user's password specified by the Cockpit's Project ID and\n * the Grafana user ID.\n *\n * @param request - The request {@link ResetGrafanaUserPasswordRequest}\n * @returns A Promise of GrafanaUser\n */\n resetGrafanaUserPassword = request => this.client.fetch({\n body: JSON.stringify(marshalResetGrafanaUserPasswordRequest(request, this.client.settings)),\n headers: jsonContentHeaders$n,\n method: 'POST',\n path: `/cockpit/v1beta1/grafana-users/${validatePathParam('grafanaUserId', request.grafanaUserId)}/reset-password`\n }, unmarshalGrafanaUser);\n pageOfListPlans = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/cockpit/v1beta1/plans`,\n urlParams: urlParams(['order_by', request.orderBy ?? 'name_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])\n }, unmarshalListPlansResponse);\n\n /**\n * Get a list of all pricing plans available.\n *\n * @param request - The request {@link ListPlansRequest}\n * @returns A Promise of ListPlansResponse\n */\n listPlans = (request = {}) => enrichForPagination('plans', this.pageOfListPlans, request);\n\n /**\n * Select your chosen pricing plan for your Cockpit, specifying the Cockpit's\n * Project ID and the pricing plan's ID in the request.\n *\n * @param request - The request {@link SelectPlanRequest}\n * @returns A Promise of SelectPlanResponse\n */\n selectPlan = request => this.client.fetch({\n body: JSON.stringify(marshalSelectPlanRequest(request, this.client.settings)),\n headers: jsonContentHeaders$n,\n method: 'POST',\n path: `/cockpit/v1beta1/select-plan`\n }, unmarshalSelectPlanResponse);\n pageOfListGrafanaProductDashboards = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/cockpit/v1beta1/grafana-product-dashboards`,\n urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId ?? this.client.settings.defaultProjectId], ['tags', request.tags])\n }, unmarshalListGrafanaProductDashboardsResponse);\n\n /**\n * List product dashboards. Get a list of available product dashboards.\n *\n * @param request - The request {@link ListGrafanaProductDashboardsRequest}\n * @returns A Promise of ListGrafanaProductDashboardsResponse\n */\n listGrafanaProductDashboards = (request = {}) => enrichForPagination('dashboards', this.pageOfListGrafanaProductDashboards, request);\n\n /**\n * Get a product dashboard. Get a product dashboard specified by the dashboard\n * ID.\n *\n * @param request - The request {@link GetGrafanaProductDashboardRequest}\n * @returns A Promise of GrafanaProductDashboard\n */\n getGrafanaProductDashboard = request => this.client.fetch({\n method: 'GET',\n path: `/cockpit/v1beta1/grafana-product-dashboards/${validatePathParam('dashboardName', request.dashboardName)}`,\n urlParams: urlParams(['project_id', request.projectId ?? this.client.settings.defaultProjectId])\n }, unmarshalGrafanaProductDashboard);\n};\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\nvar index_gen$m = /*#__PURE__*/Object.freeze({\n __proto__: null,\n API: API$o,\n COCKPIT_TRANSIENT_STATUSES: COCKPIT_TRANSIENT_STATUSES\n});\n\nvar index$p = /*#__PURE__*/Object.freeze({\n __proto__: null,\n v1beta1: index_gen$m\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\n/** Lists transient statutes of the enum {@link ContainerStatus}. */\nconst CONTAINER_TRANSIENT_STATUSES = ['deleting', 'creating', 'pending'];\n\n/** Lists transient statutes of the enum {@link CronStatus}. */\nconst CRON_TRANSIENT_STATUSES$1 = ['deleting', 'creating', 'pending'];\n\n/** Lists transient statutes of the enum {@link DomainStatus}. */\nconst DOMAIN_TRANSIENT_STATUSES$3 = ['deleting', 'creating', 'pending'];\n\n/** Lists transient statutes of the enum {@link NamespaceStatus}. */\nconst NAMESPACE_TRANSIENT_STATUSES$2 = ['deleting', 'creating', 'pending'];\n\n/** Lists transient statutes of the enum {@link TokenStatus}. */\nconst TOKEN_TRANSIENT_STATUSES$1 = ['deleting', 'creating'];\n\n/** Lists transient statutes of the enum {@link TriggerStatus}. */\nconst TRIGGER_TRANSIENT_STATUSES$1 = ['deleting', 'creating', 'pending'];\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst unmarshalSecretHashedValue$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'SecretHashedValue' failed as data isn't a dictionary.`);\n }\n return {\n hashedValue: data.hashed_value,\n key: data.key\n };\n};\nconst unmarshalTriggerMnqNatsClientConfig$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'TriggerMnqNatsClientConfig' failed as data isn't a dictionary.`);\n }\n return {\n mnqCredentialId: data.mnq_credential_id,\n mnqNamespaceId: data.mnq_namespace_id,\n mnqNatsAccountId: data.mnq_nats_account_id,\n mnqProjectId: data.mnq_project_id,\n mnqRegion: data.mnq_region,\n subject: data.subject\n };\n};\nconst unmarshalTriggerMnqSqsClientConfig$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'TriggerMnqSqsClientConfig' failed as data isn't a dictionary.`);\n }\n return {\n mnqCredentialId: data.mnq_credential_id,\n mnqNamespaceId: data.mnq_namespace_id,\n mnqProjectId: data.mnq_project_id,\n mnqRegion: data.mnq_region,\n queue: data.queue\n };\n};\nconst unmarshalTriggerSqsClientConfig$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'TriggerSqsClientConfig' failed as data isn't a dictionary.`);\n }\n return {\n accessKey: data.access_key,\n endpoint: data.endpoint,\n queueUrl: data.queue_url,\n secretKey: data.secret_key\n };\n};\nconst unmarshalContainer = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Container' failed as data isn't a dictionary.`);\n }\n return {\n cpuLimit: data.cpu_limit,\n description: data.description,\n domainName: data.domain_name,\n environmentVariables: data.environment_variables,\n errorMessage: data.error_message,\n httpOption: data.http_option,\n id: data.id,\n maxConcurrency: data.max_concurrency,\n maxScale: data.max_scale,\n memoryLimit: data.memory_limit,\n minScale: data.min_scale,\n name: data.name,\n namespaceId: data.namespace_id,\n port: data.port,\n privacy: data.privacy,\n protocol: data.protocol,\n region: data.region,\n registryImage: data.registry_image,\n secretEnvironmentVariables: unmarshalArrayOfObject(data.secret_environment_variables, unmarshalSecretHashedValue$1),\n status: data.status,\n timeout: data.timeout\n };\n};\nconst unmarshalCron$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Cron' failed as data isn't a dictionary.`);\n }\n return {\n args: data.args,\n containerId: data.container_id,\n id: data.id,\n name: data.name,\n schedule: data.schedule,\n status: data.status\n };\n};\nconst unmarshalDomain$3 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Domain' failed as data isn't a dictionary.`);\n }\n return {\n containerId: data.container_id,\n errorMessage: data.error_message,\n hostname: data.hostname,\n id: data.id,\n status: data.status,\n url: data.url\n };\n};\nconst unmarshalLog$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Log' failed as data isn't a dictionary.`);\n }\n return {\n id: data.id,\n level: data.level,\n message: data.message,\n source: data.source,\n stream: data.stream,\n timestamp: unmarshalDate(data.timestamp)\n };\n};\nconst unmarshalNamespace$3 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Namespace' failed as data isn't a dictionary.`);\n }\n return {\n description: data.description,\n environmentVariables: data.environment_variables,\n errorMessage: data.error_message,\n id: data.id,\n name: data.name,\n organizationId: data.organization_id,\n projectId: data.project_id,\n region: data.region,\n registryEndpoint: data.registry_endpoint,\n registryNamespaceId: data.registry_namespace_id,\n secretEnvironmentVariables: unmarshalArrayOfObject(data.secret_environment_variables, unmarshalSecretHashedValue$1),\n status: data.status\n };\n};\nconst unmarshalToken$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Token' failed as data isn't a dictionary.`);\n }\n return {\n containerId: data.container_id,\n description: data.description,\n expiresAt: unmarshalDate(data.expires_at),\n id: data.id,\n namespaceId: data.namespace_id,\n publicKey: data.public_key,\n status: data.status,\n token: data.token\n };\n};\nconst unmarshalTrigger$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Trigger' failed as data isn't a dictionary.`);\n }\n return {\n containerId: data.container_id,\n description: data.description,\n errorMessage: data.error_message,\n id: data.id,\n inputType: data.input_type,\n name: data.name,\n scwNatsConfig: data.scw_nats_config ? unmarshalTriggerMnqNatsClientConfig$1(data.scw_nats_config) : undefined,\n scwSqsConfig: data.scw_sqs_config ? unmarshalTriggerMnqSqsClientConfig$1(data.scw_sqs_config) : undefined,\n sqsConfig: data.sqs_config ? unmarshalTriggerSqsClientConfig$1(data.sqs_config) : undefined,\n status: data.status\n };\n};\nconst unmarshalListContainersResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListContainersResponse' failed as data isn't a dictionary.`);\n }\n return {\n containers: unmarshalArrayOfObject(data.containers, unmarshalContainer),\n totalCount: data.total_count\n };\n};\nconst unmarshalListCronsResponse$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListCronsResponse' failed as data isn't a dictionary.`);\n }\n return {\n crons: unmarshalArrayOfObject(data.crons, unmarshalCron$1),\n totalCount: data.total_count\n };\n};\nconst unmarshalListDomainsResponse$3 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListDomainsResponse' failed as data isn't a dictionary.`);\n }\n return {\n domains: unmarshalArrayOfObject(data.domains, unmarshalDomain$3),\n totalCount: data.total_count\n };\n};\nconst unmarshalListLogsResponse$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListLogsResponse' failed as data isn't a dictionary.`);\n }\n return {\n logs: unmarshalArrayOfObject(data.logs, unmarshalLog$1),\n totalCount: data.total_count\n };\n};\nconst unmarshalListNamespacesResponse$3 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListNamespacesResponse' failed as data isn't a dictionary.`);\n }\n return {\n namespaces: unmarshalArrayOfObject(data.namespaces, unmarshalNamespace$3),\n totalCount: data.total_count\n };\n};\nconst unmarshalListTokensResponse$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListTokensResponse' failed as data isn't a dictionary.`);\n }\n return {\n tokens: unmarshalArrayOfObject(data.tokens, unmarshalToken$1),\n totalCount: data.total_count\n };\n};\nconst unmarshalListTriggersResponse$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListTriggersResponse' failed as data isn't a dictionary.`);\n }\n return {\n totalCount: data.total_count,\n triggers: unmarshalArrayOfObject(data.triggers, unmarshalTrigger$1)\n };\n};\nconst marshalCreateTriggerRequestMnqNatsClientConfig$1 = (request, defaults) => ({\n mnq_namespace_id: request.mnqNamespaceId,\n mnq_nats_account_id: request.mnqNatsAccountId,\n mnq_project_id: request.mnqProjectId,\n mnq_region: request.mnqRegion,\n subject: request.subject\n});\nconst marshalCreateTriggerRequestMnqSqsClientConfig$1 = (request, defaults) => ({\n mnq_namespace_id: request.mnqNamespaceId,\n mnq_project_id: request.mnqProjectId,\n mnq_region: request.mnqRegion,\n queue: request.queue\n});\nconst marshalCreateTriggerRequestSqsClientConfig$1 = (request, defaults) => ({\n access_key: request.accessKey,\n endpoint: request.endpoint,\n queue_url: request.queueUrl,\n secret_key: request.secretKey\n});\nconst marshalSecret$1 = (request, defaults) => ({\n key: request.key,\n value: request.value\n});\nconst marshalUpdateTriggerRequestSqsClientConfig$1 = (request, defaults) => ({\n access_key: request.accessKey,\n secret_key: request.secretKey\n});\nconst marshalCreateContainerRequest = (request, defaults) => ({\n cpu_limit: request.cpuLimit,\n description: request.description,\n environment_variables: request.environmentVariables,\n http_option: request.httpOption ?? 'unknown_http_option',\n max_concurrency: request.maxConcurrency,\n max_scale: request.maxScale,\n memory_limit: request.memoryLimit,\n min_scale: request.minScale,\n name: request.name,\n namespace_id: request.namespaceId,\n port: request.port,\n privacy: request.privacy ?? 'unknown_privacy',\n protocol: request.protocol ?? 'unknown_protocol',\n registry_image: request.registryImage,\n secret_environment_variables: request.secretEnvironmentVariables ? request.secretEnvironmentVariables.map(elt => marshalSecret$1(elt)) : undefined,\n timeout: request.timeout\n});\nconst marshalCreateCronRequest$1 = (request, defaults) => ({\n args: request.args,\n container_id: request.containerId,\n name: request.name,\n schedule: request.schedule\n});\nconst marshalCreateDomainRequest$2 = (request, defaults) => ({\n container_id: request.containerId,\n hostname: request.hostname\n});\nconst marshalCreateNamespaceRequest$3 = (request, defaults) => ({\n description: request.description,\n environment_variables: request.environmentVariables,\n name: request.name || randomName('cns'),\n project_id: request.projectId ?? defaults.defaultProjectId,\n secret_environment_variables: request.secretEnvironmentVariables ? request.secretEnvironmentVariables.map(elt => marshalSecret$1(elt)) : undefined\n});\nconst marshalCreateTokenRequest$1 = (request, defaults) => ({\n description: request.description,\n expires_at: request.expiresAt,\n ...resolveOneOf([{\n param: 'container_id',\n value: request.containerId\n }, {\n param: 'namespace_id',\n value: request.namespaceId\n }])\n});\nconst marshalCreateTriggerRequest$1 = (request, defaults) => ({\n container_id: request.containerId,\n description: request.description,\n name: request.name,\n ...resolveOneOf([{\n param: 'scw_sqs_config',\n value: request.scwSqsConfig ? marshalCreateTriggerRequestMnqSqsClientConfig$1(request.scwSqsConfig) : undefined\n }, {\n param: 'sqs_config',\n value: request.sqsConfig ? marshalCreateTriggerRequestSqsClientConfig$1(request.sqsConfig) : undefined\n }, {\n param: 'scw_nats_config',\n value: request.scwNatsConfig ? marshalCreateTriggerRequestMnqNatsClientConfig$1(request.scwNatsConfig) : undefined\n }])\n});\nconst marshalUpdateContainerRequest = (request, defaults) => ({\n cpu_limit: request.cpuLimit,\n description: request.description,\n environment_variables: request.environmentVariables,\n http_option: request.httpOption ?? 'unknown_http_option',\n max_concurrency: request.maxConcurrency,\n max_scale: request.maxScale,\n memory_limit: request.memoryLimit,\n min_scale: request.minScale,\n port: request.port,\n privacy: request.privacy ?? 'unknown_privacy',\n protocol: request.protocol ?? 'unknown_protocol',\n redeploy: request.redeploy,\n registry_image: request.registryImage,\n secret_environment_variables: request.secretEnvironmentVariables ? request.secretEnvironmentVariables.map(elt => marshalSecret$1(elt)) : undefined,\n timeout: request.timeout\n});\nconst marshalUpdateCronRequest$1 = (request, defaults) => ({\n args: request.args,\n container_id: request.containerId,\n name: request.name,\n schedule: request.schedule\n});\nconst marshalUpdateNamespaceRequest$3 = (request, defaults) => ({\n description: request.description,\n environment_variables: request.environmentVariables,\n secret_environment_variables: request.secretEnvironmentVariables ? request.secretEnvironmentVariables.map(elt => marshalSecret$1(elt)) : undefined\n});\nconst marshalUpdateTriggerRequest$1 = (request, defaults) => ({\n description: request.description,\n name: request.name,\n ...resolveOneOf([{\n param: 'sqs_config',\n value: request.sqsConfig ? marshalUpdateTriggerRequestSqsClientConfig$1(request.sqsConfig) : undefined\n }])\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst jsonContentHeaders$m = {\n 'Content-Type': 'application/json; charset=utf-8'\n};\n\n/** Serverless Containers API. */\nlet API$n = class API extends API$u {\n /** Lists the available regions of the API. */\n static LOCALITIES = ['fr-par', 'nl-ams', 'pl-waw'];\n pageOfListNamespaces = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces`,\n urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])\n }, unmarshalListNamespacesResponse$3);\n\n /**\n * List all your namespaces. List all namespaces in a specified region.\n *\n * @param request - The request {@link ListNamespacesRequest}\n * @returns A Promise of ListNamespacesResponse\n */\n listNamespaces = (request = {}) => enrichForPagination('namespaces', this.pageOfListNamespaces, request);\n\n /**\n * Get a namespace. Get the namespace associated with the specified ID.\n *\n * @param request - The request {@link GetNamespaceRequest}\n * @returns A Promise of Namespace\n */\n getNamespace = request => this.client.fetch({\n method: 'GET',\n path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam('namespaceId', request.namespaceId)}`\n }, unmarshalNamespace$3);\n\n /**\n * Waits for {@link Namespace} to be in a final state.\n *\n * @param request - The request {@link GetNamespaceRequest}\n * @param options - The waiting options\n * @returns A Promise of Namespace\n */\n waitForNamespace = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!NAMESPACE_TRANSIENT_STATUSES$2.includes(res.status))), this.getNamespace, request, options);\n\n /**\n * Create a new namespace. Create a new namespace in a specified region.\n *\n * @param request - The request {@link CreateNamespaceRequest}\n * @returns A Promise of Namespace\n */\n createNamespace = (request = {}) => this.client.fetch({\n body: JSON.stringify(marshalCreateNamespaceRequest$3(request, this.client.settings)),\n headers: jsonContentHeaders$m,\n method: 'POST',\n path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces`\n }, unmarshalNamespace$3);\n\n /**\n * Update an existing namespace. Update the space associated with the\n * specified ID.\n *\n * @param request - The request {@link UpdateNamespaceRequest}\n * @returns A Promise of Namespace\n */\n updateNamespace = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateNamespaceRequest$3(request, this.client.settings)),\n headers: jsonContentHeaders$m,\n method: 'PATCH',\n path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam('namespaceId', request.namespaceId)}`\n }, unmarshalNamespace$3);\n\n /**\n * Delete an existing namespace. Delete the namespace associated with the\n * specified ID.\n *\n * @param request - The request {@link DeleteNamespaceRequest}\n * @returns A Promise of Namespace\n */\n deleteNamespace = request => this.client.fetch({\n method: 'DELETE',\n path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam('namespaceId', request.namespaceId)}`\n }, unmarshalNamespace$3);\n pageOfListContainers = request => this.client.fetch({\n method: 'GET',\n path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/containers`,\n urlParams: urlParams(['name', request.name], ['namespace_id', request.namespaceId], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])\n }, unmarshalListContainersResponse);\n\n /**\n * List all your containers. List all containers for a specified region.\n *\n * @param request - The request {@link ListContainersRequest}\n * @returns A Promise of ListContainersResponse\n */\n listContainers = request => enrichForPagination('containers', this.pageOfListContainers, request);\n\n /**\n * Get a container. Get the container associated with the specified ID.\n *\n * @param request - The request {@link GetContainerRequest}\n * @returns A Promise of Container\n */\n getContainer = request => this.client.fetch({\n method: 'GET',\n path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/containers/${validatePathParam('containerId', request.containerId)}`\n }, unmarshalContainer);\n\n /**\n * Waits for {@link Container} to be in a final state.\n *\n * @param request - The request {@link GetContainerRequest}\n * @param options - The waiting options\n * @returns A Promise of Container\n */\n waitForContainer = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!CONTAINER_TRANSIENT_STATUSES.includes(res.status))), this.getContainer, request, options);\n\n /**\n * Create a new container. Create a new container in the specified region.\n *\n * @param request - The request {@link CreateContainerRequest}\n * @returns A Promise of Container\n */\n createContainer = request => this.client.fetch({\n body: JSON.stringify(marshalCreateContainerRequest(request, this.client.settings)),\n headers: jsonContentHeaders$m,\n method: 'POST',\n path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/containers`\n }, unmarshalContainer);\n\n /**\n * Update an existing container. Update the container associated with the\n * specified ID.\n *\n * @param request - The request {@link UpdateContainerRequest}\n * @returns A Promise of Container\n */\n updateContainer = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateContainerRequest(request, this.client.settings)),\n headers: jsonContentHeaders$m,\n method: 'PATCH',\n path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/containers/${validatePathParam('containerId', request.containerId)}`\n }, unmarshalContainer);\n\n /**\n * Delete a container. Delete the container associated with the specified ID.\n *\n * @param request - The request {@link DeleteContainerRequest}\n * @returns A Promise of Container\n */\n deleteContainer = request => this.client.fetch({\n method: 'DELETE',\n path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/containers/${validatePathParam('containerId', request.containerId)}`\n }, unmarshalContainer);\n\n /**\n * Deploy a container. Deploy a container associated with the specified ID.\n *\n * @param request - The request {@link DeployContainerRequest}\n * @returns A Promise of Container\n */\n deployContainer = request => this.client.fetch({\n body: '{}',\n headers: jsonContentHeaders$m,\n method: 'POST',\n path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/containers/${validatePathParam('containerId', request.containerId)}/deploy`\n }, unmarshalContainer);\n pageOfListCrons = request => this.client.fetch({\n method: 'GET',\n path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/crons`,\n urlParams: urlParams(['container_id', request.containerId], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])\n }, unmarshalListCronsResponse$1);\n\n /**\n * List all your crons.\n *\n * @param request - The request {@link ListCronsRequest}\n * @returns A Promise of ListCronsResponse\n */\n listCrons = request => enrichForPagination('crons', this.pageOfListCrons, request);\n\n /**\n * Get a cron. Get the cron associated with the specified ID.\n *\n * @param request - The request {@link GetCronRequest}\n * @returns A Promise of Cron\n */\n getCron = request => this.client.fetch({\n method: 'GET',\n path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/crons/${validatePathParam('cronId', request.cronId)}`\n }, unmarshalCron$1);\n\n /**\n * Waits for {@link Cron} to be in a final state.\n *\n * @param request - The request {@link GetCronRequest}\n * @param options - The waiting options\n * @returns A Promise of Cron\n */\n waitForCron = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!CRON_TRANSIENT_STATUSES$1.includes(res.status))), this.getCron, request, options);\n\n /**\n * Create a new cron.\n *\n * @param request - The request {@link CreateCronRequest}\n * @returns A Promise of Cron\n */\n createCron = request => this.client.fetch({\n body: JSON.stringify(marshalCreateCronRequest$1(request, this.client.settings)),\n headers: jsonContentHeaders$m,\n method: 'POST',\n path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/crons`\n }, unmarshalCron$1);\n\n /**\n * Update an existing cron. Update the cron associated with the specified ID.\n *\n * @param request - The request {@link UpdateCronRequest}\n * @returns A Promise of Cron\n */\n updateCron = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateCronRequest$1(request, this.client.settings)),\n headers: jsonContentHeaders$m,\n method: 'PATCH',\n path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/crons/${validatePathParam('cronId', request.cronId)}`\n }, unmarshalCron$1);\n\n /**\n * Delete an existing cron. Delete the cron associated with the specified ID.\n *\n * @param request - The request {@link DeleteCronRequest}\n * @returns A Promise of Cron\n */\n deleteCron = request => this.client.fetch({\n method: 'DELETE',\n path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/crons/${validatePathParam('cronId', request.cronId)}`\n }, unmarshalCron$1);\n pageOfListLogs = request => this.client.fetch({\n method: 'GET',\n path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/containers/${validatePathParam('containerId', request.containerId)}/logs`,\n urlParams: urlParams(['order_by', request.orderBy ?? 'timestamp_desc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])\n }, unmarshalListLogsResponse$1);\n\n /**\n * List your container logs. List the logs of the container with the specified\n * ID.\n *\n * @param request - The request {@link ListLogsRequest}\n * @returns A Promise of ListLogsResponse\n */\n listLogs = request => enrichForPagination('logs', this.pageOfListLogs, request);\n pageOfListDomains = request => this.client.fetch({\n method: 'GET',\n path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains`,\n urlParams: urlParams(['container_id', request.containerId], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])\n }, unmarshalListDomainsResponse$3);\n\n /**\n * List all domain name bindings. List all domain name bindings in a specified\n * region.\n *\n * @param request - The request {@link ListDomainsRequest}\n * @returns A Promise of ListDomainsResponse\n */\n listDomains = request => enrichForPagination('domains', this.pageOfListDomains, request);\n\n /**\n * Get a domain name binding. Get a domain name binding for the container with\n * the specified ID.\n *\n * @param request - The request {@link GetDomainRequest}\n * @returns A Promise of Domain\n */\n getDomain = request => this.client.fetch({\n method: 'GET',\n path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam('domainId', request.domainId)}`\n }, unmarshalDomain$3);\n\n /**\n * Waits for {@link Domain} to be in a final state.\n *\n * @param request - The request {@link GetDomainRequest}\n * @param options - The waiting options\n * @returns A Promise of Domain\n */\n waitForDomain = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!DOMAIN_TRANSIENT_STATUSES$3.includes(res.status))), this.getDomain, request, options);\n\n /**\n * Create a domain name binding. Create a domain name binding for the\n * container with the specified ID.\n *\n * @param request - The request {@link CreateDomainRequest}\n * @returns A Promise of Domain\n */\n createDomain = request => this.client.fetch({\n body: JSON.stringify(marshalCreateDomainRequest$2(request, this.client.settings)),\n headers: jsonContentHeaders$m,\n method: 'POST',\n path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains`\n }, unmarshalDomain$3);\n\n /**\n * Delete a domain name binding. Delete the domain name binding with the\n * specific ID.\n *\n * @param request - The request {@link DeleteDomainRequest}\n * @returns A Promise of Domain\n */\n deleteDomain = request => this.client.fetch({\n method: 'DELETE',\n path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam('domainId', request.domainId)}`\n }, unmarshalDomain$3);\n\n /**\n * @deprecated\n * @param request - The request {@link IssueJWTRequest}\n * @returns A Promise of Token\n */\n issueJWT = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/issue-jwt`,\n urlParams: urlParams(['expires_at', request.expiresAt], ...Object.entries(resolveOneOf([{\n param: 'container_id',\n value: request.containerId\n }, {\n param: 'namespace_id',\n value: request.namespaceId\n }])))\n }, unmarshalToken$1);\n\n /**\n * Create a new revocable token.\n *\n * @param request - The request {@link CreateTokenRequest}\n * @returns A Promise of Token\n */\n createToken = (request = {}) => this.client.fetch({\n body: JSON.stringify(marshalCreateTokenRequest$1(request, this.client.settings)),\n headers: jsonContentHeaders$m,\n method: 'POST',\n path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/tokens`\n }, unmarshalToken$1);\n\n /**\n * Get a token. Get a token with a specified ID.\n *\n * @param request - The request {@link GetTokenRequest}\n * @returns A Promise of Token\n */\n getToken = request => this.client.fetch({\n method: 'GET',\n path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/tokens/${validatePathParam('tokenId', request.tokenId)}`\n }, unmarshalToken$1);\n\n /**\n * Waits for {@link Token} to be in a final state.\n *\n * @param request - The request {@link GetTokenRequest}\n * @param options - The waiting options\n * @returns A Promise of Token\n */\n waitForToken = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!TOKEN_TRANSIENT_STATUSES$1.includes(res.status))), this.getToken, request, options);\n pageOfListTokens = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/tokens`,\n urlParams: urlParams(['container_id', request.containerId], ['namespace_id', request.namespaceId], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])\n }, unmarshalListTokensResponse$1);\n\n /**\n * List all tokens. List all tokens belonging to a specified Organization or\n * Project.\n *\n * @param request - The request {@link ListTokensRequest}\n * @returns A Promise of ListTokensResponse\n */\n listTokens = (request = {}) => enrichForPagination('tokens', this.pageOfListTokens, request);\n\n /**\n * Delete a token. Delete a token with a specified ID.\n *\n * @param request - The request {@link DeleteTokenRequest}\n * @returns A Promise of Token\n */\n deleteToken = request => this.client.fetch({\n method: 'DELETE',\n path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/tokens/${validatePathParam('tokenId', request.tokenId)}`\n }, unmarshalToken$1);\n\n /**\n * Create a trigger. Create a new trigger for a specified container.\n *\n * @param request - The request {@link CreateTriggerRequest}\n * @returns A Promise of Trigger\n */\n createTrigger = request => this.client.fetch({\n body: JSON.stringify(marshalCreateTriggerRequest$1(request, this.client.settings)),\n headers: jsonContentHeaders$m,\n method: 'POST',\n path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/triggers`\n }, unmarshalTrigger$1);\n\n /**\n * Get a trigger. Get a trigger with a specified ID.\n *\n * @param request - The request {@link GetTriggerRequest}\n * @returns A Promise of Trigger\n */\n getTrigger = request => this.client.fetch({\n method: 'GET',\n path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/triggers/${validatePathParam('triggerId', request.triggerId)}`\n }, unmarshalTrigger$1);\n\n /**\n * Waits for {@link Trigger} to be in a final state.\n *\n * @param request - The request {@link GetTriggerRequest}\n * @param options - The waiting options\n * @returns A Promise of Trigger\n */\n waitForTrigger = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!TRIGGER_TRANSIENT_STATUSES$1.includes(res.status))), this.getTrigger, request, options);\n pageOfListTriggers = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/triggers`,\n urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ...Object.entries(resolveOneOf([{\n default: this.client.settings.defaultProjectId,\n param: 'project_id',\n value: request.projectId\n }, {\n param: 'container_id',\n value: request.containerId\n }, {\n param: 'namespace_id',\n value: request.namespaceId\n }])))\n }, unmarshalListTriggersResponse$1);\n\n /**\n * List all triggers. List all triggers belonging to a specified Organization\n * or Project.\n *\n * @param request - The request {@link ListTriggersRequest}\n * @returns A Promise of ListTriggersResponse\n */\n listTriggers = (request = {}) => enrichForPagination('triggers', this.pageOfListTriggers, request);\n\n /**\n * Update a trigger. Update a trigger with a specified ID.\n *\n * @param request - The request {@link UpdateTriggerRequest}\n * @returns A Promise of Trigger\n */\n updateTrigger = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateTriggerRequest$1(request, this.client.settings)),\n headers: jsonContentHeaders$m,\n method: 'PATCH',\n path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/triggers/${validatePathParam('triggerId', request.triggerId)}`\n }, unmarshalTrigger$1);\n\n /**\n * Delete a trigger. Delete a trigger with a specified ID.\n *\n * @param request - The request {@link DeleteTriggerRequest}\n * @returns A Promise of Trigger\n */\n deleteTrigger = request => this.client.fetch({\n method: 'DELETE',\n path: `/containers/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/triggers/${validatePathParam('triggerId', request.triggerId)}`\n }, unmarshalTrigger$1);\n};\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\nvar index_gen$l = /*#__PURE__*/Object.freeze({\n __proto__: null,\n API: API$n,\n CONTAINER_TRANSIENT_STATUSES: CONTAINER_TRANSIENT_STATUSES,\n CRON_TRANSIENT_STATUSES: CRON_TRANSIENT_STATUSES$1,\n DOMAIN_TRANSIENT_STATUSES: DOMAIN_TRANSIENT_STATUSES$3,\n NAMESPACE_TRANSIENT_STATUSES: NAMESPACE_TRANSIENT_STATUSES$2,\n TOKEN_TRANSIENT_STATUSES: TOKEN_TRANSIENT_STATUSES$1,\n TRIGGER_TRANSIENT_STATUSES: TRIGGER_TRANSIENT_STATUSES$1\n});\n\nvar index$o = /*#__PURE__*/Object.freeze({\n __proto__: null,\n v1beta1: index_gen$l\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\n/** Lists transient statutes of the enum {@link InstanceLogStatus}. */\nconst INSTANCE_LOG_TRANSIENT_STATUSES$1 = ['creating'];\n\n/** Lists transient statutes of the enum {@link InstanceStatus}. */\nconst INSTANCE_TRANSIENT_STATUSES$2 = ['provisioning', 'configuring', 'deleting', 'autohealing', 'initializing', 'backuping', 'snapshotting', 'restarting'];\n\n/** Lists transient statutes of the enum {@link MaintenanceStatus}. */\nconst MAINTENANCE_TRANSIENT_STATUSES$1 = ['pending'];\n\n/** Lists transient statutes of the enum {@link ReadReplicaStatus}. */\nconst READ_REPLICA_TRANSIENT_STATUSES$1 = ['provisioning', 'initializing', 'deleting', 'configuring', 'promoting'];\n\n/** Lists transient statutes of the enum {@link SnapshotStatus}. */\nconst SNAPSHOT_TRANSIENT_STATUSES$2 = ['creating', 'restoring', 'deleting'];\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst unmarshalEndpointDirectAccessDetails$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'EndpointDirectAccessDetails' failed as data isn't a dictionary.`);\n }\n return {};\n};\nconst unmarshalEndpointLoadBalancerDetails$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'EndpointLoadBalancerDetails' failed as data isn't a dictionary.`);\n }\n return {};\n};\nconst unmarshalEndpointPrivateNetworkDetails$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'EndpointPrivateNetworkDetails' failed as data isn't a dictionary.`);\n }\n return {\n privateNetworkId: data.private_network_id,\n serviceIp: data.service_ip,\n zone: data.zone\n };\n};\nconst unmarshalEndpoint$2 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Endpoint' failed as data isn't a dictionary.`);\n }\n return {\n directAccess: data.direct_access ? unmarshalEndpointDirectAccessDetails$1(data.direct_access) : undefined,\n hostname: data.hostname,\n id: data.id,\n ip: data.ip,\n loadBalancer: data.load_balancer ? unmarshalEndpointLoadBalancerDetails$1(data.load_balancer) : undefined,\n name: data.name,\n port: data.port,\n privateNetwork: data.private_network ? unmarshalEndpointPrivateNetworkDetails$1(data.private_network) : undefined\n };\n};\nconst unmarshalEngineSetting$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'EngineSetting' failed as data isn't a dictionary.`);\n }\n return {\n defaultValue: data.default_value,\n description: data.description,\n floatMax: data.float_max,\n floatMin: data.float_min,\n hotConfigurable: data.hot_configurable,\n intMax: data.int_max,\n intMin: data.int_min,\n name: data.name,\n propertyType: data.property_type,\n stringConstraint: data.string_constraint,\n unit: data.unit\n };\n};\nconst unmarshalBackupSchedule$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'BackupSchedule' failed as data isn't a dictionary.`);\n }\n return {\n disabled: data.disabled,\n frequency: data.frequency,\n nextRunAt: unmarshalDate(data.next_run_at),\n retention: data.retention\n };\n};\nconst unmarshalEngineVersion$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'EngineVersion' failed as data isn't a dictionary.`);\n }\n return {\n availableInitSettings: unmarshalArrayOfObject(data.available_init_settings, unmarshalEngineSetting$1),\n availableSettings: unmarshalArrayOfObject(data.available_settings, unmarshalEngineSetting$1),\n beta: data.beta,\n disabled: data.disabled,\n endOfLife: unmarshalDate(data.end_of_life),\n name: data.name,\n version: data.version\n };\n};\nconst unmarshalInstanceSetting$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'InstanceSetting' failed as data isn't a dictionary.`);\n }\n return {\n name: data.name,\n value: data.value\n };\n};\nconst unmarshalLogsPolicy$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'LogsPolicy' failed as data isn't a dictionary.`);\n }\n return {\n maxAgeRetention: data.max_age_retention,\n totalDiskRetention: data.total_disk_retention\n };\n};\nconst unmarshalMaintenance$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Maintenance' failed as data isn't a dictionary.`);\n }\n return {\n closedAt: unmarshalDate(data.closed_at),\n reason: data.reason,\n startsAt: unmarshalDate(data.starts_at),\n status: data.status,\n stopsAt: unmarshalDate(data.stops_at)\n };\n};\nconst unmarshalNodeTypeVolumeConstraintSizes$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'NodeTypeVolumeConstraintSizes' failed as data isn't a dictionary.`);\n }\n return {\n maxSize: data.max_size,\n minSize: data.min_size\n };\n};\nconst unmarshalNodeTypeVolumeType$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'NodeTypeVolumeType' failed as data isn't a dictionary.`);\n }\n return {\n chunkSize: data.chunk_size,\n description: data.description,\n maxSize: data.max_size,\n minSize: data.min_size,\n type: data.type\n };\n};\nconst unmarshalReadReplica$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ReadReplica' failed as data isn't a dictionary.`);\n }\n return {\n endpoints: unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint$2),\n id: data.id,\n region: data.region,\n sameZone: data.same_zone,\n status: data.status\n };\n};\nconst unmarshalUpgradableVersion$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'UpgradableVersion' failed as data isn't a dictionary.`);\n }\n return {\n id: data.id,\n minorVersion: data.minor_version,\n name: data.name,\n version: data.version\n };\n};\nconst unmarshalVolume$3 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Volume' failed as data isn't a dictionary.`);\n }\n return {\n size: data.size,\n type: data.type\n };\n};\nconst unmarshalACLRule$2 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ACLRule' failed as data isn't a dictionary.`);\n }\n return {\n action: data.action,\n description: data.description,\n direction: data.direction,\n ip: data.ip,\n port: data.port,\n protocol: data.protocol\n };\n};\nconst unmarshalDatabase$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Database' failed as data isn't a dictionary.`);\n }\n return {\n managed: data.managed,\n name: data.name,\n owner: data.owner,\n size: data.size\n };\n};\nconst unmarshalDatabaseEngine$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'DatabaseEngine' failed as data isn't a dictionary.`);\n }\n return {\n logoUrl: data.logo_url,\n name: data.name,\n region: data.region,\n versions: unmarshalArrayOfObject(data.versions, unmarshalEngineVersion$1)\n };\n};\nconst unmarshalInstance$2 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Instance' failed as data isn't a dictionary.`);\n }\n return {\n backupSameRegion: data.backup_same_region,\n backupSchedule: data.backup_schedule ? unmarshalBackupSchedule$1(data.backup_schedule) : undefined,\n createdAt: unmarshalDate(data.created_at),\n endpoint: data.endpoint ? unmarshalEndpoint$2(data.endpoint) : undefined,\n endpoints: unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint$2),\n engine: data.engine,\n id: data.id,\n initSettings: unmarshalArrayOfObject(data.init_settings, unmarshalInstanceSetting$1),\n isHaCluster: data.is_ha_cluster,\n logsPolicy: data.logs_policy ? unmarshalLogsPolicy$1(data.logs_policy) : undefined,\n maintenances: unmarshalArrayOfObject(data.maintenances, unmarshalMaintenance$1),\n name: data.name,\n nodeType: data.node_type,\n organizationId: data.organization_id,\n projectId: data.project_id,\n readReplicas: unmarshalArrayOfObject(data.read_replicas, unmarshalReadReplica$1),\n region: data.region,\n settings: unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting$1),\n status: data.status,\n tags: data.tags,\n upgradableVersion: unmarshalArrayOfObject(data.upgradable_version, unmarshalUpgradableVersion$1),\n volume: data.volume ? unmarshalVolume$3(data.volume) : undefined\n };\n};\nconst unmarshalInstanceLog$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'InstanceLog' failed as data isn't a dictionary.`);\n }\n return {\n createdAt: unmarshalDate(data.created_at),\n downloadUrl: data.download_url,\n expiresAt: unmarshalDate(data.expires_at),\n id: data.id,\n nodeName: data.node_name,\n region: data.region,\n status: data.status\n };\n};\nconst unmarshalListInstanceLogsDetailsResponseInstanceLogDetail$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListInstanceLogsDetailsResponseInstanceLogDetail' failed as data isn't a dictionary.`);\n }\n return {\n logName: data.log_name,\n size: data.size\n };\n};\nconst unmarshalNodeType$2 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'NodeType' failed as data isn't a dictionary.`);\n }\n return {\n availableVolumeTypes: unmarshalArrayOfObject(data.available_volume_types, unmarshalNodeTypeVolumeType$1),\n beta: data.beta,\n description: data.description,\n disabled: data.disabled,\n generation: data.generation,\n instanceRange: data.instance_range,\n isBssdCompatible: data.is_bssd_compatible,\n isHaRequired: data.is_ha_required,\n memory: data.memory,\n name: data.name,\n region: data.region,\n stockStatus: data.stock_status,\n vcpus: data.vcpus,\n volumeConstraint: data.volume_constraint ? unmarshalNodeTypeVolumeConstraintSizes$1(data.volume_constraint) : undefined\n };\n};\nconst unmarshalPrivilege$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Privilege' failed as data isn't a dictionary.`);\n }\n return {\n databaseName: data.database_name,\n permission: data.permission,\n userName: data.user_name\n };\n};\nconst unmarshalSnapshot$2 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Snapshot' failed as data isn't a dictionary.`);\n }\n return {\n createdAt: unmarshalDate(data.created_at),\n expiresAt: unmarshalDate(data.expires_at),\n id: data.id,\n instanceId: data.instance_id,\n instanceName: data.instance_name,\n name: data.name,\n nodeType: data.node_type,\n region: data.region,\n size: data.size,\n status: data.status,\n updatedAt: unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalUser$2 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'User' failed as data isn't a dictionary.`);\n }\n return {\n isAdmin: data.is_admin,\n name: data.name\n };\n};\nconst unmarshalAddInstanceACLRulesResponse$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'AddInstanceACLRulesResponse' failed as data isn't a dictionary.`);\n }\n return {\n rules: unmarshalArrayOfObject(data.rules, unmarshalACLRule$2)\n };\n};\nconst unmarshalAddInstanceSettingsResponse$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'AddInstanceSettingsResponse' failed as data isn't a dictionary.`);\n }\n return {\n settings: unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting$1)\n };\n};\nconst unmarshalDeleteInstanceACLRulesResponse$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'DeleteInstanceACLRulesResponse' failed as data isn't a dictionary.`);\n }\n return {\n rules: unmarshalArrayOfObject(data.rules, unmarshalACLRule$2)\n };\n};\nconst unmarshalDeleteInstanceSettingsResponse$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'DeleteInstanceSettingsResponse' failed as data isn't a dictionary.`);\n }\n return {\n settings: unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting$1)\n };\n};\nconst unmarshalInstanceMetrics$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'InstanceMetrics' failed as data isn't a dictionary.`);\n }\n return {\n timeseries: unmarshalArrayOfObject(data.timeseries, unmarshalTimeSeries)\n };\n};\nconst unmarshalListDatabaseEnginesResponse$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListDatabaseEnginesResponse' failed as data isn't a dictionary.`);\n }\n return {\n engines: unmarshalArrayOfObject(data.engines, unmarshalDatabaseEngine$1),\n totalCount: data.total_count\n };\n};\nconst unmarshalListDatabasesResponse$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListDatabasesResponse' failed as data isn't a dictionary.`);\n }\n return {\n databases: unmarshalArrayOfObject(data.databases, unmarshalDatabase$1),\n totalCount: data.total_count\n };\n};\nconst unmarshalListInstanceACLRulesResponse$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListInstanceACLRulesResponse' failed as data isn't a dictionary.`);\n }\n return {\n rules: unmarshalArrayOfObject(data.rules, unmarshalACLRule$2),\n totalCount: data.total_count\n };\n};\nconst unmarshalListInstanceLogsDetailsResponse$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListInstanceLogsDetailsResponse' failed as data isn't a dictionary.`);\n }\n return {\n details: unmarshalArrayOfObject(data.details, unmarshalListInstanceLogsDetailsResponseInstanceLogDetail$1)\n };\n};\nconst unmarshalListInstanceLogsResponse$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListInstanceLogsResponse' failed as data isn't a dictionary.`);\n }\n return {\n instanceLogs: unmarshalArrayOfObject(data.instance_logs, unmarshalInstanceLog$1)\n };\n};\nconst unmarshalListInstancesResponse$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListInstancesResponse' failed as data isn't a dictionary.`);\n }\n return {\n instances: unmarshalArrayOfObject(data.instances, unmarshalInstance$2),\n totalCount: data.total_count\n };\n};\nconst unmarshalListNodeTypesResponse$2 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListNodeTypesResponse' failed as data isn't a dictionary.`);\n }\n return {\n nodeTypes: unmarshalArrayOfObject(data.node_types, unmarshalNodeType$2),\n totalCount: data.total_count\n };\n};\nconst unmarshalListPrivilegesResponse$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListPrivilegesResponse' failed as data isn't a dictionary.`);\n }\n return {\n privileges: unmarshalArrayOfObject(data.privileges, unmarshalPrivilege$1),\n totalCount: data.total_count\n };\n};\nconst unmarshalListSnapshotsResponse$2 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListSnapshotsResponse' failed as data isn't a dictionary.`);\n }\n return {\n snapshots: unmarshalArrayOfObject(data.snapshots, unmarshalSnapshot$2),\n totalCount: data.total_count\n };\n};\nconst unmarshalListUsersResponse$2 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListUsersResponse' failed as data isn't a dictionary.`);\n }\n return {\n totalCount: data.total_count,\n users: unmarshalArrayOfObject(data.users, unmarshalUser$2)\n };\n};\nconst unmarshalSetInstanceACLRulesResponse$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'SetInstanceACLRulesResponse' failed as data isn't a dictionary.`);\n }\n return {\n rules: unmarshalArrayOfObject(data.rules, unmarshalACLRule$2)\n };\n};\nconst unmarshalSetInstanceSettingsResponse$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'SetInstanceSettingsResponse' failed as data isn't a dictionary.`);\n }\n return {\n settings: unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting$1)\n };\n};\nconst marshalEndpointSpecPrivateNetworkIpamConfig$1 = (request, defaults) => ({});\nconst marshalReadReplicaEndpointSpecPrivateNetworkIpamConfig$1 = (request, defaults) => ({});\nconst marshalEndpointSpecLoadBalancer$1 = (request, defaults) => ({});\nconst marshalEndpointSpecPrivateNetwork$1 = (request, defaults) => ({\n private_network_id: request.privateNetworkId,\n ...resolveOneOf([{\n param: 'service_ip',\n value: request.serviceIp\n }, {\n param: 'ipam_config',\n value: request.ipamConfig ? marshalEndpointSpecPrivateNetworkIpamConfig$1(request.ipamConfig) : undefined\n }])\n});\nconst marshalReadReplicaEndpointSpecDirectAccess$1 = (request, defaults) => ({});\nconst marshalReadReplicaEndpointSpecPrivateNetwork$1 = (request, defaults) => ({\n private_network_id: request.privateNetworkId,\n ...resolveOneOf([{\n param: 'service_ip',\n value: request.serviceIp\n }, {\n param: 'ipam_config',\n value: request.ipamConfig ? marshalReadReplicaEndpointSpecPrivateNetworkIpamConfig$1(request.ipamConfig) : undefined\n }])\n});\nconst marshalACLRuleRequest$1 = (request, defaults) => ({\n description: request.description,\n ip: request.ip\n});\nconst marshalEndpointSpec$2 = (request, defaults) => ({\n ...resolveOneOf([{\n param: 'load_balancer',\n value: request.loadBalancer ? marshalEndpointSpecLoadBalancer$1(request.loadBalancer) : undefined\n }, {\n param: 'private_network',\n value: request.privateNetwork ? marshalEndpointSpecPrivateNetwork$1(request.privateNetwork) : undefined\n }])\n});\nconst marshalInstanceSetting$1 = (request, defaults) => ({\n name: request.name,\n value: request.value\n});\nconst marshalLogsPolicy$1 = (request, defaults) => ({\n max_age_retention: request.maxAgeRetention,\n total_disk_retention: request.totalDiskRetention\n});\nconst marshalReadReplicaEndpointSpec$1 = (request, defaults) => ({\n ...resolveOneOf([{\n param: 'direct_access',\n value: request.directAccess ? marshalReadReplicaEndpointSpecDirectAccess$1(request.directAccess) : undefined\n }, {\n param: 'private_network',\n value: request.privateNetwork ? marshalReadReplicaEndpointSpecPrivateNetwork$1(request.privateNetwork) : undefined\n }])\n});\nconst marshalAddInstanceACLRulesRequest$1 = (request, defaults) => ({\n rules: request.rules.map(elt => marshalACLRuleRequest$1(elt))\n});\nconst marshalAddInstanceSettingsRequest$1 = (request, defaults) => ({\n settings: request.settings.map(elt => marshalInstanceSetting$1(elt))\n});\nconst marshalCloneInstanceRequest$1 = (request, defaults) => ({\n name: request.name,\n node_type: request.nodeType\n});\nconst marshalCreateDatabaseRequest$1 = (request, defaults) => ({\n name: request.name\n});\nconst marshalCreateEndpointRequest$1 = (request, defaults) => ({\n endpoint_spec: request.endpointSpec ? marshalEndpointSpec$2(request.endpointSpec) : undefined\n});\nconst marshalCreateInstanceFromSnapshotRequest$1 = (request, defaults) => ({\n instance_name: request.instanceName,\n is_ha_cluster: request.isHaCluster,\n node_type: request.nodeType\n});\nconst marshalCreateInstanceRequest$1 = (request, defaults) => ({\n backup_same_region: request.backupSameRegion,\n disable_backup: request.disableBackup,\n engine: request.engine,\n init_endpoints: request.initEndpoints ? request.initEndpoints.map(elt => marshalEndpointSpec$2(elt)) : undefined,\n init_settings: request.initSettings ? request.initSettings.map(elt => marshalInstanceSetting$1(elt)) : undefined,\n is_ha_cluster: request.isHaCluster,\n name: request.name || randomName('ins'),\n node_type: request.nodeType,\n password: request.password,\n tags: request.tags,\n user_name: request.userName,\n volume_size: request.volumeSize,\n volume_type: request.volumeType ?? 'lssd',\n ...resolveOneOf([{\n default: defaults.defaultProjectId,\n param: 'project_id',\n value: request.projectId\n }, {\n default: defaults.defaultOrganizationId,\n param: 'organization_id',\n value: request.organizationId\n }])\n});\nconst marshalCreateReadReplicaEndpointRequest$1 = (request, defaults) => ({\n endpoint_spec: request.endpointSpec.map(elt => marshalReadReplicaEndpointSpec$1(elt))\n});\nconst marshalCreateReadReplicaRequest$1 = (request, defaults) => ({\n endpoint_spec: request.endpointSpec ? request.endpointSpec.map(elt => marshalReadReplicaEndpointSpec$1(elt)) : undefined,\n instance_id: request.instanceId,\n same_zone: request.sameZone\n});\nconst marshalCreateSnapshotRequest$2 = (request, defaults) => ({\n expires_at: request.expiresAt,\n name: request.name || randomName('snp')\n});\nconst marshalCreateUserRequest$2 = (request, defaults) => ({\n is_admin: request.isAdmin,\n name: request.name,\n password: request.password\n});\nconst marshalDeleteInstanceACLRulesRequest$1 = (request, defaults) => ({\n acl_rule_ips: request.aclRuleIps\n});\nconst marshalDeleteInstanceSettingsRequest$1 = (request, defaults) => ({\n setting_names: request.settingNames\n});\nconst marshalMigrateEndpointRequest$1 = (request, defaults) => ({\n instance_id: request.instanceId\n});\nconst marshalPurgeInstanceLogsRequest$1 = (request, defaults) => ({\n log_name: request.logName\n});\nconst marshalSetInstanceACLRulesRequest$1 = (request, defaults) => ({\n rules: request.rules.map(elt => marshalACLRuleRequest$1(elt))\n});\nconst marshalSetInstanceSettingsRequest$1 = (request, defaults) => ({\n settings: request.settings.map(elt => marshalInstanceSetting$1(elt))\n});\nconst marshalSetPrivilegeRequest$1 = (request, defaults) => ({\n database_name: request.databaseName,\n permission: request.permission ?? 'readonly',\n user_name: request.userName\n});\nconst marshalUpdateInstanceRequest$1 = (request, defaults) => ({\n backup_same_region: request.backupSameRegion,\n backup_schedule_frequency: request.backupScheduleFrequency,\n backup_schedule_retention: request.backupScheduleRetention,\n backup_schedule_start_hour: request.backupScheduleStartHour,\n is_backup_schedule_disabled: request.isBackupScheduleDisabled,\n logs_policy: request.logsPolicy ? marshalLogsPolicy$1(request.logsPolicy) : undefined,\n name: request.name,\n tags: request.tags\n});\nconst marshalUpdateSnapshotRequest$1 = (request, defaults) => ({\n expires_at: request.expiresAt,\n name: request.name\n});\nconst marshalUpdateUserRequest$1 = (request, defaults) => ({\n is_admin: request.isAdmin,\n password: request.password\n});\nconst marshalUpgradeInstanceRequest$1 = (request, defaults) => ({\n ...resolveOneOf([{\n param: 'node_type',\n value: request.nodeType\n }, {\n param: 'enable_ha',\n value: request.enableHa\n }, {\n param: 'volume_size',\n value: request.volumeSize\n }, {\n param: 'volume_type',\n value: request.volumeType\n }, {\n param: 'upgradable_version_id',\n value: request.upgradableVersionId\n }])\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst jsonContentHeaders$l = {\n 'Content-Type': 'application/json; charset=utf-8'\n};\n\n/** Managed Document Databases API. */\nlet API$m = class API extends API$u {\n /** Lists the available regions of the API. */\n static LOCALITIES = ['fr-par', 'nl-ams', 'pl-waw'];\n pageOfListDatabaseEngines = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/database-engines`,\n urlParams: urlParams(['name', request.name], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['version', request.version])\n }, unmarshalListDatabaseEnginesResponse$1);\n\n /**\n * List available database engines. List the FerretDB database engines\n * available at Scaleway.\n *\n * @param request - The request {@link ListDatabaseEnginesRequest}\n * @returns A Promise of ListDatabaseEnginesResponse\n */\n listDatabaseEngines = (request = {}) => enrichForPagination('engines', this.pageOfListDatabaseEngines, request);\n pageOfListNodeTypes = request => this.client.fetch({\n method: 'GET',\n path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/node-types`,\n urlParams: urlParams(['include_disabled_types', request.includeDisabledTypes], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])\n }, unmarshalListNodeTypesResponse$2);\n\n /**\n * List available node types. List all available node types. By default, the\n * node types returned in the list are ordered by creation date in ascending\n * order, though this can be modified via the `order_by` field.\n *\n * @param request - The request {@link ListNodeTypesRequest}\n * @returns A Promise of ListNodeTypesResponse\n */\n listNodeTypes = request => enrichForPagination('nodeTypes', this.pageOfListNodeTypes, request);\n\n /**\n * Upgrade a Database Instance. Upgrade your current Database Instance\n * specifications like node type, high availability, volume, or the database\n * engine version. Note that upon upgrade the `enable_ha` parameter can only\n * be set to `true`.\n *\n * @param request - The request {@link UpgradeInstanceRequest}\n * @returns A Promise of Instance\n */\n upgradeInstance = request => this.client.fetch({\n body: JSON.stringify(marshalUpgradeInstanceRequest$1(request, this.client.settings)),\n headers: jsonContentHeaders$l,\n method: 'POST',\n path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/upgrade`\n }, unmarshalInstance$2);\n pageOfListInstances = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances`,\n urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId], ['tags', request.tags])\n }, unmarshalListInstancesResponse$1);\n\n /**\n * List Database Instances. List all Database Instances in the specified\n * region, for a given Scaleway Organization or Scaleway Project. By default,\n * the Database Instances returned in the list are ordered by creation date in\n * ascending order, though this can be modified via the order_by field. You\n * can define additional parameters for your query, such as `tags` and `name`.\n * For the `name` parameter, the value you include will be checked against the\n * whole name string to see if it includes the string you put in the\n * parameter.\n *\n * @param request - The request {@link ListInstancesRequest}\n * @returns A Promise of ListInstancesResponse\n */\n listInstances = (request = {}) => enrichForPagination('instances', this.pageOfListInstances, request);\n\n /**\n * Get a Database Instance. Retrieve information about a given Database\n * Instance, specified by the `region` and `instance_id` parameters. Its full\n * details, including name, status, IP address and port, are returned in the\n * response object.\n *\n * @param request - The request {@link GetInstanceRequest}\n * @returns A Promise of Instance\n */\n getInstance = request => this.client.fetch({\n method: 'GET',\n path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}`\n }, unmarshalInstance$2);\n\n /**\n * Waits for {@link Instance} to be in a final state.\n *\n * @param request - The request {@link GetInstanceRequest}\n * @param options - The waiting options\n * @returns A Promise of Instance\n */\n waitForInstance = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!INSTANCE_TRANSIENT_STATUSES$2.includes(res.status))), this.getInstance, request, options);\n\n /**\n * Create a Database Instance. Create a new Database Instance. You must set\n * the `engine`, `user_name`, `password` and `node_type` parameters.\n * Optionally, you can specify the volume type and size.\n *\n * @param request - The request {@link CreateInstanceRequest}\n * @returns A Promise of Instance\n */\n createInstance = request => this.client.fetch({\n body: JSON.stringify(marshalCreateInstanceRequest$1(request, this.client.settings)),\n headers: jsonContentHeaders$l,\n method: 'POST',\n path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances`\n }, unmarshalInstance$2);\n\n /**\n * Update a Database Instance. Update the parameters of a Database Instance,\n * including name, tags and backup schedule details.\n *\n * @param request - The request {@link UpdateInstanceRequest}\n * @returns A Promise of Instance\n */\n updateInstance = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateInstanceRequest$1(request, this.client.settings)),\n headers: jsonContentHeaders$l,\n method: 'PATCH',\n path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}`\n }, unmarshalInstance$2);\n\n /**\n * Delete a Database Instance. Delete a given Database Instance, specified by\n * the `region` and `instance_id` parameters. Deleting a Database Instance is\n * permanent, and cannot be undone. Note that upon deletion all your data will\n * be lost.\n *\n * @param request - The request {@link DeleteInstanceRequest}\n * @returns A Promise of Instance\n */\n deleteInstance = request => this.client.fetch({\n method: 'DELETE',\n path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}`\n }, unmarshalInstance$2);\n\n /**\n * Clone a Database Instance. Clone a given Database Instance, specified by\n * the `region` and `instance_id` parameters. The clone feature allows you to\n * create a new Database Instance from an existing one. The clone includes all\n * existing databases, users and permissions. You can create a clone on a\n * Database Instance bigger than your current one.\n *\n * @param request - The request {@link CloneInstanceRequest}\n * @returns A Promise of Instance\n */\n cloneInstance = request => this.client.fetch({\n body: JSON.stringify(marshalCloneInstanceRequest$1(request, this.client.settings)),\n headers: jsonContentHeaders$l,\n method: 'POST',\n path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/clone`\n }, unmarshalInstance$2);\n\n /**\n * Restart Database Instance. Restart a given Database Instance, specified by\n * the `region` and `instance_id` parameters. The status of the Database\n * Instance returned in the response.\n *\n * @param request - The request {@link RestartInstanceRequest}\n * @returns A Promise of Instance\n */\n restartInstance = request => this.client.fetch({\n body: '{}',\n headers: jsonContentHeaders$l,\n method: 'POST',\n path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/restart`\n }, unmarshalInstance$2);\n\n /**\n * Get the TLS certificate of a Database Instance. Retrieve information about\n * the TLS certificate of a given Database Instance. Details like name and\n * content are returned in the response.\n *\n * @param request - The request {@link GetInstanceCertificateRequest}\n * @returns A Promise of Blob\n */\n getInstanceCertificate = request => this.client.fetch({\n method: 'GET',\n path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/certificate`,\n urlParams: urlParams(['dl', 1]),\n responseType: 'blob'\n });\n\n /**\n * Renew the TLS certificate of a Database Instance. Renew a TLS for a\n * Database Instance. Renewing a certificate means that you will not be able\n * to connect to your Database Instance using the previous certificate. You\n * will also need to download and update the new certificate for all database\n * clients.\n *\n * @param request - The request {@link RenewInstanceCertificateRequest}\n */\n renewInstanceCertificate = request => this.client.fetch({\n body: '{}',\n headers: jsonContentHeaders$l,\n method: 'POST',\n path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/renew-certificate`\n });\n\n /**\n * Get Database Instance metrics. Retrieve the time series metrics of a given\n * Database Instance. You can define the period from which to retrieve metrics\n * by specifying the `start_date` and `end_date`.\n *\n * @param request - The request {@link GetInstanceMetricsRequest}\n * @returns A Promise of InstanceMetrics\n */\n getInstanceMetrics = request => this.client.fetch({\n method: 'GET',\n path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/metrics`,\n urlParams: urlParams(['end_date', request.endDate], ['metric_name', request.metricName], ['start_date', request.startDate])\n }, unmarshalInstanceMetrics$1);\n\n /**\n * Create a Read Replica. Create a new Read Replica of a Database Instance.\n * You must specify the `region` and the `instance_id`. You can only create a\n * maximum of 3 Read Replicas per Database Instance.\n *\n * @param request - The request {@link CreateReadReplicaRequest}\n * @returns A Promise of ReadReplica\n */\n createReadReplica = request => this.client.fetch({\n body: JSON.stringify(marshalCreateReadReplicaRequest$1(request, this.client.settings)),\n headers: jsonContentHeaders$l,\n method: 'POST',\n path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/read-replicas`\n }, unmarshalReadReplica$1);\n\n /**\n * Get a Read Replica. Retrieve information about a Database Instance Read\n * Replica. Full details about the Read Replica, like `endpoints`, `status`\n * and `region` are returned in the response.\n *\n * @param request - The request {@link GetReadReplicaRequest}\n * @returns A Promise of ReadReplica\n */\n getReadReplica = request => this.client.fetch({\n method: 'GET',\n path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/read-replicas/${validatePathParam('readReplicaId', request.readReplicaId)}`\n }, unmarshalReadReplica$1);\n\n /**\n * Waits for {@link ReadReplica} to be in a final state.\n *\n * @param request - The request {@link GetReadReplicaRequest}\n * @param options - The waiting options\n * @returns A Promise of ReadReplica\n */\n waitForReadReplica = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!READ_REPLICA_TRANSIENT_STATUSES$1.includes(res.status))), this.getReadReplica, request, options);\n\n /**\n * Delete a Read Replica. Delete a Read Replica of a Database Instance. You\n * must specify the `region` and `read_replica_id` parameters of the Read\n * Replica you want to delete.\n *\n * @param request - The request {@link DeleteReadReplicaRequest}\n * @returns A Promise of ReadReplica\n */\n deleteReadReplica = request => this.client.fetch({\n method: 'DELETE',\n path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/read-replicas/${validatePathParam('readReplicaId', request.readReplicaId)}`\n }, unmarshalReadReplica$1);\n\n /**\n * Resync a Read Replica. When you resync a Read Replica, first it is reset,\n * then its data is resynchronized from the primary node. Your Read Replica\n * remains unavailable during the resync process. The duration of this process\n * is proportional to the size of your Database Instance. The configured\n * endpoints do not change.\n *\n * @param request - The request {@link ResetReadReplicaRequest}\n * @returns A Promise of ReadReplica\n */\n resetReadReplica = request => this.client.fetch({\n body: '{}',\n headers: jsonContentHeaders$l,\n method: 'POST',\n path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/read-replicas/${validatePathParam('readReplicaId', request.readReplicaId)}/reset`\n }, unmarshalReadReplica$1);\n\n /**\n * Promote a Read Replica. Promote a Read Replica to Database Instance\n * automatically.\n *\n * @param request - The request {@link PromoteReadReplicaRequest}\n * @returns A Promise of Instance\n */\n promoteReadReplica = request => this.client.fetch({\n body: '{}',\n headers: jsonContentHeaders$l,\n method: 'POST',\n path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/read-replicas/${validatePathParam('readReplicaId', request.readReplicaId)}/promote`\n }, unmarshalInstance$2);\n\n /**\n * Create an endpoint for a Read Replica. Create a new endpoint for a Read\n * Replica. Read Replicas can have at most one direct access and one Private\n * Network endpoint.\n *\n * @param request - The request {@link CreateReadReplicaEndpointRequest}\n * @returns A Promise of ReadReplica\n */\n createReadReplicaEndpoint = request => this.client.fetch({\n body: JSON.stringify(marshalCreateReadReplicaEndpointRequest$1(request, this.client.settings)),\n headers: jsonContentHeaders$l,\n method: 'POST',\n path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/read-replicas/${validatePathParam('readReplicaId', request.readReplicaId)}/endpoints`\n }, unmarshalReadReplica$1);\n\n /**\n * List available logs of a Database Instance. List the available logs of a\n * Database Instance. By default, the logs returned in the list are ordered by\n * creation date in ascending order, though this can be modified via the\n * order_by field.\n *\n * @param request - The request {@link ListInstanceLogsRequest}\n * @returns A Promise of ListInstanceLogsResponse\n */\n listInstanceLogs = request => this.client.fetch({\n method: 'GET',\n path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/logs`,\n urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'])\n }, unmarshalListInstanceLogsResponse$1);\n\n /**\n * Get given logs of a Database Instance. Retrieve information about the logs\n * of a Database Instance. Specify the `instance_log_id` and `region` in your\n * request to get information such as `download_url`, `status`, `expires_at`\n * and `created_at` about your logs in the response.\n *\n * @param request - The request {@link GetInstanceLogRequest}\n * @returns A Promise of InstanceLog\n */\n getInstanceLog = request => this.client.fetch({\n method: 'GET',\n path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/logs/${validatePathParam('instanceLogId', request.instanceLogId)}`\n }, unmarshalInstanceLog$1);\n\n /**\n * Waits for {@link InstanceLog} to be in a final state.\n *\n * @param request - The request {@link GetInstanceLogRequest}\n * @param options - The waiting options\n * @returns A Promise of InstanceLog\n */\n waitForInstanceLog = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!INSTANCE_LOG_TRANSIENT_STATUSES$1.includes(res.status))), this.getInstanceLog, request, options);\n\n /**\n * Purge remote Database Instance logs. Purge a given remote log from a\n * Database Instance. You can specify the `log_name` of the log you wish to\n * clean from your Database Instance.\n *\n * @param request - The request {@link PurgeInstanceLogsRequest}\n */\n purgeInstanceLogs = request => this.client.fetch({\n body: JSON.stringify(marshalPurgeInstanceLogsRequest$1(request, this.client.settings)),\n headers: jsonContentHeaders$l,\n method: 'POST',\n path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/purge-logs`\n });\n\n /**\n * List remote Database Instance logs details. List remote log details. By\n * default, the details returned in the list are ordered by creation date in\n * ascending order, though this can be modified via the order_by field.\n *\n * @param request - The request {@link ListInstanceLogsDetailsRequest}\n * @returns A Promise of ListInstanceLogsDetailsResponse\n */\n listInstanceLogsDetails = request => this.client.fetch({\n method: 'GET',\n path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/logs-details`\n }, unmarshalListInstanceLogsDetailsResponse$1);\n\n /**\n * Add Database Instance advanced settings. Add an advanced setting to a\n * Database Instance. You must set the `name` and the `value` of each\n * setting.\n *\n * @param request - The request {@link AddInstanceSettingsRequest}\n * @returns A Promise of AddInstanceSettingsResponse\n */\n addInstanceSettings = request => this.client.fetch({\n body: JSON.stringify(marshalAddInstanceSettingsRequest$1(request, this.client.settings)),\n headers: jsonContentHeaders$l,\n method: 'POST',\n path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/settings`\n }, unmarshalAddInstanceSettingsResponse$1);\n\n /**\n * Delete Database Instance advanced settings. Delete an advanced setting in a\n * Database Instance. You must specify the names of the settings you want to\n * delete in the request.\n *\n * @param request - The request {@link DeleteInstanceSettingsRequest}\n * @returns A Promise of DeleteInstanceSettingsResponse\n */\n deleteInstanceSettings = request => this.client.fetch({\n body: JSON.stringify(marshalDeleteInstanceSettingsRequest$1(request, this.client.settings)),\n headers: jsonContentHeaders$l,\n method: 'DELETE',\n path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/settings`\n }, unmarshalDeleteInstanceSettingsResponse$1);\n\n /**\n * Set Database Instance advanced settings. Update an advanced setting for a\n * Database Instance. Settings added upon database engine initalization can\n * only be defined once, and cannot, therefore, be updated.\n *\n * @param request - The request {@link SetInstanceSettingsRequest}\n * @returns A Promise of SetInstanceSettingsResponse\n */\n setInstanceSettings = request => this.client.fetch({\n body: JSON.stringify(marshalSetInstanceSettingsRequest$1(request, this.client.settings)),\n headers: jsonContentHeaders$l,\n method: 'PUT',\n path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/settings`\n }, unmarshalSetInstanceSettingsResponse$1);\n pageOfListInstanceACLRules = request => this.client.fetch({\n method: 'GET',\n path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/acls`,\n urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])\n }, unmarshalListInstanceACLRulesResponse$1);\n\n /**\n * List ACL rules of a Database Instance. List the ACL rules for a given\n * Database Instance. The response is an array of ACL objects, each one\n * representing an ACL that denies, allows or redirects traffic based on\n * certain conditions.\n *\n * @param request - The request {@link ListInstanceACLRulesRequest}\n * @returns A Promise of ListInstanceACLRulesResponse\n */\n listInstanceACLRules = request => enrichForPagination('rules', this.pageOfListInstanceACLRules, request);\n\n /**\n * Add an ACL rule to a Database Instance. Add an additional ACL rule to a\n * Database Instance.\n *\n * @param request - The request {@link AddInstanceACLRulesRequest}\n * @returns A Promise of AddInstanceACLRulesResponse\n */\n addInstanceACLRules = request => this.client.fetch({\n body: JSON.stringify(marshalAddInstanceACLRulesRequest$1(request, this.client.settings)),\n headers: jsonContentHeaders$l,\n method: 'POST',\n path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/acls`\n }, unmarshalAddInstanceACLRulesResponse$1);\n\n /**\n * Set ACL rules for a Database Instance. Replace all the ACL rules of a\n * Database Instance.\n *\n * @param request - The request {@link SetInstanceACLRulesRequest}\n * @returns A Promise of SetInstanceACLRulesResponse\n */\n setInstanceACLRules = request => this.client.fetch({\n body: JSON.stringify(marshalSetInstanceACLRulesRequest$1(request, this.client.settings)),\n headers: jsonContentHeaders$l,\n method: 'PUT',\n path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/acls`\n }, unmarshalSetInstanceACLRulesResponse$1);\n\n /**\n * Delete ACL rules of a Database Instance. Delete one or more ACL rules of a\n * Database Instance.\n *\n * @param request - The request {@link DeleteInstanceACLRulesRequest}\n * @returns A Promise of DeleteInstanceACLRulesResponse\n */\n deleteInstanceACLRules = request => this.client.fetch({\n body: JSON.stringify(marshalDeleteInstanceACLRulesRequest$1(request, this.client.settings)),\n headers: jsonContentHeaders$l,\n method: 'DELETE',\n path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/acls`\n }, unmarshalDeleteInstanceACLRulesResponse$1);\n pageOfListUsers = request => this.client.fetch({\n method: 'GET',\n path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/users`,\n urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'name_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])\n }, unmarshalListUsersResponse$2);\n\n /**\n * List users of a Database Instance. List all users of a given Database\n * Instance. By default, the users returned in the list are ordered by\n * creation date in ascending order, though this can be modified via the\n * order_by field.\n *\n * @param request - The request {@link ListUsersRequest}\n * @returns A Promise of ListUsersResponse\n */\n listUsers = request => enrichForPagination('users', this.pageOfListUsers, request);\n\n /**\n * Create a user for a Database Instance. Create a new user for a Database\n * Instance. You must define the `name`, `password` and `is_admin`\n * parameters.\n *\n * @param request - The request {@link CreateUserRequest}\n * @returns A Promise of User\n */\n createUser = request => this.client.fetch({\n body: JSON.stringify(marshalCreateUserRequest$2(request, this.client.settings)),\n headers: jsonContentHeaders$l,\n method: 'POST',\n path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/users`\n }, unmarshalUser$2);\n\n /**\n * Update a user on a Database Instance. Update the parameters of a user on a\n * Database Instance. You can update the `password` and `is_admin` parameters,\n * but you cannot change the name of the user.\n *\n * @param request - The request {@link UpdateUserRequest}\n * @returns A Promise of User\n */\n updateUser = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateUserRequest$1(request, this.client.settings)),\n headers: jsonContentHeaders$l,\n method: 'PATCH',\n path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/users/${validatePathParam('name', request.name)}`\n }, unmarshalUser$2);\n\n /**\n * Delete a user on a Database Instance. Delete a given user on a Database\n * Instance. You must specify, in the endpoint, the `region`, `instance_id`\n * and `name` parameters of the user you want to delete.\n *\n * @param request - The request {@link DeleteUserRequest}\n */\n deleteUser = request => this.client.fetch({\n method: 'DELETE',\n path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/users/${validatePathParam('name', request.name)}`\n });\n pageOfListDatabases = request => this.client.fetch({\n method: 'GET',\n path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/databases`,\n urlParams: urlParams(['managed', request.managed], ['name', request.name], ['order_by', request.orderBy ?? 'name_asc'], ['owner', request.owner], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])\n }, unmarshalListDatabasesResponse$1);\n\n /**\n * List databases in a Database Instance. List all databases of a given\n * Database Instance. By default, the databases returned in the list are\n * ordered by creation date in ascending order, though this can be modified\n * via the order_by field. You can define additional parameters for your\n * query, such as `name`, `managed` and `owner`.\n *\n * @param request - The request {@link ListDatabasesRequest}\n * @returns A Promise of ListDatabasesResponse\n */\n listDatabases = request => enrichForPagination('databases', this.pageOfListDatabases, request);\n\n /**\n * Create a database in a Database Instance. Create a new database. You must\n * define the `name` parameter in the request.\n *\n * @param request - The request {@link CreateDatabaseRequest}\n * @returns A Promise of Database\n */\n createDatabase = request => this.client.fetch({\n body: JSON.stringify(marshalCreateDatabaseRequest$1(request, this.client.settings)),\n headers: jsonContentHeaders$l,\n method: 'POST',\n path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/databases`\n }, unmarshalDatabase$1);\n\n /**\n * Delete a database in a Database Instance. Delete a given database on a\n * Database Instance. You must specify, in the endpoint, the `region`,\n * `instance_id` and `name` parameters of the database you want to delete.\n *\n * @param request - The request {@link DeleteDatabaseRequest}\n */\n deleteDatabase = request => this.client.fetch({\n method: 'DELETE',\n path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/databases/${validatePathParam('name', request.name)}`\n });\n pageOfListPrivileges = request => this.client.fetch({\n method: 'GET',\n path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/privileges`,\n urlParams: urlParams(['database_name', request.databaseName], ['order_by', request.orderBy ?? 'user_name_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['user_name', request.userName])\n }, unmarshalListPrivilegesResponse$1);\n\n /**\n * List user privileges for a database. List privileges of a user on a\n * database. By default, the details returned in the list are ordered by\n * creation date in ascending order, though this can be modified via the\n * order_by field. You can define additional parameters for your query, such\n * as `database_name` and `user_name`.\n *\n * @param request - The request {@link ListPrivilegesRequest}\n * @returns A Promise of ListPrivilegesResponse\n */\n listPrivileges = request => enrichForPagination('privileges', this.pageOfListPrivileges, request);\n\n /**\n * Set user privileges for a database. Set the privileges of a user on a\n * database. You must define `database_name`, `user_name` and `permission` in\n * the request body.\n *\n * @param request - The request {@link SetPrivilegeRequest}\n * @returns A Promise of Privilege\n */\n setPrivilege = request => this.client.fetch({\n body: JSON.stringify(marshalSetPrivilegeRequest$1(request, this.client.settings)),\n headers: jsonContentHeaders$l,\n method: 'PUT',\n path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/privileges`\n }, unmarshalPrivilege$1);\n pageOfListSnapshots = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/snapshots`,\n urlParams: urlParams(['instance_id', request.instanceId], ['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])\n }, unmarshalListSnapshotsResponse$2);\n\n /**\n * List snapshots. List snapshots. You can include the `instance_id` or\n * `project_id` in your query to get the list of snapshots for specific\n * Database Instances and/or Projects. By default, the details returned in the\n * list are ordered by creation date in ascending order, though this can be\n * modified via the `order_by` field.\n *\n * @param request - The request {@link ListSnapshotsRequest}\n * @returns A Promise of ListSnapshotsResponse\n */\n listSnapshots = (request = {}) => enrichForPagination('snapshots', this.pageOfListSnapshots, request);\n\n /**\n * Get a Database Instance snapshot. Retrieve information about a given\n * snapshot, specified by its `snapshot_id` and `region`. Full details about\n * the snapshot, like size and expiration date, are returned in the response.\n *\n * @param request - The request {@link GetSnapshotRequest}\n * @returns A Promise of Snapshot\n */\n getSnapshot = request => this.client.fetch({\n method: 'GET',\n path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/snapshots/${validatePathParam('snapshotId', request.snapshotId)}`\n }, unmarshalSnapshot$2);\n\n /**\n * Waits for {@link Snapshot} to be in a final state.\n *\n * @param request - The request {@link GetSnapshotRequest}\n * @param options - The waiting options\n * @returns A Promise of Snapshot\n */\n waitForSnapshot = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!SNAPSHOT_TRANSIENT_STATUSES$2.includes(res.status))), this.getSnapshot, request, options);\n\n /**\n * Create a Database Instance snapshot. Create a new snapshot of a Database\n * Instance. You must define the `name` parameter in the request.\n *\n * @param request - The request {@link CreateSnapshotRequest}\n * @returns A Promise of Snapshot\n */\n createSnapshot = request => this.client.fetch({\n body: JSON.stringify(marshalCreateSnapshotRequest$2(request, this.client.settings)),\n headers: jsonContentHeaders$l,\n method: 'POST',\n path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/snapshots`\n }, unmarshalSnapshot$2);\n\n /**\n * Update a Database Instance snapshot. Update the parameters of a snapshot of\n * a Database Instance. You can update the `name` and `expires_at`\n * parameters.\n *\n * @param request - The request {@link UpdateSnapshotRequest}\n * @returns A Promise of Snapshot\n */\n updateSnapshot = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateSnapshotRequest$1(request, this.client.settings)),\n headers: jsonContentHeaders$l,\n method: 'PATCH',\n path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/snapshots/${validatePathParam('snapshotId', request.snapshotId)}`\n }, unmarshalSnapshot$2);\n\n /**\n * Delete a Database Instance snapshot. Delete a given snapshot of a Database\n * Instance. You must specify, in the endpoint, the `region` and `snapshot_id`\n * parameters of the snapshot you want to delete.\n *\n * @param request - The request {@link DeleteSnapshotRequest}\n * @returns A Promise of Snapshot\n */\n deleteSnapshot = request => this.client.fetch({\n method: 'DELETE',\n path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/snapshots/${validatePathParam('snapshotId', request.snapshotId)}`\n }, unmarshalSnapshot$2);\n\n /**\n * Create a new Database Instance from a snapshot. Restore a snapshot. When\n * you restore a snapshot, a new Instance is created and billed to your\n * account. Note that is possible to select a larger node type for your new\n * Database Instance. However, the Block volume size will be the same as the\n * size of the restored snapshot. All Instance settings will be restored if\n * you chose a node type with the same or more memory size than the initial\n * Instance. Settings will be reset to the default if your node type has less\n * memory.\n *\n * @param request - The request {@link CreateInstanceFromSnapshotRequest}\n * @returns A Promise of Instance\n */\n createInstanceFromSnapshot = request => this.client.fetch({\n body: JSON.stringify(marshalCreateInstanceFromSnapshotRequest$1(request, this.client.settings)),\n headers: jsonContentHeaders$l,\n method: 'POST',\n path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/snapshots/${validatePathParam('snapshotId', request.snapshotId)}/create-instance`\n }, unmarshalInstance$2);\n\n /**\n * Create a new Database Instance endpoint. Create a new endpoint for a\n * Database Instance. You can add `load_balancer` and `private_network`\n * specifications to the body of the request.\n *\n * @param request - The request {@link CreateEndpointRequest}\n * @returns A Promise of Endpoint\n */\n createEndpoint = request => this.client.fetch({\n body: JSON.stringify(marshalCreateEndpointRequest$1(request, this.client.settings)),\n headers: jsonContentHeaders$l,\n method: 'POST',\n path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/endpoints`\n }, unmarshalEndpoint$2);\n\n /**\n * Delete a Database Instance endpoint. Delete the endpoint of a Database\n * Instance. You must specify the `region` and `endpoint_id` parameters of the\n * endpoint you want to delete. Note that might need to update any environment\n * configurations that point to the deleted endpoint.\n *\n * @param request - The request {@link DeleteEndpointRequest}\n */\n deleteEndpoint = request => this.client.fetch({\n method: 'DELETE',\n path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/endpoints/${validatePathParam('endpointId', request.endpointId)}`\n });\n\n /**\n * Get a Database Instance endpoint. Retrieve information about a Database\n * Instance endpoint. Full details about the endpoint, like `ip`, `port`,\n * `private_network` and `load_balancer` specifications are returned in the\n * response.\n *\n * @param request - The request {@link GetEndpointRequest}\n * @returns A Promise of Endpoint\n */\n getEndpoint = request => this.client.fetch({\n method: 'GET',\n path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/endpoints/${validatePathParam('endpointId', request.endpointId)}`\n }, unmarshalEndpoint$2);\n\n /**\n * Migrate Database Instance endpoint. Migrate an existing Database Instance\n * endpoint to another Database Instance.\n *\n * @param request - The request {@link MigrateEndpointRequest}\n * @returns A Promise of Endpoint\n */\n migrateEndpoint = request => this.client.fetch({\n body: JSON.stringify(marshalMigrateEndpointRequest$1(request, this.client.settings)),\n headers: jsonContentHeaders$l,\n method: 'POST',\n path: `/document-db/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/endpoints/${validatePathParam('endpointId', request.endpointId)}/migrate`\n }, unmarshalEndpoint$2);\n};\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\nconst UpdateInstanceRequest$1 = {\n backupScheduleStartHour: {\n lessThanOrEqual: 23\n }\n};\n\nvar validationRules_gen$6 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n UpdateInstanceRequest: UpdateInstanceRequest$1\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\nvar index_gen$k = /*#__PURE__*/Object.freeze({\n __proto__: null,\n API: API$m,\n INSTANCE_LOG_TRANSIENT_STATUSES: INSTANCE_LOG_TRANSIENT_STATUSES$1,\n INSTANCE_TRANSIENT_STATUSES: INSTANCE_TRANSIENT_STATUSES$2,\n MAINTENANCE_TRANSIENT_STATUSES: MAINTENANCE_TRANSIENT_STATUSES$1,\n READ_REPLICA_TRANSIENT_STATUSES: READ_REPLICA_TRANSIENT_STATUSES$1,\n SNAPSHOT_TRANSIENT_STATUSES: SNAPSHOT_TRANSIENT_STATUSES$2,\n ValidationRules: validationRules_gen$6\n});\n\nvar index$n = /*#__PURE__*/Object.freeze({\n __proto__: null,\n v1beta1: index_gen$k\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\n/** Lists transient statutes of the enum {@link DNSZoneStatus}. */\nconst DNS_ZONE_TRANSIENT_STATUSES = ['pending'];\n\n/** Lists transient statutes of the enum {@link DomainFeatureStatus}. */\nconst DOMAIN_FEATURE_TRANSIENT_STATUSES = ['enabling', 'disabling'];\n\n/**\n * Lists transient statutes of the enum\n * {@link DomainRegistrationStatusTransferStatus}.\n */\nconst DOMAIN_REGISTRATION_STATUS_TRANSFER_TRANSIENT_STATUSES = ['pending', 'processing'];\n\n/** Lists transient statutes of the enum {@link DomainStatus}. */\nconst DOMAIN_TRANSIENT_STATUSES$2 = ['creating', 'renewing', 'xfering', 'expiring', 'updating', 'checking', 'deleting'];\n\n/** Lists transient statutes of the enum {@link HostStatus}. */\nconst HOST_TRANSIENT_STATUSES = ['updating', 'deleting'];\n\n/** Lists transient statutes of the enum {@link SSLCertificateStatus}. */\nconst SSL_CERTIFICATE_TRANSIENT_STATUSES = ['pending'];\n\n/** Lists transient statutes of the enum {@link TaskStatus}. */\nconst TASK_TRANSIENT_STATUSES$1 = ['pending'];\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst unmarshalDomainRecordGeoIPConfigMatch = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'DomainRecordGeoIPConfigMatch' failed as data isn't a dictionary.`);\n }\n return {\n continents: data.continents,\n countries: data.countries,\n data: data.data\n };\n};\nconst unmarshalDomainRecordViewConfigView = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'DomainRecordViewConfigView' failed as data isn't a dictionary.`);\n }\n return {\n data: data.data,\n subnet: data.subnet\n };\n};\nconst unmarshalDomainRecordWeightedConfigWeightedIP = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'DomainRecordWeightedConfigWeightedIP' failed as data isn't a dictionary.`);\n }\n return {\n ip: data.ip,\n weight: data.weight\n };\n};\nconst unmarshalContactExtensionFRAssociationInfo = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ContactExtensionFRAssociationInfo' failed as data isn't a dictionary.`);\n }\n return {\n publicationJo: unmarshalDate(data.publication_jo),\n publicationJoPage: data.publication_jo_page\n };\n};\nconst unmarshalContactExtensionFRCodeAuthAfnicInfo = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ContactExtensionFRCodeAuthAfnicInfo' failed as data isn't a dictionary.`);\n }\n return {\n codeAuthAfnic: data.code_auth_afnic\n };\n};\nconst unmarshalContactExtensionFRDunsInfo = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ContactExtensionFRDunsInfo' failed as data isn't a dictionary.`);\n }\n return {\n dunsId: data.duns_id,\n localId: data.local_id\n };\n};\nconst unmarshalContactExtensionFRIndividualInfo = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ContactExtensionFRIndividualInfo' failed as data isn't a dictionary.`);\n }\n return {\n whoisOptIn: data.whois_opt_in\n };\n};\nconst unmarshalContactExtensionFRTrademarkInfo = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ContactExtensionFRTrademarkInfo' failed as data isn't a dictionary.`);\n }\n return {\n trademarkInpi: data.trademark_inpi\n };\n};\nconst unmarshalDSRecordPublicKey = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'DSRecordPublicKey' failed as data isn't a dictionary.`);\n }\n return {\n key: data.key\n };\n};\nconst unmarshalDomainRecordGeoIPConfig = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'DomainRecordGeoIPConfig' failed as data isn't a dictionary.`);\n }\n return {\n default: data.default,\n matches: unmarshalArrayOfObject(data.matches, unmarshalDomainRecordGeoIPConfigMatch)\n };\n};\nconst unmarshalDomainRecordHTTPServiceConfig = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'DomainRecordHTTPServiceConfig' failed as data isn't a dictionary.`);\n }\n return {\n ips: data.ips,\n mustContain: data.must_contain,\n strategy: data.strategy,\n url: data.url,\n userAgent: data.user_agent\n };\n};\nconst unmarshalDomainRecordViewConfig = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'DomainRecordViewConfig' failed as data isn't a dictionary.`);\n }\n return {\n views: unmarshalArrayOfObject(data.views, unmarshalDomainRecordViewConfigView)\n };\n};\nconst unmarshalDomainRecordWeightedConfig = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'DomainRecordWeightedConfig' failed as data isn't a dictionary.`);\n }\n return {\n weightedIps: unmarshalArrayOfObject(data.weighted_ips, unmarshalDomainRecordWeightedConfigWeightedIP)\n };\n};\nconst unmarshalContactExtensionEU = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ContactExtensionEU' failed as data isn't a dictionary.`);\n }\n return {\n europeanCitizenship: data.european_citizenship\n };\n};\nconst unmarshalContactExtensionFR = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ContactExtensionFR' failed as data isn't a dictionary.`);\n }\n return {\n associationInfo: data.association_info ? unmarshalContactExtensionFRAssociationInfo(data.association_info) : undefined,\n codeAuthAfnicInfo: data.code_auth_afnic_info ? unmarshalContactExtensionFRCodeAuthAfnicInfo(data.code_auth_afnic_info) : undefined,\n dunsInfo: data.duns_info ? unmarshalContactExtensionFRDunsInfo(data.duns_info) : undefined,\n individualInfo: data.individual_info ? unmarshalContactExtensionFRIndividualInfo(data.individual_info) : undefined,\n mode: data.mode,\n trademarkInfo: data.trademark_info ? unmarshalContactExtensionFRTrademarkInfo(data.trademark_info) : undefined\n };\n};\nconst unmarshalContactExtensionNL = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ContactExtensionNL' failed as data isn't a dictionary.`);\n }\n return {\n legalForm: data.legal_form,\n legalFormRegistrationNumber: data.legal_form_registration_number\n };\n};\nconst unmarshalContactQuestion = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ContactQuestion' failed as data isn't a dictionary.`);\n }\n return {\n answer: data.answer,\n question: data.question\n };\n};\nconst unmarshalDSRecordDigest = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'DSRecordDigest' failed as data isn't a dictionary.`);\n }\n return {\n digest: data.digest,\n publicKey: data.public_key ? unmarshalDSRecordPublicKey(data.public_key) : undefined,\n type: data.type\n };\n};\nconst unmarshalDomainRecord = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'DomainRecord' failed as data isn't a dictionary.`);\n }\n return {\n comment: data.comment,\n data: data.data,\n geoIpConfig: data.geo_ip_config ? unmarshalDomainRecordGeoIPConfig(data.geo_ip_config) : undefined,\n httpServiceConfig: data.http_service_config ? unmarshalDomainRecordHTTPServiceConfig(data.http_service_config) : undefined,\n id: data.id,\n name: data.name,\n priority: data.priority,\n ttl: data.ttl,\n type: data.type,\n viewConfig: data.view_config ? unmarshalDomainRecordViewConfig(data.view_config) : undefined,\n weightedConfig: data.weighted_config ? unmarshalDomainRecordWeightedConfig(data.weighted_config) : undefined\n };\n};\nconst unmarshalRecordIdentifier = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'RecordIdentifier' failed as data isn't a dictionary.`);\n }\n return {\n data: data.data,\n name: data.name,\n ttl: data.ttl,\n type: data.type\n };\n};\nconst unmarshalTldOffer = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'TldOffer' failed as data isn't a dictionary.`);\n }\n return {\n action: data.action,\n operationPath: data.operation_path,\n price: data.price ? unmarshalMoney(data.price) : undefined\n };\n};\nconst unmarshalContact = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Contact' failed as data isn't a dictionary.`);\n }\n return {\n addressLine1: data.address_line_1,\n addressLine2: data.address_line_2,\n city: data.city,\n companyIdentificationCode: data.company_identification_code,\n companyName: data.company_name,\n country: data.country,\n email: data.email,\n emailAlt: data.email_alt,\n emailStatus: data.email_status,\n extensionEu: data.extension_eu ? unmarshalContactExtensionEU(data.extension_eu) : undefined,\n extensionFr: data.extension_fr ? unmarshalContactExtensionFR(data.extension_fr) : undefined,\n extensionNl: data.extension_nl ? unmarshalContactExtensionNL(data.extension_nl) : undefined,\n faxNumber: data.fax_number,\n firstname: data.firstname,\n id: data.id,\n lang: data.lang,\n lastname: data.lastname,\n legalForm: data.legal_form,\n phoneNumber: data.phone_number,\n questions: unmarshalArrayOfObject(data.questions, unmarshalContactQuestion, false),\n resale: data.resale,\n state: data.state,\n vatIdentificationCode: data.vat_identification_code,\n whoisOptIn: data.whois_opt_in,\n zip: data.zip\n };\n};\nconst unmarshalContactRolesRoles = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ContactRolesRoles' failed as data isn't a dictionary.`);\n }\n return {\n isAdministrative: data.is_administrative,\n isOwner: data.is_owner,\n isTechnical: data.is_technical\n };\n};\nconst unmarshalDSRecord = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'DSRecord' failed as data isn't a dictionary.`);\n }\n return {\n algorithm: data.algorithm,\n digest: data.digest ? unmarshalDSRecordDigest(data.digest) : undefined,\n keyId: data.key_id,\n publicKey: data.public_key ? unmarshalDSRecordPublicKey(data.public_key) : undefined\n };\n};\nconst unmarshalDomainRegistrationStatusExternalDomain = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'DomainRegistrationStatusExternalDomain' failed as data isn't a dictionary.`);\n }\n return {\n validationToken: data.validation_token\n };\n};\nconst unmarshalDomainRegistrationStatusTransfer = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'DomainRegistrationStatusTransfer' failed as data isn't a dictionary.`);\n }\n return {\n status: data.status,\n voteCurrentOwner: data.vote_current_owner,\n voteNewOwner: data.vote_new_owner\n };\n};\nconst unmarshalRecordChangeAdd = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'RecordChangeAdd' failed as data isn't a dictionary.`);\n }\n return {\n records: unmarshalArrayOfObject(data.records, unmarshalDomainRecord)\n };\n};\nconst unmarshalRecordChangeClear = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'RecordChangeClear' failed as data isn't a dictionary.`);\n }\n return {};\n};\nconst unmarshalRecordChangeDelete = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'RecordChangeDelete' failed as data isn't a dictionary.`);\n }\n return {\n id: data.id,\n idFields: data.id_fields ? unmarshalRecordIdentifier(data.id_fields) : undefined\n };\n};\nconst unmarshalRecordChangeSet = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'RecordChangeSet' failed as data isn't a dictionary.`);\n }\n return {\n id: data.id,\n idFields: data.id_fields ? unmarshalRecordIdentifier(data.id_fields) : undefined,\n records: unmarshalArrayOfObject(data.records, unmarshalDomainRecord)\n };\n};\nconst unmarshalTld = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Tld' failed as data isn't a dictionary.`);\n }\n return {\n dnssecSupport: data.dnssec_support,\n durationInYearsMax: data.duration_in_years_max,\n durationInYearsMin: data.duration_in_years_min,\n idnSupport: data.idn_support,\n name: data.name,\n offers: unmarshalMapOfObject(data.offers, unmarshalTldOffer),\n specifications: data.specifications\n };\n};\nconst unmarshalAvailableDomain = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'AvailableDomain' failed as data isn't a dictionary.`);\n }\n return {\n available: data.available,\n domain: data.domain,\n tld: data.tld ? unmarshalTld(data.tld) : undefined\n };\n};\nconst unmarshalCheckContactsCompatibilityResponseContactCheckResult = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'CheckContactsCompatibilityResponseContactCheckResult' failed as data isn't a dictionary.`);\n }\n return {\n compatible: data.compatible,\n errorMessage: data.error_message\n };\n};\nconst unmarshalContactRoles = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ContactRoles' failed as data isn't a dictionary.`);\n }\n return {\n contact: data.contact ? unmarshalContact(data.contact) : undefined,\n roles: unmarshalMapOfObject(data.roles, unmarshalContactRolesRoles)\n };\n};\nconst unmarshalDNSZone = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'DNSZone' failed as data isn't a dictionary.`);\n }\n return {\n domain: data.domain,\n message: data.message,\n ns: data.ns,\n nsDefault: data.ns_default,\n nsMaster: data.ns_master,\n projectId: data.project_id,\n status: data.status,\n subdomain: data.subdomain,\n updatedAt: unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalDNSZoneVersion = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'DNSZoneVersion' failed as data isn't a dictionary.`);\n }\n return {\n createdAt: unmarshalDate(data.created_at),\n id: data.id\n };\n};\nconst unmarshalDomainDNSSEC = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'DomainDNSSEC' failed as data isn't a dictionary.`);\n }\n return {\n dsRecords: unmarshalArrayOfObject(data.ds_records, unmarshalDSRecord),\n status: data.status\n };\n};\nconst unmarshalDomainSummary = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'DomainSummary' failed as data isn't a dictionary.`);\n }\n return {\n autoRenewStatus: data.auto_renew_status,\n dnssecStatus: data.dnssec_status,\n domain: data.domain,\n eppCode: data.epp_code,\n expiredAt: unmarshalDate(data.expired_at),\n externalDomainRegistrationStatus: data.external_domain_registration_status ? unmarshalDomainRegistrationStatusExternalDomain(data.external_domain_registration_status) : undefined,\n isExternal: data.is_external,\n organizationId: data.organization_id,\n projectId: data.project_id,\n registrar: data.registrar,\n status: data.status,\n transferRegistrationStatus: data.transfer_registration_status ? unmarshalDomainRegistrationStatusTransfer(data.transfer_registration_status) : undefined,\n updatedAt: unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalHost = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Host' failed as data isn't a dictionary.`);\n }\n return {\n domain: data.domain,\n ips: data.ips,\n name: data.name,\n status: data.status\n };\n};\nconst unmarshalNameserver$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Nameserver' failed as data isn't a dictionary.`);\n }\n return {\n ip: data.ip,\n name: data.name\n };\n};\nconst unmarshalRecordChange = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'RecordChange' failed as data isn't a dictionary.`);\n }\n return {\n add: data.add ? unmarshalRecordChangeAdd(data.add) : undefined,\n clear: data.clear ? unmarshalRecordChangeClear(data.clear) : undefined,\n delete: data.delete ? unmarshalRecordChangeDelete(data.delete) : undefined,\n set: data.set ? unmarshalRecordChangeSet(data.set) : undefined\n };\n};\nconst unmarshalRenewableDomain = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'RenewableDomain' failed as data isn't a dictionary.`);\n }\n return {\n domain: data.domain,\n estimatedDeleteAt: unmarshalDate(data.estimated_delete_at),\n expiredAt: unmarshalDate(data.expired_at),\n limitRedemptionAt: unmarshalDate(data.limit_redemption_at),\n limitRenewAt: unmarshalDate(data.limit_renew_at),\n organizationId: data.organization_id,\n projectId: data.project_id,\n renewableDurationInYears: data.renewable_duration_in_years,\n status: data.status,\n tld: data.tld ? unmarshalTld(data.tld) : undefined\n };\n};\nconst unmarshalSSLCertificate = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'SSLCertificate' failed as data isn't a dictionary.`);\n }\n return {\n alternativeDnsZones: data.alternative_dns_zones,\n certificateChain: data.certificate_chain,\n createdAt: unmarshalDate(data.created_at),\n dnsZone: data.dns_zone,\n expiredAt: unmarshalDate(data.expired_at),\n privateKey: data.private_key,\n status: data.status\n };\n};\nconst unmarshalTask$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Task' failed as data isn't a dictionary.`);\n }\n return {\n domain: data.domain,\n id: data.id,\n message: data.message,\n organizationId: data.organization_id,\n projectId: data.project_id,\n startedAt: unmarshalDate(data.started_at),\n status: data.status,\n type: data.type,\n updatedAt: unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalCheckContactsCompatibilityResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'CheckContactsCompatibilityResponse' failed as data isn't a dictionary.`);\n }\n return {\n administrativeCheckResult: data.administrative_check_result ? unmarshalCheckContactsCompatibilityResponseContactCheckResult(data.administrative_check_result) : undefined,\n compatible: data.compatible,\n ownerCheckResult: data.owner_check_result ? unmarshalCheckContactsCompatibilityResponseContactCheckResult(data.owner_check_result) : undefined,\n technicalCheckResult: data.technical_check_result ? unmarshalCheckContactsCompatibilityResponseContactCheckResult(data.technical_check_result) : undefined\n };\n};\nconst unmarshalClearDNSZoneRecordsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ClearDNSZoneRecordsResponse' failed as data isn't a dictionary.`);\n }\n return {};\n};\nconst unmarshalDeleteDNSZoneResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'DeleteDNSZoneResponse' failed as data isn't a dictionary.`);\n }\n return {};\n};\nconst unmarshalDeleteExternalDomainResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'DeleteExternalDomainResponse' failed as data isn't a dictionary.`);\n }\n return {};\n};\nconst unmarshalDeleteSSLCertificateResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'DeleteSSLCertificateResponse' failed as data isn't a dictionary.`);\n }\n return {};\n};\nconst unmarshalDomain$2 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Domain' failed as data isn't a dictionary.`);\n }\n return {\n administrativeContact: data.administrative_contact ? unmarshalContact(data.administrative_contact) : undefined,\n autoRenewStatus: data.auto_renew_status,\n dnssec: data.dnssec ? unmarshalDomainDNSSEC(data.dnssec) : undefined,\n dnsZones: unmarshalArrayOfObject(data.dns_zones, unmarshalDNSZone),\n domain: data.domain,\n eppCode: data.epp_code,\n expiredAt: unmarshalDate(data.expired_at),\n externalDomainRegistrationStatus: data.external_domain_registration_status ? unmarshalDomainRegistrationStatusExternalDomain(data.external_domain_registration_status) : undefined,\n isExternal: data.is_external,\n organizationId: data.organization_id,\n ownerContact: data.owner_contact ? unmarshalContact(data.owner_contact) : undefined,\n projectId: data.project_id,\n registrar: data.registrar,\n status: data.status,\n technicalContact: data.technical_contact ? unmarshalContact(data.technical_contact) : undefined,\n tld: data.tld ? unmarshalTld(data.tld) : undefined,\n transferRegistrationStatus: data.transfer_registration_status ? unmarshalDomainRegistrationStatusTransfer(data.transfer_registration_status) : undefined,\n updatedAt: unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalGetDNSZoneTsigKeyResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'GetDNSZoneTsigKeyResponse' failed as data isn't a dictionary.`);\n }\n return {\n algorithm: data.algorithm,\n key: data.key,\n name: data.name\n };\n};\nconst unmarshalGetDNSZoneVersionDiffResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'GetDNSZoneVersionDiffResponse' failed as data isn't a dictionary.`);\n }\n return {\n changes: unmarshalArrayOfObject(data.changes, unmarshalRecordChange)\n };\n};\nconst unmarshalGetDomainAuthCodeResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'GetDomainAuthCodeResponse' failed as data isn't a dictionary.`);\n }\n return {\n authCode: data.auth_code\n };\n};\nconst unmarshalImportProviderDNSZoneResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ImportProviderDNSZoneResponse' failed as data isn't a dictionary.`);\n }\n return {\n records: unmarshalArrayOfObject(data.records, unmarshalDomainRecord)\n };\n};\nconst unmarshalImportRawDNSZoneResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ImportRawDNSZoneResponse' failed as data isn't a dictionary.`);\n }\n return {\n records: unmarshalArrayOfObject(data.records, unmarshalDomainRecord)\n };\n};\nconst unmarshalListContactsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListContactsResponse' failed as data isn't a dictionary.`);\n }\n return {\n contacts: unmarshalArrayOfObject(data.contacts, unmarshalContactRoles),\n totalCount: data.total_count\n };\n};\nconst unmarshalListDNSZoneNameserversResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListDNSZoneNameserversResponse' failed as data isn't a dictionary.`);\n }\n return {\n ns: unmarshalArrayOfObject(data.ns, unmarshalNameserver$1)\n };\n};\nconst unmarshalListDNSZoneRecordsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListDNSZoneRecordsResponse' failed as data isn't a dictionary.`);\n }\n return {\n records: unmarshalArrayOfObject(data.records, unmarshalDomainRecord),\n totalCount: data.total_count\n };\n};\nconst unmarshalListDNSZoneVersionRecordsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListDNSZoneVersionRecordsResponse' failed as data isn't a dictionary.`);\n }\n return {\n records: unmarshalArrayOfObject(data.records, unmarshalDomainRecord),\n totalCount: data.total_count\n };\n};\nconst unmarshalListDNSZoneVersionsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListDNSZoneVersionsResponse' failed as data isn't a dictionary.`);\n }\n return {\n totalCount: data.total_count,\n versions: unmarshalArrayOfObject(data.versions, unmarshalDNSZoneVersion)\n };\n};\nconst unmarshalListDNSZonesResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListDNSZonesResponse' failed as data isn't a dictionary.`);\n }\n return {\n dnsZones: unmarshalArrayOfObject(data.dns_zones, unmarshalDNSZone),\n totalCount: data.total_count\n };\n};\nconst unmarshalListDomainHostsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListDomainHostsResponse' failed as data isn't a dictionary.`);\n }\n return {\n hosts: unmarshalArrayOfObject(data.hosts, unmarshalHost),\n totalCount: data.total_count\n };\n};\nconst unmarshalListDomainsResponse$2 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListDomainsResponse' failed as data isn't a dictionary.`);\n }\n return {\n domains: unmarshalArrayOfObject(data.domains, unmarshalDomainSummary),\n totalCount: data.total_count\n };\n};\nconst unmarshalListRenewableDomainsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListRenewableDomainsResponse' failed as data isn't a dictionary.`);\n }\n return {\n domains: unmarshalArrayOfObject(data.domains, unmarshalRenewableDomain),\n totalCount: data.total_count\n };\n};\nconst unmarshalListSSLCertificatesResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListSSLCertificatesResponse' failed as data isn't a dictionary.`);\n }\n return {\n certificates: unmarshalArrayOfObject(data.certificates, unmarshalSSLCertificate),\n totalCount: data.total_count\n };\n};\nconst unmarshalListTasksResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListTasksResponse' failed as data isn't a dictionary.`);\n }\n return {\n tasks: unmarshalArrayOfObject(data.tasks, unmarshalTask$1),\n totalCount: data.total_count\n };\n};\nconst unmarshalListTldsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListTldsResponse' failed as data isn't a dictionary.`);\n }\n return {\n tlds: unmarshalArrayOfObject(data.tlds, unmarshalTld),\n totalCount: data.total_count\n };\n};\nconst unmarshalOrderResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'OrderResponse' failed as data isn't a dictionary.`);\n }\n return {\n createdAt: unmarshalDate(data.created_at),\n domains: data.domains,\n organizationId: data.organization_id,\n projectId: data.project_id,\n taskId: data.task_id\n };\n};\nconst unmarshalRefreshDNSZoneResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'RefreshDNSZoneResponse' failed as data isn't a dictionary.`);\n }\n return {\n dnsZones: unmarshalArrayOfObject(data.dns_zones, unmarshalDNSZone)\n };\n};\nconst unmarshalRegisterExternalDomainResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'RegisterExternalDomainResponse' failed as data isn't a dictionary.`);\n }\n return {\n createdAt: unmarshalDate(data.created_at),\n domain: data.domain,\n organizationId: data.organization_id,\n projectId: data.project_id,\n validationToken: data.validation_token\n };\n};\nconst unmarshalRestoreDNSZoneVersionResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'RestoreDNSZoneVersionResponse' failed as data isn't a dictionary.`);\n }\n return {};\n};\nconst unmarshalSearchAvailableDomainsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'SearchAvailableDomainsResponse' failed as data isn't a dictionary.`);\n }\n return {\n availableDomains: unmarshalArrayOfObject(data.available_domains, unmarshalAvailableDomain)\n };\n};\nconst unmarshalUpdateDNSZoneNameserversResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'UpdateDNSZoneNameserversResponse' failed as data isn't a dictionary.`);\n }\n return {\n ns: unmarshalArrayOfObject(data.ns, unmarshalNameserver$1)\n };\n};\nconst unmarshalUpdateDNSZoneRecordsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'UpdateDNSZoneRecordsResponse' failed as data isn't a dictionary.`);\n }\n return {\n records: unmarshalArrayOfObject(data.records, unmarshalDomainRecord)\n };\n};\nconst marshalDomainRecordGeoIPConfigMatch = (request, defaults) => ({\n continents: request.continents,\n countries: request.countries,\n data: request.data\n});\nconst marshalDomainRecordViewConfigView = (request, defaults) => ({\n data: request.data,\n subnet: request.subnet\n});\nconst marshalDomainRecordWeightedConfigWeightedIP = (request, defaults) => ({\n ip: request.ip,\n weight: request.weight\n});\nconst marshalDomainRecordGeoIPConfig = (request, defaults) => ({\n default: request.default,\n matches: request.matches.map(elt => marshalDomainRecordGeoIPConfigMatch(elt))\n});\nconst marshalDomainRecordHTTPServiceConfig = (request, defaults) => ({\n ips: request.ips,\n must_contain: request.mustContain,\n strategy: request.strategy,\n url: request.url,\n user_agent: request.userAgent\n});\nconst marshalDomainRecordViewConfig = (request, defaults) => ({\n views: request.views.map(elt => marshalDomainRecordViewConfigView(elt))\n});\nconst marshalDomainRecordWeightedConfig = (request, defaults) => ({\n weighted_ips: request.weightedIps.map(elt => marshalDomainRecordWeightedConfigWeightedIP(elt))\n});\nconst marshalContactExtensionFRAssociationInfo = (request, defaults) => ({\n publication_jo: request.publicationJo,\n publication_jo_page: request.publicationJoPage\n});\nconst marshalContactExtensionFRCodeAuthAfnicInfo = (request, defaults) => ({\n code_auth_afnic: request.codeAuthAfnic\n});\nconst marshalContactExtensionFRDunsInfo = (request, defaults) => ({\n duns_id: request.dunsId,\n local_id: request.localId\n});\nconst marshalContactExtensionFRIndividualInfo = (request, defaults) => ({\n whois_opt_in: request.whoisOptIn\n});\nconst marshalContactExtensionFRTrademarkInfo = (request, defaults) => ({\n trademark_inpi: request.trademarkInpi\n});\nconst marshalDSRecordPublicKey = (request, defaults) => ({\n key: request.key\n});\nconst marshalDomainRecord = (request, defaults) => ({\n comment: request.comment,\n data: request.data,\n id: request.id,\n name: request.name,\n priority: request.priority,\n ttl: request.ttl,\n type: request.type,\n ...resolveOneOf([{\n param: 'geo_ip_config',\n value: request.geoIpConfig ? marshalDomainRecordGeoIPConfig(request.geoIpConfig) : undefined\n }, {\n param: 'http_service_config',\n value: request.httpServiceConfig ? marshalDomainRecordHTTPServiceConfig(request.httpServiceConfig) : undefined\n }, {\n param: 'weighted_config',\n value: request.weightedConfig ? marshalDomainRecordWeightedConfig(request.weightedConfig) : undefined\n }, {\n param: 'view_config',\n value: request.viewConfig ? marshalDomainRecordViewConfig(request.viewConfig) : undefined\n }])\n});\nconst marshalRecordIdentifier = (request, defaults) => ({\n data: request.data,\n name: request.name,\n ttl: request.ttl,\n type: request.type\n});\nconst marshalContactExtensionEU = (request, defaults) => ({\n european_citizenship: request.europeanCitizenship\n});\nconst marshalContactExtensionFR = (request, defaults) => ({\n mode: request.mode,\n ...resolveOneOf([{\n param: 'individual_info',\n value: request.individualInfo ? marshalContactExtensionFRIndividualInfo(request.individualInfo) : undefined\n }, {\n param: 'duns_info',\n value: request.dunsInfo ? marshalContactExtensionFRDunsInfo(request.dunsInfo) : undefined\n }, {\n param: 'association_info',\n value: request.associationInfo ? marshalContactExtensionFRAssociationInfo(request.associationInfo) : undefined\n }, {\n param: 'trademark_info',\n value: request.trademarkInfo ? marshalContactExtensionFRTrademarkInfo(request.trademarkInfo) : undefined\n }, {\n param: 'code_auth_afnic_info',\n value: request.codeAuthAfnicInfo ? marshalContactExtensionFRCodeAuthAfnicInfo(request.codeAuthAfnicInfo) : undefined\n }])\n});\nconst marshalContactExtensionNL = (request, defaults) => ({\n legal_form: request.legalForm,\n legal_form_registration_number: request.legalFormRegistrationNumber\n});\nconst marshalContactQuestion = (request, defaults) => ({\n answer: request.answer,\n question: request.question\n});\nconst marshalDSRecordDigest = (request, defaults) => ({\n digest: request.digest,\n public_key: request.publicKey ? marshalDSRecordPublicKey(request.publicKey) : undefined,\n type: request.type\n});\nconst marshalImportRawDNSZoneRequestTsigKey = (request, defaults) => ({\n algorithm: request.algorithm,\n key: request.key,\n name: request.name\n});\nconst marshalRecordChangeAdd = (request, defaults) => ({\n records: request.records.map(elt => marshalDomainRecord(elt))\n});\nconst marshalRecordChangeClear = (request, defaults) => ({});\nconst marshalRecordChangeDelete = (request, defaults) => ({\n ...resolveOneOf([{\n param: 'id',\n value: request.id\n }, {\n param: 'id_fields',\n value: request.idFields ? marshalRecordIdentifier(request.idFields) : undefined\n }])\n});\nconst marshalRecordChangeSet = (request, defaults) => ({\n records: request.records.map(elt => marshalDomainRecord(elt)),\n ...resolveOneOf([{\n param: 'id',\n value: request.id\n }, {\n param: 'id_fields',\n value: request.idFields ? marshalRecordIdentifier(request.idFields) : undefined\n }])\n});\nconst marshalDSRecord = (request, defaults) => ({\n algorithm: request.algorithm,\n key_id: request.keyId,\n ...resolveOneOf([{\n param: 'digest',\n value: request.digest ? marshalDSRecordDigest(request.digest) : undefined\n }, {\n param: 'public_key',\n value: request.publicKey ? marshalDSRecordPublicKey(request.publicKey) : undefined\n }])\n});\nconst marshalImportProviderDNSZoneRequestOnlineV1 = (request, defaults) => ({\n token: request.token\n});\nconst marshalImportRawDNSZoneRequestAXFRSource = (request, defaults) => ({\n name_server: request.nameServer,\n tsig_key: request.tsigKey ? marshalImportRawDNSZoneRequestTsigKey(request.tsigKey) : undefined\n});\nconst marshalImportRawDNSZoneRequestBindSource = (request, defaults) => ({\n content: request.content\n});\nconst marshalNameserver = (request, defaults) => ({\n ip: request.ip,\n name: request.name\n});\nconst marshalNewContact = (request, defaults) => ({\n address_line_1: request.addressLine1,\n address_line_2: request.addressLine2,\n city: request.city,\n company_identification_code: request.companyIdentificationCode,\n company_name: request.companyName,\n country: request.country,\n email: request.email,\n email_alt: request.emailAlt,\n extension_eu: request.extensionEu ? marshalContactExtensionEU(request.extensionEu) : undefined,\n extension_fr: request.extensionFr ? marshalContactExtensionFR(request.extensionFr) : undefined,\n extension_nl: request.extensionNl ? marshalContactExtensionNL(request.extensionNl) : undefined,\n fax_number: request.faxNumber,\n firstname: request.firstname,\n lang: request.lang,\n lastname: request.lastname,\n legal_form: request.legalForm,\n phone_number: request.phoneNumber,\n questions: request.questions ? request.questions.map(elt => marshalContactQuestion(elt)) : undefined,\n resale: request.resale,\n state: request.state,\n vat_identification_code: request.vatIdentificationCode,\n whois_opt_in: request.whoisOptIn,\n zip: request.zip\n});\nconst marshalRecordChange = (request, defaults) => ({\n ...resolveOneOf([{\n param: 'add',\n value: request.add ? marshalRecordChangeAdd(request.add) : undefined\n }, {\n param: 'set',\n value: request.set ? marshalRecordChangeSet(request.set) : undefined\n }, {\n param: 'delete',\n value: request.delete ? marshalRecordChangeDelete(request.delete) : undefined\n }, {\n param: 'clear',\n value: request.clear ? marshalRecordChangeClear(request.clear) : undefined\n }])\n});\nconst marshalTransferInDomainRequestTransferRequest = (request, defaults) => ({\n auth_code: request.authCode,\n domain: request.domain\n});\nconst marshalUpdateContactRequestQuestion = (request, defaults) => ({\n answer: request.answer,\n question: request.question\n});\nconst marshalCloneDNSZoneRequest = (request, defaults) => ({\n dest_dns_zone: request.destDnsZone,\n overwrite: request.overwrite,\n project_id: request.projectId\n});\nconst marshalCreateDNSZoneRequest = (request, defaults) => ({\n domain: request.domain,\n project_id: request.projectId ?? defaults.defaultProjectId,\n subdomain: request.subdomain\n});\nconst marshalCreateSSLCertificateRequest = (request, defaults) => ({\n alternative_dns_zones: request.alternativeDnsZones,\n dns_zone: request.dnsZone\n});\nconst marshalImportProviderDNSZoneRequest = (request, defaults) => ({\n ...resolveOneOf([{\n param: 'online_v1',\n value: request.onlineV1 ? marshalImportProviderDNSZoneRequestOnlineV1(request.onlineV1) : undefined\n }])\n});\nconst marshalImportRawDNSZoneRequest = (request, defaults) => ({\n content: request.content,\n format: request.format,\n project_id: request.projectId ?? defaults.defaultProjectId,\n ...resolveOneOf([{\n param: 'bind_source',\n value: request.bindSource ? marshalImportRawDNSZoneRequestBindSource(request.bindSource) : undefined\n }, {\n param: 'axfr_source',\n value: request.axfrSource ? marshalImportRawDNSZoneRequestAXFRSource(request.axfrSource) : undefined\n }])\n});\nconst marshalRefreshDNSZoneRequest = (request, defaults) => ({\n recreate_dns_zone: request.recreateDnsZone,\n recreate_sub_dns_zone: request.recreateSubDnsZone\n});\nconst marshalRegistrarApiBuyDomainsRequest = (request, defaults) => ({\n domains: request.domains,\n duration_in_years: request.durationInYears,\n project_id: request.projectId ?? defaults.defaultProjectId,\n ...resolveOneOf([{\n param: 'administrative_contact_id',\n value: request.administrativeContactId\n }, {\n param: 'administrative_contact',\n value: request.administrativeContact ? marshalNewContact(request.administrativeContact) : undefined\n }]),\n ...resolveOneOf([{\n param: 'owner_contact_id',\n value: request.ownerContactId\n }, {\n param: 'owner_contact',\n value: request.ownerContact ? marshalNewContact(request.ownerContact) : undefined\n }]),\n ...resolveOneOf([{\n param: 'technical_contact_id',\n value: request.technicalContactId\n }, {\n param: 'technical_contact',\n value: request.technicalContact ? marshalNewContact(request.technicalContact) : undefined\n }])\n});\nconst marshalRegistrarApiCheckContactsCompatibilityRequest = (request, defaults) => ({\n domains: request.domains,\n tlds: request.tlds,\n ...resolveOneOf([{\n param: 'administrative_contact_id',\n value: request.administrativeContactId\n }, {\n param: 'administrative_contact',\n value: request.administrativeContact ? marshalNewContact(request.administrativeContact) : undefined\n }]),\n ...resolveOneOf([{\n param: 'owner_contact_id',\n value: request.ownerContactId\n }, {\n param: 'owner_contact',\n value: request.ownerContact ? marshalNewContact(request.ownerContact) : undefined\n }]),\n ...resolveOneOf([{\n param: 'technical_contact_id',\n value: request.technicalContactId\n }, {\n param: 'technical_contact',\n value: request.technicalContact ? marshalNewContact(request.technicalContact) : undefined\n }])\n});\nconst marshalRegistrarApiCreateDomainHostRequest = (request, defaults) => ({\n ips: request.ips,\n name: request.name\n});\nconst marshalRegistrarApiEnableDomainDNSSECRequest = (request, defaults) => ({\n ds_record: request.dsRecord ? marshalDSRecord(request.dsRecord) : undefined\n});\nconst marshalRegistrarApiRegisterExternalDomainRequest = (request, defaults) => ({\n domain: request.domain,\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalRegistrarApiRenewDomainsRequest = (request, defaults) => ({\n domains: request.domains,\n duration_in_years: request.durationInYears,\n force_late_renewal: request.forceLateRenewal\n});\nconst marshalRegistrarApiTradeDomainRequest = (request, defaults) => ({\n project_id: request.projectId,\n ...resolveOneOf([{\n param: 'new_owner_contact_id',\n value: request.newOwnerContactId\n }, {\n param: 'new_owner_contact',\n value: request.newOwnerContact ? marshalNewContact(request.newOwnerContact) : undefined\n }])\n});\nconst marshalRegistrarApiTransferInDomainRequest = (request, defaults) => ({\n domains: request.domains.map(elt => marshalTransferInDomainRequestTransferRequest(elt)),\n project_id: request.projectId ?? defaults.defaultProjectId,\n ...resolveOneOf([{\n param: 'administrative_contact_id',\n value: request.administrativeContactId\n }, {\n param: 'administrative_contact',\n value: request.administrativeContact ? marshalNewContact(request.administrativeContact) : undefined\n }]),\n ...resolveOneOf([{\n param: 'owner_contact_id',\n value: request.ownerContactId\n }, {\n param: 'owner_contact',\n value: request.ownerContact ? marshalNewContact(request.ownerContact) : undefined\n }]),\n ...resolveOneOf([{\n param: 'technical_contact_id',\n value: request.technicalContactId\n }, {\n param: 'technical_contact',\n value: request.technicalContact ? marshalNewContact(request.technicalContact) : undefined\n }])\n});\nconst marshalRegistrarApiUpdateContactRequest = (request, defaults) => ({\n address_line_1: request.addressLine1,\n address_line_2: request.addressLine2,\n city: request.city,\n company_identification_code: request.companyIdentificationCode,\n country: request.country,\n email: request.email,\n email_alt: request.emailAlt,\n extension_eu: request.extensionEu ? marshalContactExtensionEU(request.extensionEu) : undefined,\n extension_fr: request.extensionFr ? marshalContactExtensionFR(request.extensionFr) : undefined,\n extension_nl: request.extensionNl ? marshalContactExtensionNL(request.extensionNl) : undefined,\n fax_number: request.faxNumber,\n lang: request.lang ?? 'unknown_language_code',\n phone_number: request.phoneNumber,\n questions: request.questions ? request.questions.map(elt => marshalUpdateContactRequestQuestion(elt)) : undefined,\n resale: request.resale,\n state: request.state,\n vat_identification_code: request.vatIdentificationCode,\n whois_opt_in: request.whoisOptIn,\n zip: request.zip\n});\nconst marshalRegistrarApiUpdateDomainHostRequest = (request, defaults) => ({\n ips: request.ips\n});\nconst marshalRegistrarApiUpdateDomainRequest = (request, defaults) => ({\n ...resolveOneOf([{\n param: 'administrative_contact_id',\n value: request.administrativeContactId\n }, {\n param: 'administrative_contact',\n value: request.administrativeContact ? marshalNewContact(request.administrativeContact) : undefined\n }]),\n ...resolveOneOf([{\n param: 'owner_contact_id',\n value: request.ownerContactId\n }, {\n param: 'owner_contact',\n value: request.ownerContact ? marshalNewContact(request.ownerContact) : undefined\n }]),\n ...resolveOneOf([{\n param: 'technical_contact_id',\n value: request.technicalContactId\n }, {\n param: 'technical_contact',\n value: request.technicalContact ? marshalNewContact(request.technicalContact) : undefined\n }])\n});\nconst marshalUpdateDNSZoneNameserversRequest = (request, defaults) => ({\n ns: request.ns.map(elt => marshalNameserver(elt))\n});\nconst marshalUpdateDNSZoneRecordsRequest = (request, defaults) => ({\n changes: request.changes.map(elt => marshalRecordChange(elt)),\n disallow_new_zone_creation: request.disallowNewZoneCreation,\n return_all_records: request.returnAllRecords,\n serial: request.serial\n});\nconst marshalUpdateDNSZoneRequest = (request, defaults) => ({\n new_dns_zone: request.newDnsZone,\n project_id: request.projectId ?? defaults.defaultProjectId\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst jsonContentHeaders$k = {\n 'Content-Type': 'application/json; charset=utf-8'\n};\n\n/**\n * Domains and DNS API.\n *\n * Domains and DNS API. Manage your domains, DNS zones and records with the\n * Domains and DNS API.\n */\nlet API$l = class API extends API$u {\n pageOfListDNSZones = request => this.client.fetch({\n method: 'GET',\n path: `/domain/v2beta1/dns-zones`,\n urlParams: urlParams(['created_after', request.createdAfter], ['created_before', request.createdBefore], ['dns_zone', request.dnsZone], ['dns_zones', request.dnsZones], ['domain', request.domain], ['order_by', request.orderBy ?? 'domain_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId], ['updated_after', request.updatedAfter], ['updated_before', request.updatedBefore])\n }, unmarshalListDNSZonesResponse);\n\n /**\n * List DNS zones. Retrieve the list of DNS zones you can manage and filter\n * DNS zones associated with specific domain names.\n *\n * @param request - The request {@link ListDNSZonesRequest}\n * @returns A Promise of ListDNSZonesResponse\n */\n listDNSZones = request => enrichForPagination('dnsZones', this.pageOfListDNSZones, request);\n\n /**\n * Create a DNS zone. Create a new DNS zone specified by the domain name, the\n * subdomain and the Project ID.\n *\n * @param request - The request {@link CreateDNSZoneRequest}\n * @returns A Promise of DNSZone\n */\n createDNSZone = request => this.client.fetch({\n body: JSON.stringify(marshalCreateDNSZoneRequest(request, this.client.settings)),\n headers: jsonContentHeaders$k,\n method: 'POST',\n path: `/domain/v2beta1/dns-zones`\n }, unmarshalDNSZone);\n\n /**\n * Update a DNS zone. Update the name and/or the Organizations for a DNS zone.\n *\n * @param request - The request {@link UpdateDNSZoneRequest}\n * @returns A Promise of DNSZone\n */\n updateDNSZone = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateDNSZoneRequest(request, this.client.settings)),\n headers: jsonContentHeaders$k,\n method: 'PATCH',\n path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}`\n }, unmarshalDNSZone);\n\n /**\n * Clone a DNS zone. Clone an existing DNS zone with all its records into a\n * new DNS zone.\n *\n * @param request - The request {@link CloneDNSZoneRequest}\n * @returns A Promise of DNSZone\n */\n cloneDNSZone = request => this.client.fetch({\n body: JSON.stringify(marshalCloneDNSZoneRequest(request, this.client.settings)),\n headers: jsonContentHeaders$k,\n method: 'POST',\n path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/clone`\n }, unmarshalDNSZone);\n\n /**\n * Delete a DNS zone. Delete a DNS zone and all its records.\n *\n * @param request - The request {@link DeleteDNSZoneRequest}\n * @returns A Promise of DeleteDNSZoneResponse\n */\n deleteDNSZone = request => this.client.fetch({\n method: 'DELETE',\n path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}`,\n urlParams: urlParams(['project_id', request.projectId ?? this.client.settings.defaultProjectId])\n }, unmarshalDeleteDNSZoneResponse);\n pageOfListDNSZoneRecords = request => this.client.fetch({\n method: 'GET',\n path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/records`,\n urlParams: urlParams(['id', request.id], ['name', request.name], ['order_by', request.orderBy ?? 'name_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId], ['type', request.type ?? 'unknown'])\n }, unmarshalListDNSZoneRecordsResponse);\n\n /**\n * List records within a DNS zone. Retrieve a list of DNS records within a DNS\n * zone that has default name servers. You can filter records by type and\n * name.\n *\n * @param request - The request {@link ListDNSZoneRecordsRequest}\n * @returns A Promise of ListDNSZoneRecordsResponse\n */\n listDNSZoneRecords = request => enrichForPagination('records', this.pageOfListDNSZoneRecords, request);\n\n /**\n * Update records within a DNS zone. Update records within a DNS zone that has\n * default name servers and perform several actions on your records.\n *\n * Actions include:\n *\n * - Add: allows you to add a new record or add a new IP to an existing A\n * record, for example\n * - Set: allows you to edit a record or edit an IP from an existing A record,\n * for example\n * - Delete: allows you to delete a record or delete an IP from an existing A\n * record, for example\n * - Clear: allows you to delete all records from a DNS zone\n *\n * All edits will be versioned.\n *\n * @param request - The request {@link UpdateDNSZoneRecordsRequest}\n * @returns A Promise of UpdateDNSZoneRecordsResponse\n */\n updateDNSZoneRecords = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateDNSZoneRecordsRequest(request, this.client.settings)),\n headers: jsonContentHeaders$k,\n method: 'PATCH',\n path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/records`\n }, unmarshalUpdateDNSZoneRecordsResponse);\n\n /**\n * List name servers within a DNS zone. Retrieve a list of name servers within\n * a DNS zone and their optional glue records.\n *\n * @param request - The request {@link ListDNSZoneNameserversRequest}\n * @returns A Promise of ListDNSZoneNameserversResponse\n */\n listDNSZoneNameservers = request => this.client.fetch({\n method: 'GET',\n path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/nameservers`,\n urlParams: urlParams(['project_id', request.projectId])\n }, unmarshalListDNSZoneNameserversResponse);\n\n /**\n * Update name servers within a DNS zone. Update name servers within a DNS\n * zone and set optional glue records.\n *\n * @param request - The request {@link UpdateDNSZoneNameserversRequest}\n * @returns A Promise of UpdateDNSZoneNameserversResponse\n */\n updateDNSZoneNameservers = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateDNSZoneNameserversRequest(request, this.client.settings)),\n headers: jsonContentHeaders$k,\n method: 'PUT',\n path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/nameservers`\n }, unmarshalUpdateDNSZoneNameserversResponse);\n\n /**\n * Clear records within a DNS zone. Delete all records within a DNS zone that\n * has default name servers.
All edits will be versioned.\n *\n * @param request - The request {@link ClearDNSZoneRecordsRequest}\n * @returns A Promise of ClearDNSZoneRecordsResponse\n */\n clearDNSZoneRecords = request => this.client.fetch({\n method: 'DELETE',\n path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/records`\n }, unmarshalClearDNSZoneRecordsResponse);\n\n /**\n * Export a raw DNS zone. Export a DNS zone with default name servers, in a\n * specific format.\n *\n * @param request - The request {@link ExportRawDNSZoneRequest}\n * @returns A Promise of Blob\n */\n exportRawDNSZone = request => this.client.fetch({\n method: 'GET',\n path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/raw`,\n urlParams: urlParams(['dl', 1], ['format', request.format ?? 'unknown_raw_format']),\n responseType: 'blob'\n });\n\n /**\n * Import a raw DNS zone. Import and replace the format of records from a\n * given provider, with default name servers.\n *\n * @param request - The request {@link ImportRawDNSZoneRequest}\n * @returns A Promise of ImportRawDNSZoneResponse\n */\n importRawDNSZone = request => this.client.fetch({\n body: JSON.stringify(marshalImportRawDNSZoneRequest(request, this.client.settings)),\n headers: jsonContentHeaders$k,\n method: 'POST',\n path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/raw`\n }, unmarshalImportRawDNSZoneResponse);\n\n /**\n * Import a DNS zone from another provider. Import and replace the format of\n * records from a given provider, with default name servers.\n *\n * @param request - The request {@link ImportProviderDNSZoneRequest}\n * @returns A Promise of ImportProviderDNSZoneResponse\n */\n importProviderDNSZone = request => this.client.fetch({\n body: JSON.stringify(marshalImportProviderDNSZoneRequest(request, this.client.settings)),\n headers: jsonContentHeaders$k,\n method: 'POST',\n path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/import-provider`\n }, unmarshalImportProviderDNSZoneResponse);\n\n /**\n * Refresh a DNS zone. Refresh an SOA DNS zone to reload the records in the\n * DNS zone and update the SOA serial. You can recreate the given DNS zone and\n * its sub DNS zone if needed.\n *\n * @param request - The request {@link RefreshDNSZoneRequest}\n * @returns A Promise of RefreshDNSZoneResponse\n */\n refreshDNSZone = request => this.client.fetch({\n body: JSON.stringify(marshalRefreshDNSZoneRequest(request, this.client.settings)),\n headers: jsonContentHeaders$k,\n method: 'POST',\n path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/refresh`\n }, unmarshalRefreshDNSZoneResponse);\n pageOfListDNSZoneVersions = request => this.client.fetch({\n method: 'GET',\n path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/versions`,\n urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])\n }, unmarshalListDNSZoneVersionsResponse);\n\n /**\n * List versions of a DNS zone. Retrieve a list of a DNS zone's versions.
\n * The maximum version count is 100. If the count reaches this limit, the\n * oldest version will be deleted after each new modification.\n *\n * @param request - The request {@link ListDNSZoneVersionsRequest}\n * @returns A Promise of ListDNSZoneVersionsResponse\n */\n listDNSZoneVersions = request => enrichForPagination('versions', this.pageOfListDNSZoneVersions, request);\n pageOfListDNSZoneVersionRecords = request => this.client.fetch({\n method: 'GET',\n path: `/domain/v2beta1/dns-zones/version/${validatePathParam('dnsZoneVersionId', request.dnsZoneVersionId)}`,\n urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])\n }, unmarshalListDNSZoneVersionRecordsResponse);\n\n /**\n * List records from a given version of a specific DNS zone. Retrieve a list\n * of records from a specific DNS zone version.\n *\n * @param request - The request {@link ListDNSZoneVersionRecordsRequest}\n * @returns A Promise of ListDNSZoneVersionRecordsResponse\n */\n listDNSZoneVersionRecords = request => enrichForPagination('records', this.pageOfListDNSZoneVersionRecords, request);\n\n /**\n * Access differences from a specific DNS zone version. Access a previous DNS\n * zone version to see the differences from another specific version.\n *\n * @param request - The request {@link GetDNSZoneVersionDiffRequest}\n * @returns A Promise of GetDNSZoneVersionDiffResponse\n */\n getDNSZoneVersionDiff = request => this.client.fetch({\n method: 'GET',\n path: `/domain/v2beta1/dns-zones/version/${validatePathParam('dnsZoneVersionId', request.dnsZoneVersionId)}/diff`\n }, unmarshalGetDNSZoneVersionDiffResponse);\n\n /**\n * Restore a DNS zone version. Restore and activate a version of a specific\n * DNS zone.\n *\n * @param request - The request {@link RestoreDNSZoneVersionRequest}\n * @returns A Promise of RestoreDNSZoneVersionResponse\n */\n restoreDNSZoneVersion = request => this.client.fetch({\n body: '{}',\n headers: jsonContentHeaders$k,\n method: 'POST',\n path: `/domain/v2beta1/dns-zones/version/${validatePathParam('dnsZoneVersionId', request.dnsZoneVersionId)}/restore`\n }, unmarshalRestoreDNSZoneVersionResponse);\n\n /**\n * Get a DNS zone's TLS certificate. Get the DNS zone's TLS certificate. If\n * you do not have a certificate, the ouptut returns `no certificate found`.\n *\n * @param request - The request {@link GetSSLCertificateRequest}\n * @returns A Promise of SSLCertificate\n */\n getSSLCertificate = request => this.client.fetch({\n method: 'GET',\n path: `/domain/v2beta1/ssl-certificates/${validatePathParam('dnsZone', request.dnsZone)}`\n }, unmarshalSSLCertificate);\n\n /**\n * Waits for {@link SSLCertificate} to be in a final state.\n *\n * @param request - The request {@link GetSSLCertificateRequest}\n * @param options - The waiting options\n * @returns A Promise of SSLCertificate\n */\n waitForSSLCertificate = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!SSL_CERTIFICATE_TRANSIENT_STATUSES.includes(res.status))), this.getSSLCertificate, request, options);\n\n /**\n * Create or get the DNS zone's TLS certificate. Create a new TLS certificate\n * or retrieve information about an existing TLS certificate.\n *\n * @param request - The request {@link CreateSSLCertificateRequest}\n * @returns A Promise of SSLCertificate\n */\n createSSLCertificate = request => this.client.fetch({\n body: JSON.stringify(marshalCreateSSLCertificateRequest(request, this.client.settings)),\n headers: jsonContentHeaders$k,\n method: 'POST',\n path: `/domain/v2beta1/ssl-certificates`\n }, unmarshalSSLCertificate);\n pageOfListSSLCertificates = request => this.client.fetch({\n method: 'GET',\n path: `/domain/v2beta1/ssl-certificates`,\n urlParams: urlParams(['dns_zone', request.dnsZone], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])\n }, unmarshalListSSLCertificatesResponse);\n\n /**\n * List a user's TLS certificates. List all the TLS certificates a user has\n * created, specified by the user's Project ID and the DNS zone.\n *\n * @param request - The request {@link ListSSLCertificatesRequest}\n * @returns A Promise of ListSSLCertificatesResponse\n */\n listSSLCertificates = request => enrichForPagination('certificates', this.pageOfListSSLCertificates, request);\n\n /**\n * Delete a TLS certificate. Delete an existing TLS certificate specified by\n * its DNS zone. Deleting a TLS certificate is permanent and cannot be\n * undone.\n *\n * @param request - The request {@link DeleteSSLCertificateRequest}\n * @returns A Promise of DeleteSSLCertificateResponse\n */\n deleteSSLCertificate = request => this.client.fetch({\n method: 'DELETE',\n path: `/domain/v2beta1/ssl-certificates/${validatePathParam('dnsZone', request.dnsZone)}`\n }, unmarshalDeleteSSLCertificateResponse);\n\n /**\n * Get the DNS zone's TSIG key. Retrieve information about the TSIG key of a\n * given DNS zone to allow AXFR requests.\n *\n * @param request - The request {@link GetDNSZoneTsigKeyRequest}\n * @returns A Promise of GetDNSZoneTsigKeyResponse\n */\n getDNSZoneTsigKey = request => this.client.fetch({\n method: 'GET',\n path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/tsig-key`\n }, unmarshalGetDNSZoneTsigKeyResponse);\n\n /**\n * Delete the DNS zone's TSIG key. Delete an existing TSIG key specified by\n * its DNS zone. Deleting a TSIG key is permanent and cannot be undone.\n *\n * @param request - The request {@link DeleteDNSZoneTsigKeyRequest}\n */\n deleteDNSZoneTsigKey = request => this.client.fetch({\n method: 'DELETE',\n path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/tsig-key`\n });\n};\n\n/**\n * Domains and DNS - Registrar API.\n *\n * Domains and DNS - Registrar API. Manage your domains and contacts.\n */\nclass RegistrarAPI extends API$u {\n pageOfListTasks = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/domain/v2beta1/tasks`,\n urlParams: urlParams(['domain', request.domain], ['order_by', request.orderBy ?? 'domain_desc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId], ['statuses', request.statuses], ['types', request.types])\n }, unmarshalListTasksResponse);\n\n /**\n * List tasks. List all operations performed on the account. You can filter\n * the list of tasks by domain name.\n *\n * @param request - The request {@link RegistrarApiListTasksRequest}\n * @returns A Promise of ListTasksResponse\n */\n listTasks = (request = {}) => enrichForPagination('tasks', this.pageOfListTasks, request);\n\n /**\n * Purchase domains. Request the registration of domain names. You can provide\n * a domain's already existing contact or a new contact.\n *\n * @param request - The request {@link RegistrarApiBuyDomainsRequest}\n * @returns A Promise of OrderResponse\n */\n buyDomains = request => this.client.fetch({\n body: JSON.stringify(marshalRegistrarApiBuyDomainsRequest(request, this.client.settings)),\n headers: jsonContentHeaders$k,\n method: 'POST',\n path: `/domain/v2beta1/buy-domains`\n }, unmarshalOrderResponse);\n\n /**\n * Renew domains. Request the renewal of one or more domain names.\n *\n * @param request - The request {@link RegistrarApiRenewDomainsRequest}\n * @returns A Promise of OrderResponse\n */\n renewDomains = request => this.client.fetch({\n body: JSON.stringify(marshalRegistrarApiRenewDomainsRequest(request, this.client.settings)),\n headers: jsonContentHeaders$k,\n method: 'POST',\n path: `/domain/v2beta1/renew-domains`\n }, unmarshalOrderResponse);\n\n /**\n * Transfer a domain. Request the transfer of a domain from another registrar\n * to Scaleway Domains and DNS.\n *\n * @param request - The request {@link RegistrarApiTransferInDomainRequest}\n * @returns A Promise of OrderResponse\n */\n transferInDomain = request => this.client.fetch({\n body: JSON.stringify(marshalRegistrarApiTransferInDomainRequest(request, this.client.settings)),\n headers: jsonContentHeaders$k,\n method: 'POST',\n path: `/domain/v2beta1/domains/transfer-domains`\n }, unmarshalOrderResponse);\n\n /**\n * Trade a domain's contact. Request to change a domain's contact owner.
\n * If you specify the `organization_id` of the domain's new owner, the contact\n * will change from the current owner's Scaleway account to the new owner's\n * Scaleway account.
If the new owner's current contact information is\n * not available, the first ever contact they have created for previous\n * domains is taken into account to operate the change.
If the new owner\n * has never created a contact to register domains before, an error message\n * displays.\n *\n * @param request - The request {@link RegistrarApiTradeDomainRequest}\n * @returns A Promise of OrderResponse\n */\n tradeDomain = request => this.client.fetch({\n body: JSON.stringify(marshalRegistrarApiTradeDomainRequest(request, this.client.settings)),\n headers: jsonContentHeaders$k,\n method: 'POST',\n path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/trade`\n }, unmarshalOrderResponse);\n\n /**\n * Register an external domain. Request the registration of an external domain\n * name.\n *\n * @param request - The request\n * {@link RegistrarApiRegisterExternalDomainRequest}\n * @returns A Promise of RegisterExternalDomainResponse\n */\n registerExternalDomain = request => this.client.fetch({\n body: JSON.stringify(marshalRegistrarApiRegisterExternalDomainRequest(request, this.client.settings)),\n headers: jsonContentHeaders$k,\n method: 'POST',\n path: `/domain/v2beta1/external-domains`\n }, unmarshalRegisterExternalDomainResponse);\n\n /**\n * Delete an external domain. Delete an external domain name.\n *\n * @param request - The request {@link RegistrarApiDeleteExternalDomainRequest}\n * @returns A Promise of DeleteExternalDomainResponse\n */\n deleteExternalDomain = request => this.client.fetch({\n method: 'DELETE',\n path: `/domain/v2beta1/external-domains/${validatePathParam('domain', request.domain)}`\n }, unmarshalDeleteExternalDomainResponse);\n\n /**\n * Check if contacts are compatible with a domain or a TLD. Check whether\n * contacts are compatible with a domain or a TLD. If contacts are not\n * compatible with either the domain or the TLD, the information that needs to\n * be corrected is returned.\n *\n * @param request - The request\n * {@link RegistrarApiCheckContactsCompatibilityRequest}\n * @returns A Promise of CheckContactsCompatibilityResponse\n */\n checkContactsCompatibility = (request = {}) => this.client.fetch({\n body: JSON.stringify(marshalRegistrarApiCheckContactsCompatibilityRequest(request, this.client.settings)),\n headers: jsonContentHeaders$k,\n method: 'POST',\n path: `/domain/v2beta1/check-contacts-compatibility`\n }, unmarshalCheckContactsCompatibilityResponse);\n pageOfListContacts = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/domain/v2beta1/contacts`,\n urlParams: urlParams(['domain', request.domain], ['email_status', request.emailStatus ?? 'email_status_unknown'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId], ['role', request.role ?? 'unknown_role'])\n }, unmarshalListContactsResponse);\n\n /**\n * List contacts. Retrieve the list of contacts and their associated domains\n * and roles. You can filter the list by domain name.\n *\n * @param request - The request {@link RegistrarApiListContactsRequest}\n * @returns A Promise of ListContactsResponse\n */\n listContacts = (request = {}) => enrichForPagination('contacts', this.pageOfListContacts, request);\n\n /**\n * Get a contact. Retrieve a contact's details from the registrar using the\n * given contact's ID.\n *\n * @param request - The request {@link RegistrarApiGetContactRequest}\n * @returns A Promise of Contact\n */\n getContact = request => this.client.fetch({\n method: 'GET',\n path: `/domain/v2beta1/contacts/${validatePathParam('contactId', request.contactId)}`\n }, unmarshalContact);\n\n /**\n * Update contact. Edit the contact's information.\n *\n * @param request - The request {@link RegistrarApiUpdateContactRequest}\n * @returns A Promise of Contact\n */\n updateContact = request => this.client.fetch({\n body: JSON.stringify(marshalRegistrarApiUpdateContactRequest(request, this.client.settings)),\n headers: jsonContentHeaders$k,\n method: 'PATCH',\n path: `/domain/v2beta1/contacts/${validatePathParam('contactId', request.contactId)}`\n }, unmarshalContact);\n pageOfListDomains = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/domain/v2beta1/domains`,\n urlParams: urlParams(['domain', request.domain], ['is_external', request.isExternal], ['order_by', request.orderBy ?? 'domain_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId], ['registrar', request.registrar], ['status', request.status ?? 'status_unknown'])\n }, unmarshalListDomainsResponse$2);\n\n /**\n * List domains. Retrieve the list of domains you own.\n *\n * @param request - The request {@link RegistrarApiListDomainsRequest}\n * @returns A Promise of ListDomainsResponse\n */\n listDomains = (request = {}) => enrichForPagination('domains', this.pageOfListDomains, request);\n pageOfListRenewableDomains = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/domain/v2beta1/renewable-domains`,\n urlParams: urlParams(['order_by', request.orderBy ?? 'domain_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])\n }, unmarshalListRenewableDomainsResponse);\n\n /**\n * List domains that can be renewed. Retrieve the list of domains you own that\n * can be renewed. You can also see the maximum renewal duration in years for\n * your domains that are renewable.\n *\n * @param request - The request {@link RegistrarApiListRenewableDomainsRequest}\n * @returns A Promise of ListRenewableDomainsResponse\n */\n listRenewableDomains = (request = {}) => enrichForPagination('domains', this.pageOfListRenewableDomains, request);\n\n /**\n * Get domain. Retrieve a specific domain and display the domain's\n * information.\n *\n * @param request - The request {@link RegistrarApiGetDomainRequest}\n * @returns A Promise of Domain\n */\n getDomain = request => this.client.fetch({\n method: 'GET',\n path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}`\n }, unmarshalDomain$2);\n\n /**\n * Waits for {@link Domain} to be in a final state.\n *\n * @param request - The request {@link GetDomainRequest}\n * @param options - The waiting options\n * @returns A Promise of Domain\n */\n waitForDomain = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!DOMAIN_TRANSIENT_STATUSES$2.includes(res.status))), this.getDomain, request, options);\n\n /**\n * Update a domain's contacts. Update contacts for a specific domain or create\n * a new contact.
If you add the same contact for multiple roles (owner,\n * administrative, technical), only one ID will be created and used for all of\n * the roles.\n *\n * @param request - The request {@link RegistrarApiUpdateDomainRequest}\n * @returns A Promise of Domain\n */\n updateDomain = request => this.client.fetch({\n body: JSON.stringify(marshalRegistrarApiUpdateDomainRequest(request, this.client.settings)),\n headers: jsonContentHeaders$k,\n method: 'PATCH',\n path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}`\n }, unmarshalDomain$2);\n\n /**\n * Lock the transfer of a domain. Lock the transfer of a domain. This means\n * that the domain cannot be transferred and the authorization code cannot be\n * requested to your current registrar.\n *\n * @param request - The request {@link RegistrarApiLockDomainTransferRequest}\n * @returns A Promise of Domain\n */\n lockDomainTransfer = request => this.client.fetch({\n body: '{}',\n headers: jsonContentHeaders$k,\n method: 'POST',\n path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/lock-transfer`\n }, unmarshalDomain$2);\n\n /**\n * Unlock the transfer of a domain. Unlock the transfer of a domain. This\n * means that the domain can be transferred and the authorization code can be\n * requested to your current registrar.\n *\n * @param request - The request {@link RegistrarApiUnlockDomainTransferRequest}\n * @returns A Promise of Domain\n */\n unlockDomainTransfer = request => this.client.fetch({\n body: '{}',\n headers: jsonContentHeaders$k,\n method: 'POST',\n path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/unlock-transfer`\n }, unmarshalDomain$2);\n\n /**\n * Enable auto renew. Enable the `auto renew` feature for a domain. This means\n * the domain will be automatically renewed before its expiry date.\n *\n * @param request - The request\n * {@link RegistrarApiEnableDomainAutoRenewRequest}\n * @returns A Promise of Domain\n */\n enableDomainAutoRenew = request => this.client.fetch({\n body: '{}',\n headers: jsonContentHeaders$k,\n method: 'POST',\n path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/enable-auto-renew`\n }, unmarshalDomain$2);\n\n /**\n * Disable auto renew. Disable the `auto renew` feature for a domain. This\n * means the domain will not be renewed before its expiry date.\n *\n * @param request - The request\n * {@link RegistrarApiDisableDomainAutoRenewRequest}\n * @returns A Promise of Domain\n */\n disableDomainAutoRenew = request => this.client.fetch({\n body: '{}',\n headers: jsonContentHeaders$k,\n method: 'POST',\n path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/disable-auto-renew`\n }, unmarshalDomain$2);\n\n /**\n * Get a domain's authorization code. Retrieve the authorization code to\n * tranfer an unlocked domain. The output returns an error if the domain is\n * locked. Some TLDs may have a different procedure to retrieve the\n * authorization code. In that case, the information displays in the message\n * field.\n *\n * @param request - The request {@link RegistrarApiGetDomainAuthCodeRequest}\n * @returns A Promise of GetDomainAuthCodeResponse\n */\n getDomainAuthCode = request => this.client.fetch({\n method: 'GET',\n path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/auth-code`\n }, unmarshalGetDomainAuthCodeResponse);\n\n /**\n * Update domain DNSSEC. If your domain has the default Scaleway NS and uses\n * another registrar, you have to update the DS record manually.\n *\n * @param request - The request {@link RegistrarApiEnableDomainDNSSECRequest}\n * @returns A Promise of Domain\n */\n enableDomainDNSSEC = request => this.client.fetch({\n body: JSON.stringify(marshalRegistrarApiEnableDomainDNSSECRequest(request, this.client.settings)),\n headers: jsonContentHeaders$k,\n method: 'POST',\n path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/enable-dnssec`\n }, unmarshalDomain$2);\n\n /**\n * Disable a domain's DNSSEC. Disable DNSSEC for a domain.\n *\n * @param request - The request {@link RegistrarApiDisableDomainDNSSECRequest}\n * @returns A Promise of Domain\n */\n disableDomainDNSSEC = request => this.client.fetch({\n body: '{}',\n headers: jsonContentHeaders$k,\n method: 'POST',\n path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/disable-dnssec`\n }, unmarshalDomain$2);\n\n /**\n * Search available domains. Search a domain or a maximum of 10 domains that\n * are available.\n *\n * If the TLD list is empty or not set, the search returns the results from\n * the most popular TLDs.\n *\n * @param request - The request\n * {@link RegistrarApiSearchAvailableDomainsRequest}\n * @returns A Promise of SearchAvailableDomainsResponse\n */\n searchAvailableDomains = request => this.client.fetch({\n method: 'GET',\n path: `/domain/v2beta1/search-domains`,\n urlParams: urlParams(['domains', request.domains], ['strict_search', request.strictSearch], ['tlds', request.tlds])\n }, unmarshalSearchAvailableDomainsResponse);\n pageOfListTlds = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/domain/v2beta1/tlds`,\n urlParams: urlParams(['order_by', request.orderBy ?? 'name_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['tlds', request.tlds])\n }, unmarshalListTldsResponse);\n\n /**\n * List TLD offers. Retrieve the list of TLDs and offers associated with them.\n *\n * @param request - The request {@link RegistrarApiListTldsRequest}\n * @returns A Promise of ListTldsResponse\n */\n listTlds = (request = {}) => enrichForPagination('tlds', this.pageOfListTlds, request);\n\n /**\n * Create a hostname for a domain. Create a hostname for a domain with glue\n * IPs.\n *\n * @param request - The request {@link RegistrarApiCreateDomainHostRequest}\n * @returns A Promise of Host\n */\n createDomainHost = request => this.client.fetch({\n body: JSON.stringify(marshalRegistrarApiCreateDomainHostRequest(request, this.client.settings)),\n headers: jsonContentHeaders$k,\n method: 'POST',\n path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/hosts`\n }, unmarshalHost);\n pageOfListDomainHosts = request => this.client.fetch({\n method: 'GET',\n path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/hosts`,\n urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])\n }, unmarshalListDomainHostsResponse);\n\n /**\n * List a domain's hostnames. List a domain's hostnames using their glue IPs.\n *\n * @param request - The request {@link RegistrarApiListDomainHostsRequest}\n * @returns A Promise of ListDomainHostsResponse\n */\n listDomainHosts = request => enrichForPagination('hosts', this.pageOfListDomainHosts, request);\n\n /**\n * Update a domain's hostname. Update a domain's hostname with glue IPs.\n *\n * @param request - The request {@link RegistrarApiUpdateDomainHostRequest}\n * @returns A Promise of Host\n */\n updateDomainHost = request => this.client.fetch({\n body: JSON.stringify(marshalRegistrarApiUpdateDomainHostRequest(request, this.client.settings)),\n headers: jsonContentHeaders$k,\n method: 'PATCH',\n path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/hosts/${validatePathParam('name', request.name)}`\n }, unmarshalHost);\n\n /**\n * Delete a domain's hostname. Delete a domain's hostname.\n *\n * @param request - The request {@link RegistrarApiDeleteDomainHostRequest}\n * @returns A Promise of Host\n */\n deleteDomainHost = request => this.client.fetch({\n method: 'DELETE',\n path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/hosts/${validatePathParam('name', request.name)}`\n }, unmarshalHost);\n}\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\nvar index_gen$j = /*#__PURE__*/Object.freeze({\n __proto__: null,\n API: API$l,\n DNS_ZONE_TRANSIENT_STATUSES: DNS_ZONE_TRANSIENT_STATUSES,\n DOMAIN_FEATURE_TRANSIENT_STATUSES: DOMAIN_FEATURE_TRANSIENT_STATUSES,\n DOMAIN_REGISTRATION_STATUS_TRANSFER_TRANSIENT_STATUSES: DOMAIN_REGISTRATION_STATUS_TRANSFER_TRANSIENT_STATUSES,\n DOMAIN_TRANSIENT_STATUSES: DOMAIN_TRANSIENT_STATUSES$2,\n HOST_TRANSIENT_STATUSES: HOST_TRANSIENT_STATUSES,\n RegistrarAPI: RegistrarAPI,\n SSL_CERTIFICATE_TRANSIENT_STATUSES: SSL_CERTIFICATE_TRANSIENT_STATUSES,\n TASK_TRANSIENT_STATUSES: TASK_TRANSIENT_STATUSES$1\n});\n\nvar index$m = /*#__PURE__*/Object.freeze({\n __proto__: null,\n v2beta1: index_gen$j\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\n/** Lists transient statutes of the enum {@link FlexibleIPStatus}. */\nconst FLEXIBLE_IP_TRANSIENT_STATUSES = ['updating', 'detaching'];\n\n/** Lists transient statutes of the enum {@link MACAddressStatus}. */\nconst MAC_ADDRESS_TRANSIENT_STATUSES = ['updating', 'deleting'];\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst unmarshalMACAddress = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'MACAddress' failed as data isn't a dictionary.`);\n }\n return {\n createdAt: unmarshalDate(data.created_at),\n id: data.id,\n macAddress: data.mac_address,\n macType: data.mac_type,\n status: data.status,\n updatedAt: unmarshalDate(data.updated_at),\n zone: data.zone\n };\n};\nconst unmarshalFlexibleIP = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'FlexibleIP' failed as data isn't a dictionary.`);\n }\n return {\n createdAt: unmarshalDate(data.created_at),\n description: data.description,\n id: data.id,\n ipAddress: data.ip_address,\n macAddress: data.mac_address ? unmarshalMACAddress(data.mac_address) : undefined,\n organizationId: data.organization_id,\n projectId: data.project_id,\n reverse: data.reverse,\n serverId: data.server_id,\n status: data.status,\n tags: data.tags,\n updatedAt: unmarshalDate(data.updated_at),\n zone: data.zone\n };\n};\nconst unmarshalAttachFlexibleIPsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'AttachFlexibleIPsResponse' failed as data isn't a dictionary.`);\n }\n return {\n flexibleIps: unmarshalArrayOfObject(data.flexible_ips, unmarshalFlexibleIP),\n totalCount: data.total_count\n };\n};\nconst unmarshalDetachFlexibleIPsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'DetachFlexibleIPsResponse' failed as data isn't a dictionary.`);\n }\n return {\n flexibleIps: unmarshalArrayOfObject(data.flexible_ips, unmarshalFlexibleIP),\n totalCount: data.total_count\n };\n};\nconst unmarshalListFlexibleIPsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListFlexibleIPsResponse' failed as data isn't a dictionary.`);\n }\n return {\n flexibleIps: unmarshalArrayOfObject(data.flexible_ips, unmarshalFlexibleIP),\n totalCount: data.total_count\n };\n};\nconst marshalAttachFlexibleIPRequest = (request, defaults) => ({\n fips_ids: request.fipsIds,\n server_id: request.serverId\n});\nconst marshalCreateFlexibleIPRequest = (request, defaults) => ({\n description: request.description,\n is_ipv6: request.isIpv6,\n project_id: request.projectId ?? defaults.defaultProjectId,\n reverse: request.reverse,\n server_id: request.serverId,\n tags: request.tags\n});\nconst marshalDetachFlexibleIPRequest = (request, defaults) => ({\n fips_ids: request.fipsIds\n});\nconst marshalDuplicateMACAddrRequest = (request, defaults) => ({\n duplicate_from_fip_id: request.duplicateFromFipId\n});\nconst marshalGenerateMACAddrRequest = (request, defaults) => ({\n mac_type: request.macType\n});\nconst marshalMoveMACAddrRequest = (request, defaults) => ({\n dst_fip_id: request.dstFipId\n});\nconst marshalUpdateFlexibleIPRequest = (request, defaults) => ({\n description: request.description,\n reverse: request.reverse,\n tags: request.tags\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst jsonContentHeaders$j = {\n 'Content-Type': 'application/json; charset=utf-8'\n};\n\n/** Elastic Metal - Flexible IP API. */\nlet API$k = class API extends API$u {\n /** Lists the available zones of the API. */\n static LOCALITIES = ['fr-par-1', 'fr-par-2', 'nl-ams-1'];\n\n /**\n * Create a new flexible IP. Generate a new flexible IP within a given zone,\n * specifying its configuration including Project ID and description.\n *\n * @param request - The request {@link CreateFlexibleIPRequest}\n * @returns A Promise of FlexibleIP\n */\n createFlexibleIP = request => this.client.fetch({\n body: JSON.stringify(marshalCreateFlexibleIPRequest(request, this.client.settings)),\n headers: jsonContentHeaders$j,\n method: 'POST',\n path: `/flexible-ip/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/fips`\n }, unmarshalFlexibleIP);\n\n /**\n * Get an existing flexible IP. Retrieve information about an existing\n * flexible IP, specified by its ID and zone. Its full details, including\n * Project ID, description and status, are returned in the response object.\n *\n * @param request - The request {@link GetFlexibleIPRequest}\n * @returns A Promise of FlexibleIP\n */\n getFlexibleIP = request => this.client.fetch({\n method: 'GET',\n path: `/flexible-ip/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/fips/${validatePathParam('fipId', request.fipId)}`\n }, unmarshalFlexibleIP);\n\n /**\n * Waits for {@link FlexibleIP} to be in a final state.\n *\n * @param request - The request {@link GetFlexibleIPRequest}\n * @param options - The waiting options\n * @returns A Promise of FlexibleIP\n */\n waitForFlexibleIP = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!FLEXIBLE_IP_TRANSIENT_STATUSES.includes(res.status))), this.getFlexibleIP, request, options);\n pageOfListFlexibleIPs = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/flexible-ip/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/fips`,\n urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId], ['server_ids', request.serverIds], ['status', request.status], ['tags', request.tags])\n }, unmarshalListFlexibleIPsResponse);\n\n /**\n * List flexible IPs. List all flexible IPs within a given zone.\n *\n * @param request - The request {@link ListFlexibleIPsRequest}\n * @returns A Promise of ListFlexibleIPsResponse\n */\n listFlexibleIPs = (request = {}) => enrichForPagination('flexibleIps', this.pageOfListFlexibleIPs, request);\n\n /**\n * Update an existing flexible IP. Update the parameters of an existing\n * flexible IP, specified by its ID and zone. These parameters include tags\n * and description.\n *\n * @param request - The request {@link UpdateFlexibleIPRequest}\n * @returns A Promise of FlexibleIP\n */\n updateFlexibleIP = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateFlexibleIPRequest(request, this.client.settings)),\n headers: jsonContentHeaders$j,\n method: 'PATCH',\n path: `/flexible-ip/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/fips/${validatePathParam('fipId', request.fipId)}`\n }, unmarshalFlexibleIP);\n\n /**\n * Delete an existing flexible IP. Delete an existing flexible IP, specified\n * by its ID and zone. Note that deleting a flexible IP is permanent and\n * cannot be undone.\n *\n * @param request - The request {@link DeleteFlexibleIPRequest}\n */\n deleteFlexibleIP = request => this.client.fetch({\n method: 'DELETE',\n path: `/flexible-ip/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/fips/${validatePathParam('fipId', request.fipId)}`\n });\n\n /**\n * Attach an existing flexible IP to a server. Attach an existing flexible IP\n * to a specified Elastic Metal server.\n *\n * @param request - The request {@link AttachFlexibleIPRequest}\n * @returns A Promise of AttachFlexibleIPsResponse\n */\n attachFlexibleIP = request => this.client.fetch({\n body: JSON.stringify(marshalAttachFlexibleIPRequest(request, this.client.settings)),\n headers: jsonContentHeaders$j,\n method: 'POST',\n path: `/flexible-ip/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/fips/attach`\n }, unmarshalAttachFlexibleIPsResponse);\n\n /**\n * Detach an existing flexible IP from a server. Detach an existing flexible\n * IP from a specified Elastic Metal server.\n *\n * @param request - The request {@link DetachFlexibleIPRequest}\n * @returns A Promise of DetachFlexibleIPsResponse\n */\n detachFlexibleIP = request => this.client.fetch({\n body: JSON.stringify(marshalDetachFlexibleIPRequest(request, this.client.settings)),\n headers: jsonContentHeaders$j,\n method: 'POST',\n path: `/flexible-ip/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/fips/detach`\n }, unmarshalDetachFlexibleIPsResponse);\n\n /**\n * Generate a virtual MAC address on an existing flexible IP. Generate a\n * virtual MAC (Media Access Control) address on an existing flexible IP.\n *\n * @param request - The request {@link GenerateMACAddrRequest}\n * @returns A Promise of FlexibleIP\n */\n generateMACAddr = request => this.client.fetch({\n body: JSON.stringify(marshalGenerateMACAddrRequest(request, this.client.settings)),\n headers: jsonContentHeaders$j,\n method: 'POST',\n path: `/flexible-ip/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/fips/${validatePathParam('fipId', request.fipId)}/mac`\n }, unmarshalFlexibleIP);\n\n /**\n * Duplicate a virtual MAC address to another flexible IP. Duplicate a virtual\n * MAC address from a given flexible IP to another flexible IP attached to the\n * same server.\n *\n * @param request - The request {@link DuplicateMACAddrRequest}\n * @returns A Promise of FlexibleIP\n */\n duplicateMACAddr = request => this.client.fetch({\n body: JSON.stringify(marshalDuplicateMACAddrRequest(request, this.client.settings)),\n headers: jsonContentHeaders$j,\n method: 'POST',\n path: `/flexible-ip/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/fips/${validatePathParam('fipId', request.fipId)}/mac/duplicate`\n }, unmarshalFlexibleIP);\n\n /**\n * Relocate an existing virtual MAC address to a different flexible IP.\n * Relocate a virtual MAC (Media Access Control) address from an existing\n * flexible IP to a different flexible IP.\n *\n * @param request - The request {@link MoveMACAddrRequest}\n * @returns A Promise of FlexibleIP\n */\n moveMACAddr = request => this.client.fetch({\n body: JSON.stringify(marshalMoveMACAddrRequest(request, this.client.settings)),\n headers: jsonContentHeaders$j,\n method: 'POST',\n path: `/flexible-ip/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/fips/${validatePathParam('fipId', request.fipId)}/mac/move`\n }, unmarshalFlexibleIP);\n\n /**\n * Detach a given virtual MAC address from an existing flexible IP. Detach a\n * given MAC (Media Access Control) address from an existing flexible IP.\n *\n * @param request - The request {@link DeleteMACAddrRequest}\n */\n deleteMACAddr = request => this.client.fetch({\n method: 'DELETE',\n path: `/flexible-ip/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/fips/${validatePathParam('fipId', request.fipId)}/mac`\n });\n};\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\nconst ListFlexibleIPsRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\n\nvar validationRules_gen$5 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n ListFlexibleIPsRequest: ListFlexibleIPsRequest\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\nvar index_gen$i = /*#__PURE__*/Object.freeze({\n __proto__: null,\n API: API$k,\n FLEXIBLE_IP_TRANSIENT_STATUSES: FLEXIBLE_IP_TRANSIENT_STATUSES,\n MAC_ADDRESS_TRANSIENT_STATUSES: MAC_ADDRESS_TRANSIENT_STATUSES,\n ValidationRules: validationRules_gen$5\n});\n\nvar index$l = /*#__PURE__*/Object.freeze({\n __proto__: null,\n v1alpha1: index_gen$i\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\n/** Lists transient statutes of the enum {@link CronStatus}. */\nconst CRON_TRANSIENT_STATUSES = ['deleting', 'creating', 'pending'];\n\n/** Lists transient statutes of the enum {@link DomainStatus}. */\nconst DOMAIN_TRANSIENT_STATUSES$1 = ['deleting', 'creating', 'pending'];\n\n/** Lists transient statutes of the enum {@link FunctionStatus}. */\nconst FUNCTION_TRANSIENT_STATUSES = ['deleting', 'creating', 'pending'];\n\n/** Lists transient statutes of the enum {@link NamespaceStatus}. */\nconst NAMESPACE_TRANSIENT_STATUSES$1 = ['deleting', 'creating', 'pending'];\n\n/** Lists transient statutes of the enum {@link TokenStatus}. */\nconst TOKEN_TRANSIENT_STATUSES = ['deleting', 'creating'];\n\n/** Lists transient statutes of the enum {@link TriggerStatus}. */\nconst TRIGGER_TRANSIENT_STATUSES = ['deleting', 'creating', 'pending'];\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst unmarshalSecretHashedValue = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'SecretHashedValue' failed as data isn't a dictionary.`);\n }\n return {\n hashedValue: data.hashed_value,\n key: data.key\n };\n};\nconst unmarshalTriggerMnqNatsClientConfig = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'TriggerMnqNatsClientConfig' failed as data isn't a dictionary.`);\n }\n return {\n mnqCredentialId: data.mnq_credential_id,\n mnqNamespaceId: data.mnq_namespace_id,\n mnqNatsAccountId: data.mnq_nats_account_id,\n mnqProjectId: data.mnq_project_id,\n mnqRegion: data.mnq_region,\n subject: data.subject\n };\n};\nconst unmarshalTriggerMnqSqsClientConfig = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'TriggerMnqSqsClientConfig' failed as data isn't a dictionary.`);\n }\n return {\n mnqCredentialId: data.mnq_credential_id,\n mnqNamespaceId: data.mnq_namespace_id,\n mnqProjectId: data.mnq_project_id,\n mnqRegion: data.mnq_region,\n queue: data.queue\n };\n};\nconst unmarshalTriggerSqsClientConfig = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'TriggerSqsClientConfig' failed as data isn't a dictionary.`);\n }\n return {\n accessKey: data.access_key,\n endpoint: data.endpoint,\n queueUrl: data.queue_url,\n secretKey: data.secret_key\n };\n};\nconst unmarshalCron = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Cron' failed as data isn't a dictionary.`);\n }\n return {\n args: data.args,\n functionId: data.function_id,\n id: data.id,\n name: data.name,\n schedule: data.schedule,\n status: data.status\n };\n};\nconst unmarshalDomain$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Domain' failed as data isn't a dictionary.`);\n }\n return {\n errorMessage: data.error_message,\n functionId: data.function_id,\n hostname: data.hostname,\n id: data.id,\n status: data.status,\n url: data.url\n };\n};\nconst unmarshalFunction = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Function' failed as data isn't a dictionary.`);\n }\n return {\n buildMessage: data.build_message,\n cpuLimit: data.cpu_limit,\n description: data.description,\n domainName: data.domain_name,\n environmentVariables: data.environment_variables,\n errorMessage: data.error_message,\n handler: data.handler,\n httpOption: data.http_option,\n id: data.id,\n maxScale: data.max_scale,\n memoryLimit: data.memory_limit,\n minScale: data.min_scale,\n name: data.name,\n namespaceId: data.namespace_id,\n privacy: data.privacy,\n region: data.region,\n runtime: data.runtime,\n runtimeMessage: data.runtime_message,\n secretEnvironmentVariables: unmarshalArrayOfObject(data.secret_environment_variables, unmarshalSecretHashedValue),\n status: data.status,\n timeout: data.timeout\n };\n};\nconst unmarshalLog = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Log' failed as data isn't a dictionary.`);\n }\n return {\n id: data.id,\n level: data.level,\n message: data.message,\n source: data.source,\n stream: data.stream,\n timestamp: unmarshalDate(data.timestamp)\n };\n};\nconst unmarshalNamespace$2 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Namespace' failed as data isn't a dictionary.`);\n }\n return {\n description: data.description,\n environmentVariables: data.environment_variables,\n errorMessage: data.error_message,\n id: data.id,\n name: data.name,\n organizationId: data.organization_id,\n projectId: data.project_id,\n region: data.region,\n registryEndpoint: data.registry_endpoint,\n registryNamespaceId: data.registry_namespace_id,\n secretEnvironmentVariables: unmarshalArrayOfObject(data.secret_environment_variables, unmarshalSecretHashedValue),\n status: data.status\n };\n};\nconst unmarshalRuntime = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Runtime' failed as data isn't a dictionary.`);\n }\n return {\n codeSample: data.code_sample,\n defaultHandler: data.default_handler,\n extension: data.extension,\n implementation: data.implementation,\n language: data.language,\n logoUrl: data.logo_url,\n name: data.name,\n status: data.status,\n statusMessage: data.status_message,\n version: data.version\n };\n};\nconst unmarshalToken = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Token' failed as data isn't a dictionary.`);\n }\n return {\n description: data.description,\n expiresAt: unmarshalDate(data.expires_at),\n functionId: data.function_id,\n id: data.id,\n namespaceId: data.namespace_id,\n publicKey: data.public_key,\n status: data.status,\n token: data.token\n };\n};\nconst unmarshalTrigger = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Trigger' failed as data isn't a dictionary.`);\n }\n return {\n description: data.description,\n errorMessage: data.error_message,\n functionId: data.function_id,\n id: data.id,\n inputType: data.input_type,\n name: data.name,\n scwNatsConfig: data.scw_nats_config ? unmarshalTriggerMnqNatsClientConfig(data.scw_nats_config) : undefined,\n scwSqsConfig: data.scw_sqs_config ? unmarshalTriggerMnqSqsClientConfig(data.scw_sqs_config) : undefined,\n sqsConfig: data.sqs_config ? unmarshalTriggerSqsClientConfig(data.sqs_config) : undefined,\n status: data.status\n };\n};\nconst unmarshalDownloadURL = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'DownloadURL' failed as data isn't a dictionary.`);\n }\n return {\n headers: data.headers,\n url: data.url\n };\n};\nconst unmarshalListCronsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListCronsResponse' failed as data isn't a dictionary.`);\n }\n return {\n crons: unmarshalArrayOfObject(data.crons, unmarshalCron),\n totalCount: data.total_count\n };\n};\nconst unmarshalListDomainsResponse$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListDomainsResponse' failed as data isn't a dictionary.`);\n }\n return {\n domains: unmarshalArrayOfObject(data.domains, unmarshalDomain$1),\n totalCount: data.total_count\n };\n};\nconst unmarshalListFunctionRuntimesResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListFunctionRuntimesResponse' failed as data isn't a dictionary.`);\n }\n return {\n runtimes: unmarshalArrayOfObject(data.runtimes, unmarshalRuntime),\n totalCount: data.total_count\n };\n};\nconst unmarshalListFunctionsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListFunctionsResponse' failed as data isn't a dictionary.`);\n }\n return {\n functions: unmarshalArrayOfObject(data.functions, unmarshalFunction),\n totalCount: data.total_count\n };\n};\nconst unmarshalListLogsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListLogsResponse' failed as data isn't a dictionary.`);\n }\n return {\n logs: unmarshalArrayOfObject(data.logs, unmarshalLog),\n totalCount: data.total_count\n };\n};\nconst unmarshalListNamespacesResponse$2 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListNamespacesResponse' failed as data isn't a dictionary.`);\n }\n return {\n namespaces: unmarshalArrayOfObject(data.namespaces, unmarshalNamespace$2),\n totalCount: data.total_count\n };\n};\nconst unmarshalListTokensResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListTokensResponse' failed as data isn't a dictionary.`);\n }\n return {\n tokens: unmarshalArrayOfObject(data.tokens, unmarshalToken),\n totalCount: data.total_count\n };\n};\nconst unmarshalListTriggersResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListTriggersResponse' failed as data isn't a dictionary.`);\n }\n return {\n totalCount: data.total_count,\n triggers: unmarshalArrayOfObject(data.triggers, unmarshalTrigger)\n };\n};\nconst unmarshalUploadURL = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'UploadURL' failed as data isn't a dictionary.`);\n }\n return {\n headers: data.headers,\n url: data.url\n };\n};\nconst marshalCreateTriggerRequestMnqNatsClientConfig = (request, defaults) => ({\n mnq_namespace_id: request.mnqNamespaceId,\n mnq_nats_account_id: request.mnqNatsAccountId,\n mnq_project_id: request.mnqProjectId,\n mnq_region: request.mnqRegion,\n subject: request.subject\n});\nconst marshalCreateTriggerRequestMnqSqsClientConfig = (request, defaults) => ({\n mnq_namespace_id: request.mnqNamespaceId,\n mnq_project_id: request.mnqProjectId,\n mnq_region: request.mnqRegion,\n queue: request.queue\n});\nconst marshalCreateTriggerRequestSqsClientConfig = (request, defaults) => ({\n access_key: request.accessKey,\n endpoint: request.endpoint,\n queue_url: request.queueUrl,\n secret_key: request.secretKey\n});\nconst marshalSecret = (request, defaults) => ({\n key: request.key,\n value: request.value\n});\nconst marshalUpdateTriggerRequestSqsClientConfig = (request, defaults) => ({\n access_key: request.accessKey,\n secret_key: request.secretKey\n});\nconst marshalCreateCronRequest = (request, defaults) => ({\n args: request.args,\n function_id: request.functionId,\n name: request.name,\n schedule: request.schedule\n});\nconst marshalCreateDomainRequest$1 = (request, defaults) => ({\n function_id: request.functionId,\n hostname: request.hostname\n});\nconst marshalCreateFunctionRequest = (request, defaults) => ({\n description: request.description,\n environment_variables: request.environmentVariables,\n handler: request.handler,\n http_option: request.httpOption ?? 'unknown_http_option',\n max_scale: request.maxScale,\n memory_limit: request.memoryLimit,\n min_scale: request.minScale,\n name: request.name || randomName('fn'),\n namespace_id: request.namespaceId,\n privacy: request.privacy ?? 'unknown_privacy',\n runtime: request.runtime ?? 'unknown_runtime',\n secret_environment_variables: request.secretEnvironmentVariables ? request.secretEnvironmentVariables.map(elt => marshalSecret(elt)) : undefined,\n timeout: request.timeout\n});\nconst marshalCreateNamespaceRequest$2 = (request, defaults) => ({\n description: request.description,\n environment_variables: request.environmentVariables,\n name: request.name || randomName('ns'),\n project_id: request.projectId ?? defaults.defaultProjectId,\n secret_environment_variables: request.secretEnvironmentVariables ? request.secretEnvironmentVariables.map(elt => marshalSecret(elt)) : undefined\n});\nconst marshalCreateTokenRequest = (request, defaults) => ({\n description: request.description,\n expires_at: request.expiresAt,\n ...resolveOneOf([{\n param: 'function_id',\n value: request.functionId\n }, {\n param: 'namespace_id',\n value: request.namespaceId\n }])\n});\nconst marshalCreateTriggerRequest = (request, defaults) => ({\n description: request.description,\n function_id: request.functionId,\n name: request.name,\n ...resolveOneOf([{\n param: 'scw_sqs_config',\n value: request.scwSqsConfig ? marshalCreateTriggerRequestMnqSqsClientConfig(request.scwSqsConfig) : undefined\n }, {\n param: 'sqs_config',\n value: request.sqsConfig ? marshalCreateTriggerRequestSqsClientConfig(request.sqsConfig) : undefined\n }, {\n param: 'scw_nats_config',\n value: request.scwNatsConfig ? marshalCreateTriggerRequestMnqNatsClientConfig(request.scwNatsConfig) : undefined\n }])\n});\nconst marshalUpdateCronRequest = (request, defaults) => ({\n args: request.args,\n function_id: request.functionId,\n name: request.name,\n schedule: request.schedule\n});\nconst marshalUpdateFunctionRequest = (request, defaults) => ({\n description: request.description,\n environment_variables: request.environmentVariables,\n handler: request.handler,\n http_option: request.httpOption ?? 'unknown_http_option',\n max_scale: request.maxScale,\n memory_limit: request.memoryLimit,\n min_scale: request.minScale,\n privacy: request.privacy ?? 'unknown_privacy',\n redeploy: request.redeploy,\n runtime: request.runtime ?? 'unknown_runtime',\n secret_environment_variables: request.secretEnvironmentVariables ? request.secretEnvironmentVariables.map(elt => marshalSecret(elt)) : undefined,\n timeout: request.timeout\n});\nconst marshalUpdateNamespaceRequest$2 = (request, defaults) => ({\n description: request.description,\n environment_variables: request.environmentVariables,\n secret_environment_variables: request.secretEnvironmentVariables ? request.secretEnvironmentVariables.map(elt => marshalSecret(elt)) : undefined\n});\nconst marshalUpdateTriggerRequest = (request, defaults) => ({\n description: request.description,\n name: request.name,\n ...resolveOneOf([{\n param: 'sqs_config',\n value: request.sqsConfig ? marshalUpdateTriggerRequestSqsClientConfig(request.sqsConfig) : undefined\n }])\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst jsonContentHeaders$i = {\n 'Content-Type': 'application/json; charset=utf-8'\n};\n\n/** Serverless Functions API. */\nlet API$j = class API extends API$u {\n /** Lists the available regions of the API. */\n static LOCALITIES = ['fr-par', 'nl-ams', 'pl-waw'];\n pageOfListNamespaces = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces`,\n urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])\n }, unmarshalListNamespacesResponse$2);\n\n /**\n * List all your namespaces. List all existing namespaces in the specified\n * region.\n *\n * @param request - The request {@link ListNamespacesRequest}\n * @returns A Promise of ListNamespacesResponse\n */\n listNamespaces = (request = {}) => enrichForPagination('namespaces', this.pageOfListNamespaces, request);\n\n /**\n * Get a namespace. Get the namespace associated with the specified ID.\n *\n * @param request - The request {@link GetNamespaceRequest}\n * @returns A Promise of Namespace\n */\n getNamespace = request => this.client.fetch({\n method: 'GET',\n path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam('namespaceId', request.namespaceId)}`\n }, unmarshalNamespace$2);\n\n /**\n * Waits for {@link Namespace} to be in a final state.\n *\n * @param request - The request {@link GetNamespaceRequest}\n * @param options - The waiting options\n * @returns A Promise of Namespace\n */\n waitForNamespace = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!NAMESPACE_TRANSIENT_STATUSES$1.includes(res.status))), this.getNamespace, request, options);\n\n /**\n * Create a new namespace. Create a new namespace in a specified Organization\n * or Project.\n *\n * @param request - The request {@link CreateNamespaceRequest}\n * @returns A Promise of Namespace\n */\n createNamespace = (request = {}) => this.client.fetch({\n body: JSON.stringify(marshalCreateNamespaceRequest$2(request, this.client.settings)),\n headers: jsonContentHeaders$i,\n method: 'POST',\n path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces`\n }, unmarshalNamespace$2);\n\n /**\n * Update an existing namespace. Update the namespace associated with the\n * specified ID.\n *\n * @param request - The request {@link UpdateNamespaceRequest}\n * @returns A Promise of Namespace\n */\n updateNamespace = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateNamespaceRequest$2(request, this.client.settings)),\n headers: jsonContentHeaders$i,\n method: 'PATCH',\n path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam('namespaceId', request.namespaceId)}`\n }, unmarshalNamespace$2);\n\n /**\n * Delete an existing namespace. Delete the namespace associated with the\n * specified ID.\n *\n * @param request - The request {@link DeleteNamespaceRequest}\n * @returns A Promise of Namespace\n */\n deleteNamespace = request => this.client.fetch({\n method: 'DELETE',\n path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam('namespaceId', request.namespaceId)}`\n }, unmarshalNamespace$2);\n pageOfListFunctions = request => this.client.fetch({\n method: 'GET',\n path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/functions`,\n urlParams: urlParams(['name', request.name], ['namespace_id', request.namespaceId], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])\n }, unmarshalListFunctionsResponse);\n\n /**\n * List all your functions.\n *\n * @param request - The request {@link ListFunctionsRequest}\n * @returns A Promise of ListFunctionsResponse\n */\n listFunctions = request => enrichForPagination('functions', this.pageOfListFunctions, request);\n\n /**\n * Get a function. Get the function associated with the specified ID.\n *\n * @param request - The request {@link GetFunctionRequest}\n * @returns A Promise of Function\n */\n getFunction = request => this.client.fetch({\n method: 'GET',\n path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/functions/${validatePathParam('functionId', request.functionId)}`\n }, unmarshalFunction);\n\n /**\n * Waits for {@link Function} to be in a final state.\n *\n * @param request - The request {@link GetFunctionRequest}\n * @param options - The waiting options\n * @returns A Promise of Function\n */\n waitForFunction = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!FUNCTION_TRANSIENT_STATUSES.includes(res.status))), this.getFunction, request, options);\n\n /**\n * Create a new function. Create a new function in the specified region for a\n * specified Organization or Project.\n *\n * @param request - The request {@link CreateFunctionRequest}\n * @returns A Promise of Function\n */\n createFunction = request => this.client.fetch({\n body: JSON.stringify(marshalCreateFunctionRequest(request, this.client.settings)),\n headers: jsonContentHeaders$i,\n method: 'POST',\n path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/functions`\n }, unmarshalFunction);\n\n /**\n * Update an existing function. Update the function associated with the\n * specified ID.\n *\n * @param request - The request {@link UpdateFunctionRequest}\n * @returns A Promise of Function\n */\n updateFunction = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateFunctionRequest(request, this.client.settings)),\n headers: jsonContentHeaders$i,\n method: 'PATCH',\n path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/functions/${validatePathParam('functionId', request.functionId)}`\n }, unmarshalFunction);\n\n /**\n * Delete a function. Delete the function associated with the specified ID.\n *\n * @param request - The request {@link DeleteFunctionRequest}\n * @returns A Promise of Function\n */\n deleteFunction = request => this.client.fetch({\n method: 'DELETE',\n path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/functions/${validatePathParam('functionId', request.functionId)}`\n }, unmarshalFunction);\n\n /**\n * Deploy a function. Deploy a function associated with the specified ID.\n *\n * @param request - The request {@link DeployFunctionRequest}\n * @returns A Promise of Function\n */\n deployFunction = request => this.client.fetch({\n body: '{}',\n headers: jsonContentHeaders$i,\n method: 'POST',\n path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/functions/${validatePathParam('functionId', request.functionId)}/deploy`\n }, unmarshalFunction);\n\n /**\n * List function runtimes. List available function runtimes.\n *\n * @param request - The request {@link ListFunctionRuntimesRequest}\n * @returns A Promise of ListFunctionRuntimesResponse\n */\n listFunctionRuntimes = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/runtimes`\n }, unmarshalListFunctionRuntimesResponse);\n\n /**\n * Get an upload URL of a function. Get an upload URL of a function associated\n * with the specified ID.\n *\n * @param request - The request {@link GetFunctionUploadURLRequest}\n * @returns A Promise of UploadURL\n */\n getFunctionUploadURL = request => this.client.fetch({\n method: 'GET',\n path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/functions/${validatePathParam('functionId', request.functionId)}/upload-url`,\n urlParams: urlParams(['content_length', request.contentLength])\n }, unmarshalUploadURL);\n\n /**\n * Get a download URL of a function. Get a download URL for a function\n * associated with the specified ID.\n *\n * @param request - The request {@link GetFunctionDownloadURLRequest}\n * @returns A Promise of DownloadURL\n */\n getFunctionDownloadURL = request => this.client.fetch({\n method: 'GET',\n path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/functions/${validatePathParam('functionId', request.functionId)}/download-url`\n }, unmarshalDownloadURL);\n pageOfListCrons = request => this.client.fetch({\n method: 'GET',\n path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/crons`,\n urlParams: urlParams(['function_id', request.functionId], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])\n }, unmarshalListCronsResponse);\n\n /**\n * List all crons. List all the cronjobs in a specified region.\n *\n * @param request - The request {@link ListCronsRequest}\n * @returns A Promise of ListCronsResponse\n */\n listCrons = request => enrichForPagination('crons', this.pageOfListCrons, request);\n\n /**\n * Get a cron. Get the cron associated with the specified ID.\n *\n * @param request - The request {@link GetCronRequest}\n * @returns A Promise of Cron\n */\n getCron = request => this.client.fetch({\n method: 'GET',\n path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/crons/${validatePathParam('cronId', request.cronId)}`\n }, unmarshalCron);\n\n /**\n * Waits for {@link Cron} to be in a final state.\n *\n * @param request - The request {@link GetCronRequest}\n * @param options - The waiting options\n * @returns A Promise of Cron\n */\n waitForCron = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!CRON_TRANSIENT_STATUSES.includes(res.status))), this.getCron, request, options);\n\n /**\n * Create a new cron. Create a new cronjob for a function with the specified\n * ID.\n *\n * @param request - The request {@link CreateCronRequest}\n * @returns A Promise of Cron\n */\n createCron = request => this.client.fetch({\n body: JSON.stringify(marshalCreateCronRequest(request, this.client.settings)),\n headers: jsonContentHeaders$i,\n method: 'POST',\n path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/crons`\n }, unmarshalCron);\n\n /**\n * Update an existing cron. Update the cron associated with the specified ID.\n *\n * @param request - The request {@link UpdateCronRequest}\n * @returns A Promise of Cron\n */\n updateCron = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateCronRequest(request, this.client.settings)),\n headers: jsonContentHeaders$i,\n method: 'PATCH',\n path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/crons/${validatePathParam('cronId', request.cronId)}`\n }, unmarshalCron);\n\n /**\n * Delete an existing cron. Delete the cron associated with the specified ID.\n *\n * @param request - The request {@link DeleteCronRequest}\n * @returns A Promise of Cron\n */\n deleteCron = request => this.client.fetch({\n method: 'DELETE',\n path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/crons/${validatePathParam('cronId', request.cronId)}`\n }, unmarshalCron);\n pageOfListLogs = request => this.client.fetch({\n method: 'GET',\n path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/functions/${validatePathParam('functionId', request.functionId)}/logs`,\n urlParams: urlParams(['order_by', request.orderBy ?? 'timestamp_desc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])\n }, unmarshalListLogsResponse);\n\n /**\n * List application logs. List the application logs of the function with the\n * specified ID.\n *\n * @param request - The request {@link ListLogsRequest}\n * @returns A Promise of ListLogsResponse\n */\n listLogs = request => enrichForPagination('logs', this.pageOfListLogs, request);\n pageOfListDomains = request => this.client.fetch({\n method: 'GET',\n path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains`,\n urlParams: urlParams(['function_id', request.functionId], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])\n }, unmarshalListDomainsResponse$1);\n\n /**\n * List all domain name bindings. List all domain name bindings in a specified\n * region.\n *\n * @param request - The request {@link ListDomainsRequest}\n * @returns A Promise of ListDomainsResponse\n */\n listDomains = request => enrichForPagination('domains', this.pageOfListDomains, request);\n\n /**\n * Get a domain name binding. Get a domain name binding for the function with\n * the specified ID.\n *\n * @param request - The request {@link GetDomainRequest}\n * @returns A Promise of Domain\n */\n getDomain = request => this.client.fetch({\n method: 'GET',\n path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam('domainId', request.domainId)}`\n }, unmarshalDomain$1);\n\n /**\n * Waits for {@link Domain} to be in a final state.\n *\n * @param request - The request {@link GetDomainRequest}\n * @param options - The waiting options\n * @returns A Promise of Domain\n */\n waitForDomain = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!DOMAIN_TRANSIENT_STATUSES$1.includes(res.status))), this.getDomain, request, options);\n\n /**\n * Create a domain name binding. Create a domain name binding for the function\n * with the specified ID.\n *\n * @param request - The request {@link CreateDomainRequest}\n * @returns A Promise of Domain\n */\n createDomain = request => this.client.fetch({\n body: JSON.stringify(marshalCreateDomainRequest$1(request, this.client.settings)),\n headers: jsonContentHeaders$i,\n method: 'POST',\n path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains`\n }, unmarshalDomain$1);\n\n /**\n * Delete a domain name binding. Delete a domain name binding for the function\n * with the specified ID.\n *\n * @param request - The request {@link DeleteDomainRequest}\n * @returns A Promise of Domain\n */\n deleteDomain = request => this.client.fetch({\n method: 'DELETE',\n path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam('domainId', request.domainId)}`\n }, unmarshalDomain$1);\n\n /**\n * @deprecated\n * @param request - The request {@link IssueJWTRequest}\n * @returns A Promise of Token\n */\n issueJWT = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/issue-jwt`,\n urlParams: urlParams(['expires_at', request.expiresAt], ...Object.entries(resolveOneOf([{\n param: 'function_id',\n value: request.functionId\n }, {\n param: 'namespace_id',\n value: request.namespaceId\n }])))\n }, unmarshalToken);\n\n /**\n * Create a new revocable token.\n *\n * @param request - The request {@link CreateTokenRequest}\n * @returns A Promise of Token\n */\n createToken = (request = {}) => this.client.fetch({\n body: JSON.stringify(marshalCreateTokenRequest(request, this.client.settings)),\n headers: jsonContentHeaders$i,\n method: 'POST',\n path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/tokens`\n }, unmarshalToken);\n\n /**\n * Get a token.\n *\n * @param request - The request {@link GetTokenRequest}\n * @returns A Promise of Token\n */\n getToken = request => this.client.fetch({\n method: 'GET',\n path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/tokens/${validatePathParam('tokenId', request.tokenId)}`\n }, unmarshalToken);\n\n /**\n * Waits for {@link Token} to be in a final state.\n *\n * @param request - The request {@link GetTokenRequest}\n * @param options - The waiting options\n * @returns A Promise of Token\n */\n waitForToken = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!TOKEN_TRANSIENT_STATUSES.includes(res.status))), this.getToken, request, options);\n pageOfListTokens = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/tokens`,\n urlParams: urlParams(['function_id', request.functionId], ['namespace_id', request.namespaceId], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])\n }, unmarshalListTokensResponse);\n\n /**\n * List all tokens.\n *\n * @param request - The request {@link ListTokensRequest}\n * @returns A Promise of ListTokensResponse\n */\n listTokens = (request = {}) => enrichForPagination('tokens', this.pageOfListTokens, request);\n\n /**\n * Delete a token.\n *\n * @param request - The request {@link DeleteTokenRequest}\n * @returns A Promise of Token\n */\n deleteToken = request => this.client.fetch({\n method: 'DELETE',\n path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/tokens/${validatePathParam('tokenId', request.tokenId)}`\n }, unmarshalToken);\n createTrigger = request => this.client.fetch({\n body: JSON.stringify(marshalCreateTriggerRequest(request, this.client.settings)),\n headers: jsonContentHeaders$i,\n method: 'POST',\n path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/triggers`\n }, unmarshalTrigger);\n getTrigger = request => this.client.fetch({\n method: 'GET',\n path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/triggers/${validatePathParam('triggerId', request.triggerId)}`\n }, unmarshalTrigger);\n\n /**\n * Waits for {@link Trigger} to be in a final state.\n *\n * @param request - The request {@link GetTriggerRequest}\n * @param options - The waiting options\n * @returns A Promise of Trigger\n */\n waitForTrigger = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!TRIGGER_TRANSIENT_STATUSES.includes(res.status))), this.getTrigger, request, options);\n pageOfListTriggers = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/triggers`,\n urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ...Object.entries(resolveOneOf([{\n default: this.client.settings.defaultProjectId,\n param: 'project_id',\n value: request.projectId\n }, {\n param: 'function_id',\n value: request.functionId\n }, {\n param: 'namespace_id',\n value: request.namespaceId\n }])))\n }, unmarshalListTriggersResponse);\n listTriggers = (request = {}) => enrichForPagination('triggers', this.pageOfListTriggers, request);\n updateTrigger = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateTriggerRequest(request, this.client.settings)),\n headers: jsonContentHeaders$i,\n method: 'PATCH',\n path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/triggers/${validatePathParam('triggerId', request.triggerId)}`\n }, unmarshalTrigger);\n deleteTrigger = request => this.client.fetch({\n method: 'DELETE',\n path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/triggers/${validatePathParam('triggerId', request.triggerId)}`\n }, unmarshalTrigger);\n};\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\nvar index_gen$h = /*#__PURE__*/Object.freeze({\n __proto__: null,\n API: API$j,\n CRON_TRANSIENT_STATUSES: CRON_TRANSIENT_STATUSES,\n DOMAIN_TRANSIENT_STATUSES: DOMAIN_TRANSIENT_STATUSES$1,\n FUNCTION_TRANSIENT_STATUSES: FUNCTION_TRANSIENT_STATUSES,\n NAMESPACE_TRANSIENT_STATUSES: NAMESPACE_TRANSIENT_STATUSES$1,\n TOKEN_TRANSIENT_STATUSES: TOKEN_TRANSIENT_STATUSES,\n TRIGGER_TRANSIENT_STATUSES: TRIGGER_TRANSIENT_STATUSES\n});\n\nvar index$k = /*#__PURE__*/Object.freeze({\n __proto__: null,\n v1beta1: index_gen$h\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst unmarshalAPIKey = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'APIKey' failed as data isn't a dictionary.`);\n }\n return {\n accessKey: data.access_key,\n applicationId: data.application_id,\n createdAt: unmarshalDate(data.created_at),\n creationIp: data.creation_ip,\n defaultProjectId: data.default_project_id,\n description: data.description,\n editable: data.editable,\n expiresAt: unmarshalDate(data.expires_at),\n secretKey: data.secret_key,\n updatedAt: unmarshalDate(data.updated_at),\n userId: data.user_id\n };\n};\nconst unmarshalApplication = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Application' failed as data isn't a dictionary.`);\n }\n return {\n createdAt: unmarshalDate(data.created_at),\n description: data.description,\n editable: data.editable,\n id: data.id,\n name: data.name,\n nbApiKeys: data.nb_api_keys,\n organizationId: data.organization_id,\n updatedAt: unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalGroup = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Group' failed as data isn't a dictionary.`);\n }\n return {\n applicationIds: data.application_ids,\n createdAt: unmarshalDate(data.created_at),\n description: data.description,\n id: data.id,\n name: data.name,\n organizationId: data.organization_id,\n updatedAt: unmarshalDate(data.updated_at),\n userIds: data.user_ids\n };\n};\nconst unmarshalJWT = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'JWT' failed as data isn't a dictionary.`);\n }\n return {\n audienceId: data.audience_id,\n createdAt: unmarshalDate(data.created_at),\n expiresAt: unmarshalDate(data.expires_at),\n ip: data.ip,\n issuerId: data.issuer_id,\n jti: data.jti,\n updatedAt: unmarshalDate(data.updated_at),\n userAgent: data.user_agent\n };\n};\nconst unmarshalPermissionSet = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'PermissionSet' failed as data isn't a dictionary.`);\n }\n return {\n categories: data.categories,\n description: data.description,\n id: data.id,\n name: data.name,\n scopeType: data.scope_type\n };\n};\nconst unmarshalPolicy = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Policy' failed as data isn't a dictionary.`);\n }\n return {\n applicationId: data.application_id,\n createdAt: unmarshalDate(data.created_at),\n description: data.description,\n editable: data.editable,\n groupId: data.group_id,\n id: data.id,\n name: data.name,\n nbPermissionSets: data.nb_permission_sets,\n nbRules: data.nb_rules,\n nbScopes: data.nb_scopes,\n noPrincipal: data.no_principal,\n organizationId: data.organization_id,\n updatedAt: unmarshalDate(data.updated_at),\n userId: data.user_id\n };\n};\nconst unmarshalQuotum = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Quotum' failed as data isn't a dictionary.`);\n }\n return {\n limit: data.limit,\n name: data.name,\n unlimited: data.unlimited\n };\n};\nconst unmarshalRule = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Rule' failed as data isn't a dictionary.`);\n }\n return {\n accountRootUserId: data.account_root_user_id,\n id: data.id,\n organizationId: data.organization_id,\n permissionSetNames: data.permission_set_names,\n permissionSetsScopeType: data.permission_sets_scope_type,\n projectIds: data.project_ids\n };\n};\nconst unmarshalSSHKey = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'SSHKey' failed as data isn't a dictionary.`);\n }\n return {\n createdAt: unmarshalDate(data.created_at),\n disabled: data.disabled,\n fingerprint: data.fingerprint,\n id: data.id,\n name: data.name,\n organizationId: data.organization_id,\n projectId: data.project_id,\n publicKey: data.public_key,\n updatedAt: unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalUser$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'User' failed as data isn't a dictionary.`);\n }\n return {\n accountRootUserId: data.account_root_user_id,\n createdAt: unmarshalDate(data.created_at),\n deletable: data.deletable,\n email: data.email,\n id: data.id,\n lastLoginAt: unmarshalDate(data.last_login_at),\n mfa: data.mfa,\n organizationId: data.organization_id,\n status: data.status,\n twoFactorEnabled: data.two_factor_enabled,\n type: data.type,\n updatedAt: unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalListAPIKeysResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListAPIKeysResponse' failed as data isn't a dictionary.`);\n }\n return {\n apiKeys: unmarshalArrayOfObject(data.api_keys, unmarshalAPIKey),\n totalCount: data.total_count\n };\n};\nconst unmarshalListApplicationsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListApplicationsResponse' failed as data isn't a dictionary.`);\n }\n return {\n applications: unmarshalArrayOfObject(data.applications, unmarshalApplication),\n totalCount: data.total_count\n };\n};\nconst unmarshalListGroupsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListGroupsResponse' failed as data isn't a dictionary.`);\n }\n return {\n groups: unmarshalArrayOfObject(data.groups, unmarshalGroup),\n totalCount: data.total_count\n };\n};\nconst unmarshalListJWTsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListJWTsResponse' failed as data isn't a dictionary.`);\n }\n return {\n jwts: unmarshalArrayOfObject(data.jwts, unmarshalJWT),\n totalCount: data.total_count\n };\n};\nconst unmarshalListPermissionSetsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListPermissionSetsResponse' failed as data isn't a dictionary.`);\n }\n return {\n permissionSets: unmarshalArrayOfObject(data.permission_sets, unmarshalPermissionSet),\n totalCount: data.total_count\n };\n};\nconst unmarshalListPoliciesResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListPoliciesResponse' failed as data isn't a dictionary.`);\n }\n return {\n policies: unmarshalArrayOfObject(data.policies, unmarshalPolicy),\n totalCount: data.total_count\n };\n};\nconst unmarshalListQuotaResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListQuotaResponse' failed as data isn't a dictionary.`);\n }\n return {\n quota: unmarshalArrayOfObject(data.quota, unmarshalQuotum),\n totalCount: data.total_count\n };\n};\nconst unmarshalListRulesResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListRulesResponse' failed as data isn't a dictionary.`);\n }\n return {\n rules: unmarshalArrayOfObject(data.rules, unmarshalRule),\n totalCount: data.total_count\n };\n};\nconst unmarshalListSSHKeysResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListSSHKeysResponse' failed as data isn't a dictionary.`);\n }\n return {\n sshKeys: unmarshalArrayOfObject(data.ssh_keys, unmarshalSSHKey),\n totalCount: data.total_count\n };\n};\nconst unmarshalListUsersResponse$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListUsersResponse' failed as data isn't a dictionary.`);\n }\n return {\n totalCount: data.total_count,\n users: unmarshalArrayOfObject(data.users, unmarshalUser$1)\n };\n};\nconst unmarshalSetRulesResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'SetRulesResponse' failed as data isn't a dictionary.`);\n }\n return {\n rules: unmarshalArrayOfObject(data.rules, unmarshalRule)\n };\n};\nconst marshalRuleSpecs = (request, defaults) => ({\n permission_set_names: request.permissionSetNames,\n ...resolveOneOf([{\n param: 'project_ids',\n value: request.projectIds\n }, {\n param: 'organization_id',\n value: request.organizationId\n }])\n});\nconst marshalAddGroupMemberRequest = (request, defaults) => ({\n ...resolveOneOf([{\n param: 'user_id',\n value: request.userId\n }, {\n param: 'application_id',\n value: request.applicationId\n }])\n});\nconst marshalAddGroupMembersRequest = (request, defaults) => ({\n application_ids: request.applicationIds,\n user_ids: request.userIds\n});\nconst marshalCreateAPIKeyRequest = (request, defaults) => ({\n default_project_id: request.defaultProjectId,\n description: request.description,\n expires_at: request.expiresAt,\n ...resolveOneOf([{\n param: 'application_id',\n value: request.applicationId\n }, {\n param: 'user_id',\n value: request.userId\n }])\n});\nconst marshalCreateApplicationRequest = (request, defaults) => ({\n description: request.description,\n name: request.name || randomName('app'),\n organization_id: request.organizationId ?? defaults.defaultOrganizationId\n});\nconst marshalCreateGroupRequest = (request, defaults) => ({\n description: request.description,\n name: request.name || randomName('grp'),\n organization_id: request.organizationId ?? defaults.defaultOrganizationId\n});\nconst marshalCreatePolicyRequest = (request, defaults) => ({\n description: request.description,\n name: request.name || randomName('pol'),\n organization_id: request.organizationId ?? defaults.defaultOrganizationId,\n rules: request.rules ? request.rules.map(elt => marshalRuleSpecs(elt)) : undefined,\n ...resolveOneOf([{\n param: 'user_id',\n value: request.userId\n }, {\n param: 'group_id',\n value: request.groupId\n }, {\n param: 'application_id',\n value: request.applicationId\n }, {\n param: 'no_principal',\n value: request.noPrincipal\n }])\n});\nconst marshalCreateSSHKeyRequest = (request, defaults) => ({\n name: request.name || randomName('key'),\n project_id: request.projectId ?? defaults.defaultProjectId,\n public_key: request.publicKey\n});\nconst marshalCreateUserRequest$1 = (request, defaults) => ({\n email: request.email,\n organization_id: request.organizationId ?? defaults.defaultOrganizationId\n});\nconst marshalRemoveGroupMemberRequest = (request, defaults) => ({\n ...resolveOneOf([{\n param: 'user_id',\n value: request.userId\n }, {\n param: 'application_id',\n value: request.applicationId\n }])\n});\nconst marshalSetGroupMembersRequest = (request, defaults) => ({\n application_ids: request.applicationIds,\n user_ids: request.userIds\n});\nconst marshalSetRulesRequest = (request, defaults) => ({\n policy_id: request.policyId,\n rules: request.rules.map(elt => marshalRuleSpecs(elt))\n});\nconst marshalUpdateAPIKeyRequest = (request, defaults) => ({\n default_project_id: request.defaultProjectId,\n description: request.description\n});\nconst marshalUpdateApplicationRequest = (request, defaults) => ({\n description: request.description,\n name: request.name\n});\nconst marshalUpdateGroupRequest = (request, defaults) => ({\n description: request.description,\n name: request.name\n});\nconst marshalUpdatePolicyRequest = (request, defaults) => ({\n description: request.description,\n name: request.name,\n ...resolveOneOf([{\n param: 'user_id',\n value: request.userId\n }, {\n param: 'group_id',\n value: request.groupId\n }, {\n param: 'application_id',\n value: request.applicationId\n }, {\n param: 'no_principal',\n value: request.noPrincipal\n }])\n});\nconst marshalUpdateSSHKeyRequest = (request, defaults) => ({\n disabled: request.disabled,\n name: request.name\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst jsonContentHeaders$h = {\n 'Content-Type': 'application/json; charset=utf-8'\n};\n\n/** IAM API. */\nlet API$i = class API extends API$u {\n pageOfListSSHKeys = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/iam/v1alpha1/ssh-keys`,\n urlParams: urlParams(['disabled', request.disabled], ['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])\n }, unmarshalListSSHKeysResponse);\n\n /**\n * List SSH keys. List SSH keys. By default, the SSH keys listed are ordered\n * by creation date in ascending order. This can be modified via the\n * `order_by` field. You can define additional parameters for your query such\n * as `organization_id`, `name`, `project_id` and `disabled`.\n *\n * @param request - The request {@link ListSSHKeysRequest}\n * @returns A Promise of ListSSHKeysResponse\n */\n listSSHKeys = (request = {}) => enrichForPagination('sshKeys', this.pageOfListSSHKeys, request);\n\n /**\n * Create an SSH key. Add a new SSH key to a Scaleway Project. You must\n * specify the `name`, `public_key` and `project_id`.\n *\n * @param request - The request {@link CreateSSHKeyRequest}\n * @returns A Promise of SSHKey\n */\n createSSHKey = request => this.client.fetch({\n body: JSON.stringify(marshalCreateSSHKeyRequest(request, this.client.settings)),\n headers: jsonContentHeaders$h,\n method: 'POST',\n path: `/iam/v1alpha1/ssh-keys`\n }, unmarshalSSHKey);\n\n /**\n * Get an SSH key. Retrieve information about a given SSH key, specified by\n * the `ssh_key_id` parameter. The SSH key's full details, including `id`,\n * `name`, `public_key`, and `project_id` are returned in the response.\n *\n * @param request - The request {@link GetSSHKeyRequest}\n * @returns A Promise of SSHKey\n */\n getSSHKey = request => this.client.fetch({\n method: 'GET',\n path: `/iam/v1alpha1/ssh-keys/${validatePathParam('sshKeyId', request.sshKeyId)}`\n }, unmarshalSSHKey);\n\n /**\n * Update an SSH key. Update the parameters of an SSH key, including `name`\n * and `disable`.\n *\n * @param request - The request {@link UpdateSSHKeyRequest}\n * @returns A Promise of SSHKey\n */\n updateSSHKey = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateSSHKeyRequest(request, this.client.settings)),\n headers: jsonContentHeaders$h,\n method: 'PATCH',\n path: `/iam/v1alpha1/ssh-keys/${validatePathParam('sshKeyId', request.sshKeyId)}`\n }, unmarshalSSHKey);\n\n /**\n * Delete an SSH key. Delete a given SSH key, specified by the `ssh_key_id`.\n * Deleting an SSH is permanent, and cannot be undone. Note that you might\n * need to update any configurations that used the SSH key.\n *\n * @param request - The request {@link DeleteSSHKeyRequest}\n */\n deleteSSHKey = request => this.client.fetch({\n method: 'DELETE',\n path: `/iam/v1alpha1/ssh-keys/${validatePathParam('sshKeyId', request.sshKeyId)}`\n });\n pageOfListUsers = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/iam/v1alpha1/users`,\n urlParams: urlParams(['mfa', request.mfa], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['user_ids', request.userIds])\n }, unmarshalListUsersResponse$1);\n\n /**\n * List users of an Organization. List the users of an Organization. By\n * default, the users listed are ordered by creation date in ascending order.\n * This can be modified via the `order_by` field. You must define the\n * `organization_id` in the query path of your request. You can also define\n * additional parameters for your query such as `user_ids`.\n *\n * @param request - The request {@link ListUsersRequest}\n * @returns A Promise of ListUsersResponse\n */\n listUsers = (request = {}) => enrichForPagination('users', this.pageOfListUsers, request);\n\n /**\n * Get a given user. Retrieve information about a user, specified by the\n * `user_id` parameter. The user's full details, including `id`, `email`,\n * `organization_id`, `status` and `mfa` are returned in the response.\n *\n * @param request - The request {@link GetUserRequest}\n * @returns A Promise of User\n */\n getUser = request => this.client.fetch({\n method: 'GET',\n path: `/iam/v1alpha1/users/${validatePathParam('userId', request.userId)}`\n }, unmarshalUser$1);\n\n /**\n * Delete a guest user from an Organization. Remove a user from an\n * Organization in which they are a guest. You must define the `user_id` in\n * your request. Note that removing a user from an Organization automatically\n * deletes their API keys, and any policies directly attached to them become\n * orphaned.\n *\n * @param request - The request {@link DeleteUserRequest}\n */\n deleteUser = request => this.client.fetch({\n method: 'DELETE',\n path: `/iam/v1alpha1/users/${validatePathParam('userId', request.userId)}`\n });\n\n /**\n * Create a new user. Create a new user. You must define the `organization_id`\n * and the `email` in your request.\n *\n * @param request - The request {@link CreateUserRequest}\n * @returns A Promise of User\n */\n createUser = request => this.client.fetch({\n body: JSON.stringify(marshalCreateUserRequest$1(request, this.client.settings)),\n headers: jsonContentHeaders$h,\n method: 'POST',\n path: `/iam/v1alpha1/users`\n }, unmarshalUser$1);\n pageOfListApplications = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/iam/v1alpha1/applications`,\n urlParams: urlParams(['application_ids', request.applicationIds], ['editable', request.editable], ['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])\n }, unmarshalListApplicationsResponse);\n\n /**\n * List applications of an Organization. List the applications of an\n * Organization. By default, the applications listed are ordered by creation\n * date in ascending order. This can be modified via the `order_by` field. You\n * must define the `organization_id` in the query path of your request. You\n * can also define additional parameters for your query such as\n * `application_ids`.\n *\n * @param request - The request {@link ListApplicationsRequest}\n * @returns A Promise of ListApplicationsResponse\n */\n listApplications = (request = {}) => enrichForPagination('applications', this.pageOfListApplications, request);\n\n /**\n * Create a new application. Create a new application. You must define the\n * `name` parameter in the request.\n *\n * @param request - The request {@link CreateApplicationRequest}\n * @returns A Promise of Application\n */\n createApplication = request => this.client.fetch({\n body: JSON.stringify(marshalCreateApplicationRequest(request, this.client.settings)),\n headers: jsonContentHeaders$h,\n method: 'POST',\n path: `/iam/v1alpha1/applications`\n }, unmarshalApplication);\n\n /**\n * Get a given application. Retrieve information about an application,\n * specified by the `application_id` parameter. The application's full\n * details, including `id`, `email`, `organization_id`, `status` and\n * `two_factor_enabled` are returned in the response.\n *\n * @param request - The request {@link GetApplicationRequest}\n * @returns A Promise of Application\n */\n getApplication = request => this.client.fetch({\n method: 'GET',\n path: `/iam/v1alpha1/applications/${validatePathParam('applicationId', request.applicationId)}`\n }, unmarshalApplication);\n\n /**\n * Update an application. Update the parameters of an application, including\n * `name` and `description`.\n *\n * @param request - The request {@link UpdateApplicationRequest}\n * @returns A Promise of Application\n */\n updateApplication = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateApplicationRequest(request, this.client.settings)),\n headers: jsonContentHeaders$h,\n method: 'PATCH',\n path: `/iam/v1alpha1/applications/${validatePathParam('applicationId', request.applicationId)}`\n }, unmarshalApplication);\n\n /**\n * Delete an application. Delete an application. Note that this action is\n * irreversible and will automatically delete the application's API keys.\n * Policies attached to users and applications via this group will no longer\n * apply.\n *\n * @param request - The request {@link DeleteApplicationRequest}\n */\n deleteApplication = request => this.client.fetch({\n method: 'DELETE',\n path: `/iam/v1alpha1/applications/${validatePathParam('applicationId', request.applicationId)}`\n });\n pageOfListGroups = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/iam/v1alpha1/groups`,\n urlParams: urlParams(['application_ids', request.applicationIds], ['group_ids', request.groupIds], ['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['user_ids', request.userIds])\n }, unmarshalListGroupsResponse);\n\n /**\n * List groups. List groups. By default, the groups listed are ordered by\n * creation date in ascending order. This can be modified via the `order_by`\n * field. You can define additional parameters to filter your query. Use\n * `user_ids` or `application_ids` to list all groups certain users or\n * applications belong to.\n *\n * @param request - The request {@link ListGroupsRequest}\n * @returns A Promise of ListGroupsResponse\n */\n listGroups = (request = {}) => enrichForPagination('groups', this.pageOfListGroups, request);\n\n /**\n * Create a group. Create a new group. You must define the `name` and\n * `organization_id` parameters in the request.\n *\n * @param request - The request {@link CreateGroupRequest}\n * @returns A Promise of Group\n */\n createGroup = request => this.client.fetch({\n body: JSON.stringify(marshalCreateGroupRequest(request, this.client.settings)),\n headers: jsonContentHeaders$h,\n method: 'POST',\n path: `/iam/v1alpha1/groups`\n }, unmarshalGroup);\n\n /**\n * Get a group. Retrive information about a given group, specified by the\n * `group_id` parameter. The group's full details, including `user_ids` and\n * `application_ids` are returned in the response.\n *\n * @param request - The request {@link GetGroupRequest}\n * @returns A Promise of Group\n */\n getGroup = request => this.client.fetch({\n method: 'GET',\n path: `/iam/v1alpha1/groups/${validatePathParam('groupId', request.groupId)}`\n }, unmarshalGroup);\n\n /**\n * Update a group. Update the parameters of group, including `name` and\n * `description`.\n *\n * @param request - The request {@link UpdateGroupRequest}\n * @returns A Promise of Group\n */\n updateGroup = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateGroupRequest(request, this.client.settings)),\n headers: jsonContentHeaders$h,\n method: 'PATCH',\n path: `/iam/v1alpha1/groups/${validatePathParam('groupId', request.groupId)}`\n }, unmarshalGroup);\n\n /**\n * Overwrite users and applications of a group. Overwrite users and\n * applications configuration in a group. Any information that you add using\n * this command will overwrite the previous configuration.\n *\n * @param request - The request {@link SetGroupMembersRequest}\n * @returns A Promise of Group\n */\n setGroupMembers = request => this.client.fetch({\n body: JSON.stringify(marshalSetGroupMembersRequest(request, this.client.settings)),\n headers: jsonContentHeaders$h,\n method: 'PUT',\n path: `/iam/v1alpha1/groups/${validatePathParam('groupId', request.groupId)}/members`\n }, unmarshalGroup);\n\n /**\n * Add a user or an application to a group. Add a user or an application to a\n * group. You can specify a `user_id` and and `application_id` in the body of\n * your request. Note that you can only add one of each per request.\n *\n * @param request - The request {@link AddGroupMemberRequest}\n * @returns A Promise of Group\n */\n addGroupMember = request => this.client.fetch({\n body: JSON.stringify(marshalAddGroupMemberRequest(request, this.client.settings)),\n headers: jsonContentHeaders$h,\n method: 'POST',\n path: `/iam/v1alpha1/groups/${validatePathParam('groupId', request.groupId)}/add-member`\n }, unmarshalGroup);\n\n /**\n * Add multiple users and applications to a group. Add multiple users and\n * applications to a group in a single call. You can specify an array of\n * `user_id`s and `application_id`s. Note that any existing users and\n * applications in the group will remain. To add new users/applications and\n * delete pre-existing ones, use the [Overwrite users and applications of a\n * group](#path-groups-overwrite-users-and-applications-of-a-group) method.\n *\n * @param request - The request {@link AddGroupMembersRequest}\n * @returns A Promise of Group\n */\n addGroupMembers = request => this.client.fetch({\n body: JSON.stringify(marshalAddGroupMembersRequest(request, this.client.settings)),\n headers: jsonContentHeaders$h,\n method: 'POST',\n path: `/iam/v1alpha1/groups/${validatePathParam('groupId', request.groupId)}/add-members`\n }, unmarshalGroup);\n\n /**\n * Remove a user or an application from a group. Remove a user or an\n * application from a group. You can specify a `user_id` and and\n * `application_id` in the body of your request. Note that you can only remove\n * one of each per request. Removing a user from a group means that any\n * permissions given to them via the group (i.e. from an attached policy) will\n * no longer apply. Be sure you want to remove these permissions from the user\n * before proceeding.\n *\n * @param request - The request {@link RemoveGroupMemberRequest}\n * @returns A Promise of Group\n */\n removeGroupMember = request => this.client.fetch({\n body: JSON.stringify(marshalRemoveGroupMemberRequest(request, this.client.settings)),\n headers: jsonContentHeaders$h,\n method: 'POST',\n path: `/iam/v1alpha1/groups/${validatePathParam('groupId', request.groupId)}/remove-member`\n }, unmarshalGroup);\n\n /**\n * Delete a group. Delete a group. Note that this action is irreversible and\n * could delete permissions for group members. Policies attached to users and\n * applications via this group will no longer apply.\n *\n * @param request - The request {@link DeleteGroupRequest}\n */\n deleteGroup = request => this.client.fetch({\n method: 'DELETE',\n path: `/iam/v1alpha1/groups/${validatePathParam('groupId', request.groupId)}`\n });\n pageOfListPolicies = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/iam/v1alpha1/policies`,\n urlParams: urlParams(['application_ids', request.applicationIds], ['editable', request.editable], ['group_ids', request.groupIds], ['no_principal', request.noPrincipal], ['order_by', request.orderBy ?? 'policy_name_asc'], ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['policy_name', request.policyName], ['user_ids', request.userIds])\n }, unmarshalListPoliciesResponse);\n\n /**\n * List policies of an Organization. List the policies of an Organization. By\n * default, the policies listed are ordered by creation date in ascending\n * order. This can be modified via the `order_by` field. You must define the\n * `organization_id` in the query path of your request. You can also define\n * additional parameters to filter your query, such as `user_ids`,\n * `groups_ids`, `application_ids`, and `policy_name`.\n *\n * @param request - The request {@link ListPoliciesRequest}\n * @returns A Promise of ListPoliciesResponse\n */\n listPolicies = (request = {}) => enrichForPagination('policies', this.pageOfListPolicies, request);\n\n /**\n * Create a new policy. Create a new application. You must define the `name`\n * parameter in the request. You can specify parameters such as `user_id`,\n * `groups_id`, `application_id`, `no_principal`, `rules` and its child\n * attributes.\n *\n * @param request - The request {@link CreatePolicyRequest}\n * @returns A Promise of Policy\n */\n createPolicy = request => this.client.fetch({\n body: JSON.stringify(marshalCreatePolicyRequest(request, this.client.settings)),\n headers: jsonContentHeaders$h,\n method: 'POST',\n path: `/iam/v1alpha1/policies`\n }, unmarshalPolicy);\n\n /**\n * Get an existing policy. Retrieve information about a policy, speficified by\n * the `policy_id` parameter. The policy's full details, including `id`,\n * `name`, `organization_id`, `nb_rules` and `nb_scopes`, `nb_permission_sets`\n * are returned in the response.\n *\n * @param request - The request {@link GetPolicyRequest}\n * @returns A Promise of Policy\n */\n getPolicy = request => this.client.fetch({\n method: 'GET',\n path: `/iam/v1alpha1/policies/${validatePathParam('policyId', request.policyId)}`\n }, unmarshalPolicy);\n\n /**\n * Update an existing policy. Update the parameters of a policy, including\n * `name`, `description`, `user_id`, `group_id`, `application_id` and\n * `no_principal`.\n *\n * @param request - The request {@link UpdatePolicyRequest}\n * @returns A Promise of Policy\n */\n updatePolicy = request => this.client.fetch({\n body: JSON.stringify(marshalUpdatePolicyRequest(request, this.client.settings)),\n headers: jsonContentHeaders$h,\n method: 'PATCH',\n path: `/iam/v1alpha1/policies/${validatePathParam('policyId', request.policyId)}`\n }, unmarshalPolicy);\n\n /**\n * Delete a policy. Delete a policy. You must define specify the `policy_id`\n * parameter in your request. Note that when deleting a policy, all\n * permissions it gives to its principal (user, group or application) will be\n * revoked.\n *\n * @param request - The request {@link DeletePolicyRequest}\n */\n deletePolicy = request => this.client.fetch({\n method: 'DELETE',\n path: `/iam/v1alpha1/policies/${validatePathParam('policyId', request.policyId)}`\n });\n\n /**\n * Clone a policy. Clone a policy. You must define specify the `policy_id`\n * parameter in your request.\n *\n * @param request - The request {@link ClonePolicyRequest}\n * @returns A Promise of Policy\n */\n clonePolicy = request => this.client.fetch({\n body: '{}',\n headers: jsonContentHeaders$h,\n method: 'POST',\n path: `/iam/v1alpha1/policies/${validatePathParam('policyId', request.policyId)}/clone`\n }, unmarshalPolicy);\n\n /**\n * Set rules of a given policy. Overwrite the rules of a given policy. Any\n * information that you add using this command will overwrite the previous\n * configuration. If you include some of the rules you already had in your\n * previous configuration in your new one, but you change their order, the new\n * order of display will apply. While policy rules are ordered, they have no\n * impact on the access logic of IAM because rules are allow-only.\n *\n * @param request - The request {@link SetRulesRequest}\n * @returns A Promise of SetRulesResponse\n */\n setRules = request => this.client.fetch({\n body: JSON.stringify(marshalSetRulesRequest(request, this.client.settings)),\n headers: jsonContentHeaders$h,\n method: 'PUT',\n path: `/iam/v1alpha1/rules`\n }, unmarshalSetRulesResponse);\n pageOfListRules = request => this.client.fetch({\n method: 'GET',\n path: `/iam/v1alpha1/rules`,\n urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['policy_id', request.policyId])\n }, unmarshalListRulesResponse);\n\n /**\n * List rules of a given policy. List the rules of a given policy. By default,\n * the rules listed are ordered by creation date in ascending order. This can\n * be modified via the `order_by` field. You must define the `policy_id` in\n * the query path of your request.\n *\n * @param request - The request {@link ListRulesRequest}\n * @returns A Promise of ListRulesResponse\n */\n listRules = request => enrichForPagination('rules', this.pageOfListRules, request);\n pageOfListPermissionSets = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/iam/v1alpha1/permission-sets`,\n urlParams: urlParams(['order_by', request.orderBy ?? 'name_asc'], ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])\n }, unmarshalListPermissionSetsResponse);\n\n /**\n * List permission sets. List permission sets available for given\n * Organization. You must define the `organization_id` in the query path of\n * your request.\n *\n * @param request - The request {@link ListPermissionSetsRequest}\n * @returns A Promise of ListPermissionSetsResponse\n */\n listPermissionSets = (request = {}) => enrichForPagination('permissionSets', this.pageOfListPermissionSets, request);\n pageOfListAPIKeys = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/iam/v1alpha1/api-keys`,\n urlParams: urlParams(['access_key', request.accessKey], ['bearer_id', request.bearerId], ['bearer_type', request.bearerType ?? 'unknown_bearer_type'], ['description', request.description], ['editable', request.editable], ['expired', request.expired], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ...Object.entries(resolveOneOf([{\n param: 'application_id',\n value: request.applicationId\n }, {\n param: 'user_id',\n value: request.userId\n }])))\n }, unmarshalListAPIKeysResponse);\n\n /**\n * List API keys. List API keys. By default, the API keys listed are ordered\n * by creation date in ascending order. This can be modified via the\n * `order_by` field. You can define additional parameters for your query such\n * as `editable`, `expired`, `access_key` and `bearer_id`.\n *\n * @param request - The request {@link ListAPIKeysRequest}\n * @returns A Promise of ListAPIKeysResponse\n */\n listAPIKeys = (request = {}) => enrichForPagination('apiKeys', this.pageOfListAPIKeys, request);\n\n /**\n * Create an API key. Create an API key. You must specify the `application_id`\n * or the `user_id` and the description. You can also specify the\n * `default_project_id` which is the Project ID of your preferred Project, to\n * use with Object Storage. The `access_key` and `secret_key` values are\n * returned in the response. Note that he secret key is only showed once. Make\n * sure that you copy and store both keys somewhere safe.\n *\n * @param request - The request {@link CreateAPIKeyRequest}\n * @returns A Promise of APIKey\n */\n createAPIKey = request => this.client.fetch({\n body: JSON.stringify(marshalCreateAPIKeyRequest(request, this.client.settings)),\n headers: jsonContentHeaders$h,\n method: 'POST',\n path: `/iam/v1alpha1/api-keys`\n }, unmarshalAPIKey);\n\n /**\n * Get an API key. Retrive information about an API key, specified by the\n * `access_key` parameter. The API key's details, including either the\n * `user_id` or `application_id` of its bearer are returned in the response.\n * Note that the string value for the `secret_key` is nullable, and therefore\n * is not displayed in the response. The `secret_key` value is only displayed\n * upon API key creation.\n *\n * @param request - The request {@link GetAPIKeyRequest}\n * @returns A Promise of APIKey\n */\n getAPIKey = request => this.client.fetch({\n method: 'GET',\n path: `/iam/v1alpha1/api-keys/${validatePathParam('accessKey', request.accessKey)}`\n }, unmarshalAPIKey);\n\n /**\n * Update an API key. Update the parameters of an API key, including\n * `default_project_id` and `description`.\n *\n * @param request - The request {@link UpdateAPIKeyRequest}\n * @returns A Promise of APIKey\n */\n updateAPIKey = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateAPIKeyRequest(request, this.client.settings)),\n headers: jsonContentHeaders$h,\n method: 'PATCH',\n path: `/iam/v1alpha1/api-keys/${validatePathParam('accessKey', request.accessKey)}`\n }, unmarshalAPIKey);\n\n /**\n * Delete an API key. Delete an API key. Note that this action is irreversible\n * and cannot be undone. Make sure you update any configurations using the API\n * keys you delete.\n *\n * @param request - The request {@link DeleteAPIKeyRequest}\n */\n deleteAPIKey = request => this.client.fetch({\n method: 'DELETE',\n path: `/iam/v1alpha1/api-keys/${validatePathParam('accessKey', request.accessKey)}`\n });\n pageOfListQuota = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/iam/v1alpha1/quota`,\n urlParams: urlParams(['order_by', request.orderBy ?? 'name_asc'], ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])\n }, unmarshalListQuotaResponse);\n\n /**\n * List all quotas in the Organization. List all product and features quota\n * for an Organization, with their associated limits. By default, the quota\n * listed are ordered by creation date in ascending order. This can be\n * modified via the `order_by` field. You must define the `organization_id` in\n * the query path of your request.\n *\n * @param request - The request {@link ListQuotaRequest}\n * @returns A Promise of ListQuotaResponse\n */\n listQuota = (request = {}) => enrichForPagination('quota', this.pageOfListQuota, request);\n\n /**\n * Get a quota in the Organization. Retrieve information about a resource\n * quota, speficified by the `quotum_name` parameter. The quota's `limit`, or\n * whether it is unlimited, is returned in the response.\n *\n * @param request - The request {@link GetQuotumRequest}\n * @returns A Promise of Quotum\n */\n getQuotum = request => this.client.fetch({\n method: 'GET',\n path: `/iam/v1alpha1/quota/${validatePathParam('quotumName', request.quotumName)}`,\n urlParams: urlParams(['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId])\n }, unmarshalQuotum);\n pageOfListJWTs = request => this.client.fetch({\n method: 'GET',\n path: `/iam/v1alpha1/jwts`,\n urlParams: urlParams(['audience_id', request.audienceId], ['expired', request.expired], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])\n }, unmarshalListJWTsResponse);\n\n /**\n * List JWTs.\n *\n * @param request - The request {@link ListJWTsRequest}\n * @returns A Promise of ListJWTsResponse\n */\n listJWTs = request => enrichForPagination('jwts', this.pageOfListJWTs, request);\n\n /**\n * Get a JWT.\n *\n * @param request - The request {@link GetJWTRequest}\n * @returns A Promise of JWT\n */\n getJWT = request => this.client.fetch({\n method: 'GET',\n path: `/iam/v1alpha1/jwts/${validatePathParam('jti', request.jti)}`\n }, unmarshalJWT);\n\n /**\n * Delete a JWT.\n *\n * @param request - The request {@link DeleteJWTRequest}\n */\n deleteJWT = request => this.client.fetch({\n method: 'DELETE',\n path: `/iam/v1alpha1/jwts/${validatePathParam('jti', request.jti)}`\n });\n};\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\nconst CreateAPIKeyRequest = {\n description: {\n ignoreEmpty: true,\n maxLength: 200\n }\n};\nconst CreateApplicationRequest = {\n description: {\n ignoreEmpty: true,\n maxLength: 200\n },\n name: {\n maxLength: 64,\n minLength: 1,\n pattern: /^[a-zA-Z0-9\\(\\)\\._\\- ]+$/\n }\n};\nconst CreateGroupRequest = {\n description: {\n ignoreEmpty: true,\n maxLength: 200\n },\n name: {\n maxLength: 64,\n minLength: 1,\n pattern: /^[a-zA-Z0-9\\(\\)\\._\\- ]+$/\n }\n};\nconst CreatePolicyRequest = {\n description: {\n ignoreEmpty: true,\n maxLength: 200\n },\n name: {\n maxLength: 64,\n minLength: 1,\n pattern: /^[a-zA-Z0-9\\(\\)\\._\\- ]+$/\n }\n};\nconst CreateSSHKeyRequest = {\n name: {\n ignoreEmpty: true,\n maxLength: 1000\n },\n publicKey: {\n maxLength: 65000,\n minLength: 1\n }\n};\nconst GetQuotumRequest = {\n quotumName: {\n minLength: 1\n }\n};\nconst ListAPIKeysRequest = {\n description: {\n maxLength: 200\n },\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThanOrEqual: 1,\n lessThanOrEqual: 100\n }\n};\nconst ListApplicationsRequest = {\n name: {\n maxLength: 64,\n minLength: 1,\n pattern: /^[a-zA-Z0-9\\(\\)\\._\\- ]+$/\n },\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThanOrEqual: 1,\n lessThanOrEqual: 100\n }\n};\nconst ListGroupsRequest = {\n name: {\n minLength: 1\n },\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThanOrEqual: 1,\n lessThanOrEqual: 100\n }\n};\nconst ListJWTsRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThanOrEqual: 1,\n lessThanOrEqual: 100\n }\n};\nconst ListPermissionSetsRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThanOrEqual: 1,\n lessThanOrEqual: 100\n }\n};\nconst ListPoliciesRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThanOrEqual: 1,\n lessThanOrEqual: 100\n },\n policyName: {\n minLength: 1\n }\n};\nconst ListQuotaRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThanOrEqual: 1,\n lessThanOrEqual: 100\n }\n};\nconst ListRulesRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThanOrEqual: 1,\n lessThanOrEqual: 100\n }\n};\nconst ListSSHKeysRequest = {\n name: {\n maxLength: 1000,\n minLength: 1\n },\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThanOrEqual: 1,\n lessThanOrEqual: 100\n }\n};\nconst ListUsersRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThanOrEqual: 1,\n lessThanOrEqual: 100\n }\n};\nconst UpdateAPIKeyRequest = {\n description: {\n maxLength: 200\n }\n};\nconst UpdateApplicationRequest = {\n description: {\n maxLength: 200\n },\n name: {\n maxLength: 64,\n minLength: 1,\n pattern: /^[a-zA-Z0-9\\(\\)\\._\\- ]+$/\n }\n};\nconst UpdateGroupRequest = {\n description: {\n maxLength: 200\n },\n name: {\n maxLength: 64,\n minLength: 1,\n pattern: /^[a-zA-Z0-9\\(\\)\\._\\- ]+$/\n }\n};\nconst UpdatePolicyRequest = {\n description: {\n maxLength: 200\n },\n name: {\n maxLength: 64,\n minLength: 1,\n pattern: /^[a-zA-Z0-9\\(\\)\\._\\- ]+$/\n }\n};\nconst UpdateSSHKeyRequest = {\n name: {\n maxLength: 1000\n }\n};\n\nvar validationRules_gen$4 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n CreateAPIKeyRequest: CreateAPIKeyRequest,\n CreateApplicationRequest: CreateApplicationRequest,\n CreateGroupRequest: CreateGroupRequest,\n CreatePolicyRequest: CreatePolicyRequest,\n CreateSSHKeyRequest: CreateSSHKeyRequest,\n GetQuotumRequest: GetQuotumRequest,\n ListAPIKeysRequest: ListAPIKeysRequest,\n ListApplicationsRequest: ListApplicationsRequest,\n ListGroupsRequest: ListGroupsRequest,\n ListJWTsRequest: ListJWTsRequest,\n ListPermissionSetsRequest: ListPermissionSetsRequest,\n ListPoliciesRequest: ListPoliciesRequest,\n ListQuotaRequest: ListQuotaRequest,\n ListRulesRequest: ListRulesRequest,\n ListSSHKeysRequest: ListSSHKeysRequest,\n ListUsersRequest: ListUsersRequest,\n UpdateAPIKeyRequest: UpdateAPIKeyRequest,\n UpdateApplicationRequest: UpdateApplicationRequest,\n UpdateGroupRequest: UpdateGroupRequest,\n UpdatePolicyRequest: UpdatePolicyRequest,\n UpdateSSHKeyRequest: UpdateSSHKeyRequest\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\nvar index_gen$g = /*#__PURE__*/Object.freeze({\n __proto__: null,\n API: API$i,\n ValidationRules: validationRules_gen$4\n});\n\nvar index$j = /*#__PURE__*/Object.freeze({\n __proto__: null,\n v1alpha1: index_gen$g\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst unmarshalServerSummary = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ServerSummary' failed as data isn't a dictionary.`);\n }\n return {\n id: data.id,\n name: data.name\n };\n};\nconst unmarshalBootscript = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Bootscript' failed as data isn't a dictionary.`);\n }\n return {\n arch: data.arch,\n bootcmdargs: data.bootcmdargs,\n default: data.default,\n dtb: data.dtb,\n id: data.id,\n initrd: data.initrd,\n kernel: data.kernel,\n organization: data.organization,\n project: data.project,\n public: data.public,\n title: data.title,\n zone: data.zone\n };\n};\nconst unmarshalServerTypeNetworkInterface = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ServerTypeNetworkInterface' failed as data isn't a dictionary.`);\n }\n return {\n internalBandwidth: data.internal_bandwidth,\n internetBandwidth: data.internet_bandwidth\n };\n};\nconst unmarshalServerTypeVolumeConstraintSizes = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ServerTypeVolumeConstraintSizes' failed as data isn't a dictionary.`);\n }\n return {\n maxSize: data.max_size,\n minSize: data.min_size\n };\n};\nconst unmarshalVolume$2 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Volume' failed as data isn't a dictionary.`);\n }\n return {\n creationDate: unmarshalDate(data.creation_date),\n exportUri: data.export_uri,\n id: data.id,\n modificationDate: unmarshalDate(data.modification_date),\n name: data.name,\n organization: data.organization,\n project: data.project,\n server: data.server ? unmarshalServerSummary(data.server) : undefined,\n size: data.size,\n state: data.state,\n tags: data.tags,\n volumeType: data.volume_type,\n zone: data.zone\n };\n};\nconst unmarshalVolumeSummary = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'VolumeSummary' failed as data isn't a dictionary.`);\n }\n return {\n id: data.id,\n name: data.name,\n size: data.size,\n volumeType: data.volume_type\n };\n};\nconst unmarshalImage$3 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Image' failed as data isn't a dictionary.`);\n }\n return {\n arch: data.arch,\n creationDate: unmarshalDate(data.creation_date),\n defaultBootscript: data.default_bootscript ? unmarshalBootscript(data.default_bootscript) : undefined,\n extraVolumes: unmarshalMapOfObject(data.extra_volumes, unmarshalVolume$2),\n fromServer: data.from_server,\n id: data.id,\n modificationDate: unmarshalDate(data.modification_date),\n name: data.name,\n organization: data.organization,\n project: data.project,\n public: data.public,\n rootVolume: data.root_volume ? unmarshalVolumeSummary(data.root_volume) : undefined,\n state: data.state,\n tags: data.tags,\n zone: data.zone\n };\n};\nconst unmarshalPlacementGroup = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'PlacementGroup' failed as data isn't a dictionary.`);\n }\n return {\n id: data.id,\n name: data.name,\n organization: data.organization,\n policyMode: data.policy_mode,\n policyRespected: data.policy_respected,\n policyType: data.policy_type,\n project: data.project,\n tags: data.tags,\n zone: data.zone\n };\n};\nconst unmarshalPrivateNIC = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'PrivateNIC' failed as data isn't a dictionary.`);\n }\n return {\n id: data.id,\n macAddress: data.mac_address,\n privateNetworkId: data.private_network_id,\n serverId: data.server_id,\n state: data.state,\n tags: data.tags\n };\n};\nconst unmarshalSecurityGroupSummary = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'SecurityGroupSummary' failed as data isn't a dictionary.`);\n }\n return {\n id: data.id,\n name: data.name\n };\n};\nconst unmarshalServerIp = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ServerIp' failed as data isn't a dictionary.`);\n }\n return {\n address: data.address,\n dynamic: data.dynamic,\n family: data.family,\n gateway: data.gateway,\n id: data.id,\n netmask: data.netmask,\n provisioningMode: data.provisioning_mode,\n tags: data.tags\n };\n};\nconst unmarshalServerIpv6 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ServerIpv6' failed as data isn't a dictionary.`);\n }\n return {\n address: data.address,\n gateway: data.gateway,\n netmask: data.netmask\n };\n};\nconst unmarshalServerLocation = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ServerLocation' failed as data isn't a dictionary.`);\n }\n return {\n clusterId: data.cluster_id,\n hypervisorId: data.hypervisor_id,\n nodeId: data.node_id,\n platformId: data.platform_id,\n zoneId: data.zone_id\n };\n};\nconst unmarshalServerMaintenance = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ServerMaintenance' failed as data isn't a dictionary.`);\n }\n return {\n reason: data.reason\n };\n};\nconst unmarshalServerTypeCapabilities = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ServerTypeCapabilities' failed as data isn't a dictionary.`);\n }\n return {\n blockStorage: data.block_storage,\n bootTypes: data.boot_types\n };\n};\nconst unmarshalServerTypeNetwork = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ServerTypeNetwork' failed as data isn't a dictionary.`);\n }\n return {\n interfaces: unmarshalArrayOfObject(data.interfaces, unmarshalServerTypeNetworkInterface),\n ipv6Support: data.ipv6_support,\n sumInternalBandwidth: data.sum_internal_bandwidth,\n sumInternetBandwidth: data.sum_internet_bandwidth\n };\n};\nconst unmarshalServerTypeVolumeConstraintsByType = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ServerTypeVolumeConstraintsByType' failed as data isn't a dictionary.`);\n }\n return {\n lSsd: data.l_ssd ? unmarshalServerTypeVolumeConstraintSizes(data.l_ssd) : undefined\n };\n};\nconst unmarshalSnapshotBaseVolume = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'SnapshotBaseVolume' failed as data isn't a dictionary.`);\n }\n return {\n id: data.id,\n name: data.name\n };\n};\nconst unmarshalVolumeServer = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'VolumeServer' failed as data isn't a dictionary.`);\n }\n return {\n boot: data.boot,\n creationDate: unmarshalDate(data.creation_date),\n exportUri: data.export_uri,\n id: data.id,\n modificationDate: unmarshalDate(data.modification_date),\n name: data.name,\n organization: data.organization,\n project: data.project,\n server: data.server ? unmarshalServerSummary(data.server) : undefined,\n size: data.size,\n state: data.state,\n volumeType: data.volume_type,\n zone: data.zone\n };\n};\nconst unmarshalVolumeTypeCapabilities = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'VolumeTypeCapabilities' failed as data isn't a dictionary.`);\n }\n return {\n snapshot: data.snapshot\n };\n};\nconst unmarshalVolumeTypeConstraints = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'VolumeTypeConstraints' failed as data isn't a dictionary.`);\n }\n return {\n max: data.max,\n min: data.min\n };\n};\nconst unmarshalDashboard = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Dashboard' failed as data isn't a dictionary.`);\n }\n return {\n imagesCount: data.images_count,\n ipsCount: data.ips_count,\n ipsUnused: data.ips_unused,\n placementGroupsCount: data.placement_groups_count,\n privateNicsCount: data.private_nics_count,\n runningServersCount: data.running_servers_count,\n securityGroupsCount: data.security_groups_count,\n serversByTypes: data.servers_by_types,\n serversCount: data.servers_count,\n snapshotsCount: data.snapshots_count,\n volumesBSsdCount: data.volumes_b_ssd_count,\n volumesBSsdTotalSize: data.volumes_b_ssd_total_size,\n volumesCount: data.volumes_count,\n volumesLSsdCount: data.volumes_l_ssd_count,\n volumesLSsdTotalSize: data.volumes_l_ssd_total_size\n };\n};\nconst unmarshalGetServerTypesAvailabilityResponseAvailability = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'GetServerTypesAvailabilityResponseAvailability' failed as data isn't a dictionary.`);\n }\n return {\n availability: data.availability\n };\n};\nconst unmarshalIp$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Ip' failed as data isn't a dictionary.`);\n }\n return {\n address: data.address,\n id: data.id,\n organization: data.organization,\n prefix: data.prefix,\n project: data.project,\n reverse: data.reverse,\n server: data.server ? unmarshalServerSummary(data.server) : undefined,\n state: data.state,\n tags: data.tags,\n type: data.type,\n zone: data.zone\n };\n};\nconst unmarshalPlacementGroupServer = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'PlacementGroupServer' failed as data isn't a dictionary.`);\n }\n return {\n id: data.id,\n name: data.name,\n policyRespected: data.policy_respected\n };\n};\nconst unmarshalSecurityGroup = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'SecurityGroup' failed as data isn't a dictionary.`);\n }\n return {\n creationDate: unmarshalDate(data.creation_date),\n description: data.description,\n enableDefaultSecurity: data.enable_default_security,\n id: data.id,\n inboundDefaultPolicy: data.inbound_default_policy,\n modificationDate: unmarshalDate(data.modification_date),\n name: data.name,\n organization: data.organization,\n organizationDefault: data.organization_default,\n outboundDefaultPolicy: data.outbound_default_policy,\n project: data.project,\n projectDefault: data.project_default,\n servers: unmarshalArrayOfObject(data.servers, unmarshalServerSummary),\n state: data.state,\n stateful: data.stateful,\n tags: data.tags,\n zone: data.zone\n };\n};\nconst unmarshalSecurityGroupRule = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'SecurityGroupRule' failed as data isn't a dictionary.`);\n }\n return {\n action: data.action,\n destPortFrom: data.dest_port_from,\n destPortTo: data.dest_port_to,\n direction: data.direction,\n editable: data.editable,\n id: data.id,\n ipRange: data.ip_range,\n position: data.position,\n protocol: data.protocol,\n zone: data.zone\n };\n};\nconst unmarshalServer = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Server' failed as data isn't a dictionary.`);\n }\n return {\n allowedActions: data.allowed_actions,\n arch: data.arch,\n bootscript: data.bootscript ? unmarshalBootscript(data.bootscript) : undefined,\n bootType: data.boot_type,\n commercialType: data.commercial_type,\n creationDate: unmarshalDate(data.creation_date),\n dynamicIpRequired: data.dynamic_ip_required,\n enableIpv6: data.enable_ipv6,\n hostname: data.hostname,\n id: data.id,\n image: data.image ? unmarshalImage$3(data.image) : undefined,\n ipv6: data.ipv6 ? unmarshalServerIpv6(data.ipv6) : undefined,\n location: data.location ? unmarshalServerLocation(data.location) : undefined,\n macAddress: data.mac_address,\n maintenances: unmarshalArrayOfObject(data.maintenances, unmarshalServerMaintenance),\n modificationDate: unmarshalDate(data.modification_date),\n name: data.name,\n organization: data.organization,\n placementGroup: data.placement_group ? unmarshalPlacementGroup(data.placement_group) : undefined,\n privateIp: data.private_ip,\n privateNics: unmarshalArrayOfObject(data.private_nics, unmarshalPrivateNIC),\n project: data.project,\n protected: data.protected,\n publicIp: data.public_ip ? unmarshalServerIp(data.public_ip) : undefined,\n publicIps: unmarshalArrayOfObject(data.public_ips, unmarshalServerIp),\n routedIpEnabled: data.routed_ip_enabled,\n securityGroup: data.security_group ? unmarshalSecurityGroupSummary(data.security_group) : undefined,\n state: data.state,\n stateDetail: data.state_detail,\n tags: data.tags,\n volumes: unmarshalMapOfObject(data.volumes, unmarshalVolumeServer),\n zone: data.zone\n };\n};\nconst unmarshalServerType = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ServerType' failed as data isn't a dictionary.`);\n }\n return {\n altNames: data.alt_names,\n arch: data.arch,\n baremetal: data.baremetal,\n capabilities: data.capabilities ? unmarshalServerTypeCapabilities(data.capabilities) : undefined,\n gpu: data.gpu,\n hourlyPrice: data.hourly_price,\n monthlyPrice: data.monthly_price,\n ncpus: data.ncpus,\n network: data.network ? unmarshalServerTypeNetwork(data.network) : undefined,\n perVolumeConstraint: data.per_volume_constraint ? unmarshalServerTypeVolumeConstraintsByType(data.per_volume_constraint) : undefined,\n ram: data.ram,\n scratchStorageMaxSize: data.scratch_storage_max_size,\n volumesConstraint: data.volumes_constraint ? unmarshalServerTypeVolumeConstraintSizes(data.volumes_constraint) : undefined\n };\n};\nconst unmarshalSnapshot$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Snapshot' failed as data isn't a dictionary.`);\n }\n return {\n baseVolume: data.base_volume ? unmarshalSnapshotBaseVolume(data.base_volume) : undefined,\n creationDate: unmarshalDate(data.creation_date),\n errorReason: data.error_reason,\n id: data.id,\n modificationDate: unmarshalDate(data.modification_date),\n name: data.name,\n organization: data.organization,\n project: data.project,\n size: data.size,\n state: data.state,\n tags: data.tags,\n volumeType: data.volume_type,\n zone: data.zone\n };\n};\nconst unmarshalTask = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Task' failed as data isn't a dictionary.`);\n }\n return {\n description: data.description,\n hrefFrom: data.href_from,\n hrefResult: data.href_result,\n id: data.id,\n progress: data.progress,\n startedAt: unmarshalDate(data.started_at),\n status: data.status,\n terminatedAt: unmarshalDate(data.terminated_at),\n zone: data.zone\n };\n};\nconst unmarshalVolumeType = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'VolumeType' failed as data isn't a dictionary.`);\n }\n return {\n capabilities: data.capabilities ? unmarshalVolumeTypeCapabilities(data.capabilities) : undefined,\n constraints: data.constraints ? unmarshalVolumeTypeConstraints(data.constraints) : undefined,\n displayName: data.display_name\n };\n};\nconst unmarshalCreateImageResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'CreateImageResponse' failed as data isn't a dictionary.`);\n }\n return {\n image: data.image ? unmarshalImage$3(data.image) : undefined\n };\n};\nconst unmarshalCreateIpResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'CreateIpResponse' failed as data isn't a dictionary.`);\n }\n return {\n ip: data.ip ? unmarshalIp$1(data.ip) : undefined\n };\n};\nconst unmarshalCreatePlacementGroupResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'CreatePlacementGroupResponse' failed as data isn't a dictionary.`);\n }\n return {\n placementGroup: data.placement_group ? unmarshalPlacementGroup(data.placement_group) : undefined\n };\n};\nconst unmarshalCreatePrivateNICResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'CreatePrivateNICResponse' failed as data isn't a dictionary.`);\n }\n return {\n privateNic: data.private_nic ? unmarshalPrivateNIC(data.private_nic) : undefined\n };\n};\nconst unmarshalCreateSecurityGroupResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'CreateSecurityGroupResponse' failed as data isn't a dictionary.`);\n }\n return {\n securityGroup: data.security_group ? unmarshalSecurityGroup(data.security_group) : undefined\n };\n};\nconst unmarshalCreateSecurityGroupRuleResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'CreateSecurityGroupRuleResponse' failed as data isn't a dictionary.`);\n }\n return {\n rule: data.rule ? unmarshalSecurityGroupRule(data.rule) : undefined\n };\n};\nconst unmarshalCreateServerResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'CreateServerResponse' failed as data isn't a dictionary.`);\n }\n return {\n server: data.server ? unmarshalServer(data.server) : undefined\n };\n};\nconst unmarshalCreateSnapshotResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'CreateSnapshotResponse' failed as data isn't a dictionary.`);\n }\n return {\n snapshot: data.snapshot ? unmarshalSnapshot$1(data.snapshot) : undefined,\n task: data.task ? unmarshalTask(data.task) : undefined\n };\n};\nconst unmarshalCreateVolumeResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'CreateVolumeResponse' failed as data isn't a dictionary.`);\n }\n return {\n volume: data.volume ? unmarshalVolume$2(data.volume) : undefined\n };\n};\nconst unmarshalExportSnapshotResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ExportSnapshotResponse' failed as data isn't a dictionary.`);\n }\n return {\n task: data.task ? unmarshalTask(data.task) : undefined\n };\n};\nconst unmarshalGetBootscriptResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'GetBootscriptResponse' failed as data isn't a dictionary.`);\n }\n return {\n bootscript: data.bootscript ? unmarshalBootscript(data.bootscript) : undefined\n };\n};\nconst unmarshalGetDashboardResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'GetDashboardResponse' failed as data isn't a dictionary.`);\n }\n return {\n dashboard: data.dashboard ? unmarshalDashboard(data.dashboard) : undefined\n };\n};\nconst unmarshalGetImageResponse$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'GetImageResponse' failed as data isn't a dictionary.`);\n }\n return {\n image: data.image ? unmarshalImage$3(data.image) : undefined\n };\n};\nconst unmarshalGetIpResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'GetIpResponse' failed as data isn't a dictionary.`);\n }\n return {\n ip: data.ip ? unmarshalIp$1(data.ip) : undefined\n };\n};\nconst unmarshalGetPlacementGroupResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'GetPlacementGroupResponse' failed as data isn't a dictionary.`);\n }\n return {\n placementGroup: data.placement_group ? unmarshalPlacementGroup(data.placement_group) : undefined\n };\n};\nconst unmarshalGetPlacementGroupServersResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'GetPlacementGroupServersResponse' failed as data isn't a dictionary.`);\n }\n return {\n servers: unmarshalArrayOfObject(data.servers, unmarshalPlacementGroupServer)\n };\n};\nconst unmarshalGetPrivateNICResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'GetPrivateNICResponse' failed as data isn't a dictionary.`);\n }\n return {\n privateNic: data.private_nic ? unmarshalPrivateNIC(data.private_nic) : undefined\n };\n};\nconst unmarshalGetSecurityGroupResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'GetSecurityGroupResponse' failed as data isn't a dictionary.`);\n }\n return {\n securityGroup: data.security_group ? unmarshalSecurityGroup(data.security_group) : undefined\n };\n};\nconst unmarshalGetSecurityGroupRuleResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'GetSecurityGroupRuleResponse' failed as data isn't a dictionary.`);\n }\n return {\n rule: data.rule ? unmarshalSecurityGroupRule(data.rule) : undefined\n };\n};\nconst unmarshalGetServerResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'GetServerResponse' failed as data isn't a dictionary.`);\n }\n return {\n server: data.server ? unmarshalServer(data.server) : undefined\n };\n};\nconst unmarshalGetServerTypesAvailabilityResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'GetServerTypesAvailabilityResponse' failed as data isn't a dictionary.`);\n }\n return {\n servers: unmarshalMapOfObject(data.servers, unmarshalGetServerTypesAvailabilityResponseAvailability),\n totalCount: data.total_count\n };\n};\nconst unmarshalGetSnapshotResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'GetSnapshotResponse' failed as data isn't a dictionary.`);\n }\n return {\n snapshot: data.snapshot ? unmarshalSnapshot$1(data.snapshot) : undefined\n };\n};\nconst unmarshalGetVolumeResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'GetVolumeResponse' failed as data isn't a dictionary.`);\n }\n return {\n volume: data.volume ? unmarshalVolume$2(data.volume) : undefined\n };\n};\nconst unmarshalListBootscriptsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListBootscriptsResponse' failed as data isn't a dictionary.`);\n }\n return {\n bootscripts: unmarshalArrayOfObject(data.bootscripts, unmarshalBootscript),\n totalCount: data.total_count\n };\n};\nconst unmarshalListImagesResponse$3 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListImagesResponse' failed as data isn't a dictionary.`);\n }\n return {\n images: unmarshalArrayOfObject(data.images, unmarshalImage$3),\n totalCount: data.total_count\n };\n};\nconst unmarshalListIpsResponse$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListIpsResponse' failed as data isn't a dictionary.`);\n }\n return {\n ips: unmarshalArrayOfObject(data.ips, unmarshalIp$1),\n totalCount: data.total_count\n };\n};\nconst unmarshalListPlacementGroupsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListPlacementGroupsResponse' failed as data isn't a dictionary.`);\n }\n return {\n placementGroups: unmarshalArrayOfObject(data.placement_groups, unmarshalPlacementGroup),\n totalCount: data.total_count\n };\n};\nconst unmarshalListPrivateNICsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListPrivateNICsResponse' failed as data isn't a dictionary.`);\n }\n return {\n privateNics: unmarshalArrayOfObject(data.private_nics, unmarshalPrivateNIC),\n totalCount: data.total_count\n };\n};\nconst unmarshalListSecurityGroupRulesResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListSecurityGroupRulesResponse' failed as data isn't a dictionary.`);\n }\n return {\n rules: unmarshalArrayOfObject(data.rules, unmarshalSecurityGroupRule),\n totalCount: data.total_count\n };\n};\nconst unmarshalListSecurityGroupsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListSecurityGroupsResponse' failed as data isn't a dictionary.`);\n }\n return {\n securityGroups: unmarshalArrayOfObject(data.security_groups, unmarshalSecurityGroup),\n totalCount: data.total_count\n };\n};\nconst unmarshalListServerActionsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListServerActionsResponse' failed as data isn't a dictionary.`);\n }\n return {\n actions: data.actions\n };\n};\nconst unmarshalListServerUserDataResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListServerUserDataResponse' failed as data isn't a dictionary.`);\n }\n return {\n userData: data.user_data\n };\n};\nconst unmarshalListServersResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListServersResponse' failed as data isn't a dictionary.`);\n }\n return {\n servers: unmarshalArrayOfObject(data.servers, unmarshalServer),\n totalCount: data.total_count\n };\n};\nconst unmarshalListServersTypesResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListServersTypesResponse' failed as data isn't a dictionary.`);\n }\n return {\n servers: unmarshalMapOfObject(data.servers, unmarshalServerType),\n totalCount: data.total_count\n };\n};\nconst unmarshalListSnapshotsResponse$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListSnapshotsResponse' failed as data isn't a dictionary.`);\n }\n return {\n snapshots: unmarshalArrayOfObject(data.snapshots, unmarshalSnapshot$1),\n totalCount: data.total_count\n };\n};\nconst unmarshalListVolumesResponse$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListVolumesResponse' failed as data isn't a dictionary.`);\n }\n return {\n totalCount: data.total_count,\n volumes: unmarshalArrayOfObject(data.volumes, unmarshalVolume$2)\n };\n};\nconst unmarshalListVolumesTypesResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListVolumesTypesResponse' failed as data isn't a dictionary.`);\n }\n return {\n totalCount: data.total_count,\n volumes: unmarshalMapOfObject(data.volumes, unmarshalVolumeType)\n };\n};\nconst unmarshalMigrationPlan = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'MigrationPlan' failed as data isn't a dictionary.`);\n }\n return {\n snapshots: unmarshalArrayOfObject(data.snapshots, unmarshalSnapshot$1),\n validationKey: data.validation_key,\n volume: data.volume ? unmarshalVolume$2(data.volume) : undefined\n };\n};\nconst unmarshalServerActionResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ServerActionResponse' failed as data isn't a dictionary.`);\n }\n return {\n task: data.task ? unmarshalTask(data.task) : undefined\n };\n};\nconst unmarshalSetImageResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'SetImageResponse' failed as data isn't a dictionary.`);\n }\n return {\n image: data.image ? unmarshalImage$3(data.image) : undefined\n };\n};\nconst unmarshalSetPlacementGroupResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'SetPlacementGroupResponse' failed as data isn't a dictionary.`);\n }\n return {\n placementGroup: data.placement_group ? unmarshalPlacementGroup(data.placement_group) : undefined\n };\n};\nconst unmarshalSetPlacementGroupServersResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'SetPlacementGroupServersResponse' failed as data isn't a dictionary.`);\n }\n return {\n servers: unmarshalArrayOfObject(data.servers, unmarshalPlacementGroupServer)\n };\n};\nconst unmarshalSetSecurityGroupResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'SetSecurityGroupResponse' failed as data isn't a dictionary.`);\n }\n return {\n securityGroup: data.security_group ? unmarshalSecurityGroup(data.security_group) : undefined\n };\n};\nconst unmarshalSetSecurityGroupRuleResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'SetSecurityGroupRuleResponse' failed as data isn't a dictionary.`);\n }\n return {\n rule: data.rule ? unmarshalSecurityGroupRule(data.rule) : undefined\n };\n};\nconst unmarshalSetSecurityGroupRulesResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'SetSecurityGroupRulesResponse' failed as data isn't a dictionary.`);\n }\n return {\n rules: unmarshalArrayOfObject(data.rules, unmarshalSecurityGroupRule)\n };\n};\nconst unmarshalSetServerResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'SetServerResponse' failed as data isn't a dictionary.`);\n }\n return {\n server: data.server ? unmarshalServer(data.server) : undefined\n };\n};\nconst unmarshalSetSnapshotResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'SetSnapshotResponse' failed as data isn't a dictionary.`);\n }\n return {\n snapshot: data.snapshot ? unmarshalSnapshot$1(data.snapshot) : undefined\n };\n};\nconst unmarshalUpdateIpResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'UpdateIpResponse' failed as data isn't a dictionary.`);\n }\n return {\n ip: data.ip ? unmarshalIp$1(data.ip) : undefined\n };\n};\nconst unmarshalUpdatePlacementGroupResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'UpdatePlacementGroupResponse' failed as data isn't a dictionary.`);\n }\n return {\n placementGroup: data.placement_group ? unmarshalPlacementGroup(data.placement_group) : undefined\n };\n};\nconst unmarshalUpdatePlacementGroupServersResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'UpdatePlacementGroupServersResponse' failed as data isn't a dictionary.`);\n }\n return {\n servers: unmarshalArrayOfObject(data.servers, unmarshalPlacementGroupServer)\n };\n};\nconst unmarshalUpdateServerResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'UpdateServerResponse' failed as data isn't a dictionary.`);\n }\n return {\n server: data.server ? unmarshalServer(data.server) : undefined\n };\n};\nconst unmarshalUpdateVolumeResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'UpdateVolumeResponse' failed as data isn't a dictionary.`);\n }\n return {\n volume: data.volume ? unmarshalVolume$2(data.volume) : undefined\n };\n};\nconst marshalServerSummary$1 = (request, defaults) => ({\n id: request.id,\n name: request.name\n});\nconst marshalBootscript$1 = (request, defaults) => ({\n arch: request.arch,\n bootcmdargs: request.bootcmdargs,\n default: request.default,\n dtb: request.dtb,\n id: request.id,\n initrd: request.initrd,\n kernel: request.kernel,\n organization: request.organization,\n project: request.project,\n public: request.public,\n title: request.title,\n zone: request.zone\n});\nconst marshalVolume$1 = (request, defaults) => ({\n creation_date: request.creationDate,\n export_uri: request.exportUri,\n id: request.id,\n modification_date: request.modificationDate,\n name: request.name,\n organization: request.organization,\n project: request.project,\n server: request.server ? marshalServerSummary$1(request.server) : undefined,\n size: request.size,\n state: request.state,\n tags: request.tags,\n volume_type: request.volumeType,\n zone: request.zone\n});\nconst marshalVolumeSummary$1 = (request, defaults) => ({\n id: request.id,\n name: request.name,\n size: request.size,\n volume_type: request.volumeType\n});\nconst marshalImage = (request, defaults) => ({\n arch: request.arch,\n creation_date: request.creationDate,\n default_bootscript: request.defaultBootscript ? marshalBootscript$1(request.defaultBootscript) : undefined,\n extra_volumes: Object.entries(request.extraVolumes).reduce((acc, [key, value]) => ({\n ...acc,\n [key]: marshalVolume$1(value)\n }), {}),\n from_server: request.fromServer,\n id: request.id,\n modification_date: request.modificationDate,\n name: request.name,\n organization: request.organization,\n project: request.project,\n public: request.public,\n root_volume: request.rootVolume ? marshalVolumeSummary$1(request.rootVolume) : undefined,\n state: request.state,\n tags: request.tags,\n zone: request.zone\n});\nconst marshalPlacementGroup = (request, defaults) => ({\n id: request.id,\n name: request.name,\n organization: request.organization,\n policy_mode: request.policyMode,\n policy_respected: request.policyRespected,\n policy_type: request.policyType,\n project: request.project,\n tags: request.tags,\n zone: request.zone\n});\nconst marshalPrivateNIC = (request, defaults) => ({\n id: request.id,\n mac_address: request.macAddress,\n private_network_id: request.privateNetworkId,\n server_id: request.serverId,\n state: request.state,\n tags: request.tags\n});\nconst marshalSecurityGroupSummary = (request, defaults) => ({\n id: request.id,\n name: request.name\n});\nconst marshalSecurityGroupTemplate = (request, defaults) => ({\n id: request.id,\n name: request.name\n});\nconst marshalServerActionRequestVolumeBackupTemplate = (request, defaults) => ({\n volume_type: request.volumeType\n});\nconst marshalServerIp = (request, defaults) => ({\n address: request.address,\n dynamic: request.dynamic,\n family: request.family,\n gateway: request.gateway,\n id: request.id,\n netmask: request.netmask,\n provisioning_mode: request.provisioningMode,\n tags: request.tags\n});\nconst marshalServerIpv6 = (request, defaults) => ({\n address: request.address,\n gateway: request.gateway,\n netmask: request.netmask\n});\nconst marshalServerLocation = (request, defaults) => ({\n cluster_id: request.clusterId,\n hypervisor_id: request.hypervisorId,\n node_id: request.nodeId,\n platform_id: request.platformId,\n zone_id: request.zoneId\n});\nconst marshalServerMaintenance = (request, defaults) => ({\n reason: request.reason\n});\nconst marshalSetSecurityGroupRulesRequestRule = (request, defaults) => ({\n action: request.action,\n dest_port_from: request.destPortFrom,\n dest_port_to: request.destPortTo,\n direction: request.direction,\n editable: request.editable,\n id: request.id,\n ip_range: request.ipRange,\n position: request.position,\n protocol: request.protocol,\n zone: request.zone\n});\nconst marshalSnapshotBaseVolume = (request, defaults) => ({\n id: request.id,\n name: request.name\n});\nconst marshalVolumeServerTemplate = (request, defaults) => ({\n base_snapshot: request.baseSnapshot,\n boot: request.boot,\n id: request.id,\n name: request.name,\n organization: request.organization,\n project: request.project,\n size: request.size,\n volume_type: request.volumeType\n});\nconst marshalVolumeTemplate = (request, defaults) => ({\n id: request.id,\n name: request.name,\n size: request.size,\n volume_type: request.volumeType,\n ...resolveOneOf([{\n param: 'project',\n value: request.project\n }, {\n param: 'organization',\n value: request.organization\n }])\n});\nconst marshalApplyBlockMigrationRequest = (request, defaults) => ({\n validation_key: request.validationKey,\n ...resolveOneOf([{\n param: 'volume_id',\n value: request.volumeId\n }, {\n param: 'snapshot_id',\n value: request.snapshotId\n }])\n});\nconst marshalCreateImageRequest = (request, defaults) => ({\n arch: request.arch,\n default_bootscript: request.defaultBootscript,\n extra_volumes: request.extraVolumes ? Object.entries(request.extraVolumes).reduce((acc, [key, value]) => ({\n ...acc,\n [key]: marshalVolumeTemplate(value)\n }), {}) : undefined,\n name: request.name || randomName('img'),\n public: request.public,\n root_volume: request.rootVolume,\n tags: request.tags,\n ...resolveOneOf([{\n default: defaults.defaultProjectId,\n param: 'project',\n value: request.project\n }, {\n default: defaults.defaultOrganizationId,\n param: 'organization',\n value: request.organization\n }])\n});\nconst marshalCreateIpRequest$1 = (request, defaults) => ({\n server: request.server,\n tags: request.tags,\n type: request.type ?? 'unknown_iptype',\n ...resolveOneOf([{\n default: defaults.defaultProjectId,\n param: 'project',\n value: request.project\n }, {\n default: defaults.defaultOrganizationId,\n param: 'organization',\n value: request.organization\n }])\n});\nconst marshalCreatePlacementGroupRequest = (request, defaults) => ({\n name: request.name || randomName('pg'),\n policy_mode: request.policyMode ?? 'optional',\n policy_type: request.policyType ?? 'max_availability',\n tags: request.tags,\n ...resolveOneOf([{\n default: defaults.defaultProjectId,\n param: 'project',\n value: request.project\n }, {\n default: defaults.defaultOrganizationId,\n param: 'organization',\n value: request.organization\n }])\n});\nconst marshalCreatePrivateNICRequest = (request, defaults) => ({\n ip_ids: request.ipIds,\n private_network_id: request.privateNetworkId,\n tags: request.tags\n});\nconst marshalCreateSecurityGroupRequest = (request, defaults) => ({\n description: request.description,\n enable_default_security: request.enableDefaultSecurity,\n inbound_default_policy: request.inboundDefaultPolicy ?? 'accept',\n name: request.name || randomName('sg'),\n outbound_default_policy: request.outboundDefaultPolicy ?? 'accept',\n stateful: request.stateful,\n tags: request.tags,\n ...resolveOneOf([{\n param: 'organization_default',\n value: request.organizationDefault\n }, {\n param: 'project_default',\n value: request.projectDefault\n }]),\n ...resolveOneOf([{\n default: defaults.defaultProjectId,\n param: 'project',\n value: request.project\n }, {\n default: defaults.defaultOrganizationId,\n param: 'organization',\n value: request.organization\n }])\n});\nconst marshalCreateSecurityGroupRuleRequest = (request, defaults) => ({\n action: request.action,\n dest_port_from: request.destPortFrom,\n dest_port_to: request.destPortTo,\n direction: request.direction,\n editable: request.editable,\n ip_range: request.ipRange,\n position: request.position,\n protocol: request.protocol\n});\nconst marshalCreateServerRequest = (request, defaults) => ({\n boot_type: request.bootType,\n bootscript: request.bootscript,\n commercial_type: request.commercialType,\n dynamic_ip_required: request.dynamicIpRequired,\n enable_ipv6: request.enableIpv6,\n image: request.image,\n name: request.name || randomName('srv'),\n placement_group: request.placementGroup,\n public_ip: request.publicIp,\n public_ips: request.publicIps,\n routed_ip_enabled: request.routedIpEnabled,\n security_group: request.securityGroup,\n tags: request.tags,\n volumes: request.volumes ? Object.entries(request.volumes).reduce((acc, [key, value]) => ({\n ...acc,\n [key]: marshalVolumeServerTemplate(value)\n }), {}) : undefined,\n ...resolveOneOf([{\n default: defaults.defaultProjectId,\n param: 'project',\n value: request.project\n }, {\n default: defaults.defaultOrganizationId,\n param: 'organization',\n value: request.organization\n }])\n});\nconst marshalCreateSnapshotRequest$1 = (request, defaults) => ({\n bucket: request.bucket,\n key: request.key,\n name: request.name || randomName('snp'),\n size: request.size,\n tags: request.tags,\n volume_id: request.volumeId,\n volume_type: request.volumeType ?? 'unknown_volume_type',\n ...resolveOneOf([{\n default: defaults.defaultProjectId,\n param: 'project',\n value: request.project\n }, {\n default: defaults.defaultOrganizationId,\n param: 'organization',\n value: request.organization\n }])\n});\nconst marshalCreateVolumeRequest$1 = (request, defaults) => ({\n name: request.name || randomName('vol'),\n tags: request.tags,\n volume_type: request.volumeType ?? 'l_ssd',\n ...resolveOneOf([{\n default: defaults.defaultProjectId,\n param: 'project',\n value: request.project\n }, {\n default: defaults.defaultOrganizationId,\n param: 'organization',\n value: request.organization\n }]),\n ...resolveOneOf([{\n param: 'size',\n value: request.size\n }, {\n param: 'base_volume',\n value: request.baseVolume\n }, {\n param: 'base_snapshot',\n value: request.baseSnapshot\n }])\n});\nconst marshalExportSnapshotRequest = (request, defaults) => ({\n bucket: request.bucket,\n key: request.key\n});\nconst marshalPlanBlockMigrationRequest = (request, defaults) => ({\n ...resolveOneOf([{\n param: 'volume_id',\n value: request.volumeId\n }, {\n param: 'snapshot_id',\n value: request.snapshotId\n }])\n});\nconst marshalServerActionRequest = (request, defaults) => ({\n action: request.action ?? 'poweron',\n name: request.name,\n volumes: request.volumes ? Object.entries(request.volumes).reduce((acc, [key, value]) => ({\n ...acc,\n [key]: marshalServerActionRequestVolumeBackupTemplate(value)\n }), {}) : undefined\n});\nconst marshalSetImageRequest = (request, defaults) => ({\n arch: request.arch,\n creation_date: request.creationDate,\n default_bootscript: request.defaultBootscript ? marshalBootscript$1(request.defaultBootscript) : undefined,\n extra_volumes: request.extraVolumes ? Object.entries(request.extraVolumes).reduce((acc, [key, value]) => ({\n ...acc,\n [key]: marshalVolume$1(value)\n }), {}) : undefined,\n from_server: request.fromServer,\n modification_date: request.modificationDate,\n name: request.name,\n organization: request.organization,\n project: request.project,\n public: request.public,\n root_volume: request.rootVolume ? marshalVolumeSummary$1(request.rootVolume) : undefined,\n state: request.state,\n tags: request.tags\n});\nconst marshalSetPlacementGroupRequest = (request, defaults) => ({\n name: request.name,\n organization: request.organization,\n policy_mode: request.policyMode,\n policy_type: request.policyType,\n project: request.project,\n tags: request.tags\n});\nconst marshalSetPlacementGroupServersRequest = (request, defaults) => ({\n servers: request.servers\n});\nconst marshalSetSecurityGroupRequest = (request, defaults) => ({\n creation_date: request.creationDate,\n description: request.description,\n enable_default_security: request.enableDefaultSecurity,\n inbound_default_policy: request.inboundDefaultPolicy,\n modification_date: request.modificationDate,\n name: request.name,\n organization: request.organization,\n organization_default: request.organizationDefault,\n outbound_default_policy: request.outboundDefaultPolicy,\n project: request.project,\n project_default: request.projectDefault,\n servers: request.servers ? request.servers.map(elt => marshalServerSummary$1(elt)) : undefined,\n stateful: request.stateful,\n tags: request.tags\n});\nconst marshalSetSecurityGroupRuleRequest = (request, defaults) => ({\n action: request.action,\n dest_port_from: request.destPortFrom,\n dest_port_to: request.destPortTo,\n direction: request.direction,\n editable: request.editable,\n id: request.id,\n ip_range: request.ipRange,\n position: request.position,\n protocol: request.protocol\n});\nconst marshalSetSecurityGroupRulesRequest = (request, defaults) => ({\n rules: request.rules ? request.rules.map(elt => marshalSetSecurityGroupRulesRequestRule(elt)) : undefined\n});\nconst marshalSetServerRequest = (request, defaults) => ({\n allowed_actions: request.allowedActions,\n arch: request.arch,\n boot_type: request.bootType,\n bootscript: request.bootscript ? marshalBootscript$1(request.bootscript) : undefined,\n commercial_type: request.commercialType,\n creation_date: request.creationDate,\n dynamic_ip_required: request.dynamicIpRequired,\n enable_ipv6: request.enableIpv6,\n hostname: request.hostname,\n image: request.image ? marshalImage(request.image) : undefined,\n ipv6: request.ipv6 ? marshalServerIpv6(request.ipv6) : undefined,\n location: request.location ? marshalServerLocation(request.location) : undefined,\n maintenances: request.maintenances ? request.maintenances.map(elt => marshalServerMaintenance(elt)) : undefined,\n modification_date: request.modificationDate,\n name: request.name,\n organization: request.organization,\n placement_group: request.placementGroup ? marshalPlacementGroup(request.placementGroup) : undefined,\n private_ip: request.privateIp,\n private_nics: request.privateNics ? request.privateNics.map(elt => marshalPrivateNIC(elt)) : undefined,\n project: request.project,\n protected: request.protected,\n public_ip: request.publicIp ? marshalServerIp(request.publicIp) : undefined,\n public_ips: request.publicIps ? request.publicIps.map(elt => marshalServerIp(elt)) : undefined,\n routed_ip_enabled: request.routedIpEnabled,\n security_group: request.securityGroup ? marshalSecurityGroupSummary(request.securityGroup) : undefined,\n state: request.state,\n state_detail: request.stateDetail,\n tags: request.tags,\n volumes: request.volumes ? Object.entries(request.volumes).reduce((acc, [key, value]) => ({\n ...acc,\n [key]: marshalVolume$1(value)\n }), {}) : undefined\n});\nconst marshalSetSnapshotRequest = (request, defaults) => ({\n base_volume: request.baseVolume ? marshalSnapshotBaseVolume(request.baseVolume) : undefined,\n creation_date: request.creationDate,\n id: request.id,\n modification_date: request.modificationDate,\n name: request.name,\n organization: request.organization,\n project: request.project,\n size: request.size,\n state: request.state,\n tags: request.tags,\n volume_type: request.volumeType\n});\nconst marshalUpdateIpRequest$1 = (request, defaults) => ({\n reverse: request.reverse,\n server: request.server,\n tags: request.tags,\n type: request.type ?? 'unknown_iptype'\n});\nconst marshalUpdatePlacementGroupRequest = (request, defaults) => ({\n name: request.name,\n policy_mode: request.policyMode,\n policy_type: request.policyType,\n tags: request.tags\n});\nconst marshalUpdatePlacementGroupServersRequest = (request, defaults) => ({\n servers: request.servers\n});\nconst marshalUpdatePrivateNICRequest = (request, defaults) => ({\n tags: request.tags\n});\nconst marshalUpdateServerRequest = (request, defaults) => ({\n boot_type: request.bootType,\n bootscript: request.bootscript,\n commercial_type: request.commercialType,\n dynamic_ip_required: request.dynamicIpRequired,\n enable_ipv6: request.enableIpv6,\n name: request.name,\n placement_group: request.placementGroup,\n private_nics: request.privateNics,\n protected: request.protected,\n public_ips: request.publicIps,\n routed_ip_enabled: request.routedIpEnabled,\n security_group: request.securityGroup ? marshalSecurityGroupTemplate(request.securityGroup) : undefined,\n tags: request.tags,\n volumes: request.volumes ? Object.entries(request.volumes).reduce((acc, [key, value]) => ({\n ...acc,\n [key]: marshalVolumeServerTemplate(value)\n }), {}) : undefined\n});\nconst marshalUpdateVolumeRequest$1 = (request, defaults) => ({\n name: request.name,\n size: request.size,\n tags: request.tags\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst jsonContentHeaders$g = {\n 'Content-Type': 'application/json; charset=utf-8'\n};\n\n/** Instance API. */\nlet API$h = class API extends API$u {\n /** Lists the available zones of the API. */\n static LOCALITIES = ['fr-par-1', 'fr-par-2', 'fr-par-3', 'nl-ams-1', 'nl-ams-2', 'nl-ams-3', 'pl-waw-1', 'pl-waw-2', 'pl-waw-3'];\n\n /**\n * Get availability. Get availability for all Instance types.\n *\n * @param request - The request {@link GetServerTypesAvailabilityRequest}\n * @returns A Promise of GetServerTypesAvailabilityResponse\n */\n getServerTypesAvailability = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/products/servers/availability`,\n urlParams: urlParams(['page', request.page], ['per_page', request.perPage ?? this.client.settings.defaultPageSize])\n }, unmarshalGetServerTypesAvailabilityResponse);\n\n /**\n * List Instance types. List available Instance types and their technical\n * details.\n *\n * @param request - The request {@link ListServersTypesRequest}\n * @returns A Promise of ListServersTypesResponse\n */\n listServersTypes = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/products/servers`,\n urlParams: urlParams(['page', request.page], ['per_page', request.perPage ?? this.client.settings.defaultPageSize])\n }, unmarshalListServersTypesResponse);\n\n /**\n * List volume types. List all volume types and their technical details.\n *\n * @param request - The request {@link ListVolumesTypesRequest}\n * @returns A Promise of ListVolumesTypesResponse\n */\n listVolumesTypes = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/products/volumes`,\n urlParams: urlParams(['page', request.page], ['per_page', request.perPage ?? this.client.settings.defaultPageSize])\n }, unmarshalListVolumesTypesResponse);\n pageOfListServers = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers`,\n urlParams: urlParams(['commercial_type', request.commercialType], ['name', request.name], ['order', request.order], ['organization', request.organization], ['page', request.page], ['per_page', request.perPage ?? this.client.settings.defaultPageSize], ['private_ip', request.privateIp], ['private_network', request.privateNetwork], ['private_networks', request.privateNetworks && request.privateNetworks.length > 0 ? request.privateNetworks.join(',') : undefined], ['private_nic_mac_address', request.privateNicMacAddress], ['project', request.project], ['servers', request.servers && request.servers.length > 0 ? request.servers.join(',') : undefined], ['state', request.state], ['tags', request.tags && request.tags.length > 0 ? request.tags.join(',') : undefined], ['without_ip', request.withoutIp])\n }, unmarshalListServersResponse);\n\n /**\n * List all Instances. List all Instances in a specified Availability Zone,\n * e.g. `fr-par-1`.\n *\n * @param request - The request {@link ListServersRequest}\n * @returns A Promise of ListServersResponse\n */\n listServers = (request = {}) => enrichForPagination('servers', this.pageOfListServers, request);\n _createServer = request => this.client.fetch({\n body: JSON.stringify(marshalCreateServerRequest(request, this.client.settings)),\n headers: jsonContentHeaders$g,\n method: 'POST',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers`\n }, unmarshalCreateServerResponse);\n\n /**\n * Delete an Instance. Delete the Instance with the specified ID.\n *\n * @param request - The request {@link DeleteServerRequest}\n */\n deleteServer = request => this.client.fetch({\n method: 'DELETE',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`\n });\n\n /**\n * Get an Instance. Get the details of a specified Instance.\n *\n * @param request - The request {@link GetServerRequest}\n * @returns A Promise of GetServerResponse\n */\n getServer = request => this.client.fetch({\n method: 'GET',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`\n }, unmarshalGetServerResponse);\n _setServer = request => this.client.fetch({\n body: JSON.stringify(marshalSetServerRequest(request, this.client.settings)),\n headers: jsonContentHeaders$g,\n method: 'PUT',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('id', request.id)}`\n }, unmarshalSetServerResponse);\n _updateServer = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateServerRequest(request, this.client.settings)),\n headers: jsonContentHeaders$g,\n method: 'PATCH',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`\n }, unmarshalUpdateServerResponse);\n\n /**\n * List Instance actions. List all actions (e.g. power on, power off, reboot)\n * that can currently be performed on an Instance.\n *\n * @param request - The request {@link ListServerActionsRequest}\n * @returns A Promise of ListServerActionsResponse\n */\n listServerActions = request => this.client.fetch({\n method: 'GET',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/action`\n }, unmarshalListServerActionsResponse);\n\n /**\n * Perform action. Perform an action on an Instance. Available actions are:\n * `poweron`: Start a stopped Instance. `poweroff`: Fully stop the Instance\n * and release the hypervisor slot. `stop_in_place`: Stop the Instance, but\n * keep the slot on the hypervisor. `reboot`: Stop the instance and restart\n * it. `backup`: Create an image with all the volumes of an Instance.\n * `terminate`: Delete the Instance along with all attached volumes.\n * `enable_routed_ip`: Migrate the Instance to the new network stack.\n *\n * Keep in mind that terminating an Instance will result in the deletion of\n * all attached volumes, including local and block storage. If you want to\n * preserve your local volumes, you should use the `archive` action instead of\n * `terminate`. Similarly, if you want to keep your block storage volumes, you\n * must first detach them before issuing the `terminate` command. For more\n * information, read the [Volumes](#path-volumes-list-volumes) documentation.\n *\n * @param request - The request {@link ServerActionRequest}\n * @returns A Promise of ServerActionResponse\n */\n serverAction = request => this.client.fetch({\n body: JSON.stringify(marshalServerActionRequest(request, this.client.settings)),\n headers: jsonContentHeaders$g,\n method: 'POST',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/action`\n }, unmarshalServerActionResponse);\n\n /**\n * List user data. List all user data keys registered on a specified Instance.\n *\n * @param request - The request {@link ListServerUserDataRequest}\n * @returns A Promise of ListServerUserDataResponse\n */\n listServerUserData = request => this.client.fetch({\n method: 'GET',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/user_data`\n }, unmarshalListServerUserDataResponse);\n\n /**\n * Delete user data. Delete the specified key from an Instance's user data.\n *\n * @param request - The request {@link DeleteServerUserDataRequest}\n */\n deleteServerUserData = request => this.client.fetch({\n method: 'DELETE',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/user_data/${validatePathParam('key', request.key)}`\n });\n pageOfListImages = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/images`,\n urlParams: urlParams(['arch', request.arch], ['name', request.name], ['organization', request.organization], ['page', request.page], ['per_page', request.perPage ?? this.client.settings.defaultPageSize], ['project', request.project], ['public', request.public], ['tags', request.tags])\n }, unmarshalListImagesResponse$3);\n\n /**\n * List Instance images. List all existing Instance images.\n *\n * @param request - The request {@link ListImagesRequest}\n * @returns A Promise of ListImagesResponse\n */\n listImages = (request = {}) => enrichForPagination('images', this.pageOfListImages, request);\n\n /**\n * Get an Instance image. Get details of an image with the specified ID.\n *\n * @param request - The request {@link GetImageRequest}\n * @returns A Promise of GetImageResponse\n */\n getImage = request => this.client.fetch({\n method: 'GET',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/images/${validatePathParam('imageId', request.imageId)}`\n }, unmarshalGetImageResponse$1);\n\n /**\n * Create an Instance image. Create an Instance image from the specified\n * snapshot ID.\n *\n * @param request - The request {@link CreateImageRequest}\n * @returns A Promise of CreateImageResponse\n */\n createImage = request => this.client.fetch({\n body: JSON.stringify(marshalCreateImageRequest(request, this.client.settings)),\n headers: jsonContentHeaders$g,\n method: 'POST',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/images`\n }, unmarshalCreateImageResponse);\n _setImage = request => this.client.fetch({\n body: JSON.stringify(marshalSetImageRequest(request, this.client.settings)),\n headers: jsonContentHeaders$g,\n method: 'PUT',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/images/${validatePathParam('id', request.id)}`\n }, unmarshalSetImageResponse);\n\n /**\n * Delete an Instance image. Delete the image with the specified ID.\n *\n * @param request - The request {@link DeleteImageRequest}\n */\n deleteImage = request => this.client.fetch({\n method: 'DELETE',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/images/${validatePathParam('imageId', request.imageId)}`\n });\n pageOfListSnapshots = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/snapshots`,\n urlParams: urlParams(['base_volume_id', request.baseVolumeId], ['name', request.name], ['organization', request.organization], ['page', request.page], ['per_page', request.perPage ?? this.client.settings.defaultPageSize], ['project', request.project], ['tags', request.tags])\n }, unmarshalListSnapshotsResponse$1);\n\n /**\n * List snapshots. List all snapshots of an Organization in a specified\n * Availability Zone.\n *\n * @param request - The request {@link ListSnapshotsRequest}\n * @returns A Promise of ListSnapshotsResponse\n */\n listSnapshots = (request = {}) => enrichForPagination('snapshots', this.pageOfListSnapshots, request);\n\n /**\n * Create a snapshot from a specified volume or from a QCOW2 file. Create a\n * snapshot from a specified volume or from a QCOW2 file in a specified\n * Availability Zone.\n *\n * @param request - The request {@link CreateSnapshotRequest}\n * @returns A Promise of CreateSnapshotResponse\n */\n createSnapshot = (request = {}) => this.client.fetch({\n body: JSON.stringify(marshalCreateSnapshotRequest$1(request, this.client.settings)),\n headers: jsonContentHeaders$g,\n method: 'POST',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/snapshots`\n }, unmarshalCreateSnapshotResponse);\n\n /**\n * Get a snapshot. Get details of a snapshot with the specified ID.\n *\n * @param request - The request {@link GetSnapshotRequest}\n * @returns A Promise of GetSnapshotResponse\n */\n getSnapshot = request => this.client.fetch({\n method: 'GET',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam('snapshotId', request.snapshotId)}`\n }, unmarshalGetSnapshotResponse);\n _setSnapshot = request => this.client.fetch({\n body: JSON.stringify(marshalSetSnapshotRequest(request, this.client.settings)),\n headers: jsonContentHeaders$g,\n method: 'PUT',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam('snapshotId', request.snapshotId)}`\n }, unmarshalSetSnapshotResponse);\n\n /**\n * Delete a snapshot. Delete the snapshot with the specified ID.\n *\n * @param request - The request {@link DeleteSnapshotRequest}\n */\n deleteSnapshot = request => this.client.fetch({\n method: 'DELETE',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam('snapshotId', request.snapshotId)}`\n });\n\n /**\n * Export a snapshot. Export a snapshot to a specified S3 bucket in the same\n * region.\n *\n * @param request - The request {@link ExportSnapshotRequest}\n * @returns A Promise of ExportSnapshotResponse\n */\n exportSnapshot = request => this.client.fetch({\n body: JSON.stringify(marshalExportSnapshotRequest(request, this.client.settings)),\n headers: jsonContentHeaders$g,\n method: 'POST',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam('snapshotId', request.snapshotId)}/export`\n }, unmarshalExportSnapshotResponse);\n pageOfListVolumes = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/volumes`,\n urlParams: urlParams(['name', request.name], ['organization', request.organization], ['page', request.page], ['per_page', request.perPage ?? this.client.settings.defaultPageSize], ['project', request.project], ['tags', request.tags && request.tags.length > 0 ? request.tags.join(',') : undefined], ['volume_type', request.volumeType])\n }, unmarshalListVolumesResponse$1);\n\n /**\n * List volumes. List volumes in the specified Availability Zone. You can\n * filter the output by volume type.\n *\n * @param request - The request {@link ListVolumesRequest}\n * @returns A Promise of ListVolumesResponse\n */\n listVolumes = (request = {}) => enrichForPagination('volumes', this.pageOfListVolumes, request);\n\n /**\n * Create a volume. Create a volume of a specified type in an Availability\n * Zone.\n *\n * @param request - The request {@link CreateVolumeRequest}\n * @returns A Promise of CreateVolumeResponse\n */\n createVolume = (request = {}) => this.client.fetch({\n body: JSON.stringify(marshalCreateVolumeRequest$1(request, this.client.settings)),\n headers: jsonContentHeaders$g,\n method: 'POST',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/volumes`\n }, unmarshalCreateVolumeResponse);\n\n /**\n * Get a volume. Get details of a volume with the specified ID.\n *\n * @param request - The request {@link GetVolumeRequest}\n * @returns A Promise of GetVolumeResponse\n */\n getVolume = request => this.client.fetch({\n method: 'GET',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/volumes/${validatePathParam('volumeId', request.volumeId)}`\n }, unmarshalGetVolumeResponse);\n\n /**\n * Update a volume. Replace the name and/or size properties of a volume\n * specified by its ID, with the specified value(s). Any volume name can be\n * changed, however only `b_ssd` volumes can currently be increased in size.\n *\n * @param request - The request {@link UpdateVolumeRequest}\n * @returns A Promise of UpdateVolumeResponse\n */\n updateVolume = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateVolumeRequest$1(request, this.client.settings)),\n headers: jsonContentHeaders$g,\n method: 'PATCH',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/volumes/${validatePathParam('volumeId', request.volumeId)}`\n }, unmarshalUpdateVolumeResponse);\n\n /**\n * Delete a volume. Delete the volume with the specified ID.\n *\n * @param request - The request {@link DeleteVolumeRequest}\n */\n deleteVolume = request => this.client.fetch({\n method: 'DELETE',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/volumes/${validatePathParam('volumeId', request.volumeId)}`\n });\n pageOfListSecurityGroups = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/security_groups`,\n urlParams: urlParams(['name', request.name], ['organization', request.organization], ['page', request.page], ['per_page', request.perPage ?? this.client.settings.defaultPageSize], ['project', request.project], ['project_default', request.projectDefault], ['tags', request.tags && request.tags.length > 0 ? request.tags.join(',') : undefined])\n }, unmarshalListSecurityGroupsResponse);\n\n /**\n * List security groups. List all existing security groups.\n *\n * @param request - The request {@link ListSecurityGroupsRequest}\n * @returns A Promise of ListSecurityGroupsResponse\n */\n listSecurityGroups = (request = {}) => enrichForPagination('securityGroups', this.pageOfListSecurityGroups, request);\n\n /**\n * Create a security group. Create a security group with a specified name and\n * description.\n *\n * @param request - The request {@link CreateSecurityGroupRequest}\n * @returns A Promise of CreateSecurityGroupResponse\n */\n createSecurityGroup = request => this.client.fetch({\n body: JSON.stringify(marshalCreateSecurityGroupRequest(request, this.client.settings)),\n headers: jsonContentHeaders$g,\n method: 'POST',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/security_groups`\n }, unmarshalCreateSecurityGroupResponse);\n\n /**\n * Get a security group. Get the details of a security group with the\n * specified ID.\n *\n * @param request - The request {@link GetSecurityGroupRequest}\n * @returns A Promise of GetSecurityGroupResponse\n */\n getSecurityGroup = request => this.client.fetch({\n method: 'GET',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/security_groups/${validatePathParam('securityGroupId', request.securityGroupId)}`\n }, unmarshalGetSecurityGroupResponse);\n\n /**\n * Delete a security group. Delete a security group with the specified ID.\n *\n * @param request - The request {@link DeleteSecurityGroupRequest}\n */\n deleteSecurityGroup = request => this.client.fetch({\n method: 'DELETE',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/security_groups/${validatePathParam('securityGroupId', request.securityGroupId)}`\n });\n _setSecurityGroup = request => this.client.fetch({\n body: JSON.stringify(marshalSetSecurityGroupRequest(request, this.client.settings)),\n headers: jsonContentHeaders$g,\n method: 'PUT',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/security_groups/${validatePathParam('id', request.id)}`\n }, unmarshalSetSecurityGroupResponse);\n\n /**\n * Get default rules. Lists the default rules applied to all the security\n * groups.\n *\n * @param request - The request {@link ListDefaultSecurityGroupRulesRequest}\n * @returns A Promise of ListSecurityGroupRulesResponse\n */\n listDefaultSecurityGroupRules = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/security_groups/default/rules`\n }, unmarshalListSecurityGroupRulesResponse);\n pageOfListSecurityGroupRules = request => this.client.fetch({\n method: 'GET',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/security_groups/${validatePathParam('securityGroupId', request.securityGroupId)}/rules`,\n urlParams: urlParams(['page', request.page], ['per_page', request.perPage ?? this.client.settings.defaultPageSize])\n }, unmarshalListSecurityGroupRulesResponse);\n\n /**\n * List rules. List the rules of the a specified security group ID.\n *\n * @param request - The request {@link ListSecurityGroupRulesRequest}\n * @returns A Promise of ListSecurityGroupRulesResponse\n */\n listSecurityGroupRules = request => enrichForPagination('rules', this.pageOfListSecurityGroupRules, request);\n\n /**\n * Create rule. Create a rule in the specified security group ID.\n *\n * @param request - The request {@link CreateSecurityGroupRuleRequest}\n * @returns A Promise of CreateSecurityGroupRuleResponse\n */\n createSecurityGroupRule = request => this.client.fetch({\n body: JSON.stringify(marshalCreateSecurityGroupRuleRequest(request, this.client.settings)),\n headers: jsonContentHeaders$g,\n method: 'POST',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/security_groups/${validatePathParam('securityGroupId', request.securityGroupId)}/rules`\n }, unmarshalCreateSecurityGroupRuleResponse);\n\n /**\n * Update all the rules of a security group. Replaces the existing rules of\n * the security group with the rules provided. This endpoint supports the\n * update of existing rules, creation of new rules and deletion of existing\n * rules when they are not passed in the request.\n *\n * @param request - The request {@link SetSecurityGroupRulesRequest}\n * @returns A Promise of SetSecurityGroupRulesResponse\n */\n setSecurityGroupRules = request => this.client.fetch({\n body: JSON.stringify(marshalSetSecurityGroupRulesRequest(request, this.client.settings)),\n headers: jsonContentHeaders$g,\n method: 'PUT',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/security_groups/${validatePathParam('securityGroupId', request.securityGroupId)}/rules`\n }, unmarshalSetSecurityGroupRulesResponse);\n\n /**\n * Delete rule. Delete a security group rule with the specified ID.\n *\n * @param request - The request {@link DeleteSecurityGroupRuleRequest}\n */\n deleteSecurityGroupRule = request => this.client.fetch({\n method: 'DELETE',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/security_groups/${validatePathParam('securityGroupId', request.securityGroupId)}/rules/${validatePathParam('securityGroupRuleId', request.securityGroupRuleId)}`\n });\n\n /**\n * Get rule. Get details of a security group rule with the specified ID.\n *\n * @param request - The request {@link GetSecurityGroupRuleRequest}\n * @returns A Promise of GetSecurityGroupRuleResponse\n */\n getSecurityGroupRule = request => this.client.fetch({\n method: 'GET',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/security_groups/${validatePathParam('securityGroupId', request.securityGroupId)}/rules/${validatePathParam('securityGroupRuleId', request.securityGroupRuleId)}`\n }, unmarshalGetSecurityGroupRuleResponse);\n _setSecurityGroupRule = request => this.client.fetch({\n body: JSON.stringify(marshalSetSecurityGroupRuleRequest(request, this.client.settings)),\n headers: jsonContentHeaders$g,\n method: 'PUT',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/security_groups/${validatePathParam('securityGroupId', request.securityGroupId)}/rules/${validatePathParam('securityGroupRuleId', request.securityGroupRuleId)}`\n }, unmarshalSetSecurityGroupRuleResponse);\n pageOfListPlacementGroups = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/placement_groups`,\n urlParams: urlParams(['name', request.name], ['organization', request.organization], ['page', request.page], ['per_page', request.perPage ?? this.client.settings.defaultPageSize], ['project', request.project], ['tags', request.tags && request.tags.length > 0 ? request.tags.join(',') : undefined])\n }, unmarshalListPlacementGroupsResponse);\n\n /**\n * List placement groups. List all placement groups in a specified\n * Availability Zone.\n *\n * @param request - The request {@link ListPlacementGroupsRequest}\n * @returns A Promise of ListPlacementGroupsResponse\n */\n listPlacementGroups = (request = {}) => enrichForPagination('placementGroups', this.pageOfListPlacementGroups, request);\n\n /**\n * Create a placement group. Create a new placement group in a specified\n * Availability Zone.\n *\n * @param request - The request {@link CreatePlacementGroupRequest}\n * @returns A Promise of CreatePlacementGroupResponse\n */\n createPlacementGroup = (request = {}) => this.client.fetch({\n body: JSON.stringify(marshalCreatePlacementGroupRequest(request, this.client.settings)),\n headers: jsonContentHeaders$g,\n method: 'POST',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/placement_groups`\n }, unmarshalCreatePlacementGroupResponse);\n\n /**\n * Get a placement group. Get the specified placement group.\n *\n * @param request - The request {@link GetPlacementGroupRequest}\n * @returns A Promise of GetPlacementGroupResponse\n */\n getPlacementGroup = request => this.client.fetch({\n method: 'GET',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/placement_groups/${validatePathParam('placementGroupId', request.placementGroupId)}`\n }, unmarshalGetPlacementGroupResponse);\n\n /**\n * Set placement group. Set all parameters of the specified placement group.\n *\n * @param request - The request {@link SetPlacementGroupRequest}\n * @returns A Promise of SetPlacementGroupResponse\n */\n setPlacementGroup = request => this.client.fetch({\n body: JSON.stringify(marshalSetPlacementGroupRequest(request, this.client.settings)),\n headers: jsonContentHeaders$g,\n method: 'PUT',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/placement_groups/${validatePathParam('placementGroupId', request.placementGroupId)}`\n }, unmarshalSetPlacementGroupResponse);\n\n /**\n * Update a placement group. Update one or more parameter of the specified\n * placement group.\n *\n * @param request - The request {@link UpdatePlacementGroupRequest}\n * @returns A Promise of UpdatePlacementGroupResponse\n */\n updatePlacementGroup = request => this.client.fetch({\n body: JSON.stringify(marshalUpdatePlacementGroupRequest(request, this.client.settings)),\n headers: jsonContentHeaders$g,\n method: 'PATCH',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/placement_groups/${validatePathParam('placementGroupId', request.placementGroupId)}`\n }, unmarshalUpdatePlacementGroupResponse);\n\n /**\n * Delete the specified placement group.\n *\n * @param request - The request {@link DeletePlacementGroupRequest}\n */\n deletePlacementGroup = request => this.client.fetch({\n method: 'DELETE',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/placement_groups/${validatePathParam('placementGroupId', request.placementGroupId)}`\n });\n\n /**\n * Get placement group servers. Get all Instances belonging to the specified\n * placement group.\n *\n * @param request - The request {@link GetPlacementGroupServersRequest}\n * @returns A Promise of GetPlacementGroupServersResponse\n */\n getPlacementGroupServers = request => this.client.fetch({\n method: 'GET',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/placement_groups/${validatePathParam('placementGroupId', request.placementGroupId)}/servers`\n }, unmarshalGetPlacementGroupServersResponse);\n\n /**\n * Set placement group servers. Set all Instances belonging to the specified\n * placement group.\n *\n * @param request - The request {@link SetPlacementGroupServersRequest}\n * @returns A Promise of SetPlacementGroupServersResponse\n */\n setPlacementGroupServers = request => this.client.fetch({\n body: JSON.stringify(marshalSetPlacementGroupServersRequest(request, this.client.settings)),\n headers: jsonContentHeaders$g,\n method: 'PUT',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/placement_groups/${validatePathParam('placementGroupId', request.placementGroupId)}/servers`\n }, unmarshalSetPlacementGroupServersResponse);\n\n /**\n * Update placement group servers. Update all Instances belonging to the\n * specified placement group.\n *\n * @param request - The request {@link UpdatePlacementGroupServersRequest}\n * @returns A Promise of UpdatePlacementGroupServersResponse\n */\n updatePlacementGroupServers = request => this.client.fetch({\n body: JSON.stringify(marshalUpdatePlacementGroupServersRequest(request, this.client.settings)),\n headers: jsonContentHeaders$g,\n method: 'PATCH',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/placement_groups/${validatePathParam('placementGroupId', request.placementGroupId)}/servers`\n }, unmarshalUpdatePlacementGroupServersResponse);\n pageOfListIps = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips`,\n urlParams: urlParams(['name', request.name], ['organization', request.organization], ['page', request.page], ['per_page', request.perPage ?? this.client.settings.defaultPageSize], ['project', request.project], ['tags', request.tags && request.tags.length > 0 ? request.tags.join(',') : undefined], ['type', request.type])\n }, unmarshalListIpsResponse$1);\n\n /**\n * List all flexible IPs. List all flexible IPs in a specified zone.\n *\n * @param request - The request {@link ListIpsRequest}\n * @returns A Promise of ListIpsResponse\n */\n listIps = (request = {}) => enrichForPagination('ips', this.pageOfListIps, request);\n\n /**\n * Reserve a flexible IP. Reserve a flexible IP and attach it to the specified\n * Instance.\n *\n * @param request - The request {@link CreateIpRequest}\n * @returns A Promise of CreateIpResponse\n */\n createIp = (request = {}) => this.client.fetch({\n body: JSON.stringify(marshalCreateIpRequest$1(request, this.client.settings)),\n headers: jsonContentHeaders$g,\n method: 'POST',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips`\n }, unmarshalCreateIpResponse);\n\n /**\n * Get a flexible IP. Get details of an IP with the specified ID or address.\n *\n * @param request - The request {@link GetIpRequest}\n * @returns A Promise of GetIpResponse\n */\n getIp = request => this.client.fetch({\n method: 'GET',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam('ip', request.ip)}`\n }, unmarshalGetIpResponse);\n\n /**\n * Update a flexible IP. Update a flexible IP in the specified zone with the\n * specified ID.\n *\n * @param request - The request {@link UpdateIpRequest}\n * @returns A Promise of UpdateIpResponse\n */\n updateIp = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateIpRequest$1(request, this.client.settings)),\n headers: jsonContentHeaders$g,\n method: 'PATCH',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam('ip', request.ip)}`\n }, unmarshalUpdateIpResponse);\n\n /**\n * Delete a flexible IP. Delete the IP with the specified ID.\n *\n * @param request - The request {@link DeleteIpRequest}\n */\n deleteIp = request => this.client.fetch({\n method: 'DELETE',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam('ip', request.ip)}`\n });\n pageOfListPrivateNICs = request => this.client.fetch({\n method: 'GET',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/private_nics`,\n urlParams: urlParams(['page', request.page], ['per_page', request.perPage ?? this.client.settings.defaultPageSize], ['tags', request.tags && request.tags.length > 0 ? request.tags.join(',') : undefined])\n }, unmarshalListPrivateNICsResponse);\n\n /**\n * List all private NICs. List all private NICs of a specified Instance.\n *\n * @param request - The request {@link ListPrivateNICsRequest}\n * @returns A Promise of ListPrivateNICsResponse\n */\n listPrivateNICs = request => enrichForPagination('privateNics', this.pageOfListPrivateNICs, request);\n\n /**\n * Create a private NIC connecting an Instance to a Private Network.\n *\n * @param request - The request {@link CreatePrivateNICRequest}\n * @returns A Promise of CreatePrivateNICResponse\n */\n createPrivateNIC = request => this.client.fetch({\n body: JSON.stringify(marshalCreatePrivateNICRequest(request, this.client.settings)),\n headers: jsonContentHeaders$g,\n method: 'POST',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/private_nics`\n }, unmarshalCreatePrivateNICResponse);\n\n /**\n * Get a private NIC. Get private NIC properties.\n *\n * @param request - The request {@link GetPrivateNICRequest}\n * @returns A Promise of GetPrivateNICResponse\n */\n getPrivateNIC = request => this.client.fetch({\n method: 'GET',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/private_nics/${validatePathParam('privateNicId', request.privateNicId)}`\n }, unmarshalGetPrivateNICResponse);\n\n /**\n * Update a private NIC. Update one or more parameter(s) of a specified\n * private NIC.\n *\n * @param request - The request {@link UpdatePrivateNICRequest}\n * @returns A Promise of PrivateNIC\n */\n updatePrivateNIC = request => this.client.fetch({\n body: JSON.stringify(marshalUpdatePrivateNICRequest(request, this.client.settings)),\n headers: jsonContentHeaders$g,\n method: 'PATCH',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/private_nics/${validatePathParam('privateNicId', request.privateNicId)}`\n }, unmarshalPrivateNIC);\n\n /**\n * Delete a private NIC.\n *\n * @param request - The request {@link DeletePrivateNICRequest}\n */\n deletePrivateNIC = request => this.client.fetch({\n method: 'DELETE',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/private_nics/${validatePathParam('privateNicId', request.privateNicId)}`\n });\n pageOfListBootscripts = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/bootscripts`,\n urlParams: urlParams(['arch', request.arch], ['default', request.default], ['page', request.page], ['per_page', request.perPage ?? this.client.settings.defaultPageSize], ['public', request.public], ['title', request.title])\n }, unmarshalListBootscriptsResponse);\n\n /**\n * List bootscripts.\n *\n * @deprecated\n * @param request - The request {@link ListBootscriptsRequest}\n * @returns A Promise of ListBootscriptsResponse\n */\n listBootscripts = (request = {}) => enrichForPagination('bootscripts', this.pageOfListBootscripts, request);\n\n /**\n * Get bootscripts. Get details of a bootscript with the specified ID.\n *\n * @deprecated\n * @param request - The request {@link GetBootscriptRequest}\n * @returns A Promise of GetBootscriptResponse\n */\n getBootscript = request => this.client.fetch({\n method: 'GET',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/bootscripts/${validatePathParam('bootscriptId', request.bootscriptId)}`\n }, unmarshalGetBootscriptResponse);\n getDashboard = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/dashboard`,\n urlParams: urlParams(['organization', request.organization], ['project', request.project])\n }, unmarshalGetDashboardResponse);\n\n /**\n * Get a volume or snapshot's migration plan. Given a volume or snapshot,\n * returns the migration plan for a call to the RPC ApplyBlockMigration. This\n * plan will include zero or one volume, and zero or more snapshots, which\n * will need to be migrated together. This RPC does not perform the actual\n * migration itself, ApplyBlockMigration must be used. The validation_key\n * value returned by this call must be provided to the ApplyBlockMigration\n * call to confirm that all resources listed in the plan should be migrated.\n *\n * @param request - The request {@link PlanBlockMigrationRequest}\n * @returns A Promise of MigrationPlan\n */\n planBlockMigration = (request = {}) => this.client.fetch({\n body: JSON.stringify(marshalPlanBlockMigrationRequest(request, this.client.settings)),\n headers: jsonContentHeaders$g,\n method: 'POST',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/block-migration/plan`\n }, unmarshalMigrationPlan);\n\n /**\n * Migrate a volume and/or snapshots to SBS (Scaleway Block Storage). To be\n * used, this RPC must be preceded by a call to PlanBlockMigration. To migrate\n * all resources mentioned in the MigrationPlan, the validation_key returned\n * in the MigrationPlan must be provided.\n *\n * @param request - The request {@link ApplyBlockMigrationRequest}\n */\n applyBlockMigration = request => this.client.fetch({\n body: JSON.stringify(marshalApplyBlockMigrationRequest(request, this.client.settings)),\n headers: jsonContentHeaders$g,\n method: 'POST',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/block-migration/apply`\n });\n};\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\n/** Lists transient statutes of the enum {@link ImageState}. */\nconst IMAGE_TRANSIENT_STATUSES$1 = ['creating'];\n\n/** Lists transient statutes of the enum {@link IpState}. */\nconst IP_TRANSIENT_STATUSES = ['pending'];\n\n/** Lists transient statutes of the enum {@link PrivateNICState}. */\nconst PRIVATE_NIC_TRANSIENT_STATUSES = ['syncing'];\n\n/** Lists transient statutes of the enum {@link SecurityGroupState}. */\nconst SECURITY_GROUP_TRANSIENT_STATUSES = ['syncing'];\n\n/** Lists transient statutes of the enum {@link ServerState}. */\nconst SERVER_TRANSIENT_STATUSES = ['starting', 'stopping'];\n\n/** Lists transient statutes of the enum {@link SnapshotState}. */\nconst SNAPSHOT_TRANSIENT_STATUSES$1 = ['snapshotting', 'importing', 'exporting'];\n\n/** Lists transient statutes of the enum {@link TaskStatus}. */\nconst TASK_TRANSIENT_STATUSES = ['pending', 'started', 'retry'];\n\n/** Lists transient statutes of the enum {@link VolumeServerState}. */\nconst VOLUME_SERVER_TRANSIENT_STATUSES = ['snapshotting', 'fetching', 'resizing', 'saving', 'hotsyncing'];\n\n/** Lists transient statutes of the enum {@link VolumeState}. */\nconst VOLUME_TRANSIENT_STATUSES = ['snapshotting', 'fetching', 'resizing', 'saving', 'hotsyncing'];\n\nconst marshalVolumeSummary = (request, defaults) => ({\n id: request.id,\n name: request.name,\n size: request.size,\n volume_type: request.volumeType\n});\nconst marshalServerSummary = (request, defaults) => ({\n id: request.id,\n name: request.name\n});\nconst marshalBootscript = (request, defaults) => ({\n arch: request.arch,\n bootcmdargs: request.bootcmdargs,\n default: request.default,\n dtb: request.dtb,\n id: request.id,\n initrd: request.initrd,\n kernel: request.kernel,\n organization: request.organization,\n project: request.project,\n public: request.public,\n title: request.title,\n zone: request.zone\n});\nconst marshalVolume = (request, defaults) => ({\n creation_date: request.creationDate,\n export_uri: request.exportUri,\n id: request.id,\n modification_date: request.modificationDate,\n name: request.name,\n organization: request.organization,\n project: request.project,\n server: request.server ? marshalServerSummary(request.server) : undefined,\n size: request.size,\n state: request.state,\n tags: request.tags,\n volume_type: request.volumeType,\n zone: request.zone\n});\nconst marshalSetImageRequestWithID = (request, defaults) => ({\n arch: request.arch,\n creation_date: request.creationDate,\n default_bootscript: request.defaultBootscript ? marshalBootscript(request.defaultBootscript) : undefined,\n extra_volumes: request.extraVolumes ? Object.entries(request.extraVolumes).reduce((acc, [key, value]) => ({\n ...acc,\n [key]: marshalVolume(value)\n }), {}) : undefined,\n from_server: request.fromServer,\n modification_date: request.modificationDate,\n id: request.id,\n name: request.name,\n organization: request.organization,\n project: request.project,\n public: request.public,\n root_volume: request.rootVolume ? marshalVolumeSummary(request.rootVolume) : undefined,\n state: request.state,\n tags: request.tags\n});\n\nconst validateNotUndefined = obj => {\n if (obj === undefined) throw new TypeError(`object was found undefined`);\n return obj;\n};\nclass InstanceV1UtilsAPI extends API$h {\n /**\n * Waits for {@link Image} to be in a final state.\n *\n * @param request - The request {@link GetImageRequest}\n * @param options - The waiting options\n * @returns A Promise of Image\n */\n waitForImage = (request, options) => tryAtIntervals(async () => {\n const value = await this.getImage(request).then(res => res.image);\n return {\n done: !IMAGE_TRANSIENT_STATUSES$1.includes(value.state),\n value\n };\n }, createExponentialBackoffStrategy(options?.minDelay ?? 1, options?.maxDelay ?? 30), options?.timeout);\n\n /**\n * Waits for {@link PrivateNIC} to be in a final state.\n *\n * @param request - The request {@link GetPrivateNICRequest}\n * @param options - The waiting options\n * @returns A Promise of PrivateNIC\n */\n waitForPrivateNIC = (request, options) => tryAtIntervals(async () => {\n const value = await this.getPrivateNIC(request).then(res => res.privateNic);\n return {\n done: !PRIVATE_NIC_TRANSIENT_STATUSES.includes(value.state),\n value\n };\n }, createExponentialBackoffStrategy(options?.minDelay ?? 1, options?.maxDelay ?? 30), options?.timeout);\n\n /**\n * Waits for {@link Server} to be in a final state.\n *\n * @param request - The request {@link GetServerRequest}\n * @param options - The waiting options\n * @returns A Promise of Server\n */\n waitForServer = (request, options) => tryAtIntervals(async () => {\n const value = await this.getServer(request).then(res => res.server);\n return {\n done: !SERVER_TRANSIENT_STATUSES.includes(value.state),\n value\n };\n }, createExponentialBackoffStrategy(options?.minDelay ?? 1, options?.maxDelay ?? 30), options?.timeout);\n\n /**\n * Waits for {@link Server} to be in a final state.\n *\n * @param request - The request {@link GetServerRequest}\n * @param options - The waiting options\n * @returns A Promise of Server\n */\n waitForSnapshot = (request, options) => tryAtIntervals(async () => {\n const value = await this.getSnapshot(request).then(res => res.snapshot);\n return {\n done: !SNAPSHOT_TRANSIENT_STATUSES$1.includes(value.state),\n value\n };\n }, createExponentialBackoffStrategy(options?.minDelay ?? 1, options?.maxDelay ?? 30), options?.timeout);\n\n /**\n * Waits for {@link Volume} to be in a final state.\n *\n * @param request - The request {@link GetVolumeRequest}\n * @param options - The waiting options\n * @returns A Promise of Volume\n */\n waitForVolume = (request, options) => tryAtIntervals(async () => {\n const value = await this.getVolume(request).then(res => res.volume);\n return {\n done: !VOLUME_TRANSIENT_STATUSES.includes(value.state),\n value\n };\n }, createExponentialBackoffStrategy(options?.minDelay ?? 1, options?.maxDelay ?? 30), options?.timeout);\n\n /**\n * Updates a snapshot.\n *\n * @param request - The request {@link UpdateSnapshotRequest}\n * @returns A Promise of UpdateSnapshotResponse\n */\n updateSnapshot = request => this.getSnapshot(request).then(res => validateNotUndefined(res.snapshot)).then(snapshot => this._setSnapshot({\n ...snapshot,\n name: request.name ?? snapshot.name,\n snapshotId: snapshot.id\n })).then(res => ({\n snapshot: res.snapshot\n }));\n\n /**\n * Updates a security group.\n *\n * @param request - The request {@link UpdateSecurityGroupRequest}\n * @returns A Promise of UpdateSecurityGroupResponse\n */\n updateSecurityGroup = request => this.getSecurityGroup({\n securityGroupId: request.securityGroupId,\n zone: request.zone\n }).then(res => validateNotUndefined(res.securityGroup)).then(securityGroup => this._setSecurityGroup({\n creationDate: securityGroup.creationDate,\n description: request.description ?? securityGroup.description,\n enableDefaultSecurity: request.enableDefaultSecurity ?? securityGroup.enableDefaultSecurity,\n id: securityGroup.id,\n inboundDefaultPolicy: request.inboundDefaultPolicy ?? securityGroup.inboundDefaultPolicy,\n modificationDate: securityGroup.modificationDate,\n name: request.name ?? securityGroup.name,\n organization: securityGroup.organization,\n organizationDefault: request.organizationDefault ?? securityGroup.organizationDefault,\n outboundDefaultPolicy: request.outboundDefaultPolicy ?? securityGroup.outboundDefaultPolicy,\n project: securityGroup.project,\n projectDefault: request.projectDefault ?? securityGroup.projectDefault,\n servers: securityGroup.servers,\n stateful: request.stateful ?? securityGroup.stateful,\n zone: request.zone\n })).then(res => ({\n securityGroup: res.securityGroup\n }));\n\n /**\n * Updates a security group rule.\n *\n * @param request - The request {@link UpdateSecurityGroupRuleRequest}\n * @returns A Promise of UpdateSecurityGroupRuleResponse\n */\n updateSecurityGroupRule = request => this.getSecurityGroupRule({\n securityGroupId: request.securityGroupId,\n securityGroupRuleId: request.securityGroupRuleId,\n zone: request.zone\n }).then(res => validateNotUndefined(res.rule)).then(rule => {\n let sReq = {\n action: request.action ?? rule.action,\n destPortFrom: rule.destPortFrom,\n destPortTo: rule.destPortTo,\n direction: request.direction ?? rule.direction,\n editable: rule.editable,\n id: request.securityGroupRuleId,\n ipRange: request.ipRange ?? rule.ipRange,\n position: request.position ?? rule.position,\n protocol: request.protocol ?? rule.protocol,\n securityGroupId: request.securityGroupId,\n securityGroupRuleId: request.securityGroupRuleId\n };\n if (request.destPortFrom) {\n sReq = {\n ...sReq,\n destPortFrom: request.destPortFrom > 0 ? request.destPortFrom : undefined\n };\n }\n if (request.destPortTo) {\n sReq = {\n ...sReq,\n destPortTo: request.destPortTo > 0 ? request.destPortTo : undefined\n };\n }\n if (sReq.destPortFrom && sReq.destPortTo && sReq.destPortFrom === sReq.destPortTo) {\n sReq = {\n ...sReq,\n destPortTo: undefined\n };\n }\n // When we use ICMP protocol portFrom and portTo should be set to nil\n if (request.protocol === 'ICMP') {\n sReq = {\n ...sReq,\n destPortFrom: undefined,\n destPortTo: undefined\n };\n }\n return this._setSecurityGroupRule(sReq);\n }).then(res => ({\n rule: res.rule\n }));\n\n /**\n * Updates a server.\n *\n * @param request - The request {@link UpdateServerRequest}\n * @returns A Promise of UpdateServerResponse\n */\n updateServer = request => this._updateServer(request);\n\n /**\n * Creates a server.\n *\n * @param request - The request {@link CreateServerRequest}\n * @returns A Promise of CreateServerResponse\n */\n createServer = request => this._createServer(request);\n\n /**\n * Starts an action and wait for the server to be in the correct \"terminal\n * state\" expected by this action.\n *\n * @param request - The request {@link ServerActionRequest}\n * @returns A Promise of Server\n */\n serverActionAndWait = async (request, options) => {\n const finalServer = await this.serverAction(request).then(() => this.waitForServer({\n serverId: request.serverId,\n zone: request.zone\n }, options));\n\n // Check the action was properly executed.\n let expectedState;\n switch (request.action) {\n case 'poweron':\n case 'reboot':\n expectedState = 'running';\n break;\n case 'poweroff':\n expectedState = 'stopped';\n break;\n case 'stop_in_place':\n expectedState = 'stopped in place';\n break;\n }\n if (expectedState && finalServer.state !== expectedState) {\n throw new Error(`expected state ${expectedState} but found ${finalServer.state}: ${finalServer.stateDetail}`);\n }\n return finalServer;\n };\n\n /**\n * Attaches a volume to a server.\n *\n * @param request - The request {@link AttachVolumeRequest}\n * @returns A Promise of AttachVolumeResponse\n */\n attachVolume = async request => {\n const volumes = await this.getServer({\n serverId: request.serverId,\n zone: request.zone\n }).then(res => validateNotUndefined(res.server?.volumes));\n const newVolumes = {};\n for (const [key, server] of Object.entries(volumes)) {\n newVolumes[key] = {\n id: server.id,\n name: server.name\n };\n }\n\n // We loop through all the possible volume keys (0 to len(volumes))\n // to find a non existing key and assign it to the requested volume.\n // A key should always be found. However we return an error if no keys were found.\n let found = false;\n const volumesLength = Object.keys(volumes).length;\n for (let index = 0; index <= volumesLength; index += 1) {\n const key = index.toString();\n if (!(key in newVolumes)) {\n newVolumes[key] = {\n id: request.volumeId,\n name: request.volumeId // name is ignored on this PATCH\n };\n\n found = true;\n break;\n }\n }\n if (!found) {\n throw new Error(`could not find key to attach volume ${request.volumeId}`);\n }\n\n // Update server\n return this.updateServer({\n serverId: request.serverId,\n volumes: newVolumes,\n zone: request.zone\n }).then(obj => obj);\n };\n\n /**\n * Detaches a volume from a server.\n *\n * @param request - The request {@link DetachVolumeRequest}\n * @returns A Promise of DetachVolumeResponse\n */\n detachVolume = async request => {\n // Get server and related volumes.\n const server = await this.getVolume({\n volumeId: request.volumeId,\n zone: request.zone\n }).then(res => validateNotUndefined(res.volume?.server?.id)).then(serverId => this.getServer({\n serverId,\n zone: request.zone\n })).then(res => validateNotUndefined(res.server));\n\n // Remove volume.\n const newVolumes = {};\n for (const [key, volume] of Object.entries(server.volumes)) {\n if (volume.id !== request.volumeId) {\n newVolumes[key] = {\n id: volume.id,\n name: volume.name\n };\n }\n }\n\n // Update server.\n return this.updateServer({\n serverId: server.id,\n volumes: newVolumes,\n zone: request.zone\n }).then(obj => obj);\n };\n\n /**\n * Updates an image.\n *\n * @param request - The request {@link UpdateImageRequest}\n * @returns A Promise of UpdateImageResponse\n */\n updateImage = request => this.getImage({\n zone: request.zone,\n imageId: request.imageId\n }).then(res => validateNotUndefined(res.image)).then(image => ({\n ...image,\n name: request.name ?? image.name,\n tags: request.tags ?? image.tags,\n id: image.id\n })).then(imageReq => this.client.fetch({\n body: JSON.stringify(marshalSetImageRequestWithID(imageReq, this.client.settings)),\n headers: {\n 'Content-Type': 'application/json; charset=utf-8'\n },\n method: 'PUT',\n path: `/instance/v1/zones/${validatePathParam('zone', imageReq.zone)}/images/${validatePathParam('id', imageReq.id)}`\n }, unmarshalSetImageResponse)).then(res => ({\n image: res.image\n }));\n\n /**\n * Get the content of a user data on a server for the given key.\n *\n * @param request - The request {@link GetServerUserDataRequest}\n * @returns The content of the key\n */\n getServerUserData = request => this.client.fetch({\n method: 'GET',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/user_data/${validatePathParam('key', request.key)}`\n });\n\n /**\n * Sets the content of a user data on a server for the given key.\n *\n * @param request - The request {@link SetServerUserDataRequest}\n */\n setServerUserData = request => this.client.fetch({\n body: request.content,\n headers: {\n 'Content-Type': 'text/plain'\n },\n method: 'PATCH',\n path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/user_data/${validatePathParam('key', request.key)}`\n });\n}\n\nvar index$i = /*#__PURE__*/Object.freeze({\n __proto__: null,\n API: InstanceV1UtilsAPI,\n IMAGE_TRANSIENT_STATUSES: IMAGE_TRANSIENT_STATUSES$1,\n IP_TRANSIENT_STATUSES: IP_TRANSIENT_STATUSES,\n PRIVATE_NIC_TRANSIENT_STATUSES: PRIVATE_NIC_TRANSIENT_STATUSES,\n SECURITY_GROUP_TRANSIENT_STATUSES: SECURITY_GROUP_TRANSIENT_STATUSES,\n SERVER_TRANSIENT_STATUSES: SERVER_TRANSIENT_STATUSES,\n SNAPSHOT_TRANSIENT_STATUSES: SNAPSHOT_TRANSIENT_STATUSES$1,\n TASK_TRANSIENT_STATUSES: TASK_TRANSIENT_STATUSES,\n VOLUME_SERVER_TRANSIENT_STATUSES: VOLUME_SERVER_TRANSIENT_STATUSES,\n VOLUME_TRANSIENT_STATUSES: VOLUME_TRANSIENT_STATUSES\n});\n\nvar index$h = /*#__PURE__*/Object.freeze({\n __proto__: null,\n v1: index$i\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\n/** Lists transient statutes of the enum {@link HubStatus}. */\nconst HUB_TRANSIENT_STATUSES = ['enabling', 'disabling'];\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst unmarshalDeviceMessageFiltersRule = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'DeviceMessageFiltersRule' failed as data isn't a dictionary.`);\n }\n return {\n policy: data.policy,\n topics: data.topics\n };\n};\nconst unmarshalDeviceMessageFilters = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'DeviceMessageFilters' failed as data isn't a dictionary.`);\n }\n return {\n publish: data.publish ? unmarshalDeviceMessageFiltersRule(data.publish) : undefined,\n subscribe: data.subscribe ? unmarshalDeviceMessageFiltersRule(data.subscribe) : undefined\n };\n};\nconst unmarshalHubTwinsGraphiteConfig = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'HubTwinsGraphiteConfig' failed as data isn't a dictionary.`);\n }\n return {\n pushUri: data.push_uri\n };\n};\nconst unmarshalCertificate$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Certificate' failed as data isn't a dictionary.`);\n }\n return {\n crt: data.crt,\n key: data.key\n };\n};\nconst unmarshalDevice = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Device' failed as data isn't a dictionary.`);\n }\n return {\n allowInsecure: data.allow_insecure,\n allowMultipleConnections: data.allow_multiple_connections,\n createdAt: unmarshalDate(data.created_at),\n description: data.description,\n hasCustomCertificate: data.has_custom_certificate,\n hubId: data.hub_id,\n id: data.id,\n isConnected: data.is_connected,\n lastActivityAt: unmarshalDate(data.last_activity_at),\n messageFilters: data.message_filters ? unmarshalDeviceMessageFilters(data.message_filters) : undefined,\n name: data.name,\n status: data.status,\n updatedAt: unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalHub = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Hub' failed as data isn't a dictionary.`);\n }\n return {\n connectedDeviceCount: data.connected_device_count,\n createdAt: unmarshalDate(data.created_at),\n deviceCount: data.device_count,\n disableEvents: data.disable_events,\n enabled: data.enabled,\n enableDeviceAutoProvisioning: data.enable_device_auto_provisioning,\n endpoint: data.endpoint,\n eventsTopicPrefix: data.events_topic_prefix,\n hasCustomCa: data.has_custom_ca,\n id: data.id,\n name: data.name,\n organizationId: data.organization_id,\n productPlan: data.product_plan,\n projectId: data.project_id,\n region: data.region,\n status: data.status,\n twinsGraphiteConfig: data.twins_graphite_config ? unmarshalHubTwinsGraphiteConfig(data.twins_graphite_config) : undefined,\n updatedAt: unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalListTwinDocumentsResponseDocumentSummary = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListTwinDocumentsResponseDocumentSummary' failed as data isn't a dictionary.`);\n }\n return {\n documentName: data.document_name\n };\n};\nconst unmarshalNetwork = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Network' failed as data isn't a dictionary.`);\n }\n return {\n createdAt: unmarshalDate(data.created_at),\n endpoint: data.endpoint,\n hubId: data.hub_id,\n id: data.id,\n name: data.name,\n topicPrefix: data.topic_prefix,\n type: data.type\n };\n};\nconst unmarshalRouteDatabaseConfig = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'RouteDatabaseConfig' failed as data isn't a dictionary.`);\n }\n return {\n dbname: data.dbname,\n engine: data.engine,\n host: data.host,\n password: data.password,\n port: data.port,\n query: data.query,\n username: data.username\n };\n};\nconst unmarshalRouteRestConfig = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'RouteRestConfig' failed as data isn't a dictionary.`);\n }\n return {\n headers: data.headers,\n uri: data.uri,\n verb: data.verb\n };\n};\nconst unmarshalRouteS3Config = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'RouteS3Config' failed as data isn't a dictionary.`);\n }\n return {\n bucketName: data.bucket_name,\n bucketRegion: data.bucket_region,\n objectPrefix: data.object_prefix,\n strategy: data.strategy\n };\n};\nconst unmarshalRouteSummary = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'RouteSummary' failed as data isn't a dictionary.`);\n }\n return {\n createdAt: unmarshalDate(data.created_at),\n hubId: data.hub_id,\n id: data.id,\n name: data.name,\n topic: data.topic,\n type: data.type,\n updatedAt: unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalCreateDeviceResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'CreateDeviceResponse' failed as data isn't a dictionary.`);\n }\n return {\n certificate: data.certificate ? unmarshalCertificate$1(data.certificate) : undefined,\n device: data.device ? unmarshalDevice(data.device) : undefined\n };\n};\nconst unmarshalCreateNetworkResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'CreateNetworkResponse' failed as data isn't a dictionary.`);\n }\n return {\n network: data.network ? unmarshalNetwork(data.network) : undefined,\n secret: data.secret\n };\n};\nconst unmarshalGetDeviceCertificateResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'GetDeviceCertificateResponse' failed as data isn't a dictionary.`);\n }\n return {\n certificatePem: data.certificate_pem,\n device: data.device ? unmarshalDevice(data.device) : undefined\n };\n};\nconst unmarshalGetDeviceMetricsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'GetDeviceMetricsResponse' failed as data isn't a dictionary.`);\n }\n return {\n metrics: unmarshalArrayOfObject(data.metrics, unmarshalTimeSeries)\n };\n};\nconst unmarshalGetHubCAResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'GetHubCAResponse' failed as data isn't a dictionary.`);\n }\n return {\n caCertPem: data.ca_cert_pem\n };\n};\nconst unmarshalGetHubMetricsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'GetHubMetricsResponse' failed as data isn't a dictionary.`);\n }\n return {\n metrics: unmarshalArrayOfObject(data.metrics, unmarshalTimeSeries)\n };\n};\nconst unmarshalListDevicesResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListDevicesResponse' failed as data isn't a dictionary.`);\n }\n return {\n devices: unmarshalArrayOfObject(data.devices, unmarshalDevice),\n totalCount: data.total_count\n };\n};\nconst unmarshalListHubsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListHubsResponse' failed as data isn't a dictionary.`);\n }\n return {\n hubs: unmarshalArrayOfObject(data.hubs, unmarshalHub),\n totalCount: data.total_count\n };\n};\nconst unmarshalListNetworksResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListNetworksResponse' failed as data isn't a dictionary.`);\n }\n return {\n networks: unmarshalArrayOfObject(data.networks, unmarshalNetwork),\n totalCount: data.total_count\n };\n};\nconst unmarshalListRoutesResponse$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListRoutesResponse' failed as data isn't a dictionary.`);\n }\n return {\n routes: unmarshalArrayOfObject(data.routes, unmarshalRouteSummary),\n totalCount: data.total_count\n };\n};\nconst unmarshalListTwinDocumentsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListTwinDocumentsResponse' failed as data isn't a dictionary.`);\n }\n return {\n documents: unmarshalArrayOfObject(data.documents, unmarshalListTwinDocumentsResponseDocumentSummary)\n };\n};\nconst unmarshalRenewDeviceCertificateResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'RenewDeviceCertificateResponse' failed as data isn't a dictionary.`);\n }\n return {\n certificate: data.certificate ? unmarshalCertificate$1(data.certificate) : undefined,\n device: data.device ? unmarshalDevice(data.device) : undefined\n };\n};\nconst unmarshalRoute$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Route' failed as data isn't a dictionary.`);\n }\n return {\n createdAt: unmarshalDate(data.created_at),\n dbConfig: data.db_config ? unmarshalRouteDatabaseConfig(data.db_config) : undefined,\n hubId: data.hub_id,\n id: data.id,\n name: data.name,\n restConfig: data.rest_config ? unmarshalRouteRestConfig(data.rest_config) : undefined,\n s3Config: data.s3_config ? unmarshalRouteS3Config(data.s3_config) : undefined,\n topic: data.topic,\n type: data.type,\n updatedAt: unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalSetDeviceCertificateResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'SetDeviceCertificateResponse' failed as data isn't a dictionary.`);\n }\n return {\n certificatePem: data.certificate_pem,\n device: data.device ? unmarshalDevice(data.device) : undefined\n };\n};\nconst unmarshalTwinDocument = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'TwinDocument' failed as data isn't a dictionary.`);\n }\n return {\n data: data.data,\n documentName: data.document_name,\n twinId: data.twin_id,\n version: data.version\n };\n};\nconst marshalDeviceMessageFiltersRule = (request, defaults) => ({\n policy: request.policy,\n topics: request.topics\n});\nconst marshalCreateRouteRequestDatabaseConfig = (request, defaults) => ({\n dbname: request.dbname,\n engine: request.engine,\n host: request.host,\n password: request.password,\n port: request.port,\n query: request.query,\n username: request.username\n});\nconst marshalCreateRouteRequestRestConfig = (request, defaults) => ({\n headers: request.headers,\n uri: request.uri,\n verb: request.verb\n});\nconst marshalCreateRouteRequestS3Config = (request, defaults) => ({\n bucket_name: request.bucketName,\n bucket_region: request.bucketRegion,\n object_prefix: request.objectPrefix,\n strategy: request.strategy\n});\nconst marshalDeviceMessageFilters = (request, defaults) => ({\n publish: request.publish ? marshalDeviceMessageFiltersRule(request.publish) : undefined,\n subscribe: request.subscribe ? marshalDeviceMessageFiltersRule(request.subscribe) : undefined\n});\nconst marshalHubTwinsGraphiteConfig = (request, defaults) => ({\n push_uri: request.pushUri\n});\nconst marshalUpdateRouteRequestDatabaseConfig = (request, defaults) => ({\n dbname: request.dbname,\n engine: request.engine,\n host: request.host,\n password: request.password,\n port: request.port,\n query: request.query,\n username: request.username\n});\nconst marshalUpdateRouteRequestRestConfig = (request, defaults) => ({\n headers: request.headers,\n uri: request.uri,\n verb: request.verb\n});\nconst marshalUpdateRouteRequestS3Config = (request, defaults) => ({\n bucket_name: request.bucketName,\n bucket_region: request.bucketRegion,\n object_prefix: request.objectPrefix,\n strategy: request.strategy\n});\nconst marshalCreateDeviceRequest = (request, defaults) => ({\n allow_insecure: request.allowInsecure,\n allow_multiple_connections: request.allowMultipleConnections,\n description: request.description,\n hub_id: request.hubId,\n message_filters: request.messageFilters ? marshalDeviceMessageFilters(request.messageFilters) : undefined,\n name: request.name || randomName('device')\n});\nconst marshalCreateHubRequest = (request, defaults) => ({\n disable_events: request.disableEvents,\n events_topic_prefix: request.eventsTopicPrefix,\n name: request.name || randomName('hub'),\n product_plan: request.productPlan,\n project_id: request.projectId ?? defaults.defaultProjectId,\n ...resolveOneOf([{\n param: 'twins_graphite_config',\n value: request.twinsGraphiteConfig ? marshalHubTwinsGraphiteConfig(request.twinsGraphiteConfig) : undefined\n }])\n});\nconst marshalCreateNetworkRequest = (request, defaults) => ({\n hub_id: request.hubId,\n name: request.name || randomName('network'),\n topic_prefix: request.topicPrefix,\n type: request.type\n});\nconst marshalCreateRouteRequest$1 = (request, defaults) => ({\n hub_id: request.hubId,\n name: request.name || randomName('route'),\n topic: request.topic,\n ...resolveOneOf([{\n param: 's3_config',\n value: request.s3Config ? marshalCreateRouteRequestS3Config(request.s3Config) : undefined\n }, {\n param: 'db_config',\n value: request.dbConfig ? marshalCreateRouteRequestDatabaseConfig(request.dbConfig) : undefined\n }, {\n param: 'rest_config',\n value: request.restConfig ? marshalCreateRouteRequestRestConfig(request.restConfig) : undefined\n }])\n});\nconst marshalPatchTwinDocumentRequest = (request, defaults) => ({\n data: request.data,\n version: request.version\n});\nconst marshalPutTwinDocumentRequest = (request, defaults) => ({\n data: request.data,\n version: request.version\n});\nconst marshalSetDeviceCertificateRequest = (request, defaults) => ({\n certificate_pem: request.certificatePem\n});\nconst marshalSetHubCARequest = (request, defaults) => ({\n ca_cert_pem: request.caCertPem,\n challenge_cert_pem: request.challengeCertPem\n});\nconst marshalUpdateDeviceRequest = (request, defaults) => ({\n allow_insecure: request.allowInsecure,\n allow_multiple_connections: request.allowMultipleConnections,\n description: request.description,\n hub_id: request.hubId,\n message_filters: request.messageFilters ? marshalDeviceMessageFilters(request.messageFilters) : undefined\n});\nconst marshalUpdateHubRequest = (request, defaults) => ({\n disable_events: request.disableEvents,\n enable_device_auto_provisioning: request.enableDeviceAutoProvisioning,\n events_topic_prefix: request.eventsTopicPrefix,\n name: request.name,\n product_plan: request.productPlan ?? 'plan_unknown',\n ...resolveOneOf([{\n param: 'twins_graphite_config',\n value: request.twinsGraphiteConfig ? marshalHubTwinsGraphiteConfig(request.twinsGraphiteConfig) : undefined\n }])\n});\nconst marshalUpdateRouteRequest$1 = (request, defaults) => ({\n name: request.name,\n topic: request.topic,\n ...resolveOneOf([{\n param: 's3_config',\n value: request.s3Config ? marshalUpdateRouteRequestS3Config(request.s3Config) : undefined\n }, {\n param: 'db_config',\n value: request.dbConfig ? marshalUpdateRouteRequestDatabaseConfig(request.dbConfig) : undefined\n }, {\n param: 'rest_config',\n value: request.restConfig ? marshalUpdateRouteRequestRestConfig(request.restConfig) : undefined\n }])\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst jsonContentHeaders$f = {\n 'Content-Type': 'application/json; charset=utf-8'\n};\n\n/**\n * IoT Hub API.\n *\n * This API allows you to manage IoT hubs and devices. IoT Hub API.\n */\nlet API$g = class API extends API$u {\n /** Lists the available regions of the API. */\n static LOCALITIES = ['fr-par'];\n pageOfListHubs = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hubs`,\n urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'name_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])\n }, unmarshalListHubsResponse);\n\n /**\n * List hubs. List all Hubs in the specified zone. By default, returned Hubs\n * are ordered by creation date in ascending order, though this can be\n * modified via the `order_by` field.\n *\n * @param request - The request {@link ListHubsRequest}\n * @returns A Promise of ListHubsResponse\n */\n listHubs = (request = {}) => enrichForPagination('hubs', this.pageOfListHubs, request);\n\n /**\n * Create a hub. Create a new Hub in the targeted region, specifying its\n * configuration including name and product plan.\n *\n * @param request - The request {@link CreateHubRequest}\n * @returns A Promise of Hub\n */\n createHub = request => this.client.fetch({\n body: JSON.stringify(marshalCreateHubRequest(request, this.client.settings)),\n headers: jsonContentHeaders$f,\n method: 'POST',\n path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hubs`\n }, unmarshalHub);\n\n /**\n * Get a hub. Retrieve information about an existing IoT Hub, specified by its\n * Hub ID. Its full details, including name, status and endpoint, are returned\n * in the response object.\n *\n * @param request - The request {@link GetHubRequest}\n * @returns A Promise of Hub\n */\n getHub = request => this.client.fetch({\n method: 'GET',\n path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hubs/${validatePathParam('hubId', request.hubId)}`\n }, unmarshalHub);\n\n /**\n * Waits for {@link Hub} to be in a final state.\n *\n * @param request - The request {@link GetHubRequest}\n * @param options - The waiting options\n * @returns A Promise of Hub\n */\n waitForHub = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!HUB_TRANSIENT_STATUSES.includes(res.status))), this.getHub, request, options);\n\n /**\n * Update a hub. Update the parameters of an existing IoT Hub, specified by\n * its Hub ID.\n *\n * @param request - The request {@link UpdateHubRequest}\n * @returns A Promise of Hub\n */\n updateHub = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateHubRequest(request, this.client.settings)),\n headers: jsonContentHeaders$f,\n method: 'PATCH',\n path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hubs/${validatePathParam('hubId', request.hubId)}`\n }, unmarshalHub);\n\n /**\n * Enable a hub. Enable an existing IoT Hub, specified by its Hub ID.\n *\n * @param request - The request {@link EnableHubRequest}\n * @returns A Promise of Hub\n */\n enableHub = request => this.client.fetch({\n body: '{}',\n headers: jsonContentHeaders$f,\n method: 'POST',\n path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hubs/${validatePathParam('hubId', request.hubId)}/enable`\n }, unmarshalHub);\n\n /**\n * Disable a hub. Disable an existing IoT Hub, specified by its Hub ID.\n *\n * @param request - The request {@link DisableHubRequest}\n * @returns A Promise of Hub\n */\n disableHub = request => this.client.fetch({\n body: '{}',\n headers: jsonContentHeaders$f,\n method: 'POST',\n path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hubs/${validatePathParam('hubId', request.hubId)}/disable`\n }, unmarshalHub);\n\n /**\n * Delete a hub. Delete an existing IoT Hub, specified by its Hub ID. Deleting\n * a Hub is permanent, and cannot be undone.\n *\n * @param request - The request {@link DeleteHubRequest}\n */\n deleteHub = request => this.client.fetch({\n method: 'DELETE',\n path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hubs/${validatePathParam('hubId', request.hubId)}`,\n urlParams: urlParams(['delete_devices', request.deleteDevices])\n });\n\n /**\n * Get a hub's metrics. Get the metrics of an existing IoT Hub, specified by\n * its Hub ID.\n *\n * @deprecated\n * @param request - The request {@link GetHubMetricsRequest}\n * @returns A Promise of GetHubMetricsResponse\n */\n getHubMetrics = request => this.client.fetch({\n method: 'GET',\n path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hubs/${validatePathParam('hubId', request.hubId)}/metrics`,\n urlParams: urlParams(['start_date', request.startDate])\n }, unmarshalGetHubMetricsResponse);\n\n /**\n * Set the certificate authority of a hub. Set a particular PEM-encoded\n * certificate, specified by the Hub ID.\n *\n * @param request - The request {@link SetHubCARequest}\n * @returns A Promise of Hub\n */\n setHubCA = request => this.client.fetch({\n body: JSON.stringify(marshalSetHubCARequest(request, this.client.settings)),\n headers: jsonContentHeaders$f,\n method: 'POST',\n path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hubs/${validatePathParam('hubId', request.hubId)}/ca`\n }, unmarshalHub);\n\n /**\n * Get the certificate authority of a hub. Get information for a particular\n * PEM-encoded certificate, specified by the Hub ID.\n *\n * @param request - The request {@link GetHubCARequest}\n * @returns A Promise of GetHubCAResponse\n */\n getHubCA = request => this.client.fetch({\n method: 'GET',\n path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hubs/${validatePathParam('hubId', request.hubId)}/ca`\n }, unmarshalGetHubCAResponse);\n pageOfListDevices = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/devices`,\n urlParams: urlParams(['allow_insecure', request.allowInsecure], ['hub_id', request.hubId], ['name', request.name], ['order_by', request.orderBy ?? 'name_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['status', request.status ?? 'unknown'])\n }, unmarshalListDevicesResponse);\n\n /**\n * List devices. List all devices in the specified region. By default,\n * returned devices are ordered by creation date in ascending order, though\n * this can be modified via the `order_by` field.\n *\n * @param request - The request {@link ListDevicesRequest}\n * @returns A Promise of ListDevicesResponse\n */\n listDevices = (request = {}) => enrichForPagination('devices', this.pageOfListDevices, request);\n\n /**\n * Add a device. Attach a device to a given Hub.\n *\n * @param request - The request {@link CreateDeviceRequest}\n * @returns A Promise of CreateDeviceResponse\n */\n createDevice = request => this.client.fetch({\n body: JSON.stringify(marshalCreateDeviceRequest(request, this.client.settings)),\n headers: jsonContentHeaders$f,\n method: 'POST',\n path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/devices`\n }, unmarshalCreateDeviceResponse);\n\n /**\n * Get a device. Retrieve information about an existing device, specified by\n * its device ID. Its full details, including name, status and ID, are\n * returned in the response object.\n *\n * @param request - The request {@link GetDeviceRequest}\n * @returns A Promise of Device\n */\n getDevice = request => this.client.fetch({\n method: 'GET',\n path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/devices/${validatePathParam('deviceId', request.deviceId)}`\n }, unmarshalDevice);\n\n /**\n * Update a device. Update the parameters of an existing device, specified by\n * its device ID.\n *\n * @param request - The request {@link UpdateDeviceRequest}\n * @returns A Promise of Device\n */\n updateDevice = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateDeviceRequest(request, this.client.settings)),\n headers: jsonContentHeaders$f,\n method: 'PATCH',\n path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/devices/${validatePathParam('deviceId', request.deviceId)}`\n }, unmarshalDevice);\n\n /**\n * Enable a device. Enable a specific device, specified by its device ID.\n *\n * @param request - The request {@link EnableDeviceRequest}\n * @returns A Promise of Device\n */\n enableDevice = request => this.client.fetch({\n body: '{}',\n headers: jsonContentHeaders$f,\n method: 'POST',\n path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/devices/${validatePathParam('deviceId', request.deviceId)}/enable`\n }, unmarshalDevice);\n\n /**\n * Disable a device. Disable an existing device, specified by its device ID.\n *\n * @param request - The request {@link DisableDeviceRequest}\n * @returns A Promise of Device\n */\n disableDevice = request => this.client.fetch({\n body: '{}',\n headers: jsonContentHeaders$f,\n method: 'POST',\n path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/devices/${validatePathParam('deviceId', request.deviceId)}/disable`\n }, unmarshalDevice);\n\n /**\n * Renew a device certificate. Renew the certificate of an existing device,\n * specified by its device ID.\n *\n * @param request - The request {@link RenewDeviceCertificateRequest}\n * @returns A Promise of RenewDeviceCertificateResponse\n */\n renewDeviceCertificate = request => this.client.fetch({\n body: '{}',\n headers: jsonContentHeaders$f,\n method: 'POST',\n path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/devices/${validatePathParam('deviceId', request.deviceId)}/renew-certificate`\n }, unmarshalRenewDeviceCertificateResponse);\n\n /**\n * Set a custom certificate on a device. Switch the existing certificate of a\n * given device with an EM-encoded custom certificate.\n *\n * @param request - The request {@link SetDeviceCertificateRequest}\n * @returns A Promise of SetDeviceCertificateResponse\n */\n setDeviceCertificate = request => this.client.fetch({\n body: JSON.stringify(marshalSetDeviceCertificateRequest(request, this.client.settings)),\n headers: jsonContentHeaders$f,\n method: 'PUT',\n path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/devices/${validatePathParam('deviceId', request.deviceId)}/certificate`\n }, unmarshalSetDeviceCertificateResponse);\n\n /**\n * Get a device's certificate. Get information for a particular PEM-encoded\n * certificate, specified by the device ID. The response returns full details\n * of the device, including its type of certificate.\n *\n * @param request - The request {@link GetDeviceCertificateRequest}\n * @returns A Promise of GetDeviceCertificateResponse\n */\n getDeviceCertificate = request => this.client.fetch({\n method: 'GET',\n path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/devices/${validatePathParam('deviceId', request.deviceId)}/certificate`\n }, unmarshalGetDeviceCertificateResponse);\n\n /**\n * Remove a device. Remove a specific device from the specific Hub it is\n * attached to.\n *\n * @param request - The request {@link DeleteDeviceRequest}\n */\n deleteDevice = request => this.client.fetch({\n method: 'DELETE',\n path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/devices/${validatePathParam('deviceId', request.deviceId)}`\n });\n\n /**\n * Get a device's metrics. Get the metrics of an existing device, specified by\n * its device ID.\n *\n * @deprecated\n * @param request - The request {@link GetDeviceMetricsRequest}\n * @returns A Promise of GetDeviceMetricsResponse\n */\n getDeviceMetrics = request => this.client.fetch({\n method: 'GET',\n path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/devices/${validatePathParam('deviceId', request.deviceId)}/metrics`,\n urlParams: urlParams(['start_date', request.startDate])\n }, unmarshalGetDeviceMetricsResponse);\n pageOfListRoutes = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/routes`,\n urlParams: urlParams(['hub_id', request.hubId], ['name', request.name], ['order_by', request.orderBy ?? 'name_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])\n }, unmarshalListRoutesResponse$1);\n\n /**\n * List routes. List all routes in the specified region. By default, returned\n * routes are ordered by creation date in ascending order, though this can be\n * modified via the `order_by` field.\n *\n * @param request - The request {@link ListRoutesRequest}\n * @returns A Promise of ListRoutesResponse\n */\n listRoutes = (request = {}) => enrichForPagination('routes', this.pageOfListRoutes, request);\n\n /**\n * Create a route. Multiple kinds of routes can be created, such as:\n *\n * - Database Route Create a route that will record subscribed MQTT messages\n * into your database. You need to manage the database by yourself.\n * - REST Route. Create a route that will call a REST API on received subscribed\n * MQTT messages.\n * - S3 Routes. Create a route that will put subscribed MQTT messages into an S3\n * bucket. You need to create the bucket yourself and grant write access.\n * Granting can be done with s3cmd (`s3cmd setacl s3://<my-bucket>\n * --acl-grant=write:555c69c3-87d0-4bf8-80f1-99a2f757d031:555c69c3-87d0-4bf8-80f1-99a2f757d031`).\n *\n * @param request - The request {@link CreateRouteRequest}\n * @returns A Promise of Route\n */\n createRoute = request => this.client.fetch({\n body: JSON.stringify(marshalCreateRouteRequest$1(request, this.client.settings)),\n headers: jsonContentHeaders$f,\n method: 'POST',\n path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/routes`\n }, unmarshalRoute$1);\n\n /**\n * Update a route. Update the parameters of an existing route, specified by\n * its route ID.\n *\n * @param request - The request {@link UpdateRouteRequest}\n * @returns A Promise of Route\n */\n updateRoute = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateRouteRequest$1(request, this.client.settings)),\n headers: jsonContentHeaders$f,\n method: 'PATCH',\n path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam('routeId', request.routeId)}`\n }, unmarshalRoute$1);\n\n /**\n * Get a route. Get information for a particular route, specified by the route\n * ID. The response returns full details of the route, including its type, the\n * topic it subscribes to and its configuration.\n *\n * @param request - The request {@link GetRouteRequest}\n * @returns A Promise of Route\n */\n getRoute = request => this.client.fetch({\n method: 'GET',\n path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam('routeId', request.routeId)}`\n }, unmarshalRoute$1);\n\n /**\n * Delete a route. Delete an existing route, specified by its route ID.\n * Deleting a route is permanent, and cannot be undone.\n *\n * @param request - The request {@link DeleteRouteRequest}\n */\n deleteRoute = request => this.client.fetch({\n method: 'DELETE',\n path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam('routeId', request.routeId)}`\n });\n pageOfListNetworks = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/networks`,\n urlParams: urlParams(['hub_id', request.hubId], ['name', request.name], ['order_by', request.orderBy ?? 'name_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['topic_prefix', request.topicPrefix])\n }, unmarshalListNetworksResponse);\n\n /**\n * List the networks.\n *\n * @param request - The request {@link ListNetworksRequest}\n * @returns A Promise of ListNetworksResponse\n */\n listNetworks = (request = {}) => enrichForPagination('networks', this.pageOfListNetworks, request);\n\n /**\n * Create a new network. Create a new network for an existing hub. Beside the\n * default network, you can add networks for different data providers.\n * Possible network types are Sigfox and REST.\n *\n * @param request - The request {@link CreateNetworkRequest}\n * @returns A Promise of CreateNetworkResponse\n */\n createNetwork = request => this.client.fetch({\n body: JSON.stringify(marshalCreateNetworkRequest(request, this.client.settings)),\n headers: jsonContentHeaders$f,\n method: 'POST',\n path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/networks`\n }, unmarshalCreateNetworkResponse);\n\n /**\n * Retrieve a specific network. Retrieve an existing network, specified by its\n * network ID. The response returns full details of the network, including its\n * type, the topic prefix and its endpoint.\n *\n * @param request - The request {@link GetNetworkRequest}\n * @returns A Promise of Network\n */\n getNetwork = request => this.client.fetch({\n method: 'GET',\n path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/networks/${validatePathParam('networkId', request.networkId)}`\n }, unmarshalNetwork);\n\n /**\n * Delete a Network. Delete an existing network, specified by its network ID.\n * Deleting a network is permanent, and cannot be undone.\n *\n * @param request - The request {@link DeleteNetworkRequest}\n */\n deleteNetwork = request => this.client.fetch({\n method: 'DELETE',\n path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/networks/${validatePathParam('networkId', request.networkId)}`\n });\n\n /**\n * BETA - Get a Cloud Twin Document.\n *\n * @param request - The request {@link GetTwinDocumentRequest}\n * @returns A Promise of TwinDocument\n */\n getTwinDocument = request => this.client.fetch({\n method: 'GET',\n path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/twins/${validatePathParam('twinId', request.twinId)}/documents/${validatePathParam('documentName', request.documentName)}`\n }, unmarshalTwinDocument);\n\n /**\n * BETA - Update a Cloud Twin Document.\n *\n * @param request - The request {@link PutTwinDocumentRequest}\n * @returns A Promise of TwinDocument\n */\n putTwinDocument = request => this.client.fetch({\n body: JSON.stringify(marshalPutTwinDocumentRequest(request, this.client.settings)),\n headers: jsonContentHeaders$f,\n method: 'PUT',\n path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/twins/${validatePathParam('twinId', request.twinId)}/documents/${validatePathParam('documentName', request.documentName)}`\n }, unmarshalTwinDocument);\n\n /**\n * BETA - Patch a Cloud Twin Document.\n *\n * @param request - The request {@link PatchTwinDocumentRequest}\n * @returns A Promise of TwinDocument\n */\n patchTwinDocument = request => this.client.fetch({\n body: JSON.stringify(marshalPatchTwinDocumentRequest(request, this.client.settings)),\n headers: jsonContentHeaders$f,\n method: 'PATCH',\n path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/twins/${validatePathParam('twinId', request.twinId)}/documents/${validatePathParam('documentName', request.documentName)}`\n }, unmarshalTwinDocument);\n\n /**\n * BETA - Delete a Cloud Twin Document.\n *\n * @param request - The request {@link DeleteTwinDocumentRequest}\n */\n deleteTwinDocument = request => this.client.fetch({\n method: 'DELETE',\n path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/twins/${validatePathParam('twinId', request.twinId)}/documents/${validatePathParam('documentName', request.documentName)}`\n });\n\n /**\n * BETA - List the documents of a Cloud Twin.\n *\n * @param request - The request {@link ListTwinDocumentsRequest}\n * @returns A Promise of ListTwinDocumentsResponse\n */\n listTwinDocuments = request => this.client.fetch({\n method: 'GET',\n path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/twins/${validatePathParam('twinId', request.twinId)}`\n }, unmarshalListTwinDocumentsResponse);\n\n /**\n * BETA - Delete all the documents of a Cloud Twin.\n *\n * @param request - The request {@link DeleteTwinDocumentsRequest}\n */\n deleteTwinDocuments = request => this.client.fetch({\n method: 'DELETE',\n path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/twins/${validatePathParam('twinId', request.twinId)}`\n });\n};\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\nvar index_gen$f = /*#__PURE__*/Object.freeze({\n __proto__: null,\n API: API$g,\n HUB_TRANSIENT_STATUSES: HUB_TRANSIENT_STATUSES\n});\n\nvar index$g = /*#__PURE__*/Object.freeze({\n __proto__: null,\n v1: index_gen$f\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\n/** Lists transient statutes of the enum {@link NameStatus}. */\nconst NAME_TRANSIENT_STATUSES = ['queued', 'publishing'];\n\n/** Lists transient statutes of the enum {@link PinStatus}. */\nconst PIN_TRANSIENT_STATUSES = ['queued', 'pinning'];\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst unmarshalPinCIDMeta = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'PinCIDMeta' failed as data isn't a dictionary.`);\n }\n return {\n id: data.id\n };\n};\nconst unmarshalPinCID = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'PinCID' failed as data isn't a dictionary.`);\n }\n return {\n cid: data.cid,\n meta: data.meta ? unmarshalPinCIDMeta(data.meta) : undefined,\n name: data.name,\n origins: data.origins\n };\n};\nconst unmarshalPinInfo = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'PinInfo' failed as data isn't a dictionary.`);\n }\n return {\n id: data.id,\n progress: data.progress,\n size: data.size,\n statusDetails: data.status_details,\n url: data.url\n };\n};\nconst unmarshalName = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Name' failed as data isn't a dictionary.`);\n }\n return {\n createdAt: unmarshalDate(data.created_at),\n key: data.key,\n name: data.name,\n nameId: data.name_id,\n projectId: data.project_id,\n region: data.region,\n status: data.status,\n tags: data.tags,\n updatedAt: unmarshalDate(data.updated_at),\n value: data.value\n };\n};\nconst unmarshalPin = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Pin' failed as data isn't a dictionary.`);\n }\n return {\n cid: data.cid ? unmarshalPinCID(data.cid) : undefined,\n createdAt: unmarshalDate(data.created_at),\n delegates: data.delegates,\n info: data.info ? unmarshalPinInfo(data.info) : undefined,\n pinId: data.pin_id,\n status: data.status\n };\n};\nconst unmarshalVolume$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Volume' failed as data isn't a dictionary.`);\n }\n return {\n countPin: data.count_pin,\n createdAt: unmarshalDate(data.created_at),\n id: data.id,\n name: data.name,\n projectId: data.project_id,\n region: data.region,\n size: data.size,\n tags: data.tags,\n updatedAt: unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalExportKeyNameResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ExportKeyNameResponse' failed as data isn't a dictionary.`);\n }\n return {\n createdAt: unmarshalDate(data.created_at),\n nameId: data.name_id,\n privateKey: data.private_key,\n projectId: data.project_id,\n publicKey: data.public_key,\n updatedAt: unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalListNamesResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListNamesResponse' failed as data isn't a dictionary.`);\n }\n return {\n names: unmarshalArrayOfObject(data.names, unmarshalName),\n totalCount: data.total_count\n };\n};\nconst unmarshalListPinsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListPinsResponse' failed as data isn't a dictionary.`);\n }\n return {\n pins: unmarshalArrayOfObject(data.pins, unmarshalPin),\n totalCount: data.total_count\n };\n};\nconst unmarshalListVolumesResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListVolumesResponse' failed as data isn't a dictionary.`);\n }\n return {\n totalCount: data.total_count,\n volumes: unmarshalArrayOfObject(data.volumes, unmarshalVolume$1)\n };\n};\nconst unmarshalReplacePinResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ReplacePinResponse' failed as data isn't a dictionary.`);\n }\n return {\n pin: data.pin ? unmarshalPin(data.pin) : undefined\n };\n};\nconst marshalPinOptions = (request, defaults) => ({\n replication_count: request.replicationCount,\n required_zones: request.requiredZones\n});\nconst marshalCreatePinByCIDRequest = (request, defaults) => ({\n cid: request.cid,\n name: request.name,\n origins: request.origins,\n pin_options: request.pinOptions ? marshalPinOptions(request.pinOptions) : undefined,\n volume_id: request.volumeId\n});\nconst marshalCreatePinByURLRequest = (request, defaults) => ({\n name: request.name,\n pin_options: request.pinOptions ? marshalPinOptions(request.pinOptions) : undefined,\n url: request.url,\n volume_id: request.volumeId\n});\nconst marshalCreateVolumeRequest = (request, defaults) => ({\n name: request.name,\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalIpnsApiCreateNameRequest = (request, defaults) => ({\n name: request.name,\n project_id: request.projectId ?? defaults.defaultProjectId,\n value: request.value\n});\nconst marshalIpnsApiImportKeyNameRequest = (request, defaults) => ({\n name: request.name,\n private_key: request.privateKey,\n project_id: request.projectId ?? defaults.defaultProjectId,\n value: request.value\n});\nconst marshalIpnsApiUpdateNameRequest = (request, defaults) => ({\n name: request.name,\n tags: request.tags,\n value: request.value\n});\nconst marshalReplacePinRequest = (request, defaults) => ({\n cid: request.cid,\n name: request.name,\n origins: request.origins,\n pin_options: request.pinOptions ? marshalPinOptions(request.pinOptions) : undefined,\n volume_id: request.volumeId\n});\nconst marshalUpdateVolumeRequest = (request, defaults) => ({\n name: request.name,\n tags: request.tags\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst jsonContentHeaders$e = {\n 'Content-Type': 'application/json; charset=utf-8'\n};\n\n/** IPFS Pinning service API. */\nlet API$f = class API extends API$u {\n /** Lists the available regions of the API. */\n static LOCALITIES = ['fr-par', 'nl-ams', 'pl-waw'];\n\n /**\n * Create a new volume. Create a new volume from a Project ID. Volume is\n * identified by an ID and used to host pin references. Volume is personal (at\n * least to your organization) even if IPFS blocks and CID are available to\n * anyone. Should be the first command you made because every pin must be\n * attached to a volume.\n *\n * @param request - The request {@link CreateVolumeRequest}\n * @returns A Promise of Volume\n */\n createVolume = request => this.client.fetch({\n body: JSON.stringify(marshalCreateVolumeRequest(request, this.client.settings)),\n headers: jsonContentHeaders$e,\n method: 'POST',\n path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/volumes`\n }, unmarshalVolume$1);\n\n /**\n * Get information about a volume. Retrieve information about a specific\n * volume.\n *\n * @param request - The request {@link GetVolumeRequest}\n * @returns A Promise of Volume\n */\n getVolume = request => this.client.fetch({\n method: 'GET',\n path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/volumes/${validatePathParam('volumeId', request.volumeId)}`\n }, unmarshalVolume$1);\n pageOfListVolumes = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/volumes`,\n urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId ?? this.client.settings.defaultProjectId])\n }, unmarshalListVolumesResponse);\n\n /**\n * List all volumes by a Project ID. Retrieve information about all volumes\n * from a Project ID.\n *\n * @param request - The request {@link ListVolumesRequest}\n * @returns A Promise of ListVolumesResponse\n */\n listVolumes = (request = {}) => enrichForPagination('volumes', this.pageOfListVolumes, request);\n\n /**\n * Update volume information. Update volume information (tag, name...).\n *\n * @param request - The request {@link UpdateVolumeRequest}\n * @returns A Promise of Volume\n */\n updateVolume = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateVolumeRequest(request, this.client.settings)),\n headers: jsonContentHeaders$e,\n method: 'PATCH',\n path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/volumes/${validatePathParam('volumeId', request.volumeId)}`\n }, unmarshalVolume$1);\n\n /**\n * Delete an existing volume. Delete a volume by its ID and every pin attached\n * to this volume. This process can take a while to conclude, depending on the\n * size of your pinned content.\n *\n * @param request - The request {@link DeleteVolumeRequest}\n */\n deleteVolume = request => this.client.fetch({\n method: 'DELETE',\n path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/volumes/${validatePathParam('volumeId', request.volumeId)}`\n });\n\n /**\n * Create a pin by URL. Will fetch and store the content pointed by the\n * provided URL. The content must be available on the public IPFS network. The\n * content (IPFS blocks) will be host by the pinning service until pin\n * deletion. From that point, any other IPFS peer can fetch and host your\n * content: Make sure to pin public or encrypted content. Many pin requests\n * (from different users) can target the same CID. A pin is defined by its ID\n * (UUID), its status (queued, pinning, pinned or failed) and target CID.\n *\n * @param request - The request {@link CreatePinByURLRequest}\n * @returns A Promise of Pin\n */\n createPinByURL = request => this.client.fetch({\n body: JSON.stringify(marshalCreatePinByURLRequest(request, this.client.settings)),\n headers: jsonContentHeaders$e,\n method: 'POST',\n path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/pins/create-by-url`\n }, unmarshalPin);\n\n /**\n * Create a pin by CID. Will fetch and store the content pointed by the\n * provided CID. The content must be available on the public IPFS network. The\n * content (IPFS blocks) will be host by the pinning service until pin\n * deletion. From that point, any other IPFS peer can fetch and host your\n * content: Make sure to pin public or encrypted content. Many pin requests\n * (from different users) can target the same CID. A pin is defined by its ID\n * (UUID), its status (queued, pinning, pinned or failed) and target CID.\n *\n * @param request - The request {@link CreatePinByCIDRequest}\n * @returns A Promise of Pin\n */\n createPinByCID = request => this.client.fetch({\n body: JSON.stringify(marshalCreatePinByCIDRequest(request, this.client.settings)),\n headers: jsonContentHeaders$e,\n method: 'POST',\n path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/pins/create-by-cid`\n }, unmarshalPin);\n replacePin = request => this.client.fetch({\n body: JSON.stringify(marshalReplacePinRequest(request, this.client.settings)),\n headers: jsonContentHeaders$e,\n method: 'POST',\n path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/pins/${validatePathParam('pinId', request.pinId)}/replace`\n }, unmarshalReplacePinResponse);\n\n /**\n * Get pin information. Retrieve information about the provided **pin ID**,\n * such as status, last modification, and CID.\n *\n * @param request - The request {@link GetPinRequest}\n * @returns A Promise of Pin\n */\n getPin = request => this.client.fetch({\n method: 'GET',\n path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/pins/${validatePathParam('pinId', request.pinId)}`,\n urlParams: urlParams(['volume_id', request.volumeId])\n }, unmarshalPin);\n\n /**\n * Waits for {@link Pin} to be in a final state.\n *\n * @param request - The request {@link GetPinRequest}\n * @param options - The waiting options\n * @returns A Promise of Pin\n */\n waitForPin = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!PIN_TRANSIENT_STATUSES.includes(res.status))), this.getPin, request, options);\n pageOfListPins = request => this.client.fetch({\n method: 'GET',\n path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/pins`,\n urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId], ['status', request.status ?? 'unknown_status'], ['volume_id', request.volumeId])\n }, unmarshalListPinsResponse);\n\n /**\n * List all pins within a volume. Retrieve information about all pins within a\n * volume.\n *\n * @param request - The request {@link ListPinsRequest}\n * @returns A Promise of ListPinsResponse\n */\n listPins = request => enrichForPagination('pins', this.pageOfListPins, request);\n\n /**\n * Create an unpin request. An unpin request means that you no longer own the\n * content. This content can therefore be removed and no longer provided on\n * the IPFS network.\n *\n * @param request - The request {@link DeletePinRequest}\n */\n deletePin = request => this.client.fetch({\n method: 'DELETE',\n path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/pins/${validatePathParam('pinId', request.pinId)}`,\n urlParams: urlParams(['volume_id', request.volumeId])\n });\n};\n\n/** IPFS Naming service API. */\nclass IpnsAPI extends API$u {\n /** Lists the available regions of the API. */\n static LOCALITIES = ['fr-par', 'nl-ams', 'pl-waw'];\n\n /**\n * Create a new name. You can use the `ipns key` command to list and generate\n * more names and their respective keys.\n *\n * @param request - The request {@link IpnsApiCreateNameRequest}\n * @returns A Promise of Name\n */\n createName = request => this.client.fetch({\n body: JSON.stringify(marshalIpnsApiCreateNameRequest(request, this.client.settings)),\n headers: jsonContentHeaders$e,\n method: 'POST',\n path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/names`\n }, unmarshalName);\n\n /**\n * Get information about a name. Retrieve information about a specific name.\n *\n * @param request - The request {@link IpnsApiGetNameRequest}\n * @returns A Promise of Name\n */\n getName = request => this.client.fetch({\n method: 'GET',\n path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/names/${validatePathParam('nameId', request.nameId)}`\n }, unmarshalName);\n\n /**\n * Waits for {@link Name} to be in a final state.\n *\n * @param request - The request {@link GetNameRequest}\n * @param options - The waiting options\n * @returns A Promise of Name\n */\n waitForName = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!NAME_TRANSIENT_STATUSES.includes(res.status))), this.getName, request, options);\n\n /**\n * Delete an existing name. Delete a name by its ID.\n *\n * @param request - The request {@link IpnsApiDeleteNameRequest}\n */\n deleteName = request => this.client.fetch({\n method: 'DELETE',\n path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/names/${validatePathParam('nameId', request.nameId)}`\n });\n pageOfListNames = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/names`,\n urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])\n }, unmarshalListNamesResponse);\n\n /**\n * List all names by a Project ID. Retrieve information about all names from a\n * Project ID.\n *\n * @param request - The request {@link IpnsApiListNamesRequest}\n * @returns A Promise of ListNamesResponse\n */\n listNames = (request = {}) => enrichForPagination('names', this.pageOfListNames, request);\n\n /**\n * Update name information. Update name information (CID, tag, name...).\n *\n * @param request - The request {@link IpnsApiUpdateNameRequest}\n * @returns A Promise of Name\n */\n updateName = request => this.client.fetch({\n body: JSON.stringify(marshalIpnsApiUpdateNameRequest(request, this.client.settings)),\n headers: jsonContentHeaders$e,\n method: 'PATCH',\n path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/names/${validatePathParam('nameId', request.nameId)}`\n }, unmarshalName);\n\n /**\n * Export your private key. Export a private key by its ID.\n *\n * @param request - The request {@link IpnsApiExportKeyNameRequest}\n * @returns A Promise of ExportKeyNameResponse\n */\n exportKeyName = request => this.client.fetch({\n method: 'GET',\n path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/names/${validatePathParam('nameId', request.nameId)}/export-key`\n }, unmarshalExportKeyNameResponse);\n\n /**\n * Import your private key. Import a private key.\n *\n * @param request - The request {@link IpnsApiImportKeyNameRequest}\n * @returns A Promise of Name\n */\n importKeyName = request => this.client.fetch({\n body: JSON.stringify(marshalIpnsApiImportKeyNameRequest(request, this.client.settings)),\n headers: jsonContentHeaders$e,\n method: 'POST',\n path: `/ipfs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/names/import-key`\n }, unmarshalName);\n}\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\nvar index_gen$e = /*#__PURE__*/Object.freeze({\n __proto__: null,\n API: API$f,\n IpnsAPI: IpnsAPI,\n NAME_TRANSIENT_STATUSES: NAME_TRANSIENT_STATUSES,\n PIN_TRANSIENT_STATUSES: PIN_TRANSIENT_STATUSES\n});\n\nvar index$f = /*#__PURE__*/Object.freeze({\n __proto__: null,\n v1alpha1: index_gen$e\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\n/** Lists transient statutes of the enum {@link ClusterStatus}. */\nconst CLUSTER_TRANSIENT_STATUSES$1 = ['creating', 'deleting', 'updating'];\n\n/** Lists transient statutes of the enum {@link NodeStatus}. */\nconst NODE_TRANSIENT_STATUSES = ['creating', 'deleting', 'rebooting', 'upgrading', 'starting', 'registering'];\n\n/** Lists transient statutes of the enum {@link PoolStatus}. */\nconst POOL_TRANSIENT_STATUSES = ['deleting', 'scaling', 'upgrading'];\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst unmarshalMaintenanceWindow = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'MaintenanceWindow' failed as data isn't a dictionary.`);\n }\n return {\n day: data.day,\n startHour: data.start_hour\n };\n};\nconst unmarshalClusterAutoUpgrade = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ClusterAutoUpgrade' failed as data isn't a dictionary.`);\n }\n return {\n enabled: data.enabled,\n maintenanceWindow: data.maintenance_window ? unmarshalMaintenanceWindow(data.maintenance_window) : undefined\n };\n};\nconst unmarshalClusterAutoscalerConfig = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ClusterAutoscalerConfig' failed as data isn't a dictionary.`);\n }\n return {\n balanceSimilarNodeGroups: data.balance_similar_node_groups,\n estimator: data.estimator,\n expander: data.expander,\n expendablePodsPriorityCutoff: data.expendable_pods_priority_cutoff,\n ignoreDaemonsetsUtilization: data.ignore_daemonsets_utilization,\n maxGracefulTerminationSec: data.max_graceful_termination_sec,\n scaleDownDelayAfterAdd: data.scale_down_delay_after_add,\n scaleDownDisabled: data.scale_down_disabled,\n scaleDownUnneededTime: data.scale_down_unneeded_time,\n scaleDownUtilizationThreshold: data.scale_down_utilization_threshold\n };\n};\nconst unmarshalClusterOpenIDConnectConfig = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ClusterOpenIDConnectConfig' failed as data isn't a dictionary.`);\n }\n return {\n clientId: data.client_id,\n groupsClaim: data.groups_claim,\n groupsPrefix: data.groups_prefix,\n issuerUrl: data.issuer_url,\n requiredClaim: data.required_claim,\n usernameClaim: data.username_claim,\n usernamePrefix: data.username_prefix\n };\n};\nconst unmarshalPoolUpgradePolicy = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'PoolUpgradePolicy' failed as data isn't a dictionary.`);\n }\n return {\n maxSurge: data.max_surge,\n maxUnavailable: data.max_unavailable\n };\n};\nconst unmarshalCluster$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Cluster' failed as data isn't a dictionary.`);\n }\n return {\n admissionPlugins: data.admission_plugins,\n apiserverCertSans: data.apiserver_cert_sans,\n autoscalerConfig: data.autoscaler_config ? unmarshalClusterAutoscalerConfig(data.autoscaler_config) : undefined,\n autoUpgrade: data.auto_upgrade ? unmarshalClusterAutoUpgrade(data.auto_upgrade) : undefined,\n clusterUrl: data.cluster_url,\n cni: data.cni,\n commitmentEndsAt: unmarshalDate(data.commitment_ends_at),\n createdAt: unmarshalDate(data.created_at),\n dashboardEnabled: data.dashboard_enabled,\n description: data.description,\n dnsWildcard: data.dns_wildcard,\n featureGates: data.feature_gates,\n id: data.id,\n ingress: data.ingress,\n name: data.name,\n openIdConnectConfig: data.open_id_connect_config ? unmarshalClusterOpenIDConnectConfig(data.open_id_connect_config) : undefined,\n organizationId: data.organization_id,\n privateNetworkId: data.private_network_id,\n projectId: data.project_id,\n region: data.region,\n status: data.status,\n tags: data.tags,\n type: data.type,\n updatedAt: unmarshalDate(data.updated_at),\n upgradeAvailable: data.upgrade_available,\n version: data.version\n };\n};\nconst unmarshalClusterType = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ClusterType' failed as data isn't a dictionary.`);\n }\n return {\n availability: data.availability,\n commitmentDelay: data.commitment_delay,\n dedicated: data.dedicated,\n maxNodes: data.max_nodes,\n memory: data.memory,\n name: data.name,\n resiliency: data.resiliency,\n sla: data.sla\n };\n};\nconst unmarshalNode = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Node' failed as data isn't a dictionary.`);\n }\n return {\n clusterId: data.cluster_id,\n conditions: data.conditions,\n createdAt: unmarshalDate(data.created_at),\n errorMessage: data.error_message,\n id: data.id,\n name: data.name,\n poolId: data.pool_id,\n providerId: data.provider_id,\n publicIpV4: data.public_ip_v4,\n publicIpV6: data.public_ip_v6,\n region: data.region,\n status: data.status,\n updatedAt: unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalPool = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Pool' failed as data isn't a dictionary.`);\n }\n return {\n autohealing: data.autohealing,\n autoscaling: data.autoscaling,\n clusterId: data.cluster_id,\n containerRuntime: data.container_runtime,\n createdAt: unmarshalDate(data.created_at),\n id: data.id,\n kubeletArgs: data.kubelet_args,\n maxSize: data.max_size,\n minSize: data.min_size,\n name: data.name,\n nodeType: data.node_type,\n placementGroupId: data.placement_group_id,\n publicIpDisabled: data.public_ip_disabled,\n region: data.region,\n rootVolumeSize: data.root_volume_size,\n rootVolumeType: data.root_volume_type,\n size: data.size,\n status: data.status,\n tags: data.tags,\n updatedAt: unmarshalDate(data.updated_at),\n upgradePolicy: data.upgrade_policy ? unmarshalPoolUpgradePolicy(data.upgrade_policy) : undefined,\n version: data.version,\n zone: data.zone\n };\n};\nconst unmarshalVersion$2 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Version' failed as data isn't a dictionary.`);\n }\n return {\n availableAdmissionPlugins: data.available_admission_plugins,\n availableCnis: data.available_cnis,\n availableContainerRuntimes: data.available_container_runtimes,\n availableFeatureGates: data.available_feature_gates,\n availableIngresses: data.available_ingresses,\n availableKubeletArgs: data.available_kubelet_args,\n label: data.label,\n name: data.name,\n region: data.region\n };\n};\nconst unmarshalExternalNode = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ExternalNode' failed as data isn't a dictionary.`);\n }\n return {\n clusterCa: data.cluster_ca,\n clusterUrl: data.cluster_url,\n externalIp: data.external_ip,\n id: data.id,\n kubeletConfig: data.kubelet_config,\n kubeToken: data.kube_token,\n name: data.name,\n poolVersion: data.pool_version\n };\n};\nconst unmarshalListClusterAvailableTypesResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListClusterAvailableTypesResponse' failed as data isn't a dictionary.`);\n }\n return {\n clusterTypes: unmarshalArrayOfObject(data.cluster_types, unmarshalClusterType),\n totalCount: data.total_count\n };\n};\nconst unmarshalListClusterAvailableVersionsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListClusterAvailableVersionsResponse' failed as data isn't a dictionary.`);\n }\n return {\n versions: unmarshalArrayOfObject(data.versions, unmarshalVersion$2)\n };\n};\nconst unmarshalListClusterTypesResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListClusterTypesResponse' failed as data isn't a dictionary.`);\n }\n return {\n clusterTypes: unmarshalArrayOfObject(data.cluster_types, unmarshalClusterType),\n totalCount: data.total_count\n };\n};\nconst unmarshalListClustersResponse$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListClustersResponse' failed as data isn't a dictionary.`);\n }\n return {\n clusters: unmarshalArrayOfObject(data.clusters, unmarshalCluster$1),\n totalCount: data.total_count\n };\n};\nconst unmarshalListNodesResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListNodesResponse' failed as data isn't a dictionary.`);\n }\n return {\n nodes: unmarshalArrayOfObject(data.nodes, unmarshalNode),\n totalCount: data.total_count\n };\n};\nconst unmarshalListPoolsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListPoolsResponse' failed as data isn't a dictionary.`);\n }\n return {\n pools: unmarshalArrayOfObject(data.pools, unmarshalPool),\n totalCount: data.total_count\n };\n};\nconst unmarshalListVersionsResponse$2 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListVersionsResponse' failed as data isn't a dictionary.`);\n }\n return {\n versions: unmarshalArrayOfObject(data.versions, unmarshalVersion$2)\n };\n};\nconst marshalCreateClusterRequestPoolConfigUpgradePolicy = (request, defaults) => ({\n max_surge: request.maxSurge,\n max_unavailable: request.maxUnavailable\n});\nconst marshalMaintenanceWindow = (request, defaults) => ({\n day: request.day,\n start_hour: request.startHour\n});\nconst marshalCreateClusterRequestAutoUpgrade = (request, defaults) => ({\n enable: request.enable,\n maintenance_window: request.maintenanceWindow ? marshalMaintenanceWindow(request.maintenanceWindow) : undefined\n});\nconst marshalCreateClusterRequestAutoscalerConfig = (request, defaults) => ({\n balance_similar_node_groups: request.balanceSimilarNodeGroups,\n estimator: request.estimator,\n expander: request.expander,\n expendable_pods_priority_cutoff: request.expendablePodsPriorityCutoff,\n ignore_daemonsets_utilization: request.ignoreDaemonsetsUtilization,\n max_graceful_termination_sec: request.maxGracefulTerminationSec,\n scale_down_delay_after_add: request.scaleDownDelayAfterAdd,\n scale_down_disabled: request.scaleDownDisabled,\n scale_down_unneeded_time: request.scaleDownUnneededTime,\n scale_down_utilization_threshold: request.scaleDownUtilizationThreshold\n});\nconst marshalCreateClusterRequestOpenIDConnectConfig = (request, defaults) => ({\n client_id: request.clientId,\n groups_claim: request.groupsClaim,\n groups_prefix: request.groupsPrefix,\n issuer_url: request.issuerUrl,\n required_claim: request.requiredClaim,\n username_claim: request.usernameClaim,\n username_prefix: request.usernamePrefix\n});\nconst marshalCreateClusterRequestPoolConfig = (request, defaults) => ({\n autohealing: request.autohealing,\n autoscaling: request.autoscaling,\n container_runtime: request.containerRuntime,\n kubelet_args: request.kubeletArgs,\n max_size: request.maxSize,\n min_size: request.minSize,\n name: request.name,\n node_type: request.nodeType,\n placement_group_id: request.placementGroupId,\n public_ip_disabled: request.publicIpDisabled,\n root_volume_size: request.rootVolumeSize,\n root_volume_type: request.rootVolumeType,\n size: request.size,\n tags: request.tags,\n upgrade_policy: request.upgradePolicy ? marshalCreateClusterRequestPoolConfigUpgradePolicy(request.upgradePolicy) : undefined,\n zone: request.zone\n});\nconst marshalCreatePoolRequestUpgradePolicy = (request, defaults) => ({\n max_surge: request.maxSurge,\n max_unavailable: request.maxUnavailable\n});\nconst marshalUpdateClusterRequestAutoUpgrade = (request, defaults) => ({\n enable: request.enable,\n maintenance_window: request.maintenanceWindow ? marshalMaintenanceWindow(request.maintenanceWindow) : undefined\n});\nconst marshalUpdateClusterRequestAutoscalerConfig = (request, defaults) => ({\n balance_similar_node_groups: request.balanceSimilarNodeGroups,\n estimator: request.estimator,\n expander: request.expander,\n expendable_pods_priority_cutoff: request.expendablePodsPriorityCutoff,\n ignore_daemonsets_utilization: request.ignoreDaemonsetsUtilization,\n max_graceful_termination_sec: request.maxGracefulTerminationSec,\n scale_down_delay_after_add: request.scaleDownDelayAfterAdd,\n scale_down_disabled: request.scaleDownDisabled,\n scale_down_unneeded_time: request.scaleDownUnneededTime,\n scale_down_utilization_threshold: request.scaleDownUtilizationThreshold\n});\nconst marshalUpdateClusterRequestOpenIDConnectConfig = (request, defaults) => ({\n client_id: request.clientId,\n groups_claim: request.groupsClaim,\n groups_prefix: request.groupsPrefix,\n issuer_url: request.issuerUrl,\n required_claim: request.requiredClaim,\n username_claim: request.usernameClaim,\n username_prefix: request.usernamePrefix\n});\nconst marshalUpdatePoolRequestUpgradePolicy = (request, defaults) => ({\n max_surge: request.maxSurge,\n max_unavailable: request.maxUnavailable\n});\nconst marshalCreateClusterRequest$1 = (request, defaults) => ({\n admission_plugins: request.admissionPlugins,\n apiserver_cert_sans: request.apiserverCertSans,\n auto_upgrade: request.autoUpgrade ? marshalCreateClusterRequestAutoUpgrade(request.autoUpgrade) : undefined,\n autoscaler_config: request.autoscalerConfig ? marshalCreateClusterRequestAutoscalerConfig(request.autoscalerConfig) : undefined,\n cni: request.cni,\n description: request.description,\n enable_dashboard: request.enableDashboard,\n feature_gates: request.featureGates,\n ingress: request.ingress,\n name: request.name || randomName('k8s'),\n open_id_connect_config: request.openIdConnectConfig ? marshalCreateClusterRequestOpenIDConnectConfig(request.openIdConnectConfig) : undefined,\n pools: request.pools ? request.pools.map(elt => marshalCreateClusterRequestPoolConfig(elt)) : undefined,\n private_network_id: request.privateNetworkId,\n tags: request.tags,\n type: request.type,\n version: request.version,\n ...resolveOneOf([{\n default: defaults.defaultProjectId,\n param: 'project_id',\n value: request.projectId\n }, {\n default: defaults.defaultOrganizationId,\n param: 'organization_id',\n value: request.organizationId\n }])\n});\nconst marshalCreatePoolRequest = (request, defaults) => ({\n autohealing: request.autohealing,\n autoscaling: request.autoscaling,\n container_runtime: request.containerRuntime ?? 'unknown_runtime',\n kubelet_args: request.kubeletArgs,\n max_size: request.maxSize,\n min_size: request.minSize,\n name: request.name || randomName('pool'),\n node_type: request.nodeType,\n placement_group_id: request.placementGroupId,\n public_ip_disabled: request.publicIpDisabled,\n root_volume_size: request.rootVolumeSize,\n root_volume_type: request.rootVolumeType ?? 'default_volume_type',\n size: request.size,\n tags: request.tags,\n upgrade_policy: request.upgradePolicy ? marshalCreatePoolRequestUpgradePolicy(request.upgradePolicy) : undefined,\n zone: request.zone ?? defaults.defaultZone\n});\nconst marshalMigrateToPrivateNetworkClusterRequest = (request, defaults) => ({\n private_network_id: request.privateNetworkId\n});\nconst marshalSetClusterTypeRequest = (request, defaults) => ({\n type: request.type\n});\nconst marshalUpdateClusterRequest$1 = (request, defaults) => ({\n admission_plugins: request.admissionPlugins,\n apiserver_cert_sans: request.apiserverCertSans,\n auto_upgrade: request.autoUpgrade ? marshalUpdateClusterRequestAutoUpgrade(request.autoUpgrade) : undefined,\n autoscaler_config: request.autoscalerConfig ? marshalUpdateClusterRequestAutoscalerConfig(request.autoscalerConfig) : undefined,\n description: request.description,\n enable_dashboard: request.enableDashboard,\n feature_gates: request.featureGates,\n ingress: request.ingress,\n name: request.name,\n open_id_connect_config: request.openIdConnectConfig ? marshalUpdateClusterRequestOpenIDConnectConfig(request.openIdConnectConfig) : undefined,\n tags: request.tags\n});\nconst marshalUpdatePoolRequest = (request, defaults) => ({\n autohealing: request.autohealing,\n autoscaling: request.autoscaling,\n kubelet_args: request.kubeletArgs,\n max_size: request.maxSize,\n min_size: request.minSize,\n size: request.size,\n tags: request.tags,\n upgrade_policy: request.upgradePolicy ? marshalUpdatePoolRequestUpgradePolicy(request.upgradePolicy) : undefined\n});\nconst marshalUpgradeClusterRequest = (request, defaults) => ({\n upgrade_pools: request.upgradePools,\n version: request.version\n});\nconst marshalUpgradePoolRequest = (request, defaults) => ({\n version: request.version\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst jsonContentHeaders$d = {\n 'Content-Type': 'application/json; charset=utf-8'\n};\n\n/** Kubernetes API. */\nlet API$e = class API extends API$u {\n /** Lists the available regions of the API. */\n static LOCALITIES = ['fr-par', 'nl-ams', 'pl-waw'];\n pageOfListClusters = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters`,\n urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['private_network_id', request.privateNetworkId], ['project_id', request.projectId], ['status', request.status ?? 'unknown'], ['type', request.type])\n }, unmarshalListClustersResponse$1);\n\n /**\n * List Clusters. List all existing Kubernetes clusters in a specific region.\n *\n * @param request - The request {@link ListClustersRequest}\n * @returns A Promise of ListClustersResponse\n */\n listClusters = (request = {}) => enrichForPagination('clusters', this.pageOfListClusters, request);\n\n /**\n * Create a new Cluster. Create a new Kubernetes cluster in a Scaleway region.\n *\n * @param request - The request {@link CreateClusterRequest}\n * @returns A Promise of Cluster\n */\n createCluster = request => this.client.fetch({\n body: JSON.stringify(marshalCreateClusterRequest$1(request, this.client.settings)),\n headers: jsonContentHeaders$d,\n method: 'POST',\n path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters`\n }, unmarshalCluster$1);\n\n /**\n * Get a Cluster. Retrieve information about a specific Kubernetes cluster.\n *\n * @param request - The request {@link GetClusterRequest}\n * @returns A Promise of Cluster\n */\n getCluster = request => this.client.fetch({\n method: 'GET',\n path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}`\n }, unmarshalCluster$1);\n\n /**\n * Waits for {@link Cluster} to be in a final state.\n *\n * @param request - The request {@link GetClusterRequest}\n * @param options - The waiting options\n * @returns A Promise of Cluster\n */\n waitForCluster = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!CLUSTER_TRANSIENT_STATUSES$1.includes(res.status))), this.getCluster, request, options);\n\n /**\n * Update a Cluster. Update information on a specific Kubernetes cluster. You\n * can update details such as its name, description, tags and configuration.\n * To upgrade a cluster, you will need to use the dedicated endpoint.\n *\n * @param request - The request {@link UpdateClusterRequest}\n * @returns A Promise of Cluster\n */\n updateCluster = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateClusterRequest$1(request, this.client.settings)),\n headers: jsonContentHeaders$d,\n method: 'PATCH',\n path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}`\n }, unmarshalCluster$1);\n\n /**\n * Delete a Cluster. Delete a specific Kubernetes cluster and all its\n * associated pools and nodes. Note that this method will not delete any Load\n * Balancer or Block Volume that are associated with the cluster.\n *\n * @param request - The request {@link DeleteClusterRequest}\n * @returns A Promise of Cluster\n */\n deleteCluster = request => this.client.fetch({\n method: 'DELETE',\n path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}`,\n urlParams: urlParams(['with_additional_resources', request.withAdditionalResources])\n }, unmarshalCluster$1);\n\n /**\n * Upgrade a Cluster. Upgrade a specific Kubernetes cluster and possibly its\n * associated pools to a specific and supported Kubernetes version.\n *\n * @param request - The request {@link UpgradeClusterRequest}\n * @returns A Promise of Cluster\n */\n upgradeCluster = request => this.client.fetch({\n body: JSON.stringify(marshalUpgradeClusterRequest(request, this.client.settings)),\n headers: jsonContentHeaders$d,\n method: 'POST',\n path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/upgrade`\n }, unmarshalCluster$1);\n\n /**\n * Change the Cluster type. Change the type of a specific Kubernetes cluster.\n * To see the possible values you can enter for the `type` field, [list\n * available cluster\n * types](#path-clusters-list-available-cluster-types-for-a-cluster).\n *\n * @param request - The request {@link SetClusterTypeRequest}\n * @returns A Promise of Cluster\n */\n setClusterType = request => this.client.fetch({\n body: JSON.stringify(marshalSetClusterTypeRequest(request, this.client.settings)),\n headers: jsonContentHeaders$d,\n method: 'POST',\n path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/set-type`\n }, unmarshalCluster$1);\n\n /**\n * List available versions for a Cluster. List the versions that a specific\n * Kubernetes cluster is allowed to upgrade to. Results will include every\n * patch version greater than the current patch, as well as one minor version\n * ahead of the current version. Any upgrade skipping a minor version will not\n * work.\n *\n * @param request - The request {@link ListClusterAvailableVersionsRequest}\n * @returns A Promise of ListClusterAvailableVersionsResponse\n */\n listClusterAvailableVersions = request => this.client.fetch({\n method: 'GET',\n path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/available-versions`\n }, unmarshalListClusterAvailableVersionsResponse);\n\n /**\n * List available cluster types for a cluster. List the cluster types that a\n * specific Kubernetes cluster is allowed to switch to.\n *\n * @param request - The request {@link ListClusterAvailableTypesRequest}\n * @returns A Promise of ListClusterAvailableTypesResponse\n */\n listClusterAvailableTypes = request => this.client.fetch({\n method: 'GET',\n path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/available-types`\n }, unmarshalListClusterAvailableTypesResponse);\n _getClusterKubeConfig = request => this.client.fetch({\n method: 'GET',\n path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/kubeconfig`,\n urlParams: urlParams(['dl', 1]),\n responseType: 'blob'\n });\n\n /**\n * Reset the admin token of a Cluster. Reset the admin token for a specific\n * Kubernetes cluster. This will revoke the old admin token (which will not be\n * usable afterwards) and create a new one. Note that you will need to\n * download kubeconfig again to keep interacting with the cluster.\n *\n * @param request - The request {@link ResetClusterAdminTokenRequest}\n */\n resetClusterAdminToken = request => this.client.fetch({\n body: '{}',\n headers: jsonContentHeaders$d,\n method: 'POST',\n path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/reset-admin-token`\n });\n\n /**\n * Migrate an existing cluster to a Private Network cluster. Migrate a cluster\n * that was created before the release of Private Network clusters to a new\n * one with a Private Network.\n *\n * @param request - The request {@link MigrateToPrivateNetworkClusterRequest}\n * @returns A Promise of Cluster\n */\n migrateToPrivateNetworkCluster = request => this.client.fetch({\n body: JSON.stringify(marshalMigrateToPrivateNetworkClusterRequest(request, this.client.settings)),\n headers: jsonContentHeaders$d,\n method: 'POST',\n path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/migrate-to-private-network`\n }, unmarshalCluster$1);\n pageOfListPools = request => this.client.fetch({\n method: 'GET',\n path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/pools`,\n urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['status', request.status ?? 'unknown'])\n }, unmarshalListPoolsResponse);\n\n /**\n * List Pools in a Cluster. List all the existing pools for a specific\n * Kubernetes cluster.\n *\n * @param request - The request {@link ListPoolsRequest}\n * @returns A Promise of ListPoolsResponse\n */\n listPools = request => enrichForPagination('pools', this.pageOfListPools, request);\n\n /**\n * Create a new Pool in a Cluster. Create a new pool in a specific Kubernetes\n * cluster.\n *\n * @param request - The request {@link CreatePoolRequest}\n * @returns A Promise of Pool\n */\n createPool = request => this.client.fetch({\n body: JSON.stringify(marshalCreatePoolRequest(request, this.client.settings)),\n headers: jsonContentHeaders$d,\n method: 'POST',\n path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/pools`\n }, unmarshalPool);\n\n /**\n * Get a Pool in a Cluster. Retrieve details about a specific pool in a\n * Kubernetes cluster.\n *\n * @param request - The request {@link GetPoolRequest}\n * @returns A Promise of Pool\n */\n getPool = request => this.client.fetch({\n method: 'GET',\n path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/pools/${validatePathParam('poolId', request.poolId)}`\n }, unmarshalPool);\n\n /**\n * Waits for {@link Pool} to be in a final state.\n *\n * @param request - The request {@link GetPoolRequest}\n * @param options - The waiting options\n * @returns A Promise of Pool\n */\n waitForPool = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!POOL_TRANSIENT_STATUSES.includes(res.status))), this.getPool, request, options);\n\n /**\n * Upgrade a Pool in a Cluster. Upgrade the Kubernetes version of a specific\n * pool. Note that it only works if the targeted version matches the cluster's\n * version.\n *\n * @param request - The request {@link UpgradePoolRequest}\n * @returns A Promise of Pool\n */\n upgradePool = request => this.client.fetch({\n body: JSON.stringify(marshalUpgradePoolRequest(request, this.client.settings)),\n headers: jsonContentHeaders$d,\n method: 'POST',\n path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/pools/${validatePathParam('poolId', request.poolId)}/upgrade`\n }, unmarshalPool);\n\n /**\n * Update a Pool in a Cluster. Update the attributes of a specific pool, such\n * as its desired size, autoscaling settings, and tags.\n *\n * @param request - The request {@link UpdatePoolRequest}\n * @returns A Promise of Pool\n */\n updatePool = request => this.client.fetch({\n body: JSON.stringify(marshalUpdatePoolRequest(request, this.client.settings)),\n headers: jsonContentHeaders$d,\n method: 'PATCH',\n path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/pools/${validatePathParam('poolId', request.poolId)}`\n }, unmarshalPool);\n\n /**\n * Delete a Pool in a Cluster. Delete a specific pool from a cluster. Note\n * that all the pool's nodes will also be deleted.\n *\n * @param request - The request {@link DeletePoolRequest}\n * @returns A Promise of Pool\n */\n deletePool = request => this.client.fetch({\n method: 'DELETE',\n path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/pools/${validatePathParam('poolId', request.poolId)}`\n }, unmarshalPool);\n\n /**\n * Create a Kosmos node. Retrieve metadata for a Kosmos node. This method is\n * not intended to be called by end users but rather programmatically by the\n * kapsule-node-agent.\n *\n * @param request - The request {@link CreateExternalNodeRequest}\n * @returns A Promise of ExternalNode\n */\n createExternalNode = request => this.client.fetch({\n body: '{}',\n headers: jsonContentHeaders$d,\n method: 'POST',\n path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/pools/${validatePathParam('poolId', request.poolId)}/external-nodes`\n }, unmarshalExternalNode);\n pageOfListNodes = request => this.client.fetch({\n method: 'GET',\n path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/nodes`,\n urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['pool_id', request.poolId], ['status', request.status ?? 'unknown'])\n }, unmarshalListNodesResponse);\n\n /**\n * List Nodes in a Cluster. List all the existing nodes for a specific\n * Kubernetes cluster.\n *\n * @param request - The request {@link ListNodesRequest}\n * @returns A Promise of ListNodesResponse\n */\n listNodes = request => enrichForPagination('nodes', this.pageOfListNodes, request);\n\n /**\n * Get a Node in a Cluster. Retrieve details about a specific Kubernetes Node.\n *\n * @param request - The request {@link GetNodeRequest}\n * @returns A Promise of Node\n */\n getNode = request => this.client.fetch({\n method: 'GET',\n path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/nodes/${validatePathParam('nodeId', request.nodeId)}`\n }, unmarshalNode);\n\n /**\n * Waits for {@link Node} to be in a final state.\n *\n * @param request - The request {@link GetNodeRequest}\n * @param options - The waiting options\n * @returns A Promise of Node\n */\n waitForNode = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!NODE_TRANSIENT_STATUSES.includes(res.status))), this.getNode, request, options);\n\n /**\n * Replace a Node in a Cluster. Replace a specific Node. The node will first\n * be cordoned (scheduling will be disabled on it). The existing pods on the\n * node will then be drained and rescheduled onto another schedulable node.\n * Note that when there is not enough space to reschedule all the pods (such\n * as in a one-node cluster), disruption of your applications can be\n * expected.\n *\n * @deprecated\n * @param request - The request {@link ReplaceNodeRequest}\n * @returns A Promise of Node\n */\n replaceNode = request => this.client.fetch({\n body: '{}',\n headers: jsonContentHeaders$d,\n method: 'POST',\n path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/nodes/${validatePathParam('nodeId', request.nodeId)}/replace`\n }, unmarshalNode);\n\n /**\n * Reboot a Node in a Cluster. Reboot a specific Node. The node will first be\n * cordoned (scheduling will be disabled on it). The existing pods on the node\n * will then be drained and rescheduled onto another schedulable node. Note\n * that when there is not enough space to reschedule all the pods (such as in\n * a one-node cluster), disruption of your applications can be expected.\n *\n * @param request - The request {@link RebootNodeRequest}\n * @returns A Promise of Node\n */\n rebootNode = request => this.client.fetch({\n body: '{}',\n headers: jsonContentHeaders$d,\n method: 'POST',\n path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/nodes/${validatePathParam('nodeId', request.nodeId)}/reboot`\n }, unmarshalNode);\n\n /**\n * Delete a Node in a Cluster. Delete a specific Node. Note that when there is\n * not enough space to reschedule all the pods (such as in a one-node\n * cluster), disruption of your applications can be expected.\n *\n * @param request - The request {@link DeleteNodeRequest}\n * @returns A Promise of Node\n */\n deleteNode = request => this.client.fetch({\n method: 'DELETE',\n path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/nodes/${validatePathParam('nodeId', request.nodeId)}`,\n urlParams: urlParams(['replace', request.replace], ['skip_drain', request.skipDrain])\n }, unmarshalNode);\n\n /**\n * List all available Versions. List all available versions for the creation\n * of a new Kubernetes cluster.\n *\n * @param request - The request {@link ListVersionsRequest}\n * @returns A Promise of ListVersionsResponse\n */\n listVersions = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/versions`\n }, unmarshalListVersionsResponse$2);\n\n /**\n * Get a Version. Retrieve a specific Kubernetes version and its details.\n *\n * @param request - The request {@link GetVersionRequest}\n * @returns A Promise of Version\n */\n getVersion = request => this.client.fetch({\n method: 'GET',\n path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/versions/${validatePathParam('versionName', request.versionName)}`\n }, unmarshalVersion$2);\n pageOfListClusterTypes = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/cluster-types`,\n urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])\n }, unmarshalListClusterTypesResponse);\n\n /**\n * List cluster types. List available cluster types and their technical\n * details.\n *\n * @param request - The request {@link ListClusterTypesRequest}\n * @returns A Promise of ListClusterTypesResponse\n */\n listClusterTypes = (request = {}) => enrichForPagination('clusterTypes', this.pageOfListClusterTypes, request);\n};\n\nclass K8SUtilsAPI extends API$e {\n /**\n * Get configuration of a kube cluster.\n *\n * @param request - The request {@link GetClusterKubeConfigRequest}\n * @returns A Promise of Blob\n */\n getClusterKubeConfig = request => this._getClusterKubeConfig(request);\n}\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\nconst CreateClusterRequest = {\n name: {\n minLength: 1\n }\n};\nconst CreateClusterRequestAutoscalerConfig = {\n scaleDownUtilizationThreshold: {\n greaterThan: 0,\n lessThan: 1\n }\n};\nconst CreateClusterRequestOpenIDConnectConfig = {\n clientId: {\n minLength: 1\n },\n groupsPrefix: {\n minLength: 1\n },\n usernameClaim: {\n minLength: 1\n },\n usernamePrefix: {\n minLength: 1\n }\n};\nconst CreateClusterRequestPoolConfig = {\n name: {\n minLength: 1\n }\n};\nconst CreatePoolRequest = {\n name: {\n minLength: 1\n }\n};\nconst ListClusterTypesRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nconst ListClustersRequest = {\n name: {\n minLength: 1\n },\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nconst ListNodesRequest = {\n name: {\n minLength: 1\n },\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nconst ListPoolsRequest = {\n name: {\n minLength: 1\n },\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nconst MaintenanceWindow = {\n startHour: {\n lessThanOrEqual: 23\n }\n};\nconst UpdateClusterRequest = {\n name: {\n minLength: 1\n }\n};\nconst UpdateClusterRequestAutoscalerConfig = {\n scaleDownUtilizationThreshold: {\n greaterThan: 0,\n lessThan: 1\n }\n};\n\nvar validationRules_gen$3 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n CreateClusterRequest: CreateClusterRequest,\n CreateClusterRequestAutoscalerConfig: CreateClusterRequestAutoscalerConfig,\n CreateClusterRequestOpenIDConnectConfig: CreateClusterRequestOpenIDConnectConfig,\n CreateClusterRequestPoolConfig: CreateClusterRequestPoolConfig,\n CreatePoolRequest: CreatePoolRequest,\n ListClusterTypesRequest: ListClusterTypesRequest,\n ListClustersRequest: ListClustersRequest,\n ListNodesRequest: ListNodesRequest,\n ListPoolsRequest: ListPoolsRequest,\n MaintenanceWindow: MaintenanceWindow,\n UpdateClusterRequest: UpdateClusterRequest,\n UpdateClusterRequestAutoscalerConfig: UpdateClusterRequestAutoscalerConfig\n});\n\nvar index$e = /*#__PURE__*/Object.freeze({\n __proto__: null,\n API: K8SUtilsAPI,\n CLUSTER_TRANSIENT_STATUSES: CLUSTER_TRANSIENT_STATUSES$1,\n NODE_TRANSIENT_STATUSES: NODE_TRANSIENT_STATUSES,\n POOL_TRANSIENT_STATUSES: POOL_TRANSIENT_STATUSES,\n ValidationRules: validationRules_gen$3\n});\n\nvar index$d = /*#__PURE__*/Object.freeze({\n __proto__: null,\n v1: index$e\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\n/** Lists transient statutes of the enum {@link CertificateStatus}. */\nconst CERTIFICATE_TRANSIENT_STATUSES = ['pending'];\n\n/** Lists transient statutes of the enum {@link InstanceStatus}. */\nconst INSTANCE_TRANSIENT_STATUSES$1 = ['pending', 'migrating'];\n\n/** Lists transient statutes of the enum {@link LbStatus}. */\nconst LB_TRANSIENT_STATUSES = ['pending', 'migrating', 'to_create', 'creating', 'to_delete', 'deleting'];\n\n/** Lists transient statutes of the enum {@link PrivateNetworkStatus}. */\nconst PRIVATE_NETWORK_TRANSIENT_STATUSES = ['pending'];\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst unmarshalSubscriberEmailConfig = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'SubscriberEmailConfig' failed as data isn't a dictionary.`);\n }\n return {\n email: data.email\n };\n};\nconst unmarshalSubscriberWebhookConfig = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'SubscriberWebhookConfig' failed as data isn't a dictionary.`);\n }\n return {\n uri: data.uri\n };\n};\nconst unmarshalHealthCheckHttpConfig = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'HealthCheckHttpConfig' failed as data isn't a dictionary.`);\n }\n return {\n code: data.code,\n hostHeader: data.host_header,\n method: data.method,\n uri: data.uri\n };\n};\nconst unmarshalHealthCheckHttpsConfig = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'HealthCheckHttpsConfig' failed as data isn't a dictionary.`);\n }\n return {\n code: data.code,\n hostHeader: data.host_header,\n method: data.method,\n sni: data.sni,\n uri: data.uri\n };\n};\nconst unmarshalHealthCheckLdapConfig = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'HealthCheckLdapConfig' failed as data isn't a dictionary.`);\n }\n return {};\n};\nconst unmarshalHealthCheckMysqlConfig = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'HealthCheckMysqlConfig' failed as data isn't a dictionary.`);\n }\n return {\n user: data.user\n };\n};\nconst unmarshalHealthCheckPgsqlConfig = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'HealthCheckPgsqlConfig' failed as data isn't a dictionary.`);\n }\n return {\n user: data.user\n };\n};\nconst unmarshalHealthCheckRedisConfig = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'HealthCheckRedisConfig' failed as data isn't a dictionary.`);\n }\n return {};\n};\nconst unmarshalHealthCheckTcpConfig = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'HealthCheckTcpConfig' failed as data isn't a dictionary.`);\n }\n return {};\n};\nconst unmarshalInstance$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Instance' failed as data isn't a dictionary.`);\n }\n return {\n createdAt: unmarshalDate(data.created_at),\n id: data.id,\n ipAddress: data.ip_address,\n region: data.region,\n status: data.status,\n updatedAt: unmarshalDate(data.updated_at),\n zone: data.zone\n };\n};\nconst unmarshalIp = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Ip' failed as data isn't a dictionary.`);\n }\n return {\n id: data.id,\n ipAddress: data.ip_address,\n lbId: data.lb_id,\n organizationId: data.organization_id,\n projectId: data.project_id,\n region: data.region,\n reverse: data.reverse,\n zone: data.zone\n };\n};\nconst unmarshalSubscriber = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Subscriber' failed as data isn't a dictionary.`);\n }\n return {\n emailConfig: data.email_config ? unmarshalSubscriberEmailConfig(data.email_config) : undefined,\n id: data.id,\n name: data.name,\n webhookConfig: data.webhook_config ? unmarshalSubscriberWebhookConfig(data.webhook_config) : undefined\n };\n};\nconst unmarshalHealthCheck = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'HealthCheck' failed as data isn't a dictionary.`);\n }\n return {\n checkDelay: data.check_delay,\n checkMaxRetries: data.check_max_retries,\n checkSendProxy: data.check_send_proxy,\n checkTimeout: data.check_timeout,\n httpConfig: data.http_config ? unmarshalHealthCheckHttpConfig(data.http_config) : undefined,\n httpsConfig: data.https_config ? unmarshalHealthCheckHttpsConfig(data.https_config) : undefined,\n ldapConfig: data.ldap_config ? unmarshalHealthCheckLdapConfig(data.ldap_config) : undefined,\n mysqlConfig: data.mysql_config ? unmarshalHealthCheckMysqlConfig(data.mysql_config) : undefined,\n pgsqlConfig: data.pgsql_config ? unmarshalHealthCheckPgsqlConfig(data.pgsql_config) : undefined,\n port: data.port,\n redisConfig: data.redis_config ? unmarshalHealthCheckRedisConfig(data.redis_config) : undefined,\n tcpConfig: data.tcp_config ? unmarshalHealthCheckTcpConfig(data.tcp_config) : undefined,\n transientCheckDelay: data.transient_check_delay\n };\n};\nconst unmarshalLb = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Lb' failed as data isn't a dictionary.`);\n }\n return {\n backendCount: data.backend_count,\n createdAt: unmarshalDate(data.created_at),\n description: data.description,\n frontendCount: data.frontend_count,\n id: data.id,\n instances: unmarshalArrayOfObject(data.instances, unmarshalInstance$1),\n ip: unmarshalArrayOfObject(data.ip, unmarshalIp),\n name: data.name,\n organizationId: data.organization_id,\n privateNetworkCount: data.private_network_count,\n projectId: data.project_id,\n region: data.region,\n routeCount: data.route_count,\n sslCompatibilityLevel: data.ssl_compatibility_level,\n status: data.status,\n subscriber: data.subscriber ? unmarshalSubscriber(data.subscriber) : undefined,\n tags: data.tags,\n type: data.type,\n updatedAt: unmarshalDate(data.updated_at),\n zone: data.zone\n };\n};\nconst unmarshalAclActionRedirect = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'AclActionRedirect' failed as data isn't a dictionary.`);\n }\n return {\n code: data.code,\n target: data.target,\n type: data.type\n };\n};\nconst unmarshalBackend = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Backend' failed as data isn't a dictionary.`);\n }\n return {\n createdAt: unmarshalDate(data.created_at),\n failoverHost: data.failover_host,\n forwardPort: data.forward_port,\n forwardPortAlgorithm: data.forward_port_algorithm,\n forwardProtocol: data.forward_protocol,\n healthCheck: data.health_check ? unmarshalHealthCheck(data.health_check) : undefined,\n id: data.id,\n ignoreSslServerVerify: data.ignore_ssl_server_verify,\n lb: data.lb ? unmarshalLb(data.lb) : undefined,\n maxConnections: data.max_connections,\n maxRetries: data.max_retries,\n name: data.name,\n onMarkedDownAction: data.on_marked_down_action,\n pool: data.pool,\n proxyProtocol: data.proxy_protocol,\n redispatchAttemptCount: data.redispatch_attempt_count,\n sendProxyV2: data.send_proxy_v2,\n sslBridging: data.ssl_bridging,\n stickySessions: data.sticky_sessions,\n stickySessionsCookieName: data.sticky_sessions_cookie_name,\n timeoutConnect: data.timeout_connect,\n timeoutQueue: data.timeout_queue,\n timeoutServer: data.timeout_server,\n timeoutTunnel: data.timeout_tunnel,\n updatedAt: unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalCertificate = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Certificate' failed as data isn't a dictionary.`);\n }\n return {\n commonName: data.common_name,\n createdAt: unmarshalDate(data.created_at),\n fingerprint: data.fingerprint,\n id: data.id,\n lb: data.lb ? unmarshalLb(data.lb) : undefined,\n name: data.name,\n notValidAfter: unmarshalDate(data.not_valid_after),\n notValidBefore: unmarshalDate(data.not_valid_before),\n status: data.status,\n statusDetails: data.status_details,\n subjectAlternativeName: data.subject_alternative_name,\n type: data.type,\n updatedAt: unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalAclAction = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'AclAction' failed as data isn't a dictionary.`);\n }\n return {\n redirect: data.redirect ? unmarshalAclActionRedirect(data.redirect) : undefined,\n type: data.type\n };\n};\nconst unmarshalAclMatch = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'AclMatch' failed as data isn't a dictionary.`);\n }\n return {\n httpFilter: data.http_filter,\n httpFilterOption: data.http_filter_option,\n httpFilterValue: data.http_filter_value,\n invert: data.invert,\n ipSubnet: data.ip_subnet\n };\n};\nconst unmarshalFrontend = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Frontend' failed as data isn't a dictionary.`);\n }\n return {\n backend: data.backend ? unmarshalBackend(data.backend) : undefined,\n certificate: data.certificate ? unmarshalCertificate(data.certificate) : undefined,\n certificateIds: data.certificate_ids,\n createdAt: unmarshalDate(data.created_at),\n enableHttp3: data.enable_http3,\n id: data.id,\n inboundPort: data.inbound_port,\n lb: data.lb ? unmarshalLb(data.lb) : undefined,\n name: data.name,\n timeoutClient: data.timeout_client,\n updatedAt: unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalPrivateNetworkDHCPConfig = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'PrivateNetworkDHCPConfig' failed as data isn't a dictionary.`);\n }\n return {\n ipId: data.ip_id\n };\n};\nconst unmarshalPrivateNetworkIpamConfig = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'PrivateNetworkIpamConfig' failed as data isn't a dictionary.`);\n }\n return {};\n};\nconst unmarshalPrivateNetworkStaticConfig = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'PrivateNetworkStaticConfig' failed as data isn't a dictionary.`);\n }\n return {\n ipAddress: data.ip_address\n };\n};\nconst unmarshalRouteMatch = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'RouteMatch' failed as data isn't a dictionary.`);\n }\n return {\n hostHeader: data.host_header,\n sni: data.sni\n };\n};\nconst unmarshalAcl = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Acl' failed as data isn't a dictionary.`);\n }\n return {\n action: data.action ? unmarshalAclAction(data.action) : undefined,\n createdAt: unmarshalDate(data.created_at),\n description: data.description,\n frontend: data.frontend ? unmarshalFrontend(data.frontend) : undefined,\n id: data.id,\n index: data.index,\n match: data.match ? unmarshalAclMatch(data.match) : undefined,\n name: data.name,\n updatedAt: unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalBackendServerStats = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'BackendServerStats' failed as data isn't a dictionary.`);\n }\n return {\n backendId: data.backend_id,\n instanceId: data.instance_id,\n ip: data.ip,\n lastHealthCheckStatus: data.last_health_check_status,\n serverState: data.server_state,\n serverStateChangedAt: unmarshalDate(data.server_state_changed_at)\n };\n};\nconst unmarshalLbType = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'LbType' failed as data isn't a dictionary.`);\n }\n return {\n description: data.description,\n name: data.name,\n region: data.region,\n stockStatus: data.stock_status,\n zone: data.zone\n };\n};\nconst unmarshalPrivateNetwork$3 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'PrivateNetwork' failed as data isn't a dictionary.`);\n }\n return {\n createdAt: unmarshalDate(data.created_at),\n dhcpConfig: data.dhcp_config ? unmarshalPrivateNetworkDHCPConfig(data.dhcp_config) : undefined,\n ipamConfig: data.ipam_config ? unmarshalPrivateNetworkIpamConfig(data.ipam_config) : undefined,\n ipamIds: data.ipam_ids,\n lb: data.lb ? unmarshalLb(data.lb) : undefined,\n privateNetworkId: data.private_network_id,\n staticConfig: data.static_config ? unmarshalPrivateNetworkStaticConfig(data.static_config) : undefined,\n status: data.status,\n updatedAt: unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalRoute = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Route' failed as data isn't a dictionary.`);\n }\n return {\n backendId: data.backend_id,\n createdAt: unmarshalDate(data.created_at),\n frontendId: data.frontend_id,\n id: data.id,\n match: data.match ? unmarshalRouteMatch(data.match) : undefined,\n updatedAt: unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalLbStats = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'LbStats' failed as data isn't a dictionary.`);\n }\n return {\n backendServersStats: unmarshalArrayOfObject(data.backend_servers_stats, unmarshalBackendServerStats)\n };\n};\nconst unmarshalListAclResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListAclResponse' failed as data isn't a dictionary.`);\n }\n return {\n acls: unmarshalArrayOfObject(data.acls, unmarshalAcl),\n totalCount: data.total_count\n };\n};\nconst unmarshalListBackendStatsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListBackendStatsResponse' failed as data isn't a dictionary.`);\n }\n return {\n backendServersStats: unmarshalArrayOfObject(data.backend_servers_stats, unmarshalBackendServerStats),\n totalCount: data.total_count\n };\n};\nconst unmarshalListBackendsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListBackendsResponse' failed as data isn't a dictionary.`);\n }\n return {\n backends: unmarshalArrayOfObject(data.backends, unmarshalBackend),\n totalCount: data.total_count\n };\n};\nconst unmarshalListCertificatesResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListCertificatesResponse' failed as data isn't a dictionary.`);\n }\n return {\n certificates: unmarshalArrayOfObject(data.certificates, unmarshalCertificate),\n totalCount: data.total_count\n };\n};\nconst unmarshalListFrontendsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListFrontendsResponse' failed as data isn't a dictionary.`);\n }\n return {\n frontends: unmarshalArrayOfObject(data.frontends, unmarshalFrontend),\n totalCount: data.total_count\n };\n};\nconst unmarshalListIpsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListIpsResponse' failed as data isn't a dictionary.`);\n }\n return {\n ips: unmarshalArrayOfObject(data.ips, unmarshalIp),\n totalCount: data.total_count\n };\n};\nconst unmarshalListLbPrivateNetworksResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListLbPrivateNetworksResponse' failed as data isn't a dictionary.`);\n }\n return {\n privateNetwork: unmarshalArrayOfObject(data.private_network, unmarshalPrivateNetwork$3),\n totalCount: data.total_count\n };\n};\nconst unmarshalListLbTypesResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListLbTypesResponse' failed as data isn't a dictionary.`);\n }\n return {\n lbTypes: unmarshalArrayOfObject(data.lb_types, unmarshalLbType),\n totalCount: data.total_count\n };\n};\nconst unmarshalListLbsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListLbsResponse' failed as data isn't a dictionary.`);\n }\n return {\n lbs: unmarshalArrayOfObject(data.lbs, unmarshalLb),\n totalCount: data.total_count\n };\n};\nconst unmarshalListRoutesResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListRoutesResponse' failed as data isn't a dictionary.`);\n }\n return {\n routes: unmarshalArrayOfObject(data.routes, unmarshalRoute),\n totalCount: data.total_count\n };\n};\nconst unmarshalListSubscriberResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListSubscriberResponse' failed as data isn't a dictionary.`);\n }\n return {\n subscribers: unmarshalArrayOfObject(data.subscribers, unmarshalSubscriber),\n totalCount: data.total_count\n };\n};\nconst unmarshalSetAclsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'SetAclsResponse' failed as data isn't a dictionary.`);\n }\n return {\n acls: unmarshalArrayOfObject(data.acls, unmarshalAcl),\n totalCount: data.total_count\n };\n};\nconst marshalAclActionRedirect = (request, defaults) => ({\n code: request.code,\n target: request.target,\n type: request.type\n});\nconst marshalAclAction = (request, defaults) => ({\n redirect: request.redirect ? marshalAclActionRedirect(request.redirect) : undefined,\n type: request.type\n});\nconst marshalAclMatch = (request, defaults) => ({\n http_filter: request.httpFilter,\n http_filter_option: request.httpFilterOption,\n http_filter_value: request.httpFilterValue,\n invert: request.invert,\n ip_subnet: request.ipSubnet\n});\nconst marshalHealthCheckHttpConfig = (request, defaults) => ({\n code: request.code,\n host_header: request.hostHeader,\n method: request.method,\n uri: request.uri\n});\nconst marshalHealthCheckHttpsConfig = (request, defaults) => ({\n code: request.code,\n host_header: request.hostHeader,\n method: request.method,\n sni: request.sni,\n uri: request.uri\n});\nconst marshalHealthCheckLdapConfig = (request, defaults) => ({});\nconst marshalHealthCheckMysqlConfig = (request, defaults) => ({\n user: request.user\n});\nconst marshalHealthCheckPgsqlConfig = (request, defaults) => ({\n user: request.user\n});\nconst marshalHealthCheckRedisConfig = (request, defaults) => ({});\nconst marshalHealthCheckTcpConfig = (request, defaults) => ({});\nconst marshalAclSpec = (request, defaults) => ({\n action: marshalAclAction(request.action),\n description: request.description,\n index: request.index,\n match: request.match ? marshalAclMatch(request.match) : undefined,\n name: request.name\n});\nconst marshalCreateCertificateRequestCustomCertificate = (request, defaults) => ({\n certificate_chain: request.certificateChain\n});\nconst marshalCreateCertificateRequestLetsencryptConfig = (request, defaults) => ({\n common_name: request.commonName,\n subject_alternative_name: request.subjectAlternativeName\n});\nconst marshalHealthCheck = (request, defaults) => ({\n check_delay: request.checkDelay,\n check_max_retries: request.checkMaxRetries,\n check_send_proxy: request.checkSendProxy,\n check_timeout: request.checkTimeout,\n port: request.port,\n transient_check_delay: request.transientCheckDelay,\n ...resolveOneOf([{\n param: 'tcp_config',\n value: request.tcpConfig ? marshalHealthCheckTcpConfig(request.tcpConfig) : undefined\n }, {\n param: 'mysql_config',\n value: request.mysqlConfig ? marshalHealthCheckMysqlConfig(request.mysqlConfig) : undefined\n }, {\n param: 'pgsql_config',\n value: request.pgsqlConfig ? marshalHealthCheckPgsqlConfig(request.pgsqlConfig) : undefined\n }, {\n param: 'ldap_config',\n value: request.ldapConfig ? marshalHealthCheckLdapConfig(request.ldapConfig) : undefined\n }, {\n param: 'redis_config',\n value: request.redisConfig ? marshalHealthCheckRedisConfig(request.redisConfig) : undefined\n }, {\n param: 'http_config',\n value: request.httpConfig ? marshalHealthCheckHttpConfig(request.httpConfig) : undefined\n }, {\n param: 'https_config',\n value: request.httpsConfig ? marshalHealthCheckHttpsConfig(request.httpsConfig) : undefined\n }])\n});\nconst marshalPrivateNetworkDHCPConfig = (request, defaults) => ({\n ip_id: request.ipId\n});\nconst marshalPrivateNetworkIpamConfig = (request, defaults) => ({});\nconst marshalPrivateNetworkStaticConfig = (request, defaults) => ({\n ip_address: request.ipAddress\n});\nconst marshalRouteMatch = (request, defaults) => ({\n ...resolveOneOf([{\n param: 'sni',\n value: request.sni\n }, {\n param: 'host_header',\n value: request.hostHeader\n }])\n});\nconst marshalSubscriberEmailConfig = (request, defaults) => ({\n email: request.email\n});\nconst marshalSubscriberWebhookConfig = (request, defaults) => ({\n uri: request.uri\n});\nconst marshalAddBackendServersRequest = (request, defaults) => ({\n server_ip: request.serverIp\n});\nconst marshalAttachPrivateNetworkRequest = (request, defaults) => ({\n ...resolveOneOf([{\n param: 'static_config',\n value: request.staticConfig ? marshalPrivateNetworkStaticConfig(request.staticConfig) : undefined\n }, {\n param: 'dhcp_config',\n value: request.dhcpConfig ? marshalPrivateNetworkDHCPConfig(request.dhcpConfig) : undefined\n }, {\n param: 'ipam_config',\n value: request.ipamConfig ? marshalPrivateNetworkIpamConfig(request.ipamConfig) : undefined\n }])\n});\nconst marshalCreateAclRequest = (request, defaults) => ({\n action: marshalAclAction(request.action),\n description: request.description,\n index: request.index,\n match: request.match ? marshalAclMatch(request.match) : undefined,\n name: request.name || randomName('acl')\n});\nconst marshalCreateBackendRequest = (request, defaults) => ({\n failover_host: request.failoverHost,\n forward_port: request.forwardPort,\n forward_port_algorithm: request.forwardPortAlgorithm,\n forward_protocol: request.forwardProtocol,\n health_check: marshalHealthCheck(request.healthCheck),\n ignore_ssl_server_verify: request.ignoreSslServerVerify,\n max_connections: request.maxConnections,\n max_retries: request.maxRetries,\n name: request.name || randomName('lbb'),\n on_marked_down_action: request.onMarkedDownAction ?? 'on_marked_down_action_none',\n proxy_protocol: request.proxyProtocol ?? 'proxy_protocol_unknown',\n redispatch_attempt_count: request.redispatchAttemptCount,\n send_proxy_v2: request.sendProxyV2,\n server_ip: request.serverIp,\n ssl_bridging: request.sslBridging,\n sticky_sessions: request.stickySessions,\n sticky_sessions_cookie_name: request.stickySessionsCookieName,\n timeout_connect: request.timeoutConnect,\n timeout_queue: request.timeoutQueue,\n timeout_server: request.timeoutServer,\n timeout_tunnel: request.timeoutTunnel\n});\nconst marshalCreateCertificateRequest = (request, defaults) => ({\n name: request.name || randomName('certificate'),\n ...resolveOneOf([{\n param: 'letsencrypt',\n value: request.letsencrypt ? marshalCreateCertificateRequestLetsencryptConfig(request.letsencrypt) : undefined\n }, {\n param: 'custom_certificate',\n value: request.customCertificate ? marshalCreateCertificateRequestCustomCertificate(request.customCertificate) : undefined\n }], true)\n});\nconst marshalCreateFrontendRequest = (request, defaults) => ({\n backend_id: request.backendId,\n certificate_id: request.certificateId,\n certificate_ids: request.certificateIds,\n enable_http3: request.enableHttp3,\n inbound_port: request.inboundPort,\n name: request.name || randomName('lbf'),\n timeout_client: request.timeoutClient\n});\nconst marshalCreateIpRequest = (request, defaults) => ({\n reverse: request.reverse,\n ...resolveOneOf([{\n default: defaults.defaultProjectId,\n param: 'project_id',\n value: request.projectId\n }, {\n default: defaults.defaultOrganizationId,\n param: 'organization_id',\n value: request.organizationId\n }])\n});\nconst marshalCreateLbRequest = (request, defaults) => ({\n assign_flexible_ip: request.assignFlexibleIp,\n description: request.description,\n ip_id: request.ipId,\n name: request.name || randomName('lb'),\n ssl_compatibility_level: request.sslCompatibilityLevel ?? 'ssl_compatibility_level_unknown',\n tags: request.tags,\n type: request.type,\n ...resolveOneOf([{\n default: defaults.defaultProjectId,\n param: 'project_id',\n value: request.projectId\n }, {\n default: defaults.defaultOrganizationId,\n param: 'organization_id',\n value: request.organizationId\n }])\n});\nconst marshalCreateRouteRequest = (request, defaults) => ({\n backend_id: request.backendId,\n frontend_id: request.frontendId,\n match: request.match ? marshalRouteMatch(request.match) : undefined\n});\nconst marshalCreateSubscriberRequest = (request, defaults) => ({\n name: request.name,\n ...resolveOneOf([{\n default: defaults.defaultProjectId,\n param: 'project_id',\n value: request.projectId\n }, {\n default: defaults.defaultOrganizationId,\n param: 'organization_id',\n value: request.organizationId\n }]),\n ...resolveOneOf([{\n param: 'email_config',\n value: request.emailConfig ? marshalSubscriberEmailConfig(request.emailConfig) : undefined\n }, {\n param: 'webhook_config',\n value: request.webhookConfig ? marshalSubscriberWebhookConfig(request.webhookConfig) : undefined\n }])\n});\nconst marshalMigrateLbRequest = (request, defaults) => ({\n type: request.type\n});\nconst marshalRemoveBackendServersRequest = (request, defaults) => ({\n server_ip: request.serverIp\n});\nconst marshalSetBackendServersRequest = (request, defaults) => ({\n server_ip: request.serverIp\n});\nconst marshalSubscribeToLbRequest = (request, defaults) => ({\n subscriber_id: request.subscriberId\n});\nconst marshalUpdateAclRequest = (request, defaults) => ({\n action: marshalAclAction(request.action),\n description: request.description,\n index: request.index,\n match: request.match ? marshalAclMatch(request.match) : undefined,\n name: request.name\n});\nconst marshalUpdateBackendRequest = (request, defaults) => ({\n failover_host: request.failoverHost,\n forward_port: request.forwardPort,\n forward_port_algorithm: request.forwardPortAlgorithm,\n forward_protocol: request.forwardProtocol,\n ignore_ssl_server_verify: request.ignoreSslServerVerify,\n max_connections: request.maxConnections,\n max_retries: request.maxRetries,\n name: request.name,\n on_marked_down_action: request.onMarkedDownAction ?? 'on_marked_down_action_none',\n proxy_protocol: request.proxyProtocol ?? 'proxy_protocol_unknown',\n redispatch_attempt_count: request.redispatchAttemptCount,\n send_proxy_v2: request.sendProxyV2,\n ssl_bridging: request.sslBridging,\n sticky_sessions: request.stickySessions,\n sticky_sessions_cookie_name: request.stickySessionsCookieName,\n timeout_connect: request.timeoutConnect,\n timeout_queue: request.timeoutQueue,\n timeout_server: request.timeoutServer,\n timeout_tunnel: request.timeoutTunnel\n});\nconst marshalUpdateCertificateRequest = (request, defaults) => ({\n name: request.name\n});\nconst marshalUpdateFrontendRequest = (request, defaults) => ({\n backend_id: request.backendId,\n certificate_id: request.certificateId,\n certificate_ids: request.certificateIds,\n enable_http3: request.enableHttp3,\n inbound_port: request.inboundPort,\n name: request.name,\n timeout_client: request.timeoutClient\n});\nconst marshalUpdateHealthCheckRequest = (request, defaults) => ({\n check_delay: request.checkDelay,\n check_max_retries: request.checkMaxRetries,\n check_send_proxy: request.checkSendProxy,\n check_timeout: request.checkTimeout,\n port: request.port,\n transient_check_delay: request.transientCheckDelay,\n ...resolveOneOf([{\n param: 'tcp_config',\n value: request.tcpConfig ? marshalHealthCheckTcpConfig(request.tcpConfig) : undefined\n }, {\n param: 'mysql_config',\n value: request.mysqlConfig ? marshalHealthCheckMysqlConfig(request.mysqlConfig) : undefined\n }, {\n param: 'pgsql_config',\n value: request.pgsqlConfig ? marshalHealthCheckPgsqlConfig(request.pgsqlConfig) : undefined\n }, {\n param: 'ldap_config',\n value: request.ldapConfig ? marshalHealthCheckLdapConfig(request.ldapConfig) : undefined\n }, {\n param: 'redis_config',\n value: request.redisConfig ? marshalHealthCheckRedisConfig(request.redisConfig) : undefined\n }, {\n param: 'http_config',\n value: request.httpConfig ? marshalHealthCheckHttpConfig(request.httpConfig) : undefined\n }, {\n param: 'https_config',\n value: request.httpsConfig ? marshalHealthCheckHttpsConfig(request.httpsConfig) : undefined\n }])\n});\nconst marshalUpdateIpRequest = (request, defaults) => ({\n reverse: request.reverse\n});\nconst marshalUpdateLbRequest = (request, defaults) => ({\n description: request.description,\n name: request.name,\n ssl_compatibility_level: request.sslCompatibilityLevel ?? 'ssl_compatibility_level_unknown',\n tags: request.tags\n});\nconst marshalUpdateRouteRequest = (request, defaults) => ({\n backend_id: request.backendId,\n match: request.match ? marshalRouteMatch(request.match) : undefined\n});\nconst marshalUpdateSubscriberRequest = (request, defaults) => ({\n name: request.name,\n ...resolveOneOf([{\n param: 'email_config',\n value: request.emailConfig ? marshalSubscriberEmailConfig(request.emailConfig) : undefined\n }, {\n param: 'webhook_config',\n value: request.webhookConfig ? marshalSubscriberWebhookConfig(request.webhookConfig) : undefined\n }])\n});\nconst marshalZonedApiAddBackendServersRequest = (request, defaults) => ({\n server_ip: request.serverIp\n});\nconst marshalZonedApiAttachPrivateNetworkRequest = (request, defaults) => ({\n ...resolveOneOf([{\n param: 'static_config',\n value: request.staticConfig ? marshalPrivateNetworkStaticConfig(request.staticConfig) : undefined\n }, {\n param: 'dhcp_config',\n value: request.dhcpConfig ? marshalPrivateNetworkDHCPConfig(request.dhcpConfig) : undefined\n }, {\n param: 'ipam_config',\n value: request.ipamConfig ? marshalPrivateNetworkIpamConfig(request.ipamConfig) : undefined\n }])\n});\nconst marshalZonedApiCreateAclRequest = (request, defaults) => ({\n action: marshalAclAction(request.action),\n description: request.description,\n index: request.index,\n match: request.match ? marshalAclMatch(request.match) : undefined,\n name: request.name || randomName('acl')\n});\nconst marshalZonedApiCreateBackendRequest = (request, defaults) => ({\n failover_host: request.failoverHost,\n forward_port: request.forwardPort,\n forward_port_algorithm: request.forwardPortAlgorithm,\n forward_protocol: request.forwardProtocol,\n health_check: marshalHealthCheck(request.healthCheck),\n ignore_ssl_server_verify: request.ignoreSslServerVerify,\n max_connections: request.maxConnections,\n max_retries: request.maxRetries,\n name: request.name || randomName('lbb'),\n on_marked_down_action: request.onMarkedDownAction ?? 'on_marked_down_action_none',\n proxy_protocol: request.proxyProtocol ?? 'proxy_protocol_unknown',\n redispatch_attempt_count: request.redispatchAttemptCount,\n send_proxy_v2: request.sendProxyV2,\n server_ip: request.serverIp,\n ssl_bridging: request.sslBridging,\n sticky_sessions: request.stickySessions,\n sticky_sessions_cookie_name: request.stickySessionsCookieName,\n timeout_connect: request.timeoutConnect,\n timeout_queue: request.timeoutQueue,\n timeout_server: request.timeoutServer,\n timeout_tunnel: request.timeoutTunnel\n});\nconst marshalZonedApiCreateCertificateRequest = (request, defaults) => ({\n name: request.name || randomName('certificate'),\n ...resolveOneOf([{\n param: 'letsencrypt',\n value: request.letsencrypt ? marshalCreateCertificateRequestLetsencryptConfig(request.letsencrypt) : undefined\n }, {\n param: 'custom_certificate',\n value: request.customCertificate ? marshalCreateCertificateRequestCustomCertificate(request.customCertificate) : undefined\n }], true)\n});\nconst marshalZonedApiCreateFrontendRequest = (request, defaults) => ({\n backend_id: request.backendId,\n certificate_id: request.certificateId,\n certificate_ids: request.certificateIds,\n enable_http3: request.enableHttp3,\n inbound_port: request.inboundPort,\n name: request.name || randomName('lbf'),\n timeout_client: request.timeoutClient\n});\nconst marshalZonedApiCreateIpRequest = (request, defaults) => ({\n reverse: request.reverse,\n ...resolveOneOf([{\n default: defaults.defaultProjectId,\n param: 'project_id',\n value: request.projectId\n }, {\n default: defaults.defaultOrganizationId,\n param: 'organization_id',\n value: request.organizationId\n }])\n});\nconst marshalZonedApiCreateLbRequest = (request, defaults) => ({\n assign_flexible_ip: request.assignFlexibleIp,\n description: request.description,\n ip_id: request.ipId,\n name: request.name || randomName('lb'),\n ssl_compatibility_level: request.sslCompatibilityLevel ?? 'ssl_compatibility_level_unknown',\n tags: request.tags,\n type: request.type,\n ...resolveOneOf([{\n default: defaults.defaultProjectId,\n param: 'project_id',\n value: request.projectId\n }, {\n default: defaults.defaultOrganizationId,\n param: 'organization_id',\n value: request.organizationId\n }])\n});\nconst marshalZonedApiCreateRouteRequest = (request, defaults) => ({\n backend_id: request.backendId,\n frontend_id: request.frontendId,\n match: request.match ? marshalRouteMatch(request.match) : undefined\n});\nconst marshalZonedApiCreateSubscriberRequest = (request, defaults) => ({\n name: request.name,\n ...resolveOneOf([{\n default: defaults.defaultProjectId,\n param: 'project_id',\n value: request.projectId\n }, {\n default: defaults.defaultOrganizationId,\n param: 'organization_id',\n value: request.organizationId\n }]),\n ...resolveOneOf([{\n param: 'email_config',\n value: request.emailConfig ? marshalSubscriberEmailConfig(request.emailConfig) : undefined\n }, {\n param: 'webhook_config',\n value: request.webhookConfig ? marshalSubscriberWebhookConfig(request.webhookConfig) : undefined\n }])\n});\nconst marshalZonedApiMigrateLbRequest = (request, defaults) => ({\n type: request.type\n});\nconst marshalZonedApiRemoveBackendServersRequest = (request, defaults) => ({\n server_ip: request.serverIp\n});\nconst marshalZonedApiSetAclsRequest = (request, defaults) => ({\n acls: request.acls.map(elt => marshalAclSpec(elt))\n});\nconst marshalZonedApiSetBackendServersRequest = (request, defaults) => ({\n server_ip: request.serverIp\n});\nconst marshalZonedApiSubscribeToLbRequest = (request, defaults) => ({\n subscriber_id: request.subscriberId\n});\nconst marshalZonedApiUpdateAclRequest = (request, defaults) => ({\n action: marshalAclAction(request.action),\n description: request.description,\n index: request.index,\n match: request.match ? marshalAclMatch(request.match) : undefined,\n name: request.name\n});\nconst marshalZonedApiUpdateBackendRequest = (request, defaults) => ({\n failover_host: request.failoverHost,\n forward_port: request.forwardPort,\n forward_port_algorithm: request.forwardPortAlgorithm,\n forward_protocol: request.forwardProtocol,\n ignore_ssl_server_verify: request.ignoreSslServerVerify,\n max_connections: request.maxConnections,\n max_retries: request.maxRetries,\n name: request.name,\n on_marked_down_action: request.onMarkedDownAction ?? 'on_marked_down_action_none',\n proxy_protocol: request.proxyProtocol ?? 'proxy_protocol_unknown',\n redispatch_attempt_count: request.redispatchAttemptCount,\n send_proxy_v2: request.sendProxyV2,\n ssl_bridging: request.sslBridging,\n sticky_sessions: request.stickySessions,\n sticky_sessions_cookie_name: request.stickySessionsCookieName,\n timeout_connect: request.timeoutConnect,\n timeout_queue: request.timeoutQueue,\n timeout_server: request.timeoutServer,\n timeout_tunnel: request.timeoutTunnel\n});\nconst marshalZonedApiUpdateCertificateRequest = (request, defaults) => ({\n name: request.name\n});\nconst marshalZonedApiUpdateFrontendRequest = (request, defaults) => ({\n backend_id: request.backendId,\n certificate_id: request.certificateId,\n certificate_ids: request.certificateIds,\n enable_http3: request.enableHttp3,\n inbound_port: request.inboundPort,\n name: request.name,\n timeout_client: request.timeoutClient\n});\nconst marshalZonedApiUpdateHealthCheckRequest = (request, defaults) => ({\n check_delay: request.checkDelay,\n check_max_retries: request.checkMaxRetries,\n check_send_proxy: request.checkSendProxy,\n check_timeout: request.checkTimeout,\n port: request.port,\n transient_check_delay: request.transientCheckDelay,\n ...resolveOneOf([{\n param: 'tcp_config',\n value: request.tcpConfig ? marshalHealthCheckTcpConfig(request.tcpConfig) : undefined\n }, {\n param: 'mysql_config',\n value: request.mysqlConfig ? marshalHealthCheckMysqlConfig(request.mysqlConfig) : undefined\n }, {\n param: 'pgsql_config',\n value: request.pgsqlConfig ? marshalHealthCheckPgsqlConfig(request.pgsqlConfig) : undefined\n }, {\n param: 'ldap_config',\n value: request.ldapConfig ? marshalHealthCheckLdapConfig(request.ldapConfig) : undefined\n }, {\n param: 'redis_config',\n value: request.redisConfig ? marshalHealthCheckRedisConfig(request.redisConfig) : undefined\n }, {\n param: 'http_config',\n value: request.httpConfig ? marshalHealthCheckHttpConfig(request.httpConfig) : undefined\n }, {\n param: 'https_config',\n value: request.httpsConfig ? marshalHealthCheckHttpsConfig(request.httpsConfig) : undefined\n }])\n});\nconst marshalZonedApiUpdateIpRequest = (request, defaults) => ({\n reverse: request.reverse\n});\nconst marshalZonedApiUpdateLbRequest = (request, defaults) => ({\n description: request.description,\n name: request.name,\n ssl_compatibility_level: request.sslCompatibilityLevel ?? 'ssl_compatibility_level_unknown',\n tags: request.tags\n});\nconst marshalZonedApiUpdateRouteRequest = (request, defaults) => ({\n backend_id: request.backendId,\n match: request.match ? marshalRouteMatch(request.match) : undefined\n});\nconst marshalZonedApiUpdateSubscriberRequest = (request, defaults) => ({\n name: request.name,\n ...resolveOneOf([{\n param: 'email_config',\n value: request.emailConfig ? marshalSubscriberEmailConfig(request.emailConfig) : undefined\n }, {\n param: 'webhook_config',\n value: request.webhookConfig ? marshalSubscriberWebhookConfig(request.webhookConfig) : undefined\n }])\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst jsonContentHeaders$c = {\n 'Content-Type': 'application/json; charset=utf-8'\n};\n\n/**\n * Load balancer API.\n *\n * This API allows you to manage your load balancer service. Load balancer API.\n */\nlet API$d = class API extends API$u {\n /** Lists the available regions of the API. */\n static LOCALITIES = ['fr-par', 'nl-ams', 'pl-waw'];\n pageOfListLbs = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs`,\n urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])\n }, unmarshalListLbsResponse);\n\n /**\n * List load balancers.\n *\n * @param request - The request {@link ListLbsRequest}\n * @returns A Promise of ListLbsResponse\n */\n listLbs = (request = {}) => enrichForPagination('lbs', this.pageOfListLbs, request);\n\n /**\n * Create a load balancer.\n *\n * @param request - The request {@link CreateLbRequest}\n * @returns A Promise of Lb\n */\n createLb = request => this.client.fetch({\n body: JSON.stringify(marshalCreateLbRequest(request, this.client.settings)),\n headers: jsonContentHeaders$c,\n method: 'POST',\n path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs`\n }, unmarshalLb);\n\n /**\n * Get a load balancer.\n *\n * @param request - The request {@link GetLbRequest}\n * @returns A Promise of Lb\n */\n getLb = request => this.client.fetch({\n method: 'GET',\n path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}`\n }, unmarshalLb);\n\n /**\n * Waits for {@link Lb} to be in a final state.\n *\n * @param request - The request {@link GetLbRequest}\n * @param options - The waiting options\n * @returns A Promise of Lb\n */\n waitForLb = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!LB_TRANSIENT_STATUSES.includes(res.status))), this.getLb, request, options);\n\n /**\n * Update a load balancer.\n *\n * @param request - The request {@link UpdateLbRequest}\n * @returns A Promise of Lb\n */\n updateLb = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateLbRequest(request, this.client.settings)),\n headers: jsonContentHeaders$c,\n method: 'PUT',\n path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}`\n }, unmarshalLb);\n\n /**\n * Delete a load balancer.\n *\n * @param request - The request {@link DeleteLbRequest}\n */\n deleteLb = request => this.client.fetch({\n method: 'DELETE',\n path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}`,\n urlParams: urlParams(['release_ip', request.releaseIp])\n });\n\n /**\n * Migrate a load balancer.\n *\n * @param request - The request {@link MigrateLbRequest}\n * @returns A Promise of Lb\n */\n migrateLb = request => this.client.fetch({\n body: JSON.stringify(marshalMigrateLbRequest(request, this.client.settings)),\n headers: jsonContentHeaders$c,\n method: 'POST',\n path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}/migrate`\n }, unmarshalLb);\n pageOfListIPs = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/ips`,\n urlParams: urlParams(['ip_address', request.ipAddress], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])\n }, unmarshalListIpsResponse);\n\n /**\n * List IPs.\n *\n * @param request - The request {@link ListIPsRequest}\n * @returns A Promise of ListIpsResponse\n */\n listIPs = (request = {}) => enrichForPagination('ips', this.pageOfListIPs, request);\n\n /**\n * Create an IP.\n *\n * @param request - The request {@link CreateIpRequest}\n * @returns A Promise of Ip\n */\n createIp = (request = {}) => this.client.fetch({\n body: JSON.stringify(marshalCreateIpRequest(request, this.client.settings)),\n headers: jsonContentHeaders$c,\n method: 'POST',\n path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/ips`\n }, unmarshalIp);\n\n /**\n * Get an IP.\n *\n * @param request - The request {@link GetIpRequest}\n * @returns A Promise of Ip\n */\n getIp = request => this.client.fetch({\n method: 'GET',\n path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/ips/${validatePathParam('ipId', request.ipId)}`\n }, unmarshalIp);\n\n /**\n * Delete an IP.\n *\n * @param request - The request {@link ReleaseIpRequest}\n */\n releaseIp = request => this.client.fetch({\n method: 'DELETE',\n path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/ips/${validatePathParam('ipId', request.ipId)}`\n });\n\n /**\n * Update an IP.\n *\n * @param request - The request {@link UpdateIpRequest}\n * @returns A Promise of Ip\n */\n updateIp = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateIpRequest(request, this.client.settings)),\n headers: jsonContentHeaders$c,\n method: 'PATCH',\n path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/ips/${validatePathParam('ipId', request.ipId)}`\n }, unmarshalIp);\n pageOfListBackends = request => this.client.fetch({\n method: 'GET',\n path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}/backends`,\n urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])\n }, unmarshalListBackendsResponse);\n\n /**\n * List backends in a given load balancer.\n *\n * @param request - The request {@link ListBackendsRequest}\n * @returns A Promise of ListBackendsResponse\n */\n listBackends = request => enrichForPagination('backends', this.pageOfListBackends, request);\n\n /**\n * Create a backend in a given load balancer.\n *\n * @param request - The request {@link CreateBackendRequest}\n * @returns A Promise of Backend\n */\n createBackend = request => this.client.fetch({\n body: JSON.stringify(marshalCreateBackendRequest(request, this.client.settings)),\n headers: jsonContentHeaders$c,\n method: 'POST',\n path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}/backends`\n }, unmarshalBackend);\n\n /**\n * Get a backend in a given load balancer.\n *\n * @param request - The request {@link GetBackendRequest}\n * @returns A Promise of Backend\n */\n getBackend = request => this.client.fetch({\n method: 'GET',\n path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/backends/${validatePathParam('backendId', request.backendId)}`\n }, unmarshalBackend);\n\n /**\n * Update a backend in a given load balancer.\n *\n * @param request - The request {@link UpdateBackendRequest}\n * @returns A Promise of Backend\n */\n updateBackend = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateBackendRequest(request, this.client.settings)),\n headers: jsonContentHeaders$c,\n method: 'PUT',\n path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/backends/${validatePathParam('backendId', request.backendId)}`\n }, unmarshalBackend);\n\n /**\n * Delete a backend in a given load balancer.\n *\n * @param request - The request {@link DeleteBackendRequest}\n */\n deleteBackend = request => this.client.fetch({\n method: 'DELETE',\n path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/backends/${validatePathParam('backendId', request.backendId)}`\n });\n\n /**\n * Add a set of servers in a given backend.\n *\n * @param request - The request {@link AddBackendServersRequest}\n * @returns A Promise of Backend\n */\n addBackendServers = request => this.client.fetch({\n body: JSON.stringify(marshalAddBackendServersRequest(request, this.client.settings)),\n headers: jsonContentHeaders$c,\n method: 'POST',\n path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/backends/${validatePathParam('backendId', request.backendId)}/servers`\n }, unmarshalBackend);\n\n /**\n * Remove a set of servers for a given backend.\n *\n * @param request - The request {@link RemoveBackendServersRequest}\n * @returns A Promise of Backend\n */\n removeBackendServers = request => this.client.fetch({\n body: JSON.stringify(marshalRemoveBackendServersRequest(request, this.client.settings)),\n headers: jsonContentHeaders$c,\n method: 'DELETE',\n path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/backends/${validatePathParam('backendId', request.backendId)}/servers`\n }, unmarshalBackend);\n\n /**\n * Define all servers in a given backend.\n *\n * @param request - The request {@link SetBackendServersRequest}\n * @returns A Promise of Backend\n */\n setBackendServers = request => this.client.fetch({\n body: JSON.stringify(marshalSetBackendServersRequest(request, this.client.settings)),\n headers: jsonContentHeaders$c,\n method: 'PUT',\n path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/backends/${validatePathParam('backendId', request.backendId)}/servers`\n }, unmarshalBackend);\n\n /**\n * Update an health check for a given backend.\n *\n * @param request - The request {@link UpdateHealthCheckRequest}\n * @returns A Promise of HealthCheck\n */\n updateHealthCheck = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateHealthCheckRequest(request, this.client.settings)),\n headers: jsonContentHeaders$c,\n method: 'PUT',\n path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/backends/${validatePathParam('backendId', request.backendId)}/healthcheck`\n }, unmarshalHealthCheck);\n pageOfListFrontends = request => this.client.fetch({\n method: 'GET',\n path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}/frontends`,\n urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])\n }, unmarshalListFrontendsResponse);\n\n /**\n * List frontends in a given load balancer.\n *\n * @param request - The request {@link ListFrontendsRequest}\n * @returns A Promise of ListFrontendsResponse\n */\n listFrontends = request => enrichForPagination('frontends', this.pageOfListFrontends, request);\n\n /**\n * Create a frontend in a given load balancer.\n *\n * @param request - The request {@link CreateFrontendRequest}\n * @returns A Promise of Frontend\n */\n createFrontend = request => this.client.fetch({\n body: JSON.stringify(marshalCreateFrontendRequest(request, this.client.settings)),\n headers: jsonContentHeaders$c,\n method: 'POST',\n path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}/frontends`\n }, unmarshalFrontend);\n\n /**\n * Get a frontend.\n *\n * @param request - The request {@link GetFrontendRequest}\n * @returns A Promise of Frontend\n */\n getFrontend = request => this.client.fetch({\n method: 'GET',\n path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/frontends/${validatePathParam('frontendId', request.frontendId)}`\n }, unmarshalFrontend);\n\n /**\n * Update a frontend.\n *\n * @param request - The request {@link UpdateFrontendRequest}\n * @returns A Promise of Frontend\n */\n updateFrontend = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateFrontendRequest(request, this.client.settings)),\n headers: jsonContentHeaders$c,\n method: 'PUT',\n path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/frontends/${validatePathParam('frontendId', request.frontendId)}`\n }, unmarshalFrontend);\n\n /**\n * Delete a frontend.\n *\n * @param request - The request {@link DeleteFrontendRequest}\n */\n deleteFrontend = request => this.client.fetch({\n method: 'DELETE',\n path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/frontends/${validatePathParam('frontendId', request.frontendId)}`\n });\n pageOfListRoutes = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/routes`,\n urlParams: urlParams(['frontend_id', request.frontendId], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])\n }, unmarshalListRoutesResponse);\n\n /**\n * List all backend redirections.\n *\n * @param request - The request {@link ListRoutesRequest}\n * @returns A Promise of ListRoutesResponse\n */\n listRoutes = (request = {}) => enrichForPagination('routes', this.pageOfListRoutes, request);\n\n /**\n * Create a backend redirection.\n *\n * @param request - The request {@link CreateRouteRequest}\n * @returns A Promise of Route\n */\n createRoute = request => this.client.fetch({\n body: JSON.stringify(marshalCreateRouteRequest(request, this.client.settings)),\n headers: jsonContentHeaders$c,\n method: 'POST',\n path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/routes`\n }, unmarshalRoute);\n\n /**\n * Get single backend redirection.\n *\n * @param request - The request {@link GetRouteRequest}\n * @returns A Promise of Route\n */\n getRoute = request => this.client.fetch({\n method: 'GET',\n path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam('routeId', request.routeId)}`\n }, unmarshalRoute);\n\n /**\n * Edit a backend redirection.\n *\n * @param request - The request {@link UpdateRouteRequest}\n * @returns A Promise of Route\n */\n updateRoute = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateRouteRequest(request, this.client.settings)),\n headers: jsonContentHeaders$c,\n method: 'PUT',\n path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam('routeId', request.routeId)}`\n }, unmarshalRoute);\n\n /**\n * Delete a backend redirection.\n *\n * @param request - The request {@link DeleteRouteRequest}\n */\n deleteRoute = request => this.client.fetch({\n method: 'DELETE',\n path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam('routeId', request.routeId)}`\n });\n\n /**\n * Get usage statistics of a given load balancer.\n *\n * @deprecated\n * @param request - The request {@link GetLbStatsRequest}\n * @returns A Promise of LbStats\n */\n getLbStats = request => this.client.fetch({\n method: 'GET',\n path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}/stats`,\n urlParams: urlParams(['backend_id', request.backendId])\n }, unmarshalLbStats);\n pageOfListBackendStats = request => this.client.fetch({\n method: 'GET',\n path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}/backend-stats`,\n urlParams: urlParams(['backend_id', request.backendId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])\n }, unmarshalListBackendStatsResponse);\n\n /**\n * List backend server statistics.\n *\n * @param request - The request {@link ListBackendStatsRequest}\n * @returns A Promise of ListBackendStatsResponse\n */\n listBackendStats = request => enrichForPagination('backendServersStats', this.pageOfListBackendStats, request);\n pageOfListAcls = request => this.client.fetch({\n method: 'GET',\n path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/frontends/${validatePathParam('frontendId', request.frontendId)}/acls`,\n urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])\n }, unmarshalListAclResponse);\n\n /**\n * List ACL for a given frontend.\n *\n * @param request - The request {@link ListAclsRequest}\n * @returns A Promise of ListAclResponse\n */\n listAcls = request => enrichForPagination('acls', this.pageOfListAcls, request);\n\n /**\n * Create an ACL for a given frontend.\n *\n * @param request - The request {@link CreateAclRequest}\n * @returns A Promise of Acl\n */\n createAcl = request => this.client.fetch({\n body: JSON.stringify(marshalCreateAclRequest(request, this.client.settings)),\n headers: jsonContentHeaders$c,\n method: 'POST',\n path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/frontends/${validatePathParam('frontendId', request.frontendId)}/acls`\n }, unmarshalAcl);\n\n /**\n * Get an ACL.\n *\n * @param request - The request {@link GetAclRequest}\n * @returns A Promise of Acl\n */\n getAcl = request => this.client.fetch({\n method: 'GET',\n path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/acls/${validatePathParam('aclId', request.aclId)}`\n }, unmarshalAcl);\n\n /**\n * Update an ACL.\n *\n * @param request - The request {@link UpdateAclRequest}\n * @returns A Promise of Acl\n */\n updateAcl = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateAclRequest(request, this.client.settings)),\n headers: jsonContentHeaders$c,\n method: 'PUT',\n path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/acls/${validatePathParam('aclId', request.aclId)}`\n }, unmarshalAcl);\n\n /**\n * Delete an ACL.\n *\n * @param request - The request {@link DeleteAclRequest}\n */\n deleteAcl = request => this.client.fetch({\n method: 'DELETE',\n path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/acls/${validatePathParam('aclId', request.aclId)}`\n });\n\n /**\n * Create a TLS certificate. Generate a new TLS certificate using Let's\n * Encrypt or import your certificate.\n *\n * @param request - The request {@link CreateCertificateRequest}\n * @returns A Promise of Certificate\n */\n createCertificate = request => this.client.fetch({\n body: JSON.stringify(marshalCreateCertificateRequest(request, this.client.settings)),\n headers: jsonContentHeaders$c,\n method: 'POST',\n path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}/certificates`\n }, unmarshalCertificate);\n pageOfListCertificates = request => this.client.fetch({\n method: 'GET',\n path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}/certificates`,\n urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])\n }, unmarshalListCertificatesResponse);\n\n /**\n * List all TLS certificates on a given load balancer.\n *\n * @param request - The request {@link ListCertificatesRequest}\n * @returns A Promise of ListCertificatesResponse\n */\n listCertificates = request => enrichForPagination('certificates', this.pageOfListCertificates, request);\n\n /**\n * Get a TLS certificate.\n *\n * @param request - The request {@link GetCertificateRequest}\n * @returns A Promise of Certificate\n */\n getCertificate = request => this.client.fetch({\n method: 'GET',\n path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/certificates/${validatePathParam('certificateId', request.certificateId)}`\n }, unmarshalCertificate);\n\n /**\n * Waits for {@link Certificate} to be in a final state.\n *\n * @param request - The request {@link GetCertificateRequest}\n * @param options - The waiting options\n * @returns A Promise of Certificate\n */\n waitForCertificate = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!CERTIFICATE_TRANSIENT_STATUSES.includes(res.status))), this.getCertificate, request, options);\n\n /**\n * Update a TLS certificate.\n *\n * @param request - The request {@link UpdateCertificateRequest}\n * @returns A Promise of Certificate\n */\n updateCertificate = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateCertificateRequest(request, this.client.settings)),\n headers: jsonContentHeaders$c,\n method: 'PUT',\n path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/certificates/${validatePathParam('certificateId', request.certificateId)}`\n }, unmarshalCertificate);\n\n /**\n * Delete a TLS certificate.\n *\n * @param request - The request {@link DeleteCertificateRequest}\n */\n deleteCertificate = request => this.client.fetch({\n method: 'DELETE',\n path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/certificates/${validatePathParam('certificateId', request.certificateId)}`\n });\n pageOfListLbTypes = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lb-types`,\n urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])\n }, unmarshalListLbTypesResponse);\n\n /**\n * List all load balancer offer type.\n *\n * @param request - The request {@link ListLbTypesRequest}\n * @returns A Promise of ListLbTypesResponse\n */\n listLbTypes = (request = {}) => enrichForPagination('lbTypes', this.pageOfListLbTypes, request);\n\n /**\n * Create a subscriber, webhook or email.\n *\n * @param request - The request {@link CreateSubscriberRequest}\n * @returns A Promise of Subscriber\n */\n createSubscriber = request => this.client.fetch({\n body: JSON.stringify(marshalCreateSubscriberRequest(request, this.client.settings)),\n headers: jsonContentHeaders$c,\n method: 'POST',\n path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/subscribers`\n }, unmarshalSubscriber);\n\n /**\n * Get a subscriber.\n *\n * @param request - The request {@link GetSubscriberRequest}\n * @returns A Promise of Subscriber\n */\n getSubscriber = request => this.client.fetch({\n method: 'GET',\n path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/subscribers/${validatePathParam('subscriberId', request.subscriberId)}`\n }, unmarshalSubscriber);\n pageOfListSubscriber = request => this.client.fetch({\n method: 'GET',\n path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/subscribers`,\n urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])\n }, unmarshalListSubscriberResponse);\n\n /**\n * List all subscriber.\n *\n * @param request - The request {@link ListSubscriberRequest}\n * @returns A Promise of ListSubscriberResponse\n */\n listSubscriber = request => enrichForPagination('subscribers', this.pageOfListSubscriber, request);\n\n /**\n * Update a subscriber.\n *\n * @param request - The request {@link UpdateSubscriberRequest}\n * @returns A Promise of Subscriber\n */\n updateSubscriber = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateSubscriberRequest(request, this.client.settings)),\n headers: jsonContentHeaders$c,\n method: 'PUT',\n path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/subscribers/${validatePathParam('subscriberId', request.subscriberId)}`\n }, unmarshalSubscriber);\n\n /**\n * Delete a subscriber.\n *\n * @param request - The request {@link DeleteSubscriberRequest}\n */\n deleteSubscriber = request => this.client.fetch({\n method: 'DELETE',\n path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lb/subscriber/${validatePathParam('subscriberId', request.subscriberId)}`\n });\n\n /**\n * Subscribe a subscriber to a given load balancer.\n *\n * @param request - The request {@link SubscribeToLbRequest}\n * @returns A Promise of Lb\n */\n subscribeToLb = request => this.client.fetch({\n body: JSON.stringify(marshalSubscribeToLbRequest(request, this.client.settings)),\n headers: jsonContentHeaders$c,\n method: 'POST',\n path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lb/${validatePathParam('lbId', request.lbId)}/subscribe`\n }, unmarshalLb);\n\n /**\n * Unsubscribe a subscriber from a given load balancer.\n *\n * @param request - The request {@link UnsubscribeFromLbRequest}\n * @returns A Promise of Lb\n */\n unsubscribeFromLb = request => this.client.fetch({\n method: 'DELETE',\n path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lb/${validatePathParam('lbId', request.lbId)}/unsubscribe`\n }, unmarshalLb);\n pageOfListLbPrivateNetworks = request => this.client.fetch({\n method: 'GET',\n path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}/private-networks`,\n urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])\n }, unmarshalListLbPrivateNetworksResponse);\n\n /**\n * List attached private network of load balancer.\n *\n * @param request - The request {@link ListLbPrivateNetworksRequest}\n * @returns A Promise of ListLbPrivateNetworksResponse\n */\n listLbPrivateNetworks = request => enrichForPagination('privateNetwork', this.pageOfListLbPrivateNetworks, request);\n\n /**\n * Add load balancer on instance private network.\n *\n * @param request - The request {@link AttachPrivateNetworkRequest}\n * @returns A Promise of PrivateNetwork\n */\n attachPrivateNetwork = request => this.client.fetch({\n body: JSON.stringify(marshalAttachPrivateNetworkRequest(request, this.client.settings)),\n headers: jsonContentHeaders$c,\n method: 'POST',\n path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}/attach`\n }, unmarshalPrivateNetwork$3);\n\n /**\n * Remove load balancer of private network.\n *\n * @param request - The request {@link DetachPrivateNetworkRequest}\n */\n detachPrivateNetwork = request => this.client.fetch({\n body: '{}',\n headers: jsonContentHeaders$c,\n method: 'POST',\n path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}/detach`\n });\n};\n\n/**\n * Load Balancer API.\n *\n * This API allows you to manage your Scaleway Load Balancer services. Load\n * Balancer API.\n */\nclass ZonedAPI extends API$u {\n /** Lists the available zones of the API. */\n static LOCALITIES = ['fr-par-1', 'fr-par-2', 'nl-ams-1', 'nl-ams-2', 'nl-ams-3', 'pl-waw-1', 'pl-waw-2', 'pl-waw-3'];\n pageOfListLbs = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs`,\n urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])\n }, unmarshalListLbsResponse);\n\n /**\n * List Load Balancers. List all Load Balancers in the specified zone, for a\n * Scaleway Organization or Scaleway Project. By default, the Load Balancers\n * returned in the list are ordered by creation date in ascending order,\n * though this can be modified via the `order_by` field.\n *\n * @param request - The request {@link ZonedApiListLbsRequest}\n * @returns A Promise of ListLbsResponse\n */\n listLbs = (request = {}) => enrichForPagination('lbs', this.pageOfListLbs, request);\n\n /**\n * Create a Load Balancer. Create a new Load Balancer. Note that the Load\n * Balancer will be created without frontends or backends; these must be\n * created separately via the dedicated endpoints.\n *\n * @param request - The request {@link ZonedApiCreateLbRequest}\n * @returns A Promise of Lb\n */\n createLb = request => this.client.fetch({\n body: JSON.stringify(marshalZonedApiCreateLbRequest(request, this.client.settings)),\n headers: jsonContentHeaders$c,\n method: 'POST',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs`\n }, unmarshalLb);\n\n /**\n * Get a Load Balancer. Retrieve information about an existing Load Balancer,\n * specified by its Load Balancer ID. Its full details, including name, status\n * and IP address, are returned in the response object.\n *\n * @param request - The request {@link ZonedApiGetLbRequest}\n * @returns A Promise of Lb\n */\n getLb = request => this.client.fetch({\n method: 'GET',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}`\n }, unmarshalLb);\n\n /**\n * Waits for {@link Lb} to be in a final state.\n *\n * @param request - The request {@link GetLbRequest}\n * @param options - The waiting options\n * @returns A Promise of Lb\n */\n waitForLb = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!LB_TRANSIENT_STATUSES.includes(res.status))), this.getLb, request, options);\n\n /**\n * Update a Load Balancer. Update the parameters of an existing Load Balancer,\n * specified by its Load Balancer ID. Note that the request type is PUT and\n * not PATCH. You must set all parameters.\n *\n * @param request - The request {@link ZonedApiUpdateLbRequest}\n * @returns A Promise of Lb\n */\n updateLb = request => this.client.fetch({\n body: JSON.stringify(marshalZonedApiUpdateLbRequest(request, this.client.settings)),\n headers: jsonContentHeaders$c,\n method: 'PUT',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}`\n }, unmarshalLb);\n\n /**\n * Delete a Load Balancer. Delete an existing Load Balancer, specified by its\n * Load Balancer ID. Deleting a Load Balancer is permanent, and cannot be\n * undone. The Load Balancer's flexible IP address can either be deleted with\n * the Load Balancer, or kept in your account for future use.\n *\n * @param request - The request {@link ZonedApiDeleteLbRequest}\n */\n deleteLb = request => this.client.fetch({\n method: 'DELETE',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}`,\n urlParams: urlParams(['release_ip', request.releaseIp])\n });\n\n /**\n * Migrate a Load Balancer. Migrate an existing Load Balancer from one\n * commercial type to another. Allows you to scale your Load Balancer up or\n * down in terms of bandwidth or multi-cloud provision.\n *\n * @param request - The request {@link ZonedApiMigrateLbRequest}\n * @returns A Promise of Lb\n */\n migrateLb = request => this.client.fetch({\n body: JSON.stringify(marshalZonedApiMigrateLbRequest(request, this.client.settings)),\n headers: jsonContentHeaders$c,\n method: 'POST',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}/migrate`\n }, unmarshalLb);\n pageOfListIPs = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips`,\n urlParams: urlParams(['ip_address', request.ipAddress], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])\n }, unmarshalListIpsResponse);\n\n /**\n * List IP addresses. List the Load Balancer flexible IP addresses held in the\n * account (filtered by Organization ID or Project ID). It is also possible to\n * search for a specific IP address.\n *\n * @param request - The request {@link ZonedApiListIPsRequest}\n * @returns A Promise of ListIpsResponse\n */\n listIPs = (request = {}) => enrichForPagination('ips', this.pageOfListIPs, request);\n\n /**\n * Create an IP address. Create a new Load Balancer flexible IP address, in\n * the specified Scaleway Project. This can be attached to new Load Balancers\n * created in the future.\n *\n * @param request - The request {@link ZonedApiCreateIpRequest}\n * @returns A Promise of Ip\n */\n createIp = (request = {}) => this.client.fetch({\n body: JSON.stringify(marshalZonedApiCreateIpRequest(request, this.client.settings)),\n headers: jsonContentHeaders$c,\n method: 'POST',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips`\n }, unmarshalIp);\n\n /**\n * Get an IP address. Retrieve the full details of a Load Balancer flexible IP\n * address.\n *\n * @param request - The request {@link ZonedApiGetIpRequest}\n * @returns A Promise of Ip\n */\n getIp = request => this.client.fetch({\n method: 'GET',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam('ipId', request.ipId)}`\n }, unmarshalIp);\n\n /**\n * Delete an IP address. Delete a Load Balancer flexible IP address. This\n * action is irreversible, and cannot be undone.\n *\n * @param request - The request {@link ZonedApiReleaseIpRequest}\n */\n releaseIp = request => this.client.fetch({\n method: 'DELETE',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam('ipId', request.ipId)}`\n });\n\n /**\n * Update an IP address. Update the reverse DNS of a Load Balancer flexible IP\n * address.\n *\n * @param request - The request {@link ZonedApiUpdateIpRequest}\n * @returns A Promise of Ip\n */\n updateIp = request => this.client.fetch({\n body: JSON.stringify(marshalZonedApiUpdateIpRequest(request, this.client.settings)),\n headers: jsonContentHeaders$c,\n method: 'PATCH',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam('ipId', request.ipId)}`\n }, unmarshalIp);\n pageOfListBackends = request => this.client.fetch({\n method: 'GET',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}/backends`,\n urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])\n }, unmarshalListBackendsResponse);\n\n /**\n * List the backends of a given Load Balancer. List all the backends of a Load\n * Balancer, specified by its Load Balancer ID. By default, results are\n * returned in ascending order by the creation date of each backend. The\n * response is an array of backend objects, containing full details of each\n * one including their configuration parameters such as protocol, port and\n * forwarding algorithm.\n *\n * @param request - The request {@link ZonedApiListBackendsRequest}\n * @returns A Promise of ListBackendsResponse\n */\n listBackends = request => enrichForPagination('backends', this.pageOfListBackends, request);\n\n /**\n * Create a backend for a given Load Balancer. Create a new backend for a\n * given Load Balancer, specifying its full configuration including protocol,\n * port and forwarding algorithm.\n *\n * @param request - The request {@link ZonedApiCreateBackendRequest}\n * @returns A Promise of Backend\n */\n createBackend = request => this.client.fetch({\n body: JSON.stringify(marshalZonedApiCreateBackendRequest(request, this.client.settings)),\n headers: jsonContentHeaders$c,\n method: 'POST',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}/backends`\n }, unmarshalBackend);\n\n /**\n * Get a backend of a given Load Balancer. Get the full details of a given\n * backend, specified by its backend ID. The response contains the backend's\n * full configuration parameters including protocol, port and forwarding\n * algorithm.\n *\n * @param request - The request {@link ZonedApiGetBackendRequest}\n * @returns A Promise of Backend\n */\n getBackend = request => this.client.fetch({\n method: 'GET',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/backends/${validatePathParam('backendId', request.backendId)}`\n }, unmarshalBackend);\n\n /**\n * Update a backend of a given Load Balancer. Update a backend of a given Load\n * Balancer, specified by its backend ID. Note that the request type is PUT\n * and not PATCH. You must set all parameters.\n *\n * @param request - The request {@link ZonedApiUpdateBackendRequest}\n * @returns A Promise of Backend\n */\n updateBackend = request => this.client.fetch({\n body: JSON.stringify(marshalZonedApiUpdateBackendRequest(request, this.client.settings)),\n headers: jsonContentHeaders$c,\n method: 'PUT',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/backends/${validatePathParam('backendId', request.backendId)}`\n }, unmarshalBackend);\n\n /**\n * Delete a backend of a given Load Balancer. Delete a backend of a given Load\n * Balancer, specified by its backend ID. This action is irreversible and\n * cannot be undone.\n *\n * @param request - The request {@link ZonedApiDeleteBackendRequest}\n */\n deleteBackend = request => this.client.fetch({\n method: 'DELETE',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/backends/${validatePathParam('backendId', request.backendId)}`\n });\n\n /**\n * Add a set of backend servers to a given backend. For a given backend\n * specified by its backend ID, add a set of backend servers (identified by\n * their IP addresses) it should forward traffic to. These will be appended to\n * any existing set of backend servers for this backend.\n *\n * @param request - The request {@link ZonedApiAddBackendServersRequest}\n * @returns A Promise of Backend\n */\n addBackendServers = request => this.client.fetch({\n body: JSON.stringify(marshalZonedApiAddBackendServersRequest(request, this.client.settings)),\n headers: jsonContentHeaders$c,\n method: 'POST',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/backends/${validatePathParam('backendId', request.backendId)}/servers`\n }, unmarshalBackend);\n\n /**\n * Remove a set of servers for a given backend. For a given backend specified\n * by its backend ID, remove the specified backend servers (identified by\n * their IP addresses) so that it no longer forwards traffic to them.\n *\n * @param request - The request {@link ZonedApiRemoveBackendServersRequest}\n * @returns A Promise of Backend\n */\n removeBackendServers = request => this.client.fetch({\n body: JSON.stringify(marshalZonedApiRemoveBackendServersRequest(request, this.client.settings)),\n headers: jsonContentHeaders$c,\n method: 'DELETE',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/backends/${validatePathParam('backendId', request.backendId)}/servers`\n }, unmarshalBackend);\n\n /**\n * Define all backend servers for a given backend. For a given backend\n * specified by its backend ID, define the set of backend servers (identified\n * by their IP addresses) that it should forward traffic to. Any existing\n * backend servers configured for this backend will be removed.\n *\n * @param request - The request {@link ZonedApiSetBackendServersRequest}\n * @returns A Promise of Backend\n */\n setBackendServers = request => this.client.fetch({\n body: JSON.stringify(marshalZonedApiSetBackendServersRequest(request, this.client.settings)),\n headers: jsonContentHeaders$c,\n method: 'PUT',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/backends/${validatePathParam('backendId', request.backendId)}/servers`\n }, unmarshalBackend);\n\n /**\n * Update a health check for a given backend. Update the configuration of the\n * health check performed by a given backend to verify the health of its\n * backend servers, identified by its backend ID. Note that the request type\n * is PUT and not PATCH. You must set all parameters.\n *\n * @param request - The request {@link ZonedApiUpdateHealthCheckRequest}\n * @returns A Promise of HealthCheck\n */\n updateHealthCheck = request => this.client.fetch({\n body: JSON.stringify(marshalZonedApiUpdateHealthCheckRequest(request, this.client.settings)),\n headers: jsonContentHeaders$c,\n method: 'PUT',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/backends/${validatePathParam('backendId', request.backendId)}/healthcheck`\n }, unmarshalHealthCheck);\n pageOfListFrontends = request => this.client.fetch({\n method: 'GET',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}/frontends`,\n urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])\n }, unmarshalListFrontendsResponse);\n\n /**\n * List frontends of a given Load Balancer. List all the frontends of a Load\n * Balancer, specified by its Load Balancer ID. By default, results are\n * returned in ascending order by the creation date of each frontend. The\n * response is an array of frontend objects, containing full details of each\n * one including the port they listen on and the backend they are attached\n * to.\n *\n * @param request - The request {@link ZonedApiListFrontendsRequest}\n * @returns A Promise of ListFrontendsResponse\n */\n listFrontends = request => enrichForPagination('frontends', this.pageOfListFrontends, request);\n\n /**\n * Create a frontend in a given Load Balancer. Create a new frontend for a\n * given Load Balancer, specifying its configuration including the port it\n * should listen on and the backend to attach it to.\n *\n * @param request - The request {@link ZonedApiCreateFrontendRequest}\n * @returns A Promise of Frontend\n */\n createFrontend = request => this.client.fetch({\n body: JSON.stringify(marshalZonedApiCreateFrontendRequest(request, this.client.settings)),\n headers: jsonContentHeaders$c,\n method: 'POST',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}/frontends`\n }, unmarshalFrontend);\n\n /**\n * Get a frontend. Get the full details of a given frontend, specified by its\n * frontend ID. The response contains the frontend's full configuration\n * parameters including the backend it is attached to, the port it listens on,\n * and any certificates it has.\n *\n * @param request - The request {@link ZonedApiGetFrontendRequest}\n * @returns A Promise of Frontend\n */\n getFrontend = request => this.client.fetch({\n method: 'GET',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/frontends/${validatePathParam('frontendId', request.frontendId)}`\n }, unmarshalFrontend);\n\n /**\n * Update a frontend. Update a given frontend, specified by its frontend ID.\n * You can update configuration parameters including its name and the port it\n * listens on. Note that the request type is PUT and not PATCH. You must set\n * all parameters.\n *\n * @param request - The request {@link ZonedApiUpdateFrontendRequest}\n * @returns A Promise of Frontend\n */\n updateFrontend = request => this.client.fetch({\n body: JSON.stringify(marshalZonedApiUpdateFrontendRequest(request, this.client.settings)),\n headers: jsonContentHeaders$c,\n method: 'PUT',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/frontends/${validatePathParam('frontendId', request.frontendId)}`\n }, unmarshalFrontend);\n\n /**\n * Delete a frontend. Delete a given frontend, specified by its frontend ID.\n * This action is irreversible and cannot be undone.\n *\n * @param request - The request {@link ZonedApiDeleteFrontendRequest}\n */\n deleteFrontend = request => this.client.fetch({\n method: 'DELETE',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/frontends/${validatePathParam('frontendId', request.frontendId)}`\n });\n pageOfListRoutes = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/routes`,\n urlParams: urlParams(['frontend_id', request.frontendId], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])\n }, unmarshalListRoutesResponse);\n\n /**\n * List all routes. List all routes for a given frontend. The response is an\n * array of routes, each one with a specified backend to direct to if a\n * certain condition is matched (based on the value of the SNI field or HTTP\n * Host header).\n *\n * @param request - The request {@link ZonedApiListRoutesRequest}\n * @returns A Promise of ListRoutesResponse\n */\n listRoutes = (request = {}) => enrichForPagination('routes', this.pageOfListRoutes, request);\n\n /**\n * Create a route. Create a new route on a given frontend. To configure a\n * route, specify the backend to direct to if a certain condition is matched\n * (based on the value of the SNI field or HTTP Host header).\n *\n * @param request - The request {@link ZonedApiCreateRouteRequest}\n * @returns A Promise of Route\n */\n createRoute = request => this.client.fetch({\n body: JSON.stringify(marshalZonedApiCreateRouteRequest(request, this.client.settings)),\n headers: jsonContentHeaders$c,\n method: 'POST',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/routes`\n }, unmarshalRoute);\n\n /**\n * Get a route. Retrieve information about an existing route, specified by its\n * route ID. Its full details, origin frontend, target backend and match\n * condition, are returned in the response object.\n *\n * @param request - The request {@link ZonedApiGetRouteRequest}\n * @returns A Promise of Route\n */\n getRoute = request => this.client.fetch({\n method: 'GET',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/routes/${validatePathParam('routeId', request.routeId)}`\n }, unmarshalRoute);\n\n /**\n * Update a route. Update the configuration of an existing route, specified by\n * its route ID.\n *\n * @param request - The request {@link ZonedApiUpdateRouteRequest}\n * @returns A Promise of Route\n */\n updateRoute = request => this.client.fetch({\n body: JSON.stringify(marshalZonedApiUpdateRouteRequest(request, this.client.settings)),\n headers: jsonContentHeaders$c,\n method: 'PUT',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/routes/${validatePathParam('routeId', request.routeId)}`\n }, unmarshalRoute);\n\n /**\n * Delete a route. Delete an existing route, specified by its route ID.\n * Deleting a route is permanent, and cannot be undone.\n *\n * @param request - The request {@link ZonedApiDeleteRouteRequest}\n */\n deleteRoute = request => this.client.fetch({\n method: 'DELETE',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/routes/${validatePathParam('routeId', request.routeId)}`\n });\n\n /**\n * Get usage statistics of a given Load Balancer.\n *\n * @deprecated\n * @param request - The request {@link ZonedApiGetLbStatsRequest}\n * @returns A Promise of LbStats\n */\n getLbStats = request => this.client.fetch({\n method: 'GET',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}/stats`,\n urlParams: urlParams(['backend_id', request.backendId])\n }, unmarshalLbStats);\n pageOfListBackendStats = request => this.client.fetch({\n method: 'GET',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}/backend-stats`,\n urlParams: urlParams(['backend_id', request.backendId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])\n }, unmarshalListBackendStatsResponse);\n\n /**\n * List backend server statistics. List information about your backend\n * servers, including their state and the result of their last health check.\n *\n * @param request - The request {@link ZonedApiListBackendStatsRequest}\n * @returns A Promise of ListBackendStatsResponse\n */\n listBackendStats = request => enrichForPagination('backendServersStats', this.pageOfListBackendStats, request);\n pageOfListAcls = request => this.client.fetch({\n method: 'GET',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/frontends/${validatePathParam('frontendId', request.frontendId)}/acls`,\n urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])\n }, unmarshalListAclResponse);\n\n /**\n * List ACLs for a given frontend. List the ACLs for a given frontend,\n * specified by its frontend ID. The response is an array of ACL objects, each\n * one representing an ACL that denies or allows traffic based on certain\n * conditions.\n *\n * @param request - The request {@link ZonedApiListAclsRequest}\n * @returns A Promise of ListAclResponse\n */\n listAcls = request => enrichForPagination('acls', this.pageOfListAcls, request);\n\n /**\n * Create an ACL for a given frontend. Create a new ACL for a given frontend.\n * Each ACL must have a name, an action to perform (allow or deny), and a\n * match rule (the action is carried out when the incoming traffic matches the\n * rule).\n *\n * @param request - The request {@link ZonedApiCreateAclRequest}\n * @returns A Promise of Acl\n */\n createAcl = request => this.client.fetch({\n body: JSON.stringify(marshalZonedApiCreateAclRequest(request, this.client.settings)),\n headers: jsonContentHeaders$c,\n method: 'POST',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/frontends/${validatePathParam('frontendId', request.frontendId)}/acls`\n }, unmarshalAcl);\n\n /**\n * Get an ACL. Get information for a particular ACL, specified by its ACL ID.\n * The response returns full details of the ACL, including its name, action,\n * match rule and frontend.\n *\n * @param request - The request {@link ZonedApiGetAclRequest}\n * @returns A Promise of Acl\n */\n getAcl = request => this.client.fetch({\n method: 'GET',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/acls/${validatePathParam('aclId', request.aclId)}`\n }, unmarshalAcl);\n\n /**\n * Update an ACL. Update a particular ACL, specified by its ACL ID. You can\n * update details including its name, action and match rule.\n *\n * @param request - The request {@link ZonedApiUpdateAclRequest}\n * @returns A Promise of Acl\n */\n updateAcl = request => this.client.fetch({\n body: JSON.stringify(marshalZonedApiUpdateAclRequest(request, this.client.settings)),\n headers: jsonContentHeaders$c,\n method: 'PUT',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/acls/${validatePathParam('aclId', request.aclId)}`\n }, unmarshalAcl);\n\n /**\n * Delete an ACL. Delete an ACL, specified by its ACL ID. Deleting an ACL is\n * irreversible and cannot be undone.\n *\n * @param request - The request {@link ZonedApiDeleteAclRequest}\n */\n deleteAcl = request => this.client.fetch({\n method: 'DELETE',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/acls/${validatePathParam('aclId', request.aclId)}`\n });\n\n /**\n * Define all ACLs for a given frontend. For a given frontend specified by its\n * frontend ID, define and add the complete set of ACLS for that frontend. Any\n * existing ACLs on this frontend will be removed.\n *\n * @param request - The request {@link ZonedApiSetAclsRequest}\n * @returns A Promise of SetAclsResponse\n */\n setAcls = request => this.client.fetch({\n body: JSON.stringify(marshalZonedApiSetAclsRequest(request, this.client.settings)),\n headers: jsonContentHeaders$c,\n method: 'PUT',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/frontends/${validatePathParam('frontendId', request.frontendId)}/acls`\n }, unmarshalSetAclsResponse);\n\n /**\n * Create an SSL/TLS certificate. Generate a new SSL/TLS certificate for a\n * given Load Balancer. You can choose to create a Let's Encrypt certificate,\n * or import a custom certificate.\n *\n * @param request - The request {@link ZonedApiCreateCertificateRequest}\n * @returns A Promise of Certificate\n */\n createCertificate = request => this.client.fetch({\n body: JSON.stringify(marshalZonedApiCreateCertificateRequest(request, this.client.settings)),\n headers: jsonContentHeaders$c,\n method: 'POST',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}/certificates`\n }, unmarshalCertificate);\n pageOfListCertificates = request => this.client.fetch({\n method: 'GET',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}/certificates`,\n urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])\n }, unmarshalListCertificatesResponse);\n\n /**\n * List all SSL/TLS certificates on a given Load Balancer. List all the\n * SSL/TLS certificates on a given Load Balancer. The response is an array of\n * certificate objects, which are by default listed in ascending order of\n * creation date.\n *\n * @param request - The request {@link ZonedApiListCertificatesRequest}\n * @returns A Promise of ListCertificatesResponse\n */\n listCertificates = request => enrichForPagination('certificates', this.pageOfListCertificates, request);\n\n /**\n * Get an SSL/TLS certificate. Get information for a particular SSL/TLS\n * certificate, specified by its certificate ID. The response returns full\n * details of the certificate, including its type, main domain name, and\n * alternative domain names.\n *\n * @param request - The request {@link ZonedApiGetCertificateRequest}\n * @returns A Promise of Certificate\n */\n getCertificate = request => this.client.fetch({\n method: 'GET',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/certificates/${validatePathParam('certificateId', request.certificateId)}`\n }, unmarshalCertificate);\n\n /**\n * Waits for {@link Certificate} to be in a final state.\n *\n * @param request - The request {@link GetCertificateRequest}\n * @param options - The waiting options\n * @returns A Promise of Certificate\n */\n waitForCertificate = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!CERTIFICATE_TRANSIENT_STATUSES.includes(res.status))), this.getCertificate, request, options);\n\n /**\n * Update an SSL/TLS certificate. Update the name of a particular SSL/TLS\n * certificate, specified by its certificate ID.\n *\n * @param request - The request {@link ZonedApiUpdateCertificateRequest}\n * @returns A Promise of Certificate\n */\n updateCertificate = request => this.client.fetch({\n body: JSON.stringify(marshalZonedApiUpdateCertificateRequest(request, this.client.settings)),\n headers: jsonContentHeaders$c,\n method: 'PUT',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/certificates/${validatePathParam('certificateId', request.certificateId)}`\n }, unmarshalCertificate);\n\n /**\n * Delete an SSL/TLS certificate. Delete an SSL/TLS certificate, specified by\n * its certificate ID. Deleting a certificate is irreversible and cannot be\n * undone.\n *\n * @param request - The request {@link ZonedApiDeleteCertificateRequest}\n */\n deleteCertificate = request => this.client.fetch({\n method: 'DELETE',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/certificates/${validatePathParam('certificateId', request.certificateId)}`\n });\n pageOfListLbTypes = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lb-types`,\n urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])\n }, unmarshalListLbTypesResponse);\n\n /**\n * List all Load Balancer offer types. List all the different commercial Load\n * Balancer types. The response includes an array of offer types, each with a\n * name, description, and information about its stock availability.\n *\n * @param request - The request {@link ZonedApiListLbTypesRequest}\n * @returns A Promise of ListLbTypesResponse\n */\n listLbTypes = (request = {}) => enrichForPagination('lbTypes', this.pageOfListLbTypes, request);\n\n /**\n * Create a subscriber. Create a new subscriber, either with an email\n * configuration or a webhook configuration, for a specified Scaleway\n * Project.\n *\n * @param request - The request {@link ZonedApiCreateSubscriberRequest}\n * @returns A Promise of Subscriber\n */\n createSubscriber = request => this.client.fetch({\n body: JSON.stringify(marshalZonedApiCreateSubscriberRequest(request, this.client.settings)),\n headers: jsonContentHeaders$c,\n method: 'POST',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/subscribers`\n }, unmarshalSubscriber);\n\n /**\n * Get a subscriber. Retrieve information about an existing subscriber,\n * specified by its subscriber ID. Its full details, including name and\n * email/webhook configuration, are returned in the response object.\n *\n * @param request - The request {@link ZonedApiGetSubscriberRequest}\n * @returns A Promise of Subscriber\n */\n getSubscriber = request => this.client.fetch({\n method: 'GET',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/subscribers/${validatePathParam('subscriberId', request.subscriberId)}`\n }, unmarshalSubscriber);\n pageOfListSubscriber = request => this.client.fetch({\n method: 'GET',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/subscribers`,\n urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])\n }, unmarshalListSubscriberResponse);\n\n /**\n * List all subscribers. List all subscribers to Load Balancer alerts. By\n * default, returns all subscribers to Load Balancer alerts for the\n * Organization associated with the authentication token used for the\n * request.\n *\n * @param request - The request {@link ZonedApiListSubscriberRequest}\n * @returns A Promise of ListSubscriberResponse\n */\n listSubscriber = request => enrichForPagination('subscribers', this.pageOfListSubscriber, request);\n\n /**\n * Update a subscriber. Update the parameters of a given subscriber (e.g.\n * name, webhook configuration, email configuration), specified by its\n * subscriber ID.\n *\n * @param request - The request {@link ZonedApiUpdateSubscriberRequest}\n * @returns A Promise of Subscriber\n */\n updateSubscriber = request => this.client.fetch({\n body: JSON.stringify(marshalZonedApiUpdateSubscriberRequest(request, this.client.settings)),\n headers: jsonContentHeaders$c,\n method: 'PUT',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/subscribers/${validatePathParam('subscriberId', request.subscriberId)}`\n }, unmarshalSubscriber);\n\n /**\n * Delete a subscriber. Delete an existing subscriber, specified by its\n * subscriber ID. Deleting a subscriber is permanent, and cannot be undone.\n *\n * @param request - The request {@link ZonedApiDeleteSubscriberRequest}\n */\n deleteSubscriber = request => this.client.fetch({\n method: 'DELETE',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lb/subscription/${validatePathParam('subscriberId', request.subscriberId)}`\n });\n\n /**\n * Subscribe a subscriber to alerts for a given Load Balancer. Subscribe an\n * existing subscriber to alerts for a given Load Balancer.\n *\n * @param request - The request {@link ZonedApiSubscribeToLbRequest}\n * @returns A Promise of Lb\n */\n subscribeToLb = request => this.client.fetch({\n body: JSON.stringify(marshalZonedApiSubscribeToLbRequest(request, this.client.settings)),\n headers: jsonContentHeaders$c,\n method: 'POST',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lb/${validatePathParam('lbId', request.lbId)}/subscribe`\n }, unmarshalLb);\n\n /**\n * Unsubscribe a subscriber from alerts for a given Load Balancer. Unsubscribe\n * a subscriber from alerts for a given Load Balancer. The subscriber is not\n * deleted, and can be resubscribed in the future if necessary.\n *\n * @param request - The request {@link ZonedApiUnsubscribeFromLbRequest}\n * @returns A Promise of Lb\n */\n unsubscribeFromLb = request => this.client.fetch({\n method: 'DELETE',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lb/${validatePathParam('lbId', request.lbId)}/unsubscribe`\n }, unmarshalLb);\n pageOfListLbPrivateNetworks = request => this.client.fetch({\n method: 'GET',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}/private-networks`,\n urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])\n }, unmarshalListLbPrivateNetworksResponse);\n\n /**\n * List Private Networks attached to a Load Balancer. List the Private\n * Networks attached to a given Load Balancer, specified by its Load Balancer\n * ID. The response is an array of Private Network objects, giving information\n * including the status, configuration, name and creation date of each Private\n * Network.\n *\n * @param request - The request {@link ZonedApiListLbPrivateNetworksRequest}\n * @returns A Promise of ListLbPrivateNetworksResponse\n */\n listLbPrivateNetworks = request => enrichForPagination('privateNetwork', this.pageOfListLbPrivateNetworks, request);\n\n /**\n * Attach a Load Balancer to a Private Network. Attach a specified Load\n * Balancer to a specified Private Network, defining a static or DHCP\n * configuration for the Load Balancer on the network.\n *\n * @param request - The request {@link ZonedApiAttachPrivateNetworkRequest}\n * @returns A Promise of PrivateNetwork\n */\n attachPrivateNetwork = request => this.client.fetch({\n body: JSON.stringify(marshalZonedApiAttachPrivateNetworkRequest(request, this.client.settings)),\n headers: jsonContentHeaders$c,\n method: 'POST',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}/attach`\n }, unmarshalPrivateNetwork$3);\n\n /**\n * Detach Load Balancer from Private Network. Detach a specified Load Balancer\n * from a specified Private Network.\n *\n * @param request - The request {@link ZonedApiDetachPrivateNetworkRequest}\n */\n detachPrivateNetwork = request => this.client.fetch({\n body: '{}',\n headers: jsonContentHeaders$c,\n method: 'POST',\n path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}/detach`\n });\n}\n\nclass LbV1UtilsAPI extends API$d {\n /**\n * Waits for all private networks of a load balancer to be in a final state.\n *\n * @param request - The request {@link WaitForLbPrivateNetworksRequest}\n * @param options - The waiting options\n * @returns A Promise of ListLbPrivateNetworksResponse\n */\n waitForLbPrivateNetworks = (request, options) => tryAtIntervals(async () => {\n const value = await this.listLbPrivateNetworks({\n lbId: request.lbId,\n region: request.region\n }).all().then(list => ({\n privateNetwork: list,\n totalCount: list.length\n }));\n return {\n done: value.privateNetwork.find(elt => PRIVATE_NETWORK_TRANSIENT_STATUSES.includes(elt.status)) === undefined,\n value\n };\n }, createExponentialBackoffStrategy(options?.minDelay ?? 1, options?.maxDelay ?? 30), options?.timeout);\n\n /**\n * Waits for all instances of a load balancer to be in a final state.\n *\n * @param request - The request {@link GetLbRequest}\n * @param options - The waiting options\n * @returns A Promise of Lb\n */\n waitForLbInstances = (request, options) => tryAtIntervals(async () => {\n const value = await this.getLb(request);\n return {\n done: !LB_TRANSIENT_STATUSES.includes(value.status) && value.instances.find(elt => INSTANCE_TRANSIENT_STATUSES$1.includes(elt.status)) === undefined,\n value\n };\n }, createExponentialBackoffStrategy(options?.minDelay ?? 1, options?.maxDelay ?? 30), options?.timeout);\n}\nclass LbZonedV1UtilsAPI extends ZonedAPI {\n /**\n * Waits for all private networks of a (zoned) load balancer to be in a final\n * state.\n *\n * @param request - The request {@link ZonedWaitForLbPrivateNetworksRequest}\n * @param options - The waiting options\n * @returns A Promise of ListLbPrivateNetworksResponse\n */\n waitForLbPrivateNetworks = (request, options) => tryAtIntervals(async () => {\n const value = await this.listLbPrivateNetworks({\n lbId: request.lbId,\n zone: request.zone\n }).all().then(list => ({\n privateNetwork: list,\n totalCount: list.length\n }));\n return {\n done: value.privateNetwork.find(elt => PRIVATE_NETWORK_TRANSIENT_STATUSES.includes(elt.status)) === undefined,\n value\n };\n }, createExponentialBackoffStrategy(options?.minDelay ?? 1, options?.maxDelay ?? 30), options?.timeout);\n\n /**\n * Waits for all instances of a (zoned) load balancer to be in a final state.\n *\n * @param request - The request {@link GetLbRequest}\n * @param options - The waiting options\n * @returns A Promise of Lb\n */\n waitForLbInstances = (request, options) => tryAtIntervals(async () => {\n const value = await this.getLb(request);\n return {\n done: !LB_TRANSIENT_STATUSES.includes(value.status) && value.instances.find(elt => INSTANCE_TRANSIENT_STATUSES$1.includes(elt.status)) === undefined,\n value\n };\n }, createExponentialBackoffStrategy(options?.minDelay ?? 1, options?.maxDelay ?? 30), options?.timeout);\n}\n\nvar index$c = /*#__PURE__*/Object.freeze({\n __proto__: null,\n API: LbV1UtilsAPI,\n CERTIFICATE_TRANSIENT_STATUSES: CERTIFICATE_TRANSIENT_STATUSES,\n INSTANCE_TRANSIENT_STATUSES: INSTANCE_TRANSIENT_STATUSES$1,\n LB_TRANSIENT_STATUSES: LB_TRANSIENT_STATUSES,\n PRIVATE_NETWORK_TRANSIENT_STATUSES: PRIVATE_NETWORK_TRANSIENT_STATUSES,\n ZonedAPI: LbZonedV1UtilsAPI\n});\n\nvar index$b = /*#__PURE__*/Object.freeze({\n __proto__: null,\n v1: index$c\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst unmarshalLocalImage$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'LocalImage' failed as data isn't a dictionary.`);\n }\n return {\n arch: data.arch,\n compatibleCommercialTypes: data.compatible_commercial_types,\n id: data.id,\n zone: data.zone\n };\n};\nconst unmarshalOrganization = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Organization' failed as data isn't a dictionary.`);\n }\n return {\n id: data.id,\n name: data.name\n };\n};\nconst unmarshalVersion$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Version' failed as data isn't a dictionary.`);\n }\n return {\n creationDate: unmarshalDate(data.creation_date),\n id: data.id,\n localImages: unmarshalArrayOfObject(data.local_images, unmarshalLocalImage$1),\n modificationDate: unmarshalDate(data.modification_date),\n name: data.name\n };\n};\nconst unmarshalImage$2 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Image' failed as data isn't a dictionary.`);\n }\n return {\n categories: data.categories,\n creationDate: unmarshalDate(data.creation_date),\n currentPublicVersion: data.current_public_version,\n description: data.description,\n id: data.id,\n label: data.label,\n logo: data.logo,\n modificationDate: unmarshalDate(data.modification_date),\n name: data.name,\n organization: data.organization ? unmarshalOrganization(data.organization) : undefined,\n validUntil: unmarshalDate(data.valid_until),\n versions: unmarshalArrayOfObject(data.versions, unmarshalVersion$1)\n };\n};\nconst unmarshalGetImageResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'GetImageResponse' failed as data isn't a dictionary.`);\n }\n return {\n image: data.image ? unmarshalImage$2(data.image) : undefined\n };\n};\nconst unmarshalGetVersionResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'GetVersionResponse' failed as data isn't a dictionary.`);\n }\n return {\n version: data.version ? unmarshalVersion$1(data.version) : undefined\n };\n};\nconst unmarshalListImagesResponse$2 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListImagesResponse' failed as data isn't a dictionary.`);\n }\n return {\n images: unmarshalArrayOfObject(data.images, unmarshalImage$2),\n totalCount: data.total_count\n };\n};\nconst unmarshalListVersionsResponse$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListVersionsResponse' failed as data isn't a dictionary.`);\n }\n return {\n totalCount: data.total_count,\n versions: unmarshalArrayOfObject(data.versions, unmarshalVersion$1)\n };\n};\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n/** Marketplace API. */\nlet API$c = class API extends API$u {\n pageOfListImages = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/marketplace/v1/images`,\n urlParams: urlParams(['page', request.page], ['per_page', request.perPage ?? this.client.settings.defaultPageSize])\n }, unmarshalListImagesResponse$2);\n\n /**\n * List marketplace images.\n *\n * @param request - The request {@link ListImagesRequest}\n * @returns A Promise of ListImagesResponse\n */\n listImages = (request = {}) => enrichForPagination('images', this.pageOfListImages, request);\n\n /**\n * Get a specific marketplace image.\n *\n * @param request - The request {@link GetImageRequest}\n * @returns A Promise of GetImageResponse\n */\n getImage = request => this.client.fetch({\n method: 'GET',\n path: `/marketplace/v1/images/${validatePathParam('imageId', request.imageId)}`\n }, unmarshalGetImageResponse);\n listVersions = request => this.client.fetch({\n method: 'GET',\n path: `/marketplace/v1/images/${validatePathParam('imageId', request.imageId)}/versions`\n }, unmarshalListVersionsResponse$1);\n getVersion = request => this.client.fetch({\n method: 'GET',\n path: `/marketplace/v1/images/${validatePathParam('imageId', request.imageId)}/versions/${validatePathParam('versionId', request.versionId)}`\n }, unmarshalGetVersionResponse);\n};\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\nvar index_gen$d = /*#__PURE__*/Object.freeze({\n __proto__: null,\n API: API$c\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst unmarshalCategory = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Category' failed as data isn't a dictionary.`);\n }\n return {\n description: data.description,\n id: data.id,\n name: data.name\n };\n};\nconst unmarshalImage$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Image' failed as data isn't a dictionary.`);\n }\n return {\n categories: data.categories,\n createdAt: unmarshalDate(data.created_at),\n description: data.description,\n id: data.id,\n label: data.label,\n logo: data.logo,\n name: data.name,\n updatedAt: unmarshalDate(data.updated_at),\n validUntil: unmarshalDate(data.valid_until)\n };\n};\nconst unmarshalLocalImage = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'LocalImage' failed as data isn't a dictionary.`);\n }\n return {\n arch: data.arch,\n compatibleCommercialTypes: data.compatible_commercial_types,\n id: data.id,\n label: data.label,\n type: data.type,\n zone: data.zone\n };\n};\nconst unmarshalVersion = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Version' failed as data isn't a dictionary.`);\n }\n return {\n createdAt: unmarshalDate(data.created_at),\n id: data.id,\n name: data.name,\n publishedAt: unmarshalDate(data.published_at),\n updatedAt: unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalListCategoriesResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListCategoriesResponse' failed as data isn't a dictionary.`);\n }\n return {\n categories: unmarshalArrayOfObject(data.categories, unmarshalCategory),\n totalCount: data.total_count\n };\n};\nconst unmarshalListImagesResponse$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListImagesResponse' failed as data isn't a dictionary.`);\n }\n return {\n images: unmarshalArrayOfObject(data.images, unmarshalImage$1),\n totalCount: data.total_count\n };\n};\nconst unmarshalListLocalImagesResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListLocalImagesResponse' failed as data isn't a dictionary.`);\n }\n return {\n localImages: unmarshalArrayOfObject(data.local_images, unmarshalLocalImage),\n totalCount: data.total_count\n };\n};\nconst unmarshalListVersionsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListVersionsResponse' failed as data isn't a dictionary.`);\n }\n return {\n totalCount: data.total_count,\n versions: unmarshalArrayOfObject(data.versions, unmarshalVersion)\n };\n};\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n/** Marketplace API. */\nlet API$b = class API extends API$u {\n pageOfListImages = request => this.client.fetch({\n method: 'GET',\n path: `/marketplace/v2/images`,\n urlParams: urlParams(['arch', request.arch], ['category', request.category], ['include_eol', request.includeEol], ['order_by', request.orderBy ?? 'name_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])\n }, unmarshalListImagesResponse$1);\n\n /**\n * List marketplace images. List all available images on the marketplace,\n * their UUID, CPU architecture and description.\n *\n * @param request - The request {@link ListImagesRequest}\n * @returns A Promise of ListImagesResponse\n */\n listImages = request => enrichForPagination('images', this.pageOfListImages, request);\n\n /**\n * Get a specific marketplace image. Get detailed information about a\n * marketplace image, specified by its `image_id` (UUID format).\n *\n * @param request - The request {@link GetImageRequest}\n * @returns A Promise of Image\n */\n getImage = request => this.client.fetch({\n method: 'GET',\n path: `/marketplace/v2/images/${validatePathParam('imageId', request.imageId)}`\n }, unmarshalImage$1);\n pageOfListVersions = request => this.client.fetch({\n method: 'GET',\n path: `/marketplace/v2/versions`,\n urlParams: urlParams(['image_id', request.imageId], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])\n }, unmarshalListVersionsResponse);\n\n /**\n * List versions of an Image. Get a list of all available version of an image,\n * specified by its `image_id` (UUID format).\n *\n * @param request - The request {@link ListVersionsRequest}\n * @returns A Promise of ListVersionsResponse\n */\n listVersions = request => enrichForPagination('versions', this.pageOfListVersions, request);\n\n /**\n * Get a specific image version. Get information such as the name, creation\n * date, last update and published date for an image version specified by its\n * `version_id` (UUID format).\n *\n * @param request - The request {@link GetVersionRequest}\n * @returns A Promise of Version\n */\n getVersion = request => this.client.fetch({\n method: 'GET',\n path: `/marketplace/v2/versions/${validatePathParam('versionId', request.versionId)}`\n }, unmarshalVersion);\n pageOfListLocalImages = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/marketplace/v2/local-images`,\n urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['type', request.type ?? 'unknown_type'], ['zone', request.zone ?? this.client.settings.defaultZone], ...Object.entries(resolveOneOf([{\n param: 'image_id',\n value: request.imageId\n }, {\n param: 'version_id',\n value: request.versionId\n }, {\n param: 'image_label',\n value: request.imageLabel\n }])))\n }, unmarshalListLocalImagesResponse);\n\n /**\n * List local images from a specific image or version. List information about\n * local images in a specific Availability Zone, specified by its `image_id`\n * (UUID format), `version_id` (UUID format) or `image_label`. Only one of\n * these three parameters may be set.\n *\n * @param request - The request {@link ListLocalImagesRequest}\n * @returns A Promise of ListLocalImagesResponse\n */\n listLocalImages = (request = {}) => enrichForPagination('localImages', this.pageOfListLocalImages, request);\n\n /**\n * Get a specific local image by ID. Get detailed information about a local\n * image, including compatible commercial types, supported architecture,\n * labels and the Availability Zone of the image, specified by its\n * `local_image_id` (UUID format).\n *\n * @param request - The request {@link GetLocalImageRequest}\n * @returns A Promise of LocalImage\n */\n getLocalImage = request => this.client.fetch({\n method: 'GET',\n path: `/marketplace/v2/local-images/${validatePathParam('localImageId', request.localImageId)}`\n }, unmarshalLocalImage);\n pageOfListCategories = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/marketplace/v2/categories`,\n urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])\n }, unmarshalListCategoriesResponse);\n\n /**\n * List existing image categories. Get a list of all existing categories. The\n * output can be paginated.\n *\n * @param request - The request {@link ListCategoriesRequest}\n * @returns A Promise of ListCategoriesResponse\n */\n listCategories = (request = {}) => enrichForPagination('categories', this.pageOfListCategories, request);\n\n /**\n * Get a specific category. Get information about a specific category of the\n * marketplace catalog, specified by its `category_id` (UUID format).\n *\n * @param request - The request {@link GetCategoryRequest}\n * @returns A Promise of Category\n */\n getCategory = request => this.client.fetch({\n method: 'GET',\n path: `/marketplace/v2/categories/${validatePathParam('categoryId', request.categoryId)}`\n }, unmarshalCategory);\n};\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\nvar index_gen$c = /*#__PURE__*/Object.freeze({\n __proto__: null,\n API: API$b\n});\n\nvar index$a = /*#__PURE__*/Object.freeze({\n __proto__: null,\n v1: index_gen$d,\n v2: index_gen$c\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst unmarshalPermissions = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Permissions' failed as data isn't a dictionary.`);\n }\n return {\n canManage: data.can_manage,\n canPublish: data.can_publish,\n canReceive: data.can_receive\n };\n};\nconst unmarshalCredentialSummarySQSSNSCreds = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'CredentialSummarySQSSNSCreds' failed as data isn't a dictionary.`);\n }\n return {\n accessKey: data.access_key,\n permissions: data.permissions ? unmarshalPermissions(data.permissions) : undefined\n };\n};\nconst unmarshalCredentialNATSCredsFile = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'CredentialNATSCredsFile' failed as data isn't a dictionary.`);\n }\n return {\n content: data.content\n };\n};\nconst unmarshalCredentialSQSSNSCreds = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'CredentialSQSSNSCreds' failed as data isn't a dictionary.`);\n }\n return {\n accessKey: data.access_key,\n permissions: data.permissions ? unmarshalPermissions(data.permissions) : undefined,\n secretKey: data.secret_key\n };\n};\nconst unmarshalCredentialSummary = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'CredentialSummary' failed as data isn't a dictionary.`);\n }\n return {\n id: data.id,\n name: data.name,\n namespaceId: data.namespace_id,\n protocol: data.protocol,\n sqsSnsCredentials: data.sqs_sns_credentials ? unmarshalCredentialSummarySQSSNSCreds(data.sqs_sns_credentials) : undefined\n };\n};\nconst unmarshalNamespace$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Namespace' failed as data isn't a dictionary.`);\n }\n return {\n createdAt: unmarshalDate(data.created_at),\n endpoint: data.endpoint,\n id: data.id,\n name: data.name,\n projectId: data.project_id,\n protocol: data.protocol,\n region: data.region,\n updatedAt: unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalCredential = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Credential' failed as data isn't a dictionary.`);\n }\n return {\n id: data.id,\n name: data.name,\n namespaceId: data.namespace_id,\n natsCredentials: data.nats_credentials ? unmarshalCredentialNATSCredsFile(data.nats_credentials) : undefined,\n protocol: data.protocol,\n sqsSnsCredentials: data.sqs_sns_credentials ? unmarshalCredentialSQSSNSCreds(data.sqs_sns_credentials) : undefined\n };\n};\nconst unmarshalListCredentialsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListCredentialsResponse' failed as data isn't a dictionary.`);\n }\n return {\n credentials: unmarshalArrayOfObject(data.credentials, unmarshalCredentialSummary),\n totalCount: data.total_count\n };\n};\nconst unmarshalListNamespacesResponse$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListNamespacesResponse' failed as data isn't a dictionary.`);\n }\n return {\n namespaces: unmarshalArrayOfObject(data.namespaces, unmarshalNamespace$1),\n totalCount: data.total_count\n };\n};\nconst marshalPermissions = (request, defaults) => ({\n can_manage: request.canManage,\n can_publish: request.canPublish,\n can_receive: request.canReceive\n});\nconst marshalCreateCredentialRequest = (request, defaults) => ({\n name: request.name || randomName('mnq'),\n namespace_id: request.namespaceId,\n permissions: request.permissions ? marshalPermissions(request.permissions) : undefined\n});\nconst marshalCreateNamespaceRequest$1 = (request, defaults) => ({\n name: request.name || randomName('mnq'),\n project_id: request.projectId ?? defaults.defaultProjectId,\n protocol: request.protocol\n});\nconst marshalUpdateCredentialRequest = (request, defaults) => ({\n name: request.name,\n permissions: request.permissions ? marshalPermissions(request.permissions) : undefined\n});\nconst marshalUpdateNamespaceRequest$1 = (request, defaults) => ({\n name: request.name,\n namespace_id: request.namespaceId\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst jsonContentHeaders$b = {\n 'Content-Type': 'application/json; charset=utf-8'\n};\n\n/**\n * Messaging and Queuing API.\n *\n * This API allows you to manage Scaleway Messaging and Queueing brokers.\n * Messaging and Queuing API.\n */\nlet API$a = class API extends API$u {\n /** Lists the available regions of the API. */\n static LOCALITIES = ['fr-par'];\n pageOfListNamespaces = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/mnq/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces`,\n urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])\n }, unmarshalListNamespacesResponse$1);\n\n /**\n * List namespaces. List all Messaging and Queuing namespaces in the specified\n * region, for a Scaleway Organization or Project. By default, the namespaces\n * returned in the list are ordered by creation date in ascending order,\n * though this can be modified via the `order_by` field.\n *\n * @param request - The request {@link ListNamespacesRequest}\n * @returns A Promise of ListNamespacesResponse\n */\n listNamespaces = (request = {}) => enrichForPagination('namespaces', this.pageOfListNamespaces, request);\n\n /**\n * Create a namespace. Create a Messaging and Queuing namespace, set to the\n * desired protocol.\n *\n * @param request - The request {@link CreateNamespaceRequest}\n * @returns A Promise of Namespace\n */\n createNamespace = request => this.client.fetch({\n body: JSON.stringify(marshalCreateNamespaceRequest$1(request, this.client.settings)),\n headers: jsonContentHeaders$b,\n method: 'POST',\n path: `/mnq/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces`\n }, unmarshalNamespace$1);\n\n /**\n * Update the name of a namespace. Update the name of a Messaging and Queuing\n * namespace, specified by its namespace ID.\n *\n * @param request - The request {@link UpdateNamespaceRequest}\n * @returns A Promise of Namespace\n */\n updateNamespace = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateNamespaceRequest$1(request, this.client.settings)),\n headers: jsonContentHeaders$b,\n method: 'PATCH',\n path: `/mnq/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces`\n }, unmarshalNamespace$1);\n\n /**\n * Get a namespace. Retrieve information about an existing Messaging and\n * Queuing namespace, identified by its namespace ID. Its full details,\n * including name, endpoint and protocol, are returned in the response.\n *\n * @param request - The request {@link GetNamespaceRequest}\n * @returns A Promise of Namespace\n */\n getNamespace = request => this.client.fetch({\n method: 'GET',\n path: `/mnq/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam('namespaceId', request.namespaceId)}`\n }, unmarshalNamespace$1);\n\n /**\n * Delete a namespace. Delete a Messaging and Queuing namespace, specified by\n * its namespace ID. Note that deleting a namespace is irreversible, and any\n * URLs, credentials and queued messages belonging to this namespace will also\n * be deleted.\n *\n * @param request - The request {@link DeleteNamespaceRequest}\n */\n deleteNamespace = request => this.client.fetch({\n method: 'DELETE',\n path: `/mnq/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam('namespaceId', request.namespaceId)}`\n });\n\n /**\n * Create credentials. Create a set of credentials for a Messaging and Queuing\n * namespace, specified by its namespace ID. If creating credentials for a\n * NATS namespace, the `permissions` object must not be included in the\n * request. If creating credentials for an SQS/SNS namespace, the\n * `permissions` object is required, with all three of its child attributes.\n *\n * @param request - The request {@link CreateCredentialRequest}\n * @returns A Promise of Credential\n */\n createCredential = request => this.client.fetch({\n body: JSON.stringify(marshalCreateCredentialRequest(request, this.client.settings)),\n headers: jsonContentHeaders$b,\n method: 'POST',\n path: `/mnq/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/credentials`\n }, unmarshalCredential);\n\n /**\n * Delete credentials. Delete a set of credentials, specified by their\n * credential ID. Deleting credentials is irreversible and cannot be undone.\n * The credentials can no longer be used to access the namespace.\n *\n * @param request - The request {@link DeleteCredentialRequest}\n */\n deleteCredential = request => this.client.fetch({\n method: 'DELETE',\n path: `/mnq/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/credentials/${validatePathParam('credentialId', request.credentialId)}`\n });\n pageOfListCredentials = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/mnq/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/credentials`,\n urlParams: urlParams(['namespace_id', request.namespaceId], ['order_by', request.orderBy ?? 'id_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])\n }, unmarshalListCredentialsResponse);\n\n /**\n * List credentials. List existing credentials in the specified region. The\n * response contains only the metadata for the credentials, not the\n * credentials themselves (for this, use **Get Credentials**).\n *\n * @param request - The request {@link ListCredentialsRequest}\n * @returns A Promise of ListCredentialsResponse\n */\n listCredentials = (request = {}) => enrichForPagination('credentials', this.pageOfListCredentials, request);\n\n /**\n * Update credentials. Update a set of credentials. You can update the\n * credentials' name, or (in the case of SQS/SNS credentials only) their\n * permissions. To update the name of NATS credentials, do not include the\n * `permissions` object in your request.\n *\n * @param request - The request {@link UpdateCredentialRequest}\n * @returns A Promise of Credential\n */\n updateCredential = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateCredentialRequest(request, this.client.settings)),\n headers: jsonContentHeaders$b,\n method: 'PATCH',\n path: `/mnq/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/credentials/${validatePathParam('credentialId', request.credentialId)}`\n }, unmarshalCredential);\n\n /**\n * Get credentials. Retrieve an existing set of credentials, identified by the\n * `credential_id`. The credentials themselves, as well as their metadata\n * (protocol, namespace ID etc), are returned in the response.\n *\n * @param request - The request {@link GetCredentialRequest}\n * @returns A Promise of Credential\n */\n getCredential = request => this.client.fetch({\n method: 'GET',\n path: `/mnq/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/credentials/${validatePathParam('credentialId', request.credentialId)}`\n }, unmarshalCredential);\n};\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\nvar index_gen$b = /*#__PURE__*/Object.freeze({\n __proto__: null,\n API: API$a\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst unmarshalFile = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'File' failed as data isn't a dictionary.`);\n }\n return {\n content: data.content,\n name: data.name\n };\n};\nconst unmarshalSnsPermissions = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'SnsPermissions' failed as data isn't a dictionary.`);\n }\n return {\n canManage: data.can_manage,\n canPublish: data.can_publish,\n canReceive: data.can_receive\n };\n};\nconst unmarshalSqsPermissions = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'SqsPermissions' failed as data isn't a dictionary.`);\n }\n return {\n canManage: data.can_manage,\n canPublish: data.can_publish,\n canReceive: data.can_receive\n };\n};\nconst unmarshalNatsAccount = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'NatsAccount' failed as data isn't a dictionary.`);\n }\n return {\n createdAt: unmarshalDate(data.created_at),\n endpoint: data.endpoint,\n id: data.id,\n name: data.name,\n projectId: data.project_id,\n region: data.region,\n updatedAt: unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalNatsCredentials = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'NatsCredentials' failed as data isn't a dictionary.`);\n }\n return {\n checksum: data.checksum,\n createdAt: unmarshalDate(data.created_at),\n credentials: data.credentials ? unmarshalFile(data.credentials) : undefined,\n id: data.id,\n name: data.name,\n natsAccountId: data.nats_account_id,\n updatedAt: unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalSnsCredentials = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'SnsCredentials' failed as data isn't a dictionary.`);\n }\n return {\n accessKey: data.access_key,\n createdAt: unmarshalDate(data.created_at),\n id: data.id,\n name: data.name,\n permissions: data.permissions ? unmarshalSnsPermissions(data.permissions) : undefined,\n projectId: data.project_id,\n region: data.region,\n secretChecksum: data.secret_checksum,\n secretKey: data.secret_key,\n updatedAt: unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalSqsCredentials = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'SqsCredentials' failed as data isn't a dictionary.`);\n }\n return {\n accessKey: data.access_key,\n createdAt: unmarshalDate(data.created_at),\n id: data.id,\n name: data.name,\n permissions: data.permissions ? unmarshalSqsPermissions(data.permissions) : undefined,\n projectId: data.project_id,\n region: data.region,\n secretChecksum: data.secret_checksum,\n secretKey: data.secret_key,\n updatedAt: unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalListNatsAccountsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListNatsAccountsResponse' failed as data isn't a dictionary.`);\n }\n return {\n natsAccounts: unmarshalArrayOfObject(data.nats_accounts, unmarshalNatsAccount),\n totalCount: data.total_count\n };\n};\nconst unmarshalListNatsCredentialsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListNatsCredentialsResponse' failed as data isn't a dictionary.`);\n }\n return {\n natsCredentials: unmarshalArrayOfObject(data.nats_credentials, unmarshalNatsCredentials),\n totalCount: data.total_count\n };\n};\nconst unmarshalListSnsCredentialsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListSnsCredentialsResponse' failed as data isn't a dictionary.`);\n }\n return {\n snsCredentials: unmarshalArrayOfObject(data.sns_credentials, unmarshalSnsCredentials),\n totalCount: data.total_count\n };\n};\nconst unmarshalListSqsCredentialsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListSqsCredentialsResponse' failed as data isn't a dictionary.`);\n }\n return {\n sqsCredentials: unmarshalArrayOfObject(data.sqs_credentials, unmarshalSqsCredentials),\n totalCount: data.total_count\n };\n};\nconst unmarshalSnsInfo = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'SnsInfo' failed as data isn't a dictionary.`);\n }\n return {\n createdAt: unmarshalDate(data.created_at),\n projectId: data.project_id,\n region: data.region,\n snsEndpointUrl: data.sns_endpoint_url,\n status: data.status,\n updatedAt: unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalSqsInfo = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'SqsInfo' failed as data isn't a dictionary.`);\n }\n return {\n createdAt: unmarshalDate(data.created_at),\n projectId: data.project_id,\n region: data.region,\n sqsEndpointUrl: data.sqs_endpoint_url,\n status: data.status,\n updatedAt: unmarshalDate(data.updated_at)\n };\n};\nconst marshalSnsPermissions = (request, defaults) => ({\n can_manage: request.canManage,\n can_publish: request.canPublish,\n can_receive: request.canReceive\n});\nconst marshalSqsPermissions = (request, defaults) => ({\n can_manage: request.canManage,\n can_publish: request.canPublish,\n can_receive: request.canReceive\n});\nconst marshalNatsApiCreateNatsAccountRequest = (request, defaults) => ({\n name: request.name || randomName('mnq'),\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalNatsApiCreateNatsCredentialsRequest = (request, defaults) => ({\n name: request.name || randomName('mnq'),\n nats_account_id: request.natsAccountId\n});\nconst marshalNatsApiUpdateNatsAccountRequest = (request, defaults) => ({\n name: request.name\n});\nconst marshalSnsApiActivateSnsRequest = (request, defaults) => ({\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalSnsApiCreateSnsCredentialsRequest = (request, defaults) => ({\n name: request.name || randomName('mnq_sns'),\n permissions: request.permissions ? marshalSnsPermissions(request.permissions) : undefined,\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalSnsApiDeactivateSnsRequest = (request, defaults) => ({\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalSnsApiUpdateSnsCredentialsRequest = (request, defaults) => ({\n name: request.name,\n permissions: request.permissions ? marshalSnsPermissions(request.permissions) : undefined\n});\nconst marshalSqsApiActivateSqsRequest = (request, defaults) => ({\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalSqsApiCreateSqsCredentialsRequest = (request, defaults) => ({\n name: request.name || randomName('mnq_sqs'),\n permissions: request.permissions ? marshalSqsPermissions(request.permissions) : undefined,\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalSqsApiDeactivateSqsRequest = (request, defaults) => ({\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalSqsApiUpdateSqsCredentialsRequest = (request, defaults) => ({\n name: request.name,\n permissions: request.permissions ? marshalSqsPermissions(request.permissions) : undefined\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst jsonContentHeaders$a = {\n 'Content-Type': 'application/json; charset=utf-8'\n};\n\n/**\n * Messaging and Queuing NATS API.\n *\n * This API allows you to manage Scaleway Messaging and Queueing NATS accounts.\n * Messaging and Queuing NATS API.\n */\nclass NatsAPI extends API$u {\n /** Lists the available regions of the API. */\n static LOCALITIES = ['fr-par'];\n\n /**\n * Create a NATS account. Create a NATS account associated with a Project.\n *\n * @param request - The request {@link NatsApiCreateNatsAccountRequest}\n * @returns A Promise of NatsAccount\n */\n createNatsAccount = (request = {}) => this.client.fetch({\n body: JSON.stringify(marshalNatsApiCreateNatsAccountRequest(request, this.client.settings)),\n headers: jsonContentHeaders$a,\n method: 'POST',\n path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/nats-accounts`\n }, unmarshalNatsAccount);\n\n /**\n * Delete a NATS account. Delete a NATS account, specified by its NATS account\n * ID. Note that deleting a NATS account is irreversible, and any credentials,\n * streams, consumer and stored messages belonging to this NATS account will\n * also be deleted.\n *\n * @param request - The request {@link NatsApiDeleteNatsAccountRequest}\n */\n deleteNatsAccount = request => this.client.fetch({\n method: 'DELETE',\n path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/nats-accounts/${validatePathParam('natsAccountId', request.natsAccountId)}`\n });\n\n /**\n * Update the name of a NATS account. Update the name of a NATS account,\n * specified by its NATS account ID.\n *\n * @param request - The request {@link NatsApiUpdateNatsAccountRequest}\n * @returns A Promise of NatsAccount\n */\n updateNatsAccount = request => this.client.fetch({\n body: JSON.stringify(marshalNatsApiUpdateNatsAccountRequest(request, this.client.settings)),\n headers: jsonContentHeaders$a,\n method: 'PATCH',\n path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/nats-accounts/${validatePathParam('natsAccountId', request.natsAccountId)}`\n }, unmarshalNatsAccount);\n\n /**\n * Get a NATS account. Retrieve information about an existing NATS account\n * identified by its NATS account ID. Its full details, including name and\n * endpoint, are returned in the response.\n *\n * @param request - The request {@link NatsApiGetNatsAccountRequest}\n * @returns A Promise of NatsAccount\n */\n getNatsAccount = request => this.client.fetch({\n method: 'GET',\n path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/nats-accounts/${validatePathParam('natsAccountId', request.natsAccountId)}`\n }, unmarshalNatsAccount);\n pageOfListNatsAccounts = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/nats-accounts`,\n urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])\n }, unmarshalListNatsAccountsResponse);\n\n /**\n * List NATS accounts. List all NATS accounts in the specified region, for a\n * Scaleway Organization or Project. By default, the NATS accounts returned in\n * the list are ordered by creation date in ascending order, though this can\n * be modified via the `order_by` field.\n *\n * @param request - The request {@link NatsApiListNatsAccountsRequest}\n * @returns A Promise of ListNatsAccountsResponse\n */\n listNatsAccounts = (request = {}) => enrichForPagination('natsAccounts', this.pageOfListNatsAccounts, request);\n\n /**\n * Create NATS credentials. Create a set of credentials for a NATS account,\n * specified by its NATS account ID.\n *\n * @param request - The request {@link NatsApiCreateNatsCredentialsRequest}\n * @returns A Promise of NatsCredentials\n */\n createNatsCredentials = request => this.client.fetch({\n body: JSON.stringify(marshalNatsApiCreateNatsCredentialsRequest(request, this.client.settings)),\n headers: jsonContentHeaders$a,\n method: 'POST',\n path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/nats-credentials`\n }, unmarshalNatsCredentials);\n\n /**\n * Delete NATS credentials. Delete a set of credentials, specified by their\n * credentials ID. Deleting credentials is irreversible and cannot be undone.\n * The credentials can no longer be used to access the NATS account, and\n * active connections using this credentials will be closed.\n *\n * @param request - The request {@link NatsApiDeleteNatsCredentialsRequest}\n */\n deleteNatsCredentials = request => this.client.fetch({\n method: 'DELETE',\n path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/nats-credentials/${validatePathParam('natsCredentialsId', request.natsCredentialsId)}`\n });\n\n /**\n * Get NATS credentials. Retrieve an existing set of credentials, identified\n * by the `nats_credentials_id`. The credentials themselves are NOT returned,\n * only their metadata (NATS account ID, credentials name, etc), are returned\n * in the response.\n *\n * @param request - The request {@link NatsApiGetNatsCredentialsRequest}\n * @returns A Promise of NatsCredentials\n */\n getNatsCredentials = request => this.client.fetch({\n method: 'GET',\n path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/nats-credentials/${validatePathParam('natsCredentialsId', request.natsCredentialsId)}`\n }, unmarshalNatsCredentials);\n pageOfListNatsCredentials = request => this.client.fetch({\n method: 'GET',\n path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/nats-credentials`,\n urlParams: urlParams(['nats_account_id', request.natsAccountId], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])\n }, unmarshalListNatsCredentialsResponse);\n\n /**\n * List NATS credentials. List existing credentials in the specified NATS\n * account. The response contains only the metadata for the credentials, not\n * the credentials themselves, which are only returned after a **Create\n * Credentials** call.\n *\n * @param request - The request {@link NatsApiListNatsCredentialsRequest}\n * @returns A Promise of ListNatsCredentialsResponse\n */\n listNatsCredentials = request => enrichForPagination('natsCredentials', this.pageOfListNatsCredentials, request);\n}\n\n/**\n * Messaging and Queuing SNS API.\n *\n * This API allows you to manage Scaleway Messaging and Queueing SNS brokers.\n * Messaging and Queuing SNS API.\n */\nclass SnsAPI extends API$u {\n /** Lists the available regions of the API. */\n static LOCALITIES = ['fr-par'];\n\n /**\n * Activate SNS. Activate SNS for the specified Project ID. SNS must be\n * activated before any usage. Activating SNS does not trigger any billing,\n * and you can deactivate at any time.\n *\n * @param request - The request {@link SnsApiActivateSnsRequest}\n * @returns A Promise of SnsInfo\n */\n activateSns = (request = {}) => this.client.fetch({\n body: JSON.stringify(marshalSnsApiActivateSnsRequest(request, this.client.settings)),\n headers: jsonContentHeaders$a,\n method: 'POST',\n path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/activate-sns`\n }, unmarshalSnsInfo);\n\n /**\n * Get SNS info. Retrieve the SNS information of the specified Project ID.\n * Informations include the activation status and the SNS API endpoint URL.\n *\n * @param request - The request {@link SnsApiGetSnsInfoRequest}\n * @returns A Promise of SnsInfo\n */\n getSnsInfo = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/sns-info`,\n urlParams: urlParams(['project_id', request.projectId ?? this.client.settings.defaultProjectId])\n }, unmarshalSnsInfo);\n\n /**\n * Deactivate SNS. Deactivate SNS for the specified Project ID.You must delete\n * all topics and credentials before this call or you need to set the\n * force_delete parameter.\n *\n * @param request - The request {@link SnsApiDeactivateSnsRequest}\n * @returns A Promise of SnsInfo\n */\n deactivateSns = (request = {}) => this.client.fetch({\n body: JSON.stringify(marshalSnsApiDeactivateSnsRequest(request, this.client.settings)),\n headers: jsonContentHeaders$a,\n method: 'POST',\n path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/deactivate-sns`\n }, unmarshalSnsInfo);\n\n /**\n * Create SNS credentials. Create a set of credentials for SNS, specified by a\n * Project ID. Credentials give the bearer access to topics, and the level of\n * permissions can be defined granularly.\n *\n * @param request - The request {@link SnsApiCreateSnsCredentialsRequest}\n * @returns A Promise of SnsCredentials\n */\n createSnsCredentials = (request = {}) => this.client.fetch({\n body: JSON.stringify(marshalSnsApiCreateSnsCredentialsRequest(request, this.client.settings)),\n headers: jsonContentHeaders$a,\n method: 'POST',\n path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/sns-credentials`\n }, unmarshalSnsCredentials);\n\n /**\n * Delete SNS credentials. Delete a set of SNS credentials, specified by their\n * credentials ID. Deleting credentials is irreversible and cannot be undone.\n * The credentials can then no longer be used to access SNS.\n *\n * @param request - The request {@link SnsApiDeleteSnsCredentialsRequest}\n */\n deleteSnsCredentials = request => this.client.fetch({\n method: 'DELETE',\n path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/sns-credentials/${validatePathParam('snsCredentialsId', request.snsCredentialsId)}`\n });\n\n /**\n * Update SNS credentials. Update a set of SNS credentials. You can update the\n * credentials' name, or their permissions.\n *\n * @param request - The request {@link SnsApiUpdateSnsCredentialsRequest}\n * @returns A Promise of SnsCredentials\n */\n updateSnsCredentials = request => this.client.fetch({\n body: JSON.stringify(marshalSnsApiUpdateSnsCredentialsRequest(request, this.client.settings)),\n headers: jsonContentHeaders$a,\n method: 'PATCH',\n path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/sns-credentials/${validatePathParam('snsCredentialsId', request.snsCredentialsId)}`\n }, unmarshalSnsCredentials);\n\n /**\n * Get SNS credentials. Retrieve an existing set of credentials, identified by\n * the `credentials_id`. The credentials themselves, as well as their metadata\n * (name, project ID etc), are returned in the response.\n *\n * @param request - The request {@link SnsApiGetSnsCredentialsRequest}\n * @returns A Promise of SnsCredentials\n */\n getSnsCredentials = request => this.client.fetch({\n method: 'GET',\n path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/sns-credentials/${validatePathParam('snsCredentialsId', request.snsCredentialsId)}`\n }, unmarshalSnsCredentials);\n pageOfListSnsCredentials = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/sns-credentials`,\n urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])\n }, unmarshalListSnsCredentialsResponse);\n\n /**\n * List SNS credentials. List existing SNS credentials in the specified\n * region. The response contains only the metadata for the credentials, not\n * the credentials themselves.\n *\n * @param request - The request {@link SnsApiListSnsCredentialsRequest}\n * @returns A Promise of ListSnsCredentialsResponse\n */\n listSnsCredentials = (request = {}) => enrichForPagination('snsCredentials', this.pageOfListSnsCredentials, request);\n}\n\n/**\n * Messaging and Queuing SQS API.\n *\n * This API allows you to manage Scaleway Messaging and Queueing SQS brokers.\n * Messaging and Queuing SQS API.\n */\nclass SqsAPI extends API$u {\n /** Lists the available regions of the API. */\n static LOCALITIES = ['fr-par'];\n\n /**\n * Activate SQS. Activate SQS for the specified Project ID. SQS must be\n * activated before any usage such as creating credentials and queues.\n * Activating SQS does not trigger any billing, and you can deactivate at any\n * time.\n *\n * @param request - The request {@link SqsApiActivateSqsRequest}\n * @returns A Promise of SqsInfo\n */\n activateSqs = (request = {}) => this.client.fetch({\n body: JSON.stringify(marshalSqsApiActivateSqsRequest(request, this.client.settings)),\n headers: jsonContentHeaders$a,\n method: 'POST',\n path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/activate-sqs`\n }, unmarshalSqsInfo);\n\n /**\n * Get SQS info. Retrieve the SQS information of the specified Project ID.\n * Informations include the activation status and the SQS API endpoint URL.\n *\n * @param request - The request {@link SqsApiGetSqsInfoRequest}\n * @returns A Promise of SqsInfo\n */\n getSqsInfo = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/sqs-info`,\n urlParams: urlParams(['project_id', request.projectId ?? this.client.settings.defaultProjectId])\n }, unmarshalSqsInfo);\n\n /**\n * Deactivate SQS. Deactivate SQS for the specified Project ID. You must\n * delete all queues and credentials before this call or you need to set the\n * force_delete parameter.\n *\n * @param request - The request {@link SqsApiDeactivateSqsRequest}\n * @returns A Promise of SqsInfo\n */\n deactivateSqs = (request = {}) => this.client.fetch({\n body: JSON.stringify(marshalSqsApiDeactivateSqsRequest(request, this.client.settings)),\n headers: jsonContentHeaders$a,\n method: 'POST',\n path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/deactivate-sqs`\n }, unmarshalSqsInfo);\n\n /**\n * Create SQS credentials. Create a set of credentials for SQS, specified by a\n * Project ID. Credentials give the bearer access to queues, and the level of\n * permissions can be defined granularly.\n *\n * @param request - The request {@link SqsApiCreateSqsCredentialsRequest}\n * @returns A Promise of SqsCredentials\n */\n createSqsCredentials = (request = {}) => this.client.fetch({\n body: JSON.stringify(marshalSqsApiCreateSqsCredentialsRequest(request, this.client.settings)),\n headers: jsonContentHeaders$a,\n method: 'POST',\n path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/sqs-credentials`\n }, unmarshalSqsCredentials);\n\n /**\n * Delete SQS credentials. Delete a set of SQS credentials, specified by their\n * credentials ID. Deleting credentials is irreversible and cannot be undone.\n * The credentials can then no longer be used to access SQS.\n *\n * @param request - The request {@link SqsApiDeleteSqsCredentialsRequest}\n */\n deleteSqsCredentials = request => this.client.fetch({\n method: 'DELETE',\n path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/sqs-credentials/${validatePathParam('sqsCredentialsId', request.sqsCredentialsId)}`\n });\n\n /**\n * Update SQS credentials. Update a set of SQS credentials. You can update the\n * credentials' name, or their permissions.\n *\n * @param request - The request {@link SqsApiUpdateSqsCredentialsRequest}\n * @returns A Promise of SqsCredentials\n */\n updateSqsCredentials = request => this.client.fetch({\n body: JSON.stringify(marshalSqsApiUpdateSqsCredentialsRequest(request, this.client.settings)),\n headers: jsonContentHeaders$a,\n method: 'PATCH',\n path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/sqs-credentials/${validatePathParam('sqsCredentialsId', request.sqsCredentialsId)}`\n }, unmarshalSqsCredentials);\n\n /**\n * Get SQS credentials. Retrieve an existing set of credentials, identified by\n * the `credentials_id`. The credentials themselves, as well as their metadata\n * (name, project ID etc), are returned in the response.\n *\n * @param request - The request {@link SqsApiGetSqsCredentialsRequest}\n * @returns A Promise of SqsCredentials\n */\n getSqsCredentials = request => this.client.fetch({\n method: 'GET',\n path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/sqs-credentials/${validatePathParam('sqsCredentialsId', request.sqsCredentialsId)}`\n }, unmarshalSqsCredentials);\n pageOfListSqsCredentials = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/sqs-credentials`,\n urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])\n }, unmarshalListSqsCredentialsResponse);\n\n /**\n * List SQS credentials. List existing SQS credentials in the specified\n * region. The response contains only the metadata for the credentials, not\n * the credentials themselves.\n *\n * @param request - The request {@link SqsApiListSqsCredentialsRequest}\n * @returns A Promise of ListSqsCredentialsResponse\n */\n listSqsCredentials = (request = {}) => enrichForPagination('sqsCredentials', this.pageOfListSqsCredentials, request);\n}\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\nconst NatsApiCreateNatsAccountRequest = {\n name: {\n maxLength: 64,\n minLength: 1\n }\n};\nconst NatsApiCreateNatsCredentialsRequest = {\n name: {\n maxLength: 500,\n minLength: 1\n }\n};\nconst NatsApiUpdateNatsAccountRequest = {\n name: {\n maxLength: 64,\n minLength: 1\n }\n};\nconst SnsApiCreateSnsCredentialsRequest = {\n name: {\n maxLength: 500,\n minLength: 1\n }\n};\nconst SnsApiUpdateSnsCredentialsRequest = {\n name: {\n maxLength: 500,\n minLength: 1\n }\n};\nconst SqsApiCreateSqsCredentialsRequest = {\n name: {\n maxLength: 500,\n minLength: 1\n }\n};\nconst SqsApiUpdateSqsCredentialsRequest = {\n name: {\n maxLength: 500,\n minLength: 1\n }\n};\n\nvar validationRules_gen$2 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n NatsApiCreateNatsAccountRequest: NatsApiCreateNatsAccountRequest,\n NatsApiCreateNatsCredentialsRequest: NatsApiCreateNatsCredentialsRequest,\n NatsApiUpdateNatsAccountRequest: NatsApiUpdateNatsAccountRequest,\n SnsApiCreateSnsCredentialsRequest: SnsApiCreateSnsCredentialsRequest,\n SnsApiUpdateSnsCredentialsRequest: SnsApiUpdateSnsCredentialsRequest,\n SqsApiCreateSqsCredentialsRequest: SqsApiCreateSqsCredentialsRequest,\n SqsApiUpdateSqsCredentialsRequest: SqsApiUpdateSqsCredentialsRequest\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\nvar index_gen$a = /*#__PURE__*/Object.freeze({\n __proto__: null,\n NatsAPI: NatsAPI,\n SnsAPI: SnsAPI,\n SqsAPI: SqsAPI,\n ValidationRules: validationRules_gen$2\n});\n\nvar index$9 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n v1alpha1: index_gen$b,\n v1beta1: index_gen$a\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\n/** Lists transient statutes of the enum {@link DatabaseBackupStatus}. */\nconst DATABASE_BACKUP_TRANSIENT_STATUSES = ['creating', 'restoring', 'deleting', 'exporting'];\n\n/** Lists transient statutes of the enum {@link InstanceLogStatus}. */\nconst INSTANCE_LOG_TRANSIENT_STATUSES = ['creating'];\n\n/** Lists transient statutes of the enum {@link InstanceStatus}. */\nconst INSTANCE_TRANSIENT_STATUSES = ['provisioning', 'configuring', 'deleting', 'autohealing', 'initializing', 'backuping', 'snapshotting', 'restarting'];\n\n/** Lists transient statutes of the enum {@link MaintenanceStatus}. */\nconst MAINTENANCE_TRANSIENT_STATUSES = ['pending'];\n\n/** Lists transient statutes of the enum {@link ReadReplicaStatus}. */\nconst READ_REPLICA_TRANSIENT_STATUSES = ['provisioning', 'initializing', 'deleting', 'configuring', 'promoting'];\n\n/** Lists transient statutes of the enum {@link SnapshotStatus}. */\nconst SNAPSHOT_TRANSIENT_STATUSES = ['creating', 'restoring', 'deleting'];\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst unmarshalEndpointDirectAccessDetails = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'EndpointDirectAccessDetails' failed as data isn't a dictionary.`);\n }\n return {};\n};\nconst unmarshalEndpointLoadBalancerDetails = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'EndpointLoadBalancerDetails' failed as data isn't a dictionary.`);\n }\n return {};\n};\nconst unmarshalEndpointPrivateNetworkDetails = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'EndpointPrivateNetworkDetails' failed as data isn't a dictionary.`);\n }\n return {\n privateNetworkId: data.private_network_id,\n serviceIp: data.service_ip,\n zone: data.zone\n };\n};\nconst unmarshalEndpoint$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Endpoint' failed as data isn't a dictionary.`);\n }\n return {\n directAccess: data.direct_access ? unmarshalEndpointDirectAccessDetails(data.direct_access) : undefined,\n hostname: data.hostname,\n id: data.id,\n ip: data.ip,\n loadBalancer: data.load_balancer ? unmarshalEndpointLoadBalancerDetails(data.load_balancer) : undefined,\n name: data.name,\n port: data.port,\n privateNetwork: data.private_network ? unmarshalEndpointPrivateNetworkDetails(data.private_network) : undefined\n };\n};\nconst unmarshalEngineSetting = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'EngineSetting' failed as data isn't a dictionary.`);\n }\n return {\n defaultValue: data.default_value,\n description: data.description,\n floatMax: data.float_max,\n floatMin: data.float_min,\n hotConfigurable: data.hot_configurable,\n intMax: data.int_max,\n intMin: data.int_min,\n name: data.name,\n propertyType: data.property_type,\n stringConstraint: data.string_constraint,\n unit: data.unit\n };\n};\nconst unmarshalBackupSchedule = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'BackupSchedule' failed as data isn't a dictionary.`);\n }\n return {\n disabled: data.disabled,\n frequency: data.frequency,\n nextRunAt: unmarshalDate(data.next_run_at),\n retention: data.retention\n };\n};\nconst unmarshalEngineVersion = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'EngineVersion' failed as data isn't a dictionary.`);\n }\n return {\n availableInitSettings: unmarshalArrayOfObject(data.available_init_settings, unmarshalEngineSetting),\n availableSettings: unmarshalArrayOfObject(data.available_settings, unmarshalEngineSetting),\n beta: data.beta,\n disabled: data.disabled,\n endOfLife: unmarshalDate(data.end_of_life),\n name: data.name,\n version: data.version\n };\n};\nconst unmarshalInstanceSetting = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'InstanceSetting' failed as data isn't a dictionary.`);\n }\n return {\n name: data.name,\n value: data.value\n };\n};\nconst unmarshalLogsPolicy = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'LogsPolicy' failed as data isn't a dictionary.`);\n }\n return {\n maxAgeRetention: data.max_age_retention,\n totalDiskRetention: data.total_disk_retention\n };\n};\nconst unmarshalMaintenance = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Maintenance' failed as data isn't a dictionary.`);\n }\n return {\n closedAt: unmarshalDate(data.closed_at),\n reason: data.reason,\n startsAt: unmarshalDate(data.starts_at),\n status: data.status,\n stopsAt: unmarshalDate(data.stops_at)\n };\n};\nconst unmarshalNodeTypeVolumeConstraintSizes = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'NodeTypeVolumeConstraintSizes' failed as data isn't a dictionary.`);\n }\n return {\n maxSize: data.max_size,\n minSize: data.min_size\n };\n};\nconst unmarshalNodeTypeVolumeType = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'NodeTypeVolumeType' failed as data isn't a dictionary.`);\n }\n return {\n chunkSize: data.chunk_size,\n class: data.class,\n description: data.description,\n maxSize: data.max_size,\n minSize: data.min_size,\n type: data.type\n };\n};\nconst unmarshalReadReplica = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ReadReplica' failed as data isn't a dictionary.`);\n }\n return {\n endpoints: unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint$1),\n id: data.id,\n region: data.region,\n sameZone: data.same_zone,\n status: data.status\n };\n};\nconst unmarshalUpgradableVersion = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'UpgradableVersion' failed as data isn't a dictionary.`);\n }\n return {\n id: data.id,\n minorVersion: data.minor_version,\n name: data.name,\n version: data.version\n };\n};\nconst unmarshalVolume = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Volume' failed as data isn't a dictionary.`);\n }\n return {\n class: data.class,\n size: data.size,\n type: data.type\n };\n};\nconst unmarshalACLRule$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ACLRule' failed as data isn't a dictionary.`);\n }\n return {\n action: data.action,\n description: data.description,\n direction: data.direction,\n ip: data.ip,\n port: data.port,\n protocol: data.protocol\n };\n};\nconst unmarshalDatabase = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Database' failed as data isn't a dictionary.`);\n }\n return {\n managed: data.managed,\n name: data.name,\n owner: data.owner,\n size: data.size\n };\n};\nconst unmarshalDatabaseBackup = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'DatabaseBackup' failed as data isn't a dictionary.`);\n }\n return {\n createdAt: unmarshalDate(data.created_at),\n databaseName: data.database_name,\n downloadUrl: data.download_url,\n downloadUrlExpiresAt: unmarshalDate(data.download_url_expires_at),\n expiresAt: unmarshalDate(data.expires_at),\n id: data.id,\n instanceId: data.instance_id,\n instanceName: data.instance_name,\n name: data.name,\n region: data.region,\n sameRegion: data.same_region,\n size: data.size,\n status: data.status,\n updatedAt: unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalDatabaseEngine = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'DatabaseEngine' failed as data isn't a dictionary.`);\n }\n return {\n logoUrl: data.logo_url,\n name: data.name,\n region: data.region,\n versions: unmarshalArrayOfObject(data.versions, unmarshalEngineVersion)\n };\n};\nconst unmarshalInstance = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Instance' failed as data isn't a dictionary.`);\n }\n return {\n backupSameRegion: data.backup_same_region,\n backupSchedule: data.backup_schedule ? unmarshalBackupSchedule(data.backup_schedule) : undefined,\n createdAt: unmarshalDate(data.created_at),\n endpoint: data.endpoint ? unmarshalEndpoint$1(data.endpoint) : undefined,\n endpoints: unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint$1),\n engine: data.engine,\n id: data.id,\n initSettings: unmarshalArrayOfObject(data.init_settings, unmarshalInstanceSetting),\n isHaCluster: data.is_ha_cluster,\n logsPolicy: data.logs_policy ? unmarshalLogsPolicy(data.logs_policy) : undefined,\n maintenances: unmarshalArrayOfObject(data.maintenances, unmarshalMaintenance),\n name: data.name,\n nodeType: data.node_type,\n organizationId: data.organization_id,\n projectId: data.project_id,\n readReplicas: unmarshalArrayOfObject(data.read_replicas, unmarshalReadReplica),\n region: data.region,\n settings: unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting),\n status: data.status,\n tags: data.tags,\n upgradableVersion: unmarshalArrayOfObject(data.upgradable_version, unmarshalUpgradableVersion),\n volume: data.volume ? unmarshalVolume(data.volume) : undefined\n };\n};\nconst unmarshalInstanceLog = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'InstanceLog' failed as data isn't a dictionary.`);\n }\n return {\n createdAt: unmarshalDate(data.created_at),\n downloadUrl: data.download_url,\n expiresAt: unmarshalDate(data.expires_at),\n id: data.id,\n nodeName: data.node_name,\n region: data.region,\n status: data.status\n };\n};\nconst unmarshalListInstanceLogsDetailsResponseInstanceLogDetail = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListInstanceLogsDetailsResponseInstanceLogDetail' failed as data isn't a dictionary.`);\n }\n return {\n logName: data.log_name,\n size: data.size\n };\n};\nconst unmarshalNodeType$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'NodeType' failed as data isn't a dictionary.`);\n }\n return {\n availableVolumeTypes: unmarshalArrayOfObject(data.available_volume_types, unmarshalNodeTypeVolumeType),\n beta: data.beta,\n description: data.description,\n disabled: data.disabled,\n generation: data.generation,\n instanceRange: data.instance_range,\n isBssdCompatible: data.is_bssd_compatible,\n isHaRequired: data.is_ha_required,\n memory: data.memory,\n name: data.name,\n region: data.region,\n stockStatus: data.stock_status,\n vcpus: data.vcpus,\n volumeConstraint: data.volume_constraint ? unmarshalNodeTypeVolumeConstraintSizes(data.volume_constraint) : undefined\n };\n};\nconst unmarshalPrivilege = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Privilege' failed as data isn't a dictionary.`);\n }\n return {\n databaseName: data.database_name,\n permission: data.permission,\n userName: data.user_name\n };\n};\nconst unmarshalSnapshot = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Snapshot' failed as data isn't a dictionary.`);\n }\n return {\n createdAt: unmarshalDate(data.created_at),\n expiresAt: unmarshalDate(data.expires_at),\n id: data.id,\n instanceId: data.instance_id,\n instanceName: data.instance_name,\n name: data.name,\n nodeType: data.node_type,\n region: data.region,\n size: data.size,\n status: data.status,\n updatedAt: unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalUser = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'User' failed as data isn't a dictionary.`);\n }\n return {\n isAdmin: data.is_admin,\n name: data.name\n };\n};\nconst unmarshalAddInstanceACLRulesResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'AddInstanceACLRulesResponse' failed as data isn't a dictionary.`);\n }\n return {\n rules: unmarshalArrayOfObject(data.rules, unmarshalACLRule$1)\n };\n};\nconst unmarshalAddInstanceSettingsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'AddInstanceSettingsResponse' failed as data isn't a dictionary.`);\n }\n return {\n settings: unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting)\n };\n};\nconst unmarshalDeleteInstanceACLRulesResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'DeleteInstanceACLRulesResponse' failed as data isn't a dictionary.`);\n }\n return {\n rules: unmarshalArrayOfObject(data.rules, unmarshalACLRule$1)\n };\n};\nconst unmarshalDeleteInstanceSettingsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'DeleteInstanceSettingsResponse' failed as data isn't a dictionary.`);\n }\n return {\n settings: unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting)\n };\n};\nconst unmarshalInstanceMetrics = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'InstanceMetrics' failed as data isn't a dictionary.`);\n }\n return {\n timeseries: unmarshalArrayOfObject(data.timeseries, unmarshalTimeSeries)\n };\n};\nconst unmarshalListDatabaseBackupsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListDatabaseBackupsResponse' failed as data isn't a dictionary.`);\n }\n return {\n databaseBackups: unmarshalArrayOfObject(data.database_backups, unmarshalDatabaseBackup),\n totalCount: data.total_count\n };\n};\nconst unmarshalListDatabaseEnginesResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListDatabaseEnginesResponse' failed as data isn't a dictionary.`);\n }\n return {\n engines: unmarshalArrayOfObject(data.engines, unmarshalDatabaseEngine),\n totalCount: data.total_count\n };\n};\nconst unmarshalListDatabasesResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListDatabasesResponse' failed as data isn't a dictionary.`);\n }\n return {\n databases: unmarshalArrayOfObject(data.databases, unmarshalDatabase),\n totalCount: data.total_count\n };\n};\nconst unmarshalListInstanceACLRulesResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListInstanceACLRulesResponse' failed as data isn't a dictionary.`);\n }\n return {\n rules: unmarshalArrayOfObject(data.rules, unmarshalACLRule$1),\n totalCount: data.total_count\n };\n};\nconst unmarshalListInstanceLogsDetailsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListInstanceLogsDetailsResponse' failed as data isn't a dictionary.`);\n }\n return {\n details: unmarshalArrayOfObject(data.details, unmarshalListInstanceLogsDetailsResponseInstanceLogDetail)\n };\n};\nconst unmarshalListInstanceLogsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListInstanceLogsResponse' failed as data isn't a dictionary.`);\n }\n return {\n instanceLogs: unmarshalArrayOfObject(data.instance_logs, unmarshalInstanceLog)\n };\n};\nconst unmarshalListInstancesResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListInstancesResponse' failed as data isn't a dictionary.`);\n }\n return {\n instances: unmarshalArrayOfObject(data.instances, unmarshalInstance),\n totalCount: data.total_count\n };\n};\nconst unmarshalListNodeTypesResponse$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListNodeTypesResponse' failed as data isn't a dictionary.`);\n }\n return {\n nodeTypes: unmarshalArrayOfObject(data.node_types, unmarshalNodeType$1),\n totalCount: data.total_count\n };\n};\nconst unmarshalListPrivilegesResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListPrivilegesResponse' failed as data isn't a dictionary.`);\n }\n return {\n privileges: unmarshalArrayOfObject(data.privileges, unmarshalPrivilege),\n totalCount: data.total_count\n };\n};\nconst unmarshalListSnapshotsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListSnapshotsResponse' failed as data isn't a dictionary.`);\n }\n return {\n snapshots: unmarshalArrayOfObject(data.snapshots, unmarshalSnapshot),\n totalCount: data.total_count\n };\n};\nconst unmarshalListUsersResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListUsersResponse' failed as data isn't a dictionary.`);\n }\n return {\n totalCount: data.total_count,\n users: unmarshalArrayOfObject(data.users, unmarshalUser)\n };\n};\nconst unmarshalPrepareInstanceLogsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'PrepareInstanceLogsResponse' failed as data isn't a dictionary.`);\n }\n return {\n instanceLogs: unmarshalArrayOfObject(data.instance_logs, unmarshalInstanceLog)\n };\n};\nconst unmarshalSetInstanceACLRulesResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'SetInstanceACLRulesResponse' failed as data isn't a dictionary.`);\n }\n return {\n rules: unmarshalArrayOfObject(data.rules, unmarshalACLRule$1)\n };\n};\nconst unmarshalSetInstanceSettingsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'SetInstanceSettingsResponse' failed as data isn't a dictionary.`);\n }\n return {\n settings: unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting)\n };\n};\nconst marshalEndpointSpecPrivateNetworkIpamConfig = (request, defaults) => ({});\nconst marshalReadReplicaEndpointSpecPrivateNetworkIpamConfig = (request, defaults) => ({});\nconst marshalEndpointSpecLoadBalancer = (request, defaults) => ({});\nconst marshalEndpointSpecPrivateNetwork = (request, defaults) => ({\n private_network_id: request.privateNetworkId,\n ...resolveOneOf([{\n param: 'service_ip',\n value: request.serviceIp\n }, {\n param: 'ipam_config',\n value: request.ipamConfig ? marshalEndpointSpecPrivateNetworkIpamConfig(request.ipamConfig) : undefined\n }])\n});\nconst marshalReadReplicaEndpointSpecDirectAccess = (request, defaults) => ({});\nconst marshalReadReplicaEndpointSpecPrivateNetwork = (request, defaults) => ({\n private_network_id: request.privateNetworkId,\n ...resolveOneOf([{\n param: 'service_ip',\n value: request.serviceIp\n }, {\n param: 'ipam_config',\n value: request.ipamConfig ? marshalReadReplicaEndpointSpecPrivateNetworkIpamConfig(request.ipamConfig) : undefined\n }])\n});\nconst marshalACLRuleRequest = (request, defaults) => ({\n description: request.description,\n ip: request.ip\n});\nconst marshalEndpointSpec$1 = (request, defaults) => ({\n ...resolveOneOf([{\n param: 'load_balancer',\n value: request.loadBalancer ? marshalEndpointSpecLoadBalancer(request.loadBalancer) : undefined\n }, {\n param: 'private_network',\n value: request.privateNetwork ? marshalEndpointSpecPrivateNetwork(request.privateNetwork) : undefined\n }])\n});\nconst marshalInstanceSetting = (request, defaults) => ({\n name: request.name,\n value: request.value\n});\nconst marshalLogsPolicy = (request, defaults) => ({\n max_age_retention: request.maxAgeRetention,\n total_disk_retention: request.totalDiskRetention\n});\nconst marshalReadReplicaEndpointSpec = (request, defaults) => ({\n ...resolveOneOf([{\n param: 'direct_access',\n value: request.directAccess ? marshalReadReplicaEndpointSpecDirectAccess(request.directAccess) : undefined\n }, {\n param: 'private_network',\n value: request.privateNetwork ? marshalReadReplicaEndpointSpecPrivateNetwork(request.privateNetwork) : undefined\n }])\n});\nconst marshalAddInstanceACLRulesRequest = (request, defaults) => ({\n rules: request.rules.map(elt => marshalACLRuleRequest(elt))\n});\nconst marshalAddInstanceSettingsRequest = (request, defaults) => ({\n settings: request.settings.map(elt => marshalInstanceSetting(elt))\n});\nconst marshalCloneInstanceRequest = (request, defaults) => ({\n name: request.name,\n node_type: request.nodeType\n});\nconst marshalCreateDatabaseBackupRequest = (request, defaults) => ({\n database_name: request.databaseName,\n expires_at: request.expiresAt,\n instance_id: request.instanceId,\n name: request.name || randomName('bkp')\n});\nconst marshalCreateDatabaseRequest = (request, defaults) => ({\n name: request.name\n});\nconst marshalCreateEndpointRequest = (request, defaults) => ({\n endpoint_spec: request.endpointSpec ? marshalEndpointSpec$1(request.endpointSpec) : undefined\n});\nconst marshalCreateInstanceFromSnapshotRequest = (request, defaults) => ({\n instance_name: request.instanceName,\n is_ha_cluster: request.isHaCluster,\n node_type: request.nodeType\n});\nconst marshalCreateInstanceRequest = (request, defaults) => ({\n backup_same_region: request.backupSameRegion,\n disable_backup: request.disableBackup,\n engine: request.engine,\n init_endpoints: request.initEndpoints ? request.initEndpoints.map(elt => marshalEndpointSpec$1(elt)) : undefined,\n init_settings: request.initSettings ? request.initSettings.map(elt => marshalInstanceSetting(elt)) : undefined,\n is_ha_cluster: request.isHaCluster,\n name: request.name || randomName('ins'),\n node_type: request.nodeType,\n password: request.password,\n tags: request.tags,\n user_name: request.userName,\n volume_size: request.volumeSize,\n volume_type: request.volumeType ?? 'lssd',\n ...resolveOneOf([{\n default: defaults.defaultProjectId,\n param: 'project_id',\n value: request.projectId\n }, {\n default: defaults.defaultOrganizationId,\n param: 'organization_id',\n value: request.organizationId\n }])\n});\nconst marshalCreateReadReplicaEndpointRequest = (request, defaults) => ({\n endpoint_spec: request.endpointSpec.map(elt => marshalReadReplicaEndpointSpec(elt))\n});\nconst marshalCreateReadReplicaRequest = (request, defaults) => ({\n endpoint_spec: request.endpointSpec ? request.endpointSpec.map(elt => marshalReadReplicaEndpointSpec(elt)) : undefined,\n instance_id: request.instanceId,\n same_zone: request.sameZone\n});\nconst marshalCreateSnapshotRequest = (request, defaults) => ({\n expires_at: request.expiresAt,\n name: request.name || randomName('snp')\n});\nconst marshalCreateUserRequest = (request, defaults) => ({\n is_admin: request.isAdmin,\n name: request.name,\n password: request.password\n});\nconst marshalDeleteInstanceACLRulesRequest = (request, defaults) => ({\n acl_rule_ips: request.aclRuleIps\n});\nconst marshalDeleteInstanceSettingsRequest = (request, defaults) => ({\n setting_names: request.settingNames\n});\nconst marshalMigrateEndpointRequest = (request, defaults) => ({\n instance_id: request.instanceId\n});\nconst marshalPrepareInstanceLogsRequest = (request, defaults) => ({\n end_date: request.endDate,\n start_date: request.startDate\n});\nconst marshalPurgeInstanceLogsRequest = (request, defaults) => ({\n log_name: request.logName\n});\nconst marshalRestoreDatabaseBackupRequest = (request, defaults) => ({\n database_name: request.databaseName,\n instance_id: request.instanceId\n});\nconst marshalSetInstanceACLRulesRequest = (request, defaults) => ({\n rules: request.rules.map(elt => marshalACLRuleRequest(elt))\n});\nconst marshalSetInstanceSettingsRequest = (request, defaults) => ({\n settings: request.settings.map(elt => marshalInstanceSetting(elt))\n});\nconst marshalSetPrivilegeRequest = (request, defaults) => ({\n database_name: request.databaseName,\n permission: request.permission ?? 'readonly',\n user_name: request.userName\n});\nconst marshalUpdateDatabaseBackupRequest = (request, defaults) => ({\n expires_at: request.expiresAt,\n name: request.name\n});\nconst marshalUpdateInstanceRequest = (request, defaults) => ({\n backup_same_region: request.backupSameRegion,\n backup_schedule_frequency: request.backupScheduleFrequency,\n backup_schedule_retention: request.backupScheduleRetention,\n backup_schedule_start_hour: request.backupScheduleStartHour,\n is_backup_schedule_disabled: request.isBackupScheduleDisabled,\n logs_policy: request.logsPolicy ? marshalLogsPolicy(request.logsPolicy) : undefined,\n name: request.name,\n tags: request.tags\n});\nconst marshalUpdateSnapshotRequest = (request, defaults) => ({\n expires_at: request.expiresAt,\n name: request.name\n});\nconst marshalUpdateUserRequest = (request, defaults) => ({\n is_admin: request.isAdmin,\n password: request.password\n});\nconst marshalUpgradeInstanceRequest = (request, defaults) => ({\n ...resolveOneOf([{\n param: 'node_type',\n value: request.nodeType\n }, {\n param: 'enable_ha',\n value: request.enableHa\n }, {\n param: 'volume_size',\n value: request.volumeSize\n }, {\n param: 'volume_type',\n value: request.volumeType\n }, {\n param: 'upgradable_version_id',\n value: request.upgradableVersionId\n }])\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst jsonContentHeaders$9 = {\n 'Content-Type': 'application/json; charset=utf-8'\n};\n\n/** Managed Database for PostgreSQL and MySQL API. */\nlet API$9 = class API extends API$u {\n /** Lists the available regions of the API. */\n static LOCALITIES = ['fr-par', 'nl-ams', 'pl-waw'];\n pageOfListDatabaseEngines = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/database-engines`,\n urlParams: urlParams(['name', request.name], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['version', request.version])\n }, unmarshalListDatabaseEnginesResponse);\n\n /**\n * List available database engines. List the PostgreSQL and MySQL database\n * engines available at Scaleway.\n *\n * @param request - The request {@link ListDatabaseEnginesRequest}\n * @returns A Promise of ListDatabaseEnginesResponse\n */\n listDatabaseEngines = (request = {}) => enrichForPagination('engines', this.pageOfListDatabaseEngines, request);\n pageOfListNodeTypes = request => this.client.fetch({\n method: 'GET',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/node-types`,\n urlParams: urlParams(['include_disabled_types', request.includeDisabledTypes], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])\n }, unmarshalListNodeTypesResponse$1);\n\n /**\n * List available node types. List all available node types. By default, the\n * node types returned in the list are ordered by creation date in ascending\n * order, though this can be modified via the `order_by` field.\n *\n * @param request - The request {@link ListNodeTypesRequest}\n * @returns A Promise of ListNodeTypesResponse\n */\n listNodeTypes = request => enrichForPagination('nodeTypes', this.pageOfListNodeTypes, request);\n pageOfListDatabaseBackups = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/backups`,\n urlParams: urlParams(['instance_id', request.instanceId], ['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])\n }, unmarshalListDatabaseBackupsResponse);\n\n /**\n * List database backups. List all backups in a specified region, for a given\n * Scaleway Organization or Scaleway Project. By default, the backups listed\n * are ordered by creation date in ascending order. This can be modified via\n * the `order_by` field.\n *\n * @param request - The request {@link ListDatabaseBackupsRequest}\n * @returns A Promise of ListDatabaseBackupsResponse\n */\n listDatabaseBackups = (request = {}) => enrichForPagination('databaseBackups', this.pageOfListDatabaseBackups, request);\n\n /**\n * Create a database backup. Create a new backup. You must set the\n * `instance_id`, `database_name`, `name` and `expires_at` parameters.\n *\n * @param request - The request {@link CreateDatabaseBackupRequest}\n * @returns A Promise of DatabaseBackup\n */\n createDatabaseBackup = request => this.client.fetch({\n body: JSON.stringify(marshalCreateDatabaseBackupRequest(request, this.client.settings)),\n headers: jsonContentHeaders$9,\n method: 'POST',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/backups`\n }, unmarshalDatabaseBackup);\n\n /**\n * Get a database backup. Retrieve information about a given backup, specified\n * by its database backup ID and region. Full details about the backup, like\n * size, URL and expiration date, are returned in the response.\n *\n * @param request - The request {@link GetDatabaseBackupRequest}\n * @returns A Promise of DatabaseBackup\n */\n getDatabaseBackup = request => this.client.fetch({\n method: 'GET',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/backups/${validatePathParam('databaseBackupId', request.databaseBackupId)}`\n }, unmarshalDatabaseBackup);\n\n /**\n * Waits for {@link DatabaseBackup} to be in a final state.\n *\n * @param request - The request {@link GetDatabaseBackupRequest}\n * @param options - The waiting options\n * @returns A Promise of DatabaseBackup\n */\n waitForDatabaseBackup = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!DATABASE_BACKUP_TRANSIENT_STATUSES.includes(res.status))), this.getDatabaseBackup, request, options);\n\n /**\n * Update a database backup. Update the parameters of a backup, including name\n * and expiration date.\n *\n * @param request - The request {@link UpdateDatabaseBackupRequest}\n * @returns A Promise of DatabaseBackup\n */\n updateDatabaseBackup = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateDatabaseBackupRequest(request, this.client.settings)),\n headers: jsonContentHeaders$9,\n method: 'PATCH',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/backups/${validatePathParam('databaseBackupId', request.databaseBackupId)}`\n }, unmarshalDatabaseBackup);\n\n /**\n * Delete a database backup. Delete a backup, specified by its database backup\n * ID and region. Deleting a backup is permanent, and cannot be undone.\n *\n * @param request - The request {@link DeleteDatabaseBackupRequest}\n * @returns A Promise of DatabaseBackup\n */\n deleteDatabaseBackup = request => this.client.fetch({\n method: 'DELETE',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/backups/${validatePathParam('databaseBackupId', request.databaseBackupId)}`\n }, unmarshalDatabaseBackup);\n\n /**\n * Restore a database backup. Launch the process of restoring database backup.\n * You must specify the `instance_id` of the Database Instance of destination,\n * where the backup will be restored. Note that large database backups can\n * take up to several hours to restore.\n *\n * @param request - The request {@link RestoreDatabaseBackupRequest}\n * @returns A Promise of DatabaseBackup\n */\n restoreDatabaseBackup = request => this.client.fetch({\n body: JSON.stringify(marshalRestoreDatabaseBackupRequest(request, this.client.settings)),\n headers: jsonContentHeaders$9,\n method: 'POST',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/backups/${validatePathParam('databaseBackupId', request.databaseBackupId)}/restore`\n }, unmarshalDatabaseBackup);\n\n /**\n * Export a database backup. Export a backup, specified by the\n * `database_backup_id` and the `region` parameters. The download URL is\n * returned in the response.\n *\n * @param request - The request {@link ExportDatabaseBackupRequest}\n * @returns A Promise of DatabaseBackup\n */\n exportDatabaseBackup = request => this.client.fetch({\n body: '{}',\n headers: jsonContentHeaders$9,\n method: 'POST',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/backups/${validatePathParam('databaseBackupId', request.databaseBackupId)}/export`\n }, unmarshalDatabaseBackup);\n\n /**\n * Upgrade a Database Instance. Upgrade your current Database Instance\n * specifications like node type, high availability, volume, or the database\n * engine version. Note that upon upgrade the `enable_ha` parameter can only\n * be set to `true`.\n *\n * @param request - The request {@link UpgradeInstanceRequest}\n * @returns A Promise of Instance\n */\n upgradeInstance = request => this.client.fetch({\n body: JSON.stringify(marshalUpgradeInstanceRequest(request, this.client.settings)),\n headers: jsonContentHeaders$9,\n method: 'POST',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/upgrade`\n }, unmarshalInstance);\n pageOfListInstances = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances`,\n urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId], ['tags', request.tags])\n }, unmarshalListInstancesResponse);\n\n /**\n * List Database Instances. List all Database Instances in the specified\n * region, for a given Scaleway Organization or Scaleway Project. By default,\n * the Database Instances returned in the list are ordered by creation date in\n * ascending order, though this can be modified via the order_by field. You\n * can define additional parameters for your query, such as `tags` and `name`.\n * For the `name` parameter, the value you include will be checked against the\n * whole name string to see if it includes the string you put in the\n * parameter.\n *\n * @param request - The request {@link ListInstancesRequest}\n * @returns A Promise of ListInstancesResponse\n */\n listInstances = (request = {}) => enrichForPagination('instances', this.pageOfListInstances, request);\n\n /**\n * Get a Database Instance. Retrieve information about a given Database\n * Instance, specified by the `region` and `instance_id` parameters. Its full\n * details, including name, status, IP address and port, are returned in the\n * response object.\n *\n * @param request - The request {@link GetInstanceRequest}\n * @returns A Promise of Instance\n */\n getInstance = request => this.client.fetch({\n method: 'GET',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}`\n }, unmarshalInstance);\n\n /**\n * Waits for {@link Instance} to be in a final state.\n *\n * @param request - The request {@link GetInstanceRequest}\n * @param options - The waiting options\n * @returns A Promise of Instance\n */\n waitForInstance = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!INSTANCE_TRANSIENT_STATUSES.includes(res.status))), this.getInstance, request, options);\n\n /**\n * Create a Database Instance. Create a new Database Instance. You must set\n * the `engine`, `user_name`, `password` and `node_type` parameters.\n * Optionally, you can specify the volume type and size.\n *\n * @param request - The request {@link CreateInstanceRequest}\n * @returns A Promise of Instance\n */\n createInstance = request => this.client.fetch({\n body: JSON.stringify(marshalCreateInstanceRequest(request, this.client.settings)),\n headers: jsonContentHeaders$9,\n method: 'POST',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances`\n }, unmarshalInstance);\n\n /**\n * Update a Database Instance. Update the parameters of a Database Instance,\n * including name, tags and backup schedule details.\n *\n * @param request - The request {@link UpdateInstanceRequest}\n * @returns A Promise of Instance\n */\n updateInstance = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateInstanceRequest(request, this.client.settings)),\n headers: jsonContentHeaders$9,\n method: 'PATCH',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}`\n }, unmarshalInstance);\n\n /**\n * Delete a Database Instance. Delete a given Database Instance, specified by\n * the `region` and `instance_id` parameters. Deleting a Database Instance is\n * permanent, and cannot be undone. Note that upon deletion all your data will\n * be lost.\n *\n * @param request - The request {@link DeleteInstanceRequest}\n * @returns A Promise of Instance\n */\n deleteInstance = request => this.client.fetch({\n method: 'DELETE',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}`\n }, unmarshalInstance);\n\n /**\n * Clone a Database Instance. Clone a given Database Instance, specified by\n * the `region` and `instance_id` parameters. The clone feature allows you to\n * create a new Database Instance from an existing one. The clone includes all\n * existing databases, users and permissions. You can create a clone on a\n * Database Instance bigger than your current one.\n *\n * @param request - The request {@link CloneInstanceRequest}\n * @returns A Promise of Instance\n */\n cloneInstance = request => this.client.fetch({\n body: JSON.stringify(marshalCloneInstanceRequest(request, this.client.settings)),\n headers: jsonContentHeaders$9,\n method: 'POST',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/clone`\n }, unmarshalInstance);\n\n /**\n * Restart Database Instance. Restart a given Database Instance, specified by\n * the `region` and `instance_id` parameters. The status of the Database\n * Instance returned in the response.\n *\n * @param request - The request {@link RestartInstanceRequest}\n * @returns A Promise of Instance\n */\n restartInstance = request => this.client.fetch({\n body: '{}',\n headers: jsonContentHeaders$9,\n method: 'POST',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/restart`\n }, unmarshalInstance);\n\n /**\n * Get the TLS certificate of a Database Instance. Retrieve information about\n * the TLS certificate of a given Database Instance. Details like name and\n * content are returned in the response.\n *\n * @param request - The request {@link GetInstanceCertificateRequest}\n * @returns A Promise of Blob\n */\n getInstanceCertificate = request => this.client.fetch({\n method: 'GET',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/certificate`,\n urlParams: urlParams(['dl', 1]),\n responseType: 'blob'\n });\n\n /**\n * Renew the TLS certificate of a Database Instance. Renew a TLS for a\n * Database Instance. Renewing a certificate means that you will not be able\n * to connect to your Database Instance using the previous certificate. You\n * will also need to download and update the new certificate for all database\n * clients.\n *\n * @param request - The request {@link RenewInstanceCertificateRequest}\n */\n renewInstanceCertificate = request => this.client.fetch({\n body: '{}',\n headers: jsonContentHeaders$9,\n method: 'POST',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/renew-certificate`\n });\n\n /**\n * Get Database Instance metrics. Retrieve the time series metrics of a given\n * Database Instance. You can define the period from which to retrieve metrics\n * by specifying the `start_date` and `end_date`.\n *\n * @param request - The request {@link GetInstanceMetricsRequest}\n * @returns A Promise of InstanceMetrics\n */\n getInstanceMetrics = request => this.client.fetch({\n method: 'GET',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/metrics`,\n urlParams: urlParams(['end_date', request.endDate], ['metric_name', request.metricName], ['start_date', request.startDate])\n }, unmarshalInstanceMetrics);\n\n /**\n * Create a Read Replica. Create a new Read Replica of a Database Instance.\n * You must specify the `region` and the `instance_id`. You can only create a\n * maximum of 3 Read Replicas per Database Instance.\n *\n * @param request - The request {@link CreateReadReplicaRequest}\n * @returns A Promise of ReadReplica\n */\n createReadReplica = request => this.client.fetch({\n body: JSON.stringify(marshalCreateReadReplicaRequest(request, this.client.settings)),\n headers: jsonContentHeaders$9,\n method: 'POST',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/read-replicas`\n }, unmarshalReadReplica);\n\n /**\n * Get a Read Replica. Retrieve information about a Database Instance Read\n * Replica. Full details about the Read Replica, like `endpoints`, `status`\n * and `region` are returned in the response.\n *\n * @param request - The request {@link GetReadReplicaRequest}\n * @returns A Promise of ReadReplica\n */\n getReadReplica = request => this.client.fetch({\n method: 'GET',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/read-replicas/${validatePathParam('readReplicaId', request.readReplicaId)}`\n }, unmarshalReadReplica);\n\n /**\n * Waits for {@link ReadReplica} to be in a final state.\n *\n * @param request - The request {@link GetReadReplicaRequest}\n * @param options - The waiting options\n * @returns A Promise of ReadReplica\n */\n waitForReadReplica = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!READ_REPLICA_TRANSIENT_STATUSES.includes(res.status))), this.getReadReplica, request, options);\n\n /**\n * Delete a Read Replica. Delete a Read Replica of a Database Instance. You\n * must specify the `region` and `read_replica_id` parameters of the Read\n * Replica you want to delete.\n *\n * @param request - The request {@link DeleteReadReplicaRequest}\n * @returns A Promise of ReadReplica\n */\n deleteReadReplica = request => this.client.fetch({\n method: 'DELETE',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/read-replicas/${validatePathParam('readReplicaId', request.readReplicaId)}`\n }, unmarshalReadReplica);\n\n /**\n * Resync a Read Replica. When you resync a Read Replica, first it is reset,\n * then its data is resynchronized from the primary node. Your Read Replica\n * remains unavailable during the resync process. The duration of this process\n * is proportional to the size of your Database Instance. The configured\n * endpoints do not change.\n *\n * @param request - The request {@link ResetReadReplicaRequest}\n * @returns A Promise of ReadReplica\n */\n resetReadReplica = request => this.client.fetch({\n body: '{}',\n headers: jsonContentHeaders$9,\n method: 'POST',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/read-replicas/${validatePathParam('readReplicaId', request.readReplicaId)}/reset`\n }, unmarshalReadReplica);\n\n /**\n * Promote a Read Replica. Promote a Read Replica to Database Instance\n * automatically.\n *\n * @param request - The request {@link PromoteReadReplicaRequest}\n * @returns A Promise of Instance\n */\n promoteReadReplica = request => this.client.fetch({\n body: '{}',\n headers: jsonContentHeaders$9,\n method: 'POST',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/read-replicas/${validatePathParam('readReplicaId', request.readReplicaId)}/promote`\n }, unmarshalInstance);\n\n /**\n * Create an endpoint for a Read Replica. Create a new endpoint for a Read\n * Replica. Read Replicas can have at most one direct access and one Private\n * Network endpoint.\n *\n * @param request - The request {@link CreateReadReplicaEndpointRequest}\n * @returns A Promise of ReadReplica\n */\n createReadReplicaEndpoint = request => this.client.fetch({\n body: JSON.stringify(marshalCreateReadReplicaEndpointRequest(request, this.client.settings)),\n headers: jsonContentHeaders$9,\n method: 'POST',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/read-replicas/${validatePathParam('readReplicaId', request.readReplicaId)}/endpoints`\n }, unmarshalReadReplica);\n\n /**\n * Prepare logs of a Database Instance. Prepare your Database Instance logs.\n * You can define the `start_date` and `end_date` parameters for your query.\n * The download URL is returned in the response. Logs are recorded from 00h00\n * to 23h59 and then aggregated in a `.log` file once a day. Therefore, even\n * if you specify a timeframe from which you want to get the logs, you will\n * receive logs from the full 24 hours.\n *\n * @param request - The request {@link PrepareInstanceLogsRequest}\n * @returns A Promise of PrepareInstanceLogsResponse\n */\n prepareInstanceLogs = request => this.client.fetch({\n body: JSON.stringify(marshalPrepareInstanceLogsRequest(request, this.client.settings)),\n headers: jsonContentHeaders$9,\n method: 'POST',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/prepare-logs`\n }, unmarshalPrepareInstanceLogsResponse);\n\n /**\n * List available logs of a Database Instance. List the available logs of a\n * Database Instance. By default, the logs returned in the list are ordered by\n * creation date in ascending order, though this can be modified via the\n * order_by field.\n *\n * @param request - The request {@link ListInstanceLogsRequest}\n * @returns A Promise of ListInstanceLogsResponse\n */\n listInstanceLogs = request => this.client.fetch({\n method: 'GET',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/logs`,\n urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'])\n }, unmarshalListInstanceLogsResponse);\n\n /**\n * Get given logs of a Database Instance. Retrieve information about the logs\n * of a Database Instance. Specify the `instance_log_id` and `region` in your\n * request to get information such as `download_url`, `status`, `expires_at`\n * and `created_at` about your logs in the response.\n *\n * @param request - The request {@link GetInstanceLogRequest}\n * @returns A Promise of InstanceLog\n */\n getInstanceLog = request => this.client.fetch({\n method: 'GET',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/logs/${validatePathParam('instanceLogId', request.instanceLogId)}`\n }, unmarshalInstanceLog);\n\n /**\n * Waits for {@link InstanceLog} to be in a final state.\n *\n * @param request - The request {@link GetInstanceLogRequest}\n * @param options - The waiting options\n * @returns A Promise of InstanceLog\n */\n waitForInstanceLog = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!INSTANCE_LOG_TRANSIENT_STATUSES.includes(res.status))), this.getInstanceLog, request, options);\n\n /**\n * Purge remote Database Instance logs. Purge a given remote log from a\n * Database Instance. You can specify the `log_name` of the log you wish to\n * clean from your Database Instance.\n *\n * @param request - The request {@link PurgeInstanceLogsRequest}\n */\n purgeInstanceLogs = request => this.client.fetch({\n body: JSON.stringify(marshalPurgeInstanceLogsRequest(request, this.client.settings)),\n headers: jsonContentHeaders$9,\n method: 'POST',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/purge-logs`\n });\n\n /**\n * List remote Database Instance logs details. List remote log details. By\n * default, the details returned in the list are ordered by creation date in\n * ascending order, though this can be modified via the order_by field.\n *\n * @param request - The request {@link ListInstanceLogsDetailsRequest}\n * @returns A Promise of ListInstanceLogsDetailsResponse\n */\n listInstanceLogsDetails = request => this.client.fetch({\n method: 'GET',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/logs-details`\n }, unmarshalListInstanceLogsDetailsResponse);\n\n /**\n * Add Database Instance advanced settings. Add an advanced setting to a\n * Database Instance. You must set the `name` and the `value` of each\n * setting.\n *\n * @param request - The request {@link AddInstanceSettingsRequest}\n * @returns A Promise of AddInstanceSettingsResponse\n */\n addInstanceSettings = request => this.client.fetch({\n body: JSON.stringify(marshalAddInstanceSettingsRequest(request, this.client.settings)),\n headers: jsonContentHeaders$9,\n method: 'POST',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/settings`\n }, unmarshalAddInstanceSettingsResponse);\n\n /**\n * Delete Database Instance advanced settings. Delete an advanced setting in a\n * Database Instance. You must specify the names of the settings you want to\n * delete in the request.\n *\n * @param request - The request {@link DeleteInstanceSettingsRequest}\n * @returns A Promise of DeleteInstanceSettingsResponse\n */\n deleteInstanceSettings = request => this.client.fetch({\n body: JSON.stringify(marshalDeleteInstanceSettingsRequest(request, this.client.settings)),\n headers: jsonContentHeaders$9,\n method: 'DELETE',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/settings`\n }, unmarshalDeleteInstanceSettingsResponse);\n\n /**\n * Set Database Instance advanced settings. Update an advanced setting for a\n * Database Instance. Settings added upon database engine initalization can\n * only be defined once, and cannot, therefore, be updated.\n *\n * @param request - The request {@link SetInstanceSettingsRequest}\n * @returns A Promise of SetInstanceSettingsResponse\n */\n setInstanceSettings = request => this.client.fetch({\n body: JSON.stringify(marshalSetInstanceSettingsRequest(request, this.client.settings)),\n headers: jsonContentHeaders$9,\n method: 'PUT',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/settings`\n }, unmarshalSetInstanceSettingsResponse);\n pageOfListInstanceACLRules = request => this.client.fetch({\n method: 'GET',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/acls`,\n urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])\n }, unmarshalListInstanceACLRulesResponse);\n\n /**\n * List ACL rules of a Database Instance. List the ACL rules for a given\n * Database Instance. The response is an array of ACL objects, each one\n * representing an ACL that denies, allows or redirects traffic based on\n * certain conditions.\n *\n * @param request - The request {@link ListInstanceACLRulesRequest}\n * @returns A Promise of ListInstanceACLRulesResponse\n */\n listInstanceACLRules = request => enrichForPagination('rules', this.pageOfListInstanceACLRules, request);\n\n /**\n * Add an ACL rule to a Database Instance. Add an additional ACL rule to a\n * Database Instance.\n *\n * @param request - The request {@link AddInstanceACLRulesRequest}\n * @returns A Promise of AddInstanceACLRulesResponse\n */\n addInstanceACLRules = request => this.client.fetch({\n body: JSON.stringify(marshalAddInstanceACLRulesRequest(request, this.client.settings)),\n headers: jsonContentHeaders$9,\n method: 'POST',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/acls`\n }, unmarshalAddInstanceACLRulesResponse);\n\n /**\n * Set ACL rules for a Database Instance. Replace all the ACL rules of a\n * Database Instance.\n *\n * @param request - The request {@link SetInstanceACLRulesRequest}\n * @returns A Promise of SetInstanceACLRulesResponse\n */\n setInstanceACLRules = request => this.client.fetch({\n body: JSON.stringify(marshalSetInstanceACLRulesRequest(request, this.client.settings)),\n headers: jsonContentHeaders$9,\n method: 'PUT',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/acls`\n }, unmarshalSetInstanceACLRulesResponse);\n\n /**\n * Delete ACL rules of a Database Instance. Delete one or more ACL rules of a\n * Database Instance.\n *\n * @param request - The request {@link DeleteInstanceACLRulesRequest}\n * @returns A Promise of DeleteInstanceACLRulesResponse\n */\n deleteInstanceACLRules = request => this.client.fetch({\n body: JSON.stringify(marshalDeleteInstanceACLRulesRequest(request, this.client.settings)),\n headers: jsonContentHeaders$9,\n method: 'DELETE',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/acls`\n }, unmarshalDeleteInstanceACLRulesResponse);\n pageOfListUsers = request => this.client.fetch({\n method: 'GET',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/users`,\n urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'name_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])\n }, unmarshalListUsersResponse);\n\n /**\n * List users of a Database Instance. List all users of a given Database\n * Instance. By default, the users returned in the list are ordered by\n * creation date in ascending order, though this can be modified via the\n * order_by field.\n *\n * @param request - The request {@link ListUsersRequest}\n * @returns A Promise of ListUsersResponse\n */\n listUsers = request => enrichForPagination('users', this.pageOfListUsers, request);\n\n /**\n * Create a user for a Database Instance. Create a new user for a Database\n * Instance. You must define the `name`, `password` and `is_admin`\n * parameters.\n *\n * @param request - The request {@link CreateUserRequest}\n * @returns A Promise of User\n */\n createUser = request => this.client.fetch({\n body: JSON.stringify(marshalCreateUserRequest(request, this.client.settings)),\n headers: jsonContentHeaders$9,\n method: 'POST',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/users`\n }, unmarshalUser);\n\n /**\n * Update a user on a Database Instance. Update the parameters of a user on a\n * Database Instance. You can update the `password` and `is_admin` parameters,\n * but you cannot change the name of the user.\n *\n * @param request - The request {@link UpdateUserRequest}\n * @returns A Promise of User\n */\n updateUser = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateUserRequest(request, this.client.settings)),\n headers: jsonContentHeaders$9,\n method: 'PATCH',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/users/${validatePathParam('name', request.name)}`\n }, unmarshalUser);\n\n /**\n * Delete a user on a Database Instance. Delete a given user on a Database\n * Instance. You must specify, in the endpoint, the `region`, `instance_id`\n * and `name` parameters of the user you want to delete.\n *\n * @param request - The request {@link DeleteUserRequest}\n */\n deleteUser = request => this.client.fetch({\n method: 'DELETE',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/users/${validatePathParam('name', request.name)}`\n });\n pageOfListDatabases = request => this.client.fetch({\n method: 'GET',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/databases`,\n urlParams: urlParams(['managed', request.managed], ['name', request.name], ['order_by', request.orderBy ?? 'name_asc'], ['owner', request.owner], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])\n }, unmarshalListDatabasesResponse);\n\n /**\n * List databases in a Database Instance. List all databases of a given\n * Database Instance. By default, the databases returned in the list are\n * ordered by creation date in ascending order, though this can be modified\n * via the order_by field. You can define additional parameters for your\n * query, such as `name`, `managed` and `owner`.\n *\n * @param request - The request {@link ListDatabasesRequest}\n * @returns A Promise of ListDatabasesResponse\n */\n listDatabases = request => enrichForPagination('databases', this.pageOfListDatabases, request);\n\n /**\n * Create a database in a Database Instance. Create a new database. You must\n * define the `name` parameter in the request.\n *\n * @param request - The request {@link CreateDatabaseRequest}\n * @returns A Promise of Database\n */\n createDatabase = request => this.client.fetch({\n body: JSON.stringify(marshalCreateDatabaseRequest(request, this.client.settings)),\n headers: jsonContentHeaders$9,\n method: 'POST',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/databases`\n }, unmarshalDatabase);\n\n /**\n * Delete a database in a Database Instance. Delete a given database on a\n * Database Instance. You must specify, in the endpoint, the `region`,\n * `instance_id` and `name` parameters of the database you want to delete.\n *\n * @param request - The request {@link DeleteDatabaseRequest}\n */\n deleteDatabase = request => this.client.fetch({\n method: 'DELETE',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/databases/${validatePathParam('name', request.name)}`\n });\n pageOfListPrivileges = request => this.client.fetch({\n method: 'GET',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/privileges`,\n urlParams: urlParams(['database_name', request.databaseName], ['order_by', request.orderBy ?? 'user_name_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['user_name', request.userName])\n }, unmarshalListPrivilegesResponse);\n\n /**\n * List user privileges for a database. List privileges of a user on a\n * database. By default, the details returned in the list are ordered by\n * creation date in ascending order, though this can be modified via the\n * order_by field. You can define additional parameters for your query, such\n * as `database_name` and `user_name`.\n *\n * @param request - The request {@link ListPrivilegesRequest}\n * @returns A Promise of ListPrivilegesResponse\n */\n listPrivileges = request => enrichForPagination('privileges', this.pageOfListPrivileges, request);\n\n /**\n * Set user privileges for a database. Set the privileges of a user on a\n * database. You must define `database_name`, `user_name` and `permission` in\n * the request body.\n *\n * @param request - The request {@link SetPrivilegeRequest}\n * @returns A Promise of Privilege\n */\n setPrivilege = request => this.client.fetch({\n body: JSON.stringify(marshalSetPrivilegeRequest(request, this.client.settings)),\n headers: jsonContentHeaders$9,\n method: 'PUT',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/privileges`\n }, unmarshalPrivilege);\n pageOfListSnapshots = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/snapshots`,\n urlParams: urlParams(['instance_id', request.instanceId], ['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])\n }, unmarshalListSnapshotsResponse);\n\n /**\n * List snapshots. List snapshots. You can include the `instance_id` or\n * `project_id` in your query to get the list of snapshots for specific\n * Database Instances and/or Projects. By default, the details returned in the\n * list are ordered by creation date in ascending order, though this can be\n * modified via the `order_by` field.\n *\n * @param request - The request {@link ListSnapshotsRequest}\n * @returns A Promise of ListSnapshotsResponse\n */\n listSnapshots = (request = {}) => enrichForPagination('snapshots', this.pageOfListSnapshots, request);\n\n /**\n * Get a Database Instance snapshot. Retrieve information about a given\n * snapshot, specified by its `snapshot_id` and `region`. Full details about\n * the snapshot, like size and expiration date, are returned in the response.\n *\n * @param request - The request {@link GetSnapshotRequest}\n * @returns A Promise of Snapshot\n */\n getSnapshot = request => this.client.fetch({\n method: 'GET',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/snapshots/${validatePathParam('snapshotId', request.snapshotId)}`\n }, unmarshalSnapshot);\n\n /**\n * Waits for {@link Snapshot} to be in a final state.\n *\n * @param request - The request {@link GetSnapshotRequest}\n * @param options - The waiting options\n * @returns A Promise of Snapshot\n */\n waitForSnapshot = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!SNAPSHOT_TRANSIENT_STATUSES.includes(res.status))), this.getSnapshot, request, options);\n\n /**\n * Create a Database Instance snapshot. Create a new snapshot of a Database\n * Instance. You must define the `name` parameter in the request.\n *\n * @param request - The request {@link CreateSnapshotRequest}\n * @returns A Promise of Snapshot\n */\n createSnapshot = request => this.client.fetch({\n body: JSON.stringify(marshalCreateSnapshotRequest(request, this.client.settings)),\n headers: jsonContentHeaders$9,\n method: 'POST',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/snapshots`\n }, unmarshalSnapshot);\n\n /**\n * Update a Database Instance snapshot. Update the parameters of a snapshot of\n * a Database Instance. You can update the `name` and `expires_at`\n * parameters.\n *\n * @param request - The request {@link UpdateSnapshotRequest}\n * @returns A Promise of Snapshot\n */\n updateSnapshot = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateSnapshotRequest(request, this.client.settings)),\n headers: jsonContentHeaders$9,\n method: 'PATCH',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/snapshots/${validatePathParam('snapshotId', request.snapshotId)}`\n }, unmarshalSnapshot);\n\n /**\n * Delete a Database Instance snapshot. Delete a given snapshot of a Database\n * Instance. You must specify, in the endpoint, the `region` and `snapshot_id`\n * parameters of the snapshot you want to delete.\n *\n * @param request - The request {@link DeleteSnapshotRequest}\n * @returns A Promise of Snapshot\n */\n deleteSnapshot = request => this.client.fetch({\n method: 'DELETE',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/snapshots/${validatePathParam('snapshotId', request.snapshotId)}`\n }, unmarshalSnapshot);\n\n /**\n * Create a new Database Instance from a snapshot. Restore a snapshot. When\n * you restore a snapshot, a new Instance is created and billed to your\n * account. Note that is possible to select a larger node type for your new\n * Database Instance. However, the Block volume size will be the same as the\n * size of the restored snapshot. All Instance settings will be restored if\n * you chose a node type with the same or more memory size than the initial\n * Instance. Settings will be reset to the default if your node type has less\n * memory.\n *\n * @param request - The request {@link CreateInstanceFromSnapshotRequest}\n * @returns A Promise of Instance\n */\n createInstanceFromSnapshot = request => this.client.fetch({\n body: JSON.stringify(marshalCreateInstanceFromSnapshotRequest(request, this.client.settings)),\n headers: jsonContentHeaders$9,\n method: 'POST',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/snapshots/${validatePathParam('snapshotId', request.snapshotId)}/create-instance`\n }, unmarshalInstance);\n\n /**\n * Create a new Database Instance endpoint. Create a new endpoint for a\n * Database Instance. You can add `load_balancer` and `private_network`\n * specifications to the body of the request.\n *\n * @param request - The request {@link CreateEndpointRequest}\n * @returns A Promise of Endpoint\n */\n createEndpoint = request => this.client.fetch({\n body: JSON.stringify(marshalCreateEndpointRequest(request, this.client.settings)),\n headers: jsonContentHeaders$9,\n method: 'POST',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/endpoints`\n }, unmarshalEndpoint$1);\n\n /**\n * Delete a Database Instance endpoint. Delete the endpoint of a Database\n * Instance. You must specify the `region` and `endpoint_id` parameters of the\n * endpoint you want to delete. Note that might need to update any environment\n * configurations that point to the deleted endpoint.\n *\n * @param request - The request {@link DeleteEndpointRequest}\n */\n deleteEndpoint = request => this.client.fetch({\n method: 'DELETE',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/endpoints/${validatePathParam('endpointId', request.endpointId)}`\n });\n\n /**\n * Get a Database Instance endpoint. Retrieve information about a Database\n * Instance endpoint. Full details about the endpoint, like `ip`, `port`,\n * `private_network` and `load_balancer` specifications are returned in the\n * response.\n *\n * @param request - The request {@link GetEndpointRequest}\n * @returns A Promise of Endpoint\n */\n getEndpoint = request => this.client.fetch({\n method: 'GET',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/endpoints/${validatePathParam('endpointId', request.endpointId)}`\n }, unmarshalEndpoint$1);\n\n /**\n * Migrate an existing instance endpoint to another instance.\n *\n * @param request - The request {@link MigrateEndpointRequest}\n * @returns A Promise of Endpoint\n */\n migrateEndpoint = request => this.client.fetch({\n body: JSON.stringify(marshalMigrateEndpointRequest(request, this.client.settings)),\n headers: jsonContentHeaders$9,\n method: 'POST',\n path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/endpoints/${validatePathParam('endpointId', request.endpointId)}/migrate`\n }, unmarshalEndpoint$1);\n};\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\nconst UpdateInstanceRequest = {\n backupScheduleStartHour: {\n lessThanOrEqual: 23\n }\n};\n\nvar validationRules_gen$1 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n UpdateInstanceRequest: UpdateInstanceRequest\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\nvar index_gen$9 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n API: API$9,\n DATABASE_BACKUP_TRANSIENT_STATUSES: DATABASE_BACKUP_TRANSIENT_STATUSES,\n INSTANCE_LOG_TRANSIENT_STATUSES: INSTANCE_LOG_TRANSIENT_STATUSES,\n INSTANCE_TRANSIENT_STATUSES: INSTANCE_TRANSIENT_STATUSES,\n MAINTENANCE_TRANSIENT_STATUSES: MAINTENANCE_TRANSIENT_STATUSES,\n READ_REPLICA_TRANSIENT_STATUSES: READ_REPLICA_TRANSIENT_STATUSES,\n SNAPSHOT_TRANSIENT_STATUSES: SNAPSHOT_TRANSIENT_STATUSES,\n ValidationRules: validationRules_gen$1\n});\n\nvar index$8 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n v1: index_gen$9\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\n/** Lists transient statutes of the enum {@link ClusterStatus}. */\nconst CLUSTER_TRANSIENT_STATUSES = ['provisioning', 'configuring', 'deleting', 'autohealing', 'initializing'];\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst unmarshalPrivateNetwork$2 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'PrivateNetwork' failed as data isn't a dictionary.`);\n }\n return {\n id: data.id,\n provisioningMode: data.provisioning_mode,\n serviceIps: data.service_ips,\n zone: data.zone\n };\n};\nconst unmarshalPublicNetwork = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'PublicNetwork' failed as data isn't a dictionary.`);\n }\n return {};\n};\nconst unmarshalACLRule = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ACLRule' failed as data isn't a dictionary.`);\n }\n return {\n description: data.description,\n id: data.id,\n ipCidr: data.ip_cidr\n };\n};\nconst unmarshalAvailableClusterSetting = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'AvailableClusterSetting' failed as data isn't a dictionary.`);\n }\n return {\n defaultValue: data.default_value,\n deprecated: data.deprecated,\n description: data.description,\n maxValue: data.max_value,\n minValue: data.min_value,\n name: data.name,\n regex: data.regex,\n type: data.type\n };\n};\nconst unmarshalClusterSetting = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ClusterSetting' failed as data isn't a dictionary.`);\n }\n return {\n name: data.name,\n value: data.value\n };\n};\nconst unmarshalEndpoint = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Endpoint' failed as data isn't a dictionary.`);\n }\n return {\n id: data.id,\n ips: data.ips,\n port: data.port,\n privateNetwork: data.private_network ? unmarshalPrivateNetwork$2(data.private_network) : undefined,\n publicNetwork: data.public_network ? unmarshalPublicNetwork(data.public_network) : undefined\n };\n};\nconst unmarshalCluster = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Cluster' failed as data isn't a dictionary.`);\n }\n return {\n aclRules: unmarshalArrayOfObject(data.acl_rules, unmarshalACLRule),\n clusterSettings: unmarshalArrayOfObject(data.cluster_settings, unmarshalClusterSetting),\n clusterSize: data.cluster_size,\n createdAt: unmarshalDate(data.created_at),\n endpoints: unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint),\n id: data.id,\n name: data.name,\n nodeType: data.node_type,\n projectId: data.project_id,\n status: data.status,\n tags: data.tags,\n tlsEnabled: data.tls_enabled,\n updatedAt: unmarshalDate(data.updated_at),\n upgradableVersions: data.upgradable_versions,\n userName: data.user_name,\n version: data.version,\n zone: data.zone\n };\n};\nconst unmarshalClusterVersion = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ClusterVersion' failed as data isn't a dictionary.`);\n }\n return {\n availableSettings: unmarshalArrayOfObject(data.available_settings, unmarshalAvailableClusterSetting),\n endOfLifeAt: unmarshalDate(data.end_of_life_at),\n logoUrl: data.logo_url,\n version: data.version,\n zone: data.zone\n };\n};\nconst unmarshalNodeType = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'NodeType' failed as data isn't a dictionary.`);\n }\n return {\n beta: data.beta,\n description: data.description,\n disabled: data.disabled,\n memory: data.memory,\n name: data.name,\n stockStatus: data.stock_status,\n vcpus: data.vcpus,\n zone: data.zone\n };\n};\nconst unmarshalAddAclRulesResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'AddAclRulesResponse' failed as data isn't a dictionary.`);\n }\n return {\n aclRules: unmarshalArrayOfObject(data.acl_rules, unmarshalACLRule),\n totalCount: data.total_count\n };\n};\nconst unmarshalAddEndpointsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'AddEndpointsResponse' failed as data isn't a dictionary.`);\n }\n return {\n endpoints: unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint),\n totalCount: data.total_count\n };\n};\nconst unmarshalClusterMetricsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ClusterMetricsResponse' failed as data isn't a dictionary.`);\n }\n return {\n timeseries: unmarshalArrayOfObject(data.timeseries, unmarshalTimeSeries)\n };\n};\nconst unmarshalClusterSettingsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ClusterSettingsResponse' failed as data isn't a dictionary.`);\n }\n return {\n settings: unmarshalArrayOfObject(data.settings, unmarshalClusterSetting)\n };\n};\nconst unmarshalListClusterVersionsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListClusterVersionsResponse' failed as data isn't a dictionary.`);\n }\n return {\n totalCount: data.total_count,\n versions: unmarshalArrayOfObject(data.versions, unmarshalClusterVersion)\n };\n};\nconst unmarshalListClustersResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListClustersResponse' failed as data isn't a dictionary.`);\n }\n return {\n clusters: unmarshalArrayOfObject(data.clusters, unmarshalCluster),\n totalCount: data.total_count\n };\n};\nconst unmarshalListNodeTypesResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListNodeTypesResponse' failed as data isn't a dictionary.`);\n }\n return {\n nodeTypes: unmarshalArrayOfObject(data.node_types, unmarshalNodeType),\n totalCount: data.total_count\n };\n};\nconst unmarshalSetAclRulesResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'SetAclRulesResponse' failed as data isn't a dictionary.`);\n }\n return {\n aclRules: unmarshalArrayOfObject(data.acl_rules, unmarshalACLRule)\n };\n};\nconst unmarshalSetEndpointsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'SetEndpointsResponse' failed as data isn't a dictionary.`);\n }\n return {\n endpoints: unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint)\n };\n};\nconst marshalEndpointSpecPrivateNetworkSpecIpamConfig = (request, defaults) => ({});\nconst marshalEndpointSpecPrivateNetworkSpec = (request, defaults) => ({\n id: request.id,\n ipam_config: request.ipamConfig ? marshalEndpointSpecPrivateNetworkSpecIpamConfig(request.ipamConfig) : undefined,\n service_ips: request.serviceIps\n});\nconst marshalEndpointSpecPublicNetworkSpec = (request, defaults) => ({});\nconst marshalACLRuleSpec = (request, defaults) => ({\n description: request.description,\n ip_cidr: request.ipCidr\n});\nconst marshalClusterSetting = (request, defaults) => ({\n name: request.name,\n value: request.value\n});\nconst marshalEndpointSpec = (request, defaults) => ({\n ...resolveOneOf([{\n param: 'private_network',\n value: request.privateNetwork ? marshalEndpointSpecPrivateNetworkSpec(request.privateNetwork) : undefined\n }, {\n param: 'public_network',\n value: request.publicNetwork ? marshalEndpointSpecPublicNetworkSpec(request.publicNetwork) : undefined\n }])\n});\nconst marshalAddAclRulesRequest = (request, defaults) => ({\n acl_rules: request.aclRules.map(elt => marshalACLRuleSpec(elt))\n});\nconst marshalAddClusterSettingsRequest = (request, defaults) => ({\n settings: request.settings.map(elt => marshalClusterSetting(elt))\n});\nconst marshalAddEndpointsRequest = (request, defaults) => ({\n endpoints: request.endpoints.map(elt => marshalEndpointSpec(elt))\n});\nconst marshalCreateClusterRequest = (request, defaults) => ({\n acl_rules: request.aclRules ? request.aclRules.map(elt => marshalACLRuleSpec(elt)) : undefined,\n cluster_settings: request.clusterSettings ? request.clusterSettings.map(elt => marshalClusterSetting(elt)) : undefined,\n cluster_size: request.clusterSize,\n endpoints: request.endpoints ? request.endpoints.map(elt => marshalEndpointSpec(elt)) : undefined,\n name: request.name || randomName('ins'),\n node_type: request.nodeType,\n password: request.password,\n project_id: request.projectId ?? defaults.defaultProjectId,\n tags: request.tags,\n tls_enabled: request.tlsEnabled,\n user_name: request.userName,\n version: request.version\n});\nconst marshalMigrateClusterRequest = (request, defaults) => ({\n ...resolveOneOf([{\n param: 'version',\n value: request.version\n }, {\n param: 'node_type',\n value: request.nodeType\n }, {\n param: 'cluster_size',\n value: request.clusterSize\n }])\n});\nconst marshalSetAclRulesRequest = (request, defaults) => ({\n acl_rules: request.aclRules.map(elt => marshalACLRuleSpec(elt))\n});\nconst marshalSetClusterSettingsRequest = (request, defaults) => ({\n settings: request.settings.map(elt => marshalClusterSetting(elt))\n});\nconst marshalSetEndpointsRequest = (request, defaults) => ({\n endpoints: request.endpoints.map(elt => marshalEndpointSpec(elt))\n});\nconst marshalUpdateClusterRequest = (request, defaults) => ({\n name: request.name,\n password: request.password,\n tags: request.tags,\n user_name: request.userName\n});\nconst marshalUpdateEndpointRequest = (request, defaults) => ({\n ...resolveOneOf([{\n param: 'private_network',\n value: request.privateNetwork ? marshalEndpointSpecPrivateNetworkSpec(request.privateNetwork) : undefined\n }, {\n param: 'public_network',\n value: request.publicNetwork ? marshalEndpointSpecPublicNetworkSpec(request.publicNetwork) : undefined\n }])\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst jsonContentHeaders$8 = {\n 'Content-Type': 'application/json; charset=utf-8'\n};\n\n/** Managed Database for Redis™ API. */\nlet API$8 = class API extends API$u {\n /** Lists the available zones of the API. */\n static LOCALITIES = ['fr-par-1', 'fr-par-2', 'nl-ams-1', 'nl-ams-2', 'pl-waw-1', 'pl-waw-2'];\n\n /**\n * Create a Redis™ Database Instance. Create a new Redis™ Database Instance\n * (Redis™ cluster). You must set the `zone`, `project_id`, `version`,\n * `node_type`, `user_name` and `password` parameters. Optionally you can\n * define `acl_rules`, `endpoints`, `tls_enabled` and `cluster_settings`.\n *\n * @param request - The request {@link CreateClusterRequest}\n * @returns A Promise of Cluster\n */\n createCluster = request => this.client.fetch({\n body: JSON.stringify(marshalCreateClusterRequest(request, this.client.settings)),\n headers: jsonContentHeaders$8,\n method: 'POST',\n path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters`\n }, unmarshalCluster);\n\n /**\n * Update a Redis™ Database Instance. Update the parameters of a Redis™\n * Database Instance (Redis™ cluster), including `name`, `tags`, `user_name`\n * and `password`.\n *\n * @param request - The request {@link UpdateClusterRequest}\n * @returns A Promise of Cluster\n */\n updateCluster = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateClusterRequest(request, this.client.settings)),\n headers: jsonContentHeaders$8,\n method: 'PATCH',\n path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}`\n }, unmarshalCluster);\n\n /**\n * Get a Redis™ Database Instance. Retrieve information about a Redis™\n * Database Instance (Redis™ cluster). Specify the `cluster_id` and `region`\n * in your request to get information such as `id`, `status`, `version`,\n * `tls_enabled`, `cluster_settings`, `upgradable_versions` and `endpoints`\n * about your cluster in the response.\n *\n * @param request - The request {@link GetClusterRequest}\n * @returns A Promise of Cluster\n */\n getCluster = request => this.client.fetch({\n method: 'GET',\n path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}`\n }, unmarshalCluster);\n\n /**\n * Waits for {@link Cluster} to be in a final state.\n *\n * @param request - The request {@link GetClusterRequest}\n * @param options - The waiting options\n * @returns A Promise of Cluster\n */\n waitForCluster = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!CLUSTER_TRANSIENT_STATUSES.includes(res.status))), this.getCluster, request, options);\n pageOfListClusters = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters`,\n urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId], ['tags', request.tags], ['version', request.version])\n }, unmarshalListClustersResponse);\n\n /**\n * List Redis™ Database Instances. List all Redis™ Database Instances (Redis™\n * cluster) in the specified zone. By default, the Database Instances returned\n * in the list are ordered by creation date in ascending order, though this\n * can be modified via the order_by field. You can define additional\n * parameters for your query, such as `tags`, `name`, `organization_id` and\n * `version`.\n *\n * @param request - The request {@link ListClustersRequest}\n * @returns A Promise of ListClustersResponse\n */\n listClusters = (request = {}) => enrichForPagination('clusters', this.pageOfListClusters, request);\n\n /**\n * Scale up a Redis™ Database Instance. Upgrade your standalone Redis™\n * Database Instance node, either by upgrading to a bigger node type (vertical\n * scaling) or by adding more nodes to your Database Instance to increase your\n * number of endpoints and distribute cache (horizontal scaling). Note that\n * scaling horizontally your Redis™ Database Instance will not renew its TLS\n * certificate. In order to refresh the TLS certificate, you must use the\n * Renew TLS certificate endpoint.\n *\n * @param request - The request {@link MigrateClusterRequest}\n * @returns A Promise of Cluster\n */\n migrateCluster = request => this.client.fetch({\n body: JSON.stringify(marshalMigrateClusterRequest(request, this.client.settings)),\n headers: jsonContentHeaders$8,\n method: 'POST',\n path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}/migrate`\n }, unmarshalCluster);\n\n /**\n * Delete a Redis™ Database Instance. Delete a Redis™ Database Instance\n * (Redis™ cluster), specified by the `region` and `cluster_id` parameters.\n * Deleting a Database Instance is permanent, and cannot be undone. Note that\n * upon deletion all your data will be lost.\n *\n * @param request - The request {@link DeleteClusterRequest}\n * @returns A Promise of Cluster\n */\n deleteCluster = request => this.client.fetch({\n method: 'DELETE',\n path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}`\n }, unmarshalCluster);\n\n /**\n * Get metrics of a Redis™ Database Instance. Retrieve the metrics of a Redis™\n * Database Instance (Redis™ cluster). You can define the period from which to\n * retrieve metrics by specifying the `start_date` and `end_date`.\n *\n * @param request - The request {@link GetClusterMetricsRequest}\n * @returns A Promise of ClusterMetricsResponse\n */\n getClusterMetrics = request => this.client.fetch({\n method: 'GET',\n path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}/metrics`,\n urlParams: urlParams(['end_at', request.endAt], ['metric_name', request.metricName], ['start_at', request.startAt])\n }, unmarshalClusterMetricsResponse);\n pageOfListNodeTypes = request => this.client.fetch({\n method: 'GET',\n path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/node-types`,\n urlParams: urlParams(['include_disabled_types', request.includeDisabledTypes], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])\n }, unmarshalListNodeTypesResponse);\n\n /**\n * List available node types. List all available node types. By default, the\n * node types returned in the list are ordered by creation date in ascending\n * order, though this can be modified via the `order_by` field.\n *\n * @param request - The request {@link ListNodeTypesRequest}\n * @returns A Promise of ListNodeTypesResponse\n */\n listNodeTypes = request => enrichForPagination('nodeTypes', this.pageOfListNodeTypes, request);\n pageOfListClusterVersions = request => this.client.fetch({\n method: 'GET',\n path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/cluster-versions`,\n urlParams: urlParams(['include_beta', request.includeBeta], ['include_deprecated', request.includeDeprecated], ['include_disabled', request.includeDisabled], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['version', request.version])\n }, unmarshalListClusterVersionsResponse);\n\n /**\n * List available Redis™ versions. List the Redis™ database engine versions\n * available. You can define additional parameters for your query, such as\n * `include_disabled`, `include_beta`, `include_deprecated` and `version`.\n *\n * @param request - The request {@link ListClusterVersionsRequest}\n * @returns A Promise of ListClusterVersionsResponse\n */\n listClusterVersions = request => enrichForPagination('versions', this.pageOfListClusterVersions, request);\n\n /**\n * Get the TLS certificate of a cluster. Retrieve information about the TLS\n * certificate of a Redis™ Database Instance (Redis™ cluster). Details like\n * name and content are returned in the response.\n *\n * @param request - The request {@link GetClusterCertificateRequest}\n * @returns A Promise of Blob\n */\n getClusterCertificate = request => this.client.fetch({\n method: 'GET',\n path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}/certificate`,\n urlParams: urlParams(['dl', 1]),\n responseType: 'blob'\n });\n\n /**\n * Renew the TLS certificate of a cluster. Renew a TLS certificate for a\n * Redis™ Database Instance (Redis™ cluster). Renewing a certificate means\n * that you will not be able to connect to your Database Instance using the\n * previous certificate. You will also need to download and update the new\n * certificate for all database clients.\n *\n * @param request - The request {@link RenewClusterCertificateRequest}\n * @returns A Promise of Cluster\n */\n renewClusterCertificate = request => this.client.fetch({\n body: '{}',\n headers: jsonContentHeaders$8,\n method: 'POST',\n path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}/renew-certificate`\n }, unmarshalCluster);\n\n /**\n * Add advanced settings. Add an advanced setting to a Redis™ Database\n * Instance (Redis™ cluster). You must set the `name` and the `value` of each\n * setting.\n *\n * @param request - The request {@link AddClusterSettingsRequest}\n * @returns A Promise of ClusterSettingsResponse\n */\n addClusterSettings = request => this.client.fetch({\n body: JSON.stringify(marshalAddClusterSettingsRequest(request, this.client.settings)),\n headers: jsonContentHeaders$8,\n method: 'POST',\n path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}/settings`\n }, unmarshalClusterSettingsResponse);\n\n /**\n * Delete advanced setting. Delete an advanced setting in a Redis™ Database\n * Instance (Redis™ cluster). You must specify the names of the settings you\n * want to delete in the request body.\n *\n * @param request - The request {@link DeleteClusterSettingRequest}\n * @returns A Promise of Cluster\n */\n deleteClusterSetting = request => this.client.fetch({\n method: 'DELETE',\n path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}/settings/${validatePathParam('settingName', request.settingName)}`\n }, unmarshalCluster);\n\n /**\n * Set advanced settings. Update an advanced setting for a Redis™ Database\n * Instance (Redis™ cluster). Settings added upon database engine\n * initalization can only be defined once, and cannot, therefore, be updated.\n *\n * @param request - The request {@link SetClusterSettingsRequest}\n * @returns A Promise of ClusterSettingsResponse\n */\n setClusterSettings = request => this.client.fetch({\n body: JSON.stringify(marshalSetClusterSettingsRequest(request, this.client.settings)),\n headers: jsonContentHeaders$8,\n method: 'PUT',\n path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}/settings`\n }, unmarshalClusterSettingsResponse);\n\n /**\n * Set ACL rules for a cluster. Replace all the ACL rules of a Redis™ Database\n * Instance (Redis™ cluster).\n *\n * @param request - The request {@link SetAclRulesRequest}\n * @returns A Promise of SetAclRulesResponse\n */\n setAclRules = request => this.client.fetch({\n body: JSON.stringify(marshalSetAclRulesRequest(request, this.client.settings)),\n headers: jsonContentHeaders$8,\n method: 'PUT',\n path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}/acls`\n }, unmarshalSetAclRulesResponse);\n\n /**\n * Add ACL rules for a cluster. Add an additional ACL rule to a Redis™\n * Database Instance (Redis™ cluster).\n *\n * @param request - The request {@link AddAclRulesRequest}\n * @returns A Promise of AddAclRulesResponse\n */\n addAclRules = request => this.client.fetch({\n body: JSON.stringify(marshalAddAclRulesRequest(request, this.client.settings)),\n headers: jsonContentHeaders$8,\n method: 'POST',\n path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}/acls`\n }, unmarshalAddAclRulesResponse);\n\n /**\n * Delete an ACL rule for a cluster. Delete an ACL rule of a Redis™ Database\n * Instance (Redis™ cluster). You must specify the `acl_id` of the rule you\n * want to delete in your request.\n *\n * @param request - The request {@link DeleteAclRuleRequest}\n * @returns A Promise of Cluster\n */\n deleteAclRule = request => this.client.fetch({\n method: 'DELETE',\n path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/acls/${validatePathParam('aclId', request.aclId)}`\n }, unmarshalCluster);\n\n /**\n * Get an ACL rule. Retrieve information about an ACL rule of a Redis™\n * Database Instance (Redis™ cluster). You must specify the `acl_id` of the\n * rule in your request.\n *\n * @param request - The request {@link GetAclRuleRequest}\n * @returns A Promise of ACLRule\n */\n getAclRule = request => this.client.fetch({\n method: 'GET',\n path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/acls/${validatePathParam('aclId', request.aclId)}`\n }, unmarshalACLRule);\n\n /**\n * Set endpoints for a cluster. Update an endpoint for a Redis™ Database\n * Instance (Redis™ cluster). You must specify the `cluster_id` and the\n * `endpoints` parameters in your request.\n *\n * @param request - The request {@link SetEndpointsRequest}\n * @returns A Promise of SetEndpointsResponse\n */\n setEndpoints = request => this.client.fetch({\n body: JSON.stringify(marshalSetEndpointsRequest(request, this.client.settings)),\n headers: jsonContentHeaders$8,\n method: 'PUT',\n path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}/endpoints`\n }, unmarshalSetEndpointsResponse);\n\n /**\n * Add endpoints for a cluster. Add a new endpoint for a Redis™ Database\n * Instance (Redis™ cluster). You can add `private_network` or\n * `public_network` specifications to the body of the request.\n *\n * @param request - The request {@link AddEndpointsRequest}\n * @returns A Promise of AddEndpointsResponse\n */\n addEndpoints = request => this.client.fetch({\n body: JSON.stringify(marshalAddEndpointsRequest(request, this.client.settings)),\n headers: jsonContentHeaders$8,\n method: 'POST',\n path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}/endpoints`\n }, unmarshalAddEndpointsResponse);\n\n /**\n * Delete an endpoint for a cluster. Delete the endpoint of a Redis™ Database\n * Instance (Redis™ cluster). You must specify the `region` and `endpoint_id`\n * parameters of the endpoint you want to delete. Note that might need to\n * update any environment configurations that point to the deleted endpoint.\n *\n * @param request - The request {@link DeleteEndpointRequest}\n * @returns A Promise of Cluster\n */\n deleteEndpoint = request => this.client.fetch({\n method: 'DELETE',\n path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/endpoints/${validatePathParam('endpointId', request.endpointId)}`\n }, unmarshalCluster);\n\n /**\n * Get an endpoint. Retrieve information about a Redis™ Database Instance\n * (Redis™ cluster) endpoint. Full details about the endpoint, like `ips`,\n * `port`, `private_network` and `public_network` specifications are returned\n * in the response.\n *\n * @param request - The request {@link GetEndpointRequest}\n * @returns A Promise of Endpoint\n */\n getEndpoint = request => this.client.fetch({\n method: 'GET',\n path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/endpoints/${validatePathParam('endpointId', request.endpointId)}`\n }, unmarshalEndpoint);\n\n /**\n * Update an endpoint. Update information about a Redis™ Database Instance\n * (Redis™ cluster) endpoint. Full details about the endpoint, like `ips`,\n * `port`, `private_network` and `public_network` specifications are returned\n * in the response.\n *\n * @param request - The request {@link UpdateEndpointRequest}\n * @returns A Promise of Endpoint\n */\n updateEndpoint = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateEndpointRequest(request, this.client.settings)),\n headers: jsonContentHeaders$8,\n method: 'PATCH',\n path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/endpoints/${validatePathParam('endpointId', request.endpointId)}`\n }, unmarshalEndpoint);\n};\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\nvar index_gen$8 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n API: API$8,\n CLUSTER_TRANSIENT_STATUSES: CLUSTER_TRANSIENT_STATUSES\n});\n\nvar index$7 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n v1: index_gen$8\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\n/** Lists transient statutes of the enum {@link ImageStatus}. */\nconst IMAGE_TRANSIENT_STATUSES = ['deleting'];\n\n/** Lists transient statutes of the enum {@link NamespaceStatus}. */\nconst NAMESPACE_TRANSIENT_STATUSES = ['deleting'];\n\n/** Lists transient statutes of the enum {@link TagStatus}. */\nconst TAG_TRANSIENT_STATUSES = ['deleting'];\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst unmarshalImage = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Image' failed as data isn't a dictionary.`);\n }\n return {\n createdAt: unmarshalDate(data.created_at),\n id: data.id,\n name: data.name,\n namespaceId: data.namespace_id,\n size: data.size,\n status: data.status,\n statusMessage: data.status_message,\n tags: data.tags,\n updatedAt: unmarshalDate(data.updated_at),\n visibility: data.visibility\n };\n};\nconst unmarshalNamespace = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Namespace' failed as data isn't a dictionary.`);\n }\n return {\n createdAt: unmarshalDate(data.created_at),\n description: data.description,\n endpoint: data.endpoint,\n id: data.id,\n imageCount: data.image_count,\n isPublic: data.is_public,\n name: data.name,\n organizationId: data.organization_id,\n projectId: data.project_id,\n region: data.region,\n size: data.size,\n status: data.status,\n statusMessage: data.status_message,\n updatedAt: unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalTag = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Tag' failed as data isn't a dictionary.`);\n }\n return {\n createdAt: unmarshalDate(data.created_at),\n digest: data.digest,\n id: data.id,\n imageId: data.image_id,\n name: data.name,\n status: data.status,\n updatedAt: unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalListImagesResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListImagesResponse' failed as data isn't a dictionary.`);\n }\n return {\n images: unmarshalArrayOfObject(data.images, unmarshalImage),\n totalCount: data.total_count\n };\n};\nconst unmarshalListNamespacesResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListNamespacesResponse' failed as data isn't a dictionary.`);\n }\n return {\n namespaces: unmarshalArrayOfObject(data.namespaces, unmarshalNamespace),\n totalCount: data.total_count\n };\n};\nconst unmarshalListTagsResponse$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListTagsResponse' failed as data isn't a dictionary.`);\n }\n return {\n tags: unmarshalArrayOfObject(data.tags, unmarshalTag),\n totalCount: data.total_count\n };\n};\nconst marshalCreateNamespaceRequest = (request, defaults) => ({\n description: request.description,\n is_public: request.isPublic,\n name: request.name || randomName('ns'),\n ...resolveOneOf([{\n default: defaults.defaultProjectId,\n param: 'project_id',\n value: request.projectId\n }, {\n default: defaults.defaultOrganizationId,\n param: 'organization_id',\n value: request.organizationId\n }])\n});\nconst marshalUpdateImageRequest = (request, defaults) => ({\n visibility: request.visibility ?? 'visibility_unknown'\n});\nconst marshalUpdateNamespaceRequest = (request, defaults) => ({\n description: request.description,\n is_public: request.isPublic\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst jsonContentHeaders$7 = {\n 'Content-Type': 'application/json; charset=utf-8'\n};\n\n/** Container Registry API. */\nlet API$7 = class API extends API$u {\n /** Lists the available regions of the API. */\n static LOCALITIES = ['fr-par', 'nl-ams', 'pl-waw'];\n pageOfListNamespaces = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/registry/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces`,\n urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])\n }, unmarshalListNamespacesResponse);\n\n /**\n * List namespaces. List all namespaces in a specified region. By default, the\n * namespaces listed are ordered by creation date in ascending order. This can\n * be modified via the order_by field. You can also define additional\n * parameters for your query, such as the `instance_id` and `project_id`\n * parameters.\n *\n * @param request - The request {@link ListNamespacesRequest}\n * @returns A Promise of ListNamespacesResponse\n */\n listNamespaces = (request = {}) => enrichForPagination('namespaces', this.pageOfListNamespaces, request);\n\n /**\n * Get a namespace. Retrieve information about a given namespace, specified by\n * its `namespace_id` and region. Full details about the namespace, such as\n * `description`, `project_id`, `status`, `endpoint`, `is_public`, `size`, and\n * `image_count` are returned in the response.\n *\n * @param request - The request {@link GetNamespaceRequest}\n * @returns A Promise of Namespace\n */\n getNamespace = request => this.client.fetch({\n method: 'GET',\n path: `/registry/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam('namespaceId', request.namespaceId)}`\n }, unmarshalNamespace);\n\n /**\n * Waits for {@link Namespace} to be in a final state.\n *\n * @param request - The request {@link GetNamespaceRequest}\n * @param options - The waiting options\n * @returns A Promise of Namespace\n */\n waitForNamespace = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!NAMESPACE_TRANSIENT_STATUSES.includes(res.status))), this.getNamespace, request, options);\n\n /**\n * Create a namespace. Create a new Container Registry namespace. You must\n * specify the namespace name and region in which you want it to be created.\n * Optionally, you can specify the `project_id` and `is_public` in the request\n * payload.\n *\n * @param request - The request {@link CreateNamespaceRequest}\n * @returns A Promise of Namespace\n */\n createNamespace = request => this.client.fetch({\n body: JSON.stringify(marshalCreateNamespaceRequest(request, this.client.settings)),\n headers: jsonContentHeaders$7,\n method: 'POST',\n path: `/registry/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces`\n }, unmarshalNamespace);\n\n /**\n * Update a namespace. Update the parameters of a given namespace, specified\n * by its `namespace_id` and `region`. You can update the `description` and\n * `is_public` parameters.\n *\n * @param request - The request {@link UpdateNamespaceRequest}\n * @returns A Promise of Namespace\n */\n updateNamespace = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateNamespaceRequest(request, this.client.settings)),\n headers: jsonContentHeaders$7,\n method: 'PATCH',\n path: `/registry/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam('namespaceId', request.namespaceId)}`\n }, unmarshalNamespace);\n\n /**\n * Delete a namespace. Delete a given namespace. You must specify, in the\n * endpoint, the `region` and `namespace_id` parameters of the namespace you\n * want to delete.\n *\n * @param request - The request {@link DeleteNamespaceRequest}\n * @returns A Promise of Namespace\n */\n deleteNamespace = request => this.client.fetch({\n method: 'DELETE',\n path: `/registry/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/namespaces/${validatePathParam('namespaceId', request.namespaceId)}`\n }, unmarshalNamespace);\n pageOfListImages = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/registry/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/images`,\n urlParams: urlParams(['name', request.name], ['namespace_id', request.namespaceId], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])\n }, unmarshalListImagesResponse);\n\n /**\n * List images. List all images in a specified region. By default, the images\n * listed are ordered by creation date in ascending order. This can be\n * modified via the order_by field. You can also define additional parameters\n * for your query, such as the `namespace_id` and `project_id` parameters.\n *\n * @param request - The request {@link ListImagesRequest}\n * @returns A Promise of ListImagesResponse\n */\n listImages = (request = {}) => enrichForPagination('images', this.pageOfListImages, request);\n\n /**\n * Get an image. Retrieve information about a given container image, specified\n * by its `image_id` and region. Full details about the image, such as `name`,\n * `namespace_id`, `status`, `visibility`, and `size` are returned in the\n * response.\n *\n * @param request - The request {@link GetImageRequest}\n * @returns A Promise of Image\n */\n getImage = request => this.client.fetch({\n method: 'GET',\n path: `/registry/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/images/${validatePathParam('imageId', request.imageId)}`\n }, unmarshalImage);\n\n /**\n * Waits for {@link Image} to be in a final state.\n *\n * @param request - The request {@link GetImageRequest}\n * @param options - The waiting options\n * @returns A Promise of Image\n */\n waitForImage = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!IMAGE_TRANSIENT_STATUSES.includes(res.status))), this.getImage, request, options);\n\n /**\n * Update an image. Update the parameters of a given image, specified by its\n * `image_id` and `region`. You can update the `visibility` parameter.\n *\n * @param request - The request {@link UpdateImageRequest}\n * @returns A Promise of Image\n */\n updateImage = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateImageRequest(request, this.client.settings)),\n headers: jsonContentHeaders$7,\n method: 'PATCH',\n path: `/registry/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/images/${validatePathParam('imageId', request.imageId)}`\n }, unmarshalImage);\n\n /**\n * Delete an image. Delete a given image. You must specify, in the endpoint,\n * the `region` and `image_id` parameters of the image you want to delete.\n *\n * @param request - The request {@link DeleteImageRequest}\n * @returns A Promise of Image\n */\n deleteImage = request => this.client.fetch({\n method: 'DELETE',\n path: `/registry/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/images/${validatePathParam('imageId', request.imageId)}`\n }, unmarshalImage);\n pageOfListTags = request => this.client.fetch({\n method: 'GET',\n path: `/registry/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/images/${validatePathParam('imageId', request.imageId)}/tags`,\n urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize])\n }, unmarshalListTagsResponse$1);\n\n /**\n * List tags. List all tags for a given image, specified by region. By\n * default, the tags listed are ordered by creation date in ascending order.\n * This can be modified via the order_by field. You can also define additional\n * parameters for your query, such as the `name`.\n *\n * @param request - The request {@link ListTagsRequest}\n * @returns A Promise of ListTagsResponse\n */\n listTags = request => enrichForPagination('tags', this.pageOfListTags, request);\n\n /**\n * Get a tag. Retrieve information about a given image tag, specified by its\n * `tag_id` and region. Full details about the tag, such as `name`,\n * `image_id`, `status`, and `digest` are returned in the response.\n *\n * @param request - The request {@link GetTagRequest}\n * @returns A Promise of Tag\n */\n getTag = request => this.client.fetch({\n method: 'GET',\n path: `/registry/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/tags/${validatePathParam('tagId', request.tagId)}`\n }, unmarshalTag);\n\n /**\n * Waits for {@link Tag} to be in a final state.\n *\n * @param request - The request {@link GetTagRequest}\n * @param options - The waiting options\n * @returns A Promise of Tag\n */\n waitForTag = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!TAG_TRANSIENT_STATUSES.includes(res.status))), this.getTag, request, options);\n\n /**\n * Delete a tag. Delete a given image tag. You must specify, in the endpoint,\n * the `region` and `tag_id` parameters of the tag you want to delete.\n *\n * @param request - The request {@link DeleteTagRequest}\n * @returns A Promise of Tag\n */\n deleteTag = request => this.client.fetch({\n method: 'DELETE',\n path: `/registry/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/tags/${validatePathParam('tagId', request.tagId)}`,\n urlParams: urlParams(['force', request.force])\n }, unmarshalTag);\n};\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\nvar index_gen$7 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n API: API$7,\n IMAGE_TRANSIENT_STATUSES: IMAGE_TRANSIENT_STATUSES,\n NAMESPACE_TRANSIENT_STATUSES: NAMESPACE_TRANSIENT_STATUSES,\n TAG_TRANSIENT_STATUSES: TAG_TRANSIENT_STATUSES\n});\n\nvar index$6 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n v1: index_gen$7\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst unmarshalFolder = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Folder' failed as data isn't a dictionary.`);\n }\n return {\n createdAt: unmarshalDate(data.created_at),\n id: data.id,\n name: data.name,\n path: data.path,\n projectId: data.project_id\n };\n};\nconst unmarshalSecret = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Secret' failed as data isn't a dictionary.`);\n }\n return {\n createdAt: unmarshalDate(data.created_at),\n description: data.description,\n id: data.id,\n isManaged: data.is_managed,\n isProtected: data.is_protected,\n name: data.name,\n path: data.path,\n projectId: data.project_id,\n region: data.region,\n status: data.status,\n tags: data.tags,\n type: data.type,\n updatedAt: unmarshalDate(data.updated_at),\n versionCount: data.version_count\n };\n};\nconst unmarshalSecretVersion = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'SecretVersion' failed as data isn't a dictionary.`);\n }\n return {\n createdAt: unmarshalDate(data.created_at),\n description: data.description,\n isLatest: data.is_latest,\n revision: data.revision,\n secretId: data.secret_id,\n status: data.status,\n updatedAt: unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalAccessSecretVersionResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'AccessSecretVersionResponse' failed as data isn't a dictionary.`);\n }\n return {\n data: data.data,\n dataCrc32: data.data_crc32,\n revision: data.revision,\n secretId: data.secret_id\n };\n};\nconst unmarshalListFoldersResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListFoldersResponse' failed as data isn't a dictionary.`);\n }\n return {\n folders: unmarshalArrayOfObject(data.folders, unmarshalFolder),\n totalCount: data.total_count\n };\n};\nconst unmarshalListSecretVersionsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListSecretVersionsResponse' failed as data isn't a dictionary.`);\n }\n return {\n totalCount: data.total_count,\n versions: unmarshalArrayOfObject(data.versions, unmarshalSecretVersion)\n };\n};\nconst unmarshalListSecretsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListSecretsResponse' failed as data isn't a dictionary.`);\n }\n return {\n secrets: unmarshalArrayOfObject(data.secrets, unmarshalSecret),\n totalCount: data.total_count\n };\n};\nconst unmarshalListTagsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListTagsResponse' failed as data isn't a dictionary.`);\n }\n return {\n tags: data.tags,\n totalCount: data.total_count\n };\n};\nconst marshalPasswordGenerationParams = (request, defaults) => ({\n additional_chars: request.additionalChars,\n length: request.length,\n no_digits: request.noDigits,\n no_lowercase_letters: request.noLowercaseLetters,\n no_uppercase_letters: request.noUppercaseLetters\n});\nconst marshalAddSecretOwnerRequest = (request, defaults) => ({\n product: request.product ?? 'unknown',\n product_name: request.productName\n});\nconst marshalCreateFolderRequest = (request, defaults) => ({\n name: request.name,\n path: request.path,\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalCreateSecretRequest = (request, defaults) => ({\n description: request.description,\n name: request.name,\n path: request.path,\n project_id: request.projectId ?? defaults.defaultProjectId,\n tags: request.tags,\n type: request.type ?? 'unknown_secret_type'\n});\nconst marshalCreateSecretVersionRequest = (request, defaults) => ({\n data: request.data,\n data_crc32: request.dataCrc32,\n description: request.description,\n disable_previous: request.disablePrevious,\n ...resolveOneOf([{\n param: 'password_generation',\n value: request.passwordGeneration ? marshalPasswordGenerationParams(request.passwordGeneration) : undefined\n }])\n});\nconst marshalGeneratePasswordRequest = (request, defaults) => ({\n additional_chars: request.additionalChars,\n description: request.description,\n disable_previous: request.disablePrevious,\n length: request.length,\n no_digits: request.noDigits,\n no_lowercase_letters: request.noLowercaseLetters,\n no_uppercase_letters: request.noUppercaseLetters\n});\nconst marshalUpdateSecretRequest = (request, defaults) => ({\n description: request.description,\n name: request.name,\n path: request.path,\n tags: request.tags\n});\nconst marshalUpdateSecretVersionRequest = (request, defaults) => ({\n description: request.description\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst jsonContentHeaders$6 = {\n 'Content-Type': 'application/json; charset=utf-8'\n};\n\n/**\n * Secret Manager API.\n *\n * Secret Manager API. This API allows you to conveniently store, access and\n * share sensitive data.\n */\nlet API$6 = class API extends API$u {\n /** Lists the available regions of the API. */\n static LOCALITIES = ['fr-par'];\n\n /**\n * Create a secret. You must specify the `region` to create a secret.\n *\n * @param request - The request {@link CreateSecretRequest}\n * @returns A Promise of Secret\n */\n createSecret = request => this.client.fetch({\n body: JSON.stringify(marshalCreateSecretRequest(request, this.client.settings)),\n headers: jsonContentHeaders$6,\n method: 'POST',\n path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets`\n }, unmarshalSecret);\n\n /**\n * Create folder.\n *\n * @param request - The request {@link CreateFolderRequest}\n * @returns A Promise of Folder\n */\n createFolder = request => this.client.fetch({\n body: JSON.stringify(marshalCreateFolderRequest(request, this.client.settings)),\n headers: jsonContentHeaders$6,\n method: 'POST',\n path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/folders`\n }, unmarshalFolder);\n\n /**\n * Get metadata using the secret's ID. Retrieve the metadata of a secret\n * specified by the `region` and `secret_id` parameters.\n *\n * @param request - The request {@link GetSecretRequest}\n * @returns A Promise of Secret\n */\n getSecret = request => this.client.fetch({\n method: 'GET',\n path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}`\n }, unmarshalSecret);\n\n /**\n * Get metadata using the secret's name. Retrieve the metadata of a secret\n * specified by the `region` and `secret_name` parameters.\n *\n * GetSecretByName usage is now deprecated.\n *\n * Scaleway recommends that you use the `ListSecrets` request with the `name`\n * filter.\n *\n * @deprecated\n * @param request - The request {@link GetSecretByNameRequest}\n * @returns A Promise of Secret\n */\n getSecretByName = request => this.client.fetch({\n method: 'GET',\n path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets-by-name/${validatePathParam('secretName', request.secretName)}`,\n urlParams: urlParams(['project_id', request.projectId])\n }, unmarshalSecret);\n\n /**\n * Update metadata of a secret. Edit a secret's metadata such as name, tag(s)\n * and description. The secret to update is specified by the `secret_id` and\n * `region` parameters.\n *\n * @param request - The request {@link UpdateSecretRequest}\n * @returns A Promise of Secret\n */\n updateSecret = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateSecretRequest(request, this.client.settings)),\n headers: jsonContentHeaders$6,\n method: 'PATCH',\n path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}`\n }, unmarshalSecret);\n pageOfListSecrets = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets`,\n urlParams: urlParams(['is_managed', request.isManaged], ['name', request.name], ['order_by', request.orderBy ?? 'name_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['path', request.path], ['project_id', request.projectId], ['tags', request.tags])\n }, unmarshalListSecretsResponse);\n\n /**\n * List secrets. Retrieve the list of secrets created within an Organization\n * and/or Project. You must specify either the `organization_id` or the\n * `project_id` and the `region`.\n *\n * @param request - The request {@link ListSecretsRequest}\n * @returns A Promise of ListSecretsResponse\n */\n listSecrets = (request = {}) => enrichForPagination('secrets', this.pageOfListSecrets, request);\n pageOfListFolders = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/folders`,\n urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['path', request.path], ['project_id', request.projectId])\n }, unmarshalListFoldersResponse);\n\n /**\n * List folders. Retrieve the list of folders created within a Project.\n *\n * @param request - The request {@link ListFoldersRequest}\n * @returns A Promise of ListFoldersResponse\n */\n listFolders = (request = {}) => enrichForPagination('folders', this.pageOfListFolders, request);\n\n /**\n * Delete a secret. Delete a given secret specified by the `region` and\n * `secret_id` parameters.\n *\n * @param request - The request {@link DeleteSecretRequest}\n */\n deleteSecret = request => this.client.fetch({\n method: 'DELETE',\n path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}`\n });\n\n /**\n * Delete a given folder specified by the `region` and `folder_id` parameters.\n *\n * @param request - The request {@link DeleteFolderRequest}\n */\n deleteFolder = request => this.client.fetch({\n method: 'DELETE',\n path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/folders/${validatePathParam('folderId', request.folderId)}`\n });\n\n /**\n * Protect a secret. Protect a given secret specified by the `secret_id`\n * parameter. A protected secret can be read and modified but cannot be\n * deleted.\n *\n * @param request - The request {@link ProtectSecretRequest}\n * @returns A Promise of Secret\n */\n protectSecret = request => this.client.fetch({\n body: '{}',\n headers: jsonContentHeaders$6,\n method: 'POST',\n path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/protect`\n }, unmarshalSecret);\n\n /**\n * Unprotect a secret. Unprotect a given secret specified by the `secret_id`\n * parameter. An unprotected secret can be read, modified and deleted.\n *\n * @param request - The request {@link UnprotectSecretRequest}\n * @returns A Promise of Secret\n */\n unprotectSecret = request => this.client.fetch({\n body: '{}',\n headers: jsonContentHeaders$6,\n method: 'POST',\n path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/unprotect`\n }, unmarshalSecret);\n\n /**\n * Allow a product to use the secret.\n *\n * @param request - The request {@link AddSecretOwnerRequest}\n */\n addSecretOwner = request => this.client.fetch({\n body: JSON.stringify(marshalAddSecretOwnerRequest(request, this.client.settings)),\n headers: jsonContentHeaders$6,\n method: 'POST',\n path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/add-owner`\n });\n\n /**\n * Create a version. Create a version of a given secret specified by the\n * `region` and `secret_id` parameters.\n *\n * @param request - The request {@link CreateSecretVersionRequest}\n * @returns A Promise of SecretVersion\n */\n createSecretVersion = request => this.client.fetch({\n body: JSON.stringify(marshalCreateSecretVersionRequest(request, this.client.settings)),\n headers: jsonContentHeaders$6,\n method: 'POST',\n path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions`\n }, unmarshalSecretVersion);\n\n /**\n * Generate a password in a new version. Generate a password for the given\n * secret specified by the `region` and `secret_id` parameters. This will also\n * create a new version of the secret that will store the password.\n *\n * @param request - The request {@link GeneratePasswordRequest}\n * @returns A Promise of SecretVersion\n */\n generatePassword = request => this.client.fetch({\n body: JSON.stringify(marshalGeneratePasswordRequest(request, this.client.settings)),\n headers: jsonContentHeaders$6,\n method: 'POST',\n path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/generate-password`\n }, unmarshalSecretVersion);\n\n /**\n * Get metadata of a secret's version using the secret's ID. Retrieve the\n * metadata of a secret's given version specified by the `region`, `secret_id`\n * and `revision` parameters.\n *\n * @param request - The request {@link GetSecretVersionRequest}\n * @returns A Promise of SecretVersion\n */\n getSecretVersion = request => this.client.fetch({\n method: 'GET',\n path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions/${validatePathParam('revision', request.revision)}`\n }, unmarshalSecretVersion);\n\n /**\n * Get metadata of a secret's version using the secret's name. Retrieve the\n * metadata of a secret's given version specified by the `region`,\n * `secret_name`, `revision` and `project_id` parameters.\n *\n * @param request - The request {@link GetSecretVersionByNameRequest}\n * @returns A Promise of SecretVersion\n */\n getSecretVersionByName = request => this.client.fetch({\n method: 'GET',\n path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets-by-name/${validatePathParam('secretName', request.secretName)}/versions/${validatePathParam('revision', request.revision)}`,\n urlParams: urlParams(['project_id', request.projectId])\n }, unmarshalSecretVersion);\n\n /**\n * Update metadata of a version. Edit the metadata of a secret's given\n * version, specified by the `region`, `secret_id` and `revision` parameters.\n *\n * @param request - The request {@link UpdateSecretVersionRequest}\n * @returns A Promise of SecretVersion\n */\n updateSecretVersion = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateSecretVersionRequest(request, this.client.settings)),\n headers: jsonContentHeaders$6,\n method: 'PATCH',\n path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions/${validatePathParam('revision', request.revision)}`\n }, unmarshalSecretVersion);\n pageOfListSecretVersions = request => this.client.fetch({\n method: 'GET',\n path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions`,\n urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['status', request.status])\n }, unmarshalListSecretVersionsResponse);\n\n /**\n * List versions of a secret using the secret's ID. Retrieve the list of a\n * given secret's versions specified by the `secret_id` and `region`\n * parameters.\n *\n * @param request - The request {@link ListSecretVersionsRequest}\n * @returns A Promise of ListSecretVersionsResponse\n */\n listSecretVersions = request => enrichForPagination('versions', this.pageOfListSecretVersions, request);\n pageOfListSecretVersionsByName = request => this.client.fetch({\n method: 'GET',\n path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets-by-name/${validatePathParam('secretName', request.secretName)}/versions`,\n urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId], ['status', request.status])\n }, unmarshalListSecretVersionsResponse);\n\n /**\n * List versions of a secret using the secret's name. Retrieve the list of a\n * given secret's versions specified by the `secret_name`,`region` and\n * `project_id` parameters.\n *\n * @param request - The request {@link ListSecretVersionsByNameRequest}\n * @returns A Promise of ListSecretVersionsResponse\n */\n listSecretVersionsByName = request => enrichForPagination('versions', this.pageOfListSecretVersionsByName, request);\n\n /**\n * Enable a version. Make a specific version accessible. You must specify the\n * `region`, `secret_id` and `revision` parameters.\n *\n * @param request - The request {@link EnableSecretVersionRequest}\n * @returns A Promise of SecretVersion\n */\n enableSecretVersion = request => this.client.fetch({\n body: '{}',\n headers: jsonContentHeaders$6,\n method: 'POST',\n path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions/${validatePathParam('revision', request.revision)}/enable`\n }, unmarshalSecretVersion);\n\n /**\n * Disable a version. Make a specific version inaccessible. You must specify\n * the `region`, `secret_id` and `revision` parameters.\n *\n * @param request - The request {@link DisableSecretVersionRequest}\n * @returns A Promise of SecretVersion\n */\n disableSecretVersion = request => this.client.fetch({\n body: '{}',\n headers: jsonContentHeaders$6,\n method: 'POST',\n path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions/${validatePathParam('revision', request.revision)}/disable`\n }, unmarshalSecretVersion);\n\n /**\n * Access a secret's version using the secret's ID. Access sensitive data in a\n * secret's version specified by the `region`, `secret_id` and `revision`\n * parameters.\n *\n * @param request - The request {@link AccessSecretVersionRequest}\n * @returns A Promise of AccessSecretVersionResponse\n */\n accessSecretVersion = request => this.client.fetch({\n method: 'GET',\n path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions/${validatePathParam('revision', request.revision)}/access`\n }, unmarshalAccessSecretVersionResponse);\n\n /**\n * Access a secret's version using the secret's name. Access sensitive data in\n * a secret's version specified by the `region`, `secret_name`, `revision` and\n * `project_id` parameters.\n *\n * @param request - The request {@link AccessSecretVersionByNameRequest}\n * @returns A Promise of AccessSecretVersionResponse\n */\n accessSecretVersionByName = request => this.client.fetch({\n method: 'GET',\n path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets-by-name/${validatePathParam('secretName', request.secretName)}/versions/${validatePathParam('revision', request.revision)}/access`,\n urlParams: urlParams(['project_id', request.projectId])\n }, unmarshalAccessSecretVersionResponse);\n\n /**\n * Delete a version. Delete a secret's version and the sensitive data\n * contained in it. Deleting a version is permanent and cannot be undone.\n *\n * @param request - The request {@link DestroySecretVersionRequest}\n * @returns A Promise of SecretVersion\n */\n destroySecretVersion = request => this.client.fetch({\n body: '{}',\n headers: jsonContentHeaders$6,\n method: 'POST',\n path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions/${validatePathParam('revision', request.revision)}/destroy`\n }, unmarshalSecretVersion);\n pageOfListTags = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/secret-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/tags`,\n urlParams: urlParams(['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])\n }, unmarshalListTagsResponse);\n\n /**\n * List tags. List all tags associated with secrets within a given Project.\n *\n * @param request - The request {@link ListTagsRequest}\n * @returns A Promise of ListTagsResponse\n */\n listTags = (request = {}) => enrichForPagination('tags', this.pageOfListTags, request);\n};\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\nvar index_gen$6 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n API: API$6\n});\n\nvar index$5 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n v1alpha1: index_gen$6\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\n/** Lists transient statutes of the enum {@link HumanStatus}. */\nconst HUMAN_TRANSIENT_STATUSES = ['running'];\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst unmarshalHuman = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Human' failed as data isn't a dictionary.`);\n }\n return {\n altitudeInMeter: data.altitude_in_meter,\n altitudeInMillimeter: data.altitude_in_millimeter,\n createdAt: unmarshalDate(data.created_at),\n eyesColor: data.eyes_color,\n fingersCount: data.fingers_count,\n hairCount: data.hair_count,\n height: data.height,\n id: data.id,\n isHappy: data.is_happy,\n name: data.name,\n organizationId: data.organization_id,\n projectId: data.project_id,\n shoeSize: data.shoe_size,\n status: data.status,\n updatedAt: unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalListHumansResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListHumansResponse' failed as data isn't a dictionary.`);\n }\n return {\n humans: unmarshalArrayOfObject(data.humans, unmarshalHuman),\n totalCount: data.total_count\n };\n};\nconst unmarshalRegisterResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'RegisterResponse' failed as data isn't a dictionary.`);\n }\n return {\n accessKey: data.access_key,\n secretKey: data.secret_key\n };\n};\nconst marshalCreateHumanRequest = (request, defaults) => ({\n altitude_in_meter: request.altitudeInMeter,\n altitude_in_millimeter: request.altitudeInMillimeter,\n eyes_color: request.eyesColor ?? 'unknown',\n fingers_count: request.fingersCount,\n hair_count: request.hairCount,\n height: request.height,\n is_happy: request.isHappy,\n name: request.name,\n shoe_size: request.shoeSize,\n ...resolveOneOf([{\n default: defaults.defaultProjectId,\n param: 'project_id',\n value: request.projectId\n }, {\n default: defaults.defaultOrganizationId,\n param: 'organization_id',\n value: request.organizationId\n }])\n});\nconst marshalRegisterRequest = (request, defaults) => ({\n username: request.username\n});\nconst marshalUpdateHumanRequest = (request, defaults) => ({\n altitude_in_meter: request.altitudeInMeter,\n altitude_in_millimeter: request.altitudeInMillimeter,\n eyes_color: request.eyesColor ?? 'unknown',\n fingers_count: request.fingersCount,\n hair_count: request.hairCount,\n height: request.height,\n is_happy: request.isHappy,\n name: request.name,\n shoe_size: request.shoeSize\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst jsonContentHeaders$5 = {\n 'Content-Type': 'application/json; charset=utf-8'\n};\n\n/**\n * Fake API.\n *\n * No Auth Service for end-to-end testing. Test is a fake service that aim to\n * manage fake humans. It is used for internal and public end-to-end tests.\n *\n * This service don't use the Scaleway authentication service but a fake one. It\n * allows to use this test service publicly without requiring a Scaleway\n * account.\n *\n * First, you need to register a user with `scw test human register` to get an\n * access-key. Then, you can use other test commands by setting the\n * SCW_SECRET_KEY env variable.\n */\nlet API$5 = class API extends API$u {\n /**\n * Register a user. Register a human and return a access-key and a secret-key\n * that must be used in all other commands.\n *\n * Hint: you can use other test commands by setting the SCW_SECRET_KEY env\n * variable.\n *\n * @param request - The request {@link RegisterRequest}\n * @returns A Promise of RegisterResponse\n */\n register = request => this.client.fetch({\n body: JSON.stringify(marshalRegisterRequest(request, this.client.settings)),\n headers: jsonContentHeaders$5,\n method: 'POST',\n path: `/test/v1/register`\n }, unmarshalRegisterResponse);\n pageOfListHumans = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/test/v1/humans`,\n urlParams: urlParams(['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])\n }, unmarshalListHumansResponse);\n\n /**\n * List all your humans.\n *\n * @param request - The request {@link ListHumansRequest}\n * @returns A Promise of ListHumansResponse\n */\n listHumans = (request = {}) => enrichForPagination('humans', this.pageOfListHumans, request);\n\n /**\n * Get human details. Get the human details associated with the given id.\n *\n * @param request - The request {@link GetHumanRequest}\n * @returns A Promise of Human\n */\n getHuman = request => this.client.fetch({\n method: 'GET',\n path: `/test/v1/humans/${validatePathParam('humanId', request.humanId)}`\n }, unmarshalHuman);\n\n /**\n * Waits for {@link Human} to be in a final state.\n *\n * @param request - The request {@link GetHumanRequest}\n * @param options - The waiting options\n * @returns A Promise of Human\n */\n waitForHuman = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!HUMAN_TRANSIENT_STATUSES.includes(res.status))), this.getHuman, request, options);\n\n /**\n * Create a new human.\n *\n * @param request - The request {@link CreateHumanRequest}\n * @returns A Promise of Human\n */\n createHuman = request => this.client.fetch({\n body: JSON.stringify(marshalCreateHumanRequest(request, this.client.settings)),\n headers: jsonContentHeaders$5,\n method: 'POST',\n path: `/test/v1/humans`\n }, unmarshalHuman);\n\n /**\n * Update an existing human. Update the human associated with the given id.\n *\n * @param request - The request {@link UpdateHumanRequest}\n * @returns A Promise of Human\n */\n updateHuman = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateHumanRequest(request, this.client.settings)),\n headers: jsonContentHeaders$5,\n method: 'PATCH',\n path: `/test/v1/humans/${validatePathParam('humanId', request.humanId)}`\n }, unmarshalHuman);\n\n /**\n * Delete an existing human. Delete the human associated with the given id.\n *\n * @param request - The request {@link DeleteHumanRequest}\n * @returns A Promise of Human\n */\n deleteHuman = request => this.client.fetch({\n method: 'DELETE',\n path: `/test/v1/humans/${validatePathParam('humanId', request.humanId)}`\n }, unmarshalHuman);\n\n /**\n * Start a 1h running for the given human. Start a one hour running for the\n * given human.\n *\n * @param request - The request {@link RunHumanRequest}\n * @returns A Promise of Human\n */\n runHuman = request => this.client.fetch({\n body: '{}',\n headers: jsonContentHeaders$5,\n method: 'POST',\n path: `/test/v1/humans/${validatePathParam('humanId', request.humanId)}/run`\n }, unmarshalHuman);\n\n /**\n * Make a human smoke.\n *\n * @deprecated\n * @param request - The request {@link SmokeHumanRequest}\n * @returns A Promise of Human\n */\n smokeHuman = (request = {}) => this.client.fetch({\n body: '{}',\n headers: jsonContentHeaders$5,\n method: 'POST',\n path: `/test/v1/humans/${validatePathParam('humanId', request.humanId)}/smoke`\n }, unmarshalHuman);\n};\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\nvar index_gen$5 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n API: API$5,\n HUMAN_TRANSIENT_STATUSES: HUMAN_TRANSIENT_STATUSES\n});\n\nvar index$4 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n v1: index_gen$5\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\n/** Lists transient statutes of the enum {@link DomainStatus}. */\nconst DOMAIN_TRANSIENT_STATUSES = ['pending'];\n\n/** Lists transient statutes of the enum {@link EmailStatus}. */\nconst EMAIL_TRANSIENT_STATUSES = ['new', 'sending'];\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst unmarshalDomainStatistics = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'DomainStatistics' failed as data isn't a dictionary.`);\n }\n return {\n canceledCount: data.canceled_count,\n failedCount: data.failed_count,\n sentCount: data.sent_count,\n totalCount: data.total_count\n };\n};\nconst unmarshalEmailTry = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'EmailTry' failed as data isn't a dictionary.`);\n }\n return {\n code: data.code,\n message: data.message,\n rank: data.rank,\n triedAt: unmarshalDate(data.tried_at)\n };\n};\nconst unmarshalDomain = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Domain' failed as data isn't a dictionary.`);\n }\n return {\n createdAt: unmarshalDate(data.created_at),\n dkimConfig: data.dkim_config,\n id: data.id,\n lastError: data.last_error,\n lastValidAt: unmarshalDate(data.last_valid_at),\n name: data.name,\n nextCheckAt: unmarshalDate(data.next_check_at),\n organizationId: data.organization_id,\n projectId: data.project_id,\n region: data.region,\n revokedAt: unmarshalDate(data.revoked_at),\n spfConfig: data.spf_config,\n statistics: data.statistics ? unmarshalDomainStatistics(data.statistics) : undefined,\n status: data.status\n };\n};\nconst unmarshalDomainLastStatusDkimRecord = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'DomainLastStatusDkimRecord' failed as data isn't a dictionary.`);\n }\n return {\n error: data.error,\n lastValidAt: unmarshalDate(data.last_valid_at),\n status: data.status\n };\n};\nconst unmarshalDomainLastStatusSpfRecord = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'DomainLastStatusSpfRecord' failed as data isn't a dictionary.`);\n }\n return {\n error: data.error,\n lastValidAt: unmarshalDate(data.last_valid_at),\n status: data.status\n };\n};\nconst unmarshalEmail = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Email' failed as data isn't a dictionary.`);\n }\n return {\n createdAt: unmarshalDate(data.created_at),\n flags: data.flags,\n id: data.id,\n lastTries: unmarshalArrayOfObject(data.last_tries, unmarshalEmailTry),\n mailFrom: data.mail_from,\n mailRcpt: data.mail_rcpt,\n messageId: data.message_id,\n projectId: data.project_id,\n rcptTo: data.rcpt_to,\n rcptType: data.rcpt_type,\n status: data.status,\n statusDetails: data.status_details,\n subject: data.subject,\n tryCount: data.try_count,\n updatedAt: unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalCreateEmailResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'CreateEmailResponse' failed as data isn't a dictionary.`);\n }\n return {\n emails: unmarshalArrayOfObject(data.emails, unmarshalEmail)\n };\n};\nconst unmarshalDomainLastStatus = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'DomainLastStatus' failed as data isn't a dictionary.`);\n }\n return {\n dkimRecord: data.dkim_record ? unmarshalDomainLastStatusDkimRecord(data.dkim_record) : undefined,\n domainId: data.domain_id,\n domainName: data.domain_name,\n spfRecord: data.spf_record ? unmarshalDomainLastStatusSpfRecord(data.spf_record) : undefined\n };\n};\nconst unmarshalListDomainsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListDomainsResponse' failed as data isn't a dictionary.`);\n }\n return {\n domains: unmarshalArrayOfObject(data.domains, unmarshalDomain),\n totalCount: data.total_count\n };\n};\nconst unmarshalListEmailsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListEmailsResponse' failed as data isn't a dictionary.`);\n }\n return {\n emails: unmarshalArrayOfObject(data.emails, unmarshalEmail),\n totalCount: data.total_count\n };\n};\nconst unmarshalStatistics = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Statistics' failed as data isn't a dictionary.`);\n }\n return {\n canceledCount: data.canceled_count,\n failedCount: data.failed_count,\n newCount: data.new_count,\n sendingCount: data.sending_count,\n sentCount: data.sent_count,\n totalCount: data.total_count\n };\n};\nconst marshalCreateEmailRequestAddress = (request, defaults) => ({\n email: request.email,\n name: request.name\n});\nconst marshalCreateEmailRequestAttachment = (request, defaults) => ({\n content: request.content,\n name: request.name,\n type: request.type\n});\nconst marshalCreateDomainRequest = (request, defaults) => ({\n accept_tos: request.acceptTos,\n domain_name: request.domainName,\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalCreateEmailRequest = (request, defaults) => ({\n attachments: request.attachments ? request.attachments.map(elt => marshalCreateEmailRequestAttachment(elt)) : undefined,\n bcc: request.bcc ? request.bcc.map(elt => marshalCreateEmailRequestAddress(elt)) : undefined,\n cc: request.cc ? request.cc.map(elt => marshalCreateEmailRequestAddress(elt)) : undefined,\n from: request.from ? marshalCreateEmailRequestAddress(request.from) : undefined,\n html: request.html,\n project_id: request.projectId ?? defaults.defaultProjectId,\n send_before: request.sendBefore,\n subject: request.subject,\n text: request.text,\n to: request.to ? request.to.map(elt => marshalCreateEmailRequestAddress(elt)) : undefined\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst jsonContentHeaders$4 = {\n 'Content-Type': 'application/json; charset=utf-8'\n};\n\n/** Transactional Email API. */\nlet API$4 = class API extends API$u {\n /** Lists the available regions of the API. */\n static LOCALITIES = ['fr-par'];\n\n /**\n * Send an email. You must specify the `region`, the sender and the\n * recipient's information and the `project_id` to send an email from a\n * checked domain. The subject of the email must contain at least 6\n * characters.\n *\n * @param request - The request {@link CreateEmailRequest}\n * @returns A Promise of CreateEmailResponse\n */\n createEmail = request => this.client.fetch({\n body: JSON.stringify(marshalCreateEmailRequest(request, this.client.settings)),\n headers: jsonContentHeaders$4,\n method: 'POST',\n path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/emails`\n }, unmarshalCreateEmailResponse);\n\n /**\n * Get an email. Retrieve information about a specific email using the\n * `email_id` and `region` parameters.\n *\n * @param request - The request {@link GetEmailRequest}\n * @returns A Promise of Email\n */\n getEmail = request => this.client.fetch({\n method: 'GET',\n path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/emails/${validatePathParam('emailId', request.emailId)}`\n }, unmarshalEmail);\n\n /**\n * Waits for {@link Email} to be in a final state.\n *\n * @param request - The request {@link GetEmailRequest}\n * @param options - The waiting options\n * @returns A Promise of Email\n */\n waitForEmail = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!EMAIL_TRANSIENT_STATUSES.includes(res.status))), this.getEmail, request, options);\n pageOfListEmails = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/emails`,\n urlParams: urlParams(['domain_id', request.domainId], ['flags', request.flags], ['mail_from', request.mailFrom], ['mail_rcpt', request.mailRcpt], ['mail_to', request.mailTo], ['message_id', request.messageId], ['order_by', request.orderBy ?? 'created_at_desc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId], ['search', request.search], ['since', request.since], ['statuses', request.statuses], ['subject', request.subject], ['until', request.until])\n }, unmarshalListEmailsResponse);\n\n /**\n * List emails. Retrieve the list of emails sent from a specific domain or for\n * a specific Project or Organization. You must specify the `region`.\n *\n * @param request - The request {@link ListEmailsRequest}\n * @returns A Promise of ListEmailsResponse\n */\n listEmails = (request = {}) => enrichForPagination('emails', this.pageOfListEmails, request);\n\n /**\n * Email statuses. Get information on your emails' statuses.\n *\n * @param request - The request {@link GetStatisticsRequest}\n * @returns A Promise of Statistics\n */\n getStatistics = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/statistics`,\n urlParams: urlParams(['domain_id', request.domainId], ['mail_from', request.mailFrom], ['project_id', request.projectId], ['since', request.since], ['until', request.until])\n }, unmarshalStatistics);\n\n /**\n * Cancel an email. You can cancel the sending of an email if it has not been\n * sent yet. You must specify the `region` and the `email_id` of the email you\n * want to cancel.\n *\n * @param request - The request {@link CancelEmailRequest}\n * @returns A Promise of Email\n */\n cancelEmail = request => this.client.fetch({\n body: '{}',\n headers: jsonContentHeaders$4,\n method: 'POST',\n path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/emails/${validatePathParam('emailId', request.emailId)}/cancel`\n }, unmarshalEmail);\n\n /**\n * Register a domain in a project. You must specify the `region`, `project_id`\n * and `domain_name` to register a domain in a specific Project.\n *\n * @param request - The request {@link CreateDomainRequest}\n * @returns A Promise of Domain\n */\n createDomain = request => this.client.fetch({\n body: JSON.stringify(marshalCreateDomainRequest(request, this.client.settings)),\n headers: jsonContentHeaders$4,\n method: 'POST',\n path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains`\n }, unmarshalDomain);\n\n /**\n * Get information about a domain. Retrieve information about a specific\n * domain using the `region` and `domain_id` parameters.\n *\n * @param request - The request {@link GetDomainRequest}\n * @returns A Promise of Domain\n */\n getDomain = request => this.client.fetch({\n method: 'GET',\n path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam('domainId', request.domainId)}`\n }, unmarshalDomain);\n\n /**\n * Waits for {@link Domain} to be in a final state.\n *\n * @param request - The request {@link GetDomainRequest}\n * @param options - The waiting options\n * @returns A Promise of Domain\n */\n waitForDomain = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!DOMAIN_TRANSIENT_STATUSES.includes(res.status))), this.getDomain, request, options);\n pageOfListDomains = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains`,\n urlParams: urlParams(['name', request.name], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId], ['status', request.status])\n }, unmarshalListDomainsResponse);\n\n /**\n * List domains. Retrieve domains in a specific project or in a specific\n * Organization using the `region` parameter.\n *\n * @param request - The request {@link ListDomainsRequest}\n * @returns A Promise of ListDomainsResponse\n */\n listDomains = (request = {}) => enrichForPagination('domains', this.pageOfListDomains, request);\n\n /**\n * Delete a domain. You must specify the domain you want to delete by the\n * `region` and `domain_id`. Deleting a domain is permanent and cannot be\n * undone.\n *\n * @param request - The request {@link RevokeDomainRequest}\n * @returns A Promise of Domain\n */\n revokeDomain = request => this.client.fetch({\n body: '{}',\n headers: jsonContentHeaders$4,\n method: 'POST',\n path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam('domainId', request.domainId)}/revoke`\n }, unmarshalDomain);\n\n /**\n * Domain DNS check. Perform an immediate DNS check of a domain using the\n * `region` and `domain_id` parameters.\n *\n * @param request - The request {@link CheckDomainRequest}\n * @returns A Promise of Domain\n */\n checkDomain = request => this.client.fetch({\n body: '{}',\n headers: jsonContentHeaders$4,\n method: 'POST',\n path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam('domainId', request.domainId)}/check`\n }, unmarshalDomain);\n\n /**\n * Display SPF and DKIM records status and potential errors. Display SPF and\n * DKIM records status and potential errors, including the found records to\n * make debugging easier.\n *\n * @param request - The request {@link GetDomainLastStatusRequest}\n * @returns A Promise of DomainLastStatus\n */\n getDomainLastStatus = request => this.client.fetch({\n method: 'GET',\n path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam('domainId', request.domainId)}/verification`\n }, unmarshalDomainLastStatus);\n};\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\nvar index_gen$4 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n API: API$4,\n DOMAIN_TRANSIENT_STATUSES: DOMAIN_TRANSIENT_STATUSES,\n EMAIL_TRANSIENT_STATUSES: EMAIL_TRANSIENT_STATUSES\n});\n\nvar index$3 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n v1alpha1: index_gen$4\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst unmarshalPrivateNetwork$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'PrivateNetwork' failed as data isn't a dictionary.`);\n }\n return {\n createdAt: unmarshalDate(data.created_at),\n id: data.id,\n name: data.name,\n organizationId: data.organization_id,\n projectId: data.project_id,\n subnets: data.subnets,\n tags: data.tags,\n updatedAt: unmarshalDate(data.updated_at),\n zone: data.zone\n };\n};\nconst unmarshalListPrivateNetworksResponse$1 = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListPrivateNetworksResponse' failed as data isn't a dictionary.`);\n }\n return {\n privateNetworks: unmarshalArrayOfObject(data.private_networks, unmarshalPrivateNetwork$1),\n totalCount: data.total_count\n };\n};\nconst marshalCreatePrivateNetworkRequest$1 = (request, defaults) => ({\n name: request.name || randomName('pn'),\n project_id: request.projectId ?? defaults.defaultProjectId,\n subnets: request.subnets,\n tags: request.tags\n});\nconst marshalUpdatePrivateNetworkRequest$1 = (request, defaults) => ({\n name: request.name,\n subnets: request.subnets,\n tags: request.tags\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst jsonContentHeaders$3 = {\n 'Content-Type': 'application/json; charset=utf-8'\n};\n\n/** VPC API. */\nlet API$3 = class API extends API$u {\n /** Lists the available zones of the API. */\n static LOCALITIES = ['fr-par-1', 'fr-par-2', 'fr-par-3', 'nl-ams-1', 'nl-ams-2', 'nl-ams-3', 'pl-waw-1', 'pl-waw-2'];\n pageOfListPrivateNetworks = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/vpc/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/private-networks`,\n urlParams: urlParams(['include_regional', request.includeRegional], ['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['private_network_ids', request.privateNetworkIds], ['project_id', request.projectId], ['tags', request.tags])\n }, unmarshalListPrivateNetworksResponse$1);\n\n /**\n * List Private Networks. List existing Private Networks in a specified\n * Availability Zone. By default, the Private Networks returned in the list\n * are ordered by creation date in ascending order, though this can be\n * modified via the order_by field.\n *\n * @param request - The request {@link ListPrivateNetworksRequest}\n * @returns A Promise of ListPrivateNetworksResponse\n */\n listPrivateNetworks = (request = {}) => enrichForPagination('privateNetworks', this.pageOfListPrivateNetworks, request);\n\n /**\n * Create a Private Network. Create a new Private Network. Once created, you\n * can attach Scaleway resources in the same Availability Zone.\n *\n * @param request - The request {@link CreatePrivateNetworkRequest}\n * @returns A Promise of PrivateNetwork\n */\n createPrivateNetwork = (request = {}) => this.client.fetch({\n body: JSON.stringify(marshalCreatePrivateNetworkRequest$1(request, this.client.settings)),\n headers: jsonContentHeaders$3,\n method: 'POST',\n path: `/vpc/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/private-networks`\n }, unmarshalPrivateNetwork$1);\n\n /**\n * Get a Private Network. Retrieve information about an existing Private\n * Network, specified by its Private Network ID. Its full details are returned\n * in the response object.\n *\n * @param request - The request {@link GetPrivateNetworkRequest}\n * @returns A Promise of PrivateNetwork\n */\n getPrivateNetwork = request => this.client.fetch({\n method: 'GET',\n path: `/vpc/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}`\n }, unmarshalPrivateNetwork$1);\n\n /**\n * Update Private Network. Update parameters (such as name or tags) of an\n * existing Private Network, specified by its Private Network ID.\n *\n * @param request - The request {@link UpdatePrivateNetworkRequest}\n * @returns A Promise of PrivateNetwork\n */\n updatePrivateNetwork = request => this.client.fetch({\n body: JSON.stringify(marshalUpdatePrivateNetworkRequest$1(request, this.client.settings)),\n headers: jsonContentHeaders$3,\n method: 'PATCH',\n path: `/vpc/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}`\n }, unmarshalPrivateNetwork$1);\n\n /**\n * Delete a Private Network. Delete an existing Private Network. Note that you\n * must first detach all resources from the network, in order to delete it.\n *\n * @param request - The request {@link DeletePrivateNetworkRequest}\n */\n deletePrivateNetwork = request => this.client.fetch({\n method: 'DELETE',\n path: `/vpc/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}`\n });\n};\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\nvar index_gen$3 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n API: API$3\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst unmarshalSubnet = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Subnet' failed as data isn't a dictionary.`);\n }\n return {\n createdAt: unmarshalDate(data.created_at),\n id: data.id,\n subnet: data.subnet,\n updatedAt: unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalPrivateNetwork = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'PrivateNetwork' failed as data isn't a dictionary.`);\n }\n return {\n createdAt: unmarshalDate(data.created_at),\n dhcpEnabled: data.dhcp_enabled,\n id: data.id,\n name: data.name,\n organizationId: data.organization_id,\n projectId: data.project_id,\n region: data.region,\n subnets: unmarshalArrayOfObject(data.subnets, unmarshalSubnet),\n tags: data.tags,\n updatedAt: unmarshalDate(data.updated_at),\n vpcId: data.vpc_id\n };\n};\nconst unmarshalVPC = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'VPC' failed as data isn't a dictionary.`);\n }\n return {\n createdAt: unmarshalDate(data.created_at),\n id: data.id,\n isDefault: data.is_default,\n name: data.name,\n organizationId: data.organization_id,\n privateNetworkCount: data.private_network_count,\n projectId: data.project_id,\n region: data.region,\n tags: data.tags,\n updatedAt: unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalAddSubnetsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'AddSubnetsResponse' failed as data isn't a dictionary.`);\n }\n return {\n subnets: data.subnets\n };\n};\nconst unmarshalDeleteSubnetsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'DeleteSubnetsResponse' failed as data isn't a dictionary.`);\n }\n return {\n subnets: data.subnets\n };\n};\nconst unmarshalListPrivateNetworksResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListPrivateNetworksResponse' failed as data isn't a dictionary.`);\n }\n return {\n privateNetworks: unmarshalArrayOfObject(data.private_networks, unmarshalPrivateNetwork),\n totalCount: data.total_count\n };\n};\nconst unmarshalListVPCsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListVPCsResponse' failed as data isn't a dictionary.`);\n }\n return {\n totalCount: data.total_count,\n vpcs: unmarshalArrayOfObject(data.vpcs, unmarshalVPC)\n };\n};\nconst unmarshalSetSubnetsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'SetSubnetsResponse' failed as data isn't a dictionary.`);\n }\n return {\n subnets: data.subnets\n };\n};\nconst marshalAddSubnetsRequest = (request, defaults) => ({\n subnets: request.subnets\n});\nconst marshalCreatePrivateNetworkRequest = (request, defaults) => ({\n name: request.name || randomName('pn'),\n project_id: request.projectId ?? defaults.defaultProjectId,\n subnets: request.subnets,\n tags: request.tags,\n vpc_id: request.vpcId\n});\nconst marshalCreateVPCRequest = (request, defaults) => ({\n name: request.name || randomName('vpc'),\n project_id: request.projectId ?? defaults.defaultProjectId,\n tags: request.tags\n});\nconst marshalDeleteSubnetsRequest = (request, defaults) => ({\n subnets: request.subnets\n});\nconst marshalMigrateZonalPrivateNetworksRequest = (request, defaults) => ({\n private_network_ids: request.privateNetworkIds,\n ...resolveOneOf([{\n default: defaults.defaultProjectId,\n param: 'project_id',\n value: request.projectId\n }, {\n default: defaults.defaultOrganizationId,\n param: 'organization_id',\n value: request.organizationId\n }])\n});\nconst marshalSetSubnetsRequest = (request, defaults) => ({\n subnets: request.subnets\n});\nconst marshalUpdatePrivateNetworkRequest = (request, defaults) => ({\n name: request.name,\n tags: request.tags\n});\nconst marshalUpdateVPCRequest = (request, defaults) => ({\n name: request.name,\n tags: request.tags\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst jsonContentHeaders$2 = {\n 'Content-Type': 'application/json; charset=utf-8'\n};\n\n/** VPC API. */\nlet API$2 = class API extends API$u {\n /** Lists the available regions of the API. */\n static LOCALITIES = ['fr-par', 'nl-ams', 'pl-waw'];\n pageOfListVPCs = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/vpcs`,\n urlParams: urlParams(['is_default', request.isDefault], ['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId], ['tags', request.tags])\n }, unmarshalListVPCsResponse);\n\n /**\n * List VPCs. List existing VPCs in the specified region.\n *\n * @param request - The request {@link ListVPCsRequest}\n * @returns A Promise of ListVPCsResponse\n */\n listVPCs = (request = {}) => enrichForPagination('vpcs', this.pageOfListVPCs, request);\n\n /**\n * Create a VPC. Create a new VPC in the specified region.\n *\n * @param request - The request {@link CreateVPCRequest}\n * @returns A Promise of VPC\n */\n createVPC = (request = {}) => this.client.fetch({\n body: JSON.stringify(marshalCreateVPCRequest(request, this.client.settings)),\n headers: jsonContentHeaders$2,\n method: 'POST',\n path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/vpcs`\n }, unmarshalVPC);\n\n /**\n * Get a VPC. Retrieve details of an existing VPC, specified by its VPC ID.\n *\n * @param request - The request {@link GetVPCRequest}\n * @returns A Promise of VPC\n */\n getVPC = request => this.client.fetch({\n method: 'GET',\n path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam('vpcId', request.vpcId)}`\n }, unmarshalVPC);\n\n /**\n * Update VPC. Update parameters including name and tags of the specified VPC.\n *\n * @param request - The request {@link UpdateVPCRequest}\n * @returns A Promise of VPC\n */\n updateVPC = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateVPCRequest(request, this.client.settings)),\n headers: jsonContentHeaders$2,\n method: 'PATCH',\n path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam('vpcId', request.vpcId)}`\n }, unmarshalVPC);\n\n /**\n * Delete a VPC. Delete a VPC specified by its VPC ID.\n *\n * @param request - The request {@link DeleteVPCRequest}\n */\n deleteVPC = request => this.client.fetch({\n method: 'DELETE',\n path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam('vpcId', request.vpcId)}`\n });\n pageOfListPrivateNetworks = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/private-networks`,\n urlParams: urlParams(['dhcp_enabled', request.dhcpEnabled], ['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['private_network_ids', request.privateNetworkIds], ['project_id', request.projectId], ['tags', request.tags], ['vpc_id', request.vpcId])\n }, unmarshalListPrivateNetworksResponse);\n\n /**\n * List Private Networks. List existing Private Networks in the specified\n * region. By default, the Private Networks returned in the list are ordered\n * by creation date in ascending order, though this can be modified via the\n * order_by field.\n *\n * @param request - The request {@link ListPrivateNetworksRequest}\n * @returns A Promise of ListPrivateNetworksResponse\n */\n listPrivateNetworks = (request = {}) => enrichForPagination('privateNetworks', this.pageOfListPrivateNetworks, request);\n\n /**\n * Create a Private Network. Create a new Private Network. Once created, you\n * can attach Scaleway resources which are in the same region.\n *\n * @param request - The request {@link CreatePrivateNetworkRequest}\n * @returns A Promise of PrivateNetwork\n */\n createPrivateNetwork = (request = {}) => this.client.fetch({\n body: JSON.stringify(marshalCreatePrivateNetworkRequest(request, this.client.settings)),\n headers: jsonContentHeaders$2,\n method: 'POST',\n path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/private-networks`\n }, unmarshalPrivateNetwork);\n\n /**\n * Get a Private Network. Retrieve information about an existing Private\n * Network, specified by its Private Network ID. Its full details are returned\n * in the response object.\n *\n * @param request - The request {@link GetPrivateNetworkRequest}\n * @returns A Promise of PrivateNetwork\n */\n getPrivateNetwork = request => this.client.fetch({\n method: 'GET',\n path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}`\n }, unmarshalPrivateNetwork);\n\n /**\n * Update Private Network. Update parameters (such as name or tags) of an\n * existing Private Network, specified by its Private Network ID.\n *\n * @param request - The request {@link UpdatePrivateNetworkRequest}\n * @returns A Promise of PrivateNetwork\n */\n updatePrivateNetwork = request => this.client.fetch({\n body: JSON.stringify(marshalUpdatePrivateNetworkRequest(request, this.client.settings)),\n headers: jsonContentHeaders$2,\n method: 'PATCH',\n path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}`\n }, unmarshalPrivateNetwork);\n\n /**\n * Delete a Private Network. Delete an existing Private Network. Note that you\n * must first detach all resources from the network, in order to delete it.\n *\n * @param request - The request {@link DeletePrivateNetworkRequest}\n */\n deletePrivateNetwork = request => this.client.fetch({\n method: 'DELETE',\n path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}`\n });\n\n /**\n * Migrate Private Networks from zoned to regional. Transform multiple\n * existing zoned Private Networks (scoped to a single Availability Zone) into\n * regional Private Networks, scoped to an entire region. You can transform\n * one or many Private Networks (specified by their Private Network IDs)\n * within a single Scaleway Organization or Project, with the same call.\n *\n * @param request - The request {@link MigrateZonalPrivateNetworksRequest}\n */\n migrateZonalPrivateNetworks = (request = {}) => this.client.fetch({\n body: JSON.stringify(marshalMigrateZonalPrivateNetworksRequest(request, this.client.settings)),\n headers: jsonContentHeaders$2,\n method: 'POST',\n path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/private-networks/migrate-zonal`\n });\n\n /**\n * Enable DHCP on a Private Network. Enable DHCP managed on an existing\n * Private Network. Note that you will not be able to deactivate it\n * afterwards.\n *\n * @param request - The request {@link EnableDHCPRequest}\n * @returns A Promise of PrivateNetwork\n */\n enableDHCP = request => this.client.fetch({\n body: '{}',\n headers: jsonContentHeaders$2,\n method: 'POST',\n path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}/enable-dhcp`\n }, unmarshalPrivateNetwork);\n\n /**\n * Set the subnets of a Private Network. Set subnets for an existing Private\n * Network. Note that the method is PUT and not PATCH. Any existing subnets\n * will be removed in favor of the new specified set of subnets.\n *\n * @param request - The request {@link SetSubnetsRequest}\n * @returns A Promise of SetSubnetsResponse\n */\n setSubnets = request => this.client.fetch({\n body: JSON.stringify(marshalSetSubnetsRequest(request, this.client.settings)),\n headers: jsonContentHeaders$2,\n method: 'PUT',\n path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}/subnets`\n }, unmarshalSetSubnetsResponse);\n\n /**\n * Add subnets to a Private Network. Add new subnets to an existing Private\n * Network.\n *\n * @param request - The request {@link AddSubnetsRequest}\n * @returns A Promise of AddSubnetsResponse\n */\n addSubnets = request => this.client.fetch({\n body: JSON.stringify(marshalAddSubnetsRequest(request, this.client.settings)),\n headers: jsonContentHeaders$2,\n method: 'POST',\n path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}/subnets`\n }, unmarshalAddSubnetsResponse);\n\n /**\n * Delete subnets from a Private Network. Delete the specified subnets from a\n * Private Network.\n *\n * @param request - The request {@link DeleteSubnetsRequest}\n * @returns A Promise of DeleteSubnetsResponse\n */\n deleteSubnets = request => this.client.fetch({\n body: JSON.stringify(marshalDeleteSubnetsRequest(request, this.client.settings)),\n headers: jsonContentHeaders$2,\n method: 'DELETE',\n path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}/subnets`\n }, unmarshalDeleteSubnetsResponse);\n};\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\nvar index_gen$2 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n API: API$2\n});\n\nvar index$2 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n v1: index_gen$3,\n v2: index_gen$2\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\n/** Lists transient statutes of the enum {@link GatewayNetworkStatus}. */\nconst GATEWAY_NETWORK_TRANSIENT_STATUSES = ['attaching', 'configuring', 'detaching'];\n\n/** Lists transient statutes of the enum {@link GatewayStatus}. */\nconst GATEWAY_TRANSIENT_STATUSES = ['allocating', 'configuring', 'stopping', 'deleting'];\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst unmarshalDHCP = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'DHCP' failed as data isn't a dictionary.`);\n }\n return {\n address: data.address,\n createdAt: unmarshalDate(data.created_at),\n dnsLocalName: data.dns_local_name,\n dnsSearch: data.dns_search,\n dnsServersOverride: data.dns_servers_override,\n enableDynamic: data.enable_dynamic,\n id: data.id,\n organizationId: data.organization_id,\n poolHigh: data.pool_high,\n poolLow: data.pool_low,\n projectId: data.project_id,\n pushDefaultRoute: data.push_default_route,\n pushDnsServer: data.push_dns_server,\n rebindTimer: data.rebind_timer,\n renewTimer: data.renew_timer,\n subnet: data.subnet,\n updatedAt: unmarshalDate(data.updated_at),\n validLifetime: data.valid_lifetime,\n zone: data.zone\n };\n};\nconst unmarshalGatewayNetwork = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'GatewayNetwork' failed as data isn't a dictionary.`);\n }\n return {\n address: data.address,\n createdAt: unmarshalDate(data.created_at),\n dhcp: data.dhcp ? unmarshalDHCP(data.dhcp) : undefined,\n enableDhcp: data.enable_dhcp,\n enableMasquerade: data.enable_masquerade,\n gatewayId: data.gateway_id,\n id: data.id,\n macAddress: data.mac_address,\n privateNetworkId: data.private_network_id,\n status: data.status,\n updatedAt: unmarshalDate(data.updated_at),\n zone: data.zone\n };\n};\nconst unmarshalGatewayType = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'GatewayType' failed as data isn't a dictionary.`);\n }\n return {\n bandwidth: data.bandwidth,\n name: data.name,\n zone: data.zone\n };\n};\nconst unmarshalIP = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'IP' failed as data isn't a dictionary.`);\n }\n return {\n address: data.address,\n createdAt: unmarshalDate(data.created_at),\n gatewayId: data.gateway_id,\n id: data.id,\n organizationId: data.organization_id,\n projectId: data.project_id,\n reverse: data.reverse,\n tags: data.tags,\n updatedAt: unmarshalDate(data.updated_at),\n zone: data.zone\n };\n};\nconst unmarshalDHCPEntry = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'DHCPEntry' failed as data isn't a dictionary.`);\n }\n return {\n createdAt: unmarshalDate(data.created_at),\n gatewayNetworkId: data.gateway_network_id,\n hostname: data.hostname,\n id: data.id,\n ipAddress: data.ip_address,\n macAddress: data.mac_address,\n type: data.type,\n updatedAt: unmarshalDate(data.updated_at),\n zone: data.zone\n };\n};\nconst unmarshalGateway = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Gateway' failed as data isn't a dictionary.`);\n }\n return {\n bastionEnabled: data.bastion_enabled,\n bastionPort: data.bastion_port,\n canUpgradeTo: data.can_upgrade_to,\n createdAt: unmarshalDate(data.created_at),\n gatewayNetworks: unmarshalArrayOfObject(data.gateway_networks, unmarshalGatewayNetwork),\n id: data.id,\n ip: data.ip ? unmarshalIP(data.ip) : undefined,\n name: data.name,\n organizationId: data.organization_id,\n projectId: data.project_id,\n smtpEnabled: data.smtp_enabled,\n status: data.status,\n tags: data.tags,\n type: data.type ? unmarshalGatewayType(data.type) : undefined,\n updatedAt: unmarshalDate(data.updated_at),\n upstreamDnsServers: data.upstream_dns_servers,\n version: data.version,\n zone: data.zone\n };\n};\nconst unmarshalPATRule = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'PATRule' failed as data isn't a dictionary.`);\n }\n return {\n createdAt: unmarshalDate(data.created_at),\n gatewayId: data.gateway_id,\n id: data.id,\n privateIp: data.private_ip,\n privatePort: data.private_port,\n protocol: data.protocol,\n publicPort: data.public_port,\n updatedAt: unmarshalDate(data.updated_at),\n zone: data.zone\n };\n};\nconst unmarshalListDHCPEntriesResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListDHCPEntriesResponse' failed as data isn't a dictionary.`);\n }\n return {\n dhcpEntries: unmarshalArrayOfObject(data.dhcp_entries, unmarshalDHCPEntry),\n totalCount: data.total_count\n };\n};\nconst unmarshalListDHCPsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListDHCPsResponse' failed as data isn't a dictionary.`);\n }\n return {\n dhcps: unmarshalArrayOfObject(data.dhcps, unmarshalDHCP),\n totalCount: data.total_count\n };\n};\nconst unmarshalListGatewayNetworksResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListGatewayNetworksResponse' failed as data isn't a dictionary.`);\n }\n return {\n gatewayNetworks: unmarshalArrayOfObject(data.gateway_networks, unmarshalGatewayNetwork),\n totalCount: data.total_count\n };\n};\nconst unmarshalListGatewayTypesResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListGatewayTypesResponse' failed as data isn't a dictionary.`);\n }\n return {\n types: unmarshalArrayOfObject(data.types, unmarshalGatewayType)\n };\n};\nconst unmarshalListGatewaysResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListGatewaysResponse' failed as data isn't a dictionary.`);\n }\n return {\n gateways: unmarshalArrayOfObject(data.gateways, unmarshalGateway),\n totalCount: data.total_count\n };\n};\nconst unmarshalListIPsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListIPsResponse' failed as data isn't a dictionary.`);\n }\n return {\n ips: unmarshalArrayOfObject(data.ips, unmarshalIP),\n totalCount: data.total_count\n };\n};\nconst unmarshalListPATRulesResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListPATRulesResponse' failed as data isn't a dictionary.`);\n }\n return {\n patRules: unmarshalArrayOfObject(data.pat_rules, unmarshalPATRule),\n totalCount: data.total_count\n };\n};\nconst unmarshalSetDHCPEntriesResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'SetDHCPEntriesResponse' failed as data isn't a dictionary.`);\n }\n return {\n dhcpEntries: unmarshalArrayOfObject(data.dhcp_entries, unmarshalDHCPEntry)\n };\n};\nconst unmarshalSetPATRulesResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'SetPATRulesResponse' failed as data isn't a dictionary.`);\n }\n return {\n patRules: unmarshalArrayOfObject(data.pat_rules, unmarshalPATRule)\n };\n};\nconst marshalCreateDHCPRequest = (request, defaults) => ({\n address: request.address,\n dns_local_name: request.dnsLocalName,\n dns_search: request.dnsSearch,\n dns_servers_override: request.dnsServersOverride,\n enable_dynamic: request.enableDynamic,\n pool_high: request.poolHigh,\n pool_low: request.poolLow,\n project_id: request.projectId ?? defaults.defaultProjectId,\n push_default_route: request.pushDefaultRoute,\n push_dns_server: request.pushDnsServer,\n rebind_timer: request.rebindTimer,\n renew_timer: request.renewTimer,\n subnet: request.subnet,\n valid_lifetime: request.validLifetime\n});\nconst marshalIpamConfig = (request, defaults) => ({\n push_default_route: request.pushDefaultRoute\n});\nconst marshalSetDHCPEntriesRequestEntry = (request, defaults) => ({\n ip_address: request.ipAddress,\n mac_address: request.macAddress\n});\nconst marshalSetPATRulesRequestRule = (request, defaults) => ({\n private_ip: request.privateIp,\n private_port: request.privatePort,\n protocol: request.protocol,\n public_port: request.publicPort\n});\nconst marshalCreateDHCPEntryRequest = (request, defaults) => ({\n gateway_network_id: request.gatewayNetworkId,\n ip_address: request.ipAddress,\n mac_address: request.macAddress\n});\nconst marshalCreateGatewayNetworkRequest = (request, defaults) => ({\n enable_dhcp: request.enableDhcp,\n enable_masquerade: request.enableMasquerade,\n gateway_id: request.gatewayId,\n private_network_id: request.privateNetworkId,\n ...resolveOneOf([{\n param: 'dhcp_id',\n value: request.dhcpId\n }, {\n param: 'dhcp',\n value: request.dhcp ? marshalCreateDHCPRequest(request.dhcp, defaults) : undefined\n }, {\n param: 'address',\n value: request.address\n }, {\n param: 'ipam_config',\n value: request.ipamConfig ? marshalIpamConfig(request.ipamConfig) : undefined\n }])\n});\nconst marshalCreateGatewayRequest = (request, defaults) => ({\n bastion_port: request.bastionPort,\n enable_bastion: request.enableBastion,\n enable_smtp: request.enableSmtp,\n ip_id: request.ipId,\n name: request.name || randomName('gw'),\n project_id: request.projectId ?? defaults.defaultProjectId,\n tags: request.tags,\n type: request.type,\n upstream_dns_servers: request.upstreamDnsServers\n});\nconst marshalCreateIPRequest = (request, defaults) => ({\n project_id: request.projectId ?? defaults.defaultProjectId,\n tags: request.tags\n});\nconst marshalCreatePATRuleRequest = (request, defaults) => ({\n gateway_id: request.gatewayId,\n private_ip: request.privateIp,\n private_port: request.privatePort,\n protocol: request.protocol ?? 'unknown',\n public_port: request.publicPort\n});\nconst marshalSetDHCPEntriesRequest = (request, defaults) => ({\n dhcp_entries: request.dhcpEntries ? request.dhcpEntries.map(elt => marshalSetDHCPEntriesRequestEntry(elt)) : undefined,\n gateway_network_id: request.gatewayNetworkId\n});\nconst marshalSetPATRulesRequest = (request, defaults) => ({\n gateway_id: request.gatewayId,\n pat_rules: request.patRules.map(elt => marshalSetPATRulesRequestRule(elt))\n});\nconst marshalUpdateDHCPEntryRequest = (request, defaults) => ({\n ip_address: request.ipAddress\n});\nconst marshalUpdateDHCPRequest = (request, defaults) => ({\n address: request.address,\n dns_local_name: request.dnsLocalName,\n dns_search: request.dnsSearch,\n dns_servers_override: request.dnsServersOverride,\n enable_dynamic: request.enableDynamic,\n pool_high: request.poolHigh,\n pool_low: request.poolLow,\n push_default_route: request.pushDefaultRoute,\n push_dns_server: request.pushDnsServer,\n rebind_timer: request.rebindTimer,\n renew_timer: request.renewTimer,\n subnet: request.subnet,\n valid_lifetime: request.validLifetime\n});\nconst marshalUpdateGatewayNetworkRequest = (request, defaults) => ({\n enable_dhcp: request.enableDhcp,\n enable_masquerade: request.enableMasquerade,\n ...resolveOneOf([{\n param: 'dhcp_id',\n value: request.dhcpId\n }, {\n param: 'address',\n value: request.address\n }, {\n param: 'ipam_config',\n value: request.ipamConfig ? marshalIpamConfig(request.ipamConfig) : undefined\n }])\n});\nconst marshalUpdateGatewayRequest = (request, defaults) => ({\n bastion_port: request.bastionPort,\n enable_bastion: request.enableBastion,\n enable_smtp: request.enableSmtp,\n name: request.name,\n tags: request.tags,\n upstream_dns_servers: request.upstreamDnsServers\n});\nconst marshalUpdateIPRequest = (request, defaults) => ({\n gateway_id: request.gatewayId,\n reverse: request.reverse,\n tags: request.tags\n});\nconst marshalUpdatePATRuleRequest = (request, defaults) => ({\n private_ip: request.privateIp,\n private_port: request.privatePort,\n protocol: request.protocol ?? 'unknown',\n public_port: request.publicPort\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst jsonContentHeaders$1 = {\n 'Content-Type': 'application/json; charset=utf-8'\n};\n\n/** Public Gateways API. */\nlet API$1 = class API extends API$u {\n /** Lists the available zones of the API. */\n static LOCALITIES = ['fr-par-1', 'fr-par-2', 'nl-ams-1', 'nl-ams-2', 'nl-ams-3', 'pl-waw-1', 'pl-waw-2'];\n pageOfListGateways = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateways`,\n urlParams: urlParams(['name', request.name], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['private_network_id', request.privateNetworkId], ['project_id', request.projectId], ['status', request.status ?? 'unknown'], ['tags', request.tags], ['type', request.type])\n }, unmarshalListGatewaysResponse);\n\n /**\n * List Public Gateways. List Public Gateways in a given Scaleway Organization\n * or Project. By default, results are displayed in ascending order of\n * creation date.\n *\n * @param request - The request {@link ListGatewaysRequest}\n * @returns A Promise of ListGatewaysResponse\n */\n listGateways = (request = {}) => enrichForPagination('gateways', this.pageOfListGateways, request);\n\n /**\n * Get a Public Gateway. Get details of a Public Gateway, specified by its\n * gateway ID. The response object contains full details of the gateway,\n * including its **name**, **type**, **status** and more.\n *\n * @param request - The request {@link GetGatewayRequest}\n * @returns A Promise of Gateway\n */\n getGateway = request => this.client.fetch({\n method: 'GET',\n path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam('gatewayId', request.gatewayId)}`\n }, unmarshalGateway);\n\n /**\n * Waits for {@link Gateway} to be in a final state.\n *\n * @param request - The request {@link GetGatewayRequest}\n * @param options - The waiting options\n * @returns A Promise of Gateway\n */\n waitForGateway = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!GATEWAY_TRANSIENT_STATUSES.includes(res.status))), this.getGateway, request, options);\n\n /**\n * Create a Public Gateway. Create a new Public Gateway in the specified\n * Scaleway Project, defining its **name**, **type** and other configuration\n * details such as whether to enable SSH bastion.\n *\n * @param request - The request {@link CreateGatewayRequest}\n * @returns A Promise of Gateway\n */\n createGateway = request => this.client.fetch({\n body: JSON.stringify(marshalCreateGatewayRequest(request, this.client.settings)),\n headers: jsonContentHeaders$1,\n method: 'POST',\n path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateways`\n }, unmarshalGateway);\n\n /**\n * Update a Public Gateway. Update the parameters of an existing Public\n * Gateway, for example, its **name**, **tags**, **SSH bastion\n * configuration**, and **DNS servers**.\n *\n * @param request - The request {@link UpdateGatewayRequest}\n * @returns A Promise of Gateway\n */\n updateGateway = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateGatewayRequest(request, this.client.settings)),\n headers: jsonContentHeaders$1,\n method: 'PATCH',\n path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam('gatewayId', request.gatewayId)}`\n }, unmarshalGateway);\n\n /**\n * Delete a Public Gateway. Delete an existing Public Gateway, specified by\n * its gateway ID. This action is irreversible.\n *\n * @param request - The request {@link DeleteGatewayRequest}\n */\n deleteGateway = request => this.client.fetch({\n method: 'DELETE',\n path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam('gatewayId', request.gatewayId)}`,\n urlParams: urlParams(['cleanup_dhcp', request.cleanupDhcp])\n });\n\n /**\n * Upgrade a Public Gateway to the latest version. Upgrade a given Public\n * Gateway to the newest software version. This applies the latest bugfixes\n * and features to your Public Gateway, but its service will be interrupted\n * during the update.\n *\n * @param request - The request {@link UpgradeGatewayRequest}\n * @returns A Promise of Gateway\n */\n upgradeGateway = request => this.client.fetch({\n body: '{}',\n headers: jsonContentHeaders$1,\n method: 'POST',\n path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam('gatewayId', request.gatewayId)}/upgrade`\n }, unmarshalGateway);\n pageOfListGatewayNetworks = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateway-networks`,\n urlParams: urlParams(['dhcp_id', request.dhcpId], ['enable_masquerade', request.enableMasquerade], ['gateway_id', request.gatewayId], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['private_network_id', request.privateNetworkId], ['status', request.status ?? 'unknown'])\n }, unmarshalListGatewayNetworksResponse);\n\n /**\n * List Public Gateway connections to Private Networks. List the connections\n * between Public Gateways and Private Networks (a connection = a\n * GatewayNetwork). You can choose to filter by `gateway-id` to list all\n * Private Networks attached to the specified Public Gateway, or by\n * `private_network_id` to list all Public Gateways attached to the specified\n * Private Network. Other query parameters are also available. The result is\n * an array of GatewayNetwork objects, each giving details of the connection\n * between a given Public Gateway and a given Private Network.\n *\n * @param request - The request {@link ListGatewayNetworksRequest}\n * @returns A Promise of ListGatewayNetworksResponse\n */\n listGatewayNetworks = (request = {}) => enrichForPagination('gatewayNetworks', this.pageOfListGatewayNetworks, request);\n\n /**\n * Get a Public Gateway connection to a Private Network. Get details of a\n * given connection between a Public Gateway and a Private Network (this\n * connection = a GatewayNetwork), specified by its `gateway_network_id`. The\n * response object contains details of the connection including the IDs of the\n * Public Gateway and Private Network, the dates the connection was\n * created/updated and its configuration settings.\n *\n * @param request - The request {@link GetGatewayNetworkRequest}\n * @returns A Promise of GatewayNetwork\n */\n getGatewayNetwork = request => this.client.fetch({\n method: 'GET',\n path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateway-networks/${validatePathParam('gatewayNetworkId', request.gatewayNetworkId)}`\n }, unmarshalGatewayNetwork);\n\n /**\n * Waits for {@link GatewayNetwork} to be in a final state.\n *\n * @param request - The request {@link GetGatewayNetworkRequest}\n * @param options - The waiting options\n * @returns A Promise of GatewayNetwork\n */\n waitForGatewayNetwork = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!GATEWAY_NETWORK_TRANSIENT_STATUSES.includes(res.status))), this.getGatewayNetwork, request, options);\n\n /**\n * Attach a Public Gateway to a Private Network. Attach a specific Public\n * Gateway to a specific Private Network (create a GatewayNetwork). You can\n * configure parameters for the connection including DHCP settings, whether to\n * enable masquerade (dynamic NAT), and more.\n *\n * @param request - The request {@link CreateGatewayNetworkRequest}\n * @returns A Promise of GatewayNetwork\n */\n createGatewayNetwork = request => this.client.fetch({\n body: JSON.stringify(marshalCreateGatewayNetworkRequest(request, this.client.settings)),\n headers: jsonContentHeaders$1,\n method: 'POST',\n path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateway-networks`\n }, unmarshalGatewayNetwork);\n\n /**\n * Update a Public Gateway's connection to a Private Network. Update the\n * configuration parameters of a connection between a given Public Gateway and\n * Private Network (the connection = a GatewayNetwork). Updatable parameters\n * include DHCP settings and whether to enable traffic masquerade (dynamic\n * NAT).\n *\n * @param request - The request {@link UpdateGatewayNetworkRequest}\n * @returns A Promise of GatewayNetwork\n */\n updateGatewayNetwork = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateGatewayNetworkRequest(request, this.client.settings)),\n headers: jsonContentHeaders$1,\n method: 'PATCH',\n path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateway-networks/${validatePathParam('gatewayNetworkId', request.gatewayNetworkId)}`\n }, unmarshalGatewayNetwork);\n\n /**\n * Detach a Public Gateway from a Private Network. Detach a given Public\n * Gateway from a given Private Network, i.e. delete a GatewayNetwork\n * specified by a gateway_network_id.\n *\n * @param request - The request {@link DeleteGatewayNetworkRequest}\n */\n deleteGatewayNetwork = request => this.client.fetch({\n method: 'DELETE',\n path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateway-networks/${validatePathParam('gatewayNetworkId', request.gatewayNetworkId)}`,\n urlParams: urlParams(['cleanup_dhcp', request.cleanupDhcp])\n });\n pageOfListDHCPs = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/dhcps`,\n urlParams: urlParams(['address', request.address], ['has_address', request.hasAddress], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId])\n }, unmarshalListDHCPsResponse);\n\n /**\n * List DHCP configurations. List DHCP configurations, optionally filtering by\n * Organization, Project, Public Gateway IP address or more. The response is\n * an array of DHCP configuration objects, each identified by a DHCP ID and\n * containing configuration settings for the assignment of IP addresses to\n * devices on a Private Network attached to a Public Gateway. Note that the\n * response does not contain the IDs of any Private Network / Public Gateway\n * the configuration is attached to. Use the `List Public Gateway connections\n * to Private Networks` method for that purpose, filtering on DHCP ID.\n *\n * @param request - The request {@link ListDHCPsRequest}\n * @returns A Promise of ListDHCPsResponse\n */\n listDHCPs = (request = {}) => enrichForPagination('dhcps', this.pageOfListDHCPs, request);\n\n /**\n * Get a DHCP configuration. Get a DHCP configuration object, identified by\n * its DHCP ID. The response object contains configuration settings for the\n * assignment of IP addresses to devices on a Private Network attached to a\n * Public Gateway. Note that the response does not contain the IDs of any\n * Private Network / Public Gateway the configuration is attached to. Use the\n * `List Public Gateway connections to Private Networks` method for that\n * purpose, filtering on DHCP ID.\n *\n * @param request - The request {@link GetDHCPRequest}\n * @returns A Promise of DHCP\n */\n getDHCP = request => this.client.fetch({\n method: 'GET',\n path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/dhcps/${validatePathParam('dhcpId', request.dhcpId)}`\n }, unmarshalDHCP);\n\n /**\n * Create a DHCP configuration. Create a new DHCP configuration object,\n * containing settings for the assignment of IP addresses to devices on a\n * Private Network attached to a Public Gateway. The response object includes\n * the ID of the DHCP configuration object. You can use this ID as part of a\n * call to `Create a Public Gateway connection to a Private Network` or\n * `Update a Public Gateway connection to a Private Network` to directly apply\n * this DHCP configuration.\n *\n * @param request - The request {@link CreateDHCPRequest}\n * @returns A Promise of DHCP\n */\n createDHCP = request => this.client.fetch({\n body: JSON.stringify(marshalCreateDHCPRequest(request, this.client.settings)),\n headers: jsonContentHeaders$1,\n method: 'POST',\n path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/dhcps`\n }, unmarshalDHCP);\n\n /**\n * Update a DHCP configuration. Update a DHCP configuration object, identified\n * by its DHCP ID.\n *\n * @param request - The request {@link UpdateDHCPRequest}\n * @returns A Promise of DHCP\n */\n updateDHCP = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateDHCPRequest(request, this.client.settings)),\n headers: jsonContentHeaders$1,\n method: 'PATCH',\n path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/dhcps/${validatePathParam('dhcpId', request.dhcpId)}`\n }, unmarshalDHCP);\n\n /**\n * Delete a DHCP configuration. Delete a DHCP configuration object, identified\n * by its DHCP ID. Note that you cannot delete a DHCP configuration object\n * that is currently being used by a Gateway Network.\n *\n * @param request - The request {@link DeleteDHCPRequest}\n */\n deleteDHCP = request => this.client.fetch({\n method: 'DELETE',\n path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/dhcps/${validatePathParam('dhcpId', request.dhcpId)}`\n });\n pageOfListDHCPEntries = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/dhcp-entries`,\n urlParams: urlParams(['gateway_network_id', request.gatewayNetworkId], ['hostname', request.hostname], ['ip_address', request.ipAddress], ['mac_address', request.macAddress], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['type', request.type ?? 'unknown'])\n }, unmarshalListDHCPEntriesResponse);\n\n /**\n * List DHCP entries. List DHCP entries, whether dynamically assigned and/or\n * statically reserved. DHCP entries can be filtered by the Gateway Network\n * they are on, their MAC address, IP address, type or hostname.\n *\n * @param request - The request {@link ListDHCPEntriesRequest}\n * @returns A Promise of ListDHCPEntriesResponse\n */\n listDHCPEntries = (request = {}) => enrichForPagination('dhcpEntries', this.pageOfListDHCPEntries, request);\n\n /**\n * Get a DHCP entry. Get a DHCP entry, specified by its DHCP entry ID.\n *\n * @param request - The request {@link GetDHCPEntryRequest}\n * @returns A Promise of DHCPEntry\n */\n getDHCPEntry = request => this.client.fetch({\n method: 'GET',\n path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/dhcp-entries/${validatePathParam('dhcpEntryId', request.dhcpEntryId)}`\n }, unmarshalDHCPEntry);\n\n /**\n * Create a DHCP entry. Create a static DHCP reservation, specifying the\n * Gateway Network for the reservation, the MAC address of the target device\n * and the IP address to assign this device. The response is a DHCP entry\n * object, confirming the ID and configuration details of the static DHCP\n * reservation.\n *\n * @param request - The request {@link CreateDHCPEntryRequest}\n * @returns A Promise of DHCPEntry\n */\n createDHCPEntry = request => this.client.fetch({\n body: JSON.stringify(marshalCreateDHCPEntryRequest(request, this.client.settings)),\n headers: jsonContentHeaders$1,\n method: 'POST',\n path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/dhcp-entries`\n }, unmarshalDHCPEntry);\n\n /**\n * Update a DHCP entry. Update the IP address for a DHCP entry, specified by\n * its DHCP entry ID. You can update an existing DHCP entry of any type\n * (`reservation` (static), `lease` (dynamic) or `unknown`), but in manually\n * updating the IP address the entry will necessarily be of type `reservation`\n * after the update.\n *\n * @param request - The request {@link UpdateDHCPEntryRequest}\n * @returns A Promise of DHCPEntry\n */\n updateDHCPEntry = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateDHCPEntryRequest(request, this.client.settings)),\n headers: jsonContentHeaders$1,\n method: 'PATCH',\n path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/dhcp-entries/${validatePathParam('dhcpEntryId', request.dhcpEntryId)}`\n }, unmarshalDHCPEntry);\n\n /**\n * Set all DHCP reservations on a Gateway Network. Set the list of DHCP\n * reservations attached to a Gateway Network. Reservations are identified by\n * their MAC address, and will sync the current DHCP entry list to the given\n * list, creating, updating or deleting DHCP entries accordingly.\n *\n * @param request - The request {@link SetDHCPEntriesRequest}\n * @returns A Promise of SetDHCPEntriesResponse\n */\n setDHCPEntries = request => this.client.fetch({\n body: JSON.stringify(marshalSetDHCPEntriesRequest(request, this.client.settings)),\n headers: jsonContentHeaders$1,\n method: 'PUT',\n path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/dhcp-entries`\n }, unmarshalSetDHCPEntriesResponse);\n\n /**\n * Delete a DHCP entry. Delete a static DHCP reservation, identified by its\n * DHCP entry ID. Note that you cannot delete DHCP entries of type `lease`,\n * these are deleted automatically when their time-to-live expires.\n *\n * @param request - The request {@link DeleteDHCPEntryRequest}\n */\n deleteDHCPEntry = request => this.client.fetch({\n method: 'DELETE',\n path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/dhcp-entries/${validatePathParam('dhcpEntryId', request.dhcpEntryId)}`\n });\n pageOfListPATRules = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/pat-rules`,\n urlParams: urlParams(['gateway_id', request.gatewayId], ['order_by', request.orderBy ?? 'created_at_asc'], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['private_ip', request.privateIp], ['protocol', request.protocol ?? 'unknown'])\n }, unmarshalListPATRulesResponse);\n\n /**\n * List PAT rules. List PAT rules. You can filter by gateway ID to list all\n * PAT rules for a particular gateway, or filter for PAT rules targeting a\n * specific IP address or using a specific protocol.\n *\n * @param request - The request {@link ListPATRulesRequest}\n * @returns A Promise of ListPATRulesResponse\n */\n listPATRules = (request = {}) => enrichForPagination('patRules', this.pageOfListPATRules, request);\n\n /**\n * Get a PAT rule. Get a PAT rule, specified by its PAT rule ID. The response\n * object gives full details of the PAT rule, including the Public Gateway it\n * belongs to and the configuration settings in terms of public / private\n * ports, private IP and protocol.\n *\n * @param request - The request {@link GetPATRuleRequest}\n * @returns A Promise of PATRule\n */\n getPATRule = request => this.client.fetch({\n method: 'GET',\n path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/pat-rules/${validatePathParam('patRuleId', request.patRuleId)}`\n }, unmarshalPATRule);\n\n /**\n * Create a PAT rule. Create a new PAT rule on a specified Public Gateway,\n * defining the protocol to use, public port to listen on, and private port /\n * IP address to map to.\n *\n * @param request - The request {@link CreatePATRuleRequest}\n * @returns A Promise of PATRule\n */\n createPATRule = request => this.client.fetch({\n body: JSON.stringify(marshalCreatePATRuleRequest(request, this.client.settings)),\n headers: jsonContentHeaders$1,\n method: 'POST',\n path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/pat-rules`\n }, unmarshalPATRule);\n\n /**\n * Update a PAT rule. Update a PAT rule, specified by its PAT rule ID.\n * Configuration settings including private/public port, private IP address\n * and protocol can all be updated.\n *\n * @param request - The request {@link UpdatePATRuleRequest}\n * @returns A Promise of PATRule\n */\n updatePATRule = request => this.client.fetch({\n body: JSON.stringify(marshalUpdatePATRuleRequest(request, this.client.settings)),\n headers: jsonContentHeaders$1,\n method: 'PATCH',\n path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/pat-rules/${validatePathParam('patRuleId', request.patRuleId)}`\n }, unmarshalPATRule);\n\n /**\n * Set all PAT rules. Set a definitive list of PAT rules attached to a Public\n * Gateway. Each rule is identified by its public port and protocol. This will\n * sync the current PAT rule list on the gateway with the new list, creating,\n * updating or deleting PAT rules accordingly.\n *\n * @param request - The request {@link SetPATRulesRequest}\n * @returns A Promise of SetPATRulesResponse\n */\n setPATRules = request => this.client.fetch({\n body: JSON.stringify(marshalSetPATRulesRequest(request, this.client.settings)),\n headers: jsonContentHeaders$1,\n method: 'PUT',\n path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/pat-rules`\n }, unmarshalSetPATRulesResponse);\n\n /**\n * Delete a PAT rule. Delete a PAT rule, identified by its PAT rule ID. This\n * action is irreversible.\n *\n * @param request - The request {@link DeletePATRuleRequest}\n */\n deletePATRule = request => this.client.fetch({\n method: 'DELETE',\n path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/pat-rules/${validatePathParam('patRuleId', request.patRuleId)}`\n });\n\n /**\n * List Public Gateway types. List the different Public Gateway commercial\n * offer types available at Scaleway. The response is an array of objects\n * describing the name and technical details of each available gateway type.\n *\n * @param request - The request {@link ListGatewayTypesRequest}\n * @returns A Promise of ListGatewayTypesResponse\n */\n listGatewayTypes = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateway-types`\n }, unmarshalListGatewayTypesResponse);\n pageOfListIPs = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips`,\n urlParams: urlParams(['is_free', request.isFree], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId], ['reverse', request.reverse], ['tags', request.tags])\n }, unmarshalListIPsResponse);\n\n /**\n * List IPs. List Public Gateway flexible IP addresses. A number of filter\n * options are available for limiting results in the response.\n *\n * @param request - The request {@link ListIPsRequest}\n * @returns A Promise of ListIPsResponse\n */\n listIPs = (request = {}) => enrichForPagination('ips', this.pageOfListIPs, request);\n\n /**\n * Get an IP. Get details of a Public Gateway flexible IP address, identified\n * by its IP ID. The response object contains information including which (if\n * any) Public Gateway using this IP address, the reverse and various other\n * metadata.\n *\n * @param request - The request {@link GetIPRequest}\n * @returns A Promise of IP\n */\n getIP = request => this.client.fetch({\n method: 'GET',\n path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam('ipId', request.ipId)}`\n }, unmarshalIP);\n\n /**\n * Reserve an IP. Create (reserve) a new flexible IP address that can be used\n * for a Public Gateway in a specified Scaleway Project.\n *\n * @param request - The request {@link CreateIPRequest}\n * @returns A Promise of IP\n */\n createIP = (request = {}) => this.client.fetch({\n body: JSON.stringify(marshalCreateIPRequest(request, this.client.settings)),\n headers: jsonContentHeaders$1,\n method: 'POST',\n path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips`\n }, unmarshalIP);\n\n /**\n * Update an IP. Update details of an existing flexible IP address, including\n * its tags, reverse and the Public Gateway it is assigned to.\n *\n * @param request - The request {@link UpdateIPRequest}\n * @returns A Promise of IP\n */\n updateIP = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateIPRequest(request, this.client.settings)),\n headers: jsonContentHeaders$1,\n method: 'PATCH',\n path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam('ipId', request.ipId)}`\n }, unmarshalIP);\n\n /**\n * Delete an IP. Delete a flexible IP address from your account. This action\n * is irreversible.\n *\n * @param request - The request {@link DeleteIPRequest}\n */\n deleteIP = request => this.client.fetch({\n method: 'DELETE',\n path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam('ipId', request.ipId)}`\n });\n\n /**\n * Refresh a Public Gateway's SSH keys. Refresh the SSH keys of a given Public\n * Gateway, specified by its gateway ID. This adds any new SSH keys in the\n * gateway's Scaleway Project to the gateway itself.\n *\n * @param request - The request {@link RefreshSSHKeysRequest}\n * @returns A Promise of Gateway\n */\n refreshSSHKeys = request => this.client.fetch({\n body: '{}',\n headers: jsonContentHeaders$1,\n method: 'POST',\n path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam('gatewayId', request.gatewayId)}/refresh-ssh-keys`\n }, unmarshalGateway);\n};\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\nvar index_gen$1 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n API: API$1,\n GATEWAY_NETWORK_TRANSIENT_STATUSES: GATEWAY_NETWORK_TRANSIENT_STATUSES,\n GATEWAY_TRANSIENT_STATUSES: GATEWAY_TRANSIENT_STATUSES\n});\n\nvar index$1 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n v1: index_gen$1\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\n/** Lists transient statutes of the enum {@link HostingStatus}. */\nconst HOSTING_TRANSIENT_STATUSES = ['delivering', 'deleting', 'migrating'];\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst unmarshalHostingCpanelUrls = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'HostingCpanelUrls' failed as data isn't a dictionary.`);\n }\n return {\n dashboard: data.dashboard,\n webmail: data.webmail\n };\n};\nconst unmarshalHostingOption = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'HostingOption' failed as data isn't a dictionary.`);\n }\n return {\n id: data.id,\n name: data.name\n };\n};\nconst unmarshalOfferProduct = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'OfferProduct' failed as data isn't a dictionary.`);\n }\n return {\n databasesQuota: data.databases_quota,\n emailAccountsQuota: data.email_accounts_quota,\n emailStorageQuota: data.email_storage_quota,\n hostingStorageQuota: data.hosting_storage_quota,\n maxAddonDomains: data.max_addon_domains,\n name: data.name,\n option: data.option,\n ram: data.ram,\n supportIncluded: data.support_included,\n vCpu: data.v_cpu\n };\n};\nconst unmarshalDnsRecord = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'DnsRecord' failed as data isn't a dictionary.`);\n }\n return {\n name: data.name,\n priority: data.priority,\n status: data.status,\n ttl: data.ttl,\n type: data.type,\n value: data.value\n };\n};\nconst unmarshalHosting = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Hosting' failed as data isn't a dictionary.`);\n }\n return {\n cpanelUrls: data.cpanel_urls ? unmarshalHostingCpanelUrls(data.cpanel_urls) : undefined,\n createdAt: unmarshalDate(data.created_at),\n dnsStatus: data.dns_status,\n domain: data.domain,\n id: data.id,\n offerEndOfLife: data.offer_end_of_life,\n offerId: data.offer_id,\n offerName: data.offer_name,\n options: unmarshalArrayOfObject(data.options, unmarshalHostingOption),\n organizationId: data.organization_id,\n platformHostname: data.platform_hostname,\n platformNumber: data.platform_number,\n projectId: data.project_id,\n region: data.region,\n status: data.status,\n tags: data.tags,\n updatedAt: unmarshalDate(data.updated_at),\n username: data.username\n };\n};\nconst unmarshalNameserver = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Nameserver' failed as data isn't a dictionary.`);\n }\n return {\n hostname: data.hostname,\n isDefault: data.is_default,\n status: data.status\n };\n};\nconst unmarshalOffer = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'Offer' failed as data isn't a dictionary.`);\n }\n return {\n available: data.available,\n billingOperationPath: data.billing_operation_path,\n endOfLife: data.end_of_life,\n id: data.id,\n price: data.price ? unmarshalMoney(data.price) : undefined,\n product: data.product ? unmarshalOfferProduct(data.product) : undefined,\n quotaWarnings: data.quota_warnings\n };\n};\nconst unmarshalDnsRecords = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'DnsRecords' failed as data isn't a dictionary.`);\n }\n return {\n nameServers: unmarshalArrayOfObject(data.name_servers, unmarshalNameserver),\n records: unmarshalArrayOfObject(data.records, unmarshalDnsRecord),\n status: data.status\n };\n};\nconst unmarshalListHostingsResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListHostingsResponse' failed as data isn't a dictionary.`);\n }\n return {\n hostings: unmarshalArrayOfObject(data.hostings, unmarshalHosting),\n totalCount: data.total_count\n };\n};\nconst unmarshalListOffersResponse = data => {\n if (!isJSONObject(data)) {\n throw new TypeError(`Unmarshalling the type 'ListOffersResponse' failed as data isn't a dictionary.`);\n }\n return {\n offers: unmarshalArrayOfObject(data.offers, unmarshalOffer)\n };\n};\nconst marshalCreateHostingRequest = (request, defaults) => ({\n domain: request.domain,\n email: request.email,\n offer_id: request.offerId,\n option_ids: request.optionIds,\n project_id: request.projectId ?? defaults.defaultProjectId,\n tags: request.tags\n});\nconst marshalUpdateHostingRequest = (request, defaults) => ({\n email: request.email,\n offer_id: request.offerId,\n option_ids: request.optionIds,\n tags: request.tags\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\nconst jsonContentHeaders = {\n 'Content-Type': 'application/json; charset=utf-8'\n};\n\n/** Web Hosting API. */\nclass API extends API$u {\n /** Lists the available regions of the API. */\n static LOCALITIES = ['fr-par'];\n\n /**\n * Order a Web Hosting plan. Order a Web Hosting plan, specifying the offer\n * type required via the `offer_id` parameter.\n *\n * @param request - The request {@link CreateHostingRequest}\n * @returns A Promise of Hosting\n */\n createHosting = request => this.client.fetch({\n body: JSON.stringify(marshalCreateHostingRequest(request, this.client.settings)),\n headers: jsonContentHeaders,\n method: 'POST',\n path: `/webhosting/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hostings`\n }, unmarshalHosting);\n pageOfListHostings = (request = {}) => this.client.fetch({\n method: 'GET',\n path: `/webhosting/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hostings`,\n urlParams: urlParams(['domain', request.domain], ['order_by', request.orderBy ?? 'created_at_asc'], ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], ['project_id', request.projectId], ['statuses', request.statuses], ['tags', request.tags])\n }, unmarshalListHostingsResponse);\n\n /**\n * List all Web Hosting plans. List all of your existing Web Hosting plans.\n * Various filters are available to limit the results, including filtering by\n * domain, status, tag and Project ID.\n *\n * @param request - The request {@link ListHostingsRequest}\n * @returns A Promise of ListHostingsResponse\n */\n listHostings = (request = {}) => enrichForPagination('hostings', this.pageOfListHostings, request);\n\n /**\n * Get a Web Hosting plan. Get the details of one of your existing Web Hosting\n * plans, specified by its `hosting_id`.\n *\n * @param request - The request {@link GetHostingRequest}\n * @returns A Promise of Hosting\n */\n getHosting = request => this.client.fetch({\n method: 'GET',\n path: `/webhosting/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam('hostingId', request.hostingId)}`\n }, unmarshalHosting);\n\n /**\n * Waits for {@link Hosting} to be in a final state.\n *\n * @param request - The request {@link GetHostingRequest}\n * @param options - The waiting options\n * @returns A Promise of Hosting\n */\n waitForHosting = (request, options) => waitForResource(options?.stop ?? (res => Promise.resolve(!HOSTING_TRANSIENT_STATUSES.includes(res.status))), this.getHosting, request, options);\n\n /**\n * Update a Web Hosting plan. Update the details of one of your existing Web\n * Hosting plans, specified by its `hosting_id`. You can update parameters\n * including the contact email address, tags, options and offer.\n *\n * @param request - The request {@link UpdateHostingRequest}\n * @returns A Promise of Hosting\n */\n updateHosting = request => this.client.fetch({\n body: JSON.stringify(marshalUpdateHostingRequest(request, this.client.settings)),\n headers: jsonContentHeaders,\n method: 'PATCH',\n path: `/webhosting/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam('hostingId', request.hostingId)}`\n }, unmarshalHosting);\n\n /**\n * Delete a Web Hosting plan. Delete a Web Hosting plan, specified by its\n * `hosting_id`. Note that deletion is not immediate: it will take place at\n * the end of the calendar month, after which time your Web Hosting plan and\n * all its data (files and emails) will be irreversibly lost.\n *\n * @param request - The request {@link DeleteHostingRequest}\n * @returns A Promise of Hosting\n */\n deleteHosting = request => this.client.fetch({\n method: 'DELETE',\n path: `/webhosting/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam('hostingId', request.hostingId)}`\n }, unmarshalHosting);\n\n /**\n * Restore a Web Hosting plan. When you [delete a Web Hosting\n * plan](#path-hostings-delete-a-hosting), definitive deletion does not take\n * place until the end of the calendar month. In the time between initiating\n * the deletion, and definitive deletion at the end of the month, you can\n * choose to **restore** the Web Hosting plan, using this endpoint and\n * specifying its `hosting_id`.\n *\n * @param request - The request {@link RestoreHostingRequest}\n * @returns A Promise of Hosting\n */\n restoreHosting = request => this.client.fetch({\n body: '{}',\n headers: jsonContentHeaders,\n method: 'POST',\n path: `/webhosting/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam('hostingId', request.hostingId)}/restore`\n }, unmarshalHosting);\n\n /**\n * Get DNS records. Get the set of DNS records of a specified domain\n * associated with a Web Hosting plan.\n *\n * @param request - The request {@link GetDomainDnsRecordsRequest}\n * @returns A Promise of DnsRecords\n */\n getDomainDnsRecords = request => this.client.fetch({\n method: 'GET',\n path: `/webhosting/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam('domain', request.domain)}/dns-records`\n }, unmarshalDnsRecords);\n\n /**\n * List all offers. List the different Web Hosting offers, and their options,\n * available to order from Scaleway.\n *\n * @param request - The request {@link ListOffersRequest}\n * @returns A Promise of ListOffersResponse\n */\n listOffers = request => this.client.fetch({\n method: 'GET',\n path: `/webhosting/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/offers`,\n urlParams: urlParams(['hosting_id', request.hostingId], ['only_options', request.onlyOptions], ['order_by', request.orderBy ?? 'price_asc'], ['without_options', request.withoutOptions])\n }, unmarshalListOffersResponse);\n}\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\nconst ListHostingsRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\n\nvar validationRules_gen = /*#__PURE__*/Object.freeze({\n __proto__: null,\n ListHostingsRequest: ListHostingsRequest\n});\n\n// This file was automatically generated. DO NOT EDIT.\n// If you have any remark or suggestion do not hesitate to open an issue.\n\nvar index_gen = /*#__PURE__*/Object.freeze({\n __proto__: null,\n API: API,\n HOSTING_TRANSIENT_STATUSES: HOSTING_TRANSIENT_STATUSES,\n ValidationRules: validationRules_gen\n});\n\nvar index = /*#__PURE__*/Object.freeze({\n __proto__: null,\n v1alpha1: index_gen\n});\n\nexports.API = API$u;\nexports.Account = index$v;\nexports.AppleSilicon = index$u;\nexports.BareMetal = index$s;\nexports.Billing = index$r;\nexports.Block = index$q;\nexports.Cockpit = index$p;\nexports.Container = index$o;\nexports.DocumentDB = index$n;\nexports.Domain = index$m;\nexports.Errors = index$w;\nexports.FlexibleIP = index$l;\nexports.Function = index$k;\nexports.IAM = index$j;\nexports.IOT = index$g;\nexports.IPFS = index$f;\nexports.Instance = index$h;\nexports.K8S = index$d;\nexports.LB = index$b;\nexports.MNQ = index$9;\nexports.Marketplace = index$a;\nexports.RDB = index$8;\nexports.Redis = index$7;\nexports.Registry = index$6;\nexports.Secret = index$5;\nexports.Test = index$4;\nexports.TransactionalEmail = index$3;\nexports.VPC = index$2;\nexports.VPCGW = index$1;\nexports.Webhosting = index;\nexports.addAsyncHeaderInterceptor = addAsyncHeaderInterceptor;\nexports.authenticateWithSessionToken = authenticateWithSessionToken;\nexports.createAdvancedClient = createAdvancedClient;\nexports.createClient = createClient;\nexports.enableConsoleLogger = enableConsoleLogger;\nexports.enrichForPagination = enrichForPagination;\nexports.isJSONObject = isJSONObject;\nexports.marshalMoney = marshalMoney;\nexports.marshalScwFile = marshalScwFile;\nexports.marshalTimeSeries = marshalTimeSeries;\nexports.resolveOneOf = resolveOneOf;\nexports.setLogger = setLogger;\nexports.unmarshalArrayOfObject = unmarshalArrayOfObject;\nexports.unmarshalDate = unmarshalDate;\nexports.unmarshalMapOfObject = unmarshalMapOfObject;\nexports.unmarshalMoney = unmarshalMoney;\nexports.unmarshalScwFile = unmarshalScwFile;\nexports.unmarshalServiceInfo = unmarshalServiceInfo;\nexports.unmarshalTimeSeries = unmarshalTimeSeries;\nexports.unmarshalTimeSeriesPoint = unmarshalTimeSeriesPoint;\nexports.urlParams = urlParams;\nexports.validatePathParam = validatePathParam;\nexports.waitForResource = waitForResource;\nexports.withAdditionalInterceptors = withAdditionalInterceptors;\nexports.withDefaultPageSize = withDefaultPageSize;\nexports.withHTTPClient = withHTTPClient;\nexports.withProfile = withProfile;\nexports.withUserAgent = withUserAgent;\nexports.withUserAgentSuffix = withUserAgentSuffix;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\tvar threw = true;\n\ttry {\n\t\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\t\tthrew = false;\n\t} finally {\n\t\tif(threw) delete __webpack_module_cache__[moduleId];\n\t}\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","\nif (typeof __webpack_require__ !== 'undefined') __webpack_require__.ab = __dirname + \"/\";","","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(137);\n",""],"names":[],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"index.js","mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC1EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACzEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC1RA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACzmBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5lBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AC1SA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC7vDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AChMA;;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACvQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC5LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACvMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACnMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AChxCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACnBA;;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACpHA;AACA;AACA;AACA;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC1GA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACtCA;AACA;AACA;AACA;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC9NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACVA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC9KA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACnmBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC9rBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACnHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC5GA;AACA;AACA;AACA;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC7DA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC5FA;AACA;AACA;AACA;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC/KA;AACA;AACA;AACA;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC9JA;AACA;AACA;AACA;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC9TA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC/MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC7DA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACpqBA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACnWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACpeA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACtVA;AACA;AACA;AACA;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACtlBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC9ZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC5CA;AACA;AACA;AACA;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACp7CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AChDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACl8CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACjnBA;AACA;AACA;AACA;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC1/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC5zBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACPA;AACA;AACA;AACA;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC7hCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC/7CA;AACA;AACA;AACA;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACnnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACzdA;AACA;AACA;AACA;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACnOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACnHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACXA;AACA;AACA;AACA;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACnoBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC5cA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC5CA;AACA;AACA;AACA;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACv7BA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACxgBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC/PA;AACA;AACA;AACA;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACjTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AChRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACvDA;AACA;AACA;AACA;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACzpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACtRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC5xDA;AACA;AACA;AACA;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC7mBA;AACA;AACA;AACA;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrhBA;AACA;AACA;AACA;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC/LA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACxHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACRA;AACA;AACA;AACA;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACtXA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AChNA;AACA;AACA;AACA;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACvLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC5KA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AChGA;AACA;AACA;AACA;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACjkBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AChjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC5KA;AACA;AACA;AACA;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AChSA;AACA;AACA;AACA;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACtJA;AACA;AACA;AACA;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACh8DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACnHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC3wCA;AACA;AACA;AACA;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACjTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC/QA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACvDA;AACA;AACA;AACA;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC9KA;AACA;AACA;AACA;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACnHA;AACA;AACA;AACA;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACpfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC5QA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACpFA;AACA;AACA;AACA;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC9gBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC/TA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACbA;AACA;AACA;AACA;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACxqCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC15BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACPA;AACA;AACA;AACA;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC5dA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACTA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AClWA;AACA;AACA;AACA;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC/RA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACjIA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACneA;AACA;AACA;AACA;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC7NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACjYA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACzOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACPA;AACA;AACA;AACA;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC1MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC1FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC7DA;;;;;;;;;ACAA;AACA;AACA;AACA;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACzaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACzXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACtHA;AACA;AACA;AACA;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACpKA;AACA;AACA;AACA;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC7FA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACvHA;AACA;AACA;AACA;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACpDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACnYA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AClOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACPA;AACA;AACA;AACA;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACvuBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACzbA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC3mBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACtYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACjFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC9UA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC3SA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACNA;AACA;AACA;AACA;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC3EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC/IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACpDA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AClDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC3BA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC7HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC3EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACzDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC3DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC1CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;ACtlBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC7BA;AACA;;;;AEDA;AACA;AACA;AACA","sources":[".././dist/index.js",".././dist/utils.js",".././node_modules/@actions/core/lib/command.js",".././node_modules/@actions/core/lib/core.js",".././node_modules/@actions/core/lib/file-command.js",".././node_modules/@actions/core/lib/oidc-utils.js",".././node_modules/@actions/core/lib/path-utils.js",".././node_modules/@actions/core/lib/platform.js",".././node_modules/@actions/core/lib/summary.js",".././node_modules/@actions/core/lib/utils.js",".././node_modules/@actions/exec/lib/exec.js",".././node_modules/@actions/exec/lib/toolrunner.js",".././node_modules/@actions/http-client/lib/auth.js",".././node_modules/@actions/http-client/lib/index.js",".././node_modules/@actions/http-client/lib/proxy.js",".././node_modules/@actions/io/lib/io-util.js",".././node_modules/@actions/io/lib/io.js",".././node_modules/cross-fetch/dist/node-polyfill.js",".././node_modules/cross-fetch/dist/node-ponyfill.js",".././node_modules/node-fetch/lib/index.js",".././node_modules/tr46/index.js",".././node_modules/tunnel/index.js",".././node_modules/tunnel/lib/tunnel.js",".././node_modules/webidl-conversions/lib/index.js",".././node_modules/whatwg-url/lib/URL-impl.js",".././node_modules/whatwg-url/lib/URL.js",".././node_modules/whatwg-url/lib/public-api.js",".././node_modules/whatwg-url/lib/url-state-machine.js",".././node_modules/whatwg-url/lib/utils.js",".././node_modules/@vercel/ncc/dist/ncc/@@notfound.js","../external node-commonjs \"assert\"","../external node-commonjs \"child_process\"","../external node-commonjs \"crypto\"","../external node-commonjs \"events\"","../external node-commonjs \"fs\"","../external node-commonjs \"http\"","../external node-commonjs \"https\"","../external node-commonjs \"net\"","../external node-commonjs \"os\"","../external node-commonjs \"path\"","../external node-commonjs \"punycode\"","../external node-commonjs \"stream\"","../external node-commonjs \"string_decoder\"","../external node-commonjs \"timers\"","../external node-commonjs \"tls\"","../external node-commonjs \"url\"","../external node-commonjs \"util\"","../external node-commonjs \"zlib\"",".././node_modules/@scaleway/sdk/dist/api/account/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/account/v2/api.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/account/v2/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/account/v2/marshalling.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/account/v3/api.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/account/v3/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/account/v3/marshalling.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/account/v3/validation-rules.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/applesilicon/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/applesilicon/v1alpha1/api.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/applesilicon/v1alpha1/content.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/applesilicon/v1alpha1/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/applesilicon/v1alpha1/marshalling.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/baremetal/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/baremetal/v1/api.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/baremetal/v1/api.utils.cjs",".././node_modules/@scaleway/sdk/dist/api/baremetal/v1/content.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/baremetal/v1/index.cjs",".././node_modules/@scaleway/sdk/dist/api/baremetal/v1/marshalling.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/baremetal/v1/validation-rules.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/baremetal/v3/api.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/baremetal/v3/content.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/baremetal/v3/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/baremetal/v3/marshalling.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/billing/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/billing/v2alpha1/api.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/billing/v2alpha1/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/billing/v2alpha1/marshalling.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/billing/v2beta1/api.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/billing/v2beta1/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/billing/v2beta1/marshalling.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/block/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/block/v1alpha1/api.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/block/v1alpha1/content.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/block/v1alpha1/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/block/v1alpha1/marshalling.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/block/v1alpha1/validation-rules.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/cockpit/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/cockpit/v1/api.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/cockpit/v1/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/cockpit/v1/marshalling.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/cockpit/v1/validation-rules.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/cockpit/v1beta1/api.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/cockpit/v1beta1/content.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/cockpit/v1beta1/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/cockpit/v1beta1/marshalling.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/container/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/container/v1beta1/api.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/container/v1beta1/content.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/container/v1beta1/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/container/v1beta1/marshalling.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/container/v1beta1/validation-rules.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/dedibox/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/dedibox/v1/api.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/dedibox/v1/content.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/dedibox/v1/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/dedibox/v1/marshalling.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/dedibox/v1/validation-rules.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/document_db/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/document_db/v1beta1/api.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/document_db/v1beta1/content.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/document_db/v1beta1/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/document_db/v1beta1/marshalling.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/document_db/v1beta1/validation-rules.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/domain/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/domain/v2beta1/api.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/domain/v2beta1/content.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/domain/v2beta1/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/domain/v2beta1/marshalling.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/edge_services/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/edge_services/v1alpha1/api.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/edge_services/v1alpha1/content.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/edge_services/v1alpha1/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/edge_services/v1alpha1/marshalling.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/flexibleip/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/flexibleip/v1alpha1/api.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/flexibleip/v1alpha1/content.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/flexibleip/v1alpha1/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/flexibleip/v1alpha1/marshalling.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/flexibleip/v1alpha1/validation-rules.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/function/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/function/v1beta1/api.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/function/v1beta1/content.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/function/v1beta1/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/function/v1beta1/marshalling.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/function/v1beta1/validation-rules.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/iam/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/iam/v1alpha1/api.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/iam/v1alpha1/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/iam/v1alpha1/marshalling.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/iam/v1alpha1/validation-rules.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/inference/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/inference/v1beta1/api.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/inference/v1beta1/content.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/inference/v1beta1/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/inference/v1beta1/marshalling.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/inference/v1beta1/validation-rules.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/instance/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/instance/v1/api.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/instance/v1/api.utils.cjs",".././node_modules/@scaleway/sdk/dist/api/instance/v1/content.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/instance/v1/index.cjs",".././node_modules/@scaleway/sdk/dist/api/instance/v1/marshalling.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/iot/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/iot/v1/api.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/iot/v1/content.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/iot/v1/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/iot/v1/marshalling.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/ipam/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/ipam/v1/api.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/ipam/v1/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/ipam/v1/marshalling.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/ipam/v1/validation-rules.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/ipfs/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/ipfs/v1alpha1/api.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/ipfs/v1alpha1/content.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/ipfs/v1alpha1/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/ipfs/v1alpha1/marshalling.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/jobs/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/jobs/v1alpha1/api.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/jobs/v1alpha1/content.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/jobs/v1alpha1/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/jobs/v1alpha1/marshalling.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/jobs/v1alpha1/validation-rules.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/k8s/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/k8s/v1/api.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/k8s/v1/api.utils.cjs",".././node_modules/@scaleway/sdk/dist/api/k8s/v1/content.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/k8s/v1/index.cjs",".././node_modules/@scaleway/sdk/dist/api/k8s/v1/marshalling.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/k8s/v1/validation-rules.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/key_manager/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/key_manager/v1alpha1/api.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/key_manager/v1alpha1/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/key_manager/v1alpha1/marshalling.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/lb/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/lb/v1/api.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/lb/v1/api.utils.cjs",".././node_modules/@scaleway/sdk/dist/api/lb/v1/content.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/lb/v1/index.cjs",".././node_modules/@scaleway/sdk/dist/api/lb/v1/marshalling.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/llm_inference/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/llm_inference/v1beta1/api.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/llm_inference/v1beta1/content.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/llm_inference/v1beta1/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/llm_inference/v1beta1/marshalling.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/llm_inference/v1beta1/validation-rules.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/marketplace/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/marketplace/v2/api.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/marketplace/v2/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/marketplace/v2/marshalling.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/mnq/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/mnq/v1beta1/api.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/mnq/v1beta1/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/mnq/v1beta1/marshalling.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/mnq/v1beta1/validation-rules.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/qaas/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/qaas/v1alpha1/api.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/qaas/v1alpha1/content.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/qaas/v1alpha1/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/qaas/v1alpha1/marshalling.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/qaas/v1alpha1/validation-rules.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/rdb/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/rdb/v1/api.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/rdb/v1/content.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/rdb/v1/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/rdb/v1/marshalling.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/rdb/v1/validation-rules.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/redis/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/redis/v1/api.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/redis/v1/content.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/redis/v1/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/redis/v1/marshalling.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/registry/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/registry/v1/api.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/registry/v1/content.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/registry/v1/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/registry/v1/marshalling.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/secret/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/secret/v1alpha1/api.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/secret/v1alpha1/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/secret/v1alpha1/marshalling.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/secret/v1beta1/api.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/secret/v1beta1/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/secret/v1beta1/marshalling.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/secret/v1beta1/validation-rules.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/serverless_sqldb/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/serverless_sqldb/v1alpha1/api.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/serverless_sqldb/v1alpha1/content.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/serverless_sqldb/v1alpha1/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/serverless_sqldb/v1alpha1/marshalling.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/serverless_sqldb/v1alpha1/validation-rules.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/std/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/tem/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/tem/v1alpha1/api.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/tem/v1alpha1/content.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/tem/v1alpha1/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/tem/v1alpha1/marshalling.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/tem/v1alpha1/validation-rules.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/test/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/test/v1/api.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/test/v1/content.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/test/v1/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/test/v1/marshalling.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/vpc/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/vpc/v1/api.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/vpc/v1/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/vpc/v1/marshalling.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/vpc/v2/api.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/vpc/v2/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/vpc/v2/marshalling.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/vpc/v2/validation-rules.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/vpcgw/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/vpcgw/v1/api.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/vpcgw/v1/content.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/vpcgw/v1/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/vpcgw/v1/marshalling.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/webhosting/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/webhosting/v1/api.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/webhosting/v1/content.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/webhosting/v1/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/webhosting/v1/marshalling.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/webhosting/v1/validation-rules.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/webhosting/v1alpha1/api.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/webhosting/v1alpha1/content.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/webhosting/v1alpha1/index.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/webhosting/v1alpha1/marshalling.gen.cjs",".././node_modules/@scaleway/sdk/dist/api/webhosting/v1alpha1/validation-rules.gen.cjs",".././node_modules/@scaleway/sdk/dist/helpers/is-browser.cjs",".././node_modules/@scaleway/sdk/dist/helpers/is-response.cjs",".././node_modules/@scaleway/sdk/dist/helpers/json.cjs",".././node_modules/@scaleway/sdk/dist/helpers/marshalling.cjs",".././node_modules/@scaleway/sdk/dist/index.cjs",".././node_modules/@scaleway/sdk/dist/internal/async/interval-retrier.cjs",".././node_modules/@scaleway/sdk/dist/internal/async/sleep.cjs",".././node_modules/@scaleway/sdk/dist/internal/interceptors/composer.cjs",".././node_modules/@scaleway/sdk/dist/internal/interceptors/helpers.cjs",".././node_modules/@scaleway/sdk/dist/internal/logger/console-logger.cjs",".././node_modules/@scaleway/sdk/dist/internal/logger/index.cjs",".././node_modules/@scaleway/sdk/dist/internal/logger/level-resolver.cjs",".././node_modules/@scaleway/sdk/dist/internal/validations/string-validation.cjs",".././node_modules/@scaleway/sdk/dist/scw/api.cjs",".././node_modules/@scaleway/sdk/dist/scw/auth.cjs",".././node_modules/@scaleway/sdk/dist/scw/client-ini-factory.cjs",".././node_modules/@scaleway/sdk/dist/scw/client-ini-profile.cjs",".././node_modules/@scaleway/sdk/dist/scw/client-settings.cjs",".././node_modules/@scaleway/sdk/dist/scw/client.cjs",".././node_modules/@scaleway/sdk/dist/scw/constants.cjs",".././node_modules/@scaleway/sdk/dist/scw/custom-marshalling.cjs",".././node_modules/@scaleway/sdk/dist/scw/custom-types.cjs",".././node_modules/@scaleway/sdk/dist/scw/errors/error-parser.cjs",".././node_modules/@scaleway/sdk/dist/scw/errors/non-standard/invalid-request-mapper.cjs",".././node_modules/@scaleway/sdk/dist/scw/errors/non-standard/unknown-resource-mapper.cjs",".././node_modules/@scaleway/sdk/dist/scw/errors/scw-error.cjs",".././node_modules/@scaleway/sdk/dist/scw/errors/standard/already-exists-error.cjs",".././node_modules/@scaleway/sdk/dist/scw/errors/standard/denied-authentication-error.cjs",".././node_modules/@scaleway/sdk/dist/scw/errors/standard/index.cjs",".././node_modules/@scaleway/sdk/dist/scw/errors/standard/invalid-arguments-error.cjs",".././node_modules/@scaleway/sdk/dist/scw/errors/standard/out-of-stock-error.cjs",".././node_modules/@scaleway/sdk/dist/scw/errors/standard/permissions-denied-error.cjs",".././node_modules/@scaleway/sdk/dist/scw/errors/standard/precondition-failed-error.cjs",".././node_modules/@scaleway/sdk/dist/scw/errors/standard/quotas-exceeded-error.cjs",".././node_modules/@scaleway/sdk/dist/scw/errors/standard/resource-expired-error.cjs",".././node_modules/@scaleway/sdk/dist/scw/errors/standard/resource-locked-error.cjs",".././node_modules/@scaleway/sdk/dist/scw/errors/standard/resource-not-found-error.cjs",".././node_modules/@scaleway/sdk/dist/scw/errors/standard/too-many-requests-error.cjs",".././node_modules/@scaleway/sdk/dist/scw/errors/standard/transient-state-error.cjs",".././node_modules/@scaleway/sdk/dist/scw/errors/types.cjs",".././node_modules/@scaleway/sdk/dist/scw/fetch/build-fetcher.cjs",".././node_modules/@scaleway/sdk/dist/scw/fetch/http-dumper.cjs",".././node_modules/@scaleway/sdk/dist/scw/fetch/http-interceptors.cjs",".././node_modules/@scaleway/sdk/dist/scw/fetch/resource-paginator.cjs",".././node_modules/@scaleway/sdk/dist/scw/fetch/response-parser.cjs",".././node_modules/@scaleway/sdk/dist/vendor/base64/index.cjs",".././node_modules/@scaleway/sdk/node_modules/@scaleway/random-name/dist/index.cjs","../webpack/bootstrap","../webpack/runtime/compat","../webpack/before-startup","../webpack/startup","../webpack/after-startup"],"sourcesContent":["\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.run = void 0;\nconst core = __importStar(require(\"@actions/core\"));\nrequire(\"cross-fetch/polyfill\");\nconst sdk_1 = require(\"@scaleway/sdk\");\nconst utils_1 = require(\"./utils\");\nfunction run() {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n const client = (0, sdk_1.createClient)({\n accessKey: core.getInput(\"access-key\"),\n secretKey: core.getInput(\"secret-key\"),\n defaultProjectId: core.getInput(\"default-project-id\"),\n defaultOrganizationId: core.getInput(\"default-organization-id\"),\n defaultRegion: core.getInput(\"default-region\"),\n defaultZone: core.getInput(\"default-zone\"),\n });\n const api = new sdk_1.Secret.v1beta1.API(client);\n const secretConfigInputs = [\n ...new Set(core.getMultilineInput(\"secret-names\")),\n ];\n for (let secretConf of secretConfigInputs) {\n const [envName, secret] = (0, utils_1.extractAlias)(secretConf);\n try {\n const secretValue = yield (0, utils_1.getSecretValue)(api, secret);\n core.setSecret(secretValue);\n core.debug(`Injecting secret ${secret} as environment variable '${envName}'.`);\n core.exportVariable(envName, secretValue);\n }\n catch (error) {\n core.setFailed(`Failed to fetch secret: '${secret}'. Error: ${error}.`);\n }\n }\n }\n catch (error) {\n if (error instanceof Error)\n core.setFailed(error.message);\n }\n });\n}\nexports.run = run;\nrun();\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getSecretValue = exports.splitNameAndPath = exports.extractAlias = exports.transformToValidEnvName = void 0;\nfunction transformToValidEnvName(secretName) {\n // Leading digits are invalid\n if (secretName.match(/^[0-9]/)) {\n secretName = \"_\".concat(secretName);\n }\n // Remove invalid characters\n return secretName.replace(/[^a-zA-Z0-9_]/g, \"_\").toUpperCase();\n}\nexports.transformToValidEnvName = transformToValidEnvName;\nfunction extractAlias(input) {\n const parsedInput = input.split(\",\");\n let secretRef = input.trim();\n let secretPath = \"/\";\n let alias = transformToValidEnvName(secretRef);\n let secretName = secretRef;\n if (parsedInput.length > 1) {\n alias = parsedInput[0].trim();\n secretRef = parsedInput[1].trim();\n secretName = secretRef;\n const validateEnvName = transformToValidEnvName(alias);\n if (alias !== validateEnvName) {\n throw new Error(`The alias '${alias}' is not a valid environment name. Please verify that it has uppercase letters, numbers, and underscore only.`);\n }\n }\n if (secretRef.startsWith(\"/\")) {\n [secretName, secretPath] = splitNameAndPath(secretRef);\n if (parsedInput.length == 1) {\n alias = transformToValidEnvName(secretName);\n }\n }\n return [alias, { name: secretName, path: secretPath }];\n}\nexports.extractAlias = extractAlias;\nfunction splitNameAndPath(ref) {\n let path = \"/\";\n const sep = ref.lastIndexOf(\"/\");\n if (sep > 0) {\n path = ref.substring(0, sep);\n }\n const name = ref.substring(sep + 1);\n return [name, path];\n}\nexports.splitNameAndPath = splitNameAndPath;\nfunction getSecretValue(api, secret) {\n return __awaiter(this, void 0, void 0, function* () {\n const secretList = yield api.listSecrets({\n name: secret.name,\n path: secret.path,\n page: 1,\n pageSize: 1,\n });\n if (secretList.totalCount < 1) {\n throw new Error(`No secret found with '${secret.name}' name and '${secret.path}' path`);\n }\n const secretResponse = yield api.accessSecretVersion({\n secretId: secretList.secrets[0].id,\n revision: \"latest_enabled\",\n });\n return Buffer.from(secretResponse.data, \"base64\").toString(\"binary\");\n });\n}\nexports.getSecretValue = getSecretValue;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.issue = exports.issueCommand = void 0;\nconst os = __importStar(require(\"os\"));\nconst utils_1 = require(\"./utils\");\n/**\n * Commands\n *\n * Command Format:\n * ::name key=value,key=value::message\n *\n * Examples:\n * ::warning::This is the message\n * ::set-env name=MY_VAR::some value\n */\nfunction issueCommand(command, properties, message) {\n const cmd = new Command(command, properties, message);\n process.stdout.write(cmd.toString() + os.EOL);\n}\nexports.issueCommand = issueCommand;\nfunction issue(name, message = '') {\n issueCommand(name, {}, message);\n}\nexports.issue = issue;\nconst CMD_STRING = '::';\nclass Command {\n constructor(command, properties, message) {\n if (!command) {\n command = 'missing.command';\n }\n this.command = command;\n this.properties = properties;\n this.message = message;\n }\n toString() {\n let cmdStr = CMD_STRING + this.command;\n if (this.properties && Object.keys(this.properties).length > 0) {\n cmdStr += ' ';\n let first = true;\n for (const key in this.properties) {\n if (this.properties.hasOwnProperty(key)) {\n const val = this.properties[key];\n if (val) {\n if (first) {\n first = false;\n }\n else {\n cmdStr += ',';\n }\n cmdStr += `${key}=${escapeProperty(val)}`;\n }\n }\n }\n }\n cmdStr += `${CMD_STRING}${escapeData(this.message)}`;\n return cmdStr;\n }\n}\nfunction escapeData(s) {\n return (0, utils_1.toCommandValue)(s)\n .replace(/%/g, '%25')\n .replace(/\\r/g, '%0D')\n .replace(/\\n/g, '%0A');\n}\nfunction escapeProperty(s) {\n return (0, utils_1.toCommandValue)(s)\n .replace(/%/g, '%25')\n .replace(/\\r/g, '%0D')\n .replace(/\\n/g, '%0A')\n .replace(/:/g, '%3A')\n .replace(/,/g, '%2C');\n}\n//# sourceMappingURL=command.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.platform = exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = exports.markdownSummary = exports.summary = exports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0;\nconst command_1 = require(\"./command\");\nconst file_command_1 = require(\"./file-command\");\nconst utils_1 = require(\"./utils\");\nconst os = __importStar(require(\"os\"));\nconst path = __importStar(require(\"path\"));\nconst oidc_utils_1 = require(\"./oidc-utils\");\n/**\n * The code to exit an action\n */\nvar ExitCode;\n(function (ExitCode) {\n /**\n * A code indicating that the action was successful\n */\n ExitCode[ExitCode[\"Success\"] = 0] = \"Success\";\n /**\n * A code indicating that the action was a failure\n */\n ExitCode[ExitCode[\"Failure\"] = 1] = \"Failure\";\n})(ExitCode || (exports.ExitCode = ExitCode = {}));\n//-----------------------------------------------------------------------\n// Variables\n//-----------------------------------------------------------------------\n/**\n * Sets env variable for this action and future actions in the job\n * @param name the name of the variable to set\n * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction exportVariable(name, val) {\n const convertedVal = (0, utils_1.toCommandValue)(val);\n process.env[name] = convertedVal;\n const filePath = process.env['GITHUB_ENV'] || '';\n if (filePath) {\n return (0, file_command_1.issueFileCommand)('ENV', (0, file_command_1.prepareKeyValueMessage)(name, val));\n }\n (0, command_1.issueCommand)('set-env', { name }, convertedVal);\n}\nexports.exportVariable = exportVariable;\n/**\n * Registers a secret which will get masked from logs\n * @param secret value of the secret\n */\nfunction setSecret(secret) {\n (0, command_1.issueCommand)('add-mask', {}, secret);\n}\nexports.setSecret = setSecret;\n/**\n * Prepends inputPath to the PATH (for this action and future actions)\n * @param inputPath\n */\nfunction addPath(inputPath) {\n const filePath = process.env['GITHUB_PATH'] || '';\n if (filePath) {\n (0, file_command_1.issueFileCommand)('PATH', inputPath);\n }\n else {\n (0, command_1.issueCommand)('add-path', {}, inputPath);\n }\n process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;\n}\nexports.addPath = addPath;\n/**\n * Gets the value of an input.\n * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.\n * Returns an empty string if the value is not defined.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string\n */\nfunction getInput(name, options) {\n const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';\n if (options && options.required && !val) {\n throw new Error(`Input required and not supplied: ${name}`);\n }\n if (options && options.trimWhitespace === false) {\n return val;\n }\n return val.trim();\n}\nexports.getInput = getInput;\n/**\n * Gets the values of an multiline input. Each value is also trimmed.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string[]\n *\n */\nfunction getMultilineInput(name, options) {\n const inputs = getInput(name, options)\n .split('\\n')\n .filter(x => x !== '');\n if (options && options.trimWhitespace === false) {\n return inputs;\n }\n return inputs.map(input => input.trim());\n}\nexports.getMultilineInput = getMultilineInput;\n/**\n * Gets the input value of the boolean type in the YAML 1.2 \"core schema\" specification.\n * Support boolean input list: `true | True | TRUE | false | False | FALSE` .\n * The return value is also in boolean type.\n * ref: https://yaml.org/spec/1.2/spec.html#id2804923\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns boolean\n */\nfunction getBooleanInput(name, options) {\n const trueValue = ['true', 'True', 'TRUE'];\n const falseValue = ['false', 'False', 'FALSE'];\n const val = getInput(name, options);\n if (trueValue.includes(val))\n return true;\n if (falseValue.includes(val))\n return false;\n throw new TypeError(`Input does not meet YAML 1.2 \"Core Schema\" specification: ${name}\\n` +\n `Support boolean input list: \\`true | True | TRUE | false | False | FALSE\\``);\n}\nexports.getBooleanInput = getBooleanInput;\n/**\n * Sets the value of an output.\n *\n * @param name name of the output to set\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction setOutput(name, value) {\n const filePath = process.env['GITHUB_OUTPUT'] || '';\n if (filePath) {\n return (0, file_command_1.issueFileCommand)('OUTPUT', (0, file_command_1.prepareKeyValueMessage)(name, value));\n }\n process.stdout.write(os.EOL);\n (0, command_1.issueCommand)('set-output', { name }, (0, utils_1.toCommandValue)(value));\n}\nexports.setOutput = setOutput;\n/**\n * Enables or disables the echoing of commands into stdout for the rest of the step.\n * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.\n *\n */\nfunction setCommandEcho(enabled) {\n (0, command_1.issue)('echo', enabled ? 'on' : 'off');\n}\nexports.setCommandEcho = setCommandEcho;\n//-----------------------------------------------------------------------\n// Results\n//-----------------------------------------------------------------------\n/**\n * Sets the action status to failed.\n * When the action exits it will be with an exit code of 1\n * @param message add error issue message\n */\nfunction setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}\nexports.setFailed = setFailed;\n//-----------------------------------------------------------------------\n// Logging Commands\n//-----------------------------------------------------------------------\n/**\n * Gets whether Actions Step Debug is on or not\n */\nfunction isDebug() {\n return process.env['RUNNER_DEBUG'] === '1';\n}\nexports.isDebug = isDebug;\n/**\n * Writes debug message to user log\n * @param message debug message\n */\nfunction debug(message) {\n (0, command_1.issueCommand)('debug', {}, message);\n}\nexports.debug = debug;\n/**\n * Adds an error issue\n * @param message error issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction error(message, properties = {}) {\n (0, command_1.issueCommand)('error', (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message);\n}\nexports.error = error;\n/**\n * Adds a warning issue\n * @param message warning issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction warning(message, properties = {}) {\n (0, command_1.issueCommand)('warning', (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message);\n}\nexports.warning = warning;\n/**\n * Adds a notice issue\n * @param message notice issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction notice(message, properties = {}) {\n (0, command_1.issueCommand)('notice', (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message);\n}\nexports.notice = notice;\n/**\n * Writes info to log with console.log.\n * @param message info message\n */\nfunction info(message) {\n process.stdout.write(message + os.EOL);\n}\nexports.info = info;\n/**\n * Begin an output group.\n *\n * Output until the next `groupEnd` will be foldable in this group\n *\n * @param name The name of the output group\n */\nfunction startGroup(name) {\n (0, command_1.issue)('group', name);\n}\nexports.startGroup = startGroup;\n/**\n * End an output group.\n */\nfunction endGroup() {\n (0, command_1.issue)('endgroup');\n}\nexports.endGroup = endGroup;\n/**\n * Wrap an asynchronous function call in a group.\n *\n * Returns the same type as the function itself.\n *\n * @param name The name of the group\n * @param fn The function to wrap in the group\n */\nfunction group(name, fn) {\n return __awaiter(this, void 0, void 0, function* () {\n startGroup(name);\n let result;\n try {\n result = yield fn();\n }\n finally {\n endGroup();\n }\n return result;\n });\n}\nexports.group = group;\n//-----------------------------------------------------------------------\n// Wrapper action state\n//-----------------------------------------------------------------------\n/**\n * Saves state for current action, the state can only be retrieved by this action's post job execution.\n *\n * @param name name of the state to store\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction saveState(name, value) {\n const filePath = process.env['GITHUB_STATE'] || '';\n if (filePath) {\n return (0, file_command_1.issueFileCommand)('STATE', (0, file_command_1.prepareKeyValueMessage)(name, value));\n }\n (0, command_1.issueCommand)('save-state', { name }, (0, utils_1.toCommandValue)(value));\n}\nexports.saveState = saveState;\n/**\n * Gets the value of an state set by this action's main execution.\n *\n * @param name name of the state to get\n * @returns string\n */\nfunction getState(name) {\n return process.env[`STATE_${name}`] || '';\n}\nexports.getState = getState;\nfunction getIDToken(aud) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield oidc_utils_1.OidcClient.getIDToken(aud);\n });\n}\nexports.getIDToken = getIDToken;\n/**\n * Summary exports\n */\nvar summary_1 = require(\"./summary\");\nObject.defineProperty(exports, \"summary\", { enumerable: true, get: function () { return summary_1.summary; } });\n/**\n * @deprecated use core.summary\n */\nvar summary_2 = require(\"./summary\");\nObject.defineProperty(exports, \"markdownSummary\", { enumerable: true, get: function () { return summary_2.markdownSummary; } });\n/**\n * Path exports\n */\nvar path_utils_1 = require(\"./path-utils\");\nObject.defineProperty(exports, \"toPosixPath\", { enumerable: true, get: function () { return path_utils_1.toPosixPath; } });\nObject.defineProperty(exports, \"toWin32Path\", { enumerable: true, get: function () { return path_utils_1.toWin32Path; } });\nObject.defineProperty(exports, \"toPlatformPath\", { enumerable: true, get: function () { return path_utils_1.toPlatformPath; } });\n/**\n * Platform utilities exports\n */\nexports.platform = __importStar(require(\"./platform\"));\n//# sourceMappingURL=core.js.map","\"use strict\";\n// For internal use, subject to change.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.prepareKeyValueMessage = exports.issueFileCommand = void 0;\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nconst crypto = __importStar(require(\"crypto\"));\nconst fs = __importStar(require(\"fs\"));\nconst os = __importStar(require(\"os\"));\nconst utils_1 = require(\"./utils\");\nfunction issueFileCommand(command, message) {\n const filePath = process.env[`GITHUB_${command}`];\n if (!filePath) {\n throw new Error(`Unable to find environment variable for file command ${command}`);\n }\n if (!fs.existsSync(filePath)) {\n throw new Error(`Missing file at path: ${filePath}`);\n }\n fs.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os.EOL}`, {\n encoding: 'utf8'\n });\n}\nexports.issueFileCommand = issueFileCommand;\nfunction prepareKeyValueMessage(key, value) {\n const delimiter = `ghadelimiter_${crypto.randomUUID()}`;\n const convertedValue = (0, utils_1.toCommandValue)(value);\n // These should realistically never happen, but just in case someone finds a\n // way to exploit uuid generation let's not allow keys or values that contain\n // the delimiter.\n if (key.includes(delimiter)) {\n throw new Error(`Unexpected input: name should not contain the delimiter \"${delimiter}\"`);\n }\n if (convertedValue.includes(delimiter)) {\n throw new Error(`Unexpected input: value should not contain the delimiter \"${delimiter}\"`);\n }\n return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`;\n}\nexports.prepareKeyValueMessage = prepareKeyValueMessage;\n//# sourceMappingURL=file-command.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.OidcClient = void 0;\nconst http_client_1 = require(\"@actions/http-client\");\nconst auth_1 = require(\"@actions/http-client/lib/auth\");\nconst core_1 = require(\"./core\");\nclass OidcClient {\n static createHttpClient(allowRetry = true, maxRetry = 10) {\n const requestOptions = {\n allowRetries: allowRetry,\n maxRetries: maxRetry\n };\n return new http_client_1.HttpClient('actions/oidc-client', [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions);\n }\n static getRequestToken() {\n const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN'];\n if (!token) {\n throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable');\n }\n return token;\n }\n static getIDTokenUrl() {\n const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL'];\n if (!runtimeUrl) {\n throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable');\n }\n return runtimeUrl;\n }\n static getCall(id_token_url) {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n const httpclient = OidcClient.createHttpClient();\n const res = yield httpclient\n .getJson(id_token_url)\n .catch(error => {\n throw new Error(`Failed to get ID Token. \\n \n Error Code : ${error.statusCode}\\n \n Error Message: ${error.message}`);\n });\n const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;\n if (!id_token) {\n throw new Error('Response json body do not have ID Token field');\n }\n return id_token;\n });\n }\n static getIDToken(audience) {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n // New ID Token is requested from action service\n let id_token_url = OidcClient.getIDTokenUrl();\n if (audience) {\n const encodedAudience = encodeURIComponent(audience);\n id_token_url = `${id_token_url}&audience=${encodedAudience}`;\n }\n (0, core_1.debug)(`ID token url is ${id_token_url}`);\n const id_token = yield OidcClient.getCall(id_token_url);\n (0, core_1.setSecret)(id_token);\n return id_token;\n }\n catch (error) {\n throw new Error(`Error message: ${error.message}`);\n }\n });\n }\n}\nexports.OidcClient = OidcClient;\n//# sourceMappingURL=oidc-utils.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0;\nconst path = __importStar(require(\"path\"));\n/**\n * toPosixPath converts the given path to the posix form. On Windows, \\\\ will be\n * replaced with /.\n *\n * @param pth. Path to transform.\n * @return string Posix path.\n */\nfunction toPosixPath(pth) {\n return pth.replace(/[\\\\]/g, '/');\n}\nexports.toPosixPath = toPosixPath;\n/**\n * toWin32Path converts the given path to the win32 form. On Linux, / will be\n * replaced with \\\\.\n *\n * @param pth. Path to transform.\n * @return string Win32 path.\n */\nfunction toWin32Path(pth) {\n return pth.replace(/[/]/g, '\\\\');\n}\nexports.toWin32Path = toWin32Path;\n/**\n * toPlatformPath converts the given path to a platform-specific path. It does\n * this by replacing instances of / and \\ with the platform-specific path\n * separator.\n *\n * @param pth The path to platformize.\n * @return string The platform-specific path.\n */\nfunction toPlatformPath(pth) {\n return pth.replace(/[/\\\\]/g, path.sep);\n}\nexports.toPlatformPath = toPlatformPath;\n//# sourceMappingURL=path-utils.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getDetails = exports.isLinux = exports.isMacOS = exports.isWindows = exports.arch = exports.platform = void 0;\nconst os_1 = __importDefault(require(\"os\"));\nconst exec = __importStar(require(\"@actions/exec\"));\nconst getWindowsInfo = () => __awaiter(void 0, void 0, void 0, function* () {\n const { stdout: version } = yield exec.getExecOutput('powershell -command \"(Get-CimInstance -ClassName Win32_OperatingSystem).Version\"', undefined, {\n silent: true\n });\n const { stdout: name } = yield exec.getExecOutput('powershell -command \"(Get-CimInstance -ClassName Win32_OperatingSystem).Caption\"', undefined, {\n silent: true\n });\n return {\n name: name.trim(),\n version: version.trim()\n };\n});\nconst getMacOsInfo = () => __awaiter(void 0, void 0, void 0, function* () {\n var _a, _b, _c, _d;\n const { stdout } = yield exec.getExecOutput('sw_vers', undefined, {\n silent: true\n });\n const version = (_b = (_a = stdout.match(/ProductVersion:\\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : '';\n const name = (_d = (_c = stdout.match(/ProductName:\\s*(.+)/)) === null || _c === void 0 ? void 0 : _c[1]) !== null && _d !== void 0 ? _d : '';\n return {\n name,\n version\n };\n});\nconst getLinuxInfo = () => __awaiter(void 0, void 0, void 0, function* () {\n const { stdout } = yield exec.getExecOutput('lsb_release', ['-i', '-r', '-s'], {\n silent: true\n });\n const [name, version] = stdout.trim().split('\\n');\n return {\n name,\n version\n };\n});\nexports.platform = os_1.default.platform();\nexports.arch = os_1.default.arch();\nexports.isWindows = exports.platform === 'win32';\nexports.isMacOS = exports.platform === 'darwin';\nexports.isLinux = exports.platform === 'linux';\nfunction getDetails() {\n return __awaiter(this, void 0, void 0, function* () {\n return Object.assign(Object.assign({}, (yield (exports.isWindows\n ? getWindowsInfo()\n : exports.isMacOS\n ? getMacOsInfo()\n : getLinuxInfo()))), { platform: exports.platform,\n arch: exports.arch,\n isWindows: exports.isWindows,\n isMacOS: exports.isMacOS,\n isLinux: exports.isLinux });\n });\n}\nexports.getDetails = getDetails;\n//# sourceMappingURL=platform.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0;\nconst os_1 = require(\"os\");\nconst fs_1 = require(\"fs\");\nconst { access, appendFile, writeFile } = fs_1.promises;\nexports.SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY';\nexports.SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary';\nclass Summary {\n constructor() {\n this._buffer = '';\n }\n /**\n * Finds the summary file path from the environment, rejects if env var is not found or file does not exist\n * Also checks r/w permissions.\n *\n * @returns step summary file path\n */\n filePath() {\n return __awaiter(this, void 0, void 0, function* () {\n if (this._filePath) {\n return this._filePath;\n }\n const pathFromEnv = process.env[exports.SUMMARY_ENV_VAR];\n if (!pathFromEnv) {\n throw new Error(`Unable to find environment variable for $${exports.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);\n }\n try {\n yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK);\n }\n catch (_a) {\n throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`);\n }\n this._filePath = pathFromEnv;\n return this._filePath;\n });\n }\n /**\n * Wraps content in an HTML tag, adding any HTML attributes\n *\n * @param {string} tag HTML tag to wrap\n * @param {string | null} content content within the tag\n * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add\n *\n * @returns {string} content wrapped in HTML element\n */\n wrap(tag, content, attrs = {}) {\n const htmlAttrs = Object.entries(attrs)\n .map(([key, value]) => ` ${key}=\"${value}\"`)\n .join('');\n if (!content) {\n return `<${tag}${htmlAttrs}>`;\n }\n return `<${tag}${htmlAttrs}>${content}`;\n }\n /**\n * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default.\n *\n * @param {SummaryWriteOptions} [options] (optional) options for write operation\n *\n * @returns {Promise} summary instance\n */\n write(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite);\n const filePath = yield this.filePath();\n const writeFunc = overwrite ? writeFile : appendFile;\n yield writeFunc(filePath, this._buffer, { encoding: 'utf8' });\n return this.emptyBuffer();\n });\n }\n /**\n * Clears the summary buffer and wipes the summary file\n *\n * @returns {Summary} summary instance\n */\n clear() {\n return __awaiter(this, void 0, void 0, function* () {\n return this.emptyBuffer().write({ overwrite: true });\n });\n }\n /**\n * Returns the current summary buffer as a string\n *\n * @returns {string} string of summary buffer\n */\n stringify() {\n return this._buffer;\n }\n /**\n * If the summary buffer is empty\n *\n * @returns {boolen} true if the buffer is empty\n */\n isEmptyBuffer() {\n return this._buffer.length === 0;\n }\n /**\n * Resets the summary buffer without writing to summary file\n *\n * @returns {Summary} summary instance\n */\n emptyBuffer() {\n this._buffer = '';\n return this;\n }\n /**\n * Adds raw text to the summary buffer\n *\n * @param {string} text content to add\n * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false)\n *\n * @returns {Summary} summary instance\n */\n addRaw(text, addEOL = false) {\n this._buffer += text;\n return addEOL ? this.addEOL() : this;\n }\n /**\n * Adds the operating system-specific end-of-line marker to the buffer\n *\n * @returns {Summary} summary instance\n */\n addEOL() {\n return this.addRaw(os_1.EOL);\n }\n /**\n * Adds an HTML codeblock to the summary buffer\n *\n * @param {string} code content to render within fenced code block\n * @param {string} lang (optional) language to syntax highlight code\n *\n * @returns {Summary} summary instance\n */\n addCodeBlock(code, lang) {\n const attrs = Object.assign({}, (lang && { lang }));\n const element = this.wrap('pre', this.wrap('code', code), attrs);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML list to the summary buffer\n *\n * @param {string[]} items list of items to render\n * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false)\n *\n * @returns {Summary} summary instance\n */\n addList(items, ordered = false) {\n const tag = ordered ? 'ol' : 'ul';\n const listItems = items.map(item => this.wrap('li', item)).join('');\n const element = this.wrap(tag, listItems);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML table to the summary buffer\n *\n * @param {SummaryTableCell[]} rows table rows\n *\n * @returns {Summary} summary instance\n */\n addTable(rows) {\n const tableBody = rows\n .map(row => {\n const cells = row\n .map(cell => {\n if (typeof cell === 'string') {\n return this.wrap('td', cell);\n }\n const { header, data, colspan, rowspan } = cell;\n const tag = header ? 'th' : 'td';\n const attrs = Object.assign(Object.assign({}, (colspan && { colspan })), (rowspan && { rowspan }));\n return this.wrap(tag, data, attrs);\n })\n .join('');\n return this.wrap('tr', cells);\n })\n .join('');\n const element = this.wrap('table', tableBody);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds a collapsable HTML details element to the summary buffer\n *\n * @param {string} label text for the closed state\n * @param {string} content collapsable content\n *\n * @returns {Summary} summary instance\n */\n addDetails(label, content) {\n const element = this.wrap('details', this.wrap('summary', label) + content);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML image tag to the summary buffer\n *\n * @param {string} src path to the image you to embed\n * @param {string} alt text description of the image\n * @param {SummaryImageOptions} options (optional) addition image attributes\n *\n * @returns {Summary} summary instance\n */\n addImage(src, alt, options) {\n const { width, height } = options || {};\n const attrs = Object.assign(Object.assign({}, (width && { width })), (height && { height }));\n const element = this.wrap('img', null, Object.assign({ src, alt }, attrs));\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML section heading element\n *\n * @param {string} text heading text\n * @param {number | string} [level=1] (optional) the heading level, default: 1\n *\n * @returns {Summary} summary instance\n */\n addHeading(text, level) {\n const tag = `h${level}`;\n const allowedTag = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tag)\n ? tag\n : 'h1';\n const element = this.wrap(allowedTag, text);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML thematic break (
) to the summary buffer\n *\n * @returns {Summary} summary instance\n */\n addSeparator() {\n const element = this.wrap('hr', null);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML line break (
) to the summary buffer\n *\n * @returns {Summary} summary instance\n */\n addBreak() {\n const element = this.wrap('br', null);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML blockquote to the summary buffer\n *\n * @param {string} text quote text\n * @param {string} cite (optional) citation url\n *\n * @returns {Summary} summary instance\n */\n addQuote(text, cite) {\n const attrs = Object.assign({}, (cite && { cite }));\n const element = this.wrap('blockquote', text, attrs);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML anchor tag to the summary buffer\n *\n * @param {string} text link text/content\n * @param {string} href hyperlink\n *\n * @returns {Summary} summary instance\n */\n addLink(text, href) {\n const element = this.wrap('a', text, { href });\n return this.addRaw(element).addEOL();\n }\n}\nconst _summary = new Summary();\n/**\n * @deprecated use `core.summary`\n */\nexports.markdownSummary = _summary;\nexports.summary = _summary;\n//# sourceMappingURL=summary.js.map","\"use strict\";\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toCommandProperties = exports.toCommandValue = void 0;\n/**\n * Sanitizes an input into a string so it can be passed into issueCommand safely\n * @param input input to sanitize into a string\n */\nfunction toCommandValue(input) {\n if (input === null || input === undefined) {\n return '';\n }\n else if (typeof input === 'string' || input instanceof String) {\n return input;\n }\n return JSON.stringify(input);\n}\nexports.toCommandValue = toCommandValue;\n/**\n *\n * @param annotationProperties\n * @returns The command properties to send with the actual annotation command\n * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646\n */\nfunction toCommandProperties(annotationProperties) {\n if (!Object.keys(annotationProperties).length) {\n return {};\n }\n return {\n title: annotationProperties.title,\n file: annotationProperties.file,\n line: annotationProperties.startLine,\n endLine: annotationProperties.endLine,\n col: annotationProperties.startColumn,\n endColumn: annotationProperties.endColumn\n };\n}\nexports.toCommandProperties = toCommandProperties;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getExecOutput = exports.exec = void 0;\nconst string_decoder_1 = require(\"string_decoder\");\nconst tr = __importStar(require(\"./toolrunner\"));\n/**\n * Exec a command.\n * Output will be streamed to the live console.\n * Returns promise with return code\n *\n * @param commandLine command to execute (can include additional args). Must be correctly escaped.\n * @param args optional arguments for tool. Escaping is handled by the lib.\n * @param options optional exec options. See ExecOptions\n * @returns Promise exit code\n */\nfunction exec(commandLine, args, options) {\n return __awaiter(this, void 0, void 0, function* () {\n const commandArgs = tr.argStringToArray(commandLine);\n if (commandArgs.length === 0) {\n throw new Error(`Parameter 'commandLine' cannot be null or empty.`);\n }\n // Path to tool to execute should be first arg\n const toolPath = commandArgs[0];\n args = commandArgs.slice(1).concat(args || []);\n const runner = new tr.ToolRunner(toolPath, args, options);\n return runner.exec();\n });\n}\nexports.exec = exec;\n/**\n * Exec a command and get the output.\n * Output will be streamed to the live console.\n * Returns promise with the exit code and collected stdout and stderr\n *\n * @param commandLine command to execute (can include additional args). Must be correctly escaped.\n * @param args optional arguments for tool. Escaping is handled by the lib.\n * @param options optional exec options. See ExecOptions\n * @returns Promise exit code, stdout, and stderr\n */\nfunction getExecOutput(commandLine, args, options) {\n var _a, _b;\n return __awaiter(this, void 0, void 0, function* () {\n let stdout = '';\n let stderr = '';\n //Using string decoder covers the case where a mult-byte character is split\n const stdoutDecoder = new string_decoder_1.StringDecoder('utf8');\n const stderrDecoder = new string_decoder_1.StringDecoder('utf8');\n const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.stdout;\n const originalStdErrListener = (_b = options === null || options === void 0 ? void 0 : options.listeners) === null || _b === void 0 ? void 0 : _b.stderr;\n const stdErrListener = (data) => {\n stderr += stderrDecoder.write(data);\n if (originalStdErrListener) {\n originalStdErrListener(data);\n }\n };\n const stdOutListener = (data) => {\n stdout += stdoutDecoder.write(data);\n if (originalStdoutListener) {\n originalStdoutListener(data);\n }\n };\n const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener });\n const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners }));\n //flush any remaining characters\n stdout += stdoutDecoder.end();\n stderr += stderrDecoder.end();\n return {\n exitCode,\n stdout,\n stderr\n };\n });\n}\nexports.getExecOutput = getExecOutput;\n//# sourceMappingURL=exec.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.argStringToArray = exports.ToolRunner = void 0;\nconst os = __importStar(require(\"os\"));\nconst events = __importStar(require(\"events\"));\nconst child = __importStar(require(\"child_process\"));\nconst path = __importStar(require(\"path\"));\nconst io = __importStar(require(\"@actions/io\"));\nconst ioUtil = __importStar(require(\"@actions/io/lib/io-util\"));\nconst timers_1 = require(\"timers\");\n/* eslint-disable @typescript-eslint/unbound-method */\nconst IS_WINDOWS = process.platform === 'win32';\n/*\n * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way.\n */\nclass ToolRunner extends events.EventEmitter {\n constructor(toolPath, args, options) {\n super();\n if (!toolPath) {\n throw new Error(\"Parameter 'toolPath' cannot be null or empty.\");\n }\n this.toolPath = toolPath;\n this.args = args || [];\n this.options = options || {};\n }\n _debug(message) {\n if (this.options.listeners && this.options.listeners.debug) {\n this.options.listeners.debug(message);\n }\n }\n _getCommandString(options, noPrefix) {\n const toolPath = this._getSpawnFileName();\n const args = this._getSpawnArgs(options);\n let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool\n if (IS_WINDOWS) {\n // Windows + cmd file\n if (this._isCmdFile()) {\n cmd += toolPath;\n for (const a of args) {\n cmd += ` ${a}`;\n }\n }\n // Windows + verbatim\n else if (options.windowsVerbatimArguments) {\n cmd += `\"${toolPath}\"`;\n for (const a of args) {\n cmd += ` ${a}`;\n }\n }\n // Windows (regular)\n else {\n cmd += this._windowsQuoteCmdArg(toolPath);\n for (const a of args) {\n cmd += ` ${this._windowsQuoteCmdArg(a)}`;\n }\n }\n }\n else {\n // OSX/Linux - this can likely be improved with some form of quoting.\n // creating processes on Unix is fundamentally different than Windows.\n // on Unix, execvp() takes an arg array.\n cmd += toolPath;\n for (const a of args) {\n cmd += ` ${a}`;\n }\n }\n return cmd;\n }\n _processLineBuffer(data, strBuffer, onLine) {\n try {\n let s = strBuffer + data.toString();\n let n = s.indexOf(os.EOL);\n while (n > -1) {\n const line = s.substring(0, n);\n onLine(line);\n // the rest of the string ...\n s = s.substring(n + os.EOL.length);\n n = s.indexOf(os.EOL);\n }\n return s;\n }\n catch (err) {\n // streaming lines to console is best effort. Don't fail a build.\n this._debug(`error processing line. Failed with error ${err}`);\n return '';\n }\n }\n _getSpawnFileName() {\n if (IS_WINDOWS) {\n if (this._isCmdFile()) {\n return process.env['COMSPEC'] || 'cmd.exe';\n }\n }\n return this.toolPath;\n }\n _getSpawnArgs(options) {\n if (IS_WINDOWS) {\n if (this._isCmdFile()) {\n let argline = `/D /S /C \"${this._windowsQuoteCmdArg(this.toolPath)}`;\n for (const a of this.args) {\n argline += ' ';\n argline += options.windowsVerbatimArguments\n ? a\n : this._windowsQuoteCmdArg(a);\n }\n argline += '\"';\n return [argline];\n }\n }\n return this.args;\n }\n _endsWith(str, end) {\n return str.endsWith(end);\n }\n _isCmdFile() {\n const upperToolPath = this.toolPath.toUpperCase();\n return (this._endsWith(upperToolPath, '.CMD') ||\n this._endsWith(upperToolPath, '.BAT'));\n }\n _windowsQuoteCmdArg(arg) {\n // for .exe, apply the normal quoting rules that libuv applies\n if (!this._isCmdFile()) {\n return this._uvQuoteCmdArg(arg);\n }\n // otherwise apply quoting rules specific to the cmd.exe command line parser.\n // the libuv rules are generic and are not designed specifically for cmd.exe\n // command line parser.\n //\n // for a detailed description of the cmd.exe command line parser, refer to\n // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912\n // need quotes for empty arg\n if (!arg) {\n return '\"\"';\n }\n // determine whether the arg needs to be quoted\n const cmdSpecialChars = [\n ' ',\n '\\t',\n '&',\n '(',\n ')',\n '[',\n ']',\n '{',\n '}',\n '^',\n '=',\n ';',\n '!',\n \"'\",\n '+',\n ',',\n '`',\n '~',\n '|',\n '<',\n '>',\n '\"'\n ];\n let needsQuotes = false;\n for (const char of arg) {\n if (cmdSpecialChars.some(x => x === char)) {\n needsQuotes = true;\n break;\n }\n }\n // short-circuit if quotes not needed\n if (!needsQuotes) {\n return arg;\n }\n // the following quoting rules are very similar to the rules that by libuv applies.\n //\n // 1) wrap the string in quotes\n //\n // 2) double-up quotes - i.e. \" => \"\"\n //\n // this is different from the libuv quoting rules. libuv replaces \" with \\\", which unfortunately\n // doesn't work well with a cmd.exe command line.\n //\n // note, replacing \" with \"\" also works well if the arg is passed to a downstream .NET console app.\n // for example, the command line:\n // foo.exe \"myarg:\"\"my val\"\"\"\n // is parsed by a .NET console app into an arg array:\n // [ \"myarg:\\\"my val\\\"\" ]\n // which is the same end result when applying libuv quoting rules. although the actual\n // command line from libuv quoting rules would look like:\n // foo.exe \"myarg:\\\"my val\\\"\"\n //\n // 3) double-up slashes that precede a quote,\n // e.g. hello \\world => \"hello \\world\"\n // hello\\\"world => \"hello\\\\\"\"world\"\n // hello\\\\\"world => \"hello\\\\\\\\\"\"world\"\n // hello world\\ => \"hello world\\\\\"\n //\n // technically this is not required for a cmd.exe command line, or the batch argument parser.\n // the reasons for including this as a .cmd quoting rule are:\n //\n // a) this is optimized for the scenario where the argument is passed from the .cmd file to an\n // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule.\n //\n // b) it's what we've been doing previously (by deferring to node default behavior) and we\n // haven't heard any complaints about that aspect.\n //\n // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be\n // escaped when used on the command line directly - even though within a .cmd file % can be escaped\n // by using %%.\n //\n // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts\n // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing.\n //\n // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would\n // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the\n // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args\n // to an external program.\n //\n // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file.\n // % can be escaped within a .cmd file.\n let reverse = '\"';\n let quoteHit = true;\n for (let i = arg.length; i > 0; i--) {\n // walk the string in reverse\n reverse += arg[i - 1];\n if (quoteHit && arg[i - 1] === '\\\\') {\n reverse += '\\\\'; // double the slash\n }\n else if (arg[i - 1] === '\"') {\n quoteHit = true;\n reverse += '\"'; // double the quote\n }\n else {\n quoteHit = false;\n }\n }\n reverse += '\"';\n return reverse\n .split('')\n .reverse()\n .join('');\n }\n _uvQuoteCmdArg(arg) {\n // Tool runner wraps child_process.spawn() and needs to apply the same quoting as\n // Node in certain cases where the undocumented spawn option windowsVerbatimArguments\n // is used.\n //\n // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV,\n // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details),\n // pasting copyright notice from Node within this function:\n //\n // Copyright Joyent, Inc. and other Node contributors. All rights reserved.\n //\n // Permission is hereby granted, free of charge, to any person obtaining a copy\n // of this software and associated documentation files (the \"Software\"), to\n // deal in the Software without restriction, including without limitation the\n // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n // sell copies of the Software, and to permit persons to whom the Software is\n // furnished to do so, subject to the following conditions:\n //\n // The above copyright notice and this permission notice shall be included in\n // all copies or substantial portions of the Software.\n //\n // THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n // IN THE SOFTWARE.\n if (!arg) {\n // Need double quotation for empty argument\n return '\"\"';\n }\n if (!arg.includes(' ') && !arg.includes('\\t') && !arg.includes('\"')) {\n // No quotation needed\n return arg;\n }\n if (!arg.includes('\"') && !arg.includes('\\\\')) {\n // No embedded double quotes or backslashes, so I can just wrap\n // quote marks around the whole thing.\n return `\"${arg}\"`;\n }\n // Expected input/output:\n // input : hello\"world\n // output: \"hello\\\"world\"\n // input : hello\"\"world\n // output: \"hello\\\"\\\"world\"\n // input : hello\\world\n // output: hello\\world\n // input : hello\\\\world\n // output: hello\\\\world\n // input : hello\\\"world\n // output: \"hello\\\\\\\"world\"\n // input : hello\\\\\"world\n // output: \"hello\\\\\\\\\\\"world\"\n // input : hello world\\\n // output: \"hello world\\\\\" - note the comment in libuv actually reads \"hello world\\\"\n // but it appears the comment is wrong, it should be \"hello world\\\\\"\n let reverse = '\"';\n let quoteHit = true;\n for (let i = arg.length; i > 0; i--) {\n // walk the string in reverse\n reverse += arg[i - 1];\n if (quoteHit && arg[i - 1] === '\\\\') {\n reverse += '\\\\';\n }\n else if (arg[i - 1] === '\"') {\n quoteHit = true;\n reverse += '\\\\';\n }\n else {\n quoteHit = false;\n }\n }\n reverse += '\"';\n return reverse\n .split('')\n .reverse()\n .join('');\n }\n _cloneExecOptions(options) {\n options = options || {};\n const result = {\n cwd: options.cwd || process.cwd(),\n env: options.env || process.env,\n silent: options.silent || false,\n windowsVerbatimArguments: options.windowsVerbatimArguments || false,\n failOnStdErr: options.failOnStdErr || false,\n ignoreReturnCode: options.ignoreReturnCode || false,\n delay: options.delay || 10000\n };\n result.outStream = options.outStream || process.stdout;\n result.errStream = options.errStream || process.stderr;\n return result;\n }\n _getSpawnOptions(options, toolPath) {\n options = options || {};\n const result = {};\n result.cwd = options.cwd;\n result.env = options.env;\n result['windowsVerbatimArguments'] =\n options.windowsVerbatimArguments || this._isCmdFile();\n if (options.windowsVerbatimArguments) {\n result.argv0 = `\"${toolPath}\"`;\n }\n return result;\n }\n /**\n * Exec a tool.\n * Output will be streamed to the live console.\n * Returns promise with return code\n *\n * @param tool path to tool to exec\n * @param options optional exec options. See ExecOptions\n * @returns number\n */\n exec() {\n return __awaiter(this, void 0, void 0, function* () {\n // root the tool path if it is unrooted and contains relative pathing\n if (!ioUtil.isRooted(this.toolPath) &&\n (this.toolPath.includes('/') ||\n (IS_WINDOWS && this.toolPath.includes('\\\\')))) {\n // prefer options.cwd if it is specified, however options.cwd may also need to be rooted\n this.toolPath = path.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath);\n }\n // if the tool is only a file name, then resolve it from the PATH\n // otherwise verify it exists (add extension on Windows if necessary)\n this.toolPath = yield io.which(this.toolPath, true);\n return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {\n this._debug(`exec tool: ${this.toolPath}`);\n this._debug('arguments:');\n for (const arg of this.args) {\n this._debug(` ${arg}`);\n }\n const optionsNonNull = this._cloneExecOptions(this.options);\n if (!optionsNonNull.silent && optionsNonNull.outStream) {\n optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL);\n }\n const state = new ExecState(optionsNonNull, this.toolPath);\n state.on('debug', (message) => {\n this._debug(message);\n });\n if (this.options.cwd && !(yield ioUtil.exists(this.options.cwd))) {\n return reject(new Error(`The cwd: ${this.options.cwd} does not exist!`));\n }\n const fileName = this._getSpawnFileName();\n const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName));\n let stdbuffer = '';\n if (cp.stdout) {\n cp.stdout.on('data', (data) => {\n if (this.options.listeners && this.options.listeners.stdout) {\n this.options.listeners.stdout(data);\n }\n if (!optionsNonNull.silent && optionsNonNull.outStream) {\n optionsNonNull.outStream.write(data);\n }\n stdbuffer = this._processLineBuffer(data, stdbuffer, (line) => {\n if (this.options.listeners && this.options.listeners.stdline) {\n this.options.listeners.stdline(line);\n }\n });\n });\n }\n let errbuffer = '';\n if (cp.stderr) {\n cp.stderr.on('data', (data) => {\n state.processStderr = true;\n if (this.options.listeners && this.options.listeners.stderr) {\n this.options.listeners.stderr(data);\n }\n if (!optionsNonNull.silent &&\n optionsNonNull.errStream &&\n optionsNonNull.outStream) {\n const s = optionsNonNull.failOnStdErr\n ? optionsNonNull.errStream\n : optionsNonNull.outStream;\n s.write(data);\n }\n errbuffer = this._processLineBuffer(data, errbuffer, (line) => {\n if (this.options.listeners && this.options.listeners.errline) {\n this.options.listeners.errline(line);\n }\n });\n });\n }\n cp.on('error', (err) => {\n state.processError = err.message;\n state.processExited = true;\n state.processClosed = true;\n state.CheckComplete();\n });\n cp.on('exit', (code) => {\n state.processExitCode = code;\n state.processExited = true;\n this._debug(`Exit code ${code} received from tool '${this.toolPath}'`);\n state.CheckComplete();\n });\n cp.on('close', (code) => {\n state.processExitCode = code;\n state.processExited = true;\n state.processClosed = true;\n this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);\n state.CheckComplete();\n });\n state.on('done', (error, exitCode) => {\n if (stdbuffer.length > 0) {\n this.emit('stdline', stdbuffer);\n }\n if (errbuffer.length > 0) {\n this.emit('errline', errbuffer);\n }\n cp.removeAllListeners();\n if (error) {\n reject(error);\n }\n else {\n resolve(exitCode);\n }\n });\n if (this.options.input) {\n if (!cp.stdin) {\n throw new Error('child process missing stdin');\n }\n cp.stdin.end(this.options.input);\n }\n }));\n });\n }\n}\nexports.ToolRunner = ToolRunner;\n/**\n * Convert an arg string to an array of args. Handles escaping\n *\n * @param argString string of arguments\n * @returns string[] array of arguments\n */\nfunction argStringToArray(argString) {\n const args = [];\n let inQuotes = false;\n let escaped = false;\n let arg = '';\n function append(c) {\n // we only escape double quotes.\n if (escaped && c !== '\"') {\n arg += '\\\\';\n }\n arg += c;\n escaped = false;\n }\n for (let i = 0; i < argString.length; i++) {\n const c = argString.charAt(i);\n if (c === '\"') {\n if (!escaped) {\n inQuotes = !inQuotes;\n }\n else {\n append(c);\n }\n continue;\n }\n if (c === '\\\\' && escaped) {\n append(c);\n continue;\n }\n if (c === '\\\\' && inQuotes) {\n escaped = true;\n continue;\n }\n if (c === ' ' && !inQuotes) {\n if (arg.length > 0) {\n args.push(arg);\n arg = '';\n }\n continue;\n }\n append(c);\n }\n if (arg.length > 0) {\n args.push(arg.trim());\n }\n return args;\n}\nexports.argStringToArray = argStringToArray;\nclass ExecState extends events.EventEmitter {\n constructor(options, toolPath) {\n super();\n this.processClosed = false; // tracks whether the process has exited and stdio is closed\n this.processError = '';\n this.processExitCode = 0;\n this.processExited = false; // tracks whether the process has exited\n this.processStderr = false; // tracks whether stderr was written to\n this.delay = 10000; // 10 seconds\n this.done = false;\n this.timeout = null;\n if (!toolPath) {\n throw new Error('toolPath must not be empty');\n }\n this.options = options;\n this.toolPath = toolPath;\n if (options.delay) {\n this.delay = options.delay;\n }\n }\n CheckComplete() {\n if (this.done) {\n return;\n }\n if (this.processClosed) {\n this._setResult();\n }\n else if (this.processExited) {\n this.timeout = timers_1.setTimeout(ExecState.HandleTimeout, this.delay, this);\n }\n }\n _debug(message) {\n this.emit('debug', message);\n }\n _setResult() {\n // determine whether there is an error\n let error;\n if (this.processExited) {\n if (this.processError) {\n error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`);\n }\n else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) {\n error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);\n }\n else if (this.processStderr && this.options.failOnStdErr) {\n error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`);\n }\n }\n // clear the timeout\n if (this.timeout) {\n clearTimeout(this.timeout);\n this.timeout = null;\n }\n this.done = true;\n this.emit('done', error, this.processExitCode);\n }\n static HandleTimeout(state) {\n if (state.done) {\n return;\n }\n if (!state.processClosed && state.processExited) {\n const message = `The STDIO streams did not close within ${state.delay /\n 1000} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`;\n state._debug(message);\n }\n state._setResult();\n }\n}\n//# sourceMappingURL=toolrunner.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PersonalAccessTokenCredentialHandler = exports.BearerCredentialHandler = exports.BasicCredentialHandler = void 0;\nclass BasicCredentialHandler {\n constructor(username, password) {\n this.username = username;\n this.password = password;\n }\n prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`;\n }\n // This handler cannot handle 401\n canHandleAuthentication() {\n return false;\n }\n handleAuthentication() {\n return __awaiter(this, void 0, void 0, function* () {\n throw new Error('not implemented');\n });\n }\n}\nexports.BasicCredentialHandler = BasicCredentialHandler;\nclass BearerCredentialHandler {\n constructor(token) {\n this.token = token;\n }\n // currently implements pre-authorization\n // TODO: support preAuth = false where it hooks on 401\n prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Bearer ${this.token}`;\n }\n // This handler cannot handle 401\n canHandleAuthentication() {\n return false;\n }\n handleAuthentication() {\n return __awaiter(this, void 0, void 0, function* () {\n throw new Error('not implemented');\n });\n }\n}\nexports.BearerCredentialHandler = BearerCredentialHandler;\nclass PersonalAccessTokenCredentialHandler {\n constructor(token) {\n this.token = token;\n }\n // currently implements pre-authorization\n // TODO: support preAuth = false where it hooks on 401\n prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`;\n }\n // This handler cannot handle 401\n canHandleAuthentication() {\n return false;\n }\n handleAuthentication() {\n return __awaiter(this, void 0, void 0, function* () {\n throw new Error('not implemented');\n });\n }\n}\nexports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler;\n//# sourceMappingURL=auth.js.map","\"use strict\";\n/* eslint-disable @typescript-eslint/no-explicit-any */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0;\nconst http = __importStar(require(\"http\"));\nconst https = __importStar(require(\"https\"));\nconst pm = __importStar(require(\"./proxy\"));\nconst tunnel = __importStar(require(\"tunnel\"));\nvar HttpCodes;\n(function (HttpCodes) {\n HttpCodes[HttpCodes[\"OK\"] = 200] = \"OK\";\n HttpCodes[HttpCodes[\"MultipleChoices\"] = 300] = \"MultipleChoices\";\n HttpCodes[HttpCodes[\"MovedPermanently\"] = 301] = \"MovedPermanently\";\n HttpCodes[HttpCodes[\"ResourceMoved\"] = 302] = \"ResourceMoved\";\n HttpCodes[HttpCodes[\"SeeOther\"] = 303] = \"SeeOther\";\n HttpCodes[HttpCodes[\"NotModified\"] = 304] = \"NotModified\";\n HttpCodes[HttpCodes[\"UseProxy\"] = 305] = \"UseProxy\";\n HttpCodes[HttpCodes[\"SwitchProxy\"] = 306] = \"SwitchProxy\";\n HttpCodes[HttpCodes[\"TemporaryRedirect\"] = 307] = \"TemporaryRedirect\";\n HttpCodes[HttpCodes[\"PermanentRedirect\"] = 308] = \"PermanentRedirect\";\n HttpCodes[HttpCodes[\"BadRequest\"] = 400] = \"BadRequest\";\n HttpCodes[HttpCodes[\"Unauthorized\"] = 401] = \"Unauthorized\";\n HttpCodes[HttpCodes[\"PaymentRequired\"] = 402] = \"PaymentRequired\";\n HttpCodes[HttpCodes[\"Forbidden\"] = 403] = \"Forbidden\";\n HttpCodes[HttpCodes[\"NotFound\"] = 404] = \"NotFound\";\n HttpCodes[HttpCodes[\"MethodNotAllowed\"] = 405] = \"MethodNotAllowed\";\n HttpCodes[HttpCodes[\"NotAcceptable\"] = 406] = \"NotAcceptable\";\n HttpCodes[HttpCodes[\"ProxyAuthenticationRequired\"] = 407] = \"ProxyAuthenticationRequired\";\n HttpCodes[HttpCodes[\"RequestTimeout\"] = 408] = \"RequestTimeout\";\n HttpCodes[HttpCodes[\"Conflict\"] = 409] = \"Conflict\";\n HttpCodes[HttpCodes[\"Gone\"] = 410] = \"Gone\";\n HttpCodes[HttpCodes[\"TooManyRequests\"] = 429] = \"TooManyRequests\";\n HttpCodes[HttpCodes[\"InternalServerError\"] = 500] = \"InternalServerError\";\n HttpCodes[HttpCodes[\"NotImplemented\"] = 501] = \"NotImplemented\";\n HttpCodes[HttpCodes[\"BadGateway\"] = 502] = \"BadGateway\";\n HttpCodes[HttpCodes[\"ServiceUnavailable\"] = 503] = \"ServiceUnavailable\";\n HttpCodes[HttpCodes[\"GatewayTimeout\"] = 504] = \"GatewayTimeout\";\n})(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));\nvar Headers;\n(function (Headers) {\n Headers[\"Accept\"] = \"accept\";\n Headers[\"ContentType\"] = \"content-type\";\n})(Headers = exports.Headers || (exports.Headers = {}));\nvar MediaTypes;\n(function (MediaTypes) {\n MediaTypes[\"ApplicationJson\"] = \"application/json\";\n})(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {}));\n/**\n * Returns the proxy URL, depending upon the supplied url and proxy environment variables.\n * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com\n */\nfunction getProxyUrl(serverUrl) {\n const proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}\nexports.getProxyUrl = getProxyUrl;\nconst HttpRedirectCodes = [\n HttpCodes.MovedPermanently,\n HttpCodes.ResourceMoved,\n HttpCodes.SeeOther,\n HttpCodes.TemporaryRedirect,\n HttpCodes.PermanentRedirect\n];\nconst HttpResponseRetryCodes = [\n HttpCodes.BadGateway,\n HttpCodes.ServiceUnavailable,\n HttpCodes.GatewayTimeout\n];\nconst RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];\nconst ExponentialBackoffCeiling = 10;\nconst ExponentialBackoffTimeSlice = 5;\nclass HttpClientError extends Error {\n constructor(message, statusCode) {\n super(message);\n this.name = 'HttpClientError';\n this.statusCode = statusCode;\n Object.setPrototypeOf(this, HttpClientError.prototype);\n }\n}\nexports.HttpClientError = HttpClientError;\nclass HttpClientResponse {\n constructor(message) {\n this.message = message;\n }\n readBody() {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {\n let output = Buffer.alloc(0);\n this.message.on('data', (chunk) => {\n output = Buffer.concat([output, chunk]);\n });\n this.message.on('end', () => {\n resolve(output.toString());\n });\n }));\n });\n }\n}\nexports.HttpClientResponse = HttpClientResponse;\nfunction isHttps(requestUrl) {\n const parsedUrl = new URL(requestUrl);\n return parsedUrl.protocol === 'https:';\n}\nexports.isHttps = isHttps;\nclass HttpClient {\n constructor(userAgent, handlers, requestOptions) {\n this._ignoreSslError = false;\n this._allowRedirects = true;\n this._allowRedirectDowngrade = false;\n this._maxRedirects = 50;\n this._allowRetries = false;\n this._maxRetries = 1;\n this._keepAlive = false;\n this._disposed = false;\n this.userAgent = userAgent;\n this.handlers = handlers || [];\n this.requestOptions = requestOptions;\n if (requestOptions) {\n if (requestOptions.ignoreSslError != null) {\n this._ignoreSslError = requestOptions.ignoreSslError;\n }\n this._socketTimeout = requestOptions.socketTimeout;\n if (requestOptions.allowRedirects != null) {\n this._allowRedirects = requestOptions.allowRedirects;\n }\n if (requestOptions.allowRedirectDowngrade != null) {\n this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;\n }\n if (requestOptions.maxRedirects != null) {\n this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);\n }\n if (requestOptions.keepAlive != null) {\n this._keepAlive = requestOptions.keepAlive;\n }\n if (requestOptions.allowRetries != null) {\n this._allowRetries = requestOptions.allowRetries;\n }\n if (requestOptions.maxRetries != null) {\n this._maxRetries = requestOptions.maxRetries;\n }\n }\n }\n options(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});\n });\n }\n get(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('GET', requestUrl, null, additionalHeaders || {});\n });\n }\n del(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('DELETE', requestUrl, null, additionalHeaders || {});\n });\n }\n post(requestUrl, data, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('POST', requestUrl, data, additionalHeaders || {});\n });\n }\n patch(requestUrl, data, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('PATCH', requestUrl, data, additionalHeaders || {});\n });\n }\n put(requestUrl, data, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('PUT', requestUrl, data, additionalHeaders || {});\n });\n }\n head(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('HEAD', requestUrl, null, additionalHeaders || {});\n });\n }\n sendStream(verb, requestUrl, stream, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request(verb, requestUrl, stream, additionalHeaders);\n });\n }\n /**\n * Gets a typed object from an endpoint\n * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise\n */\n getJson(requestUrl, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n const res = yield this.get(requestUrl, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n postJson(requestUrl, obj, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n const data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n const res = yield this.post(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n putJson(requestUrl, obj, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n const data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n const res = yield this.put(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n patchJson(requestUrl, obj, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n const data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n const res = yield this.patch(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n /**\n * Makes a raw http request.\n * All other methods such as get, post, patch, and request ultimately call this.\n * Prefer get, del, post and patch\n */\n request(verb, requestUrl, data, headers) {\n return __awaiter(this, void 0, void 0, function* () {\n if (this._disposed) {\n throw new Error('Client has already been disposed.');\n }\n const parsedUrl = new URL(requestUrl);\n let info = this._prepareRequest(verb, parsedUrl, headers);\n // Only perform retries on reads since writes may not be idempotent.\n const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb)\n ? this._maxRetries + 1\n : 1;\n let numTries = 0;\n let response;\n do {\n response = yield this.requestRaw(info, data);\n // Check if it's an authentication challenge\n if (response &&\n response.message &&\n response.message.statusCode === HttpCodes.Unauthorized) {\n let authenticationHandler;\n for (const handler of this.handlers) {\n if (handler.canHandleAuthentication(response)) {\n authenticationHandler = handler;\n break;\n }\n }\n if (authenticationHandler) {\n return authenticationHandler.handleAuthentication(this, info, data);\n }\n else {\n // We have received an unauthorized response but have no handlers to handle it.\n // Let the response return to the caller.\n return response;\n }\n }\n let redirectsRemaining = this._maxRedirects;\n while (response.message.statusCode &&\n HttpRedirectCodes.includes(response.message.statusCode) &&\n this._allowRedirects &&\n redirectsRemaining > 0) {\n const redirectUrl = response.message.headers['location'];\n if (!redirectUrl) {\n // if there's no location to redirect to, we won't\n break;\n }\n const parsedRedirectUrl = new URL(redirectUrl);\n if (parsedUrl.protocol === 'https:' &&\n parsedUrl.protocol !== parsedRedirectUrl.protocol &&\n !this._allowRedirectDowngrade) {\n throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.');\n }\n // we need to finish reading the response before reassigning response\n // which will leak the open socket.\n yield response.readBody();\n // strip authorization header if redirected to a different hostname\n if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {\n for (const header in headers) {\n // header names are case insensitive\n if (header.toLowerCase() === 'authorization') {\n delete headers[header];\n }\n }\n }\n // let's make the request with the new redirectUrl\n info = this._prepareRequest(verb, parsedRedirectUrl, headers);\n response = yield this.requestRaw(info, data);\n redirectsRemaining--;\n }\n if (!response.message.statusCode ||\n !HttpResponseRetryCodes.includes(response.message.statusCode)) {\n // If not a retry code, return immediately instead of retrying\n return response;\n }\n numTries += 1;\n if (numTries < maxTries) {\n yield response.readBody();\n yield this._performExponentialBackoff(numTries);\n }\n } while (numTries < maxTries);\n return response;\n });\n }\n /**\n * Needs to be called if keepAlive is set to true in request options.\n */\n dispose() {\n if (this._agent) {\n this._agent.destroy();\n }\n this._disposed = true;\n }\n /**\n * Raw request.\n * @param info\n * @param data\n */\n requestRaw(info, data) {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve, reject) => {\n function callbackForResult(err, res) {\n if (err) {\n reject(err);\n }\n else if (!res) {\n // If `err` is not passed, then `res` must be passed.\n reject(new Error('Unknown error'));\n }\n else {\n resolve(res);\n }\n }\n this.requestRawWithCallback(info, data, callbackForResult);\n });\n });\n }\n /**\n * Raw request with callback.\n * @param info\n * @param data\n * @param onResult\n */\n requestRawWithCallback(info, data, onResult) {\n if (typeof data === 'string') {\n if (!info.options.headers) {\n info.options.headers = {};\n }\n info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');\n }\n let callbackCalled = false;\n function handleResult(err, res) {\n if (!callbackCalled) {\n callbackCalled = true;\n onResult(err, res);\n }\n }\n const req = info.httpModule.request(info.options, (msg) => {\n const res = new HttpClientResponse(msg);\n handleResult(undefined, res);\n });\n let socket;\n req.on('socket', sock => {\n socket = sock;\n });\n // If we ever get disconnected, we want the socket to timeout eventually\n req.setTimeout(this._socketTimeout || 3 * 60000, () => {\n if (socket) {\n socket.end();\n }\n handleResult(new Error(`Request timeout: ${info.options.path}`));\n });\n req.on('error', function (err) {\n // err has statusCode property\n // res should have headers\n handleResult(err);\n });\n if (data && typeof data === 'string') {\n req.write(data, 'utf8');\n }\n if (data && typeof data !== 'string') {\n data.on('close', function () {\n req.end();\n });\n data.pipe(req);\n }\n else {\n req.end();\n }\n }\n /**\n * Gets an http agent. This function is useful when you need an http agent that handles\n * routing through a proxy server - depending upon the url and proxy environment variables.\n * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com\n */\n getAgent(serverUrl) {\n const parsedUrl = new URL(serverUrl);\n return this._getAgent(parsedUrl);\n }\n _prepareRequest(method, requestUrl, headers) {\n const info = {};\n info.parsedUrl = requestUrl;\n const usingSsl = info.parsedUrl.protocol === 'https:';\n info.httpModule = usingSsl ? https : http;\n const defaultPort = usingSsl ? 443 : 80;\n info.options = {};\n info.options.host = info.parsedUrl.hostname;\n info.options.port = info.parsedUrl.port\n ? parseInt(info.parsedUrl.port)\n : defaultPort;\n info.options.path =\n (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');\n info.options.method = method;\n info.options.headers = this._mergeHeaders(headers);\n if (this.userAgent != null) {\n info.options.headers['user-agent'] = this.userAgent;\n }\n info.options.agent = this._getAgent(info.parsedUrl);\n // gives handlers an opportunity to participate\n if (this.handlers) {\n for (const handler of this.handlers) {\n handler.prepareRequest(info.options);\n }\n }\n return info;\n }\n _mergeHeaders(headers) {\n if (this.requestOptions && this.requestOptions.headers) {\n return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {}));\n }\n return lowercaseKeys(headers || {});\n }\n _getExistingOrDefaultHeader(additionalHeaders, header, _default) {\n let clientHeader;\n if (this.requestOptions && this.requestOptions.headers) {\n clientHeader = lowercaseKeys(this.requestOptions.headers)[header];\n }\n return additionalHeaders[header] || clientHeader || _default;\n }\n _getAgent(parsedUrl) {\n let agent;\n const proxyUrl = pm.getProxyUrl(parsedUrl);\n const useProxy = proxyUrl && proxyUrl.hostname;\n if (this._keepAlive && useProxy) {\n agent = this._proxyAgent;\n }\n if (this._keepAlive && !useProxy) {\n agent = this._agent;\n }\n // if agent is already assigned use that agent.\n if (agent) {\n return agent;\n }\n const usingSsl = parsedUrl.protocol === 'https:';\n let maxSockets = 100;\n if (this.requestOptions) {\n maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;\n }\n // This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis.\n if (proxyUrl && proxyUrl.hostname) {\n const agentOptions = {\n maxSockets,\n keepAlive: this._keepAlive,\n proxy: Object.assign(Object.assign({}, ((proxyUrl.username || proxyUrl.password) && {\n proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`\n })), { host: proxyUrl.hostname, port: proxyUrl.port })\n };\n let tunnelAgent;\n const overHttps = proxyUrl.protocol === 'https:';\n if (usingSsl) {\n tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;\n }\n else {\n tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;\n }\n agent = tunnelAgent(agentOptions);\n this._proxyAgent = agent;\n }\n // if reusing agent across request and tunneling agent isn't assigned create a new agent\n if (this._keepAlive && !agent) {\n const options = { keepAlive: this._keepAlive, maxSockets };\n agent = usingSsl ? new https.Agent(options) : new http.Agent(options);\n this._agent = agent;\n }\n // if not using private agent and tunnel agent isn't setup then use global agent\n if (!agent) {\n agent = usingSsl ? https.globalAgent : http.globalAgent;\n }\n if (usingSsl && this._ignoreSslError) {\n // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process\n // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options\n // we have to cast it to any and change it directly\n agent.options = Object.assign(agent.options || {}, {\n rejectUnauthorized: false\n });\n }\n return agent;\n }\n _performExponentialBackoff(retryNumber) {\n return __awaiter(this, void 0, void 0, function* () {\n retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);\n const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);\n return new Promise(resolve => setTimeout(() => resolve(), ms));\n });\n }\n _processResponse(res, options) {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {\n const statusCode = res.message.statusCode || 0;\n const response = {\n statusCode,\n result: null,\n headers: {}\n };\n // not found leads to null obj returned\n if (statusCode === HttpCodes.NotFound) {\n resolve(response);\n }\n // get the result from the body\n function dateTimeDeserializer(key, value) {\n if (typeof value === 'string') {\n const a = new Date(value);\n if (!isNaN(a.valueOf())) {\n return a;\n }\n }\n return value;\n }\n let obj;\n let contents;\n try {\n contents = yield res.readBody();\n if (contents && contents.length > 0) {\n if (options && options.deserializeDates) {\n obj = JSON.parse(contents, dateTimeDeserializer);\n }\n else {\n obj = JSON.parse(contents);\n }\n response.result = obj;\n }\n response.headers = res.message.headers;\n }\n catch (err) {\n // Invalid resource (contents not json); leaving result obj null\n }\n // note that 3xx redirects are handled by the http layer.\n if (statusCode > 299) {\n let msg;\n // if exception/error in body, attempt to get better error\n if (obj && obj.message) {\n msg = obj.message;\n }\n else if (contents && contents.length > 0) {\n // it may be the case that the exception is in the body message as string\n msg = contents;\n }\n else {\n msg = `Failed request: (${statusCode})`;\n }\n const err = new HttpClientError(msg, statusCode);\n err.result = response.result;\n reject(err);\n }\n else {\n resolve(response);\n }\n }));\n });\n }\n}\nexports.HttpClient = HttpClient;\nconst lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.checkBypass = exports.getProxyUrl = void 0;\nfunction getProxyUrl(reqUrl) {\n const usingSsl = reqUrl.protocol === 'https:';\n if (checkBypass(reqUrl)) {\n return undefined;\n }\n const proxyVar = (() => {\n if (usingSsl) {\n return process.env['https_proxy'] || process.env['HTTPS_PROXY'];\n }\n else {\n return process.env['http_proxy'] || process.env['HTTP_PROXY'];\n }\n })();\n if (proxyVar) {\n return new URL(proxyVar);\n }\n else {\n return undefined;\n }\n}\nexports.getProxyUrl = getProxyUrl;\nfunction checkBypass(reqUrl) {\n if (!reqUrl.hostname) {\n return false;\n }\n const reqHost = reqUrl.hostname;\n if (isLoopbackAddress(reqHost)) {\n return true;\n }\n const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';\n if (!noProxy) {\n return false;\n }\n // Determine the request port\n let reqPort;\n if (reqUrl.port) {\n reqPort = Number(reqUrl.port);\n }\n else if (reqUrl.protocol === 'http:') {\n reqPort = 80;\n }\n else if (reqUrl.protocol === 'https:') {\n reqPort = 443;\n }\n // Format the request hostname and hostname with port\n const upperReqHosts = [reqUrl.hostname.toUpperCase()];\n if (typeof reqPort === 'number') {\n upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);\n }\n // Compare request host against noproxy\n for (const upperNoProxyItem of noProxy\n .split(',')\n .map(x => x.trim().toUpperCase())\n .filter(x => x)) {\n if (upperNoProxyItem === '*' ||\n upperReqHosts.some(x => x === upperNoProxyItem ||\n x.endsWith(`.${upperNoProxyItem}`) ||\n (upperNoProxyItem.startsWith('.') &&\n x.endsWith(`${upperNoProxyItem}`)))) {\n return true;\n }\n }\n return false;\n}\nexports.checkBypass = checkBypass;\nfunction isLoopbackAddress(host) {\n const hostLower = host.toLowerCase();\n return (hostLower === 'localhost' ||\n hostLower.startsWith('127.') ||\n hostLower.startsWith('[::1]') ||\n hostLower.startsWith('[0:0:0:0:0:0:0:1]'));\n}\n//# sourceMappingURL=proxy.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar _a;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getCmdPath = exports.tryGetExecutablePath = exports.isRooted = exports.isDirectory = exports.exists = exports.READONLY = exports.UV_FS_O_EXLOCK = exports.IS_WINDOWS = exports.unlink = exports.symlink = exports.stat = exports.rmdir = exports.rm = exports.rename = exports.readlink = exports.readdir = exports.open = exports.mkdir = exports.lstat = exports.copyFile = exports.chmod = void 0;\nconst fs = __importStar(require(\"fs\"));\nconst path = __importStar(require(\"path\"));\n_a = fs.promises\n// export const {open} = 'fs'\n, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.open = _a.open, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rm = _a.rm, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink;\n// export const {open} = 'fs'\nexports.IS_WINDOWS = process.platform === 'win32';\n// See https://github.com/nodejs/node/blob/d0153aee367422d0858105abec186da4dff0a0c5/deps/uv/include/uv/win.h#L691\nexports.UV_FS_O_EXLOCK = 0x10000000;\nexports.READONLY = fs.constants.O_RDONLY;\nfunction exists(fsPath) {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n yield exports.stat(fsPath);\n }\n catch (err) {\n if (err.code === 'ENOENT') {\n return false;\n }\n throw err;\n }\n return true;\n });\n}\nexports.exists = exists;\nfunction isDirectory(fsPath, useStat = false) {\n return __awaiter(this, void 0, void 0, function* () {\n const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);\n return stats.isDirectory();\n });\n}\nexports.isDirectory = isDirectory;\n/**\n * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:\n * \\, \\hello, \\\\hello\\share, C:, and C:\\hello (and corresponding alternate separator cases).\n */\nfunction isRooted(p) {\n p = normalizeSeparators(p);\n if (!p) {\n throw new Error('isRooted() parameter \"p\" cannot be empty');\n }\n if (exports.IS_WINDOWS) {\n return (p.startsWith('\\\\') || /^[A-Z]:/i.test(p) // e.g. \\ or \\hello or \\\\hello\n ); // e.g. C: or C:\\hello\n }\n return p.startsWith('/');\n}\nexports.isRooted = isRooted;\n/**\n * Best effort attempt to determine whether a file exists and is executable.\n * @param filePath file path to check\n * @param extensions additional file extensions to try\n * @return if file exists and is executable, returns the file path. otherwise empty string.\n */\nfunction tryGetExecutablePath(filePath, extensions) {\n return __awaiter(this, void 0, void 0, function* () {\n let stats = undefined;\n try {\n // test file exists\n stats = yield exports.stat(filePath);\n }\n catch (err) {\n if (err.code !== 'ENOENT') {\n // eslint-disable-next-line no-console\n console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);\n }\n }\n if (stats && stats.isFile()) {\n if (exports.IS_WINDOWS) {\n // on Windows, test for valid extension\n const upperExt = path.extname(filePath).toUpperCase();\n if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {\n return filePath;\n }\n }\n else {\n if (isUnixExecutable(stats)) {\n return filePath;\n }\n }\n }\n // try each extension\n const originalFilePath = filePath;\n for (const extension of extensions) {\n filePath = originalFilePath + extension;\n stats = undefined;\n try {\n stats = yield exports.stat(filePath);\n }\n catch (err) {\n if (err.code !== 'ENOENT') {\n // eslint-disable-next-line no-console\n console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);\n }\n }\n if (stats && stats.isFile()) {\n if (exports.IS_WINDOWS) {\n // preserve the case of the actual file (since an extension was appended)\n try {\n const directory = path.dirname(filePath);\n const upperName = path.basename(filePath).toUpperCase();\n for (const actualName of yield exports.readdir(directory)) {\n if (upperName === actualName.toUpperCase()) {\n filePath = path.join(directory, actualName);\n break;\n }\n }\n }\n catch (err) {\n // eslint-disable-next-line no-console\n console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);\n }\n return filePath;\n }\n else {\n if (isUnixExecutable(stats)) {\n return filePath;\n }\n }\n }\n }\n return '';\n });\n}\nexports.tryGetExecutablePath = tryGetExecutablePath;\nfunction normalizeSeparators(p) {\n p = p || '';\n if (exports.IS_WINDOWS) {\n // convert slashes on Windows\n p = p.replace(/\\//g, '\\\\');\n // remove redundant slashes\n return p.replace(/\\\\\\\\+/g, '\\\\');\n }\n // remove redundant slashes\n return p.replace(/\\/\\/+/g, '/');\n}\n// on Mac/Linux, test the execute bit\n// R W X R W X R W X\n// 256 128 64 32 16 8 4 2 1\nfunction isUnixExecutable(stats) {\n return ((stats.mode & 1) > 0 ||\n ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||\n ((stats.mode & 64) > 0 && stats.uid === process.getuid()));\n}\n// Get the path of cmd.exe in windows\nfunction getCmdPath() {\n var _a;\n return (_a = process.env['COMSPEC']) !== null && _a !== void 0 ? _a : `cmd.exe`;\n}\nexports.getCmdPath = getCmdPath;\n//# sourceMappingURL=io-util.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.findInPath = exports.which = exports.mkdirP = exports.rmRF = exports.mv = exports.cp = void 0;\nconst assert_1 = require(\"assert\");\nconst path = __importStar(require(\"path\"));\nconst ioUtil = __importStar(require(\"./io-util\"));\n/**\n * Copies a file or folder.\n * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js\n *\n * @param source source path\n * @param dest destination path\n * @param options optional. See CopyOptions.\n */\nfunction cp(source, dest, options = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n const { force, recursive, copySourceDirectory } = readCopyOptions(options);\n const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null;\n // Dest is an existing file, but not forcing\n if (destStat && destStat.isFile() && !force) {\n return;\n }\n // If dest is an existing directory, should copy inside.\n const newDest = destStat && destStat.isDirectory() && copySourceDirectory\n ? path.join(dest, path.basename(source))\n : dest;\n if (!(yield ioUtil.exists(source))) {\n throw new Error(`no such file or directory: ${source}`);\n }\n const sourceStat = yield ioUtil.stat(source);\n if (sourceStat.isDirectory()) {\n if (!recursive) {\n throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`);\n }\n else {\n yield cpDirRecursive(source, newDest, 0, force);\n }\n }\n else {\n if (path.relative(source, newDest) === '') {\n // a file cannot be copied to itself\n throw new Error(`'${newDest}' and '${source}' are the same file`);\n }\n yield copyFile(source, newDest, force);\n }\n });\n}\nexports.cp = cp;\n/**\n * Moves a path.\n *\n * @param source source path\n * @param dest destination path\n * @param options optional. See MoveOptions.\n */\nfunction mv(source, dest, options = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n if (yield ioUtil.exists(dest)) {\n let destExists = true;\n if (yield ioUtil.isDirectory(dest)) {\n // If dest is directory copy src into dest\n dest = path.join(dest, path.basename(source));\n destExists = yield ioUtil.exists(dest);\n }\n if (destExists) {\n if (options.force == null || options.force) {\n yield rmRF(dest);\n }\n else {\n throw new Error('Destination already exists');\n }\n }\n }\n yield mkdirP(path.dirname(dest));\n yield ioUtil.rename(source, dest);\n });\n}\nexports.mv = mv;\n/**\n * Remove a path recursively with force\n *\n * @param inputPath path to remove\n */\nfunction rmRF(inputPath) {\n return __awaiter(this, void 0, void 0, function* () {\n if (ioUtil.IS_WINDOWS) {\n // Check for invalid characters\n // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file\n if (/[*\"<>|]/.test(inputPath)) {\n throw new Error('File path must not contain `*`, `\"`, `<`, `>` or `|` on Windows');\n }\n }\n try {\n // note if path does not exist, error is silent\n yield ioUtil.rm(inputPath, {\n force: true,\n maxRetries: 3,\n recursive: true,\n retryDelay: 300\n });\n }\n catch (err) {\n throw new Error(`File was unable to be removed ${err}`);\n }\n });\n}\nexports.rmRF = rmRF;\n/**\n * Make a directory. Creates the full path with folders in between\n * Will throw if it fails\n *\n * @param fsPath path to create\n * @returns Promise\n */\nfunction mkdirP(fsPath) {\n return __awaiter(this, void 0, void 0, function* () {\n assert_1.ok(fsPath, 'a path argument must be provided');\n yield ioUtil.mkdir(fsPath, { recursive: true });\n });\n}\nexports.mkdirP = mkdirP;\n/**\n * Returns path of a tool had the tool actually been invoked. Resolves via paths.\n * If you check and the tool does not exist, it will throw.\n *\n * @param tool name of the tool\n * @param check whether to check if tool exists\n * @returns Promise path to tool\n */\nfunction which(tool, check) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!tool) {\n throw new Error(\"parameter 'tool' is required\");\n }\n // recursive when check=true\n if (check) {\n const result = yield which(tool, false);\n if (!result) {\n if (ioUtil.IS_WINDOWS) {\n throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`);\n }\n else {\n throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`);\n }\n }\n return result;\n }\n const matches = yield findInPath(tool);\n if (matches && matches.length > 0) {\n return matches[0];\n }\n return '';\n });\n}\nexports.which = which;\n/**\n * Returns a list of all occurrences of the given tool on the system path.\n *\n * @returns Promise the paths of the tool\n */\nfunction findInPath(tool) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!tool) {\n throw new Error(\"parameter 'tool' is required\");\n }\n // build the list of extensions to try\n const extensions = [];\n if (ioUtil.IS_WINDOWS && process.env['PATHEXT']) {\n for (const extension of process.env['PATHEXT'].split(path.delimiter)) {\n if (extension) {\n extensions.push(extension);\n }\n }\n }\n // if it's rooted, return it if exists. otherwise return empty.\n if (ioUtil.isRooted(tool)) {\n const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);\n if (filePath) {\n return [filePath];\n }\n return [];\n }\n // if any path separators, return empty\n if (tool.includes(path.sep)) {\n return [];\n }\n // build the list of directories\n //\n // Note, technically \"where\" checks the current directory on Windows. From a toolkit perspective,\n // it feels like we should not do this. Checking the current directory seems like more of a use\n // case of a shell, and the which() function exposed by the toolkit should strive for consistency\n // across platforms.\n const directories = [];\n if (process.env.PATH) {\n for (const p of process.env.PATH.split(path.delimiter)) {\n if (p) {\n directories.push(p);\n }\n }\n }\n // find all matches\n const matches = [];\n for (const directory of directories) {\n const filePath = yield ioUtil.tryGetExecutablePath(path.join(directory, tool), extensions);\n if (filePath) {\n matches.push(filePath);\n }\n }\n return matches;\n });\n}\nexports.findInPath = findInPath;\nfunction readCopyOptions(options) {\n const force = options.force == null ? true : options.force;\n const recursive = Boolean(options.recursive);\n const copySourceDirectory = options.copySourceDirectory == null\n ? true\n : Boolean(options.copySourceDirectory);\n return { force, recursive, copySourceDirectory };\n}\nfunction cpDirRecursive(sourceDir, destDir, currentDepth, force) {\n return __awaiter(this, void 0, void 0, function* () {\n // Ensure there is not a run away recursive copy\n if (currentDepth >= 255)\n return;\n currentDepth++;\n yield mkdirP(destDir);\n const files = yield ioUtil.readdir(sourceDir);\n for (const fileName of files) {\n const srcFile = `${sourceDir}/${fileName}`;\n const destFile = `${destDir}/${fileName}`;\n const srcFileStat = yield ioUtil.lstat(srcFile);\n if (srcFileStat.isDirectory()) {\n // Recurse\n yield cpDirRecursive(srcFile, destFile, currentDepth, force);\n }\n else {\n yield copyFile(srcFile, destFile, force);\n }\n }\n // Change the mode for the newly created directory\n yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode);\n });\n}\n// Buffered file copy\nfunction copyFile(srcFile, destFile, force) {\n return __awaiter(this, void 0, void 0, function* () {\n if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) {\n // unlink/re-link it\n try {\n yield ioUtil.lstat(destFile);\n yield ioUtil.unlink(destFile);\n }\n catch (e) {\n // Try to override file permission\n if (e.code === 'EPERM') {\n yield ioUtil.chmod(destFile, '0666');\n yield ioUtil.unlink(destFile);\n }\n // other errors = it doesn't exist, no work to do\n }\n // Copy over symlink\n const symlinkFull = yield ioUtil.readlink(srcFile);\n yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null);\n }\n else if (!(yield ioUtil.exists(destFile)) || force) {\n yield ioUtil.copyFile(srcFile, destFile);\n }\n });\n}\n//# sourceMappingURL=io.js.map","const fetchNode = require('./node-ponyfill')\n\nif (!global.fetch) {\n const fetch = fetchNode.fetch.bind({})\n\n global.fetch = fetch\n global.fetch.polyfill = true\n global.Response = fetchNode.Response\n global.Headers = fetchNode.Headers\n global.Request = fetchNode.Request\n}\n","const nodeFetch = require('node-fetch')\nconst realFetch = nodeFetch.default || nodeFetch\n\nconst fetch = function (url, options) {\n // Support schemaless URIs on the server for parity with the browser.\n // Ex: //github.com/ -> https://github.com/\n if (/^\\/\\//.test(url)) {\n url = 'https:' + url\n }\n return realFetch.call(this, url, options)\n}\n\nfetch.ponyfill = true\n\nmodule.exports = exports = fetch\nexports.fetch = fetch\nexports.Headers = nodeFetch.Headers\nexports.Request = nodeFetch.Request\nexports.Response = nodeFetch.Response\n\n// Needed for TypeScript consumers without esModuleInterop.\nexports.default = fetch\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }\n\nvar Stream = _interopDefault(require('stream'));\nvar http = _interopDefault(require('http'));\nvar Url = _interopDefault(require('url'));\nvar whatwgUrl = _interopDefault(require('whatwg-url'));\nvar https = _interopDefault(require('https'));\nvar zlib = _interopDefault(require('zlib'));\n\n// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js\n\n// fix for \"Readable\" isn't a named export issue\nconst Readable = Stream.Readable;\n\nconst BUFFER = Symbol('buffer');\nconst TYPE = Symbol('type');\n\nclass Blob {\n\tconstructor() {\n\t\tthis[TYPE] = '';\n\n\t\tconst blobParts = arguments[0];\n\t\tconst options = arguments[1];\n\n\t\tconst buffers = [];\n\t\tlet size = 0;\n\n\t\tif (blobParts) {\n\t\t\tconst a = blobParts;\n\t\t\tconst length = Number(a.length);\n\t\t\tfor (let i = 0; i < length; i++) {\n\t\t\t\tconst element = a[i];\n\t\t\t\tlet buffer;\n\t\t\t\tif (element instanceof Buffer) {\n\t\t\t\t\tbuffer = element;\n\t\t\t\t} else if (ArrayBuffer.isView(element)) {\n\t\t\t\t\tbuffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);\n\t\t\t\t} else if (element instanceof ArrayBuffer) {\n\t\t\t\t\tbuffer = Buffer.from(element);\n\t\t\t\t} else if (element instanceof Blob) {\n\t\t\t\t\tbuffer = element[BUFFER];\n\t\t\t\t} else {\n\t\t\t\t\tbuffer = Buffer.from(typeof element === 'string' ? element : String(element));\n\t\t\t\t}\n\t\t\t\tsize += buffer.length;\n\t\t\t\tbuffers.push(buffer);\n\t\t\t}\n\t\t}\n\n\t\tthis[BUFFER] = Buffer.concat(buffers);\n\n\t\tlet type = options && options.type !== undefined && String(options.type).toLowerCase();\n\t\tif (type && !/[^\\u0020-\\u007E]/.test(type)) {\n\t\t\tthis[TYPE] = type;\n\t\t}\n\t}\n\tget size() {\n\t\treturn this[BUFFER].length;\n\t}\n\tget type() {\n\t\treturn this[TYPE];\n\t}\n\ttext() {\n\t\treturn Promise.resolve(this[BUFFER].toString());\n\t}\n\tarrayBuffer() {\n\t\tconst buf = this[BUFFER];\n\t\tconst ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\treturn Promise.resolve(ab);\n\t}\n\tstream() {\n\t\tconst readable = new Readable();\n\t\treadable._read = function () {};\n\t\treadable.push(this[BUFFER]);\n\t\treadable.push(null);\n\t\treturn readable;\n\t}\n\ttoString() {\n\t\treturn '[object Blob]';\n\t}\n\tslice() {\n\t\tconst size = this.size;\n\n\t\tconst start = arguments[0];\n\t\tconst end = arguments[1];\n\t\tlet relativeStart, relativeEnd;\n\t\tif (start === undefined) {\n\t\t\trelativeStart = 0;\n\t\t} else if (start < 0) {\n\t\t\trelativeStart = Math.max(size + start, 0);\n\t\t} else {\n\t\t\trelativeStart = Math.min(start, size);\n\t\t}\n\t\tif (end === undefined) {\n\t\t\trelativeEnd = size;\n\t\t} else if (end < 0) {\n\t\t\trelativeEnd = Math.max(size + end, 0);\n\t\t} else {\n\t\t\trelativeEnd = Math.min(end, size);\n\t\t}\n\t\tconst span = Math.max(relativeEnd - relativeStart, 0);\n\n\t\tconst buffer = this[BUFFER];\n\t\tconst slicedBuffer = buffer.slice(relativeStart, relativeStart + span);\n\t\tconst blob = new Blob([], { type: arguments[2] });\n\t\tblob[BUFFER] = slicedBuffer;\n\t\treturn blob;\n\t}\n}\n\nObject.defineProperties(Blob.prototype, {\n\tsize: { enumerable: true },\n\ttype: { enumerable: true },\n\tslice: { enumerable: true }\n});\n\nObject.defineProperty(Blob.prototype, Symbol.toStringTag, {\n\tvalue: 'Blob',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\n/**\n * fetch-error.js\n *\n * FetchError interface for operational errors\n */\n\n/**\n * Create FetchError instance\n *\n * @param String message Error message for human\n * @param String type Error type for machine\n * @param String systemError For Node.js system error\n * @return FetchError\n */\nfunction FetchError(message, type, systemError) {\n Error.call(this, message);\n\n this.message = message;\n this.type = type;\n\n // when err.type is `system`, err.code contains system error code\n if (systemError) {\n this.code = this.errno = systemError.code;\n }\n\n // hide custom error implementation details from end-users\n Error.captureStackTrace(this, this.constructor);\n}\n\nFetchError.prototype = Object.create(Error.prototype);\nFetchError.prototype.constructor = FetchError;\nFetchError.prototype.name = 'FetchError';\n\nlet convert;\ntry {\n\tconvert = require('encoding').convert;\n} catch (e) {}\n\nconst INTERNALS = Symbol('Body internals');\n\n// fix an issue where \"PassThrough\" isn't a named export for node <10\nconst PassThrough = Stream.PassThrough;\n\n/**\n * Body mixin\n *\n * Ref: https://fetch.spec.whatwg.org/#body\n *\n * @param Stream body Readable stream\n * @param Object opts Response options\n * @return Void\n */\nfunction Body(body) {\n\tvar _this = this;\n\n\tvar _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n\t _ref$size = _ref.size;\n\n\tlet size = _ref$size === undefined ? 0 : _ref$size;\n\tvar _ref$timeout = _ref.timeout;\n\tlet timeout = _ref$timeout === undefined ? 0 : _ref$timeout;\n\n\tif (body == null) {\n\t\t// body is undefined or null\n\t\tbody = null;\n\t} else if (isURLSearchParams(body)) {\n\t\t// body is a URLSearchParams\n\t\tbody = Buffer.from(body.toString());\n\t} else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {\n\t\t// body is ArrayBuffer\n\t\tbody = Buffer.from(body);\n\t} else if (ArrayBuffer.isView(body)) {\n\t\t// body is ArrayBufferView\n\t\tbody = Buffer.from(body.buffer, body.byteOffset, body.byteLength);\n\t} else if (body instanceof Stream) ; else {\n\t\t// none of the above\n\t\t// coerce to string then buffer\n\t\tbody = Buffer.from(String(body));\n\t}\n\tthis[INTERNALS] = {\n\t\tbody,\n\t\tdisturbed: false,\n\t\terror: null\n\t};\n\tthis.size = size;\n\tthis.timeout = timeout;\n\n\tif (body instanceof Stream) {\n\t\tbody.on('error', function (err) {\n\t\t\tconst error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);\n\t\t\t_this[INTERNALS].error = error;\n\t\t});\n\t}\n}\n\nBody.prototype = {\n\tget body() {\n\t\treturn this[INTERNALS].body;\n\t},\n\n\tget bodyUsed() {\n\t\treturn this[INTERNALS].disturbed;\n\t},\n\n\t/**\n * Decode response as ArrayBuffer\n *\n * @return Promise\n */\n\tarrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t},\n\n\t/**\n * Return raw response as Blob\n *\n * @return Promise\n */\n\tblob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t},\n\n\t/**\n * Decode response as json\n *\n * @return Promise\n */\n\tjson() {\n\t\tvar _this2 = this;\n\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\ttry {\n\t\t\t\treturn JSON.parse(buffer.toString());\n\t\t\t} catch (err) {\n\t\t\t\treturn Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));\n\t\t\t}\n\t\t});\n\t},\n\n\t/**\n * Decode response as text\n *\n * @return Promise\n */\n\ttext() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t},\n\n\t/**\n * Decode response as buffer (non-spec api)\n *\n * @return Promise\n */\n\tbuffer() {\n\t\treturn consumeBody.call(this);\n\t},\n\n\t/**\n * Decode response as text, while automatically detecting the encoding and\n * trying to decode to UTF-8 (non-spec api)\n *\n * @return Promise\n */\n\ttextConverted() {\n\t\tvar _this3 = this;\n\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn convertBody(buffer, _this3.headers);\n\t\t});\n\t}\n};\n\n// In browsers, all properties are enumerable.\nObject.defineProperties(Body.prototype, {\n\tbody: { enumerable: true },\n\tbodyUsed: { enumerable: true },\n\tarrayBuffer: { enumerable: true },\n\tblob: { enumerable: true },\n\tjson: { enumerable: true },\n\ttext: { enumerable: true }\n});\n\nBody.mixIn = function (proto) {\n\tfor (const name of Object.getOwnPropertyNames(Body.prototype)) {\n\t\t// istanbul ignore else: future proof\n\t\tif (!(name in proto)) {\n\t\t\tconst desc = Object.getOwnPropertyDescriptor(Body.prototype, name);\n\t\t\tObject.defineProperty(proto, name, desc);\n\t\t}\n\t}\n};\n\n/**\n * Consume and convert an entire Body to a Buffer.\n *\n * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body\n *\n * @return Promise\n */\nfunction consumeBody() {\n\tvar _this4 = this;\n\n\tif (this[INTERNALS].disturbed) {\n\t\treturn Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));\n\t}\n\n\tthis[INTERNALS].disturbed = true;\n\n\tif (this[INTERNALS].error) {\n\t\treturn Body.Promise.reject(this[INTERNALS].error);\n\t}\n\n\tlet body = this.body;\n\n\t// body is null\n\tif (body === null) {\n\t\treturn Body.Promise.resolve(Buffer.alloc(0));\n\t}\n\n\t// body is blob\n\tif (isBlob(body)) {\n\t\tbody = body.stream();\n\t}\n\n\t// body is buffer\n\tif (Buffer.isBuffer(body)) {\n\t\treturn Body.Promise.resolve(body);\n\t}\n\n\t// istanbul ignore if: should never happen\n\tif (!(body instanceof Stream)) {\n\t\treturn Body.Promise.resolve(Buffer.alloc(0));\n\t}\n\n\t// body is stream\n\t// get ready to actually consume the body\n\tlet accum = [];\n\tlet accumBytes = 0;\n\tlet abort = false;\n\n\treturn new Body.Promise(function (resolve, reject) {\n\t\tlet resTimeout;\n\n\t\t// allow timeout on slow response body\n\t\tif (_this4.timeout) {\n\t\t\tresTimeout = setTimeout(function () {\n\t\t\t\tabort = true;\n\t\t\t\treject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));\n\t\t\t}, _this4.timeout);\n\t\t}\n\n\t\t// handle stream errors\n\t\tbody.on('error', function (err) {\n\t\t\tif (err.name === 'AbortError') {\n\t\t\t\t// if the request was aborted, reject with this Error\n\t\t\t\tabort = true;\n\t\t\t\treject(err);\n\t\t\t} else {\n\t\t\t\t// other errors, such as incorrect content-encoding\n\t\t\t\treject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));\n\t\t\t}\n\t\t});\n\n\t\tbody.on('data', function (chunk) {\n\t\t\tif (abort || chunk === null) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (_this4.size && accumBytes + chunk.length > _this4.size) {\n\t\t\t\tabort = true;\n\t\t\t\treject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\taccumBytes += chunk.length;\n\t\t\taccum.push(chunk);\n\t\t});\n\n\t\tbody.on('end', function () {\n\t\t\tif (abort) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tclearTimeout(resTimeout);\n\n\t\t\ttry {\n\t\t\t\tresolve(Buffer.concat(accum, accumBytes));\n\t\t\t} catch (err) {\n\t\t\t\t// handle streams that have accumulated too much data (issue #414)\n\t\t\t\treject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));\n\t\t\t}\n\t\t});\n\t});\n}\n\n/**\n * Detect buffer encoding and convert to target encoding\n * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding\n *\n * @param Buffer buffer Incoming buffer\n * @param String encoding Target encoding\n * @return String\n */\nfunction convertBody(buffer, headers) {\n\tif (typeof convert !== 'function') {\n\t\tthrow new Error('The package `encoding` must be installed to use the textConverted() function');\n\t}\n\n\tconst ct = headers.get('content-type');\n\tlet charset = 'utf-8';\n\tlet res, str;\n\n\t// header\n\tif (ct) {\n\t\tres = /charset=([^;]*)/i.exec(ct);\n\t}\n\n\t// no charset in content type, peek at response body for at most 1024 bytes\n\tstr = buffer.slice(0, 1024).toString();\n\n\t// html5\n\tif (!res && str) {\n\t\tres = / 0 && arguments[0] !== undefined ? arguments[0] : undefined;\n\n\t\tthis[MAP] = Object.create(null);\n\n\t\tif (init instanceof Headers) {\n\t\t\tconst rawHeaders = init.raw();\n\t\t\tconst headerNames = Object.keys(rawHeaders);\n\n\t\t\tfor (const headerName of headerNames) {\n\t\t\t\tfor (const value of rawHeaders[headerName]) {\n\t\t\t\t\tthis.append(headerName, value);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\t// We don't worry about converting prop to ByteString here as append()\n\t\t// will handle it.\n\t\tif (init == null) ; else if (typeof init === 'object') {\n\t\t\tconst method = init[Symbol.iterator];\n\t\t\tif (method != null) {\n\t\t\t\tif (typeof method !== 'function') {\n\t\t\t\t\tthrow new TypeError('Header pairs must be iterable');\n\t\t\t\t}\n\n\t\t\t\t// sequence>\n\t\t\t\t// Note: per spec we have to first exhaust the lists then process them\n\t\t\t\tconst pairs = [];\n\t\t\t\tfor (const pair of init) {\n\t\t\t\t\tif (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {\n\t\t\t\t\t\tthrow new TypeError('Each header pair must be iterable');\n\t\t\t\t\t}\n\t\t\t\t\tpairs.push(Array.from(pair));\n\t\t\t\t}\n\n\t\t\t\tfor (const pair of pairs) {\n\t\t\t\t\tif (pair.length !== 2) {\n\t\t\t\t\t\tthrow new TypeError('Each header pair must be a name/value tuple');\n\t\t\t\t\t}\n\t\t\t\t\tthis.append(pair[0], pair[1]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// record\n\t\t\t\tfor (const key of Object.keys(init)) {\n\t\t\t\t\tconst value = init[key];\n\t\t\t\t\tthis.append(key, value);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new TypeError('Provided initializer must be an object');\n\t\t}\n\t}\n\n\t/**\n * Return combined header value given name\n *\n * @param String name Header name\n * @return Mixed\n */\n\tget(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\tconst key = find(this[MAP], name);\n\t\tif (key === undefined) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this[MAP][key].join(', ');\n\t}\n\n\t/**\n * Iterate over all headers\n *\n * @param Function callback Executed for each item with parameters (value, name, thisArg)\n * @param Boolean thisArg `this` context for callback function\n * @return Void\n */\n\tforEach(callback) {\n\t\tlet thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;\n\n\t\tlet pairs = getHeaders(this);\n\t\tlet i = 0;\n\t\twhile (i < pairs.length) {\n\t\t\tvar _pairs$i = pairs[i];\n\t\t\tconst name = _pairs$i[0],\n\t\t\t value = _pairs$i[1];\n\n\t\t\tcallback.call(thisArg, value, name, this);\n\t\t\tpairs = getHeaders(this);\n\t\t\ti++;\n\t\t}\n\t}\n\n\t/**\n * Overwrite header values given name\n *\n * @param String name Header name\n * @param String value Header value\n * @return Void\n */\n\tset(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}\n\n\t/**\n * Append a value onto existing header\n *\n * @param String name Header name\n * @param String value Header value\n * @return Void\n */\n\tappend(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tif (key !== undefined) {\n\t\t\tthis[MAP][key].push(value);\n\t\t} else {\n\t\t\tthis[MAP][name] = [value];\n\t\t}\n\t}\n\n\t/**\n * Check for header name existence\n *\n * @param String name Header name\n * @return Boolean\n */\n\thas(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\treturn find(this[MAP], name) !== undefined;\n\t}\n\n\t/**\n * Delete all header values given name\n *\n * @param String name Header name\n * @return Void\n */\n\tdelete(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\tconst key = find(this[MAP], name);\n\t\tif (key !== undefined) {\n\t\t\tdelete this[MAP][key];\n\t\t}\n\t}\n\n\t/**\n * Return raw headers (non-spec api)\n *\n * @return Object\n */\n\traw() {\n\t\treturn this[MAP];\n\t}\n\n\t/**\n * Get an iterator on keys.\n *\n * @return Iterator\n */\n\tkeys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}\n\n\t/**\n * Get an iterator on values.\n *\n * @return Iterator\n */\n\tvalues() {\n\t\treturn createHeadersIterator(this, 'value');\n\t}\n\n\t/**\n * Get an iterator on entries.\n *\n * This is the default iterator of the Headers object.\n *\n * @return Iterator\n */\n\t[Symbol.iterator]() {\n\t\treturn createHeadersIterator(this, 'key+value');\n\t}\n}\nHeaders.prototype.entries = Headers.prototype[Symbol.iterator];\n\nObject.defineProperty(Headers.prototype, Symbol.toStringTag, {\n\tvalue: 'Headers',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\nObject.defineProperties(Headers.prototype, {\n\tget: { enumerable: true },\n\tforEach: { enumerable: true },\n\tset: { enumerable: true },\n\tappend: { enumerable: true },\n\thas: { enumerable: true },\n\tdelete: { enumerable: true },\n\tkeys: { enumerable: true },\n\tvalues: { enumerable: true },\n\tentries: { enumerable: true }\n});\n\nfunction getHeaders(headers) {\n\tlet kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';\n\n\tconst keys = Object.keys(headers[MAP]).sort();\n\treturn keys.map(kind === 'key' ? function (k) {\n\t\treturn k.toLowerCase();\n\t} : kind === 'value' ? function (k) {\n\t\treturn headers[MAP][k].join(', ');\n\t} : function (k) {\n\t\treturn [k.toLowerCase(), headers[MAP][k].join(', ')];\n\t});\n}\n\nconst INTERNAL = Symbol('internal');\n\nfunction createHeadersIterator(target, kind) {\n\tconst iterator = Object.create(HeadersIteratorPrototype);\n\titerator[INTERNAL] = {\n\t\ttarget,\n\t\tkind,\n\t\tindex: 0\n\t};\n\treturn iterator;\n}\n\nconst HeadersIteratorPrototype = Object.setPrototypeOf({\n\tnext() {\n\t\t// istanbul ignore if\n\t\tif (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {\n\t\t\tthrow new TypeError('Value of `this` is not a HeadersIterator');\n\t\t}\n\n\t\tvar _INTERNAL = this[INTERNAL];\n\t\tconst target = _INTERNAL.target,\n\t\t kind = _INTERNAL.kind,\n\t\t index = _INTERNAL.index;\n\n\t\tconst values = getHeaders(target, kind);\n\t\tconst len = values.length;\n\t\tif (index >= len) {\n\t\t\treturn {\n\t\t\t\tvalue: undefined,\n\t\t\t\tdone: true\n\t\t\t};\n\t\t}\n\n\t\tthis[INTERNAL].index = index + 1;\n\n\t\treturn {\n\t\t\tvalue: values[index],\n\t\t\tdone: false\n\t\t};\n\t}\n}, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));\n\nObject.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {\n\tvalue: 'HeadersIterator',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\n/**\n * Export the Headers object in a form that Node.js can consume.\n *\n * @param Headers headers\n * @return Object\n */\nfunction exportNodeCompatibleHeaders(headers) {\n\tconst obj = Object.assign({ __proto__: null }, headers[MAP]);\n\n\t// http.request() only supports string as Host header. This hack makes\n\t// specifying custom Host header possible.\n\tconst hostHeaderKey = find(headers[MAP], 'Host');\n\tif (hostHeaderKey !== undefined) {\n\t\tobj[hostHeaderKey] = obj[hostHeaderKey][0];\n\t}\n\n\treturn obj;\n}\n\n/**\n * Create a Headers object from an object of headers, ignoring those that do\n * not conform to HTTP grammar productions.\n *\n * @param Object obj Object of headers\n * @return Headers\n */\nfunction createHeadersLenient(obj) {\n\tconst headers = new Headers();\n\tfor (const name of Object.keys(obj)) {\n\t\tif (invalidTokenRegex.test(name)) {\n\t\t\tcontinue;\n\t\t}\n\t\tif (Array.isArray(obj[name])) {\n\t\t\tfor (const val of obj[name]) {\n\t\t\t\tif (invalidHeaderCharRegex.test(val)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (headers[MAP][name] === undefined) {\n\t\t\t\t\theaders[MAP][name] = [val];\n\t\t\t\t} else {\n\t\t\t\t\theaders[MAP][name].push(val);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (!invalidHeaderCharRegex.test(obj[name])) {\n\t\t\theaders[MAP][name] = [obj[name]];\n\t\t}\n\t}\n\treturn headers;\n}\n\nconst INTERNALS$1 = Symbol('Response internals');\n\n// fix an issue where \"STATUS_CODES\" aren't a named export for node <10\nconst STATUS_CODES = http.STATUS_CODES;\n\n/**\n * Response class\n *\n * @param Stream body Readable stream\n * @param Object opts Response options\n * @return Void\n */\nclass Response {\n\tconstructor() {\n\t\tlet body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n\t\tlet opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n\t\tBody.call(this, body, opts);\n\n\t\tconst status = opts.status || 200;\n\t\tconst headers = new Headers(opts.headers);\n\n\t\tif (body != null && !headers.has('Content-Type')) {\n\t\t\tconst contentType = extractContentType(body);\n\t\t\tif (contentType) {\n\t\t\t\theaders.append('Content-Type', contentType);\n\t\t\t}\n\t\t}\n\n\t\tthis[INTERNALS$1] = {\n\t\t\turl: opts.url,\n\t\t\tstatus,\n\t\t\tstatusText: opts.statusText || STATUS_CODES[status],\n\t\t\theaders,\n\t\t\tcounter: opts.counter\n\t\t};\n\t}\n\n\tget url() {\n\t\treturn this[INTERNALS$1].url || '';\n\t}\n\n\tget status() {\n\t\treturn this[INTERNALS$1].status;\n\t}\n\n\t/**\n * Convenience property representing if the request ended normally\n */\n\tget ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}\n\n\tget redirected() {\n\t\treturn this[INTERNALS$1].counter > 0;\n\t}\n\n\tget statusText() {\n\t\treturn this[INTERNALS$1].statusText;\n\t}\n\n\tget headers() {\n\t\treturn this[INTERNALS$1].headers;\n\t}\n\n\t/**\n * Clone this response\n *\n * @return Response\n */\n\tclone() {\n\t\treturn new Response(clone(this), {\n\t\t\turl: this.url,\n\t\t\tstatus: this.status,\n\t\t\tstatusText: this.statusText,\n\t\t\theaders: this.headers,\n\t\t\tok: this.ok,\n\t\t\tredirected: this.redirected\n\t\t});\n\t}\n}\n\nBody.mixIn(Response.prototype);\n\nObject.defineProperties(Response.prototype, {\n\turl: { enumerable: true },\n\tstatus: { enumerable: true },\n\tok: { enumerable: true },\n\tredirected: { enumerable: true },\n\tstatusText: { enumerable: true },\n\theaders: { enumerable: true },\n\tclone: { enumerable: true }\n});\n\nObject.defineProperty(Response.prototype, Symbol.toStringTag, {\n\tvalue: 'Response',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\nconst INTERNALS$2 = Symbol('Request internals');\nconst URL = Url.URL || whatwgUrl.URL;\n\n// fix an issue where \"format\", \"parse\" aren't a named export for node <10\nconst parse_url = Url.parse;\nconst format_url = Url.format;\n\n/**\n * Wrapper around `new URL` to handle arbitrary URLs\n *\n * @param {string} urlStr\n * @return {void}\n */\nfunction parseURL(urlStr) {\n\t/*\n \tCheck whether the URL is absolute or not\n \t\tScheme: https://tools.ietf.org/html/rfc3986#section-3.1\n \tAbsolute URL: https://tools.ietf.org/html/rfc3986#section-4.3\n */\n\tif (/^[a-zA-Z][a-zA-Z\\d+\\-.]*:/.exec(urlStr)) {\n\t\turlStr = new URL(urlStr).toString();\n\t}\n\n\t// Fallback to old implementation for arbitrary URLs\n\treturn parse_url(urlStr);\n}\n\nconst streamDestructionSupported = 'destroy' in Stream.Readable.prototype;\n\n/**\n * Check if a value is an instance of Request.\n *\n * @param Mixed input\n * @return Boolean\n */\nfunction isRequest(input) {\n\treturn typeof input === 'object' && typeof input[INTERNALS$2] === 'object';\n}\n\nfunction isAbortSignal(signal) {\n\tconst proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);\n\treturn !!(proto && proto.constructor.name === 'AbortSignal');\n}\n\n/**\n * Request class\n *\n * @param Mixed input Url or Request instance\n * @param Object init Custom options\n * @return Void\n */\nclass Request {\n\tconstructor(input) {\n\t\tlet init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n\t\tlet parsedURL;\n\n\t\t// normalize input\n\t\tif (!isRequest(input)) {\n\t\t\tif (input && input.href) {\n\t\t\t\t// in order to support Node.js' Url objects; though WHATWG's URL objects\n\t\t\t\t// will fall into this branch also (since their `toString()` will return\n\t\t\t\t// `href` property anyway)\n\t\t\t\tparsedURL = parseURL(input.href);\n\t\t\t} else {\n\t\t\t\t// coerce input to a string before attempting to parse\n\t\t\t\tparsedURL = parseURL(`${input}`);\n\t\t\t}\n\t\t\tinput = {};\n\t\t} else {\n\t\t\tparsedURL = parseURL(input.url);\n\t\t}\n\n\t\tlet method = init.method || input.method || 'GET';\n\t\tmethod = method.toUpperCase();\n\n\t\tif ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {\n\t\t\tthrow new TypeError('Request with GET/HEAD method cannot have body');\n\t\t}\n\n\t\tlet inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;\n\n\t\tBody.call(this, inputBody, {\n\t\t\ttimeout: init.timeout || input.timeout || 0,\n\t\t\tsize: init.size || input.size || 0\n\t\t});\n\n\t\tconst headers = new Headers(init.headers || input.headers || {});\n\n\t\tif (inputBody != null && !headers.has('Content-Type')) {\n\t\t\tconst contentType = extractContentType(inputBody);\n\t\t\tif (contentType) {\n\t\t\t\theaders.append('Content-Type', contentType);\n\t\t\t}\n\t\t}\n\n\t\tlet signal = isRequest(input) ? input.signal : null;\n\t\tif ('signal' in init) signal = init.signal;\n\n\t\tif (signal != null && !isAbortSignal(signal)) {\n\t\t\tthrow new TypeError('Expected signal to be an instanceof AbortSignal');\n\t\t}\n\n\t\tthis[INTERNALS$2] = {\n\t\t\tmethod,\n\t\t\tredirect: init.redirect || input.redirect || 'follow',\n\t\t\theaders,\n\t\t\tparsedURL,\n\t\t\tsignal\n\t\t};\n\n\t\t// node-fetch-only options\n\t\tthis.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;\n\t\tthis.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;\n\t\tthis.counter = init.counter || input.counter || 0;\n\t\tthis.agent = init.agent || input.agent;\n\t}\n\n\tget method() {\n\t\treturn this[INTERNALS$2].method;\n\t}\n\n\tget url() {\n\t\treturn format_url(this[INTERNALS$2].parsedURL);\n\t}\n\n\tget headers() {\n\t\treturn this[INTERNALS$2].headers;\n\t}\n\n\tget redirect() {\n\t\treturn this[INTERNALS$2].redirect;\n\t}\n\n\tget signal() {\n\t\treturn this[INTERNALS$2].signal;\n\t}\n\n\t/**\n * Clone this request\n *\n * @return Request\n */\n\tclone() {\n\t\treturn new Request(this);\n\t}\n}\n\nBody.mixIn(Request.prototype);\n\nObject.defineProperty(Request.prototype, Symbol.toStringTag, {\n\tvalue: 'Request',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\nObject.defineProperties(Request.prototype, {\n\tmethod: { enumerable: true },\n\turl: { enumerable: true },\n\theaders: { enumerable: true },\n\tredirect: { enumerable: true },\n\tclone: { enumerable: true },\n\tsignal: { enumerable: true }\n});\n\n/**\n * Convert a Request to Node.js http request options.\n *\n * @param Request A Request instance\n * @return Object The options object to be passed to http.request\n */\nfunction getNodeRequestOptions(request) {\n\tconst parsedURL = request[INTERNALS$2].parsedURL;\n\tconst headers = new Headers(request[INTERNALS$2].headers);\n\n\t// fetch step 1.3\n\tif (!headers.has('Accept')) {\n\t\theaders.set('Accept', '*/*');\n\t}\n\n\t// Basic fetch\n\tif (!parsedURL.protocol || !parsedURL.hostname) {\n\t\tthrow new TypeError('Only absolute URLs are supported');\n\t}\n\n\tif (!/^https?:$/.test(parsedURL.protocol)) {\n\t\tthrow new TypeError('Only HTTP(S) protocols are supported');\n\t}\n\n\tif (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {\n\t\tthrow new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');\n\t}\n\n\t// HTTP-network-or-cache fetch steps 2.4-2.7\n\tlet contentLengthValue = null;\n\tif (request.body == null && /^(POST|PUT)$/i.test(request.method)) {\n\t\tcontentLengthValue = '0';\n\t}\n\tif (request.body != null) {\n\t\tconst totalBytes = getTotalBytes(request);\n\t\tif (typeof totalBytes === 'number') {\n\t\t\tcontentLengthValue = String(totalBytes);\n\t\t}\n\t}\n\tif (contentLengthValue) {\n\t\theaders.set('Content-Length', contentLengthValue);\n\t}\n\n\t// HTTP-network-or-cache fetch step 2.11\n\tif (!headers.has('User-Agent')) {\n\t\theaders.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');\n\t}\n\n\t// HTTP-network-or-cache fetch step 2.15\n\tif (request.compress && !headers.has('Accept-Encoding')) {\n\t\theaders.set('Accept-Encoding', 'gzip,deflate');\n\t}\n\n\tlet agent = request.agent;\n\tif (typeof agent === 'function') {\n\t\tagent = agent(parsedURL);\n\t}\n\n\tif (!headers.has('Connection') && !agent) {\n\t\theaders.set('Connection', 'close');\n\t}\n\n\t// HTTP-network fetch step 4.2\n\t// chunked encoding is handled by Node.js\n\n\treturn Object.assign({}, parsedURL, {\n\t\tmethod: request.method,\n\t\theaders: exportNodeCompatibleHeaders(headers),\n\t\tagent\n\t});\n}\n\n/**\n * abort-error.js\n *\n * AbortError interface for cancelled requests\n */\n\n/**\n * Create AbortError instance\n *\n * @param String message Error message for human\n * @return AbortError\n */\nfunction AbortError(message) {\n Error.call(this, message);\n\n this.type = 'aborted';\n this.message = message;\n\n // hide custom error implementation details from end-users\n Error.captureStackTrace(this, this.constructor);\n}\n\nAbortError.prototype = Object.create(Error.prototype);\nAbortError.prototype.constructor = AbortError;\nAbortError.prototype.name = 'AbortError';\n\nconst URL$1 = Url.URL || whatwgUrl.URL;\n\n// fix an issue where \"PassThrough\", \"resolve\" aren't a named export for node <10\nconst PassThrough$1 = Stream.PassThrough;\n\nconst isDomainOrSubdomain = function isDomainOrSubdomain(destination, original) {\n\tconst orig = new URL$1(original).hostname;\n\tconst dest = new URL$1(destination).hostname;\n\n\treturn orig === dest || orig[orig.length - dest.length - 1] === '.' && orig.endsWith(dest);\n};\n\n/**\n * isSameProtocol reports whether the two provided URLs use the same protocol.\n *\n * Both domains must already be in canonical form.\n * @param {string|URL} original\n * @param {string|URL} destination\n */\nconst isSameProtocol = function isSameProtocol(destination, original) {\n\tconst orig = new URL$1(original).protocol;\n\tconst dest = new URL$1(destination).protocol;\n\n\treturn orig === dest;\n};\n\n/**\n * Fetch function\n *\n * @param Mixed url Absolute url or Request instance\n * @param Object opts Fetch options\n * @return Promise\n */\nfunction fetch(url, opts) {\n\n\t// allow custom promise\n\tif (!fetch.Promise) {\n\t\tthrow new Error('native promise missing, set fetch.Promise to your favorite alternative');\n\t}\n\n\tBody.Promise = fetch.Promise;\n\n\t// wrap http.request into fetch\n\treturn new fetch.Promise(function (resolve, reject) {\n\t\t// build request object\n\t\tconst request = new Request(url, opts);\n\t\tconst options = getNodeRequestOptions(request);\n\n\t\tconst send = (options.protocol === 'https:' ? https : http).request;\n\t\tconst signal = request.signal;\n\n\t\tlet response = null;\n\n\t\tconst abort = function abort() {\n\t\t\tlet error = new AbortError('The user aborted a request.');\n\t\t\treject(error);\n\t\t\tif (request.body && request.body instanceof Stream.Readable) {\n\t\t\t\tdestroyStream(request.body, error);\n\t\t\t}\n\t\t\tif (!response || !response.body) return;\n\t\t\tresponse.body.emit('error', error);\n\t\t};\n\n\t\tif (signal && signal.aborted) {\n\t\t\tabort();\n\t\t\treturn;\n\t\t}\n\n\t\tconst abortAndFinalize = function abortAndFinalize() {\n\t\t\tabort();\n\t\t\tfinalize();\n\t\t};\n\n\t\t// send request\n\t\tconst req = send(options);\n\t\tlet reqTimeout;\n\n\t\tif (signal) {\n\t\t\tsignal.addEventListener('abort', abortAndFinalize);\n\t\t}\n\n\t\tfunction finalize() {\n\t\t\treq.abort();\n\t\t\tif (signal) signal.removeEventListener('abort', abortAndFinalize);\n\t\t\tclearTimeout(reqTimeout);\n\t\t}\n\n\t\tif (request.timeout) {\n\t\t\treq.once('socket', function (socket) {\n\t\t\t\treqTimeout = setTimeout(function () {\n\t\t\t\t\treject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));\n\t\t\t\t\tfinalize();\n\t\t\t\t}, request.timeout);\n\t\t\t});\n\t\t}\n\n\t\treq.on('error', function (err) {\n\t\t\treject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));\n\n\t\t\tif (response && response.body) {\n\t\t\t\tdestroyStream(response.body, err);\n\t\t\t}\n\n\t\t\tfinalize();\n\t\t});\n\n\t\tfixResponseChunkedTransferBadEnding(req, function (err) {\n\t\t\tif (signal && signal.aborted) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (response && response.body) {\n\t\t\t\tdestroyStream(response.body, err);\n\t\t\t}\n\t\t});\n\n\t\t/* c8 ignore next 18 */\n\t\tif (parseInt(process.version.substring(1)) < 14) {\n\t\t\t// Before Node.js 14, pipeline() does not fully support async iterators and does not always\n\t\t\t// properly handle when the socket close/end events are out of order.\n\t\t\treq.on('socket', function (s) {\n\t\t\t\ts.addListener('close', function (hadError) {\n\t\t\t\t\t// if a data listener is still present we didn't end cleanly\n\t\t\t\t\tconst hasDataListener = s.listenerCount('data') > 0;\n\n\t\t\t\t\t// if end happened before close but the socket didn't emit an error, do it now\n\t\t\t\t\tif (response && hasDataListener && !hadError && !(signal && signal.aborted)) {\n\t\t\t\t\t\tconst err = new Error('Premature close');\n\t\t\t\t\t\terr.code = 'ERR_STREAM_PREMATURE_CLOSE';\n\t\t\t\t\t\tresponse.body.emit('error', err);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\treq.on('response', function (res) {\n\t\t\tclearTimeout(reqTimeout);\n\n\t\t\tconst headers = createHeadersLenient(res.headers);\n\n\t\t\t// HTTP fetch step 5\n\t\t\tif (fetch.isRedirect(res.statusCode)) {\n\t\t\t\t// HTTP fetch step 5.2\n\t\t\t\tconst location = headers.get('Location');\n\n\t\t\t\t// HTTP fetch step 5.3\n\t\t\t\tlet locationURL = null;\n\t\t\t\ttry {\n\t\t\t\t\tlocationURL = location === null ? null : new URL$1(location, request.url).toString();\n\t\t\t\t} catch (err) {\n\t\t\t\t\t// error here can only be invalid URL in Location: header\n\t\t\t\t\t// do not throw when options.redirect == manual\n\t\t\t\t\t// let the user extract the errorneous redirect URL\n\t\t\t\t\tif (request.redirect !== 'manual') {\n\t\t\t\t\t\treject(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, 'invalid-redirect'));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// HTTP fetch step 5.5\n\t\t\t\tswitch (request.redirect) {\n\t\t\t\t\tcase 'error':\n\t\t\t\t\t\treject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect'));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t\tcase 'manual':\n\t\t\t\t\t\t// node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.\n\t\t\t\t\t\tif (locationURL !== null) {\n\t\t\t\t\t\t\t// handle corrupted header\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\theaders.set('Location', locationURL);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\t// istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request\n\t\t\t\t\t\t\t\treject(err);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'follow':\n\t\t\t\t\t\t// HTTP-redirect fetch step 2\n\t\t\t\t\t\tif (locationURL === null) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 5\n\t\t\t\t\t\tif (request.counter >= request.follow) {\n\t\t\t\t\t\t\treject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));\n\t\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 6 (counter increment)\n\t\t\t\t\t\t// Create a new Request object.\n\t\t\t\t\t\tconst requestOpts = {\n\t\t\t\t\t\t\theaders: new Headers(request.headers),\n\t\t\t\t\t\t\tfollow: request.follow,\n\t\t\t\t\t\t\tcounter: request.counter + 1,\n\t\t\t\t\t\t\tagent: request.agent,\n\t\t\t\t\t\t\tcompress: request.compress,\n\t\t\t\t\t\t\tmethod: request.method,\n\t\t\t\t\t\t\tbody: request.body,\n\t\t\t\t\t\t\tsignal: request.signal,\n\t\t\t\t\t\t\ttimeout: request.timeout,\n\t\t\t\t\t\t\tsize: request.size\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tif (!isDomainOrSubdomain(request.url, locationURL) || !isSameProtocol(request.url, locationURL)) {\n\t\t\t\t\t\t\tfor (const name of ['authorization', 'www-authenticate', 'cookie', 'cookie2']) {\n\t\t\t\t\t\t\t\trequestOpts.headers.delete(name);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 9\n\t\t\t\t\t\tif (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {\n\t\t\t\t\t\t\treject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));\n\t\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 11\n\t\t\t\t\t\tif (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {\n\t\t\t\t\t\t\trequestOpts.method = 'GET';\n\t\t\t\t\t\t\trequestOpts.body = undefined;\n\t\t\t\t\t\t\trequestOpts.headers.delete('content-length');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 15\n\t\t\t\t\t\tresolve(fetch(new Request(locationURL, requestOpts)));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// prepare response\n\t\t\tres.once('end', function () {\n\t\t\t\tif (signal) signal.removeEventListener('abort', abortAndFinalize);\n\t\t\t});\n\t\t\tlet body = res.pipe(new PassThrough$1());\n\n\t\t\tconst response_options = {\n\t\t\t\turl: request.url,\n\t\t\t\tstatus: res.statusCode,\n\t\t\t\tstatusText: res.statusMessage,\n\t\t\t\theaders: headers,\n\t\t\t\tsize: request.size,\n\t\t\t\ttimeout: request.timeout,\n\t\t\t\tcounter: request.counter\n\t\t\t};\n\n\t\t\t// HTTP-network fetch step 12.1.1.3\n\t\t\tconst codings = headers.get('Content-Encoding');\n\n\t\t\t// HTTP-network fetch step 12.1.1.4: handle content codings\n\n\t\t\t// in following scenarios we ignore compression support\n\t\t\t// 1. compression support is disabled\n\t\t\t// 2. HEAD request\n\t\t\t// 3. no Content-Encoding header\n\t\t\t// 4. no content response (204)\n\t\t\t// 5. content not modified response (304)\n\t\t\tif (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {\n\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// For Node v6+\n\t\t\t// Be less strict when decoding compressed responses, since sometimes\n\t\t\t// servers send slightly invalid responses that are still accepted\n\t\t\t// by common browsers.\n\t\t\t// Always using Z_SYNC_FLUSH is what cURL does.\n\t\t\tconst zlibOptions = {\n\t\t\t\tflush: zlib.Z_SYNC_FLUSH,\n\t\t\t\tfinishFlush: zlib.Z_SYNC_FLUSH\n\t\t\t};\n\n\t\t\t// for gzip\n\t\t\tif (codings == 'gzip' || codings == 'x-gzip') {\n\t\t\t\tbody = body.pipe(zlib.createGunzip(zlibOptions));\n\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// for deflate\n\t\t\tif (codings == 'deflate' || codings == 'x-deflate') {\n\t\t\t\t// handle the infamous raw deflate response from old servers\n\t\t\t\t// a hack for old IIS and Apache servers\n\t\t\t\tconst raw = res.pipe(new PassThrough$1());\n\t\t\t\traw.once('data', function (chunk) {\n\t\t\t\t\t// see http://stackoverflow.com/questions/37519828\n\t\t\t\t\tif ((chunk[0] & 0x0F) === 0x08) {\n\t\t\t\t\t\tbody = body.pipe(zlib.createInflate());\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbody = body.pipe(zlib.createInflateRaw());\n\t\t\t\t\t}\n\t\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\t\tresolve(response);\n\t\t\t\t});\n\t\t\t\traw.on('end', function () {\n\t\t\t\t\t// some old IIS servers return zero-length OK deflate responses, so 'data' is never emitted.\n\t\t\t\t\tif (!response) {\n\t\t\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\t\t\tresolve(response);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// for br\n\t\t\tif (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {\n\t\t\t\tbody = body.pipe(zlib.createBrotliDecompress());\n\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// otherwise, use response as-is\n\t\t\tresponse = new Response(body, response_options);\n\t\t\tresolve(response);\n\t\t});\n\n\t\twriteToStream(req, request);\n\t});\n}\nfunction fixResponseChunkedTransferBadEnding(request, errorCallback) {\n\tlet socket;\n\n\trequest.on('socket', function (s) {\n\t\tsocket = s;\n\t});\n\n\trequest.on('response', function (response) {\n\t\tconst headers = response.headers;\n\n\t\tif (headers['transfer-encoding'] === 'chunked' && !headers['content-length']) {\n\t\t\tresponse.once('close', function (hadError) {\n\t\t\t\t// tests for socket presence, as in some situations the\n\t\t\t\t// the 'socket' event is not triggered for the request\n\t\t\t\t// (happens in deno), avoids `TypeError`\n\t\t\t\t// if a data listener is still present we didn't end cleanly\n\t\t\t\tconst hasDataListener = socket && socket.listenerCount('data') > 0;\n\n\t\t\t\tif (hasDataListener && !hadError) {\n\t\t\t\t\tconst err = new Error('Premature close');\n\t\t\t\t\terr.code = 'ERR_STREAM_PREMATURE_CLOSE';\n\t\t\t\t\terrorCallback(err);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t});\n}\n\nfunction destroyStream(stream, err) {\n\tif (stream.destroy) {\n\t\tstream.destroy(err);\n\t} else {\n\t\t// node < 8\n\t\tstream.emit('error', err);\n\t\tstream.end();\n\t}\n}\n\n/**\n * Redirect code matching\n *\n * @param Number code Status code\n * @return Boolean\n */\nfetch.isRedirect = function (code) {\n\treturn code === 301 || code === 302 || code === 303 || code === 307 || code === 308;\n};\n\n// expose Promise\nfetch.Promise = global.Promise;\n\nmodule.exports = exports = fetch;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = exports;\nexports.Headers = Headers;\nexports.Request = Request;\nexports.Response = Response;\nexports.FetchError = FetchError;\n","\"use strict\";\n\nvar punycode = require(\"punycode\");\nvar mappingTable = require(\"./lib/mappingTable.json\");\n\nvar PROCESSING_OPTIONS = {\n TRANSITIONAL: 0,\n NONTRANSITIONAL: 1\n};\n\nfunction normalize(str) { // fix bug in v8\n return str.split('\\u0000').map(function (s) { return s.normalize('NFC'); }).join('\\u0000');\n}\n\nfunction findStatus(val) {\n var start = 0;\n var end = mappingTable.length - 1;\n\n while (start <= end) {\n var mid = Math.floor((start + end) / 2);\n\n var target = mappingTable[mid];\n if (target[0][0] <= val && target[0][1] >= val) {\n return target;\n } else if (target[0][0] > val) {\n end = mid - 1;\n } else {\n start = mid + 1;\n }\n }\n\n return null;\n}\n\nvar regexAstralSymbols = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n\nfunction countSymbols(string) {\n return string\n // replace every surrogate pair with a BMP symbol\n .replace(regexAstralSymbols, '_')\n // then get the length\n .length;\n}\n\nfunction mapChars(domain_name, useSTD3, processing_option) {\n var hasError = false;\n var processed = \"\";\n\n var len = countSymbols(domain_name);\n for (var i = 0; i < len; ++i) {\n var codePoint = domain_name.codePointAt(i);\n var status = findStatus(codePoint);\n\n switch (status[1]) {\n case \"disallowed\":\n hasError = true;\n processed += String.fromCodePoint(codePoint);\n break;\n case \"ignored\":\n break;\n case \"mapped\":\n processed += String.fromCodePoint.apply(String, status[2]);\n break;\n case \"deviation\":\n if (processing_option === PROCESSING_OPTIONS.TRANSITIONAL) {\n processed += String.fromCodePoint.apply(String, status[2]);\n } else {\n processed += String.fromCodePoint(codePoint);\n }\n break;\n case \"valid\":\n processed += String.fromCodePoint(codePoint);\n break;\n case \"disallowed_STD3_mapped\":\n if (useSTD3) {\n hasError = true;\n processed += String.fromCodePoint(codePoint);\n } else {\n processed += String.fromCodePoint.apply(String, status[2]);\n }\n break;\n case \"disallowed_STD3_valid\":\n if (useSTD3) {\n hasError = true;\n }\n\n processed += String.fromCodePoint(codePoint);\n break;\n }\n }\n\n return {\n string: processed,\n error: hasError\n };\n}\n\nvar combiningMarksRegex = /[\\u0300-\\u036F\\u0483-\\u0489\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u065F\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07EB-\\u07F3\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u08E4-\\u0903\\u093A-\\u093C\\u093E-\\u094F\\u0951-\\u0957\\u0962\\u0963\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u0A01-\\u0A03\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A70\\u0A71\\u0A75\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AE2\\u0AE3\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B62\\u0B63\\u0B82\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0C00-\\u0C03\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0C81-\\u0C83\\u0CBC\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CE2\\u0CE3\\u0D01-\\u0D03\\u0D3E-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4D\\u0D57\\u0D62\\u0D63\\u0D82\\u0D83\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0EB1\\u0EB4-\\u0EB9\\u0EBB\\u0EBC\\u0EC8-\\u0ECD\\u0F18\\u0F19\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102B-\\u103E\\u1056-\\u1059\\u105E-\\u1060\\u1062-\\u1064\\u1067-\\u106D\\u1071-\\u1074\\u1082-\\u108D\\u108F\\u109A-\\u109D\\u135D-\\u135F\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B4-\\u17D3\\u17DD\\u180B-\\u180D\\u18A9\\u1920-\\u192B\\u1930-\\u193B\\u19B0-\\u19C0\\u19C8\\u19C9\\u1A17-\\u1A1B\\u1A55-\\u1A5E\\u1A60-\\u1A7C\\u1A7F\\u1AB0-\\u1ABE\\u1B00-\\u1B04\\u1B34-\\u1B44\\u1B6B-\\u1B73\\u1B80-\\u1B82\\u1BA1-\\u1BAD\\u1BE6-\\u1BF3\\u1C24-\\u1C37\\u1CD0-\\u1CD2\\u1CD4-\\u1CE8\\u1CED\\u1CF2-\\u1CF4\\u1CF8\\u1CF9\\u1DC0-\\u1DF5\\u1DFC-\\u1DFF\\u20D0-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA66F-\\uA672\\uA674-\\uA67D\\uA69F\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA823-\\uA827\\uA880\\uA881\\uA8B4-\\uA8C4\\uA8E0-\\uA8F1\\uA926-\\uA92D\\uA947-\\uA953\\uA980-\\uA983\\uA9B3-\\uA9C0\\uA9E5\\uAA29-\\uAA36\\uAA43\\uAA4C\\uAA4D\\uAA7B-\\uAA7D\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uAAEB-\\uAAEF\\uAAF5\\uAAF6\\uABE3-\\uABEA\\uABEC\\uABED\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE2D]|\\uD800[\\uDDFD\\uDEE0\\uDF76-\\uDF7A]|\\uD802[\\uDE01-\\uDE03\\uDE05\\uDE06\\uDE0C-\\uDE0F\\uDE38-\\uDE3A\\uDE3F\\uDEE5\\uDEE6]|\\uD804[\\uDC00-\\uDC02\\uDC38-\\uDC46\\uDC7F-\\uDC82\\uDCB0-\\uDCBA\\uDD00-\\uDD02\\uDD27-\\uDD34\\uDD73\\uDD80-\\uDD82\\uDDB3-\\uDDC0\\uDE2C-\\uDE37\\uDEDF-\\uDEEA\\uDF01-\\uDF03\\uDF3C\\uDF3E-\\uDF44\\uDF47\\uDF48\\uDF4B-\\uDF4D\\uDF57\\uDF62\\uDF63\\uDF66-\\uDF6C\\uDF70-\\uDF74]|\\uD805[\\uDCB0-\\uDCC3\\uDDAF-\\uDDB5\\uDDB8-\\uDDC0\\uDE30-\\uDE40\\uDEAB-\\uDEB7]|\\uD81A[\\uDEF0-\\uDEF4\\uDF30-\\uDF36]|\\uD81B[\\uDF51-\\uDF7E\\uDF8F-\\uDF92]|\\uD82F[\\uDC9D\\uDC9E]|\\uD834[\\uDD65-\\uDD69\\uDD6D-\\uDD72\\uDD7B-\\uDD82\\uDD85-\\uDD8B\\uDDAA-\\uDDAD\\uDE42-\\uDE44]|\\uD83A[\\uDCD0-\\uDCD6]|\\uDB40[\\uDD00-\\uDDEF]/;\n\nfunction validateLabel(label, processing_option) {\n if (label.substr(0, 4) === \"xn--\") {\n label = punycode.toUnicode(label);\n processing_option = PROCESSING_OPTIONS.NONTRANSITIONAL;\n }\n\n var error = false;\n\n if (normalize(label) !== label ||\n (label[3] === \"-\" && label[4] === \"-\") ||\n label[0] === \"-\" || label[label.length - 1] === \"-\" ||\n label.indexOf(\".\") !== -1 ||\n label.search(combiningMarksRegex) === 0) {\n error = true;\n }\n\n var len = countSymbols(label);\n for (var i = 0; i < len; ++i) {\n var status = findStatus(label.codePointAt(i));\n if ((processing === PROCESSING_OPTIONS.TRANSITIONAL && status[1] !== \"valid\") ||\n (processing === PROCESSING_OPTIONS.NONTRANSITIONAL &&\n status[1] !== \"valid\" && status[1] !== \"deviation\")) {\n error = true;\n break;\n }\n }\n\n return {\n label: label,\n error: error\n };\n}\n\nfunction processing(domain_name, useSTD3, processing_option) {\n var result = mapChars(domain_name, useSTD3, processing_option);\n result.string = normalize(result.string);\n\n var labels = result.string.split(\".\");\n for (var i = 0; i < labels.length; ++i) {\n try {\n var validation = validateLabel(labels[i]);\n labels[i] = validation.label;\n result.error = result.error || validation.error;\n } catch(e) {\n result.error = true;\n }\n }\n\n return {\n string: labels.join(\".\"),\n error: result.error\n };\n}\n\nmodule.exports.toASCII = function(domain_name, useSTD3, processing_option, verifyDnsLength) {\n var result = processing(domain_name, useSTD3, processing_option);\n var labels = result.string.split(\".\");\n labels = labels.map(function(l) {\n try {\n return punycode.toASCII(l);\n } catch(e) {\n result.error = true;\n return l;\n }\n });\n\n if (verifyDnsLength) {\n var total = labels.slice(0, labels.length - 1).join(\".\").length;\n if (total.length > 253 || total.length === 0) {\n result.error = true;\n }\n\n for (var i=0; i < labels.length; ++i) {\n if (labels.length > 63 || labels.length === 0) {\n result.error = true;\n break;\n }\n }\n }\n\n if (result.error) return null;\n return labels.join(\".\");\n};\n\nmodule.exports.toUnicode = function(domain_name, useSTD3) {\n var result = processing(domain_name, useSTD3, PROCESSING_OPTIONS.NONTRANSITIONAL);\n\n return {\n domain: result.string,\n error: result.error\n };\n};\n\nmodule.exports.PROCESSING_OPTIONS = PROCESSING_OPTIONS;\n","module.exports = require('./lib/tunnel');\n","'use strict';\n\nvar net = require('net');\nvar tls = require('tls');\nvar http = require('http');\nvar https = require('https');\nvar events = require('events');\nvar assert = require('assert');\nvar util = require('util');\n\n\nexports.httpOverHttp = httpOverHttp;\nexports.httpsOverHttp = httpsOverHttp;\nexports.httpOverHttps = httpOverHttps;\nexports.httpsOverHttps = httpsOverHttps;\n\n\nfunction httpOverHttp(options) {\n var agent = new TunnelingAgent(options);\n agent.request = http.request;\n return agent;\n}\n\nfunction httpsOverHttp(options) {\n var agent = new TunnelingAgent(options);\n agent.request = http.request;\n agent.createSocket = createSecureSocket;\n agent.defaultPort = 443;\n return agent;\n}\n\nfunction httpOverHttps(options) {\n var agent = new TunnelingAgent(options);\n agent.request = https.request;\n return agent;\n}\n\nfunction httpsOverHttps(options) {\n var agent = new TunnelingAgent(options);\n agent.request = https.request;\n agent.createSocket = createSecureSocket;\n agent.defaultPort = 443;\n return agent;\n}\n\n\nfunction TunnelingAgent(options) {\n var self = this;\n self.options = options || {};\n self.proxyOptions = self.options.proxy || {};\n self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;\n self.requests = [];\n self.sockets = [];\n\n self.on('free', function onFree(socket, host, port, localAddress) {\n var options = toOptions(host, port, localAddress);\n for (var i = 0, len = self.requests.length; i < len; ++i) {\n var pending = self.requests[i];\n if (pending.host === options.host && pending.port === options.port) {\n // Detect the request to connect same origin server,\n // reuse the connection.\n self.requests.splice(i, 1);\n pending.request.onSocket(socket);\n return;\n }\n }\n socket.destroy();\n self.removeSocket(socket);\n });\n}\nutil.inherits(TunnelingAgent, events.EventEmitter);\n\nTunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {\n var self = this;\n var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));\n\n if (self.sockets.length >= this.maxSockets) {\n // We are over limit so we'll add it to the queue.\n self.requests.push(options);\n return;\n }\n\n // If we are under maxSockets create a new one.\n self.createSocket(options, function(socket) {\n socket.on('free', onFree);\n socket.on('close', onCloseOrRemove);\n socket.on('agentRemove', onCloseOrRemove);\n req.onSocket(socket);\n\n function onFree() {\n self.emit('free', socket, options);\n }\n\n function onCloseOrRemove(err) {\n self.removeSocket(socket);\n socket.removeListener('free', onFree);\n socket.removeListener('close', onCloseOrRemove);\n socket.removeListener('agentRemove', onCloseOrRemove);\n }\n });\n};\n\nTunnelingAgent.prototype.createSocket = function createSocket(options, cb) {\n var self = this;\n var placeholder = {};\n self.sockets.push(placeholder);\n\n var connectOptions = mergeOptions({}, self.proxyOptions, {\n method: 'CONNECT',\n path: options.host + ':' + options.port,\n agent: false,\n headers: {\n host: options.host + ':' + options.port\n }\n });\n if (options.localAddress) {\n connectOptions.localAddress = options.localAddress;\n }\n if (connectOptions.proxyAuth) {\n connectOptions.headers = connectOptions.headers || {};\n connectOptions.headers['Proxy-Authorization'] = 'Basic ' +\n new Buffer(connectOptions.proxyAuth).toString('base64');\n }\n\n debug('making CONNECT request');\n var connectReq = self.request(connectOptions);\n connectReq.useChunkedEncodingByDefault = false; // for v0.6\n connectReq.once('response', onResponse); // for v0.6\n connectReq.once('upgrade', onUpgrade); // for v0.6\n connectReq.once('connect', onConnect); // for v0.7 or later\n connectReq.once('error', onError);\n connectReq.end();\n\n function onResponse(res) {\n // Very hacky. This is necessary to avoid http-parser leaks.\n res.upgrade = true;\n }\n\n function onUpgrade(res, socket, head) {\n // Hacky.\n process.nextTick(function() {\n onConnect(res, socket, head);\n });\n }\n\n function onConnect(res, socket, head) {\n connectReq.removeAllListeners();\n socket.removeAllListeners();\n\n if (res.statusCode !== 200) {\n debug('tunneling socket could not be established, statusCode=%d',\n res.statusCode);\n socket.destroy();\n var error = new Error('tunneling socket could not be established, ' +\n 'statusCode=' + res.statusCode);\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n return;\n }\n if (head.length > 0) {\n debug('got illegal response body from proxy');\n socket.destroy();\n var error = new Error('got illegal response body from proxy');\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n return;\n }\n debug('tunneling connection has established');\n self.sockets[self.sockets.indexOf(placeholder)] = socket;\n return cb(socket);\n }\n\n function onError(cause) {\n connectReq.removeAllListeners();\n\n debug('tunneling socket could not be established, cause=%s\\n',\n cause.message, cause.stack);\n var error = new Error('tunneling socket could not be established, ' +\n 'cause=' + cause.message);\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n }\n};\n\nTunnelingAgent.prototype.removeSocket = function removeSocket(socket) {\n var pos = this.sockets.indexOf(socket)\n if (pos === -1) {\n return;\n }\n this.sockets.splice(pos, 1);\n\n var pending = this.requests.shift();\n if (pending) {\n // If we have pending requests and a socket gets closed a new one\n // needs to be created to take over in the pool for the one that closed.\n this.createSocket(pending, function(socket) {\n pending.request.onSocket(socket);\n });\n }\n};\n\nfunction createSecureSocket(options, cb) {\n var self = this;\n TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {\n var hostHeader = options.request.getHeader('host');\n var tlsOptions = mergeOptions({}, self.options, {\n socket: socket,\n servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host\n });\n\n // 0 is dummy port for v0.6\n var secureSocket = tls.connect(0, tlsOptions);\n self.sockets[self.sockets.indexOf(socket)] = secureSocket;\n cb(secureSocket);\n });\n}\n\n\nfunction toOptions(host, port, localAddress) {\n if (typeof host === 'string') { // since v0.10\n return {\n host: host,\n port: port,\n localAddress: localAddress\n };\n }\n return host; // for v0.11 or later\n}\n\nfunction mergeOptions(target) {\n for (var i = 1, len = arguments.length; i < len; ++i) {\n var overrides = arguments[i];\n if (typeof overrides === 'object') {\n var keys = Object.keys(overrides);\n for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {\n var k = keys[j];\n if (overrides[k] !== undefined) {\n target[k] = overrides[k];\n }\n }\n }\n }\n return target;\n}\n\n\nvar debug;\nif (process.env.NODE_DEBUG && /\\btunnel\\b/.test(process.env.NODE_DEBUG)) {\n debug = function() {\n var args = Array.prototype.slice.call(arguments);\n if (typeof args[0] === 'string') {\n args[0] = 'TUNNEL: ' + args[0];\n } else {\n args.unshift('TUNNEL:');\n }\n console.error.apply(console, args);\n }\n} else {\n debug = function() {};\n}\nexports.debug = debug; // for test\n","\"use strict\";\n\nvar conversions = {};\nmodule.exports = conversions;\n\nfunction sign(x) {\n return x < 0 ? -1 : 1;\n}\n\nfunction evenRound(x) {\n // Round x to the nearest integer, choosing the even integer if it lies halfway between two.\n if ((x % 1) === 0.5 && (x & 1) === 0) { // [even number].5; round down (i.e. floor)\n return Math.floor(x);\n } else {\n return Math.round(x);\n }\n}\n\nfunction createNumberConversion(bitLength, typeOpts) {\n if (!typeOpts.unsigned) {\n --bitLength;\n }\n const lowerBound = typeOpts.unsigned ? 0 : -Math.pow(2, bitLength);\n const upperBound = Math.pow(2, bitLength) - 1;\n\n const moduloVal = typeOpts.moduloBitLength ? Math.pow(2, typeOpts.moduloBitLength) : Math.pow(2, bitLength);\n const moduloBound = typeOpts.moduloBitLength ? Math.pow(2, typeOpts.moduloBitLength - 1) : Math.pow(2, bitLength - 1);\n\n return function(V, opts) {\n if (!opts) opts = {};\n\n let x = +V;\n\n if (opts.enforceRange) {\n if (!Number.isFinite(x)) {\n throw new TypeError(\"Argument is not a finite number\");\n }\n\n x = sign(x) * Math.floor(Math.abs(x));\n if (x < lowerBound || x > upperBound) {\n throw new TypeError(\"Argument is not in byte range\");\n }\n\n return x;\n }\n\n if (!isNaN(x) && opts.clamp) {\n x = evenRound(x);\n\n if (x < lowerBound) x = lowerBound;\n if (x > upperBound) x = upperBound;\n return x;\n }\n\n if (!Number.isFinite(x) || x === 0) {\n return 0;\n }\n\n x = sign(x) * Math.floor(Math.abs(x));\n x = x % moduloVal;\n\n if (!typeOpts.unsigned && x >= moduloBound) {\n return x - moduloVal;\n } else if (typeOpts.unsigned) {\n if (x < 0) {\n x += moduloVal;\n } else if (x === -0) { // don't return negative zero\n return 0;\n }\n }\n\n return x;\n }\n}\n\nconversions[\"void\"] = function () {\n return undefined;\n};\n\nconversions[\"boolean\"] = function (val) {\n return !!val;\n};\n\nconversions[\"byte\"] = createNumberConversion(8, { unsigned: false });\nconversions[\"octet\"] = createNumberConversion(8, { unsigned: true });\n\nconversions[\"short\"] = createNumberConversion(16, { unsigned: false });\nconversions[\"unsigned short\"] = createNumberConversion(16, { unsigned: true });\n\nconversions[\"long\"] = createNumberConversion(32, { unsigned: false });\nconversions[\"unsigned long\"] = createNumberConversion(32, { unsigned: true });\n\nconversions[\"long long\"] = createNumberConversion(32, { unsigned: false, moduloBitLength: 64 });\nconversions[\"unsigned long long\"] = createNumberConversion(32, { unsigned: true, moduloBitLength: 64 });\n\nconversions[\"double\"] = function (V) {\n const x = +V;\n\n if (!Number.isFinite(x)) {\n throw new TypeError(\"Argument is not a finite floating-point value\");\n }\n\n return x;\n};\n\nconversions[\"unrestricted double\"] = function (V) {\n const x = +V;\n\n if (isNaN(x)) {\n throw new TypeError(\"Argument is NaN\");\n }\n\n return x;\n};\n\n// not quite valid, but good enough for JS\nconversions[\"float\"] = conversions[\"double\"];\nconversions[\"unrestricted float\"] = conversions[\"unrestricted double\"];\n\nconversions[\"DOMString\"] = function (V, opts) {\n if (!opts) opts = {};\n\n if (opts.treatNullAsEmptyString && V === null) {\n return \"\";\n }\n\n return String(V);\n};\n\nconversions[\"ByteString\"] = function (V, opts) {\n const x = String(V);\n let c = undefined;\n for (let i = 0; (c = x.codePointAt(i)) !== undefined; ++i) {\n if (c > 255) {\n throw new TypeError(\"Argument is not a valid bytestring\");\n }\n }\n\n return x;\n};\n\nconversions[\"USVString\"] = function (V) {\n const S = String(V);\n const n = S.length;\n const U = [];\n for (let i = 0; i < n; ++i) {\n const c = S.charCodeAt(i);\n if (c < 0xD800 || c > 0xDFFF) {\n U.push(String.fromCodePoint(c));\n } else if (0xDC00 <= c && c <= 0xDFFF) {\n U.push(String.fromCodePoint(0xFFFD));\n } else {\n if (i === n - 1) {\n U.push(String.fromCodePoint(0xFFFD));\n } else {\n const d = S.charCodeAt(i + 1);\n if (0xDC00 <= d && d <= 0xDFFF) {\n const a = c & 0x3FF;\n const b = d & 0x3FF;\n U.push(String.fromCodePoint((2 << 15) + (2 << 9) * a + b));\n ++i;\n } else {\n U.push(String.fromCodePoint(0xFFFD));\n }\n }\n }\n }\n\n return U.join('');\n};\n\nconversions[\"Date\"] = function (V, opts) {\n if (!(V instanceof Date)) {\n throw new TypeError(\"Argument is not a Date object\");\n }\n if (isNaN(V)) {\n return undefined;\n }\n\n return V;\n};\n\nconversions[\"RegExp\"] = function (V, opts) {\n if (!(V instanceof RegExp)) {\n V = new RegExp(V);\n }\n\n return V;\n};\n","\"use strict\";\nconst usm = require(\"./url-state-machine\");\n\nexports.implementation = class URLImpl {\n constructor(constructorArgs) {\n const url = constructorArgs[0];\n const base = constructorArgs[1];\n\n let parsedBase = null;\n if (base !== undefined) {\n parsedBase = usm.basicURLParse(base);\n if (parsedBase === \"failure\") {\n throw new TypeError(\"Invalid base URL\");\n }\n }\n\n const parsedURL = usm.basicURLParse(url, { baseURL: parsedBase });\n if (parsedURL === \"failure\") {\n throw new TypeError(\"Invalid URL\");\n }\n\n this._url = parsedURL;\n\n // TODO: query stuff\n }\n\n get href() {\n return usm.serializeURL(this._url);\n }\n\n set href(v) {\n const parsedURL = usm.basicURLParse(v);\n if (parsedURL === \"failure\") {\n throw new TypeError(\"Invalid URL\");\n }\n\n this._url = parsedURL;\n }\n\n get origin() {\n return usm.serializeURLOrigin(this._url);\n }\n\n get protocol() {\n return this._url.scheme + \":\";\n }\n\n set protocol(v) {\n usm.basicURLParse(v + \":\", { url: this._url, stateOverride: \"scheme start\" });\n }\n\n get username() {\n return this._url.username;\n }\n\n set username(v) {\n if (usm.cannotHaveAUsernamePasswordPort(this._url)) {\n return;\n }\n\n usm.setTheUsername(this._url, v);\n }\n\n get password() {\n return this._url.password;\n }\n\n set password(v) {\n if (usm.cannotHaveAUsernamePasswordPort(this._url)) {\n return;\n }\n\n usm.setThePassword(this._url, v);\n }\n\n get host() {\n const url = this._url;\n\n if (url.host === null) {\n return \"\";\n }\n\n if (url.port === null) {\n return usm.serializeHost(url.host);\n }\n\n return usm.serializeHost(url.host) + \":\" + usm.serializeInteger(url.port);\n }\n\n set host(v) {\n if (this._url.cannotBeABaseURL) {\n return;\n }\n\n usm.basicURLParse(v, { url: this._url, stateOverride: \"host\" });\n }\n\n get hostname() {\n if (this._url.host === null) {\n return \"\";\n }\n\n return usm.serializeHost(this._url.host);\n }\n\n set hostname(v) {\n if (this._url.cannotBeABaseURL) {\n return;\n }\n\n usm.basicURLParse(v, { url: this._url, stateOverride: \"hostname\" });\n }\n\n get port() {\n if (this._url.port === null) {\n return \"\";\n }\n\n return usm.serializeInteger(this._url.port);\n }\n\n set port(v) {\n if (usm.cannotHaveAUsernamePasswordPort(this._url)) {\n return;\n }\n\n if (v === \"\") {\n this._url.port = null;\n } else {\n usm.basicURLParse(v, { url: this._url, stateOverride: \"port\" });\n }\n }\n\n get pathname() {\n if (this._url.cannotBeABaseURL) {\n return this._url.path[0];\n }\n\n if (this._url.path.length === 0) {\n return \"\";\n }\n\n return \"/\" + this._url.path.join(\"/\");\n }\n\n set pathname(v) {\n if (this._url.cannotBeABaseURL) {\n return;\n }\n\n this._url.path = [];\n usm.basicURLParse(v, { url: this._url, stateOverride: \"path start\" });\n }\n\n get search() {\n if (this._url.query === null || this._url.query === \"\") {\n return \"\";\n }\n\n return \"?\" + this._url.query;\n }\n\n set search(v) {\n // TODO: query stuff\n\n const url = this._url;\n\n if (v === \"\") {\n url.query = null;\n return;\n }\n\n const input = v[0] === \"?\" ? v.substring(1) : v;\n url.query = \"\";\n usm.basicURLParse(input, { url, stateOverride: \"query\" });\n }\n\n get hash() {\n if (this._url.fragment === null || this._url.fragment === \"\") {\n return \"\";\n }\n\n return \"#\" + this._url.fragment;\n }\n\n set hash(v) {\n if (v === \"\") {\n this._url.fragment = null;\n return;\n }\n\n const input = v[0] === \"#\" ? v.substring(1) : v;\n this._url.fragment = \"\";\n usm.basicURLParse(input, { url: this._url, stateOverride: \"fragment\" });\n }\n\n toJSON() {\n return this.href;\n }\n};\n","\"use strict\";\n\nconst conversions = require(\"webidl-conversions\");\nconst utils = require(\"./utils.js\");\nconst Impl = require(\".//URL-impl.js\");\n\nconst impl = utils.implSymbol;\n\nfunction URL(url) {\n if (!this || this[impl] || !(this instanceof URL)) {\n throw new TypeError(\"Failed to construct 'URL': Please use the 'new' operator, this DOM object constructor cannot be called as a function.\");\n }\n if (arguments.length < 1) {\n throw new TypeError(\"Failed to construct 'URL': 1 argument required, but only \" + arguments.length + \" present.\");\n }\n const args = [];\n for (let i = 0; i < arguments.length && i < 2; ++i) {\n args[i] = arguments[i];\n }\n args[0] = conversions[\"USVString\"](args[0]);\n if (args[1] !== undefined) {\n args[1] = conversions[\"USVString\"](args[1]);\n }\n\n module.exports.setup(this, args);\n}\n\nURL.prototype.toJSON = function toJSON() {\n if (!this || !module.exports.is(this)) {\n throw new TypeError(\"Illegal invocation\");\n }\n const args = [];\n for (let i = 0; i < arguments.length && i < 0; ++i) {\n args[i] = arguments[i];\n }\n return this[impl].toJSON.apply(this[impl], args);\n};\nObject.defineProperty(URL.prototype, \"href\", {\n get() {\n return this[impl].href;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].href = V;\n },\n enumerable: true,\n configurable: true\n});\n\nURL.prototype.toString = function () {\n if (!this || !module.exports.is(this)) {\n throw new TypeError(\"Illegal invocation\");\n }\n return this.href;\n};\n\nObject.defineProperty(URL.prototype, \"origin\", {\n get() {\n return this[impl].origin;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"protocol\", {\n get() {\n return this[impl].protocol;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].protocol = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"username\", {\n get() {\n return this[impl].username;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].username = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"password\", {\n get() {\n return this[impl].password;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].password = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"host\", {\n get() {\n return this[impl].host;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].host = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"hostname\", {\n get() {\n return this[impl].hostname;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].hostname = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"port\", {\n get() {\n return this[impl].port;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].port = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"pathname\", {\n get() {\n return this[impl].pathname;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].pathname = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"search\", {\n get() {\n return this[impl].search;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].search = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"hash\", {\n get() {\n return this[impl].hash;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].hash = V;\n },\n enumerable: true,\n configurable: true\n});\n\n\nmodule.exports = {\n is(obj) {\n return !!obj && obj[impl] instanceof Impl.implementation;\n },\n create(constructorArgs, privateData) {\n let obj = Object.create(URL.prototype);\n this.setup(obj, constructorArgs, privateData);\n return obj;\n },\n setup(obj, constructorArgs, privateData) {\n if (!privateData) privateData = {};\n privateData.wrapper = obj;\n\n obj[impl] = new Impl.implementation(constructorArgs, privateData);\n obj[impl][utils.wrapperSymbol] = obj;\n },\n interface: URL,\n expose: {\n Window: { URL: URL },\n Worker: { URL: URL }\n }\n};\n\n","\"use strict\";\n\nexports.URL = require(\"./URL\").interface;\nexports.serializeURL = require(\"./url-state-machine\").serializeURL;\nexports.serializeURLOrigin = require(\"./url-state-machine\").serializeURLOrigin;\nexports.basicURLParse = require(\"./url-state-machine\").basicURLParse;\nexports.setTheUsername = require(\"./url-state-machine\").setTheUsername;\nexports.setThePassword = require(\"./url-state-machine\").setThePassword;\nexports.serializeHost = require(\"./url-state-machine\").serializeHost;\nexports.serializeInteger = require(\"./url-state-machine\").serializeInteger;\nexports.parseURL = require(\"./url-state-machine\").parseURL;\n","\"use strict\";\r\nconst punycode = require(\"punycode\");\r\nconst tr46 = require(\"tr46\");\r\n\r\nconst specialSchemes = {\r\n ftp: 21,\r\n file: null,\r\n gopher: 70,\r\n http: 80,\r\n https: 443,\r\n ws: 80,\r\n wss: 443\r\n};\r\n\r\nconst failure = Symbol(\"failure\");\r\n\r\nfunction countSymbols(str) {\r\n return punycode.ucs2.decode(str).length;\r\n}\r\n\r\nfunction at(input, idx) {\r\n const c = input[idx];\r\n return isNaN(c) ? undefined : String.fromCodePoint(c);\r\n}\r\n\r\nfunction isASCIIDigit(c) {\r\n return c >= 0x30 && c <= 0x39;\r\n}\r\n\r\nfunction isASCIIAlpha(c) {\r\n return (c >= 0x41 && c <= 0x5A) || (c >= 0x61 && c <= 0x7A);\r\n}\r\n\r\nfunction isASCIIAlphanumeric(c) {\r\n return isASCIIAlpha(c) || isASCIIDigit(c);\r\n}\r\n\r\nfunction isASCIIHex(c) {\r\n return isASCIIDigit(c) || (c >= 0x41 && c <= 0x46) || (c >= 0x61 && c <= 0x66);\r\n}\r\n\r\nfunction isSingleDot(buffer) {\r\n return buffer === \".\" || buffer.toLowerCase() === \"%2e\";\r\n}\r\n\r\nfunction isDoubleDot(buffer) {\r\n buffer = buffer.toLowerCase();\r\n return buffer === \"..\" || buffer === \"%2e.\" || buffer === \".%2e\" || buffer === \"%2e%2e\";\r\n}\r\n\r\nfunction isWindowsDriveLetterCodePoints(cp1, cp2) {\r\n return isASCIIAlpha(cp1) && (cp2 === 58 || cp2 === 124);\r\n}\r\n\r\nfunction isWindowsDriveLetterString(string) {\r\n return string.length === 2 && isASCIIAlpha(string.codePointAt(0)) && (string[1] === \":\" || string[1] === \"|\");\r\n}\r\n\r\nfunction isNormalizedWindowsDriveLetterString(string) {\r\n return string.length === 2 && isASCIIAlpha(string.codePointAt(0)) && string[1] === \":\";\r\n}\r\n\r\nfunction containsForbiddenHostCodePoint(string) {\r\n return string.search(/\\u0000|\\u0009|\\u000A|\\u000D|\\u0020|#|%|\\/|:|\\?|@|\\[|\\\\|\\]/) !== -1;\r\n}\r\n\r\nfunction containsForbiddenHostCodePointExcludingPercent(string) {\r\n return string.search(/\\u0000|\\u0009|\\u000A|\\u000D|\\u0020|#|\\/|:|\\?|@|\\[|\\\\|\\]/) !== -1;\r\n}\r\n\r\nfunction isSpecialScheme(scheme) {\r\n return specialSchemes[scheme] !== undefined;\r\n}\r\n\r\nfunction isSpecial(url) {\r\n return isSpecialScheme(url.scheme);\r\n}\r\n\r\nfunction defaultPort(scheme) {\r\n return specialSchemes[scheme];\r\n}\r\n\r\nfunction percentEncode(c) {\r\n let hex = c.toString(16).toUpperCase();\r\n if (hex.length === 1) {\r\n hex = \"0\" + hex;\r\n }\r\n\r\n return \"%\" + hex;\r\n}\r\n\r\nfunction utf8PercentEncode(c) {\r\n const buf = new Buffer(c);\r\n\r\n let str = \"\";\r\n\r\n for (let i = 0; i < buf.length; ++i) {\r\n str += percentEncode(buf[i]);\r\n }\r\n\r\n return str;\r\n}\r\n\r\nfunction utf8PercentDecode(str) {\r\n const input = new Buffer(str);\r\n const output = [];\r\n for (let i = 0; i < input.length; ++i) {\r\n if (input[i] !== 37) {\r\n output.push(input[i]);\r\n } else if (input[i] === 37 && isASCIIHex(input[i + 1]) && isASCIIHex(input[i + 2])) {\r\n output.push(parseInt(input.slice(i + 1, i + 3).toString(), 16));\r\n i += 2;\r\n } else {\r\n output.push(input[i]);\r\n }\r\n }\r\n return new Buffer(output).toString();\r\n}\r\n\r\nfunction isC0ControlPercentEncode(c) {\r\n return c <= 0x1F || c > 0x7E;\r\n}\r\n\r\nconst extraPathPercentEncodeSet = new Set([32, 34, 35, 60, 62, 63, 96, 123, 125]);\r\nfunction isPathPercentEncode(c) {\r\n return isC0ControlPercentEncode(c) || extraPathPercentEncodeSet.has(c);\r\n}\r\n\r\nconst extraUserinfoPercentEncodeSet =\r\n new Set([47, 58, 59, 61, 64, 91, 92, 93, 94, 124]);\r\nfunction isUserinfoPercentEncode(c) {\r\n return isPathPercentEncode(c) || extraUserinfoPercentEncodeSet.has(c);\r\n}\r\n\r\nfunction percentEncodeChar(c, encodeSetPredicate) {\r\n const cStr = String.fromCodePoint(c);\r\n\r\n if (encodeSetPredicate(c)) {\r\n return utf8PercentEncode(cStr);\r\n }\r\n\r\n return cStr;\r\n}\r\n\r\nfunction parseIPv4Number(input) {\r\n let R = 10;\r\n\r\n if (input.length >= 2 && input.charAt(0) === \"0\" && input.charAt(1).toLowerCase() === \"x\") {\r\n input = input.substring(2);\r\n R = 16;\r\n } else if (input.length >= 2 && input.charAt(0) === \"0\") {\r\n input = input.substring(1);\r\n R = 8;\r\n }\r\n\r\n if (input === \"\") {\r\n return 0;\r\n }\r\n\r\n const regex = R === 10 ? /[^0-9]/ : (R === 16 ? /[^0-9A-Fa-f]/ : /[^0-7]/);\r\n if (regex.test(input)) {\r\n return failure;\r\n }\r\n\r\n return parseInt(input, R);\r\n}\r\n\r\nfunction parseIPv4(input) {\r\n const parts = input.split(\".\");\r\n if (parts[parts.length - 1] === \"\") {\r\n if (parts.length > 1) {\r\n parts.pop();\r\n }\r\n }\r\n\r\n if (parts.length > 4) {\r\n return input;\r\n }\r\n\r\n const numbers = [];\r\n for (const part of parts) {\r\n if (part === \"\") {\r\n return input;\r\n }\r\n const n = parseIPv4Number(part);\r\n if (n === failure) {\r\n return input;\r\n }\r\n\r\n numbers.push(n);\r\n }\r\n\r\n for (let i = 0; i < numbers.length - 1; ++i) {\r\n if (numbers[i] > 255) {\r\n return failure;\r\n }\r\n }\r\n if (numbers[numbers.length - 1] >= Math.pow(256, 5 - numbers.length)) {\r\n return failure;\r\n }\r\n\r\n let ipv4 = numbers.pop();\r\n let counter = 0;\r\n\r\n for (const n of numbers) {\r\n ipv4 += n * Math.pow(256, 3 - counter);\r\n ++counter;\r\n }\r\n\r\n return ipv4;\r\n}\r\n\r\nfunction serializeIPv4(address) {\r\n let output = \"\";\r\n let n = address;\r\n\r\n for (let i = 1; i <= 4; ++i) {\r\n output = String(n % 256) + output;\r\n if (i !== 4) {\r\n output = \".\" + output;\r\n }\r\n n = Math.floor(n / 256);\r\n }\r\n\r\n return output;\r\n}\r\n\r\nfunction parseIPv6(input) {\r\n const address = [0, 0, 0, 0, 0, 0, 0, 0];\r\n let pieceIndex = 0;\r\n let compress = null;\r\n let pointer = 0;\r\n\r\n input = punycode.ucs2.decode(input);\r\n\r\n if (input[pointer] === 58) {\r\n if (input[pointer + 1] !== 58) {\r\n return failure;\r\n }\r\n\r\n pointer += 2;\r\n ++pieceIndex;\r\n compress = pieceIndex;\r\n }\r\n\r\n while (pointer < input.length) {\r\n if (pieceIndex === 8) {\r\n return failure;\r\n }\r\n\r\n if (input[pointer] === 58) {\r\n if (compress !== null) {\r\n return failure;\r\n }\r\n ++pointer;\r\n ++pieceIndex;\r\n compress = pieceIndex;\r\n continue;\r\n }\r\n\r\n let value = 0;\r\n let length = 0;\r\n\r\n while (length < 4 && isASCIIHex(input[pointer])) {\r\n value = value * 0x10 + parseInt(at(input, pointer), 16);\r\n ++pointer;\r\n ++length;\r\n }\r\n\r\n if (input[pointer] === 46) {\r\n if (length === 0) {\r\n return failure;\r\n }\r\n\r\n pointer -= length;\r\n\r\n if (pieceIndex > 6) {\r\n return failure;\r\n }\r\n\r\n let numbersSeen = 0;\r\n\r\n while (input[pointer] !== undefined) {\r\n let ipv4Piece = null;\r\n\r\n if (numbersSeen > 0) {\r\n if (input[pointer] === 46 && numbersSeen < 4) {\r\n ++pointer;\r\n } else {\r\n return failure;\r\n }\r\n }\r\n\r\n if (!isASCIIDigit(input[pointer])) {\r\n return failure;\r\n }\r\n\r\n while (isASCIIDigit(input[pointer])) {\r\n const number = parseInt(at(input, pointer));\r\n if (ipv4Piece === null) {\r\n ipv4Piece = number;\r\n } else if (ipv4Piece === 0) {\r\n return failure;\r\n } else {\r\n ipv4Piece = ipv4Piece * 10 + number;\r\n }\r\n if (ipv4Piece > 255) {\r\n return failure;\r\n }\r\n ++pointer;\r\n }\r\n\r\n address[pieceIndex] = address[pieceIndex] * 0x100 + ipv4Piece;\r\n\r\n ++numbersSeen;\r\n\r\n if (numbersSeen === 2 || numbersSeen === 4) {\r\n ++pieceIndex;\r\n }\r\n }\r\n\r\n if (numbersSeen !== 4) {\r\n return failure;\r\n }\r\n\r\n break;\r\n } else if (input[pointer] === 58) {\r\n ++pointer;\r\n if (input[pointer] === undefined) {\r\n return failure;\r\n }\r\n } else if (input[pointer] !== undefined) {\r\n return failure;\r\n }\r\n\r\n address[pieceIndex] = value;\r\n ++pieceIndex;\r\n }\r\n\r\n if (compress !== null) {\r\n let swaps = pieceIndex - compress;\r\n pieceIndex = 7;\r\n while (pieceIndex !== 0 && swaps > 0) {\r\n const temp = address[compress + swaps - 1];\r\n address[compress + swaps - 1] = address[pieceIndex];\r\n address[pieceIndex] = temp;\r\n --pieceIndex;\r\n --swaps;\r\n }\r\n } else if (compress === null && pieceIndex !== 8) {\r\n return failure;\r\n }\r\n\r\n return address;\r\n}\r\n\r\nfunction serializeIPv6(address) {\r\n let output = \"\";\r\n const seqResult = findLongestZeroSequence(address);\r\n const compress = seqResult.idx;\r\n let ignore0 = false;\r\n\r\n for (let pieceIndex = 0; pieceIndex <= 7; ++pieceIndex) {\r\n if (ignore0 && address[pieceIndex] === 0) {\r\n continue;\r\n } else if (ignore0) {\r\n ignore0 = false;\r\n }\r\n\r\n if (compress === pieceIndex) {\r\n const separator = pieceIndex === 0 ? \"::\" : \":\";\r\n output += separator;\r\n ignore0 = true;\r\n continue;\r\n }\r\n\r\n output += address[pieceIndex].toString(16);\r\n\r\n if (pieceIndex !== 7) {\r\n output += \":\";\r\n }\r\n }\r\n\r\n return output;\r\n}\r\n\r\nfunction parseHost(input, isSpecialArg) {\r\n if (input[0] === \"[\") {\r\n if (input[input.length - 1] !== \"]\") {\r\n return failure;\r\n }\r\n\r\n return parseIPv6(input.substring(1, input.length - 1));\r\n }\r\n\r\n if (!isSpecialArg) {\r\n return parseOpaqueHost(input);\r\n }\r\n\r\n const domain = utf8PercentDecode(input);\r\n const asciiDomain = tr46.toASCII(domain, false, tr46.PROCESSING_OPTIONS.NONTRANSITIONAL, false);\r\n if (asciiDomain === null) {\r\n return failure;\r\n }\r\n\r\n if (containsForbiddenHostCodePoint(asciiDomain)) {\r\n return failure;\r\n }\r\n\r\n const ipv4Host = parseIPv4(asciiDomain);\r\n if (typeof ipv4Host === \"number\" || ipv4Host === failure) {\r\n return ipv4Host;\r\n }\r\n\r\n return asciiDomain;\r\n}\r\n\r\nfunction parseOpaqueHost(input) {\r\n if (containsForbiddenHostCodePointExcludingPercent(input)) {\r\n return failure;\r\n }\r\n\r\n let output = \"\";\r\n const decoded = punycode.ucs2.decode(input);\r\n for (let i = 0; i < decoded.length; ++i) {\r\n output += percentEncodeChar(decoded[i], isC0ControlPercentEncode);\r\n }\r\n return output;\r\n}\r\n\r\nfunction findLongestZeroSequence(arr) {\r\n let maxIdx = null;\r\n let maxLen = 1; // only find elements > 1\r\n let currStart = null;\r\n let currLen = 0;\r\n\r\n for (let i = 0; i < arr.length; ++i) {\r\n if (arr[i] !== 0) {\r\n if (currLen > maxLen) {\r\n maxIdx = currStart;\r\n maxLen = currLen;\r\n }\r\n\r\n currStart = null;\r\n currLen = 0;\r\n } else {\r\n if (currStart === null) {\r\n currStart = i;\r\n }\r\n ++currLen;\r\n }\r\n }\r\n\r\n // if trailing zeros\r\n if (currLen > maxLen) {\r\n maxIdx = currStart;\r\n maxLen = currLen;\r\n }\r\n\r\n return {\r\n idx: maxIdx,\r\n len: maxLen\r\n };\r\n}\r\n\r\nfunction serializeHost(host) {\r\n if (typeof host === \"number\") {\r\n return serializeIPv4(host);\r\n }\r\n\r\n // IPv6 serializer\r\n if (host instanceof Array) {\r\n return \"[\" + serializeIPv6(host) + \"]\";\r\n }\r\n\r\n return host;\r\n}\r\n\r\nfunction trimControlChars(url) {\r\n return url.replace(/^[\\u0000-\\u001F\\u0020]+|[\\u0000-\\u001F\\u0020]+$/g, \"\");\r\n}\r\n\r\nfunction trimTabAndNewline(url) {\r\n return url.replace(/\\u0009|\\u000A|\\u000D/g, \"\");\r\n}\r\n\r\nfunction shortenPath(url) {\r\n const path = url.path;\r\n if (path.length === 0) {\r\n return;\r\n }\r\n if (url.scheme === \"file\" && path.length === 1 && isNormalizedWindowsDriveLetter(path[0])) {\r\n return;\r\n }\r\n\r\n path.pop();\r\n}\r\n\r\nfunction includesCredentials(url) {\r\n return url.username !== \"\" || url.password !== \"\";\r\n}\r\n\r\nfunction cannotHaveAUsernamePasswordPort(url) {\r\n return url.host === null || url.host === \"\" || url.cannotBeABaseURL || url.scheme === \"file\";\r\n}\r\n\r\nfunction isNormalizedWindowsDriveLetter(string) {\r\n return /^[A-Za-z]:$/.test(string);\r\n}\r\n\r\nfunction URLStateMachine(input, base, encodingOverride, url, stateOverride) {\r\n this.pointer = 0;\r\n this.input = input;\r\n this.base = base || null;\r\n this.encodingOverride = encodingOverride || \"utf-8\";\r\n this.stateOverride = stateOverride;\r\n this.url = url;\r\n this.failure = false;\r\n this.parseError = false;\r\n\r\n if (!this.url) {\r\n this.url = {\r\n scheme: \"\",\r\n username: \"\",\r\n password: \"\",\r\n host: null,\r\n port: null,\r\n path: [],\r\n query: null,\r\n fragment: null,\r\n\r\n cannotBeABaseURL: false\r\n };\r\n\r\n const res = trimControlChars(this.input);\r\n if (res !== this.input) {\r\n this.parseError = true;\r\n }\r\n this.input = res;\r\n }\r\n\r\n const res = trimTabAndNewline(this.input);\r\n if (res !== this.input) {\r\n this.parseError = true;\r\n }\r\n this.input = res;\r\n\r\n this.state = stateOverride || \"scheme start\";\r\n\r\n this.buffer = \"\";\r\n this.atFlag = false;\r\n this.arrFlag = false;\r\n this.passwordTokenSeenFlag = false;\r\n\r\n this.input = punycode.ucs2.decode(this.input);\r\n\r\n for (; this.pointer <= this.input.length; ++this.pointer) {\r\n const c = this.input[this.pointer];\r\n const cStr = isNaN(c) ? undefined : String.fromCodePoint(c);\r\n\r\n // exec state machine\r\n const ret = this[\"parse \" + this.state](c, cStr);\r\n if (!ret) {\r\n break; // terminate algorithm\r\n } else if (ret === failure) {\r\n this.failure = true;\r\n break;\r\n }\r\n }\r\n}\r\n\r\nURLStateMachine.prototype[\"parse scheme start\"] = function parseSchemeStart(c, cStr) {\r\n if (isASCIIAlpha(c)) {\r\n this.buffer += cStr.toLowerCase();\r\n this.state = \"scheme\";\r\n } else if (!this.stateOverride) {\r\n this.state = \"no scheme\";\r\n --this.pointer;\r\n } else {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse scheme\"] = function parseScheme(c, cStr) {\r\n if (isASCIIAlphanumeric(c) || c === 43 || c === 45 || c === 46) {\r\n this.buffer += cStr.toLowerCase();\r\n } else if (c === 58) {\r\n if (this.stateOverride) {\r\n if (isSpecial(this.url) && !isSpecialScheme(this.buffer)) {\r\n return false;\r\n }\r\n\r\n if (!isSpecial(this.url) && isSpecialScheme(this.buffer)) {\r\n return false;\r\n }\r\n\r\n if ((includesCredentials(this.url) || this.url.port !== null) && this.buffer === \"file\") {\r\n return false;\r\n }\r\n\r\n if (this.url.scheme === \"file\" && (this.url.host === \"\" || this.url.host === null)) {\r\n return false;\r\n }\r\n }\r\n this.url.scheme = this.buffer;\r\n this.buffer = \"\";\r\n if (this.stateOverride) {\r\n return false;\r\n }\r\n if (this.url.scheme === \"file\") {\r\n if (this.input[this.pointer + 1] !== 47 || this.input[this.pointer + 2] !== 47) {\r\n this.parseError = true;\r\n }\r\n this.state = \"file\";\r\n } else if (isSpecial(this.url) && this.base !== null && this.base.scheme === this.url.scheme) {\r\n this.state = \"special relative or authority\";\r\n } else if (isSpecial(this.url)) {\r\n this.state = \"special authority slashes\";\r\n } else if (this.input[this.pointer + 1] === 47) {\r\n this.state = \"path or authority\";\r\n ++this.pointer;\r\n } else {\r\n this.url.cannotBeABaseURL = true;\r\n this.url.path.push(\"\");\r\n this.state = \"cannot-be-a-base-URL path\";\r\n }\r\n } else if (!this.stateOverride) {\r\n this.buffer = \"\";\r\n this.state = \"no scheme\";\r\n this.pointer = -1;\r\n } else {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse no scheme\"] = function parseNoScheme(c) {\r\n if (this.base === null || (this.base.cannotBeABaseURL && c !== 35)) {\r\n return failure;\r\n } else if (this.base.cannotBeABaseURL && c === 35) {\r\n this.url.scheme = this.base.scheme;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = this.base.query;\r\n this.url.fragment = \"\";\r\n this.url.cannotBeABaseURL = true;\r\n this.state = \"fragment\";\r\n } else if (this.base.scheme === \"file\") {\r\n this.state = \"file\";\r\n --this.pointer;\r\n } else {\r\n this.state = \"relative\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse special relative or authority\"] = function parseSpecialRelativeOrAuthority(c) {\r\n if (c === 47 && this.input[this.pointer + 1] === 47) {\r\n this.state = \"special authority ignore slashes\";\r\n ++this.pointer;\r\n } else {\r\n this.parseError = true;\r\n this.state = \"relative\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse path or authority\"] = function parsePathOrAuthority(c) {\r\n if (c === 47) {\r\n this.state = \"authority\";\r\n } else {\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse relative\"] = function parseRelative(c) {\r\n this.url.scheme = this.base.scheme;\r\n if (isNaN(c)) {\r\n this.url.username = this.base.username;\r\n this.url.password = this.base.password;\r\n this.url.host = this.base.host;\r\n this.url.port = this.base.port;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = this.base.query;\r\n } else if (c === 47) {\r\n this.state = \"relative slash\";\r\n } else if (c === 63) {\r\n this.url.username = this.base.username;\r\n this.url.password = this.base.password;\r\n this.url.host = this.base.host;\r\n this.url.port = this.base.port;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = \"\";\r\n this.state = \"query\";\r\n } else if (c === 35) {\r\n this.url.username = this.base.username;\r\n this.url.password = this.base.password;\r\n this.url.host = this.base.host;\r\n this.url.port = this.base.port;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = this.base.query;\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n } else if (isSpecial(this.url) && c === 92) {\r\n this.parseError = true;\r\n this.state = \"relative slash\";\r\n } else {\r\n this.url.username = this.base.username;\r\n this.url.password = this.base.password;\r\n this.url.host = this.base.host;\r\n this.url.port = this.base.port;\r\n this.url.path = this.base.path.slice(0, this.base.path.length - 1);\r\n\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse relative slash\"] = function parseRelativeSlash(c) {\r\n if (isSpecial(this.url) && (c === 47 || c === 92)) {\r\n if (c === 92) {\r\n this.parseError = true;\r\n }\r\n this.state = \"special authority ignore slashes\";\r\n } else if (c === 47) {\r\n this.state = \"authority\";\r\n } else {\r\n this.url.username = this.base.username;\r\n this.url.password = this.base.password;\r\n this.url.host = this.base.host;\r\n this.url.port = this.base.port;\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse special authority slashes\"] = function parseSpecialAuthoritySlashes(c) {\r\n if (c === 47 && this.input[this.pointer + 1] === 47) {\r\n this.state = \"special authority ignore slashes\";\r\n ++this.pointer;\r\n } else {\r\n this.parseError = true;\r\n this.state = \"special authority ignore slashes\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse special authority ignore slashes\"] = function parseSpecialAuthorityIgnoreSlashes(c) {\r\n if (c !== 47 && c !== 92) {\r\n this.state = \"authority\";\r\n --this.pointer;\r\n } else {\r\n this.parseError = true;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse authority\"] = function parseAuthority(c, cStr) {\r\n if (c === 64) {\r\n this.parseError = true;\r\n if (this.atFlag) {\r\n this.buffer = \"%40\" + this.buffer;\r\n }\r\n this.atFlag = true;\r\n\r\n // careful, this is based on buffer and has its own pointer (this.pointer != pointer) and inner chars\r\n const len = countSymbols(this.buffer);\r\n for (let pointer = 0; pointer < len; ++pointer) {\r\n const codePoint = this.buffer.codePointAt(pointer);\r\n\r\n if (codePoint === 58 && !this.passwordTokenSeenFlag) {\r\n this.passwordTokenSeenFlag = true;\r\n continue;\r\n }\r\n const encodedCodePoints = percentEncodeChar(codePoint, isUserinfoPercentEncode);\r\n if (this.passwordTokenSeenFlag) {\r\n this.url.password += encodedCodePoints;\r\n } else {\r\n this.url.username += encodedCodePoints;\r\n }\r\n }\r\n this.buffer = \"\";\r\n } else if (isNaN(c) || c === 47 || c === 63 || c === 35 ||\r\n (isSpecial(this.url) && c === 92)) {\r\n if (this.atFlag && this.buffer === \"\") {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n this.pointer -= countSymbols(this.buffer) + 1;\r\n this.buffer = \"\";\r\n this.state = \"host\";\r\n } else {\r\n this.buffer += cStr;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse hostname\"] =\r\nURLStateMachine.prototype[\"parse host\"] = function parseHostName(c, cStr) {\r\n if (this.stateOverride && this.url.scheme === \"file\") {\r\n --this.pointer;\r\n this.state = \"file host\";\r\n } else if (c === 58 && !this.arrFlag) {\r\n if (this.buffer === \"\") {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n\r\n const host = parseHost(this.buffer, isSpecial(this.url));\r\n if (host === failure) {\r\n return failure;\r\n }\r\n\r\n this.url.host = host;\r\n this.buffer = \"\";\r\n this.state = \"port\";\r\n if (this.stateOverride === \"hostname\") {\r\n return false;\r\n }\r\n } else if (isNaN(c) || c === 47 || c === 63 || c === 35 ||\r\n (isSpecial(this.url) && c === 92)) {\r\n --this.pointer;\r\n if (isSpecial(this.url) && this.buffer === \"\") {\r\n this.parseError = true;\r\n return failure;\r\n } else if (this.stateOverride && this.buffer === \"\" &&\r\n (includesCredentials(this.url) || this.url.port !== null)) {\r\n this.parseError = true;\r\n return false;\r\n }\r\n\r\n const host = parseHost(this.buffer, isSpecial(this.url));\r\n if (host === failure) {\r\n return failure;\r\n }\r\n\r\n this.url.host = host;\r\n this.buffer = \"\";\r\n this.state = \"path start\";\r\n if (this.stateOverride) {\r\n return false;\r\n }\r\n } else {\r\n if (c === 91) {\r\n this.arrFlag = true;\r\n } else if (c === 93) {\r\n this.arrFlag = false;\r\n }\r\n this.buffer += cStr;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse port\"] = function parsePort(c, cStr) {\r\n if (isASCIIDigit(c)) {\r\n this.buffer += cStr;\r\n } else if (isNaN(c) || c === 47 || c === 63 || c === 35 ||\r\n (isSpecial(this.url) && c === 92) ||\r\n this.stateOverride) {\r\n if (this.buffer !== \"\") {\r\n const port = parseInt(this.buffer);\r\n if (port > Math.pow(2, 16) - 1) {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n this.url.port = port === defaultPort(this.url.scheme) ? null : port;\r\n this.buffer = \"\";\r\n }\r\n if (this.stateOverride) {\r\n return false;\r\n }\r\n this.state = \"path start\";\r\n --this.pointer;\r\n } else {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nconst fileOtherwiseCodePoints = new Set([47, 92, 63, 35]);\r\n\r\nURLStateMachine.prototype[\"parse file\"] = function parseFile(c) {\r\n this.url.scheme = \"file\";\r\n\r\n if (c === 47 || c === 92) {\r\n if (c === 92) {\r\n this.parseError = true;\r\n }\r\n this.state = \"file slash\";\r\n } else if (this.base !== null && this.base.scheme === \"file\") {\r\n if (isNaN(c)) {\r\n this.url.host = this.base.host;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = this.base.query;\r\n } else if (c === 63) {\r\n this.url.host = this.base.host;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = \"\";\r\n this.state = \"query\";\r\n } else if (c === 35) {\r\n this.url.host = this.base.host;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = this.base.query;\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n } else {\r\n if (this.input.length - this.pointer - 1 === 0 || // remaining consists of 0 code points\r\n !isWindowsDriveLetterCodePoints(c, this.input[this.pointer + 1]) ||\r\n (this.input.length - this.pointer - 1 >= 2 && // remaining has at least 2 code points\r\n !fileOtherwiseCodePoints.has(this.input[this.pointer + 2]))) {\r\n this.url.host = this.base.host;\r\n this.url.path = this.base.path.slice();\r\n shortenPath(this.url);\r\n } else {\r\n this.parseError = true;\r\n }\r\n\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n } else {\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse file slash\"] = function parseFileSlash(c) {\r\n if (c === 47 || c === 92) {\r\n if (c === 92) {\r\n this.parseError = true;\r\n }\r\n this.state = \"file host\";\r\n } else {\r\n if (this.base !== null && this.base.scheme === \"file\") {\r\n if (isNormalizedWindowsDriveLetterString(this.base.path[0])) {\r\n this.url.path.push(this.base.path[0]);\r\n } else {\r\n this.url.host = this.base.host;\r\n }\r\n }\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse file host\"] = function parseFileHost(c, cStr) {\r\n if (isNaN(c) || c === 47 || c === 92 || c === 63 || c === 35) {\r\n --this.pointer;\r\n if (!this.stateOverride && isWindowsDriveLetterString(this.buffer)) {\r\n this.parseError = true;\r\n this.state = \"path\";\r\n } else if (this.buffer === \"\") {\r\n this.url.host = \"\";\r\n if (this.stateOverride) {\r\n return false;\r\n }\r\n this.state = \"path start\";\r\n } else {\r\n let host = parseHost(this.buffer, isSpecial(this.url));\r\n if (host === failure) {\r\n return failure;\r\n }\r\n if (host === \"localhost\") {\r\n host = \"\";\r\n }\r\n this.url.host = host;\r\n\r\n if (this.stateOverride) {\r\n return false;\r\n }\r\n\r\n this.buffer = \"\";\r\n this.state = \"path start\";\r\n }\r\n } else {\r\n this.buffer += cStr;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse path start\"] = function parsePathStart(c) {\r\n if (isSpecial(this.url)) {\r\n if (c === 92) {\r\n this.parseError = true;\r\n }\r\n this.state = \"path\";\r\n\r\n if (c !== 47 && c !== 92) {\r\n --this.pointer;\r\n }\r\n } else if (!this.stateOverride && c === 63) {\r\n this.url.query = \"\";\r\n this.state = \"query\";\r\n } else if (!this.stateOverride && c === 35) {\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n } else if (c !== undefined) {\r\n this.state = \"path\";\r\n if (c !== 47) {\r\n --this.pointer;\r\n }\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse path\"] = function parsePath(c) {\r\n if (isNaN(c) || c === 47 || (isSpecial(this.url) && c === 92) ||\r\n (!this.stateOverride && (c === 63 || c === 35))) {\r\n if (isSpecial(this.url) && c === 92) {\r\n this.parseError = true;\r\n }\r\n\r\n if (isDoubleDot(this.buffer)) {\r\n shortenPath(this.url);\r\n if (c !== 47 && !(isSpecial(this.url) && c === 92)) {\r\n this.url.path.push(\"\");\r\n }\r\n } else if (isSingleDot(this.buffer) && c !== 47 &&\r\n !(isSpecial(this.url) && c === 92)) {\r\n this.url.path.push(\"\");\r\n } else if (!isSingleDot(this.buffer)) {\r\n if (this.url.scheme === \"file\" && this.url.path.length === 0 && isWindowsDriveLetterString(this.buffer)) {\r\n if (this.url.host !== \"\" && this.url.host !== null) {\r\n this.parseError = true;\r\n this.url.host = \"\";\r\n }\r\n this.buffer = this.buffer[0] + \":\";\r\n }\r\n this.url.path.push(this.buffer);\r\n }\r\n this.buffer = \"\";\r\n if (this.url.scheme === \"file\" && (c === undefined || c === 63 || c === 35)) {\r\n while (this.url.path.length > 1 && this.url.path[0] === \"\") {\r\n this.parseError = true;\r\n this.url.path.shift();\r\n }\r\n }\r\n if (c === 63) {\r\n this.url.query = \"\";\r\n this.state = \"query\";\r\n }\r\n if (c === 35) {\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n }\r\n } else {\r\n // TODO: If c is not a URL code point and not \"%\", parse error.\r\n\r\n if (c === 37 &&\r\n (!isASCIIHex(this.input[this.pointer + 1]) ||\r\n !isASCIIHex(this.input[this.pointer + 2]))) {\r\n this.parseError = true;\r\n }\r\n\r\n this.buffer += percentEncodeChar(c, isPathPercentEncode);\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse cannot-be-a-base-URL path\"] = function parseCannotBeABaseURLPath(c) {\r\n if (c === 63) {\r\n this.url.query = \"\";\r\n this.state = \"query\";\r\n } else if (c === 35) {\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n } else {\r\n // TODO: Add: not a URL code point\r\n if (!isNaN(c) && c !== 37) {\r\n this.parseError = true;\r\n }\r\n\r\n if (c === 37 &&\r\n (!isASCIIHex(this.input[this.pointer + 1]) ||\r\n !isASCIIHex(this.input[this.pointer + 2]))) {\r\n this.parseError = true;\r\n }\r\n\r\n if (!isNaN(c)) {\r\n this.url.path[0] = this.url.path[0] + percentEncodeChar(c, isC0ControlPercentEncode);\r\n }\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse query\"] = function parseQuery(c, cStr) {\r\n if (isNaN(c) || (!this.stateOverride && c === 35)) {\r\n if (!isSpecial(this.url) || this.url.scheme === \"ws\" || this.url.scheme === \"wss\") {\r\n this.encodingOverride = \"utf-8\";\r\n }\r\n\r\n const buffer = new Buffer(this.buffer); // TODO: Use encoding override instead\r\n for (let i = 0; i < buffer.length; ++i) {\r\n if (buffer[i] < 0x21 || buffer[i] > 0x7E || buffer[i] === 0x22 || buffer[i] === 0x23 ||\r\n buffer[i] === 0x3C || buffer[i] === 0x3E) {\r\n this.url.query += percentEncode(buffer[i]);\r\n } else {\r\n this.url.query += String.fromCodePoint(buffer[i]);\r\n }\r\n }\r\n\r\n this.buffer = \"\";\r\n if (c === 35) {\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n }\r\n } else {\r\n // TODO: If c is not a URL code point and not \"%\", parse error.\r\n if (c === 37 &&\r\n (!isASCIIHex(this.input[this.pointer + 1]) ||\r\n !isASCIIHex(this.input[this.pointer + 2]))) {\r\n this.parseError = true;\r\n }\r\n\r\n this.buffer += cStr;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse fragment\"] = function parseFragment(c) {\r\n if (isNaN(c)) { // do nothing\r\n } else if (c === 0x0) {\r\n this.parseError = true;\r\n } else {\r\n // TODO: If c is not a URL code point and not \"%\", parse error.\r\n if (c === 37 &&\r\n (!isASCIIHex(this.input[this.pointer + 1]) ||\r\n !isASCIIHex(this.input[this.pointer + 2]))) {\r\n this.parseError = true;\r\n }\r\n\r\n this.url.fragment += percentEncodeChar(c, isC0ControlPercentEncode);\r\n }\r\n\r\n return true;\r\n};\r\n\r\nfunction serializeURL(url, excludeFragment) {\r\n let output = url.scheme + \":\";\r\n if (url.host !== null) {\r\n output += \"//\";\r\n\r\n if (url.username !== \"\" || url.password !== \"\") {\r\n output += url.username;\r\n if (url.password !== \"\") {\r\n output += \":\" + url.password;\r\n }\r\n output += \"@\";\r\n }\r\n\r\n output += serializeHost(url.host);\r\n\r\n if (url.port !== null) {\r\n output += \":\" + url.port;\r\n }\r\n } else if (url.host === null && url.scheme === \"file\") {\r\n output += \"//\";\r\n }\r\n\r\n if (url.cannotBeABaseURL) {\r\n output += url.path[0];\r\n } else {\r\n for (const string of url.path) {\r\n output += \"/\" + string;\r\n }\r\n }\r\n\r\n if (url.query !== null) {\r\n output += \"?\" + url.query;\r\n }\r\n\r\n if (!excludeFragment && url.fragment !== null) {\r\n output += \"#\" + url.fragment;\r\n }\r\n\r\n return output;\r\n}\r\n\r\nfunction serializeOrigin(tuple) {\r\n let result = tuple.scheme + \"://\";\r\n result += serializeHost(tuple.host);\r\n\r\n if (tuple.port !== null) {\r\n result += \":\" + tuple.port;\r\n }\r\n\r\n return result;\r\n}\r\n\r\nmodule.exports.serializeURL = serializeURL;\r\n\r\nmodule.exports.serializeURLOrigin = function (url) {\r\n // https://url.spec.whatwg.org/#concept-url-origin\r\n switch (url.scheme) {\r\n case \"blob\":\r\n try {\r\n return module.exports.serializeURLOrigin(module.exports.parseURL(url.path[0]));\r\n } catch (e) {\r\n // serializing an opaque origin returns \"null\"\r\n return \"null\";\r\n }\r\n case \"ftp\":\r\n case \"gopher\":\r\n case \"http\":\r\n case \"https\":\r\n case \"ws\":\r\n case \"wss\":\r\n return serializeOrigin({\r\n scheme: url.scheme,\r\n host: url.host,\r\n port: url.port\r\n });\r\n case \"file\":\r\n // spec says \"exercise to the reader\", chrome says \"file://\"\r\n return \"file://\";\r\n default:\r\n // serializing an opaque origin returns \"null\"\r\n return \"null\";\r\n }\r\n};\r\n\r\nmodule.exports.basicURLParse = function (input, options) {\r\n if (options === undefined) {\r\n options = {};\r\n }\r\n\r\n const usm = new URLStateMachine(input, options.baseURL, options.encodingOverride, options.url, options.stateOverride);\r\n if (usm.failure) {\r\n return \"failure\";\r\n }\r\n\r\n return usm.url;\r\n};\r\n\r\nmodule.exports.setTheUsername = function (url, username) {\r\n url.username = \"\";\r\n const decoded = punycode.ucs2.decode(username);\r\n for (let i = 0; i < decoded.length; ++i) {\r\n url.username += percentEncodeChar(decoded[i], isUserinfoPercentEncode);\r\n }\r\n};\r\n\r\nmodule.exports.setThePassword = function (url, password) {\r\n url.password = \"\";\r\n const decoded = punycode.ucs2.decode(password);\r\n for (let i = 0; i < decoded.length; ++i) {\r\n url.password += percentEncodeChar(decoded[i], isUserinfoPercentEncode);\r\n }\r\n};\r\n\r\nmodule.exports.serializeHost = serializeHost;\r\n\r\nmodule.exports.cannotHaveAUsernamePasswordPort = cannotHaveAUsernamePasswordPort;\r\n\r\nmodule.exports.serializeInteger = function (integer) {\r\n return String(integer);\r\n};\r\n\r\nmodule.exports.parseURL = function (input, options) {\r\n if (options === undefined) {\r\n options = {};\r\n }\r\n\r\n // We don't handle blobs, so this just delegates:\r\n return module.exports.basicURLParse(input, { baseURL: options.baseURL, encodingOverride: options.encodingOverride });\r\n};\r\n","\"use strict\";\n\nmodule.exports.mixin = function mixin(target, source) {\n const keys = Object.getOwnPropertyNames(source);\n for (let i = 0; i < keys.length; ++i) {\n Object.defineProperty(target, keys[i], Object.getOwnPropertyDescriptor(source, keys[i]));\n }\n};\n\nmodule.exports.wrapperSymbol = Symbol(\"wrapper\");\nmodule.exports.implSymbol = Symbol(\"impl\");\n\nmodule.exports.wrapperForImpl = function (impl) {\n return impl[module.exports.wrapperSymbol];\n};\n\nmodule.exports.implForWrapper = function (wrapper) {\n return wrapper[module.exports.implSymbol];\n};\n\n",null,"module.exports = require(\"assert\");","module.exports = require(\"child_process\");","module.exports = require(\"crypto\");","module.exports = require(\"events\");","module.exports = require(\"fs\");","module.exports = require(\"http\");","module.exports = require(\"https\");","module.exports = require(\"net\");","module.exports = require(\"os\");","module.exports = require(\"path\");","module.exports = require(\"punycode\");","module.exports = require(\"stream\");","module.exports = require(\"string_decoder\");","module.exports = require(\"timers\");","module.exports = require(\"tls\");","module.exports = require(\"url\");","module.exports = require(\"util\");","module.exports = require(\"zlib\");","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst index_gen = require(\"./v2/index.gen.cjs\");\nconst index_gen$1 = require(\"./v3/index.gen.cjs\");\nexports.v2 = index_gen;\nexports.v3 = index_gen$1;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api = require(\"../../../scw/api.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst resourcePaginator = require(\"../../../scw/fetch/resource-paginator.cjs\");\nconst marshalling_gen = require(\"./marshalling.gen.cjs\");\nconst jsonContentHeaders = {\n \"Content-Type\": \"application/json; charset=utf-8\"\n};\nclass API extends api.API {\n /**\n * Create a new Project for an Organization. Deprecated in favor of Account\n * API v3. Generate a new Project for an Organization, specifying its\n * configuration including name and description.\n *\n * @deprecated\n * @param request - The request {@link CreateProjectRequest}\n * @returns A Promise of Project\n */\n createProject = (request = {}) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateProjectRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/account/v2/projects`\n },\n marshalling_gen.unmarshalProject\n );\n pageOfListProjects = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/account/v2/projects`,\n urlParams: marshalling.urlParams(\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\n \"organization_id\",\n request.organizationId ?? this.client.settings.defaultOrganizationId\n ],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_ids\", request.projectIds]\n )\n },\n marshalling_gen.unmarshalListProjectsResponse\n );\n /**\n * List all Projects of an Organization. Deprecated in favor of Account API\n * v3. List all Projects of an Organization. The response will include the\n * total number of Projects as well as their associated Organizations, names\n * and IDs. Other information include the creation and update date of the\n * Project.\n *\n * @deprecated\n * @param request - The request {@link ListProjectsRequest}\n * @returns A Promise of ListProjectsResponse\n */\n listProjects = (request = {}) => resourcePaginator.enrichForPagination(\"projects\", this.pageOfListProjects, request);\n /**\n * Get an existing Project. Deprecated in favor of Account API v3. Retrieve\n * information about an existing Project, specified by its Project ID. Its\n * full details, including ID, name and description, are returned in the\n * response object.\n *\n * @deprecated\n * @param request - The request {@link GetProjectRequest}\n * @returns A Promise of Project\n */\n getProject = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/account/v2/projects/${marshalling.validatePathParam(\"projectId\", request.projectId ?? this.client.settings.defaultProjectId)}`\n },\n marshalling_gen.unmarshalProject\n );\n /**\n * Delete an existing Project. Deprecated in favor of Account API v3. Delete\n * an existing Project, specified by its Project ID. The Project needs to be\n * empty (meaning there are no resources left in it) to be deleted\n * effectively. Note that deleting a Project is permanent, and cannot be\n * undone.\n *\n * @deprecated\n * @param request - The request {@link DeleteProjectRequest}\n */\n deleteProject = (request = {}) => this.client.fetch({\n method: \"DELETE\",\n path: `/account/v2/projects/${marshalling.validatePathParam(\"projectId\", request.projectId ?? this.client.settings.defaultProjectId)}`\n });\n /**\n * Update Project. Deprecated in favor of Account API v3. Update the\n * parameters of an existing Project, specified by its Project ID. These\n * parameters include the name and description.\n *\n * @deprecated\n * @param request - The request {@link UpdateProjectRequest}\n * @returns A Promise of Project\n */\n updateProject = (request = {}) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateProjectRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/account/v2/projects/${marshalling.validatePathParam(\"projectId\", request.projectId ?? this.client.settings.defaultProjectId)}`\n },\n marshalling_gen.unmarshalProject\n );\n}\nexports.API = API;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api_gen = require(\"./api.gen.cjs\");\nexports.API = api_gen.API;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst randomName = require(\"@scaleway/random-name\");\nconst json = require(\"../../../helpers/json.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst unmarshalProject = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Project' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n description: data.description,\n id: data.id,\n name: data.name,\n organizationId: data.organization_id,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalListProjectsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListProjectsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n projects: marshalling.unmarshalArrayOfObject(data.projects, unmarshalProject),\n totalCount: data.total_count\n };\n};\nconst marshalCreateProjectRequest = (request, defaults) => ({\n description: request.description,\n name: request.name || randomName(\"proj\"),\n organization_id: request.organizationId ?? defaults.defaultOrganizationId\n});\nconst marshalUpdateProjectRequest = (request, defaults) => ({\n description: request.description,\n name: request.name\n});\nexports.marshalCreateProjectRequest = marshalCreateProjectRequest;\nexports.marshalUpdateProjectRequest = marshalUpdateProjectRequest;\nexports.unmarshalListProjectsResponse = unmarshalListProjectsResponse;\nexports.unmarshalProject = unmarshalProject;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api = require(\"../../../scw/api.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst resourcePaginator = require(\"../../../scw/fetch/resource-paginator.cjs\");\nconst marshalling_gen = require(\"./marshalling.gen.cjs\");\nconst jsonContentHeaders = {\n \"Content-Type\": \"application/json; charset=utf-8\"\n};\nclass ProjectAPI extends api.API {\n /**\n * Create a new Project for an Organization. Generate a new Project for an\n * Organization, specifying its configuration including name and description.\n *\n * @param request - The request {@link ProjectApiCreateProjectRequest}\n * @returns A Promise of Project\n */\n createProject = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalProjectApiCreateProjectRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/account/v3/projects`\n },\n marshalling_gen.unmarshalProject\n );\n pageOfListProjects = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/account/v3/projects`,\n urlParams: marshalling.urlParams(\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\n \"organization_id\",\n request.organizationId ?? this.client.settings.defaultOrganizationId\n ],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_ids\", request.projectIds]\n )\n },\n marshalling_gen.unmarshalListProjectsResponse\n );\n /**\n * List all Projects of an Organization. List all Projects of an Organization.\n * The response will include the total number of Projects as well as their\n * associated Organizations, names, and IDs. Other information includes the\n * creation and update date of the Project.\n *\n * @param request - The request {@link ProjectApiListProjectsRequest}\n * @returns A Promise of ListProjectsResponse\n */\n listProjects = (request = {}) => resourcePaginator.enrichForPagination(\"projects\", this.pageOfListProjects, request);\n /**\n * Get an existing Project. Retrieve information about an existing Project,\n * specified by its Project ID. Its full details, including ID, name and\n * description, are returned in the response object.\n *\n * @param request - The request {@link ProjectApiGetProjectRequest}\n * @returns A Promise of Project\n */\n getProject = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/account/v3/projects/${marshalling.validatePathParam(\"projectId\", request.projectId ?? this.client.settings.defaultProjectId)}`\n },\n marshalling_gen.unmarshalProject\n );\n /**\n * Delete an existing Project. Delete an existing Project, specified by its\n * Project ID. The Project needs to be empty (meaning there are no resources\n * left in it) to be deleted effectively. Note that deleting a Project is\n * permanent, and cannot be undone.\n *\n * @param request - The request {@link ProjectApiDeleteProjectRequest}\n */\n deleteProject = (request = {}) => this.client.fetch({\n method: \"DELETE\",\n path: `/account/v3/projects/${marshalling.validatePathParam(\"projectId\", request.projectId ?? this.client.settings.defaultProjectId)}`\n });\n /**\n * Update Project. Update the parameters of an existing Project, specified by\n * its Project ID. These parameters include the name and description.\n *\n * @param request - The request {@link ProjectApiUpdateProjectRequest}\n * @returns A Promise of Project\n */\n updateProject = (request = {}) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalProjectApiUpdateProjectRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/account/v3/projects/${marshalling.validatePathParam(\"projectId\", request.projectId ?? this.client.settings.defaultProjectId)}`\n },\n marshalling_gen.unmarshalProject\n );\n}\nexports.ProjectAPI = ProjectAPI;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api_gen = require(\"./api.gen.cjs\");\nconst validationRules_gen = require(\"./validation-rules.gen.cjs\");\nexports.ProjectAPI = api_gen.ProjectAPI;\nexports.ValidationRules = validationRules_gen;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst randomName = require(\"@scaleway/random-name\");\nconst json = require(\"../../../helpers/json.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst unmarshalProject = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Project' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n description: data.description,\n id: data.id,\n name: data.name,\n organizationId: data.organization_id,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalListProjectsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListProjectsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n projects: marshalling.unmarshalArrayOfObject(data.projects, unmarshalProject),\n totalCount: data.total_count\n };\n};\nconst marshalProjectApiCreateProjectRequest = (request, defaults) => ({\n description: request.description,\n name: request.name || randomName(\"proj\"),\n organization_id: request.organizationId ?? defaults.defaultOrganizationId\n});\nconst marshalProjectApiUpdateProjectRequest = (request, defaults) => ({\n description: request.description,\n name: request.name\n});\nexports.marshalProjectApiCreateProjectRequest = marshalProjectApiCreateProjectRequest;\nexports.marshalProjectApiUpdateProjectRequest = marshalProjectApiUpdateProjectRequest;\nexports.unmarshalListProjectsResponse = unmarshalListProjectsResponse;\nexports.unmarshalProject = unmarshalProject;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst ProjectApiCreateProjectRequest = {\n description: {\n maxLength: 200\n },\n name: {\n maxLength: 64,\n minLength: 1,\n pattern: /^[a-zA-Z0-9\\._\\- ]+$/\n }\n};\nconst ProjectApiListProjectsRequest = {\n name: {\n maxLength: 64,\n minLength: 1,\n pattern: /^[a-zA-Z0-9\\._\\- ]+$/\n },\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThanOrEqual: 1,\n lessThanOrEqual: 100\n }\n};\nconst ProjectApiUpdateProjectRequest = {\n description: {\n maxLength: 200\n },\n name: {\n maxLength: 64,\n minLength: 1,\n pattern: /^[a-zA-Z0-9\\._\\- ]+$/\n }\n};\nexports.ProjectApiCreateProjectRequest = ProjectApiCreateProjectRequest;\nexports.ProjectApiListProjectsRequest = ProjectApiListProjectsRequest;\nexports.ProjectApiUpdateProjectRequest = ProjectApiUpdateProjectRequest;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst index_gen = require(\"./v1alpha1/index.gen.cjs\");\nexports.v1alpha1 = index_gen;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst intervalRetrier = require(\"../../../internal/async/interval-retrier.cjs\");\nconst api = require(\"../../../scw/api.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst resourcePaginator = require(\"../../../scw/fetch/resource-paginator.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nconst marshalling_gen = require(\"./marshalling.gen.cjs\");\nconst jsonContentHeaders = {\n \"Content-Type\": \"application/json; charset=utf-8\"\n};\nclass API extends api.API {\n /** Lists the available zones of the API. */\n static LOCALITIES = [\"fr-par-3\"];\n /**\n * List server types. List all technical details about Apple silicon server\n * types available in the specified zone. Since there is only one Availability\n * Zone for Apple silicon servers, the targeted value is `fr-par-3`.\n *\n * @param request - The request {@link ListServerTypesRequest}\n * @returns A Promise of ListServerTypesResponse\n */\n listServerTypes = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/apple-silicon/v1alpha1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/server-types`\n },\n marshalling_gen.unmarshalListServerTypesResponse\n );\n /**\n * Get a server type. Get technical details (CPU, disk size etc.) of a server\n * type.\n *\n * @param request - The request {@link GetServerTypeRequest}\n * @returns A Promise of ServerType\n */\n getServerType = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/apple-silicon/v1alpha1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/server-type/${marshalling.validatePathParam(\"serverType\", request.serverType)}`\n },\n marshalling_gen.unmarshalServerType\n );\n /**\n * Create a server. Create a new server in the targeted zone, specifying its\n * configuration including name and type.\n *\n * @param request - The request {@link CreateServerRequest}\n * @returns A Promise of Server\n */\n createServer = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateServerRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/apple-silicon/v1alpha1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers`\n },\n marshalling_gen.unmarshalServer\n );\n pageOfListServers = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/apple-silicon/v1alpha1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId]\n )\n },\n marshalling_gen.unmarshalListServersResponse\n );\n /**\n * List all servers. List all servers in the specified zone. By default,\n * returned servers in the list are ordered by creation date in ascending\n * order, though this can be modified via the `order_by` field.\n *\n * @param request - The request {@link ListServersRequest}\n * @returns A Promise of ListServersResponse\n */\n listServers = (request = {}) => resourcePaginator.enrichForPagination(\"servers\", this.pageOfListServers, request);\n pageOfListOS = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/apple-silicon/v1alpha1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/os`,\n urlParams: marshalling.urlParams(\n [\"name\", request.name],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"server_type\", request.serverType]\n )\n },\n marshalling_gen.unmarshalListOSResponse\n );\n /**\n * List all Operating Systems (OS). List all Operating Systems (OS). The\n * response will include the total number of OS as well as their associated\n * IDs, names and labels.\n *\n * @param request - The request {@link ListOSRequest}\n * @returns A Promise of ListOSResponse\n */\n listOS = (request = {}) => resourcePaginator.enrichForPagination(\"os\", this.pageOfListOS, request);\n /**\n * Get an Operating System (OS). Get an Operating System (OS). The response\n * will include the OS's unique ID as well as its name and label.\n *\n * @param request - The request {@link GetOSRequest}\n * @returns A Promise of OS\n */\n getOS = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/apple-silicon/v1alpha1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/os/${marshalling.validatePathParam(\"osId\", request.osId)}`\n },\n marshalling_gen.unmarshalOS\n );\n /**\n * Get a server. Retrieve information about an existing Apple silicon server,\n * specified by its server ID. Its full details, including name, status and IP\n * address, are returned in the response object.\n *\n * @param request - The request {@link GetServerRequest}\n * @returns A Promise of Server\n */\n getServer = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/apple-silicon/v1alpha1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}`\n },\n marshalling_gen.unmarshalServer\n );\n /**\n * Waits for {@link Server} to be in a final state.\n *\n * @param request - The request {@link GetServerRequest}\n * @param options - The waiting options\n * @returns A Promise of Server\n */\n waitForServer = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(!content_gen.SERVER_TRANSIENT_STATUSES.includes(res.status))),\n this.getServer,\n request,\n options\n );\n /**\n * Update a server. Update the parameters of an existing Apple silicon server,\n * specified by its server ID.\n *\n * @param request - The request {@link UpdateServerRequest}\n * @returns A Promise of Server\n */\n updateServer = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateServerRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/apple-silicon/v1alpha1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}`\n },\n marshalling_gen.unmarshalServer\n );\n /**\n * Delete a server. Delete an existing Apple silicon server, specified by its\n * server ID. Deleting a server is permanent, and cannot be undone. Note that\n * the minimum allocation period for Apple silicon-as-a-service is 24 hours,\n * meaning you cannot delete your server prior to that.\n *\n * @param request - The request {@link DeleteServerRequest}\n */\n deleteServer = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/apple-silicon/v1alpha1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}`\n });\n /**\n * Reboot a server. Reboot an existing Apple silicon server, specified by its\n * server ID.\n *\n * @param request - The request {@link RebootServerRequest}\n * @returns A Promise of Server\n */\n rebootServer = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/apple-silicon/v1alpha1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/reboot`\n },\n marshalling_gen.unmarshalServer\n );\n /**\n * Reinstall a server. Reinstall an existing Apple silicon server (specified\n * by its server ID) from a new image (OS). All the data on the disk is\n * deleted and all configuration is reset to the defailt configuration values\n * of the image (OS).\n *\n * @param request - The request {@link ReinstallServerRequest}\n * @returns A Promise of Server\n */\n reinstallServer = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalReinstallServerRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/apple-silicon/v1alpha1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/reinstall`\n },\n marshalling_gen.unmarshalServer\n );\n}\nexports.API = API;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst SERVER_TRANSIENT_STATUSES = [\n \"starting\",\n \"rebooting\",\n \"updating\",\n \"locking\",\n \"unlocking\",\n \"reinstalling\"\n];\nexports.SERVER_TRANSIENT_STATUSES = SERVER_TRANSIENT_STATUSES;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api_gen = require(\"./api.gen.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nexports.API = api_gen.API;\nexports.SERVER_TRANSIENT_STATUSES = content_gen.SERVER_TRANSIENT_STATUSES;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst randomName = require(\"@scaleway/random-name\");\nconst json = require(\"../../../helpers/json.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst unmarshalOS = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'OS' failed as data isn't a dictionary.`\n );\n }\n return {\n compatibleServerTypes: data.compatible_server_types,\n family: data.family,\n id: data.id,\n imageUrl: data.image_url,\n isBeta: data.is_beta,\n label: data.label,\n name: data.name,\n version: data.version,\n xcodeVersion: data.xcode_version\n };\n};\nconst unmarshalServerTypeCPU = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ServerTypeCPU' failed as data isn't a dictionary.`\n );\n }\n return {\n coreCount: data.core_count,\n frequency: data.frequency,\n name: data.name\n };\n};\nconst unmarshalServerTypeDisk = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ServerTypeDisk' failed as data isn't a dictionary.`\n );\n }\n return {\n capacity: data.capacity,\n type: data.type\n };\n};\nconst unmarshalServerTypeGPU = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ServerTypeGPU' failed as data isn't a dictionary.`\n );\n }\n return {\n count: data.count\n };\n};\nconst unmarshalServerTypeMemory = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ServerTypeMemory' failed as data isn't a dictionary.`\n );\n }\n return {\n capacity: data.capacity,\n type: data.type\n };\n};\nconst unmarshalServerTypeNetwork = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ServerTypeNetwork' failed as data isn't a dictionary.`\n );\n }\n return {\n publicBandwidthBps: data.public_bandwidth_bps\n };\n};\nconst unmarshalServerType = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ServerType' failed as data isn't a dictionary.`\n );\n }\n return {\n cpu: data.cpu ? unmarshalServerTypeCPU(data.cpu) : void 0,\n defaultOs: data.default_os ? unmarshalOS(data.default_os) : void 0,\n disk: data.disk ? unmarshalServerTypeDisk(data.disk) : void 0,\n gpu: data.gpu ? unmarshalServerTypeGPU(data.gpu) : void 0,\n memory: data.memory ? unmarshalServerTypeMemory(data.memory) : void 0,\n minimumLeaseDuration: data.minimum_lease_duration,\n name: data.name,\n network: data.network ? unmarshalServerTypeNetwork(data.network) : void 0,\n stock: data.stock\n };\n};\nconst unmarshalServer = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Server' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n deletableAt: marshalling.unmarshalDate(data.deletable_at),\n deletionScheduled: data.deletion_scheduled,\n id: data.id,\n ip: data.ip,\n name: data.name,\n organizationId: data.organization_id,\n os: data.os ? unmarshalOS(data.os) : void 0,\n projectId: data.project_id,\n sshUsername: data.ssh_username,\n status: data.status,\n sudoPassword: data.sudo_password,\n type: data.type,\n updatedAt: marshalling.unmarshalDate(data.updated_at),\n vncUrl: data.vnc_url,\n zone: data.zone\n };\n};\nconst unmarshalListOSResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListOSResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n os: marshalling.unmarshalArrayOfObject(data.os, unmarshalOS),\n totalCount: data.total_count\n };\n};\nconst unmarshalListServerTypesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListServerTypesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n serverTypes: marshalling.unmarshalArrayOfObject(data.server_types, unmarshalServerType)\n };\n};\nconst unmarshalListServersResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListServersResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n servers: marshalling.unmarshalArrayOfObject(data.servers, unmarshalServer),\n totalCount: data.total_count\n };\n};\nconst marshalCreateServerRequest = (request, defaults) => ({\n name: request.name || randomName(\"as\"),\n os_id: request.osId,\n project_id: request.projectId ?? defaults.defaultProjectId,\n type: request.type\n});\nconst marshalReinstallServerRequest = (request, defaults) => ({\n os_id: request.osId\n});\nconst marshalUpdateServerRequest = (request, defaults) => ({\n name: request.name,\n schedule_deletion: request.scheduleDeletion\n});\nexports.marshalCreateServerRequest = marshalCreateServerRequest;\nexports.marshalReinstallServerRequest = marshalReinstallServerRequest;\nexports.marshalUpdateServerRequest = marshalUpdateServerRequest;\nexports.unmarshalListOSResponse = unmarshalListOSResponse;\nexports.unmarshalListServerTypesResponse = unmarshalListServerTypesResponse;\nexports.unmarshalListServersResponse = unmarshalListServersResponse;\nexports.unmarshalOS = unmarshalOS;\nexports.unmarshalServer = unmarshalServer;\nexports.unmarshalServerType = unmarshalServerType;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst index = require(\"./v1/index.cjs\");\nconst index_gen = require(\"./v3/index.gen.cjs\");\nexports.v1 = index;\nexports.v3 = index_gen;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst intervalRetrier = require(\"../../../internal/async/interval-retrier.cjs\");\nconst api = require(\"../../../scw/api.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst resourcePaginator = require(\"../../../scw/fetch/resource-paginator.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nconst marshalling_gen = require(\"./marshalling.gen.cjs\");\nconst jsonContentHeaders = {\n \"Content-Type\": \"application/json; charset=utf-8\"\n};\nclass API extends api.API {\n /** Lists the available zones of the API. */\n static LOCALITIES = [\n \"fr-par-1\",\n \"fr-par-2\",\n \"nl-ams-1\",\n \"nl-ams-2\",\n \"pl-waw-2\",\n \"pl-waw-3\"\n ];\n pageOfListServers = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/baremetal/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers`,\n urlParams: marshalling.urlParams(\n [\"name\", request.name],\n [\"option_id\", request.optionId],\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId],\n [\"status\", request.status],\n [\"tags\", request.tags]\n )\n },\n marshalling_gen.unmarshalListServersResponse\n );\n /**\n * List Elastic Metal servers for an Organization. List Elastic Metal servers\n * for a specific Organization.\n *\n * @param request - The request {@link ListServersRequest}\n * @returns A Promise of ListServersResponse\n */\n listServers = (request = {}) => resourcePaginator.enrichForPagination(\"servers\", this.pageOfListServers, request);\n /**\n * Get a specific Elastic Metal server. Get full details of an existing\n * Elastic Metal server associated with the ID.\n *\n * @param request - The request {@link GetServerRequest}\n * @returns A Promise of Server\n */\n getServer = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/baremetal/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}`\n },\n marshalling_gen.unmarshalServer\n );\n /**\n * Waits for {@link Server} to be in a final state.\n *\n * @param request - The request {@link GetServerRequest}\n * @param options - The waiting options\n * @returns A Promise of Server\n */\n waitForServer = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(!content_gen.SERVER_TRANSIENT_STATUSES.includes(res.status))),\n this.getServer,\n request,\n options\n );\n /**\n * Create an Elastic Metal server. Create a new Elastic Metal server. Once the\n * server is created, proceed with the [installation of an OS](#post-3e949e).\n *\n * @param request - The request {@link CreateServerRequest}\n * @returns A Promise of Server\n */\n createServer = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateServerRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/baremetal/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers`\n },\n marshalling_gen.unmarshalServer\n );\n /**\n * Update an Elastic Metal server. Update the server associated with the ID.\n * You can update parameters such as the server's name, tags and description.\n * Any parameters left null in the request body are not updated.\n *\n * @param request - The request {@link UpdateServerRequest}\n * @returns A Promise of Server\n */\n updateServer = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateServerRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/baremetal/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}`\n },\n marshalling_gen.unmarshalServer\n );\n /**\n * Install an Elastic Metal server. Install an Operating System (OS) on the\n * Elastic Metal server with a specific ID.\n *\n * @param request - The request {@link InstallServerRequest}\n * @returns A Promise of Server\n */\n installServer = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalInstallServerRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/baremetal/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/install`\n },\n marshalling_gen.unmarshalServer\n );\n /**\n * Return server metrics. Get the ping status of the server associated with\n * the ID.\n *\n * @param request - The request {@link GetServerMetricsRequest}\n * @returns A Promise of GetServerMetricsResponse\n */\n getServerMetrics = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/baremetal/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/metrics`\n },\n marshalling_gen.unmarshalGetServerMetricsResponse\n );\n /**\n * Delete an Elastic Metal server. Delete the server associated with the ID.\n *\n * @param request - The request {@link DeleteServerRequest}\n * @returns A Promise of Server\n */\n deleteServer = (request) => this.client.fetch(\n {\n method: \"DELETE\",\n path: `/baremetal/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}`\n },\n marshalling_gen.unmarshalServer\n );\n /**\n * Reboot an Elastic Metal server. Reboot the Elastic Metal server associated\n * with the ID, use the `boot_type` `rescue` to reboot the server in rescue\n * mode.\n *\n * @param request - The request {@link RebootServerRequest}\n * @returns A Promise of Server\n */\n rebootServer = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalRebootServerRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/baremetal/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/reboot`\n },\n marshalling_gen.unmarshalServer\n );\n /**\n * Start an Elastic Metal server. Start the server associated with the ID.\n *\n * @param request - The request {@link StartServerRequest}\n * @returns A Promise of Server\n */\n startServer = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalStartServerRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/baremetal/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/start`\n },\n marshalling_gen.unmarshalServer\n );\n /**\n * Stop an Elastic Metal server. Stop the server associated with the ID. The\n * server remains allocated to your account and all data remains on the local\n * storage of the server.\n *\n * @param request - The request {@link StopServerRequest}\n * @returns A Promise of Server\n */\n stopServer = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/baremetal/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/stop`\n },\n marshalling_gen.unmarshalServer\n );\n pageOfListServerEvents = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/baremetal/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/events`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListServerEventsResponse\n );\n /**\n * List server events. List event (i.e. start/stop/reboot) associated to the\n * server ID.\n *\n * @param request - The request {@link ListServerEventsRequest}\n * @returns A Promise of ListServerEventsResponse\n */\n listServerEvents = (request) => resourcePaginator.enrichForPagination(\"events\", this.pageOfListServerEvents, request);\n /**\n * Get default partitioning schema. Get the default partitioning schema for\n * the given offer ID and OS ID.\n *\n * @param request - The request {@link GetDefaultPartitioningSchemaRequest}\n * @returns A Promise of Schema\n */\n getDefaultPartitioningSchema = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/baremetal/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/partitioning-schemas/default`,\n urlParams: marshalling.urlParams(\n [\"offer_id\", request.offerId],\n [\"os_id\", request.osId]\n )\n },\n marshalling_gen.unmarshalSchema\n );\n /**\n * Validate client partitioning schema. Validate the incoming partitioning\n * schema from a user before installing the server. Return default ErrorCode\n * if invalid.\n *\n * @param request - The request {@link ValidatePartitioningSchemaRequest}\n */\n validatePartitioningSchema = (request) => this.client.fetch({\n body: JSON.stringify(\n marshalling_gen.marshalValidatePartitioningSchemaRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/baremetal/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/partitioning-schemas/validate`\n });\n /**\n * Start BMC access. Start BMC (Baseboard Management Controller) access\n * associated with the ID. The BMC (Baseboard Management Controller) access is\n * available one hour after the installation of the server. You need first to\n * create an option Remote Access. You will find the ID and the price with a\n * call to listOffers\n * (https://developers.scaleway.com/en/products/baremetal/api/#get-78db92).\n * Then add the option\n * https://developers.scaleway.com/en/products/baremetal/api/#post-b14abd.\n * After adding the BMC option, you need to Get Remote Access to get the\n * login/password\n * https://developers.scaleway.com/en/products/baremetal/api/#get-cefc0f. Do\n * not forget to delete the Option after use.\n *\n * @param request - The request {@link StartBMCAccessRequest}\n * @returns A Promise of BMCAccess\n */\n startBMCAccess = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalStartBMCAccessRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/baremetal/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/bmc-access`\n },\n marshalling_gen.unmarshalBMCAccess\n );\n /**\n * Get BMC access. Get the BMC (Baseboard Management Controller) access\n * associated with the ID, including the URL and login information needed to\n * connect.\n *\n * @param request - The request {@link GetBMCAccessRequest}\n * @returns A Promise of BMCAccess\n */\n getBMCAccess = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/baremetal/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/bmc-access`\n },\n marshalling_gen.unmarshalBMCAccess\n );\n /**\n * Stop BMC access. Stop BMC (Baseboard Management Controller) access\n * associated with the ID.\n *\n * @param request - The request {@link StopBMCAccessRequest}\n */\n stopBMCAccess = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/baremetal/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/bmc-access`\n });\n /**\n * Update IP. Configure the IP address associated with the server ID and IP\n * ID. You can use this method to set a reverse DNS for an IP address.\n *\n * @param request - The request {@link UpdateIPRequest}\n * @returns A Promise of IP\n */\n updateIP = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateIPRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/baremetal/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/ips/${marshalling.validatePathParam(\"ipId\", request.ipId)}`\n },\n marshalling_gen.unmarshalIP\n );\n /**\n * Add server option. Add an option, such as Private Networks, to a specific\n * server.\n *\n * @param request - The request {@link AddOptionServerRequest}\n * @returns A Promise of Server\n */\n addOptionServer = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalAddOptionServerRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/baremetal/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/options/${marshalling.validatePathParam(\"optionId\", request.optionId)}`\n },\n marshalling_gen.unmarshalServer\n );\n /**\n * Delete server option. Delete an option from a specific server.\n *\n * @param request - The request {@link DeleteOptionServerRequest}\n * @returns A Promise of Server\n */\n deleteOptionServer = (request) => this.client.fetch(\n {\n method: \"DELETE\",\n path: `/baremetal/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/options/${marshalling.validatePathParam(\"optionId\", request.optionId)}`\n },\n marshalling_gen.unmarshalServer\n );\n pageOfListOffers = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/baremetal/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/offers`,\n urlParams: marshalling.urlParams(\n [\"name\", request.name],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"subscription_period\", request.subscriptionPeriod]\n )\n },\n marshalling_gen.unmarshalListOffersResponse\n );\n /**\n * List offers. List all available Elastic Metal server configurations.\n *\n * @param request - The request {@link ListOffersRequest}\n * @returns A Promise of ListOffersResponse\n */\n listOffers = (request = {}) => resourcePaginator.enrichForPagination(\"offers\", this.pageOfListOffers, request);\n /**\n * Get offer. Get details of an offer identified by its offer ID.\n *\n * @param request - The request {@link GetOfferRequest}\n * @returns A Promise of Offer\n */\n getOffer = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/baremetal/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/offers/${marshalling.validatePathParam(\"offerId\", request.offerId)}`\n },\n marshalling_gen.unmarshalOffer\n );\n /**\n * Get option. Return specific option for the ID.\n *\n * @param request - The request {@link GetOptionRequest}\n * @returns A Promise of Option\n */\n getOption = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/baremetal/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/options/${marshalling.validatePathParam(\"optionId\", request.optionId)}`\n },\n marshalling_gen.unmarshalOption\n );\n pageOfListOptions = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/baremetal/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/options`,\n urlParams: marshalling.urlParams(\n [\"name\", request.name],\n [\"offer_id\", request.offerId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListOptionsResponse\n );\n /**\n * List options. List all options matching with filters.\n *\n * @param request - The request {@link ListOptionsRequest}\n * @returns A Promise of ListOptionsResponse\n */\n listOptions = (request = {}) => resourcePaginator.enrichForPagination(\"options\", this.pageOfListOptions, request);\n pageOfListSettings = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/baremetal/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/settings`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\n \"project_id\",\n request.projectId ?? this.client.settings.defaultProjectId\n ]\n )\n },\n marshalling_gen.unmarshalListSettingsResponse\n );\n /**\n * List all settings. Return all settings for a Project ID.\n *\n * @param request - The request {@link ListSettingsRequest}\n * @returns A Promise of ListSettingsResponse\n */\n listSettings = (request = {}) => resourcePaginator.enrichForPagination(\"settings\", this.pageOfListSettings, request);\n /**\n * Update setting. Update a setting for a Project ID (enable or disable).\n *\n * @param request - The request {@link UpdateSettingRequest}\n * @returns A Promise of Setting\n */\n updateSetting = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateSettingRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/baremetal/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/settings/${marshalling.validatePathParam(\"settingId\", request.settingId)}`\n },\n marshalling_gen.unmarshalSetting\n );\n pageOfListOS = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/baremetal/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/os`,\n urlParams: marshalling.urlParams(\n [\"offer_id\", request.offerId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListOSResponse\n );\n /**\n * List available OSes. List all OSes that are available for installation on\n * Elastic Metal servers.\n *\n * @param request - The request {@link ListOSRequest}\n * @returns A Promise of ListOSResponse\n */\n listOS = (request = {}) => resourcePaginator.enrichForPagination(\"os\", this.pageOfListOS, request);\n /**\n * Get OS with an ID. Return the specific OS for the ID.\n *\n * @param request - The request {@link GetOSRequest}\n * @returns A Promise of OS\n */\n getOS = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/baremetal/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/os/${marshalling.validatePathParam(\"osId\", request.osId)}`\n },\n marshalling_gen.unmarshalOS\n );\n}\nclass PrivateNetworkAPI extends api.API {\n /** Lists the available zones of the API. */\n static LOCALITIES = [\"fr-par-2\"];\n /**\n * Add a server to a Private Network.\n *\n * @param request - The request\n * {@link PrivateNetworkApiAddServerPrivateNetworkRequest}\n * @returns A Promise of ServerPrivateNetwork\n */\n addServerPrivateNetwork = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalPrivateNetworkApiAddServerPrivateNetworkRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/baremetal/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/private-networks`\n },\n marshalling_gen.unmarshalServerPrivateNetwork\n );\n /**\n * Set multiple Private Networks on a server.\n *\n * @param request - The request\n * {@link PrivateNetworkApiSetServerPrivateNetworksRequest}\n * @returns A Promise of SetServerPrivateNetworksResponse\n */\n setServerPrivateNetworks = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalPrivateNetworkApiSetServerPrivateNetworksRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"PUT\",\n path: `/baremetal/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/private-networks`\n },\n marshalling_gen.unmarshalSetServerPrivateNetworksResponse\n );\n pageOfListServerPrivateNetworks = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/baremetal/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/server-private-networks`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"private_network_id\", request.privateNetworkId],\n [\"project_id\", request.projectId],\n [\"server_id\", request.serverId]\n )\n },\n marshalling_gen.unmarshalListServerPrivateNetworksResponse\n );\n /**\n * List the Private Networks of a server.\n *\n * @param request - The request\n * {@link PrivateNetworkApiListServerPrivateNetworksRequest}\n * @returns A Promise of ListServerPrivateNetworksResponse\n */\n listServerPrivateNetworks = (request = {}) => resourcePaginator.enrichForPagination(\n \"serverPrivateNetworks\",\n this.pageOfListServerPrivateNetworks,\n request\n );\n /**\n * Delete a Private Network.\n *\n * @param request - The request\n * {@link PrivateNetworkApiDeleteServerPrivateNetworkRequest}\n */\n deleteServerPrivateNetwork = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/baremetal/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/private-networks/${marshalling.validatePathParam(\"privateNetworkId\", request.privateNetworkId)}`\n });\n}\nexports.API = API;\nexports.PrivateNetworkAPI = PrivateNetworkAPI;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst intervalRetrier = require(\"../../../internal/async/interval-retrier.cjs\");\nconst api_gen = require(\"./api.gen.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nclass BaremetalV1UtilsAPI extends api_gen.API {\n /**\n * Waits for {@link ServerInstall} to be in a final state.\n *\n * @param request - The request {@link GetServerRequest}\n * @param options - The waiting options\n * @returns A Promise of ServerInstall\n */\n waitForServerInstall = (request, options) => intervalRetrier.tryAtIntervals(\n async () => {\n const value = await this.getServer(request).then((server) => {\n if (!server.install) {\n throw new Error(\n `Server creation has not begun for server ${request.serverId}`\n );\n }\n return server.install;\n });\n return {\n done: !content_gen.SERVER_INSTALL_TRANSIENT_STATUSES.includes(value.status),\n value\n };\n },\n intervalRetrier.createExponentialBackoffStrategy(\n options?.minDelay ?? 1,\n options?.maxDelay ?? 30\n ),\n options?.timeout\n );\n}\nexports.BaremetalV1UtilsAPI = BaremetalV1UtilsAPI;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst SERVER_INSTALL_TRANSIENT_STATUSES = [\n \"to_install\",\n \"installing\"\n];\nconst SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES = [\"attaching\", \"detaching\"];\nconst SERVER_TRANSIENT_STATUSES = [\n \"delivering\",\n \"stopping\",\n \"starting\",\n \"deleting\",\n \"ordered\",\n \"resetting\"\n];\nexports.SERVER_INSTALL_TRANSIENT_STATUSES = SERVER_INSTALL_TRANSIENT_STATUSES;\nexports.SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES = SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES;\nexports.SERVER_TRANSIENT_STATUSES = SERVER_TRANSIENT_STATUSES;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api_utils = require(\"./api.utils.cjs\");\nconst api_gen = require(\"./api.gen.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nconst validationRules_gen = require(\"./validation-rules.gen.cjs\");\nexports.API = api_utils.BaremetalV1UtilsAPI;\nexports.PrivateNetworkAPI = api_gen.PrivateNetworkAPI;\nexports.SERVER_INSTALL_TRANSIENT_STATUSES = content_gen.SERVER_INSTALL_TRANSIENT_STATUSES;\nexports.SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES = content_gen.SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES;\nexports.SERVER_TRANSIENT_STATUSES = content_gen.SERVER_TRANSIENT_STATUSES;\nexports.ValidationRules = validationRules_gen;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst json = require(\"../../../helpers/json.cjs\");\nconst customMarshalling = require(\"../../../scw/custom-marshalling.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nconst unmarshalSchemaPartition = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SchemaPartition' failed as data isn't a dictionary.`\n );\n }\n return {\n label: data.label,\n number: data.number,\n size: data.size\n };\n};\nconst unmarshalSchemaPool = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SchemaPool' failed as data isn't a dictionary.`\n );\n }\n return {\n devices: data.devices,\n filesystemOptions: data.filesystem_options,\n name: data.name,\n options: data.options,\n type: data.type\n };\n};\nconst unmarshalSchemaDisk = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SchemaDisk' failed as data isn't a dictionary.`\n );\n }\n return {\n device: data.device,\n partitions: marshalling.unmarshalArrayOfObject(\n data.partitions,\n unmarshalSchemaPartition\n )\n };\n};\nconst unmarshalSchemaFilesystem = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SchemaFilesystem' failed as data isn't a dictionary.`\n );\n }\n return {\n device: data.device,\n format: data.format,\n mountpoint: data.mountpoint\n };\n};\nconst unmarshalSchemaRAID = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SchemaRAID' failed as data isn't a dictionary.`\n );\n }\n return {\n devices: data.devices,\n level: data.level,\n name: data.name\n };\n};\nconst unmarshalSchemaZFS = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SchemaZFS' failed as data isn't a dictionary.`\n );\n }\n return {\n pools: marshalling.unmarshalArrayOfObject(data.pools, unmarshalSchemaPool)\n };\n};\nconst unmarshalSchema = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Schema' failed as data isn't a dictionary.`\n );\n }\n return {\n disks: marshalling.unmarshalArrayOfObject(data.disks, unmarshalSchemaDisk),\n filesystems: marshalling.unmarshalArrayOfObject(\n data.filesystems,\n unmarshalSchemaFilesystem\n ),\n raids: marshalling.unmarshalArrayOfObject(data.raids, unmarshalSchemaRAID),\n zfs: data.zfs ? unmarshalSchemaZFS(data.zfs) : void 0\n };\n};\nconst unmarshalIP = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'IP' failed as data isn't a dictionary.`\n );\n }\n return {\n address: data.address,\n id: data.id,\n reverse: data.reverse,\n reverseStatus: data.reverse_status,\n reverseStatusMessage: data.reverse_status_message,\n version: data.version\n };\n};\nconst unmarshalOSOSField = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'OSOSField' failed as data isn't a dictionary.`\n );\n }\n return {\n defaultValue: data.default_value,\n editable: data.editable,\n required: data.required\n };\n};\nconst unmarshalOS = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'OS' failed as data isn't a dictionary.`\n );\n }\n return {\n allowed: data.allowed,\n customPartitioningSupported: data.custom_partitioning_supported,\n enabled: data.enabled,\n id: data.id,\n licenseRequired: data.license_required,\n logoUrl: data.logo_url,\n name: data.name,\n password: data.password ? unmarshalOSOSField(data.password) : void 0,\n servicePassword: data.service_password ? unmarshalOSOSField(data.service_password) : void 0,\n serviceUser: data.service_user ? unmarshalOSOSField(data.service_user) : void 0,\n ssh: data.ssh ? unmarshalOSOSField(data.ssh) : void 0,\n user: data.user ? unmarshalOSOSField(data.user) : void 0,\n version: data.version\n };\n};\nconst unmarshalCertificationOption = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'CertificationOption' failed as data isn't a dictionary.`\n );\n }\n return {};\n};\nconst unmarshalLicenseOption = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'LicenseOption' failed as data isn't a dictionary.`\n );\n }\n return {\n osId: data.os_id\n };\n};\nconst unmarshalPrivateNetworkOption = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'PrivateNetworkOption' failed as data isn't a dictionary.`\n );\n }\n return {};\n};\nconst unmarshalPublicBandwidthOption = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'PublicBandwidthOption' failed as data isn't a dictionary.`\n );\n }\n return {\n bandwidthInBps: data.bandwidth_in_bps\n };\n};\nconst unmarshalRemoteAccessOption = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'RemoteAccessOption' failed as data isn't a dictionary.`\n );\n }\n return {};\n};\nconst unmarshalCPU = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'CPU' failed as data isn't a dictionary.`\n );\n }\n return {\n benchmark: data.benchmark,\n coreCount: data.core_count,\n frequency: data.frequency,\n name: data.name,\n threadCount: data.thread_count\n };\n};\nconst unmarshalDisk = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Disk' failed as data isn't a dictionary.`\n );\n }\n return {\n capacity: data.capacity,\n type: data.type\n };\n};\nconst unmarshalMemory = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Memory' failed as data isn't a dictionary.`\n );\n }\n return {\n capacity: data.capacity,\n frequency: data.frequency,\n isEcc: data.is_ecc,\n type: data.type\n };\n};\nconst unmarshalOfferOptionOffer = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'OfferOptionOffer' failed as data isn't a dictionary.`\n );\n }\n return {\n certification: data.certification ? unmarshalCertificationOption(data.certification) : void 0,\n enabled: data.enabled,\n id: data.id,\n license: data.license ? unmarshalLicenseOption(data.license) : void 0,\n manageable: data.manageable,\n name: data.name,\n osId: data.os_id,\n price: data.price ? customMarshalling.unmarshalMoney(data.price) : void 0,\n privateNetwork: data.private_network ? unmarshalPrivateNetworkOption(data.private_network) : void 0,\n publicBandwidth: data.public_bandwidth ? unmarshalPublicBandwidthOption(data.public_bandwidth) : void 0,\n remoteAccess: data.remote_access ? unmarshalRemoteAccessOption(data.remote_access) : void 0,\n subscriptionPeriod: data.subscription_period\n };\n};\nconst unmarshalPersistentMemory = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'PersistentMemory' failed as data isn't a dictionary.`\n );\n }\n return {\n capacity: data.capacity,\n frequency: data.frequency,\n type: data.type\n };\n};\nconst unmarshalRaidController = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'RaidController' failed as data isn't a dictionary.`\n );\n }\n return {\n model: data.model,\n raidLevel: data.raid_level\n };\n};\nconst unmarshalOffer = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Offer' failed as data isn't a dictionary.`\n );\n }\n return {\n bandwidth: data.bandwidth,\n commercialRange: data.commercial_range,\n cpus: marshalling.unmarshalArrayOfObject(data.cpus, unmarshalCPU),\n disks: marshalling.unmarshalArrayOfObject(data.disks, unmarshalDisk),\n enable: data.enable,\n fee: data.fee ? customMarshalling.unmarshalMoney(data.fee) : void 0,\n id: data.id,\n incompatibleOsIds: data.incompatible_os_ids,\n maxBandwidth: data.max_bandwidth,\n memories: marshalling.unmarshalArrayOfObject(data.memories, unmarshalMemory),\n name: data.name,\n operationPath: data.operation_path,\n options: marshalling.unmarshalArrayOfObject(data.options, unmarshalOfferOptionOffer),\n persistentMemories: marshalling.unmarshalArrayOfObject(\n data.persistent_memories,\n unmarshalPersistentMemory\n ),\n pricePerHour: data.price_per_hour ? customMarshalling.unmarshalMoney(data.price_per_hour) : void 0,\n pricePerMonth: data.price_per_month ? customMarshalling.unmarshalMoney(data.price_per_month) : void 0,\n privateBandwidth: data.private_bandwidth,\n quotaName: data.quota_name,\n raidControllers: marshalling.unmarshalArrayOfObject(\n data.raid_controllers,\n unmarshalRaidController\n ),\n sharedBandwidth: data.shared_bandwidth,\n stock: data.stock,\n subscriptionPeriod: data.subscription_period,\n tags: data.tags\n };\n};\nconst unmarshalOption = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Option' failed as data isn't a dictionary.`\n );\n }\n return {\n certification: data.certification ? unmarshalCertificationOption(data.certification) : void 0,\n id: data.id,\n license: data.license ? unmarshalLicenseOption(data.license) : void 0,\n manageable: data.manageable,\n name: data.name,\n privateNetwork: data.private_network ? unmarshalPrivateNetworkOption(data.private_network) : void 0,\n publicBandwidth: data.public_bandwidth ? unmarshalPublicBandwidthOption(data.public_bandwidth) : void 0,\n remoteAccess: data.remote_access ? unmarshalRemoteAccessOption(data.remote_access) : void 0\n };\n};\nconst unmarshalServerPrivateNetwork = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ServerPrivateNetwork' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n id: data.id,\n privateNetworkId: data.private_network_id,\n projectId: data.project_id,\n serverId: data.server_id,\n status: data.status,\n updatedAt: marshalling.unmarshalDate(data.updated_at),\n vlan: data.vlan\n };\n};\nconst unmarshalServerInstall = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ServerInstall' failed as data isn't a dictionary.`\n );\n }\n return {\n hostname: data.hostname,\n osId: data.os_id,\n partitioningSchema: data.partitioning_schema ? unmarshalSchema(data.partitioning_schema) : void 0,\n serviceUrl: data.service_url,\n serviceUser: data.service_user,\n sshKeyIds: data.ssh_key_ids,\n status: data.status,\n user: data.user\n };\n};\nconst unmarshalServerOption = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ServerOption' failed as data isn't a dictionary.`\n );\n }\n return {\n certification: data.certification ? unmarshalCertificationOption(data.certification) : void 0,\n expiresAt: marshalling.unmarshalDate(data.expires_at),\n id: data.id,\n license: data.license ? unmarshalLicenseOption(data.license) : void 0,\n manageable: data.manageable,\n name: data.name,\n privateNetwork: data.private_network ? unmarshalPrivateNetworkOption(data.private_network) : void 0,\n publicBandwidth: data.public_bandwidth ? unmarshalPublicBandwidthOption(data.public_bandwidth) : void 0,\n remoteAccess: data.remote_access ? unmarshalRemoteAccessOption(data.remote_access) : void 0,\n status: data.status\n };\n};\nconst unmarshalServerRescueServer = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ServerRescueServer' failed as data isn't a dictionary.`\n );\n }\n return {\n password: data.password,\n user: data.user\n };\n};\nconst unmarshalServer = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Server' failed as data isn't a dictionary.`\n );\n }\n return {\n bootType: data.boot_type,\n createdAt: marshalling.unmarshalDate(data.created_at),\n description: data.description,\n domain: data.domain,\n id: data.id,\n install: data.install ? unmarshalServerInstall(data.install) : void 0,\n ips: marshalling.unmarshalArrayOfObject(data.ips, unmarshalIP),\n name: data.name,\n offerId: data.offer_id,\n offerName: data.offer_name,\n options: marshalling.unmarshalArrayOfObject(data.options, unmarshalServerOption),\n organizationId: data.organization_id,\n pingStatus: data.ping_status,\n projectId: data.project_id,\n rescueServer: data.rescue_server ? unmarshalServerRescueServer(data.rescue_server) : void 0,\n status: data.status,\n tags: data.tags,\n updatedAt: marshalling.unmarshalDate(data.updated_at),\n zone: data.zone\n };\n};\nconst unmarshalSetting = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Setting' failed as data isn't a dictionary.`\n );\n }\n return {\n enabled: data.enabled,\n id: data.id,\n projectId: data.project_id,\n type: data.type\n };\n};\nconst unmarshalBMCAccess = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'BMCAccess' failed as data isn't a dictionary.`\n );\n }\n return {\n expiresAt: marshalling.unmarshalDate(data.expires_at),\n login: data.login,\n password: data.password,\n url: data.url\n };\n};\nconst unmarshalGetServerMetricsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'GetServerMetricsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n pings: data.pings ? customMarshalling.unmarshalTimeSeries(data.pings) : void 0\n };\n};\nconst unmarshalListOSResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListOSResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n os: marshalling.unmarshalArrayOfObject(data.os, unmarshalOS),\n totalCount: data.total_count\n };\n};\nconst unmarshalListOffersResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListOffersResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n offers: marshalling.unmarshalArrayOfObject(data.offers, unmarshalOffer),\n totalCount: data.total_count\n };\n};\nconst unmarshalListOptionsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListOptionsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n options: marshalling.unmarshalArrayOfObject(data.options, unmarshalOption),\n totalCount: data.total_count\n };\n};\nconst unmarshalServerEvent = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ServerEvent' failed as data isn't a dictionary.`\n );\n }\n return {\n action: data.action,\n createdAt: marshalling.unmarshalDate(data.created_at),\n id: data.id,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalListServerEventsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListServerEventsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n events: marshalling.unmarshalArrayOfObject(data.events, unmarshalServerEvent),\n totalCount: data.total_count\n };\n};\nconst unmarshalListServerPrivateNetworksResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListServerPrivateNetworksResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n serverPrivateNetworks: marshalling.unmarshalArrayOfObject(\n data.server_private_networks,\n unmarshalServerPrivateNetwork\n ),\n totalCount: data.total_count\n };\n};\nconst unmarshalListServersResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListServersResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n servers: marshalling.unmarshalArrayOfObject(data.servers, unmarshalServer),\n totalCount: data.total_count\n };\n};\nconst unmarshalListSettingsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListSettingsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n settings: marshalling.unmarshalArrayOfObject(data.settings, unmarshalSetting),\n totalCount: data.total_count\n };\n};\nconst unmarshalSetServerPrivateNetworksResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SetServerPrivateNetworksResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n serverPrivateNetworks: marshalling.unmarshalArrayOfObject(\n data.server_private_networks,\n unmarshalServerPrivateNetwork\n )\n };\n};\nconst marshalAddOptionServerRequest = (request, defaults) => ({\n expires_at: request.expiresAt\n});\nconst marshalSchemaPartition = (request, defaults) => ({\n label: request.label,\n number: request.number,\n size: request.size\n});\nconst marshalSchemaPool = (request, defaults) => ({\n devices: request.devices,\n filesystem_options: request.filesystemOptions,\n name: request.name,\n options: request.options,\n type: request.type\n});\nconst marshalSchemaDisk = (request, defaults) => ({\n device: request.device,\n partitions: request.partitions.map(\n (elt) => marshalSchemaPartition(elt)\n )\n});\nconst marshalSchemaFilesystem = (request, defaults) => ({\n device: request.device,\n format: request.format,\n mountpoint: request.mountpoint\n});\nconst marshalSchemaRAID = (request, defaults) => ({\n devices: request.devices,\n level: request.level,\n name: request.name\n});\nconst marshalSchemaZFS = (request, defaults) => ({\n pools: request.pools.map((elt) => marshalSchemaPool(elt))\n});\nconst marshalSchema = (request, defaults) => ({\n disks: request.disks.map((elt) => marshalSchemaDisk(elt)),\n filesystems: request.filesystems.map(\n (elt) => marshalSchemaFilesystem(elt)\n ),\n raids: request.raids.map((elt) => marshalSchemaRAID(elt)),\n zfs: request.zfs !== void 0 ? marshalSchemaZFS(request.zfs) : void 0\n});\nconst marshalCreateServerRequestInstall = (request, defaults) => ({\n hostname: request.hostname,\n os_id: request.osId,\n partitioning_schema: request.partitioningSchema !== void 0 ? marshalSchema(request.partitioningSchema) : void 0,\n password: request.password,\n service_password: request.servicePassword,\n service_user: request.serviceUser,\n ssh_key_ids: request.sshKeyIds,\n user: request.user\n});\nconst marshalCreateServerRequest = (request, defaults) => ({\n description: request.description,\n install: request.install !== void 0 ? marshalCreateServerRequestInstall(request.install) : void 0,\n name: request.name,\n offer_id: request.offerId,\n option_ids: request.optionIds,\n tags: request.tags,\n ...marshalling.resolveOneOf([\n {\n default: defaults.defaultProjectId,\n param: \"project_id\",\n value: request.projectId\n },\n {\n default: defaults.defaultOrganizationId,\n param: \"organization_id\",\n value: request.organizationId\n }\n ])\n});\nconst marshalInstallServerRequest = (request, defaults) => ({\n hostname: request.hostname,\n os_id: request.osId,\n partitioning_schema: request.partitioningSchema !== void 0 ? marshalSchema(request.partitioningSchema) : void 0,\n password: request.password,\n service_password: request.servicePassword,\n service_user: request.serviceUser,\n ssh_key_ids: request.sshKeyIds,\n user: request.user\n});\nconst marshalPrivateNetworkApiAddServerPrivateNetworkRequest = (request, defaults) => ({\n private_network_id: request.privateNetworkId\n});\nconst marshalPrivateNetworkApiSetServerPrivateNetworksRequest = (request, defaults) => ({\n private_network_ids: request.privateNetworkIds\n});\nconst marshalRebootServerRequest = (request, defaults) => ({\n boot_type: request.bootType\n});\nconst marshalStartBMCAccessRequest = (request, defaults) => ({\n ip: request.ip\n});\nconst marshalStartServerRequest = (request, defaults) => ({\n boot_type: request.bootType\n});\nconst marshalUpdateIPRequest = (request, defaults) => ({\n reverse: request.reverse\n});\nconst marshalUpdateServerRequest = (request, defaults) => ({\n description: request.description,\n name: request.name,\n tags: request.tags\n});\nconst marshalUpdateSettingRequest = (request, defaults) => ({\n enabled: request.enabled\n});\nconst marshalValidatePartitioningSchemaRequest = (request, defaults) => ({\n offer_id: request.offerId,\n os_id: request.osId,\n partitioning_schema: request.partitioningSchema !== void 0 ? marshalSchema(request.partitioningSchema) : void 0\n});\nexports.marshalAddOptionServerRequest = marshalAddOptionServerRequest;\nexports.marshalCreateServerRequest = marshalCreateServerRequest;\nexports.marshalInstallServerRequest = marshalInstallServerRequest;\nexports.marshalPrivateNetworkApiAddServerPrivateNetworkRequest = marshalPrivateNetworkApiAddServerPrivateNetworkRequest;\nexports.marshalPrivateNetworkApiSetServerPrivateNetworksRequest = marshalPrivateNetworkApiSetServerPrivateNetworksRequest;\nexports.marshalRebootServerRequest = marshalRebootServerRequest;\nexports.marshalSchema = marshalSchema;\nexports.marshalStartBMCAccessRequest = marshalStartBMCAccessRequest;\nexports.marshalStartServerRequest = marshalStartServerRequest;\nexports.marshalUpdateIPRequest = marshalUpdateIPRequest;\nexports.marshalUpdateServerRequest = marshalUpdateServerRequest;\nexports.marshalUpdateSettingRequest = marshalUpdateSettingRequest;\nexports.marshalValidatePartitioningSchemaRequest = marshalValidatePartitioningSchemaRequest;\nexports.unmarshalBMCAccess = unmarshalBMCAccess;\nexports.unmarshalGetServerMetricsResponse = unmarshalGetServerMetricsResponse;\nexports.unmarshalIP = unmarshalIP;\nexports.unmarshalListOSResponse = unmarshalListOSResponse;\nexports.unmarshalListOffersResponse = unmarshalListOffersResponse;\nexports.unmarshalListOptionsResponse = unmarshalListOptionsResponse;\nexports.unmarshalListServerEventsResponse = unmarshalListServerEventsResponse;\nexports.unmarshalListServerPrivateNetworksResponse = unmarshalListServerPrivateNetworksResponse;\nexports.unmarshalListServersResponse = unmarshalListServersResponse;\nexports.unmarshalListSettingsResponse = unmarshalListSettingsResponse;\nexports.unmarshalOS = unmarshalOS;\nexports.unmarshalOffer = unmarshalOffer;\nexports.unmarshalOption = unmarshalOption;\nexports.unmarshalSchema = unmarshalSchema;\nexports.unmarshalServer = unmarshalServer;\nexports.unmarshalServerPrivateNetwork = unmarshalServerPrivateNetwork;\nexports.unmarshalSetServerPrivateNetworksResponse = unmarshalSetServerPrivateNetworksResponse;\nexports.unmarshalSetting = unmarshalSetting;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst CreateServerRequest = {\n description: {\n maxLength: 255\n },\n name: {\n minLength: 1\n }\n};\nconst CreateServerRequestInstall = {\n hostname: {\n maxLength: 255\n },\n password: {\n maxLength: 255\n },\n servicePassword: {\n maxLength: 255\n },\n serviceUser: {\n maxLength: 255\n },\n user: {\n maxLength: 255\n }\n};\nconst InstallServerRequest = {\n hostname: {\n maxLength: 255\n },\n password: {\n maxLength: 255\n },\n servicePassword: {\n maxLength: 255\n },\n serviceUser: {\n maxLength: 255\n },\n user: {\n maxLength: 255\n }\n};\nconst ListOSRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nconst ListOffersRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nconst ListOptionsRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nconst ListServerEventsRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nconst ListServersRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nconst ListSettingsRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nconst UpdateServerRequest = {\n description: {\n maxLength: 255\n },\n name: {\n maxLength: 255\n }\n};\nexports.CreateServerRequest = CreateServerRequest;\nexports.CreateServerRequestInstall = CreateServerRequestInstall;\nexports.InstallServerRequest = InstallServerRequest;\nexports.ListOSRequest = ListOSRequest;\nexports.ListOffersRequest = ListOffersRequest;\nexports.ListOptionsRequest = ListOptionsRequest;\nexports.ListServerEventsRequest = ListServerEventsRequest;\nexports.ListServersRequest = ListServersRequest;\nexports.ListSettingsRequest = ListSettingsRequest;\nexports.UpdateServerRequest = UpdateServerRequest;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api = require(\"../../../scw/api.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst resourcePaginator = require(\"../../../scw/fetch/resource-paginator.cjs\");\nconst marshalling_gen = require(\"./marshalling.gen.cjs\");\nconst jsonContentHeaders = {\n \"Content-Type\": \"application/json; charset=utf-8\"\n};\nclass PrivateNetworkAPI extends api.API {\n /** Lists the available zones of the API. */\n static LOCALITIES = [\n \"fr-par-1\",\n \"fr-par-2\",\n \"nl-ams-1\",\n \"nl-ams-2\",\n \"pl-waw-2\",\n \"pl-waw-3\"\n ];\n /**\n * Add a server to a Private Network. Add an Elastic Metal server to a Private\n * Network.\n *\n * @param request - The request\n * {@link PrivateNetworkApiAddServerPrivateNetworkRequest}\n * @returns A Promise of ServerPrivateNetwork\n */\n addServerPrivateNetwork = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalPrivateNetworkApiAddServerPrivateNetworkRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/baremetal/v3/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/private-networks`\n },\n marshalling_gen.unmarshalServerPrivateNetwork\n );\n /**\n * Set multiple Private Networks on a server. Configure multiple Private\n * Networks on an Elastic Metal server.\n *\n * @param request - The request\n * {@link PrivateNetworkApiSetServerPrivateNetworksRequest}\n * @returns A Promise of SetServerPrivateNetworksResponse\n */\n setServerPrivateNetworks = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalPrivateNetworkApiSetServerPrivateNetworksRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"PUT\",\n path: `/baremetal/v3/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/private-networks`\n },\n marshalling_gen.unmarshalSetServerPrivateNetworksResponse\n );\n pageOfListServerPrivateNetworks = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/baremetal/v3/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/server-private-networks`,\n urlParams: marshalling.urlParams(\n [\"ipam_ip_ids\", request.ipamIpIds],\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"private_network_id\", request.privateNetworkId],\n [\"project_id\", request.projectId],\n [\"server_id\", request.serverId]\n )\n },\n marshalling_gen.unmarshalListServerPrivateNetworksResponse\n );\n /**\n * List the Private Networks of a server. List the Private Networks of an\n * Elastic Metal server.\n *\n * @param request - The request\n * {@link PrivateNetworkApiListServerPrivateNetworksRequest}\n * @returns A Promise of ListServerPrivateNetworksResponse\n */\n listServerPrivateNetworks = (request = {}) => resourcePaginator.enrichForPagination(\n \"serverPrivateNetworks\",\n this.pageOfListServerPrivateNetworks,\n request\n );\n /**\n * Delete a Private Network.\n *\n * @param request - The request\n * {@link PrivateNetworkApiDeleteServerPrivateNetworkRequest}\n */\n deleteServerPrivateNetwork = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/baremetal/v3/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/private-networks/${marshalling.validatePathParam(\"privateNetworkId\", request.privateNetworkId)}`\n });\n}\nexports.PrivateNetworkAPI = PrivateNetworkAPI;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES = [\"attaching\", \"detaching\"];\nexports.SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES = SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api_gen = require(\"./api.gen.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nexports.PrivateNetworkAPI = api_gen.PrivateNetworkAPI;\nexports.SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES = content_gen.SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst json = require(\"../../../helpers/json.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst unmarshalServerPrivateNetwork = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ServerPrivateNetwork' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n id: data.id,\n ipamIpIds: data.ipam_ip_ids,\n privateNetworkId: data.private_network_id,\n projectId: data.project_id,\n serverId: data.server_id,\n status: data.status,\n updatedAt: marshalling.unmarshalDate(data.updated_at),\n vlan: data.vlan\n };\n};\nconst unmarshalListServerPrivateNetworksResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListServerPrivateNetworksResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n serverPrivateNetworks: marshalling.unmarshalArrayOfObject(\n data.server_private_networks,\n unmarshalServerPrivateNetwork\n ),\n totalCount: data.total_count\n };\n};\nconst unmarshalSetServerPrivateNetworksResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SetServerPrivateNetworksResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n serverPrivateNetworks: marshalling.unmarshalArrayOfObject(\n data.server_private_networks,\n unmarshalServerPrivateNetwork\n )\n };\n};\nconst marshalPrivateNetworkApiAddServerPrivateNetworkRequest = (request, defaults) => ({\n ipam_ip_ids: request.ipamIpIds,\n private_network_id: request.privateNetworkId\n});\nconst marshalPrivateNetworkApiSetServerPrivateNetworksRequest = (request, defaults) => ({\n per_private_network_ipam_ip_ids: request.perPrivateNetworkIpamIpIds\n});\nexports.marshalPrivateNetworkApiAddServerPrivateNetworkRequest = marshalPrivateNetworkApiAddServerPrivateNetworkRequest;\nexports.marshalPrivateNetworkApiSetServerPrivateNetworksRequest = marshalPrivateNetworkApiSetServerPrivateNetworksRequest;\nexports.unmarshalListServerPrivateNetworksResponse = unmarshalListServerPrivateNetworksResponse;\nexports.unmarshalServerPrivateNetwork = unmarshalServerPrivateNetwork;\nexports.unmarshalSetServerPrivateNetworksResponse = unmarshalSetServerPrivateNetworksResponse;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst index_gen = require(\"./v2alpha1/index.gen.cjs\");\nconst index_gen$1 = require(\"./v2beta1/index.gen.cjs\");\nexports.v2alpha1 = index_gen;\nexports.v2beta1 = index_gen$1;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api = require(\"../../../scw/api.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst resourcePaginator = require(\"../../../scw/fetch/resource-paginator.cjs\");\nconst marshalling_gen = require(\"./marshalling.gen.cjs\");\nclass API extends api.API {\n /**\n * Get current month's consumption. The consumption reflects the amount of\n * money you have spent for the products you have used. The consumption value\n * is monetary and is not computed in real time.\n *\n * @param request - The request {@link GetConsumptionRequest}\n * @returns A Promise of GetConsumptionResponse\n */\n getConsumption = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/billing/v2alpha1/consumption`,\n urlParams: marshalling.urlParams([\n \"organization_id\",\n request.organizationId ?? this.client.settings.defaultOrganizationId\n ])\n },\n marshalling_gen.unmarshalGetConsumptionResponse\n );\n pageOfListInvoices = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/billing/v2alpha1/invoices`,\n urlParams: marshalling.urlParams(\n [\"invoice_type\", request.invoiceType],\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"started_after\", request.startedAfter],\n [\"started_before\", request.startedBefore]\n )\n },\n marshalling_gen.unmarshalListInvoicesResponse\n );\n /**\n * List invoices. List all your invoices, filtering by `start_date` and\n * `invoice_type`. Each invoice has its own ID.\n *\n * @param request - The request {@link ListInvoicesRequest}\n * @returns A Promise of ListInvoicesResponse\n */\n listInvoices = (request = {}) => resourcePaginator.enrichForPagination(\"invoices\", this.pageOfListInvoices, request);\n /**\n * Download an invoice. Download a specific invoice, specified by its ID.\n *\n * @param request - The request {@link DownloadInvoiceRequest}\n * @returns A Promise of Blob\n */\n downloadInvoice = (request) => this.client.fetch({\n method: \"GET\",\n path: `/billing/v2alpha1/invoices/${marshalling.validatePathParam(\"invoiceId\", request.invoiceId)}/download`,\n urlParams: marshalling.urlParams([\"dl\", 1], [\"file_type\", request.fileType]),\n responseType: \"blob\"\n });\n pageOfListDiscounts = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/billing/v2alpha1/discounts`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListDiscountsResponse\n );\n /**\n * List all user's discounts. List all discounts for an organization and\n * usable categories/products/offers/references/regions/zones where the\n * discount can be applied.\n *\n * @param request - The request {@link ListDiscountsRequest}\n * @returns A Promise of ListDiscountsResponse\n */\n listDiscounts = (request = {}) => resourcePaginator.enrichForPagination(\"discounts\", this.pageOfListDiscounts, request);\n}\nexports.API = API;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api_gen = require(\"./api.gen.cjs\");\nexports.API = api_gen.API;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst json = require(\"../../../helpers/json.cjs\");\nconst customMarshalling = require(\"../../../scw/custom-marshalling.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nconst unmarshalGetConsumptionResponseConsumption = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'GetConsumptionResponseConsumption' failed as data isn't a dictionary.`\n );\n }\n return {\n category: data.category,\n description: data.description,\n operationPath: data.operation_path,\n projectId: data.project_id,\n value: data.value ? customMarshalling.unmarshalMoney(data.value) : void 0\n };\n};\nconst unmarshalGetConsumptionResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'GetConsumptionResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n consumptions: marshalling.unmarshalArrayOfObject(\n data.consumptions,\n unmarshalGetConsumptionResponseConsumption\n ),\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalDiscountCoupon = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DiscountCoupon' failed as data isn't a dictionary.`\n );\n }\n return {\n description: data.description\n };\n};\nconst unmarshalDiscountFilter = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DiscountFilter' failed as data isn't a dictionary.`\n );\n }\n return {\n exclude: data.exclude,\n type: data.type,\n value: data.value\n };\n};\nconst unmarshalDiscount = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Discount' failed as data isn't a dictionary.`\n );\n }\n return {\n coupon: data.coupon ? unmarshalDiscountCoupon(data.coupon) : void 0,\n creationDate: marshalling.unmarshalDate(data.creation_date),\n description: data.description,\n filters: marshalling.unmarshalArrayOfObject(data.filters, unmarshalDiscountFilter),\n id: data.id,\n mode: data.mode,\n organizationId: data.organization_id,\n startDate: marshalling.unmarshalDate(data.start_date),\n stopDate: marshalling.unmarshalDate(data.stop_date),\n value: data.value,\n valueRemaining: data.value_remaining,\n valueUsed: data.value_used\n };\n};\nconst unmarshalListDiscountsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListDiscountsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n discounts: marshalling.unmarshalArrayOfObject(data.discounts, unmarshalDiscount),\n totalCount: data.total_count\n };\n};\nconst unmarshalInvoice = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Invoice' failed as data isn't a dictionary.`\n );\n }\n return {\n dueDate: marshalling.unmarshalDate(data.due_date),\n id: data.id,\n invoiceType: data.invoice_type,\n issuedDate: marshalling.unmarshalDate(data.issued_date),\n number: data.number,\n startDate: marshalling.unmarshalDate(data.start_date),\n totalTaxed: data.total_taxed ? customMarshalling.unmarshalMoney(data.total_taxed) : void 0,\n totalUntaxed: data.total_untaxed ? customMarshalling.unmarshalMoney(data.total_untaxed) : void 0\n };\n};\nconst unmarshalListInvoicesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListInvoicesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n invoices: marshalling.unmarshalArrayOfObject(data.invoices, unmarshalInvoice),\n totalCount: data.total_count\n };\n};\nexports.unmarshalGetConsumptionResponse = unmarshalGetConsumptionResponse;\nexports.unmarshalListDiscountsResponse = unmarshalListDiscountsResponse;\nexports.unmarshalListInvoicesResponse = unmarshalListInvoicesResponse;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api = require(\"../../../scw/api.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst resourcePaginator = require(\"../../../scw/fetch/resource-paginator.cjs\");\nconst marshalling_gen = require(\"./marshalling.gen.cjs\");\nclass API extends api.API {\n pageOfListConsumptions = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/billing/v2beta1/consumptions`,\n urlParams: marshalling.urlParams(\n [\"billing_period\", request.billingPeriod],\n [\"category_name\", request.categoryName],\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n ...Object.entries(\n marshalling.resolveOneOf([\n {\n default: this.client.settings.defaultOrganizationId,\n param: \"organization_id\",\n value: request.organizationId\n },\n {\n default: this.client.settings.defaultProjectId,\n param: \"project_id\",\n value: request.projectId\n }\n ])\n )\n )\n },\n marshalling_gen.unmarshalListConsumptionsResponse\n );\n /**\n * Get monthly consumption. Consumption allows you to retrieve your past or\n * current consumption cost, by project or category.\n *\n * @param request - The request {@link ListConsumptionsRequest}\n * @returns A Promise of ListConsumptionsResponse\n */\n listConsumptions = (request = {}) => resourcePaginator.enrichForPagination(\"consumptions\", this.pageOfListConsumptions, request);\n pageOfListTaxes = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/billing/v2beta1/taxes`,\n urlParams: marshalling.urlParams(\n [\"billing_period\", request.billingPeriod],\n [\"order_by\", request.orderBy],\n [\n \"organization_id\",\n request.organizationId ?? this.client.settings.defaultOrganizationId\n ],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListTaxesResponse\n );\n /**\n * Get monthly consumption taxes. Consumption Tax allows you to retrieve your\n * past or current tax charges, by project or category.\n *\n * @param request - The request {@link ListTaxesRequest}\n * @returns A Promise of ListTaxesResponse\n */\n listTaxes = (request = {}) => resourcePaginator.enrichForPagination(\"taxes\", this.pageOfListTaxes, request);\n pageOfListInvoices = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/billing/v2beta1/invoices`,\n urlParams: marshalling.urlParams(\n [\"billing_period_start_after\", request.billingPeriodStartAfter],\n [\"billing_period_start_before\", request.billingPeriodStartBefore],\n [\"invoice_type\", request.invoiceType],\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListInvoicesResponse\n );\n /**\n * List invoices. List all your invoices, filtering by `start_date` and\n * `invoice_type`. Each invoice has its own ID.\n *\n * @param request - The request {@link ListInvoicesRequest}\n * @returns A Promise of ListInvoicesResponse\n */\n listInvoices = (request = {}) => resourcePaginator.enrichForPagination(\"invoices\", this.pageOfListInvoices, request);\n /**\n * Export invoices. Export invoices in a CSV file.\n *\n * @param request - The request {@link ExportInvoicesRequest}\n * @returns A Promise of Blob\n */\n exportInvoices = (request = {}) => this.client.fetch({\n method: \"GET\",\n path: `/billing/v2beta1/export-invoices`,\n urlParams: marshalling.urlParams(\n [\"dl\", 1],\n [\"billing_period_start_after\", request.billingPeriodStartAfter],\n [\"billing_period_start_before\", request.billingPeriodStartBefore],\n [\"file_type\", request.fileType],\n [\"invoice_type\", request.invoiceType],\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\"page_size\", request.pageSize ?? this.client.settings.defaultPageSize]\n ),\n responseType: \"blob\"\n });\n /**\n * Get an invoice. Get a specific invoice, specified by its ID.\n *\n * @param request - The request {@link GetInvoiceRequest}\n * @returns A Promise of Invoice\n */\n getInvoice = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/billing/v2beta1/invoices/${marshalling.validatePathParam(\"invoiceId\", request.invoiceId)}`\n },\n marshalling_gen.unmarshalInvoice\n );\n /**\n * Download an invoice. Download a specific invoice, specified by its ID.\n *\n * @param request - The request {@link DownloadInvoiceRequest}\n * @returns A Promise of Blob\n */\n downloadInvoice = (request) => this.client.fetch({\n method: \"GET\",\n path: `/billing/v2beta1/invoices/${marshalling.validatePathParam(\"invoiceId\", request.invoiceId)}/download`,\n urlParams: marshalling.urlParams([\"dl\", 1], [\"file_type\", request.fileType]),\n responseType: \"blob\"\n });\n pageOfListDiscounts = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/billing/v2beta1/discounts`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListDiscountsResponse\n );\n /**\n * List discounts. List all discounts for your organization and usable\n * categories, products, offers, references, regions and zones where the\n * discount can be applied.\n *\n * @param request - The request {@link ListDiscountsRequest}\n * @returns A Promise of ListDiscountsResponse\n */\n listDiscounts = (request = {}) => resourcePaginator.enrichForPagination(\"discounts\", this.pageOfListDiscounts, request);\n}\nexports.API = API;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api_gen = require(\"./api.gen.cjs\");\nexports.API = api_gen.API;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst json = require(\"../../../helpers/json.cjs\");\nconst customMarshalling = require(\"../../../scw/custom-marshalling.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nconst unmarshalInvoice = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Invoice' failed as data isn't a dictionary.`\n );\n }\n return {\n billingPeriod: marshalling.unmarshalDate(data.billing_period),\n dueDate: marshalling.unmarshalDate(data.due_date),\n id: data.id,\n issuedDate: marshalling.unmarshalDate(data.issued_date),\n number: data.number,\n organizationId: data.organization_id,\n organizationName: data.organization_name,\n sellerName: data.seller_name,\n startDate: marshalling.unmarshalDate(data.start_date),\n state: data.state,\n stopDate: marshalling.unmarshalDate(data.stop_date),\n totalDiscount: data.total_discount ? customMarshalling.unmarshalMoney(data.total_discount) : void 0,\n totalTax: data.total_tax ? customMarshalling.unmarshalMoney(data.total_tax) : void 0,\n totalTaxed: data.total_taxed ? customMarshalling.unmarshalMoney(data.total_taxed) : void 0,\n totalUndiscount: data.total_undiscount ? customMarshalling.unmarshalMoney(data.total_undiscount) : void 0,\n totalUntaxed: data.total_untaxed ? customMarshalling.unmarshalMoney(data.total_untaxed) : void 0,\n type: data.type\n };\n};\nconst unmarshalListConsumptionsResponseConsumption = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListConsumptionsResponseConsumption' failed as data isn't a dictionary.`\n );\n }\n return {\n billedQuantity: data.billed_quantity,\n categoryName: data.category_name,\n productName: data.product_name,\n projectId: data.project_id,\n resourceName: data.resource_name,\n sku: data.sku,\n unit: data.unit,\n value: data.value ? customMarshalling.unmarshalMoney(data.value) : void 0\n };\n};\nconst unmarshalListConsumptionsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListConsumptionsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n consumptions: marshalling.unmarshalArrayOfObject(\n data.consumptions,\n unmarshalListConsumptionsResponseConsumption\n ),\n totalCount: data.total_count,\n totalDiscountUntaxedValue: data.total_discount_untaxed_value,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalDiscountCoupon = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DiscountCoupon' failed as data isn't a dictionary.`\n );\n }\n return {\n description: data.description\n };\n};\nconst unmarshalDiscountFilter = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DiscountFilter' failed as data isn't a dictionary.`\n );\n }\n return {\n exclude: data.exclude,\n type: data.type,\n value: data.value\n };\n};\nconst unmarshalDiscount = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Discount' failed as data isn't a dictionary.`\n );\n }\n return {\n coupon: data.coupon ? unmarshalDiscountCoupon(data.coupon) : void 0,\n creationDate: marshalling.unmarshalDate(data.creation_date),\n description: data.description,\n filters: marshalling.unmarshalArrayOfObject(data.filters, unmarshalDiscountFilter),\n id: data.id,\n mode: data.mode,\n organizationId: data.organization_id,\n startDate: marshalling.unmarshalDate(data.start_date),\n stopDate: marshalling.unmarshalDate(data.stop_date),\n value: data.value,\n valueRemaining: data.value_remaining,\n valueUsed: data.value_used\n };\n};\nconst unmarshalListDiscountsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListDiscountsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n discounts: marshalling.unmarshalArrayOfObject(data.discounts, unmarshalDiscount),\n totalCount: data.total_count\n };\n};\nconst unmarshalListInvoicesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListInvoicesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n invoices: marshalling.unmarshalArrayOfObject(data.invoices, unmarshalInvoice),\n totalCount: data.total_count\n };\n};\nconst unmarshalListTaxesResponseTax = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListTaxesResponseTax' failed as data isn't a dictionary.`\n );\n }\n return {\n currency: data.currency,\n description: data.description,\n rate: data.rate,\n totalTaxValue: data.total_tax_value\n };\n};\nconst unmarshalListTaxesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListTaxesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n taxes: marshalling.unmarshalArrayOfObject(data.taxes, unmarshalListTaxesResponseTax),\n totalCount: data.total_count,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nexports.unmarshalInvoice = unmarshalInvoice;\nexports.unmarshalListConsumptionsResponse = unmarshalListConsumptionsResponse;\nexports.unmarshalListDiscountsResponse = unmarshalListDiscountsResponse;\nexports.unmarshalListInvoicesResponse = unmarshalListInvoicesResponse;\nexports.unmarshalListTaxesResponse = unmarshalListTaxesResponse;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst index_gen = require(\"./v1alpha1/index.gen.cjs\");\nexports.v1alpha1 = index_gen;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst intervalRetrier = require(\"../../../internal/async/interval-retrier.cjs\");\nconst api = require(\"../../../scw/api.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst resourcePaginator = require(\"../../../scw/fetch/resource-paginator.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nconst marshalling_gen = require(\"./marshalling.gen.cjs\");\nconst jsonContentHeaders = {\n \"Content-Type\": \"application/json; charset=utf-8\"\n};\nclass API extends api.API {\n /** Lists the available zones of the API. */\n static LOCALITIES = [\n \"fr-par-1\",\n \"fr-par-2\",\n \"nl-ams-1\",\n \"nl-ams-2\",\n \"nl-ams-3\",\n \"pl-waw-3\"\n ];\n pageOfListVolumeTypes = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/block/v1alpha1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/volume-types`,\n urlParams: marshalling.urlParams(\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListVolumeTypesResponse\n );\n /**\n * List volume types. List all available volume types in a specified zone. The\n * volume types listed are ordered by name in ascending order.\n *\n * @param request - The request {@link ListVolumeTypesRequest}\n * @returns A Promise of ListVolumeTypesResponse\n */\n listVolumeTypes = (request = {}) => resourcePaginator.enrichForPagination(\"volumeTypes\", this.pageOfListVolumeTypes, request);\n pageOfListVolumes = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/block/v1alpha1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/volumes`,\n urlParams: marshalling.urlParams(\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"product_resource_id\", request.productResourceId],\n [\"project_id\", request.projectId]\n )\n },\n marshalling_gen.unmarshalListVolumesResponse\n );\n /**\n * List volumes. List all existing volumes in a specified zone. By default,\n * the volumes listed are ordered by creation date in ascending order. This\n * can be modified via the `order_by` field.\n *\n * @param request - The request {@link ListVolumesRequest}\n * @returns A Promise of ListVolumesResponse\n */\n listVolumes = (request = {}) => resourcePaginator.enrichForPagination(\"volumes\", this.pageOfListVolumes, request);\n /**\n * Create a volume. To create a new volume from scratch, you must specify\n * `from_empty` and the `size`. To create a volume from an existing snapshot,\n * specify `from_snapshot` and the `snapshot_id` in the request payload\n * instead, size is optional and can be specified if you need to extend the\n * original size. The volume will take on the same volume class and underlying\n * IOPS limitations as the original snapshot.\n *\n * @param request - The request {@link CreateVolumeRequest}\n * @returns A Promise of Volume\n */\n createVolume = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateVolumeRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/block/v1alpha1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/volumes`\n },\n marshalling_gen.unmarshalVolume\n );\n /**\n * Get a volume. Retrieve technical information about a specific volume.\n * Details such as size, type, and status are returned in the response.\n *\n * @param request - The request {@link GetVolumeRequest}\n * @returns A Promise of Volume\n */\n getVolume = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/block/v1alpha1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/volumes/${marshalling.validatePathParam(\"volumeId\", request.volumeId)}`\n },\n marshalling_gen.unmarshalVolume\n );\n /**\n * Waits for {@link Volume} to be in a final state.\n *\n * @param request - The request {@link GetVolumeRequest}\n * @param options - The waiting options\n * @returns A Promise of Volume\n */\n waitForVolume = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(!content_gen.VOLUME_TRANSIENT_STATUSES.includes(res.status))),\n this.getVolume,\n request,\n options\n );\n /**\n * Delete a detached volume. You must specify the `volume_id` of the volume\n * you want to delete. The volume must not be in the `in_use` status.\n *\n * @param request - The request {@link DeleteVolumeRequest}\n */\n deleteVolume = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/block/v1alpha1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/volumes/${marshalling.validatePathParam(\"volumeId\", request.volumeId)}`\n });\n /**\n * Update a volume. Update the technical details of a volume, such as its\n * name, tags, or its new size and `volume_type` (within the same Block\n * Storage class). You can only resize a volume to a larger size. It is\n * currently not possible to change your Block Storage Class.\n *\n * @param request - The request {@link UpdateVolumeRequest}\n * @returns A Promise of Volume\n */\n updateVolume = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateVolumeRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/block/v1alpha1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/volumes/${marshalling.validatePathParam(\"volumeId\", request.volumeId)}`\n },\n marshalling_gen.unmarshalVolume\n );\n pageOfListSnapshots = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/block/v1alpha1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/snapshots`,\n urlParams: marshalling.urlParams(\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId],\n [\"volume_id\", request.volumeId]\n )\n },\n marshalling_gen.unmarshalListSnapshotsResponse\n );\n /**\n * List all snapshots. List all available snapshots in a specified zone. By\n * default, the snapshots listed are ordered by creation date in ascending\n * order. This can be modified via the `order_by` field.\n *\n * @param request - The request {@link ListSnapshotsRequest}\n * @returns A Promise of ListSnapshotsResponse\n */\n listSnapshots = (request = {}) => resourcePaginator.enrichForPagination(\"snapshots\", this.pageOfListSnapshots, request);\n /**\n * Get a snapshot. Retrieve technical information about a specific snapshot.\n * Details such as size, volume type, and status are returned in the\n * response.\n *\n * @param request - The request {@link GetSnapshotRequest}\n * @returns A Promise of Snapshot\n */\n getSnapshot = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/block/v1alpha1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/snapshots/${marshalling.validatePathParam(\"snapshotId\", request.snapshotId)}`\n },\n marshalling_gen.unmarshalSnapshot\n );\n /**\n * Waits for {@link Snapshot} to be in a final state.\n *\n * @param request - The request {@link GetSnapshotRequest}\n * @param options - The waiting options\n * @returns A Promise of Snapshot\n */\n waitForSnapshot = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(!content_gen.SNAPSHOT_TRANSIENT_STATUSES.includes(res.status))),\n this.getSnapshot,\n request,\n options\n );\n /**\n * Create a snapshot of a volume. To create a snapshot, the volume must be in\n * the `in_use` or the `available` status. If your volume is in a transient\n * state, you need to wait until the end of the current operation.\n *\n * @param request - The request {@link CreateSnapshotRequest}\n * @returns A Promise of Snapshot\n */\n createSnapshot = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateSnapshotRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/block/v1alpha1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/snapshots`\n },\n marshalling_gen.unmarshalSnapshot\n );\n /**\n * (Deprecated in favor of `ImportSnapshotFromObjectStorage`). Import a\n * snapshot from a Scaleway Object Storage bucket The bucket must contain a\n * QCOW2 image. The bucket can be imported into any Availability Zone as long\n * as it is in the same region as the bucket.\n *\n * @deprecated\n * @param request - The request {@link ImportSnapshotFromS3Request}\n * @returns A Promise of Snapshot\n */\n importSnapshotFromS3 = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalImportSnapshotFromS3Request(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/block/v1alpha1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/snapshots/import-from-s3`\n },\n marshalling_gen.unmarshalSnapshot\n );\n /**\n * Import a snapshot from a Scaleway Object Storage bucket. The bucket must\n * contain a QCOW2 image. The bucket can be imported into any Availability\n * Zone as long as it is in the same region as the bucket.\n *\n * @param request - The request {@link ImportSnapshotFromObjectStorageRequest}\n * @returns A Promise of Snapshot\n */\n importSnapshotFromObjectStorage = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalImportSnapshotFromObjectStorageRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/block/v1alpha1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/snapshots/import-from-object-storage`\n },\n marshalling_gen.unmarshalSnapshot\n );\n /**\n * Export a snapshot to a Scaleway Object Storage bucket. The snapshot is\n * exported in QCOW2 format. The snapshot must not be in transient state.\n *\n * @param request - The request {@link ExportSnapshotToObjectStorageRequest}\n * @returns A Promise of Snapshot\n */\n exportSnapshotToObjectStorage = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalExportSnapshotToObjectStorageRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/block/v1alpha1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/snapshots/${marshalling.validatePathParam(\"snapshotId\", request.snapshotId)}/export-to-object-storage`\n },\n marshalling_gen.unmarshalSnapshot\n );\n /**\n * Delete a snapshot. You must specify the `snapshot_id` of the snapshot you\n * want to delete. The snapshot must not be in use.\n *\n * @param request - The request {@link DeleteSnapshotRequest}\n */\n deleteSnapshot = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/block/v1alpha1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/snapshots/${marshalling.validatePathParam(\"snapshotId\", request.snapshotId)}`\n });\n /**\n * Update a snapshot. Update the name or tags of the snapshot.\n *\n * @param request - The request {@link UpdateSnapshotRequest}\n * @returns A Promise of Snapshot\n */\n updateSnapshot = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateSnapshotRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/block/v1alpha1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/snapshots/${marshalling.validatePathParam(\"snapshotId\", request.snapshotId)}`\n },\n marshalling_gen.unmarshalSnapshot\n );\n}\nexports.API = API;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst REFERENCE_TRANSIENT_STATUSES = [\n \"attaching\",\n \"detaching\",\n \"creating\"\n];\nconst SNAPSHOT_TRANSIENT_STATUSES = [\n \"creating\",\n \"deleting\",\n \"exporting\"\n];\nconst VOLUME_TRANSIENT_STATUSES = [\n \"creating\",\n \"deleting\",\n \"resizing\",\n \"snapshotting\",\n \"updating\"\n];\nexports.REFERENCE_TRANSIENT_STATUSES = REFERENCE_TRANSIENT_STATUSES;\nexports.SNAPSHOT_TRANSIENT_STATUSES = SNAPSHOT_TRANSIENT_STATUSES;\nexports.VOLUME_TRANSIENT_STATUSES = VOLUME_TRANSIENT_STATUSES;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api_gen = require(\"./api.gen.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nconst validationRules_gen = require(\"./validation-rules.gen.cjs\");\nexports.API = api_gen.API;\nexports.REFERENCE_TRANSIENT_STATUSES = content_gen.REFERENCE_TRANSIENT_STATUSES;\nexports.SNAPSHOT_TRANSIENT_STATUSES = content_gen.SNAPSHOT_TRANSIENT_STATUSES;\nexports.VOLUME_TRANSIENT_STATUSES = content_gen.VOLUME_TRANSIENT_STATUSES;\nexports.ValidationRules = validationRules_gen;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst json = require(\"../../../helpers/json.cjs\");\nconst customMarshalling = require(\"../../../scw/custom-marshalling.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nconst unmarshalReference = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Reference' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n id: data.id,\n productResourceId: data.product_resource_id,\n productResourceType: data.product_resource_type,\n status: data.status,\n type: data.type\n };\n};\nconst unmarshalSnapshotParentVolume = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SnapshotParentVolume' failed as data isn't a dictionary.`\n );\n }\n return {\n id: data.id,\n name: data.name,\n status: data.status,\n type: data.type\n };\n};\nconst unmarshalSnapshot = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Snapshot' failed as data isn't a dictionary.`\n );\n }\n return {\n class: data.class,\n createdAt: marshalling.unmarshalDate(data.created_at),\n id: data.id,\n name: data.name,\n parentVolume: data.parent_volume ? unmarshalSnapshotParentVolume(data.parent_volume) : void 0,\n projectId: data.project_id,\n references: marshalling.unmarshalArrayOfObject(data.references, unmarshalReference),\n size: data.size,\n status: data.status,\n tags: data.tags,\n updatedAt: marshalling.unmarshalDate(data.updated_at),\n zone: data.zone\n };\n};\nconst unmarshalVolumeSpecifications = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'VolumeSpecifications' failed as data isn't a dictionary.`\n );\n }\n return {\n class: data.class,\n perfIops: data.perf_iops\n };\n};\nconst unmarshalVolume = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Volume' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n id: data.id,\n lastDetachedAt: marshalling.unmarshalDate(data.last_detached_at),\n name: data.name,\n parentSnapshotId: data.parent_snapshot_id,\n projectId: data.project_id,\n references: marshalling.unmarshalArrayOfObject(data.references, unmarshalReference),\n size: data.size,\n specs: data.specs ? unmarshalVolumeSpecifications(data.specs) : void 0,\n status: data.status,\n tags: data.tags,\n type: data.type,\n updatedAt: marshalling.unmarshalDate(data.updated_at),\n zone: data.zone\n };\n};\nconst unmarshalListSnapshotsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListSnapshotsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n snapshots: marshalling.unmarshalArrayOfObject(data.snapshots, unmarshalSnapshot),\n totalCount: data.total_count\n };\n};\nconst unmarshalVolumeType = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'VolumeType' failed as data isn't a dictionary.`\n );\n }\n return {\n pricing: data.pricing ? customMarshalling.unmarshalMoney(data.pricing) : void 0,\n snapshotPricing: data.snapshot_pricing ? customMarshalling.unmarshalMoney(data.snapshot_pricing) : void 0,\n specs: data.specs ? unmarshalVolumeSpecifications(data.specs) : void 0,\n type: data.type\n };\n};\nconst unmarshalListVolumeTypesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListVolumeTypesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n totalCount: data.total_count,\n volumeTypes: marshalling.unmarshalArrayOfObject(data.volume_types, unmarshalVolumeType)\n };\n};\nconst unmarshalListVolumesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListVolumesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n totalCount: data.total_count,\n volumes: marshalling.unmarshalArrayOfObject(data.volumes, unmarshalVolume)\n };\n};\nconst marshalCreateSnapshotRequest = (request, defaults) => ({\n name: request.name,\n project_id: request.projectId ?? defaults.defaultProjectId,\n tags: request.tags,\n volume_id: request.volumeId\n});\nconst marshalCreateVolumeRequestFromEmpty = (request, defaults) => ({\n size: request.size\n});\nconst marshalCreateVolumeRequestFromSnapshot = (request, defaults) => ({\n size: request.size,\n snapshot_id: request.snapshotId\n});\nconst marshalCreateVolumeRequest = (request, defaults) => ({\n name: request.name,\n project_id: request.projectId ?? defaults.defaultProjectId,\n tags: request.tags,\n ...marshalling.resolveOneOf([\n {\n param: \"from_empty\",\n value: request.fromEmpty !== void 0 ? marshalCreateVolumeRequestFromEmpty(request.fromEmpty) : void 0\n },\n {\n param: \"from_snapshot\",\n value: request.fromSnapshot !== void 0 ? marshalCreateVolumeRequestFromSnapshot(\n request.fromSnapshot\n ) : void 0\n }\n ]),\n ...marshalling.resolveOneOf([{ param: \"perf_iops\", value: request.perfIops }])\n});\nconst marshalExportSnapshotToObjectStorageRequest = (request, defaults) => ({\n bucket: request.bucket,\n key: request.key\n});\nconst marshalImportSnapshotFromObjectStorageRequest = (request, defaults) => ({\n bucket: request.bucket,\n key: request.key,\n name: request.name,\n project_id: request.projectId ?? defaults.defaultProjectId,\n size: request.size,\n tags: request.tags\n});\nconst marshalImportSnapshotFromS3Request = (request, defaults) => ({\n bucket: request.bucket,\n key: request.key,\n name: request.name,\n project_id: request.projectId ?? defaults.defaultProjectId,\n size: request.size,\n tags: request.tags\n});\nconst marshalUpdateSnapshotRequest = (request, defaults) => ({\n name: request.name,\n tags: request.tags\n});\nconst marshalUpdateVolumeRequest = (request, defaults) => ({\n name: request.name,\n perf_iops: request.perfIops,\n size: request.size,\n tags: request.tags\n});\nexports.marshalCreateSnapshotRequest = marshalCreateSnapshotRequest;\nexports.marshalCreateVolumeRequest = marshalCreateVolumeRequest;\nexports.marshalExportSnapshotToObjectStorageRequest = marshalExportSnapshotToObjectStorageRequest;\nexports.marshalImportSnapshotFromObjectStorageRequest = marshalImportSnapshotFromObjectStorageRequest;\nexports.marshalImportSnapshotFromS3Request = marshalImportSnapshotFromS3Request;\nexports.marshalUpdateSnapshotRequest = marshalUpdateSnapshotRequest;\nexports.marshalUpdateVolumeRequest = marshalUpdateVolumeRequest;\nexports.unmarshalListSnapshotsResponse = unmarshalListSnapshotsResponse;\nexports.unmarshalListVolumeTypesResponse = unmarshalListVolumeTypesResponse;\nexports.unmarshalListVolumesResponse = unmarshalListVolumesResponse;\nexports.unmarshalReference = unmarshalReference;\nexports.unmarshalSnapshot = unmarshalSnapshot;\nexports.unmarshalVolume = unmarshalVolume;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst CreateSnapshotRequest = {\n name: {\n minLength: 1\n }\n};\nconst CreateVolumeRequest = {\n name: {\n minLength: 1\n }\n};\nconst ImportSnapshotFromObjectStorageRequest = {\n name: {\n minLength: 1\n }\n};\nconst ImportSnapshotFromS3Request = {\n name: {\n minLength: 1\n }\n};\nconst ListSnapshotsRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nconst ListVolumeTypesRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nconst ListVolumesRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nconst Reference = {\n productResourceType: {\n minLength: 1\n }\n};\nexports.CreateSnapshotRequest = CreateSnapshotRequest;\nexports.CreateVolumeRequest = CreateVolumeRequest;\nexports.ImportSnapshotFromObjectStorageRequest = ImportSnapshotFromObjectStorageRequest;\nexports.ImportSnapshotFromS3Request = ImportSnapshotFromS3Request;\nexports.ListSnapshotsRequest = ListSnapshotsRequest;\nexports.ListVolumeTypesRequest = ListVolumeTypesRequest;\nexports.ListVolumesRequest = ListVolumesRequest;\nexports.Reference = Reference;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst index_gen = require(\"./v1/index.gen.cjs\");\nconst index_gen$1 = require(\"./v1beta1/index.gen.cjs\");\nexports.v1 = index_gen;\nexports.v1beta1 = index_gen$1;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api = require(\"../../../scw/api.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst resourcePaginator = require(\"../../../scw/fetch/resource-paginator.cjs\");\nconst marshalling_gen = require(\"./marshalling.gen.cjs\");\nconst jsonContentHeaders = {\n \"Content-Type\": \"application/json; charset=utf-8\"\n};\nclass GlobalAPI extends api.API {\n /**\n * Get your Cockpit's Grafana. Retrieve information on your Cockpit's Grafana,\n * specified by the ID of the Project the Cockpit belongs to. The output\n * returned displays the URL to access your Cockpit's Grafana.\n *\n * @param request - The request {@link GlobalApiGetGrafanaRequest}\n * @returns A Promise of Grafana\n */\n getGrafana = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/cockpit/v1/grafana`,\n urlParams: marshalling.urlParams([\n \"project_id\",\n request.projectId ?? this.client.settings.defaultProjectId\n ])\n },\n marshalling_gen.unmarshalGrafana\n );\n /**\n * Synchronize Grafana data sources. Trigger the synchronization of all your\n * data sources and the alert manager in the relevant regions. The alert\n * manager will only be synchronized if you have enabled it.\n *\n * @param request - The request {@link GlobalApiSyncGrafanaDataSourcesRequest}\n */\n syncGrafanaDataSources = (request = {}) => this.client.fetch({\n body: JSON.stringify(\n marshalling_gen.marshalGlobalApiSyncGrafanaDataSourcesRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/cockpit/v1/grafana/sync-data-sources`\n });\n /**\n * Create a Grafana user. Create a Grafana user to connect to your Cockpit's\n * Grafana. Upon creation, your user password displays only once, so make sure\n * that you save it. Each Grafana user is associated with a role: viewer or\n * editor. A viewer can only view dashboards, whereas an editor can create and\n * edit dashboards. Note that the `admin` username is not available for\n * creation.\n *\n * @param request - The request {@link GlobalApiCreateGrafanaUserRequest}\n * @returns A Promise of GrafanaUser\n */\n createGrafanaUser = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalGlobalApiCreateGrafanaUserRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/cockpit/v1/grafana/users`\n },\n marshalling_gen.unmarshalGrafanaUser\n );\n pageOfListGrafanaUsers = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/cockpit/v1/grafana/users`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\n \"project_id\",\n request.projectId ?? this.client.settings.defaultProjectId\n ]\n )\n },\n marshalling_gen.unmarshalListGrafanaUsersResponse\n );\n /**\n * List Grafana users. List all Grafana users created in your Cockpit's\n * Grafana. By default, the Grafana users returned in the list are ordered in\n * ascending order.\n *\n * @param request - The request {@link GlobalApiListGrafanaUsersRequest}\n * @returns A Promise of ListGrafanaUsersResponse\n */\n listGrafanaUsers = (request = {}) => resourcePaginator.enrichForPagination(\"grafanaUsers\", this.pageOfListGrafanaUsers, request);\n /**\n * Delete a Grafana user. Delete a Grafana user from your Cockpit's Grafana,\n * specified by the ID of the Project the Cockpit belongs to, and the ID of\n * the Grafana user.\n *\n * @param request - The request {@link GlobalApiDeleteGrafanaUserRequest}\n */\n deleteGrafanaUser = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/cockpit/v1/grafana/users/${marshalling.validatePathParam(\"grafanaUserId\", request.grafanaUserId)}`,\n urlParams: marshalling.urlParams([\n \"project_id\",\n request.projectId ?? this.client.settings.defaultProjectId\n ])\n });\n /**\n * Reset a Grafana user password. Reset the password of a Grafana user,\n * specified by the ID of the Project the Cockpit belongs to, and the ID of\n * the Grafana user. A new password regenerates and only displays once. Make\n * sure that you save it.\n *\n * @param request - The request\n * {@link GlobalApiResetGrafanaUserPasswordRequest}\n * @returns A Promise of GrafanaUser\n */\n resetGrafanaUserPassword = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalGlobalApiResetGrafanaUserPasswordRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/cockpit/v1/grafana/users/${marshalling.validatePathParam(\"grafanaUserId\", request.grafanaUserId)}/reset-password`\n },\n marshalling_gen.unmarshalGrafanaUser\n );\n pageOfListGrafanaProductDashboards = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/cockpit/v1/grafana/product-dashboards`,\n urlParams: marshalling.urlParams(\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\n \"project_id\",\n request.projectId ?? this.client.settings.defaultProjectId\n ],\n [\"tags\", request.tags]\n )\n },\n marshalling_gen.unmarshalListGrafanaProductDashboardsResponse\n );\n /**\n * List Scaleway resources dashboards. Retrieve a list of available dashboards\n * in Grafana, for all Scaleway resources which are integrated with Cockpit.\n *\n * @param request - The request\n * {@link GlobalApiListGrafanaProductDashboardsRequest}\n * @returns A Promise of ListGrafanaProductDashboardsResponse\n */\n listGrafanaProductDashboards = (request = {}) => resourcePaginator.enrichForPagination(\n \"dashboards\",\n this.pageOfListGrafanaProductDashboards,\n request\n );\n /**\n * Get Scaleway resource dashboard. Retrieve information about the dashboard\n * of a Scaleway resource in Grafana, specified by the ID of the Project the\n * Cockpit belongs to, and the name of the dashboard.\n *\n * @param request - The request\n * {@link GlobalApiGetGrafanaProductDashboardRequest}\n * @returns A Promise of GrafanaProductDashboard\n */\n getGrafanaProductDashboard = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/cockpit/v1/grafana/product-dashboards/${marshalling.validatePathParam(\"dashboardName\", request.dashboardName)}`,\n urlParams: marshalling.urlParams([\n \"project_id\",\n request.projectId ?? this.client.settings.defaultProjectId\n ])\n },\n marshalling_gen.unmarshalGrafanaProductDashboard\n );\n pageOfListPlans = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/cockpit/v1/plans`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListPlansResponse\n );\n /**\n * List plan types. Retrieve a list of available pricing plan types.\n *\n * @param request - The request {@link GlobalApiListPlansRequest}\n * @returns A Promise of ListPlansResponse\n */\n listPlans = (request = {}) => resourcePaginator.enrichForPagination(\"plans\", this.pageOfListPlans, request);\n /**\n * Apply a pricing plan. Apply a pricing plan on a given Project. You must\n * specify the ID of the pricing plan type. Note that you will be billed for\n * the plan you apply.\n *\n * @param request - The request {@link GlobalApiSelectPlanRequest}\n * @returns A Promise of Plan\n */\n selectPlan = (request = {}) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalGlobalApiSelectPlanRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/cockpit/v1/plans`\n },\n marshalling_gen.unmarshalPlan\n );\n /**\n * Get current plan. Retrieve a pricing plan for the given Project, specified\n * by the ID of the Project.\n *\n * @param request - The request {@link GlobalApiGetCurrentPlanRequest}\n * @returns A Promise of Plan\n */\n getCurrentPlan = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/cockpit/v1/current-plan`,\n urlParams: marshalling.urlParams([\n \"project_id\",\n request.projectId ?? this.client.settings.defaultProjectId\n ])\n },\n marshalling_gen.unmarshalPlan\n );\n}\nclass RegionalAPI extends api.API {\n /** Lists the available regions of the API. */\n static LOCALITIES = [\"fr-par\", \"nl-ams\", \"pl-waw\"];\n /**\n * Create a data source. You must specify the data source type upon creation.\n * Available data source types include:\n *\n * - Metrics\n * - Logs\n * - Traces The name of the data source will then be used as reference to name\n * the associated Grafana data source.\n *\n * @param request - The request {@link RegionalApiCreateDataSourceRequest}\n * @returns A Promise of DataSource\n */\n createDataSource = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalRegionalApiCreateDataSourceRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/cockpit/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/data-sources`\n },\n marshalling_gen.unmarshalDataSource\n );\n /**\n * Get a data source. Retrieve information about a given data source,\n * specified by the data source ID. The data source's information such as its\n * name, type, URL, origin, and retention period, is returned.\n *\n * @param request - The request {@link RegionalApiGetDataSourceRequest}\n * @returns A Promise of DataSource\n */\n getDataSource = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/cockpit/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/data-sources/${marshalling.validatePathParam(\"dataSourceId\", request.dataSourceId)}`\n },\n marshalling_gen.unmarshalDataSource\n );\n /**\n * Delete a data source. Delete a given data source, specified by the data\n * source ID. Note that deleting a data source is irreversible, and cannot be\n * undone.\n *\n * @param request - The request {@link RegionalApiDeleteDataSourceRequest}\n */\n deleteDataSource = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/cockpit/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/data-sources/${marshalling.validatePathParam(\"dataSourceId\", request.dataSourceId)}`\n });\n pageOfListDataSources = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/cockpit/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/data-sources`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"origin\", request.origin],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\n \"project_id\",\n request.projectId ?? this.client.settings.defaultProjectId\n ],\n [\"types\", request.types]\n )\n },\n marshalling_gen.unmarshalListDataSourcesResponse\n );\n /**\n * List data sources. Retrieve the list of data sources available in the\n * specified region. By default, the data sources returned in the list are\n * ordered by creation date, in ascending order. You can list data sources by\n * Project, type and origin.\n *\n * @param request - The request {@link RegionalApiListDataSourcesRequest}\n * @returns A Promise of ListDataSourcesResponse\n */\n listDataSources = (request = {}) => resourcePaginator.enrichForPagination(\"dataSources\", this.pageOfListDataSources, request);\n /**\n * Update a data source. Update a given data source name, specified by the\n * data source ID.\n *\n * @param request - The request {@link RegionalApiUpdateDataSourceRequest}\n * @returns A Promise of DataSource\n */\n updateDataSource = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalRegionalApiUpdateDataSourceRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/cockpit/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/data-sources/${marshalling.validatePathParam(\"dataSourceId\", request.dataSourceId)}`\n },\n marshalling_gen.unmarshalDataSource\n );\n /**\n * Get data source usage overview. Retrieve the data source usage overview per\n * type for the specified Project.\n *\n * @param request - The request {@link RegionalApiGetUsageOverviewRequest}\n * @returns A Promise of UsageOverview\n */\n getUsageOverview = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/cockpit/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/usage-overview`,\n urlParams: marshalling.urlParams(\n [\"interval\", request.interval],\n [\n \"project_id\",\n request.projectId ?? this.client.settings.defaultProjectId\n ]\n )\n },\n marshalling_gen.unmarshalUsageOverview\n );\n /**\n * Create a token. Give your token the relevant scopes to ensure it has the\n * right permissions to interact with your data sources and the Alert manager.\n * Make sure that you create your token in the same regions as the data\n * sources you want to use it for. Upon creation, your token's secret key\n * display only once. Make sure that you save it.\n *\n * @param request - The request {@link RegionalApiCreateTokenRequest}\n * @returns A Promise of Token\n */\n createToken = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalRegionalApiCreateTokenRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/cockpit/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/tokens`\n },\n marshalling_gen.unmarshalToken\n );\n pageOfListTokens = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/cockpit/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/tokens`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\n \"project_id\",\n request.projectId ?? this.client.settings.defaultProjectId\n ],\n [\"token_scopes\", request.tokenScopes]\n )\n },\n marshalling_gen.unmarshalListTokensResponse\n );\n /**\n * List tokens. Retrieve a list of all tokens in the specified region. By\n * default, tokens returned in the list are ordered by creation date, in\n * ascending order. You can filter tokens by Project ID and token scopes.\n *\n * @param request - The request {@link RegionalApiListTokensRequest}\n * @returns A Promise of ListTokensResponse\n */\n listTokens = (request = {}) => resourcePaginator.enrichForPagination(\"tokens\", this.pageOfListTokens, request);\n /**\n * Get a token. Retrieve information about a given token, specified by the\n * token ID. The token's information such as its scopes, is returned.\n *\n * @param request - The request {@link RegionalApiGetTokenRequest}\n * @returns A Promise of Token\n */\n getToken = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/cockpit/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/tokens/${marshalling.validatePathParam(\"tokenId\", request.tokenId)}`\n },\n marshalling_gen.unmarshalToken\n );\n /**\n * Delete a token. Delete a given token, specified by the token ID. Deleting a\n * token is irreversible and cannot be undone.\n *\n * @param request - The request {@link RegionalApiDeleteTokenRequest}\n */\n deleteToken = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/cockpit/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/tokens/${marshalling.validatePathParam(\"tokenId\", request.tokenId)}`\n });\n /**\n * Get the Alert manager. Retrieve information about the Alert manager which\n * is unique per Project and region. By default the Alert manager is disabled.\n * The output returned displays a URL to access the Alert manager, and whether\n * the Alert manager and managed alerts are enabled.\n *\n * @param request - The request {@link RegionalApiGetAlertManagerRequest}\n * @returns A Promise of AlertManager\n */\n getAlertManager = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/cockpit/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/alert-manager`,\n urlParams: marshalling.urlParams([\n \"project_id\",\n request.projectId ?? this.client.settings.defaultProjectId\n ])\n },\n marshalling_gen.unmarshalAlertManager\n );\n /**\n * Enable the Alert manager. Enabling the Alert manager allows you to enable\n * managed alerts and create contact points in the specified Project and\n * region, to be notified when your Scaleway resources may require your\n * attention.\n *\n * @param request - The request {@link RegionalApiEnableAlertManagerRequest}\n * @returns A Promise of AlertManager\n */\n enableAlertManager = (request = {}) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalRegionalApiEnableAlertManagerRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/cockpit/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/alert-manager/enable`\n },\n marshalling_gen.unmarshalAlertManager\n );\n /**\n * Disable the Alert manager. Disabling the Alert manager deletes the contact\n * points you have created and disables managed alerts in the specified\n * Project and region.\n *\n * @param request - The request {@link RegionalApiDisableAlertManagerRequest}\n * @returns A Promise of AlertManager\n */\n disableAlertManager = (request = {}) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalRegionalApiDisableAlertManagerRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/cockpit/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/alert-manager/disable`\n },\n marshalling_gen.unmarshalAlertManager\n );\n /**\n * Create a contact point. Contact points are email addresses associated with\n * the default receiver, that the Alert manager sends alerts to. The source of\n * the alerts are data sources within the same Project and region as the Alert\n * manager. If you need to receive alerts for other receivers, you can create\n * additional contact points and receivers in Grafana. Make sure that you\n * select the Scaleway Alert manager.\n *\n * @param request - The request {@link RegionalApiCreateContactPointRequest}\n * @returns A Promise of ContactPoint\n */\n createContactPoint = (request = {}) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalRegionalApiCreateContactPointRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/cockpit/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/alert-manager/contact-points`\n },\n marshalling_gen.unmarshalContactPoint\n );\n pageOfListContactPoints = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/cockpit/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/alert-manager/contact-points`,\n urlParams: marshalling.urlParams(\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\n \"project_id\",\n request.projectId ?? this.client.settings.defaultProjectId\n ]\n )\n },\n marshalling_gen.unmarshalListContactPointsResponse\n );\n /**\n * List contact points. Retrieve a list of contact points for the specified\n * Project. The response lists all contact points and receivers created in\n * Grafana or via the API.\n *\n * @param request - The request {@link RegionalApiListContactPointsRequest}\n * @returns A Promise of ListContactPointsResponse\n */\n listContactPoints = (request = {}) => resourcePaginator.enrichForPagination(\"contactPoints\", this.pageOfListContactPoints, request);\n /**\n * Delete a contact point. Delete a contact point associated with the default\n * receiver.\n *\n * @param request - The request {@link RegionalApiDeleteContactPointRequest}\n */\n deleteContactPoint = (request = {}) => this.client.fetch({\n body: JSON.stringify(\n marshalling_gen.marshalRegionalApiDeleteContactPointRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/cockpit/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/alert-manager/contact-points/delete`\n });\n pageOfListManagedAlerts = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/cockpit/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/managed-alerts`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\n \"project_id\",\n request.projectId ?? this.client.settings.defaultProjectId\n ]\n )\n },\n marshalling_gen.unmarshalListManagedAlertsResponse\n );\n /**\n * List managed alerts. List all managed alerts for the specified Project.\n *\n * @param request - The request {@link RegionalApiListManagedAlertsRequest}\n * @returns A Promise of ListManagedAlertsResponse\n */\n listManagedAlerts = (request = {}) => resourcePaginator.enrichForPagination(\"alerts\", this.pageOfListManagedAlerts, request);\n /**\n * Enable managed alerts. Enable the sending of managed alerts for the\n * specified Project. Managed alerts are predefined alerts that apply to\n * Scaleway recources integrated with Cockpit by default.\n *\n * @param request - The request {@link RegionalApiEnableManagedAlertsRequest}\n * @returns A Promise of AlertManager\n */\n enableManagedAlerts = (request = {}) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalRegionalApiEnableManagedAlertsRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/cockpit/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/alert-manager/managed-alerts/enable`\n },\n marshalling_gen.unmarshalAlertManager\n );\n /**\n * Disable managed alerts. Disable the sending of managed alerts for the\n * specified Project.\n *\n * @param request - The request {@link RegionalApiDisableManagedAlertsRequest}\n * @returns A Promise of AlertManager\n */\n disableManagedAlerts = (request = {}) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalRegionalApiDisableManagedAlertsRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/cockpit/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/alert-manager/managed-alerts/disable`\n },\n marshalling_gen.unmarshalAlertManager\n );\n /**\n * Trigger a test alert. Send a test alert to the Alert manager to make sure\n * your contact points get notified.\n *\n * @param request - The request {@link RegionalApiTriggerTestAlertRequest}\n */\n triggerTestAlert = (request = {}) => this.client.fetch({\n body: JSON.stringify(\n marshalling_gen.marshalRegionalApiTriggerTestAlertRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/cockpit/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/alert-manager/trigger-test-alert`\n });\n}\nexports.GlobalAPI = GlobalAPI;\nexports.RegionalAPI = RegionalAPI;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api_gen = require(\"./api.gen.cjs\");\nconst validationRules_gen = require(\"./validation-rules.gen.cjs\");\nexports.GlobalAPI = api_gen.GlobalAPI;\nexports.RegionalAPI = api_gen.RegionalAPI;\nexports.ValidationRules = validationRules_gen;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst json = require(\"../../../helpers/json.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst unmarshalContactPointEmail = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ContactPointEmail' failed as data isn't a dictionary.`\n );\n }\n return {\n to: data.to\n };\n};\nconst unmarshalContactPoint = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ContactPoint' failed as data isn't a dictionary.`\n );\n }\n return {\n email: data.email ? unmarshalContactPointEmail(data.email) : void 0,\n region: data.region\n };\n};\nconst unmarshalDataSource = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DataSource' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n id: data.id,\n name: data.name,\n origin: data.origin,\n projectId: data.project_id,\n region: data.region,\n synchronizedWithGrafana: data.synchronized_with_grafana,\n type: data.type,\n updatedAt: marshalling.unmarshalDate(data.updated_at),\n url: data.url\n };\n};\nconst unmarshalGrafanaProductDashboard = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'GrafanaProductDashboard' failed as data isn't a dictionary.`\n );\n }\n return {\n name: data.name,\n tags: data.tags,\n title: data.title,\n url: data.url,\n variables: data.variables\n };\n};\nconst unmarshalGrafanaUser = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'GrafanaUser' failed as data isn't a dictionary.`\n );\n }\n return {\n id: data.id,\n login: data.login,\n password: data.password,\n role: data.role\n };\n};\nconst unmarshalPlan = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Plan' failed as data isn't a dictionary.`\n );\n }\n return {\n logsIngestionPrice: data.logs_ingestion_price,\n monthlyPrice: data.monthly_price,\n name: data.name,\n retentionLogsInterval: data.retention_logs_interval,\n retentionMetricsInterval: data.retention_metrics_interval,\n retentionTracesInterval: data.retention_traces_interval,\n sampleIngestionPrice: data.sample_ingestion_price,\n tracesIngestionPrice: data.traces_ingestion_price\n };\n};\nconst unmarshalToken = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Token' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n id: data.id,\n name: data.name,\n projectId: data.project_id,\n region: data.region,\n scopes: data.scopes,\n secretKey: data.secret_key,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalAlertManager = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'AlertManager' failed as data isn't a dictionary.`\n );\n }\n return {\n alertManagerEnabled: data.alert_manager_enabled,\n alertManagerUrl: data.alert_manager_url,\n managedAlertsEnabled: data.managed_alerts_enabled,\n region: data.region\n };\n};\nconst unmarshalGrafana = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Grafana' failed as data isn't a dictionary.`\n );\n }\n return {\n grafanaUrl: data.grafana_url\n };\n};\nconst unmarshalListContactPointsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListContactPointsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n contactPoints: marshalling.unmarshalArrayOfObject(\n data.contact_points,\n unmarshalContactPoint\n ),\n hasAdditionalContactPoints: data.has_additional_contact_points,\n hasAdditionalReceivers: data.has_additional_receivers,\n totalCount: data.total_count\n };\n};\nconst unmarshalListDataSourcesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListDataSourcesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n dataSources: marshalling.unmarshalArrayOfObject(data.data_sources, unmarshalDataSource),\n totalCount: data.total_count\n };\n};\nconst unmarshalListGrafanaProductDashboardsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListGrafanaProductDashboardsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n dashboards: marshalling.unmarshalArrayOfObject(\n data.dashboards,\n unmarshalGrafanaProductDashboard\n ),\n totalCount: data.total_count\n };\n};\nconst unmarshalListGrafanaUsersResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListGrafanaUsersResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n grafanaUsers: marshalling.unmarshalArrayOfObject(\n data.grafana_users,\n unmarshalGrafanaUser\n ),\n totalCount: data.total_count\n };\n};\nconst unmarshalAlert = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Alert' failed as data isn't a dictionary.`\n );\n }\n return {\n description: data.description,\n name: data.name,\n product: data.product,\n productFamily: data.product_family,\n rule: data.rule\n };\n};\nconst unmarshalListManagedAlertsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListManagedAlertsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n alerts: marshalling.unmarshalArrayOfObject(data.alerts, unmarshalAlert),\n totalCount: data.total_count\n };\n};\nconst unmarshalListPlansResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListPlansResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n plans: marshalling.unmarshalArrayOfObject(data.plans, unmarshalPlan),\n totalCount: data.total_count\n };\n};\nconst unmarshalListTokensResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListTokensResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n tokens: marshalling.unmarshalArrayOfObject(data.tokens, unmarshalToken),\n totalCount: data.total_count\n };\n};\nconst unmarshalUsage = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Usage' failed as data isn't a dictionary.`\n );\n }\n return {\n dataSourceId: data.data_source_id,\n dataSourceOrigin: data.data_source_origin,\n dataSourceType: data.data_source_type,\n interval: data.interval,\n projectId: data.project_id,\n quantityOverInterval: data.quantity_over_interval,\n region: data.region,\n unit: data.unit\n };\n};\nconst unmarshalUsageOverview = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'UsageOverview' failed as data isn't a dictionary.`\n );\n }\n return {\n externalLogsUsage: data.external_logs_usage ? unmarshalUsage(data.external_logs_usage) : void 0,\n externalMetricsUsage: data.external_metrics_usage ? unmarshalUsage(data.external_metrics_usage) : void 0,\n externalTracesUsage: data.external_traces_usage ? unmarshalUsage(data.external_traces_usage) : void 0,\n scalewayLogsUsage: data.scaleway_logs_usage ? unmarshalUsage(data.scaleway_logs_usage) : void 0,\n scalewayMetricsUsage: data.scaleway_metrics_usage ? unmarshalUsage(data.scaleway_metrics_usage) : void 0\n };\n};\nconst marshalGlobalApiCreateGrafanaUserRequest = (request, defaults) => ({\n login: request.login,\n project_id: request.projectId ?? defaults.defaultProjectId,\n role: request.role\n});\nconst marshalGlobalApiResetGrafanaUserPasswordRequest = (request, defaults) => ({\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalGlobalApiSelectPlanRequest = (request, defaults) => ({\n plan_name: request.planName,\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalGlobalApiSyncGrafanaDataSourcesRequest = (request, defaults) => ({\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalContactPointEmail = (request, defaults) => ({\n to: request.to\n});\nconst marshalRegionalApiCreateContactPointRequest = (request, defaults) => ({\n project_id: request.projectId ?? defaults.defaultProjectId,\n ...marshalling.resolveOneOf([\n {\n param: \"email\",\n value: request.email !== void 0 ? marshalContactPointEmail(request.email) : void 0\n }\n ])\n});\nconst marshalRegionalApiCreateDataSourceRequest = (request, defaults) => ({\n name: request.name,\n project_id: request.projectId ?? defaults.defaultProjectId,\n type: request.type\n});\nconst marshalRegionalApiCreateTokenRequest = (request, defaults) => ({\n name: request.name,\n project_id: request.projectId ?? defaults.defaultProjectId,\n token_scopes: request.tokenScopes !== void 0 ? request.tokenScopes : void 0\n});\nconst marshalRegionalApiDeleteContactPointRequest = (request, defaults) => ({\n project_id: request.projectId ?? defaults.defaultProjectId,\n ...marshalling.resolveOneOf([\n {\n param: \"email\",\n value: request.email !== void 0 ? marshalContactPointEmail(request.email) : void 0\n }\n ])\n});\nconst marshalRegionalApiDisableAlertManagerRequest = (request, defaults) => ({\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalRegionalApiDisableManagedAlertsRequest = (request, defaults) => ({\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalRegionalApiEnableAlertManagerRequest = (request, defaults) => ({\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalRegionalApiEnableManagedAlertsRequest = (request, defaults) => ({\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalRegionalApiTriggerTestAlertRequest = (request, defaults) => ({\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalRegionalApiUpdateDataSourceRequest = (request, defaults) => ({\n name: request.name\n});\nexports.marshalGlobalApiCreateGrafanaUserRequest = marshalGlobalApiCreateGrafanaUserRequest;\nexports.marshalGlobalApiResetGrafanaUserPasswordRequest = marshalGlobalApiResetGrafanaUserPasswordRequest;\nexports.marshalGlobalApiSelectPlanRequest = marshalGlobalApiSelectPlanRequest;\nexports.marshalGlobalApiSyncGrafanaDataSourcesRequest = marshalGlobalApiSyncGrafanaDataSourcesRequest;\nexports.marshalRegionalApiCreateContactPointRequest = marshalRegionalApiCreateContactPointRequest;\nexports.marshalRegionalApiCreateDataSourceRequest = marshalRegionalApiCreateDataSourceRequest;\nexports.marshalRegionalApiCreateTokenRequest = marshalRegionalApiCreateTokenRequest;\nexports.marshalRegionalApiDeleteContactPointRequest = marshalRegionalApiDeleteContactPointRequest;\nexports.marshalRegionalApiDisableAlertManagerRequest = marshalRegionalApiDisableAlertManagerRequest;\nexports.marshalRegionalApiDisableManagedAlertsRequest = marshalRegionalApiDisableManagedAlertsRequest;\nexports.marshalRegionalApiEnableAlertManagerRequest = marshalRegionalApiEnableAlertManagerRequest;\nexports.marshalRegionalApiEnableManagedAlertsRequest = marshalRegionalApiEnableManagedAlertsRequest;\nexports.marshalRegionalApiTriggerTestAlertRequest = marshalRegionalApiTriggerTestAlertRequest;\nexports.marshalRegionalApiUpdateDataSourceRequest = marshalRegionalApiUpdateDataSourceRequest;\nexports.unmarshalAlertManager = unmarshalAlertManager;\nexports.unmarshalContactPoint = unmarshalContactPoint;\nexports.unmarshalDataSource = unmarshalDataSource;\nexports.unmarshalGrafana = unmarshalGrafana;\nexports.unmarshalGrafanaProductDashboard = unmarshalGrafanaProductDashboard;\nexports.unmarshalGrafanaUser = unmarshalGrafanaUser;\nexports.unmarshalListContactPointsResponse = unmarshalListContactPointsResponse;\nexports.unmarshalListDataSourcesResponse = unmarshalListDataSourcesResponse;\nexports.unmarshalListGrafanaProductDashboardsResponse = unmarshalListGrafanaProductDashboardsResponse;\nexports.unmarshalListGrafanaUsersResponse = unmarshalListGrafanaUsersResponse;\nexports.unmarshalListManagedAlertsResponse = unmarshalListManagedAlertsResponse;\nexports.unmarshalListPlansResponse = unmarshalListPlansResponse;\nexports.unmarshalListTokensResponse = unmarshalListTokensResponse;\nexports.unmarshalPlan = unmarshalPlan;\nexports.unmarshalToken = unmarshalToken;\nexports.unmarshalUsageOverview = unmarshalUsageOverview;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst RegionalApiCreateDataSourceRequest = {\n name: {\n maxLength: 50,\n minLength: 3,\n pattern: /^[A-Za-z0-9-_. ]+$/\n }\n};\nconst RegionalApiCreateTokenRequest = {\n name: {\n maxLength: 50,\n minLength: 3,\n pattern: /^[A-Za-z0-9-_]+$/\n }\n};\nconst RegionalApiListContactPointsRequest = {\n page: {\n greaterThanOrEqual: 1\n },\n pageSize: {\n greaterThanOrEqual: 1,\n lessThanOrEqual: 1e3\n }\n};\nconst RegionalApiListDataSourcesRequest = {\n page: {\n greaterThanOrEqual: 1\n },\n pageSize: {\n greaterThanOrEqual: 1,\n lessThanOrEqual: 1e3\n }\n};\nconst RegionalApiListManagedAlertsRequest = {\n page: {\n greaterThanOrEqual: 1\n },\n pageSize: {\n greaterThanOrEqual: 1,\n lessThanOrEqual: 1e3\n }\n};\nconst RegionalApiListTokensRequest = {\n page: {\n greaterThanOrEqual: 1\n },\n pageSize: {\n greaterThanOrEqual: 1,\n lessThanOrEqual: 1e3\n }\n};\nconst RegionalApiUpdateDataSourceRequest = {\n name: {\n maxLength: 50,\n minLength: 3,\n pattern: /^[A-Za-z0-9-_. ]+$/\n }\n};\nexports.RegionalApiCreateDataSourceRequest = RegionalApiCreateDataSourceRequest;\nexports.RegionalApiCreateTokenRequest = RegionalApiCreateTokenRequest;\nexports.RegionalApiListContactPointsRequest = RegionalApiListContactPointsRequest;\nexports.RegionalApiListDataSourcesRequest = RegionalApiListDataSourcesRequest;\nexports.RegionalApiListManagedAlertsRequest = RegionalApiListManagedAlertsRequest;\nexports.RegionalApiListTokensRequest = RegionalApiListTokensRequest;\nexports.RegionalApiUpdateDataSourceRequest = RegionalApiUpdateDataSourceRequest;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst intervalRetrier = require(\"../../../internal/async/interval-retrier.cjs\");\nconst api = require(\"../../../scw/api.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst resourcePaginator = require(\"../../../scw/fetch/resource-paginator.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nconst marshalling_gen = require(\"./marshalling.gen.cjs\");\nconst jsonContentHeaders = {\n \"Content-Type\": \"application/json; charset=utf-8\"\n};\nclass API extends api.API {\n /**\n * Activate the Cockpit of a given Project specified by the Project ID.\n *\n * @param request - The request {@link ActivateCockpitRequest}\n * @returns A Promise of Cockpit\n */\n activateCockpit = (request = {}) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalActivateCockpitRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/cockpit/v1beta1/activate`\n },\n marshalling_gen.unmarshalCockpit\n );\n /**\n * Retrieve the Cockpit of a given Project specified by the Project ID.\n *\n * @param request - The request {@link GetCockpitRequest}\n * @returns A Promise of Cockpit\n */\n getCockpit = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/cockpit/v1beta1/cockpit`,\n urlParams: marshalling.urlParams([\n \"project_id\",\n request.projectId ?? this.client.settings.defaultProjectId\n ])\n },\n marshalling_gen.unmarshalCockpit\n );\n /**\n * Waits for {@link Cockpit} to be in a final state.\n *\n * @param request - The request {@link GetCockpitRequest}\n * @param options - The waiting options\n * @returns A Promise of Cockpit\n */\n waitForCockpit = (request = {}, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(!content_gen.COCKPIT_TRANSIENT_STATUSES.includes(res.status))),\n this.getCockpit,\n request,\n options\n );\n /**\n * Retrieve metrics from your Cockpit specified by the ID of the Project the\n * Cockpit belongs to.\n *\n * @param request - The request {@link GetCockpitMetricsRequest}\n * @returns A Promise of CockpitMetrics\n */\n getCockpitMetrics = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/cockpit/v1beta1/cockpit/metrics`,\n urlParams: marshalling.urlParams(\n [\"end_date\", request.endDate],\n [\"metric_name\", request.metricName],\n [\n \"project_id\",\n request.projectId ?? this.client.settings.defaultProjectId\n ],\n [\"start_date\", request.startDate]\n )\n },\n marshalling_gen.unmarshalCockpitMetrics\n );\n /**\n * Deactivate the Cockpit of a given Project specified by the Project ID.\n *\n * @param request - The request {@link DeactivateCockpitRequest}\n * @returns A Promise of Cockpit\n */\n deactivateCockpit = (request = {}) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalDeactivateCockpitRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/cockpit/v1beta1/deactivate`\n },\n marshalling_gen.unmarshalCockpit\n );\n /**\n * Create a data source for a given Project specified by the Project ID and\n * the data source type.\n *\n * @param request - The request {@link CreateDatasourceRequest}\n * @returns A Promise of Datasource\n */\n createDatasource = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateDatasourceRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/cockpit/v1beta1/datasources`\n },\n marshalling_gen.unmarshalDatasource\n );\n /**\n * Delete a given data source specified by the data source ID.\n *\n * @param request - The request {@link DeleteDatasourceRequest}\n */\n deleteDatasource = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/cockpit/v1beta1/datasources/${marshalling.validatePathParam(\"datasourceId\", request.datasourceId)}`\n });\n pageOfListDatasources = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/cockpit/v1beta1/datasources`,\n urlParams: marshalling.urlParams(\n [\"is_managed_by_scaleway\", request.isManagedByScaleway],\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\n \"project_id\",\n request.projectId ?? this.client.settings.defaultProjectId\n ],\n [\"types\", request.types]\n )\n },\n marshalling_gen.unmarshalListDatasourcesResponse\n );\n /**\n * Get a list of data sources for the specified Project ID.\n *\n * @param request - The request {@link ListDatasourcesRequest}\n * @returns A Promise of ListDatasourcesResponse\n */\n listDatasources = (request = {}) => resourcePaginator.enrichForPagination(\"datasources\", this.pageOfListDatasources, request);\n /**\n * Create a token in a given Project specified by the Project ID.\n *\n * @param request - The request {@link CreateTokenRequest}\n * @returns A Promise of Token\n */\n createToken = (request = {}) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateTokenRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/cockpit/v1beta1/tokens`\n },\n marshalling_gen.unmarshalToken\n );\n pageOfListTokens = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/cockpit/v1beta1/tokens`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\n \"project_id\",\n request.projectId ?? this.client.settings.defaultProjectId\n ]\n )\n },\n marshalling_gen.unmarshalListTokensResponse\n );\n /**\n * Get a list of tokens in a given Project specified by the Project ID.\n *\n * @param request - The request {@link ListTokensRequest}\n * @returns A Promise of ListTokensResponse\n */\n listTokens = (request = {}) => resourcePaginator.enrichForPagination(\"tokens\", this.pageOfListTokens, request);\n /**\n * Retrieve a given token specified by the token ID.\n *\n * @param request - The request {@link GetTokenRequest}\n * @returns A Promise of Token\n */\n getToken = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/cockpit/v1beta1/tokens/${marshalling.validatePathParam(\"tokenId\", request.tokenId)}`\n },\n marshalling_gen.unmarshalToken\n );\n /**\n * Delete a given token specified by the token ID.\n *\n * @param request - The request {@link DeleteTokenRequest}\n */\n deleteToken = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/cockpit/v1beta1/tokens/${marshalling.validatePathParam(\"tokenId\", request.tokenId)}`\n });\n /**\n * Create a contact point associated with the default receiver, to receive\n * alerts.\n *\n * @param request - The request {@link CreateContactPointRequest}\n * @returns A Promise of ContactPoint\n */\n createContactPoint = (request = {}) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateContactPointRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/cockpit/v1beta1/contact-points`\n },\n marshalling_gen.unmarshalContactPoint\n );\n pageOfListContactPoints = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/cockpit/v1beta1/contact-points`,\n urlParams: marshalling.urlParams(\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\n \"project_id\",\n request.projectId ?? this.client.settings.defaultProjectId\n ]\n )\n },\n marshalling_gen.unmarshalListContactPointsResponse\n );\n /**\n * Get a list of contact points created for a given Cockpit, specified by the\n * ID of the Project the Cockpit belongs to.\n *\n * @param request - The request {@link ListContactPointsRequest}\n * @returns A Promise of ListContactPointsResponse\n */\n listContactPoints = (request = {}) => resourcePaginator.enrichForPagination(\"contactPoints\", this.pageOfListContactPoints, request);\n /**\n * Delete a contact point associated with the default receiver.\n *\n * @param request - The request {@link DeleteContactPointRequest}\n */\n deleteContactPoint = (request = {}) => this.client.fetch({\n body: JSON.stringify(\n marshalling_gen.marshalDeleteContactPointRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/cockpit/v1beta1/delete-contact-point`\n });\n /**\n * Enable the sending of managed alerts for a given Cockpit, specified by the\n * ID of the Project the Cockpit belongs to.\n *\n * @param request - The request {@link EnableManagedAlertsRequest}\n */\n enableManagedAlerts = (request = {}) => this.client.fetch({\n body: JSON.stringify(\n marshalling_gen.marshalEnableManagedAlertsRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/cockpit/v1beta1/enable-managed-alerts`\n });\n /**\n * Disable the sending of managed alerts for a given Cockpit, specified by the\n * ID of the Project the Cockpit belongs to.\n *\n * @param request - The request {@link DisableManagedAlertsRequest}\n */\n disableManagedAlerts = (request = {}) => this.client.fetch({\n body: JSON.stringify(\n marshalling_gen.marshalDisableManagedAlertsRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/cockpit/v1beta1/disable-managed-alerts`\n });\n /**\n * Send a test alert to make sure your contact points get notified when an\n * actual alert is triggered.\n *\n * @param request - The request {@link TriggerTestAlertRequest}\n */\n triggerTestAlert = (request = {}) => this.client.fetch({\n body: JSON.stringify(\n marshalling_gen.marshalTriggerTestAlertRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/cockpit/v1beta1/trigger-test-alert`\n });\n /**\n * Create a Grafana user for your Cockpit's Grafana. Make sure you save the\n * automatically-generated password and the Grafana user ID.\n *\n * @param request - The request {@link CreateGrafanaUserRequest}\n * @returns A Promise of GrafanaUser\n */\n createGrafanaUser = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateGrafanaUserRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/cockpit/v1beta1/grafana-users`\n },\n marshalling_gen.unmarshalGrafanaUser\n );\n pageOfListGrafanaUsers = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/cockpit/v1beta1/grafana-users`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\n \"project_id\",\n request.projectId ?? this.client.settings.defaultProjectId\n ]\n )\n },\n marshalling_gen.unmarshalListGrafanaUsersResponse\n );\n /**\n * Get a list of all Grafana users created in your Cockpit's Grafana.\n *\n * @param request - The request {@link ListGrafanaUsersRequest}\n * @returns A Promise of ListGrafanaUsersResponse\n */\n listGrafanaUsers = (request = {}) => resourcePaginator.enrichForPagination(\"grafanaUsers\", this.pageOfListGrafanaUsers, request);\n /**\n * Delete a Grafana user from your Cockpit's Grafana, specified by the ID of\n * the Project the Cockpit belongs to, and the ID of the Grafana user.\n *\n * @param request - The request {@link DeleteGrafanaUserRequest}\n */\n deleteGrafanaUser = (request) => this.client.fetch({\n body: JSON.stringify(\n marshalling_gen.marshalDeleteGrafanaUserRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/cockpit/v1beta1/grafana-users/${marshalling.validatePathParam(\"grafanaUserId\", request.grafanaUserId)}/delete`\n });\n /**\n * Reset the password of a Grafana user, specified by the ID of the Project\n * the Cockpit belongs to, and the ID of the Grafana user.\n *\n * @param request - The request {@link ResetGrafanaUserPasswordRequest}\n * @returns A Promise of GrafanaUser\n */\n resetGrafanaUserPassword = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalResetGrafanaUserPasswordRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/cockpit/v1beta1/grafana-users/${marshalling.validatePathParam(\"grafanaUserId\", request.grafanaUserId)}/reset-password`\n },\n marshalling_gen.unmarshalGrafanaUser\n );\n pageOfListPlans = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/cockpit/v1beta1/plans`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListPlansResponse\n );\n /**\n * Get a list of all pricing plans available.\n *\n * @param request - The request {@link ListPlansRequest}\n * @returns A Promise of ListPlansResponse\n */\n listPlans = (request = {}) => resourcePaginator.enrichForPagination(\"plans\", this.pageOfListPlans, request);\n /**\n * Select your chosen pricing plan for your Cockpit, specifying the Cockpit's\n * Project ID and the pricing plan's ID in the request.\n *\n * @param request - The request {@link SelectPlanRequest}\n * @returns A Promise of SelectPlanResponse\n */\n selectPlan = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalSelectPlanRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/cockpit/v1beta1/select-plan`\n },\n marshalling_gen.unmarshalSelectPlanResponse\n );\n pageOfListGrafanaProductDashboards = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/cockpit/v1beta1/grafana-product-dashboards`,\n urlParams: marshalling.urlParams(\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\n \"project_id\",\n request.projectId ?? this.client.settings.defaultProjectId\n ],\n [\"tags\", request.tags]\n )\n },\n marshalling_gen.unmarshalListGrafanaProductDashboardsResponse\n );\n /**\n * List product dashboards. Get a list of available product dashboards.\n *\n * @param request - The request {@link ListGrafanaProductDashboardsRequest}\n * @returns A Promise of ListGrafanaProductDashboardsResponse\n */\n listGrafanaProductDashboards = (request = {}) => resourcePaginator.enrichForPagination(\n \"dashboards\",\n this.pageOfListGrafanaProductDashboards,\n request\n );\n /**\n * Get a product dashboard. Get a product dashboard specified by the dashboard\n * ID.\n *\n * @param request - The request {@link GetGrafanaProductDashboardRequest}\n * @returns A Promise of GrafanaProductDashboard\n */\n getGrafanaProductDashboard = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/cockpit/v1beta1/grafana-product-dashboards/${marshalling.validatePathParam(\"dashboardName\", request.dashboardName)}`,\n urlParams: marshalling.urlParams([\n \"project_id\",\n request.projectId ?? this.client.settings.defaultProjectId\n ])\n },\n marshalling_gen.unmarshalGrafanaProductDashboard\n );\n}\nexports.API = API;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst COCKPIT_TRANSIENT_STATUSES = [\n \"creating\",\n \"deleting\",\n \"updating\"\n];\nexports.COCKPIT_TRANSIENT_STATUSES = COCKPIT_TRANSIENT_STATUSES;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api_gen = require(\"./api.gen.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nexports.API = api_gen.API;\nexports.COCKPIT_TRANSIENT_STATUSES = content_gen.COCKPIT_TRANSIENT_STATUSES;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst randomName = require(\"@scaleway/random-name\");\nconst json = require(\"../../../helpers/json.cjs\");\nconst customMarshalling = require(\"../../../scw/custom-marshalling.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nconst unmarshalContactPointEmail = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ContactPointEmail' failed as data isn't a dictionary.`\n );\n }\n return {\n to: data.to\n };\n};\nconst unmarshalContactPoint = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ContactPoint' failed as data isn't a dictionary.`\n );\n }\n return {\n email: data.email ? unmarshalContactPointEmail(data.email) : void 0\n };\n};\nconst unmarshalDatasource = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Datasource' failed as data isn't a dictionary.`\n );\n }\n return {\n id: data.id,\n isManagedByScaleway: data.is_managed_by_scaleway,\n name: data.name,\n projectId: data.project_id,\n type: data.type,\n url: data.url\n };\n};\nconst unmarshalGrafanaProductDashboard = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'GrafanaProductDashboard' failed as data isn't a dictionary.`\n );\n }\n return {\n dashboardName: data.dashboard_name,\n tags: data.tags,\n title: data.title,\n url: data.url,\n variables: data.variables\n };\n};\nconst unmarshalGrafanaUser = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'GrafanaUser' failed as data isn't a dictionary.`\n );\n }\n return {\n id: data.id,\n login: data.login,\n password: data.password,\n role: data.role\n };\n};\nconst unmarshalTokenScopes = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'TokenScopes' failed as data isn't a dictionary.`\n );\n }\n return {\n queryLogs: data.query_logs,\n queryMetrics: data.query_metrics,\n queryTraces: data.query_traces,\n setupAlerts: data.setup_alerts,\n setupLogsRules: data.setup_logs_rules,\n setupMetricsRules: data.setup_metrics_rules,\n writeLogs: data.write_logs,\n writeMetrics: data.write_metrics,\n writeTraces: data.write_traces\n };\n};\nconst unmarshalToken = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Token' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n id: data.id,\n name: data.name,\n projectId: data.project_id,\n scopes: data.scopes ? unmarshalTokenScopes(data.scopes) : void 0,\n secretKey: data.secret_key,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalCockpitEndpoints = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'CockpitEndpoints' failed as data isn't a dictionary.`\n );\n }\n return {\n alertmanagerUrl: data.alertmanager_url,\n grafanaUrl: data.grafana_url,\n logsUrl: data.logs_url,\n metricsUrl: data.metrics_url,\n tracesUrl: data.traces_url\n };\n};\nconst unmarshalPlan = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Plan' failed as data isn't a dictionary.`\n );\n }\n return {\n id: data.id,\n logsIngestionPrice: data.logs_ingestion_price,\n name: data.name,\n retentionLogsInterval: data.retention_logs_interval,\n retentionMetricsInterval: data.retention_metrics_interval,\n retentionPrice: data.retention_price,\n retentionTracesInterval: data.retention_traces_interval,\n sampleIngestionPrice: data.sample_ingestion_price,\n tracesIngestionPrice: data.traces_ingestion_price\n };\n};\nconst unmarshalCockpit = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Cockpit' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n endpoints: data.endpoints ? unmarshalCockpitEndpoints(data.endpoints) : void 0,\n managedAlertsEnabled: data.managed_alerts_enabled,\n plan: data.plan ? unmarshalPlan(data.plan) : void 0,\n projectId: data.project_id,\n status: data.status,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalCockpitMetrics = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'CockpitMetrics' failed as data isn't a dictionary.`\n );\n }\n return {\n timeseries: marshalling.unmarshalArrayOfObject(data.timeseries, customMarshalling.unmarshalTimeSeries)\n };\n};\nconst unmarshalListContactPointsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListContactPointsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n contactPoints: marshalling.unmarshalArrayOfObject(\n data.contact_points,\n unmarshalContactPoint\n ),\n hasAdditionalContactPoints: data.has_additional_contact_points,\n hasAdditionalReceivers: data.has_additional_receivers,\n totalCount: data.total_count\n };\n};\nconst unmarshalListDatasourcesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListDatasourcesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n datasources: marshalling.unmarshalArrayOfObject(data.datasources, unmarshalDatasource),\n totalCount: data.total_count\n };\n};\nconst unmarshalListGrafanaProductDashboardsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListGrafanaProductDashboardsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n dashboards: marshalling.unmarshalArrayOfObject(\n data.dashboards,\n unmarshalGrafanaProductDashboard\n ),\n totalCount: data.total_count\n };\n};\nconst unmarshalListGrafanaUsersResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListGrafanaUsersResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n grafanaUsers: marshalling.unmarshalArrayOfObject(\n data.grafana_users,\n unmarshalGrafanaUser\n ),\n totalCount: data.total_count\n };\n};\nconst unmarshalListPlansResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListPlansResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n plans: marshalling.unmarshalArrayOfObject(data.plans, unmarshalPlan),\n totalCount: data.total_count\n };\n};\nconst unmarshalListTokensResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListTokensResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n tokens: marshalling.unmarshalArrayOfObject(data.tokens, unmarshalToken),\n totalCount: data.total_count\n };\n};\nconst unmarshalSelectPlanResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SelectPlanResponse' failed as data isn't a dictionary.`\n );\n }\n return {};\n};\nconst marshalActivateCockpitRequest = (request, defaults) => ({\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalContactPointEmail = (request, defaults) => ({\n to: request.to\n});\nconst marshalContactPoint = (request, defaults) => ({\n ...marshalling.resolveOneOf([\n {\n param: \"email\",\n value: request.email !== void 0 ? marshalContactPointEmail(request.email) : void 0\n }\n ])\n});\nconst marshalCreateContactPointRequest = (request, defaults) => ({\n contact_point: request.contactPoint !== void 0 ? marshalContactPoint(request.contactPoint) : void 0,\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalCreateDatasourceRequest = (request, defaults) => ({\n is_default: request.isDefault,\n name: request.name,\n project_id: request.projectId ?? defaults.defaultProjectId,\n type: request.type\n});\nconst marshalCreateGrafanaUserRequest = (request, defaults) => ({\n login: request.login,\n project_id: request.projectId ?? defaults.defaultProjectId,\n role: request.role\n});\nconst marshalTokenScopes = (request, defaults) => ({\n query_logs: request.queryLogs,\n query_metrics: request.queryMetrics,\n query_traces: request.queryTraces,\n setup_alerts: request.setupAlerts,\n setup_logs_rules: request.setupLogsRules,\n setup_metrics_rules: request.setupMetricsRules,\n write_logs: request.writeLogs,\n write_metrics: request.writeMetrics,\n write_traces: request.writeTraces\n});\nconst marshalCreateTokenRequest = (request, defaults) => ({\n name: request.name || randomName(\"token\"),\n project_id: request.projectId ?? defaults.defaultProjectId,\n scopes: request.scopes !== void 0 ? marshalTokenScopes(request.scopes) : void 0\n});\nconst marshalDeactivateCockpitRequest = (request, defaults) => ({\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalDeleteContactPointRequest = (request, defaults) => ({\n contact_point: request.contactPoint !== void 0 ? marshalContactPoint(request.contactPoint) : void 0,\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalDeleteGrafanaUserRequest = (request, defaults) => ({\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalDisableManagedAlertsRequest = (request, defaults) => ({\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalEnableManagedAlertsRequest = (request, defaults) => ({\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalResetGrafanaUserPasswordRequest = (request, defaults) => ({\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalSelectPlanRequest = (request, defaults) => ({\n plan_id: request.planId,\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalTriggerTestAlertRequest = (request, defaults) => ({\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nexports.marshalActivateCockpitRequest = marshalActivateCockpitRequest;\nexports.marshalCreateContactPointRequest = marshalCreateContactPointRequest;\nexports.marshalCreateDatasourceRequest = marshalCreateDatasourceRequest;\nexports.marshalCreateGrafanaUserRequest = marshalCreateGrafanaUserRequest;\nexports.marshalCreateTokenRequest = marshalCreateTokenRequest;\nexports.marshalDeactivateCockpitRequest = marshalDeactivateCockpitRequest;\nexports.marshalDeleteContactPointRequest = marshalDeleteContactPointRequest;\nexports.marshalDeleteGrafanaUserRequest = marshalDeleteGrafanaUserRequest;\nexports.marshalDisableManagedAlertsRequest = marshalDisableManagedAlertsRequest;\nexports.marshalEnableManagedAlertsRequest = marshalEnableManagedAlertsRequest;\nexports.marshalResetGrafanaUserPasswordRequest = marshalResetGrafanaUserPasswordRequest;\nexports.marshalSelectPlanRequest = marshalSelectPlanRequest;\nexports.marshalTriggerTestAlertRequest = marshalTriggerTestAlertRequest;\nexports.unmarshalCockpit = unmarshalCockpit;\nexports.unmarshalCockpitMetrics = unmarshalCockpitMetrics;\nexports.unmarshalContactPoint = unmarshalContactPoint;\nexports.unmarshalDatasource = unmarshalDatasource;\nexports.unmarshalGrafanaProductDashboard = unmarshalGrafanaProductDashboard;\nexports.unmarshalGrafanaUser = unmarshalGrafanaUser;\nexports.unmarshalListContactPointsResponse = unmarshalListContactPointsResponse;\nexports.unmarshalListDatasourcesResponse = unmarshalListDatasourcesResponse;\nexports.unmarshalListGrafanaProductDashboardsResponse = unmarshalListGrafanaProductDashboardsResponse;\nexports.unmarshalListGrafanaUsersResponse = unmarshalListGrafanaUsersResponse;\nexports.unmarshalListPlansResponse = unmarshalListPlansResponse;\nexports.unmarshalListTokensResponse = unmarshalListTokensResponse;\nexports.unmarshalSelectPlanResponse = unmarshalSelectPlanResponse;\nexports.unmarshalToken = unmarshalToken;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst index_gen = require(\"./v1beta1/index.gen.cjs\");\nexports.v1beta1 = index_gen;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst intervalRetrier = require(\"../../../internal/async/interval-retrier.cjs\");\nconst api = require(\"../../../scw/api.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst resourcePaginator = require(\"../../../scw/fetch/resource-paginator.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nconst marshalling_gen = require(\"./marshalling.gen.cjs\");\nconst jsonContentHeaders = {\n \"Content-Type\": \"application/json; charset=utf-8\"\n};\nclass API extends api.API {\n /** Lists the available regions of the API. */\n static LOCALITIES = [\"fr-par\", \"nl-ams\", \"pl-waw\"];\n pageOfListNamespaces = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/containers/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/namespaces`,\n urlParams: marshalling.urlParams(\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId]\n )\n },\n marshalling_gen.unmarshalListNamespacesResponse\n );\n /**\n * List all your namespaces. List all namespaces in a specified region.\n *\n * @param request - The request {@link ListNamespacesRequest}\n * @returns A Promise of ListNamespacesResponse\n */\n listNamespaces = (request = {}) => resourcePaginator.enrichForPagination(\"namespaces\", this.pageOfListNamespaces, request);\n /**\n * Get a namespace. Get the namespace associated with the specified ID.\n *\n * @param request - The request {@link GetNamespaceRequest}\n * @returns A Promise of Namespace\n */\n getNamespace = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/containers/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/namespaces/${marshalling.validatePathParam(\"namespaceId\", request.namespaceId)}`\n },\n marshalling_gen.unmarshalNamespace\n );\n /**\n * Waits for {@link Namespace} to be in a final state.\n *\n * @param request - The request {@link GetNamespaceRequest}\n * @param options - The waiting options\n * @returns A Promise of Namespace\n */\n waitForNamespace = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(!content_gen.NAMESPACE_TRANSIENT_STATUSES.includes(res.status))),\n this.getNamespace,\n request,\n options\n );\n /**\n * Create a new namespace. Create a new namespace in a specified region.\n *\n * @param request - The request {@link CreateNamespaceRequest}\n * @returns A Promise of Namespace\n */\n createNamespace = (request = {}) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateNamespaceRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/containers/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/namespaces`\n },\n marshalling_gen.unmarshalNamespace\n );\n /**\n * Update an existing namespace. Update the space associated with the\n * specified ID.\n *\n * @param request - The request {@link UpdateNamespaceRequest}\n * @returns A Promise of Namespace\n */\n updateNamespace = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateNamespaceRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/containers/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/namespaces/${marshalling.validatePathParam(\"namespaceId\", request.namespaceId)}`\n },\n marshalling_gen.unmarshalNamespace\n );\n /**\n * Delete an existing namespace. Delete the namespace associated with the\n * specified ID.\n *\n * @param request - The request {@link DeleteNamespaceRequest}\n * @returns A Promise of Namespace\n */\n deleteNamespace = (request) => this.client.fetch(\n {\n method: \"DELETE\",\n path: `/containers/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/namespaces/${marshalling.validatePathParam(\"namespaceId\", request.namespaceId)}`\n },\n marshalling_gen.unmarshalNamespace\n );\n pageOfListContainers = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/containers/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/containers`,\n urlParams: marshalling.urlParams(\n [\"name\", request.name],\n [\"namespace_id\", request.namespaceId],\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId]\n )\n },\n marshalling_gen.unmarshalListContainersResponse\n );\n /**\n * List all your containers. List all containers for a specified region.\n *\n * @param request - The request {@link ListContainersRequest}\n * @returns A Promise of ListContainersResponse\n */\n listContainers = (request) => resourcePaginator.enrichForPagination(\"containers\", this.pageOfListContainers, request);\n /**\n * Get a container. Get the container associated with the specified ID.\n *\n * @param request - The request {@link GetContainerRequest}\n * @returns A Promise of Container\n */\n getContainer = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/containers/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/containers/${marshalling.validatePathParam(\"containerId\", request.containerId)}`\n },\n marshalling_gen.unmarshalContainer\n );\n /**\n * Waits for {@link Container} to be in a final state.\n *\n * @param request - The request {@link GetContainerRequest}\n * @param options - The waiting options\n * @returns A Promise of Container\n */\n waitForContainer = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(!content_gen.CONTAINER_TRANSIENT_STATUSES.includes(res.status))),\n this.getContainer,\n request,\n options\n );\n /**\n * Create a new container. Create a new container in the specified region.\n *\n * @param request - The request {@link CreateContainerRequest}\n * @returns A Promise of Container\n */\n createContainer = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateContainerRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/containers/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/containers`\n },\n marshalling_gen.unmarshalContainer\n );\n /**\n * Update an existing container. Update the container associated with the\n * specified ID.\n *\n * @param request - The request {@link UpdateContainerRequest}\n * @returns A Promise of Container\n */\n updateContainer = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateContainerRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/containers/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/containers/${marshalling.validatePathParam(\"containerId\", request.containerId)}`\n },\n marshalling_gen.unmarshalContainer\n );\n /**\n * Delete a container. Delete the container associated with the specified ID.\n *\n * @param request - The request {@link DeleteContainerRequest}\n * @returns A Promise of Container\n */\n deleteContainer = (request) => this.client.fetch(\n {\n method: \"DELETE\",\n path: `/containers/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/containers/${marshalling.validatePathParam(\"containerId\", request.containerId)}`\n },\n marshalling_gen.unmarshalContainer\n );\n /**\n * Deploy a container. Deploy a container associated with the specified ID.\n *\n * @param request - The request {@link DeployContainerRequest}\n * @returns A Promise of Container\n */\n deployContainer = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/containers/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/containers/${marshalling.validatePathParam(\"containerId\", request.containerId)}/deploy`\n },\n marshalling_gen.unmarshalContainer\n );\n pageOfListCrons = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/containers/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/crons`,\n urlParams: marshalling.urlParams(\n [\"container_id\", request.containerId],\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListCronsResponse\n );\n /**\n * List all your crons.\n *\n * @param request - The request {@link ListCronsRequest}\n * @returns A Promise of ListCronsResponse\n */\n listCrons = (request) => resourcePaginator.enrichForPagination(\"crons\", this.pageOfListCrons, request);\n /**\n * Get a cron. Get the cron associated with the specified ID.\n *\n * @param request - The request {@link GetCronRequest}\n * @returns A Promise of Cron\n */\n getCron = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/containers/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/crons/${marshalling.validatePathParam(\"cronId\", request.cronId)}`\n },\n marshalling_gen.unmarshalCron\n );\n /**\n * Waits for {@link Cron} to be in a final state.\n *\n * @param request - The request {@link GetCronRequest}\n * @param options - The waiting options\n * @returns A Promise of Cron\n */\n waitForCron = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(!content_gen.CRON_TRANSIENT_STATUSES.includes(res.status))),\n this.getCron,\n request,\n options\n );\n /**\n * Create a new cron.\n *\n * @param request - The request {@link CreateCronRequest}\n * @returns A Promise of Cron\n */\n createCron = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateCronRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/containers/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/crons`\n },\n marshalling_gen.unmarshalCron\n );\n /**\n * Update an existing cron. Update the cron associated with the specified ID.\n *\n * @param request - The request {@link UpdateCronRequest}\n * @returns A Promise of Cron\n */\n updateCron = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateCronRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/containers/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/crons/${marshalling.validatePathParam(\"cronId\", request.cronId)}`\n },\n marshalling_gen.unmarshalCron\n );\n /**\n * Delete an existing cron. Delete the cron associated with the specified ID.\n *\n * @param request - The request {@link DeleteCronRequest}\n * @returns A Promise of Cron\n */\n deleteCron = (request) => this.client.fetch(\n {\n method: \"DELETE\",\n path: `/containers/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/crons/${marshalling.validatePathParam(\"cronId\", request.cronId)}`\n },\n marshalling_gen.unmarshalCron\n );\n pageOfListDomains = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/containers/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/domains`,\n urlParams: marshalling.urlParams(\n [\"container_id\", request.containerId],\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListDomainsResponse\n );\n /**\n * List all domain name bindings. List all domain name bindings in a specified\n * region.\n *\n * @param request - The request {@link ListDomainsRequest}\n * @returns A Promise of ListDomainsResponse\n */\n listDomains = (request) => resourcePaginator.enrichForPagination(\"domains\", this.pageOfListDomains, request);\n /**\n * Get a domain name binding. Get a domain name binding for the container with\n * the specified ID.\n *\n * @param request - The request {@link GetDomainRequest}\n * @returns A Promise of Domain\n */\n getDomain = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/containers/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/domains/${marshalling.validatePathParam(\"domainId\", request.domainId)}`\n },\n marshalling_gen.unmarshalDomain\n );\n /**\n * Waits for {@link Domain} to be in a final state.\n *\n * @param request - The request {@link GetDomainRequest}\n * @param options - The waiting options\n * @returns A Promise of Domain\n */\n waitForDomain = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(!content_gen.DOMAIN_TRANSIENT_STATUSES.includes(res.status))),\n this.getDomain,\n request,\n options\n );\n /**\n * Create a domain name binding. Create a domain name binding for the\n * container with the specified ID.\n *\n * @param request - The request {@link CreateDomainRequest}\n * @returns A Promise of Domain\n */\n createDomain = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateDomainRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/containers/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/domains`\n },\n marshalling_gen.unmarshalDomain\n );\n /**\n * Delete a domain name binding. Delete the domain name binding with the\n * specific ID.\n *\n * @param request - The request {@link DeleteDomainRequest}\n * @returns A Promise of Domain\n */\n deleteDomain = (request) => this.client.fetch(\n {\n method: \"DELETE\",\n path: `/containers/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/domains/${marshalling.validatePathParam(\"domainId\", request.domainId)}`\n },\n marshalling_gen.unmarshalDomain\n );\n /**\n * Create a new revocable token.\n *\n * @param request - The request {@link CreateTokenRequest}\n * @returns A Promise of Token\n */\n createToken = (request = {}) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateTokenRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/containers/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/tokens`\n },\n marshalling_gen.unmarshalToken\n );\n /**\n * Get a token. Get a token with a specified ID.\n *\n * @param request - The request {@link GetTokenRequest}\n * @returns A Promise of Token\n */\n getToken = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/containers/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/tokens/${marshalling.validatePathParam(\"tokenId\", request.tokenId)}`\n },\n marshalling_gen.unmarshalToken\n );\n /**\n * Waits for {@link Token} to be in a final state.\n *\n * @param request - The request {@link GetTokenRequest}\n * @param options - The waiting options\n * @returns A Promise of Token\n */\n waitForToken = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(!content_gen.TOKEN_TRANSIENT_STATUSES.includes(res.status))),\n this.getToken,\n request,\n options\n );\n pageOfListTokens = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/containers/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/tokens`,\n urlParams: marshalling.urlParams(\n [\"container_id\", request.containerId],\n [\"namespace_id\", request.namespaceId],\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListTokensResponse\n );\n /**\n * List all tokens. List all tokens belonging to a specified Organization or\n * Project.\n *\n * @param request - The request {@link ListTokensRequest}\n * @returns A Promise of ListTokensResponse\n */\n listTokens = (request = {}) => resourcePaginator.enrichForPagination(\"tokens\", this.pageOfListTokens, request);\n /**\n * Delete a token. Delete a token with a specified ID.\n *\n * @param request - The request {@link DeleteTokenRequest}\n * @returns A Promise of Token\n */\n deleteToken = (request) => this.client.fetch(\n {\n method: \"DELETE\",\n path: `/containers/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/tokens/${marshalling.validatePathParam(\"tokenId\", request.tokenId)}`\n },\n marshalling_gen.unmarshalToken\n );\n /**\n * Create a trigger. Create a new trigger for a specified container.\n *\n * @param request - The request {@link CreateTriggerRequest}\n * @returns A Promise of Trigger\n */\n createTrigger = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateTriggerRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/containers/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/triggers`\n },\n marshalling_gen.unmarshalTrigger\n );\n /**\n * Get a trigger. Get a trigger with a specified ID.\n *\n * @param request - The request {@link GetTriggerRequest}\n * @returns A Promise of Trigger\n */\n getTrigger = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/containers/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/triggers/${marshalling.validatePathParam(\"triggerId\", request.triggerId)}`\n },\n marshalling_gen.unmarshalTrigger\n );\n /**\n * Waits for {@link Trigger} to be in a final state.\n *\n * @param request - The request {@link GetTriggerRequest}\n * @param options - The waiting options\n * @returns A Promise of Trigger\n */\n waitForTrigger = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(!content_gen.TRIGGER_TRANSIENT_STATUSES.includes(res.status))),\n this.getTrigger,\n request,\n options\n );\n pageOfListTriggers = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/containers/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/triggers`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n ...Object.entries(\n marshalling.resolveOneOf([\n { param: \"container_id\", value: request.containerId },\n { param: \"namespace_id\", value: request.namespaceId },\n {\n default: this.client.settings.defaultProjectId,\n param: \"project_id\",\n value: request.projectId\n }\n ])\n )\n )\n },\n marshalling_gen.unmarshalListTriggersResponse\n );\n /**\n * List all triggers. List all triggers belonging to a specified Organization\n * or Project.\n *\n * @param request - The request {@link ListTriggersRequest}\n * @returns A Promise of ListTriggersResponse\n */\n listTriggers = (request = {}) => resourcePaginator.enrichForPagination(\"triggers\", this.pageOfListTriggers, request);\n /**\n * Update a trigger. Update a trigger with a specified ID.\n *\n * @param request - The request {@link UpdateTriggerRequest}\n * @returns A Promise of Trigger\n */\n updateTrigger = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateTriggerRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/containers/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/triggers/${marshalling.validatePathParam(\"triggerId\", request.triggerId)}`\n },\n marshalling_gen.unmarshalTrigger\n );\n /**\n * Delete a trigger. Delete a trigger with a specified ID.\n *\n * @param request - The request {@link DeleteTriggerRequest}\n * @returns A Promise of Trigger\n */\n deleteTrigger = (request) => this.client.fetch(\n {\n method: \"DELETE\",\n path: `/containers/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/triggers/${marshalling.validatePathParam(\"triggerId\", request.triggerId)}`\n },\n marshalling_gen.unmarshalTrigger\n );\n}\nexports.API = API;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst CONTAINER_TRANSIENT_STATUSES = [\n \"deleting\",\n \"creating\",\n \"pending\"\n];\nconst CRON_TRANSIENT_STATUSES = [\n \"deleting\",\n \"creating\",\n \"pending\"\n];\nconst DOMAIN_TRANSIENT_STATUSES = [\n \"deleting\",\n \"creating\",\n \"pending\"\n];\nconst NAMESPACE_TRANSIENT_STATUSES = [\n \"deleting\",\n \"creating\",\n \"pending\"\n];\nconst TOKEN_TRANSIENT_STATUSES = [\"deleting\", \"creating\"];\nconst TRIGGER_TRANSIENT_STATUSES = [\n \"deleting\",\n \"creating\",\n \"pending\"\n];\nexports.CONTAINER_TRANSIENT_STATUSES = CONTAINER_TRANSIENT_STATUSES;\nexports.CRON_TRANSIENT_STATUSES = CRON_TRANSIENT_STATUSES;\nexports.DOMAIN_TRANSIENT_STATUSES = DOMAIN_TRANSIENT_STATUSES;\nexports.NAMESPACE_TRANSIENT_STATUSES = NAMESPACE_TRANSIENT_STATUSES;\nexports.TOKEN_TRANSIENT_STATUSES = TOKEN_TRANSIENT_STATUSES;\nexports.TRIGGER_TRANSIENT_STATUSES = TRIGGER_TRANSIENT_STATUSES;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api_gen = require(\"./api.gen.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nconst validationRules_gen = require(\"./validation-rules.gen.cjs\");\nexports.API = api_gen.API;\nexports.CONTAINER_TRANSIENT_STATUSES = content_gen.CONTAINER_TRANSIENT_STATUSES;\nexports.CRON_TRANSIENT_STATUSES = content_gen.CRON_TRANSIENT_STATUSES;\nexports.DOMAIN_TRANSIENT_STATUSES = content_gen.DOMAIN_TRANSIENT_STATUSES;\nexports.NAMESPACE_TRANSIENT_STATUSES = content_gen.NAMESPACE_TRANSIENT_STATUSES;\nexports.TOKEN_TRANSIENT_STATUSES = content_gen.TOKEN_TRANSIENT_STATUSES;\nexports.TRIGGER_TRANSIENT_STATUSES = content_gen.TRIGGER_TRANSIENT_STATUSES;\nexports.ValidationRules = validationRules_gen;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst randomName = require(\"@scaleway/random-name\");\nconst json = require(\"../../../helpers/json.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst unmarshalSecretHashedValue = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SecretHashedValue' failed as data isn't a dictionary.`\n );\n }\n return {\n hashedValue: data.hashed_value,\n key: data.key\n };\n};\nconst unmarshalContainer = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Container' failed as data isn't a dictionary.`\n );\n }\n return {\n cpuLimit: data.cpu_limit,\n description: data.description,\n domainName: data.domain_name,\n environmentVariables: data.environment_variables,\n errorMessage: data.error_message,\n httpOption: data.http_option,\n id: data.id,\n localStorageLimit: data.local_storage_limit,\n maxConcurrency: data.max_concurrency,\n maxScale: data.max_scale,\n memoryLimit: data.memory_limit,\n minScale: data.min_scale,\n name: data.name,\n namespaceId: data.namespace_id,\n port: data.port,\n privacy: data.privacy,\n protocol: data.protocol,\n region: data.region,\n registryImage: data.registry_image,\n sandbox: data.sandbox,\n secretEnvironmentVariables: marshalling.unmarshalArrayOfObject(\n data.secret_environment_variables,\n unmarshalSecretHashedValue\n ),\n status: data.status,\n timeout: data.timeout\n };\n};\nconst unmarshalCron = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Cron' failed as data isn't a dictionary.`\n );\n }\n return {\n args: data.args,\n containerId: data.container_id,\n id: data.id,\n name: data.name,\n schedule: data.schedule,\n status: data.status\n };\n};\nconst unmarshalDomain = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Domain' failed as data isn't a dictionary.`\n );\n }\n return {\n containerId: data.container_id,\n errorMessage: data.error_message,\n hostname: data.hostname,\n id: data.id,\n status: data.status,\n url: data.url\n };\n};\nconst unmarshalNamespace = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Namespace' failed as data isn't a dictionary.`\n );\n }\n return {\n description: data.description,\n environmentVariables: data.environment_variables,\n errorMessage: data.error_message,\n id: data.id,\n name: data.name,\n organizationId: data.organization_id,\n projectId: data.project_id,\n region: data.region,\n registryEndpoint: data.registry_endpoint,\n registryNamespaceId: data.registry_namespace_id,\n secretEnvironmentVariables: marshalling.unmarshalArrayOfObject(\n data.secret_environment_variables,\n unmarshalSecretHashedValue\n ),\n status: data.status\n };\n};\nconst unmarshalToken = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Token' failed as data isn't a dictionary.`\n );\n }\n return {\n containerId: data.container_id,\n description: data.description,\n expiresAt: marshalling.unmarshalDate(data.expires_at),\n id: data.id,\n namespaceId: data.namespace_id,\n publicKey: data.public_key,\n status: data.status,\n token: data.token\n };\n};\nconst unmarshalTriggerMnqNatsClientConfig = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'TriggerMnqNatsClientConfig' failed as data isn't a dictionary.`\n );\n }\n return {\n mnqCredentialId: data.mnq_credential_id,\n mnqNatsAccountId: data.mnq_nats_account_id,\n mnqProjectId: data.mnq_project_id,\n mnqRegion: data.mnq_region,\n subject: data.subject\n };\n};\nconst unmarshalTriggerMnqSqsClientConfig = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'TriggerMnqSqsClientConfig' failed as data isn't a dictionary.`\n );\n }\n return {\n mnqCredentialId: data.mnq_credential_id,\n mnqProjectId: data.mnq_project_id,\n mnqRegion: data.mnq_region,\n queue: data.queue\n };\n};\nconst unmarshalTriggerSqsClientConfig = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'TriggerSqsClientConfig' failed as data isn't a dictionary.`\n );\n }\n return {\n accessKey: data.access_key,\n endpoint: data.endpoint,\n queueUrl: data.queue_url,\n secretKey: data.secret_key\n };\n};\nconst unmarshalTrigger = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Trigger' failed as data isn't a dictionary.`\n );\n }\n return {\n containerId: data.container_id,\n description: data.description,\n errorMessage: data.error_message,\n id: data.id,\n inputType: data.input_type,\n name: data.name,\n scwNatsConfig: data.scw_nats_config ? unmarshalTriggerMnqNatsClientConfig(data.scw_nats_config) : void 0,\n scwSqsConfig: data.scw_sqs_config ? unmarshalTriggerMnqSqsClientConfig(data.scw_sqs_config) : void 0,\n sqsConfig: data.sqs_config ? unmarshalTriggerSqsClientConfig(data.sqs_config) : void 0,\n status: data.status\n };\n};\nconst unmarshalListContainersResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListContainersResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n containers: marshalling.unmarshalArrayOfObject(data.containers, unmarshalContainer),\n totalCount: data.total_count\n };\n};\nconst unmarshalListCronsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListCronsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n crons: marshalling.unmarshalArrayOfObject(data.crons, unmarshalCron),\n totalCount: data.total_count\n };\n};\nconst unmarshalListDomainsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListDomainsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n domains: marshalling.unmarshalArrayOfObject(data.domains, unmarshalDomain),\n totalCount: data.total_count\n };\n};\nconst unmarshalListNamespacesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListNamespacesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n namespaces: marshalling.unmarshalArrayOfObject(data.namespaces, unmarshalNamespace),\n totalCount: data.total_count\n };\n};\nconst unmarshalListTokensResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListTokensResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n tokens: marshalling.unmarshalArrayOfObject(data.tokens, unmarshalToken),\n totalCount: data.total_count\n };\n};\nconst unmarshalListTriggersResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListTriggersResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n totalCount: data.total_count,\n triggers: marshalling.unmarshalArrayOfObject(data.triggers, unmarshalTrigger)\n };\n};\nconst marshalSecret = (request, defaults) => ({\n key: request.key,\n value: request.value\n});\nconst marshalCreateContainerRequest = (request, defaults) => ({\n cpu_limit: request.cpuLimit,\n description: request.description,\n environment_variables: request.environmentVariables,\n http_option: request.httpOption,\n local_storage_limit: request.localStorageLimit,\n max_concurrency: request.maxConcurrency,\n max_scale: request.maxScale,\n memory_limit: request.memoryLimit,\n min_scale: request.minScale,\n name: request.name,\n namespace_id: request.namespaceId,\n port: request.port,\n privacy: request.privacy,\n protocol: request.protocol,\n registry_image: request.registryImage,\n sandbox: request.sandbox,\n secret_environment_variables: request.secretEnvironmentVariables !== void 0 ? request.secretEnvironmentVariables.map(\n (elt) => marshalSecret(elt)\n ) : void 0,\n timeout: request.timeout\n});\nconst marshalCreateCronRequest = (request, defaults) => ({\n args: request.args,\n container_id: request.containerId,\n name: request.name,\n schedule: request.schedule\n});\nconst marshalCreateDomainRequest = (request, defaults) => ({\n container_id: request.containerId,\n hostname: request.hostname\n});\nconst marshalCreateNamespaceRequest = (request, defaults) => ({\n description: request.description,\n environment_variables: request.environmentVariables,\n name: request.name || randomName(\"cns\"),\n project_id: request.projectId ?? defaults.defaultProjectId,\n secret_environment_variables: request.secretEnvironmentVariables !== void 0 ? request.secretEnvironmentVariables.map(\n (elt) => marshalSecret(elt)\n ) : void 0\n});\nconst marshalCreateTokenRequest = (request, defaults) => ({\n description: request.description,\n expires_at: request.expiresAt,\n ...marshalling.resolveOneOf([\n { param: \"container_id\", value: request.containerId },\n { param: \"namespace_id\", value: request.namespaceId }\n ])\n});\nconst marshalCreateTriggerRequestMnqNatsClientConfig = (request, defaults) => ({\n mnq_nats_account_id: request.mnqNatsAccountId,\n mnq_project_id: request.mnqProjectId,\n mnq_region: request.mnqRegion,\n subject: request.subject\n});\nconst marshalCreateTriggerRequestMnqSqsClientConfig = (request, defaults) => ({\n mnq_project_id: request.mnqProjectId,\n mnq_region: request.mnqRegion,\n queue: request.queue\n});\nconst marshalCreateTriggerRequestSqsClientConfig = (request, defaults) => ({\n access_key: request.accessKey,\n endpoint: request.endpoint,\n queue_url: request.queueUrl,\n secret_key: request.secretKey\n});\nconst marshalCreateTriggerRequest = (request, defaults) => ({\n container_id: request.containerId,\n description: request.description,\n name: request.name,\n ...marshalling.resolveOneOf([\n {\n param: \"scw_sqs_config\",\n value: request.scwSqsConfig !== void 0 ? marshalCreateTriggerRequestMnqSqsClientConfig(\n request.scwSqsConfig\n ) : void 0\n },\n {\n param: \"scw_nats_config\",\n value: request.scwNatsConfig !== void 0 ? marshalCreateTriggerRequestMnqNatsClientConfig(\n request.scwNatsConfig\n ) : void 0\n },\n {\n param: \"sqs_config\",\n value: request.sqsConfig !== void 0 ? marshalCreateTriggerRequestSqsClientConfig(\n request.sqsConfig\n ) : void 0\n }\n ])\n});\nconst marshalUpdateContainerRequest = (request, defaults) => ({\n cpu_limit: request.cpuLimit,\n description: request.description,\n environment_variables: request.environmentVariables,\n http_option: request.httpOption,\n local_storage_limit: request.localStorageLimit,\n max_concurrency: request.maxConcurrency,\n max_scale: request.maxScale,\n memory_limit: request.memoryLimit,\n min_scale: request.minScale,\n port: request.port,\n privacy: request.privacy,\n protocol: request.protocol,\n redeploy: request.redeploy,\n registry_image: request.registryImage,\n sandbox: request.sandbox,\n secret_environment_variables: request.secretEnvironmentVariables !== void 0 ? request.secretEnvironmentVariables.map(\n (elt) => marshalSecret(elt)\n ) : void 0,\n timeout: request.timeout\n});\nconst marshalUpdateCronRequest = (request, defaults) => ({\n args: request.args,\n container_id: request.containerId,\n name: request.name,\n schedule: request.schedule\n});\nconst marshalUpdateNamespaceRequest = (request, defaults) => ({\n description: request.description,\n environment_variables: request.environmentVariables,\n secret_environment_variables: request.secretEnvironmentVariables !== void 0 ? request.secretEnvironmentVariables.map(\n (elt) => marshalSecret(elt)\n ) : void 0\n});\nconst marshalUpdateTriggerRequestSqsClientConfig = (request, defaults) => ({\n access_key: request.accessKey,\n secret_key: request.secretKey\n});\nconst marshalUpdateTriggerRequest = (request, defaults) => ({\n description: request.description,\n name: request.name,\n ...marshalling.resolveOneOf([\n {\n param: \"sqs_config\",\n value: request.sqsConfig !== void 0 ? marshalUpdateTriggerRequestSqsClientConfig(\n request.sqsConfig\n ) : void 0\n }\n ])\n});\nexports.marshalCreateContainerRequest = marshalCreateContainerRequest;\nexports.marshalCreateCronRequest = marshalCreateCronRequest;\nexports.marshalCreateDomainRequest = marshalCreateDomainRequest;\nexports.marshalCreateNamespaceRequest = marshalCreateNamespaceRequest;\nexports.marshalCreateTokenRequest = marshalCreateTokenRequest;\nexports.marshalCreateTriggerRequest = marshalCreateTriggerRequest;\nexports.marshalUpdateContainerRequest = marshalUpdateContainerRequest;\nexports.marshalUpdateCronRequest = marshalUpdateCronRequest;\nexports.marshalUpdateNamespaceRequest = marshalUpdateNamespaceRequest;\nexports.marshalUpdateTriggerRequest = marshalUpdateTriggerRequest;\nexports.unmarshalContainer = unmarshalContainer;\nexports.unmarshalCron = unmarshalCron;\nexports.unmarshalDomain = unmarshalDomain;\nexports.unmarshalListContainersResponse = unmarshalListContainersResponse;\nexports.unmarshalListCronsResponse = unmarshalListCronsResponse;\nexports.unmarshalListDomainsResponse = unmarshalListDomainsResponse;\nexports.unmarshalListNamespacesResponse = unmarshalListNamespacesResponse;\nexports.unmarshalListTokensResponse = unmarshalListTokensResponse;\nexports.unmarshalListTriggersResponse = unmarshalListTriggersResponse;\nexports.unmarshalNamespace = unmarshalNamespace;\nexports.unmarshalToken = unmarshalToken;\nexports.unmarshalTrigger = unmarshalTrigger;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst CreateTriggerRequest = {\n description: {\n maxLength: 255\n },\n name: {\n maxLength: 50,\n minLength: 1\n }\n};\nconst CreateTriggerRequestMnqNatsClientConfig = {\n mnqRegion: {\n maxLength: 20,\n minLength: 1\n },\n subject: {\n maxLength: 100,\n minLength: 1,\n pattern: /^[^\\s]+$/\n }\n};\nconst CreateTriggerRequestMnqSqsClientConfig = {\n mnqRegion: {\n maxLength: 20,\n minLength: 1\n },\n queue: {\n maxLength: 100,\n minLength: 1\n }\n};\nconst UpdateTriggerRequest = {\n description: {\n maxLength: 255\n },\n name: {\n maxLength: 50,\n minLength: 1\n }\n};\nexports.CreateTriggerRequest = CreateTriggerRequest;\nexports.CreateTriggerRequestMnqNatsClientConfig = CreateTriggerRequestMnqNatsClientConfig;\nexports.CreateTriggerRequestMnqSqsClientConfig = CreateTriggerRequestMnqSqsClientConfig;\nexports.UpdateTriggerRequest = UpdateTriggerRequest;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst index_gen = require(\"./v1/index.gen.cjs\");\nexports.v1 = index_gen;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst intervalRetrier = require(\"../../../internal/async/interval-retrier.cjs\");\nconst api = require(\"../../../scw/api.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst resourcePaginator = require(\"../../../scw/fetch/resource-paginator.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nconst marshalling_gen = require(\"./marshalling.gen.cjs\");\nconst jsonContentHeaders = {\n \"Content-Type\": \"application/json; charset=utf-8\"\n};\nclass API extends api.API {\n /** Lists the available zones of the API. */\n static LOCALITIES = [\n \"fr-par-1\",\n \"fr-par-2\",\n \"nl-ams-1\"\n ];\n pageOfListServers = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/dedibox/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\n \"project_id\",\n request.projectId ?? this.client.settings.defaultProjectId\n ],\n [\"search\", request.search]\n )\n },\n marshalling_gen.unmarshalListServersResponse\n );\n /**\n * List baremetal servers for project.\n *\n * @param request - The request {@link ListServersRequest}\n * @returns A Promise of ListServersResponse\n */\n listServers = (request = {}) => resourcePaginator.enrichForPagination(\"servers\", this.pageOfListServers, request);\n /**\n * Get a specific baremetal server. Get the server associated with the given\n * ID.\n *\n * @param request - The request {@link GetServerRequest}\n * @returns A Promise of Server\n */\n getServer = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/dedibox/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}`\n },\n marshalling_gen.unmarshalServer\n );\n /**\n * Waits for {@link Server} to be in a final state.\n *\n * @param request - The request {@link GetServerRequest}\n * @param options - The waiting options\n * @returns A Promise of Server\n */\n waitForServer = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(!content_gen.SERVER_TRANSIENT_STATUSES.includes(res.status))),\n this.getServer,\n request,\n options\n );\n getServerBackup = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/dedibox/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/backups`\n },\n marshalling_gen.unmarshalBackup\n );\n updateServerBackup = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateServerBackupRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/dedibox/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/backups`\n },\n marshalling_gen.unmarshalBackup\n );\n pageOfListSubscribableServerOptions = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/dedibox/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/subscribable-server-options`,\n urlParams: marshalling.urlParams(\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListSubscribableServerOptionsResponse\n );\n /**\n * List subscribable server options. List subscribable options associated to\n * the given server ID.\n *\n * @param request - The request {@link ListSubscribableServerOptionsRequest}\n * @returns A Promise of ListSubscribableServerOptionsResponse\n */\n listSubscribableServerOptions = (request) => resourcePaginator.enrichForPagination(\n \"serverOptions\",\n this.pageOfListSubscribableServerOptions,\n request\n );\n /**\n * Subscribe server option. Subscribe option for the given server ID.\n *\n * @param request - The request {@link SubscribeServerOptionRequest}\n * @returns A Promise of Service\n */\n subscribeServerOption = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalSubscribeServerOptionRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/dedibox/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/subscribe-server-option`\n },\n marshalling_gen.unmarshalService\n );\n /**\n * Create a baremetal server. Create a new baremetal server. The order return\n * you a service ID to follow the provisionning status you could call\n * GetService.\n *\n * @param request - The request {@link CreateServerRequest}\n * @returns A Promise of Service\n */\n createServer = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateServerRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/dedibox/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers`\n },\n marshalling_gen.unmarshalService\n );\n /**\n * Subscribe storage server option. Subscribe storage option for the given\n * server ID.\n *\n * @param request - The request {@link SubscribeStorageOptionsRequest}\n * @returns A Promise of SubscribeStorageOptionsResponse\n */\n subscribeStorageOptions = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalSubscribeStorageOptionsRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/dedibox/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/subscribe-storage-options`\n },\n marshalling_gen.unmarshalSubscribeStorageOptionsResponse\n );\n /**\n * Update a baremetal server. Update the server associated with the given ID.\n *\n * @param request - The request {@link UpdateServerRequest}\n * @returns A Promise of Server\n */\n updateServer = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateServerRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/dedibox/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}`\n },\n marshalling_gen.unmarshalServer\n );\n updateServerTags = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateServerTagsRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/dedibox/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/tags`\n },\n marshalling_gen.unmarshalServer\n );\n /**\n * Reboot a baremetal server. Reboot the server associated with the given ID,\n * use boot param to reboot in rescue.\n *\n * @param request - The request {@link RebootServerRequest}\n */\n rebootServer = (request) => this.client.fetch({\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/dedibox/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/reboot`\n });\n /**\n * Start a baremetal server. Start the server associated with the given ID.\n *\n * @param request - The request {@link StartServerRequest}\n */\n startServer = (request) => this.client.fetch({\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/dedibox/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/start`\n });\n /**\n * Stop a baremetal server. Stop the server associated with the given ID.\n *\n * @param request - The request {@link StopServerRequest}\n */\n stopServer = (request) => this.client.fetch({\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/dedibox/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/stop`\n });\n /**\n * Delete a baremetal server. Delete the server associated with the given ID.\n *\n * @param request - The request {@link DeleteServerRequest}\n */\n deleteServer = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/dedibox/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}`\n });\n pageOfListServerEvents = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/dedibox/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/events`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListServerEventsResponse\n );\n /**\n * List server events. List events associated to the given server ID.\n *\n * @param request - The request {@link ListServerEventsRequest}\n * @returns A Promise of ListServerEventsResponse\n */\n listServerEvents = (request) => resourcePaginator.enrichForPagination(\"events\", this.pageOfListServerEvents, request);\n pageOfListServerDisks = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/dedibox/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/disks`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListServerDisksResponse\n );\n /**\n * List server disks. List disks associated to the given server ID.\n *\n * @param request - The request {@link ListServerDisksRequest}\n * @returns A Promise of ListServerDisksResponse\n */\n listServerDisks = (request) => resourcePaginator.enrichForPagination(\"disks\", this.pageOfListServerDisks, request);\n getOrderedService = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/dedibox/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/ordered-services/${marshalling.validatePathParam(\"orderedServiceId\", request.orderedServiceId)}`\n },\n marshalling_gen.unmarshalService\n );\n /**\n * Get a specific service. Get the service associated with the given ID.\n *\n * @param request - The request {@link GetServiceRequest}\n * @returns A Promise of Service\n */\n getService = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/dedibox/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/services/${marshalling.validatePathParam(\"serviceId\", request.serviceId)}`\n },\n marshalling_gen.unmarshalService\n );\n /**\n * Delete a specific service. Delete the service associated with the given ID.\n *\n * @param request - The request {@link DeleteServiceRequest}\n * @returns A Promise of Service\n */\n deleteService = (request) => this.client.fetch(\n {\n method: \"DELETE\",\n path: `/dedibox/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/services/${marshalling.validatePathParam(\"serviceId\", request.serviceId)}`\n },\n marshalling_gen.unmarshalService\n );\n pageOfListServices = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/dedibox/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/services`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId]\n )\n },\n marshalling_gen.unmarshalListServicesResponse\n );\n /**\n * List services.\n *\n * @param request - The request {@link ListServicesRequest}\n * @returns A Promise of ListServicesResponse\n */\n listServices = (request = {}) => resourcePaginator.enrichForPagination(\"services\", this.pageOfListServices, request);\n /**\n * Install a baremetal server. Install an OS on the server associated with the\n * given ID.\n *\n * @param request - The request {@link InstallServerRequest}\n * @returns A Promise of ServerInstall\n */\n installServer = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalInstallServerRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/dedibox/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/install`\n },\n marshalling_gen.unmarshalServerInstall\n );\n /**\n * Get a specific server installation status. Get the server installation\n * status associated with the given server ID.\n *\n * @param request - The request {@link GetServerInstallRequest}\n * @returns A Promise of ServerInstall\n */\n getServerInstall = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/dedibox/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/install`\n },\n marshalling_gen.unmarshalServerInstall\n );\n /**\n * Waits for {@link ServerInstall} to be in a final state.\n *\n * @param request - The request {@link GetServerInstallRequest}\n * @param options - The waiting options\n * @returns A Promise of ServerInstall\n */\n waitForServerInstall = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(\n !content_gen.SERVER_INSTALL_TRANSIENT_STATUSES.includes(res.status)\n )),\n this.getServerInstall,\n request,\n options\n );\n /**\n * Cancels the current (running) server installation. Cancels the current\n * server installation associated with the given server ID.\n *\n * @param request - The request {@link CancelServerInstallRequest}\n */\n cancelServerInstall = (request) => this.client.fetch({\n method: \"POST\",\n path: `/dedibox/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/cancel-install`\n });\n /**\n * Get server default partitioning. Get the server default partitioning schema\n * associated with the given server ID and OS ID.\n *\n * @param request - The request {@link GetServerDefaultPartitioningRequest}\n * @returns A Promise of ServerDefaultPartitioning\n */\n getServerDefaultPartitioning = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/dedibox/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/partitioning/${marshalling.validatePathParam(\"osId\", request.osId)}`\n },\n marshalling_gen.unmarshalServerDefaultPartitioning\n );\n /**\n * Start BMC (Baseboard Management Controller) access for a given baremetal\n * server. Start BMC (Baseboard Management Controller) access associated with\n * the given ID. The BMC (Baseboard Management Controller) access is available\n * one hour after the installation of the server.\n *\n * @param request - The request {@link StartBMCAccessRequest}\n */\n startBMCAccess = (request) => this.client.fetch({\n body: JSON.stringify(\n marshalling_gen.marshalStartBMCAccessRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/dedibox/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/bmc-access`\n });\n /**\n * Get BMC (Baseboard Management Controller) access for a given baremetal\n * server. Get the BMC (Baseboard Management Controller) access associated\n * with the given ID.\n *\n * @param request - The request {@link GetBMCAccessRequest}\n * @returns A Promise of BMCAccess\n */\n getBMCAccess = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/dedibox/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/bmc-access`\n },\n marshalling_gen.unmarshalBMCAccess\n );\n /**\n * Waits for {@link BMCAccess} to be in a final state.\n *\n * @param request - The request {@link GetBMCAccessRequest}\n * @param options - The waiting options\n * @returns A Promise of BMCAccess\n */\n waitForBMCAccess = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(!content_gen.BMC_ACCESS_TRANSIENT_STATUSES.includes(res.status))),\n this.getBMCAccess,\n request,\n options\n );\n /**\n * Stop BMC (Baseboard Management Controller) access for a given baremetal\n * server. Stop BMC (Baseboard Management Controller) access associated with\n * the given ID.\n *\n * @param request - The request {@link StopBMCAccessRequest}\n */\n stopBMCAccess = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/dedibox/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/bmc-access`\n });\n pageOfListOffers = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/dedibox/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/offers`,\n urlParams: marshalling.urlParams(\n [\"available_only\", request.availableOnly],\n [\"catalog\", request.catalog],\n [\"commercial_range\", request.commercialRange],\n [\"is_failover_block\", request.isFailoverBlock],\n [\"is_failover_ip\", request.isFailoverIp],\n [\"is_rpn_san\", request.isRpnSan],\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId],\n [\n \"sold_in\",\n request.soldIn && request.soldIn.length > 0 ? request.soldIn.join(\",\") : void 0\n ]\n )\n },\n marshalling_gen.unmarshalListOffersResponse\n );\n /**\n * List offers. List all available server offers.\n *\n * @param request - The request {@link ListOffersRequest}\n * @returns A Promise of ListOffersResponse\n */\n listOffers = (request = {}) => resourcePaginator.enrichForPagination(\"offers\", this.pageOfListOffers, request);\n /**\n * Get offer. Return specific offer for the given ID.\n *\n * @param request - The request {@link GetOfferRequest}\n * @returns A Promise of Offer\n */\n getOffer = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/dedibox/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/offers/${marshalling.validatePathParam(\"offerId\", request.offerId)}`,\n urlParams: marshalling.urlParams([\"project_id\", request.projectId])\n },\n marshalling_gen.unmarshalOffer\n );\n pageOfListOS = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/dedibox/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/os`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId],\n [\"server_id\", request.serverId],\n [\"type\", request.type]\n )\n },\n marshalling_gen.unmarshalListOSResponse\n );\n /**\n * List all available OS that can be install on a baremetal server.\n *\n * @param request - The request {@link ListOSRequest}\n * @returns A Promise of ListOSResponse\n */\n listOS = (request) => resourcePaginator.enrichForPagination(\"os\", this.pageOfListOS, request);\n /**\n * Get an OS with a given ID. Return specific OS for the given ID.\n *\n * @param request - The request {@link GetOSRequest}\n * @returns A Promise of OS\n */\n getOS = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/dedibox/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/os/${marshalling.validatePathParam(\"osId\", request.osId)}`,\n urlParams: marshalling.urlParams(\n [\"project_id\", request.projectId],\n [\"server_id\", request.serverId]\n )\n },\n marshalling_gen.unmarshalOS\n );\n /**\n * Update reverse of ip. Update reverse of ip associated with the given ID.\n *\n * @param request - The request {@link UpdateReverseRequest}\n * @returns A Promise of IP\n */\n updateReverse = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateReverseRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/dedibox/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/reverses/${marshalling.validatePathParam(\"ipId\", request.ipId)}`\n },\n marshalling_gen.unmarshalIP\n );\n /**\n * Order failover IPs. Order X failover IPs.\n *\n * @param request - The request {@link CreateFailoverIPsRequest}\n * @returns A Promise of CreateFailoverIPsResponse\n */\n createFailoverIPs = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateFailoverIPsRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/dedibox/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/failover-ips`\n },\n marshalling_gen.unmarshalCreateFailoverIPsResponse\n );\n /**\n * Attach failovers on baremetal server. Attach failovers on the server\n * associated with the given ID.\n *\n * @param request - The request {@link AttachFailoverIPsRequest}\n */\n attachFailoverIPs = (request) => this.client.fetch({\n body: JSON.stringify(\n marshalling_gen.marshalAttachFailoverIPsRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/dedibox/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/failover-ips/attach`\n });\n /**\n * Detach failovers on baremetal server. Detach failovers on the server\n * associated with the given ID.\n *\n * @param request - The request {@link DetachFailoverIPsRequest}\n */\n detachFailoverIPs = (request) => this.client.fetch({\n body: JSON.stringify(\n marshalling_gen.marshalDetachFailoverIPsRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/dedibox/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/failover-ips/detach`\n });\n /**\n * Attach a failover IP to a MAC address.\n *\n * @param request - The request {@link AttachFailoverIPToMacAddressRequest}\n * @returns A Promise of IP\n */\n attachFailoverIPToMacAddress = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalAttachFailoverIPToMacAddressRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/dedibox/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/failover-ips/${marshalling.validatePathParam(\"ipId\", request.ipId)}/attach-to-mac-address`\n },\n marshalling_gen.unmarshalIP\n );\n /**\n * Detach a failover IP from a MAC address.\n *\n * @param request - The request {@link DetachFailoverIPFromMacAddressRequest}\n * @returns A Promise of IP\n */\n detachFailoverIPFromMacAddress = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/dedibox/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/failover-ips/${marshalling.validatePathParam(\"ipId\", request.ipId)}/detach-from-mac-address`\n },\n marshalling_gen.unmarshalIP\n );\n /**\n * Delete a failover server. Delete the failover associated with the given ID.\n *\n * @param request - The request {@link DeleteFailoverIPRequest}\n */\n deleteFailoverIP = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/dedibox/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/failover-ips/${marshalling.validatePathParam(\"ipId\", request.ipId)}`\n });\n pageOfListFailoverIPs = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/dedibox/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/failover-ips`,\n urlParams: marshalling.urlParams(\n [\"only_available\", request.onlyAvailable],\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\n \"project_id\",\n request.projectId ?? this.client.settings.defaultProjectId\n ],\n [\"search\", request.search]\n )\n },\n marshalling_gen.unmarshalListFailoverIPsResponse\n );\n /**\n * List failovers for project. List failovers servers for project.\n *\n * @param request - The request {@link ListFailoverIPsRequest}\n * @returns A Promise of ListFailoverIPsResponse\n */\n listFailoverIPs = (request = {}) => resourcePaginator.enrichForPagination(\"failoverIps\", this.pageOfListFailoverIPs, request);\n /**\n * Get a specific baremetal server. Get the server associated with the given\n * ID.\n *\n * @param request - The request {@link GetFailoverIPRequest}\n * @returns A Promise of FailoverIP\n */\n getFailoverIP = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/dedibox/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/failover-ips/${marshalling.validatePathParam(\"ipId\", request.ipId)}`\n },\n marshalling_gen.unmarshalFailoverIP\n );\n /**\n * Get remaining quota.\n *\n * @param request - The request {@link GetRemainingQuotaRequest}\n * @returns A Promise of GetRemainingQuotaResponse\n */\n getRemainingQuota = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/dedibox/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/remaining-quota`,\n urlParams: marshalling.urlParams([\"project_id\", request.projectId])\n },\n marshalling_gen.unmarshalGetRemainingQuotaResponse\n );\n /**\n * Get raid. Return raid for the given server ID.\n *\n * @param request - The request {@link GetRaidRequest}\n * @returns A Promise of Raid\n */\n getRaid = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/dedibox/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/raid`\n },\n marshalling_gen.unmarshalRaid\n );\n /**\n * Update RAID. Update RAID associated with the given server ID.\n *\n * @param request - The request {@link UpdateRaidRequest}\n */\n updateRaid = (request) => this.client.fetch({\n body: JSON.stringify(\n marshalling_gen.marshalUpdateRaidRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/dedibox/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/update-raid`\n });\n /**\n * Start in rescue baremetal server. Start in rescue the server associated\n * with the given ID.\n *\n * @param request - The request {@link StartRescueRequest}\n * @returns A Promise of Rescue\n */\n startRescue = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalStartRescueRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/dedibox/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/rescue`\n },\n marshalling_gen.unmarshalRescue\n );\n /**\n * Get rescue information. Return rescue information for the given server ID.\n *\n * @param request - The request {@link GetRescueRequest}\n * @returns A Promise of Rescue\n */\n getRescue = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/dedibox/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/rescue`\n },\n marshalling_gen.unmarshalRescue\n );\n /**\n * Stop rescue on baremetal server. Stop rescue on the server associated with\n * the given ID.\n *\n * @param request - The request {@link StopRescueRequest}\n */\n stopRescue = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/dedibox/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/rescue`\n });\n}\nclass BillingAPI extends api.API {\n pageOfListInvoices = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/dedibox/v1/invoices`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId]\n )\n },\n marshalling_gen.unmarshalListInvoicesResponse\n );\n listInvoices = (request = {}) => resourcePaginator.enrichForPagination(\"invoices\", this.pageOfListInvoices, request);\n getInvoice = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/dedibox/v1/invoices/${marshalling.validatePathParam(\"invoiceId\", request.invoiceId)}`\n },\n marshalling_gen.unmarshalInvoice\n );\n downloadInvoice = (request) => this.client.fetch({\n method: \"GET\",\n path: `/dedibox/v1/invoices/${marshalling.validatePathParam(\"invoiceId\", request.invoiceId)}/download`,\n urlParams: marshalling.urlParams([\"dl\", 1]),\n responseType: \"blob\"\n });\n pageOfListRefunds = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/dedibox/v1/refunds`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId]\n )\n },\n marshalling_gen.unmarshalListRefundsResponse\n );\n listRefunds = (request = {}) => resourcePaginator.enrichForPagination(\"refunds\", this.pageOfListRefunds, request);\n getRefund = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/dedibox/v1/refunds/${marshalling.validatePathParam(\"refundId\", request.refundId)}`\n },\n marshalling_gen.unmarshalRefund\n );\n downloadRefund = (request) => this.client.fetch({\n method: \"GET\",\n path: `/dedibox/v1/refunds/${marshalling.validatePathParam(\"refundId\", request.refundId)}/download`,\n urlParams: marshalling.urlParams([\"dl\", 1]),\n responseType: \"blob\"\n });\n canOrder = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/dedibox/v1/can-order`,\n urlParams: marshalling.urlParams([\n \"project_id\",\n request.projectId ?? this.client.settings.defaultProjectId\n ])\n },\n marshalling_gen.unmarshalCanOrderResponse\n );\n}\nclass IPv6BlockAPI extends api.API {\n /**\n * Get IPv6 block quota. Get IPv6 block quota with the given project ID. /48\n * one per organization. /56 link to your number of server. /64 link to your\n * number of failover IP.\n *\n * @param request - The request {@link IPv6BlockApiGetIPv6BlockQuotasRequest}\n * @returns A Promise of GetIPv6BlockQuotasResponse\n */\n getIPv6BlockQuotas = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/dedibox/v1/ipv6-block-quotas`,\n urlParams: marshalling.urlParams([\"project_id\", request.projectId])\n },\n marshalling_gen.unmarshalGetIPv6BlockQuotasResponse\n );\n /**\n * Create IPv6 block for baremetal server. Create IPv6 block associated with\n * the given project ID.\n *\n * @param request - The request {@link IPv6BlockApiCreateIPv6BlockRequest}\n * @returns A Promise of IPv6Block\n */\n createIPv6Block = (request = {}) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalIPv6BlockApiCreateIPv6BlockRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/dedibox/v1/ipv6-block`\n },\n marshalling_gen.unmarshalIPv6Block\n );\n /**\n * Get a specific IPv6 block. Get the IPv6 block associated with the given ID.\n *\n * @param request - The request {@link IPv6BlockApiGetIPv6BlockRequest}\n * @returns A Promise of IPv6Block\n */\n getIPv6Block = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/dedibox/v1/ipv6-block`,\n urlParams: marshalling.urlParams([\"project_id\", request.projectId])\n },\n marshalling_gen.unmarshalIPv6Block\n );\n /**\n * Update IPv6 block. Update DNS associated to IPv6 block. If DNS is used,\n * minimum of 2 is necessary and maximum of 5 (no duplicate).\n *\n * @param request - The request {@link IPv6BlockApiUpdateIPv6BlockRequest}\n * @returns A Promise of IPv6Block\n */\n updateIPv6Block = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalIPv6BlockApiUpdateIPv6BlockRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/dedibox/v1/ipv6-blocks/${marshalling.validatePathParam(\"blockId\", request.blockId)}`\n },\n marshalling_gen.unmarshalIPv6Block\n );\n /**\n * Delete IPv6 block. Delete IPv6 block subnet with the given ID.\n *\n * @param request - The request {@link IPv6BlockApiDeleteIPv6BlockRequest}\n */\n deleteIPv6Block = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/dedibox/v1/ipv6-blocks/${marshalling.validatePathParam(\"blockId\", request.blockId)}`\n });\n /**\n * Create IPv6 block subnet. Create IPv6 block subnet for the given IP ID. /48\n * could create subnet in /56 (quota link to your number of server). /56 could\n * create subnet in /64 (quota link to your number of failover IP).\n *\n * @param request - The request\n * {@link IPv6BlockApiCreateIPv6BlockSubnetRequest}\n * @returns A Promise of IPv6Block\n */\n createIPv6BlockSubnet = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalIPv6BlockApiCreateIPv6BlockSubnetRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/dedibox/v1/ipv6-blocks/${marshalling.validatePathParam(\"blockId\", request.blockId)}/subnets`\n },\n marshalling_gen.unmarshalIPv6Block\n );\n /**\n * List available IPv6 block subnets. List all available IPv6 block subnets\n * for given IP ID.\n *\n * @param request - The request\n * {@link IPv6BlockApiListIPv6BlockSubnetsAvailableRequest}\n * @returns A Promise of ListIPv6BlockSubnetsAvailableResponse\n */\n listIPv6BlockSubnetsAvailable = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/dedibox/v1/ipv6-blocks/${marshalling.validatePathParam(\"blockId\", request.blockId)}/subnets`\n },\n marshalling_gen.unmarshalListIPv6BlockSubnetsAvailableResponse\n );\n}\nclass RpnAPI extends api.API {\n pageOfListRpnServerCapabilities = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/dedibox/v1/rpn/server-capabilities`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId]\n )\n },\n marshalling_gen.unmarshalListRpnServerCapabilitiesResponse\n );\n listRpnServerCapabilities = (request = {}) => resourcePaginator.enrichForPagination(\n \"servers\",\n this.pageOfListRpnServerCapabilities,\n request\n );\n getRpnStatus = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/dedibox/v1/rpn/status`,\n urlParams: marshalling.urlParams(\n [\"project_id\", request.projectId],\n [\"rpnv1_group_id\", request.rpnv1GroupId],\n [\"rpnv2_group_id\", request.rpnv2GroupId]\n )\n },\n marshalling_gen.unmarshalGetRpnStatusResponse\n );\n}\nclass RpnSanAPI extends api.API {\n pageOfListRpnSans = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/dedibox/v1/rpn-sans`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId]\n )\n },\n marshalling_gen.unmarshalListRpnSansResponse\n );\n listRpnSans = (request = {}) => resourcePaginator.enrichForPagination(\"rpnSans\", this.pageOfListRpnSans, request);\n getRpnSan = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/dedibox/v1/rpn-sans/${marshalling.validatePathParam(\"rpnSanId\", request.rpnSanId)}`\n },\n marshalling_gen.unmarshalRpnSan\n );\n /**\n * Waits for {@link RpnSan} to be in a final state.\n *\n * @param request - The request {@link RpnSanApiGetRpnSanRequest}\n * @param options - The waiting options\n * @returns A Promise of RpnSan\n */\n waitForRpnSan = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(!content_gen.RPN_SAN_TRANSIENT_STATUSES.includes(res.status))),\n this.getRpnSan,\n request,\n options\n );\n deleteRpnSan = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/dedibox/v1/rpn-sans/${marshalling.validatePathParam(\"rpnSanId\", request.rpnSanId)}`\n });\n createRpnSan = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalRpnSanApiCreateRpnSanRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/dedibox/v1/rpn-sans`\n },\n marshalling_gen.unmarshalService\n );\n listIps = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/dedibox/v1/rpn-sans/${marshalling.validatePathParam(\"rpnSanId\", request.rpnSanId)}/ips`,\n urlParams: marshalling.urlParams([\"type\", request.type])\n },\n marshalling_gen.unmarshalListIpsResponse\n );\n addIp = (request) => this.client.fetch({\n body: JSON.stringify(\n marshalling_gen.marshalRpnSanApiAddIpRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/dedibox/v1/rpn-sans/${marshalling.validatePathParam(\"rpnSanId\", request.rpnSanId)}/ips`\n });\n removeIp = (request) => this.client.fetch({\n body: JSON.stringify(\n marshalling_gen.marshalRpnSanApiRemoveIpRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"DELETE\",\n path: `/dedibox/v1/rpn-sans/${marshalling.validatePathParam(\"rpnSanId\", request.rpnSanId)}/ips`\n });\n listAvailableIps = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/dedibox/v1/rpn-sans/${marshalling.validatePathParam(\"rpnSanId\", request.rpnSanId)}/available-ips`,\n urlParams: marshalling.urlParams([\"type\", request.type])\n },\n marshalling_gen.unmarshalListIpsResponse\n );\n}\nclass RpnV1API extends api.API {\n pageOfListRpnGroups = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/dedibox/v1/rpnv1/groups`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId]\n )\n },\n marshalling_gen.unmarshalListRpnGroupsResponse\n );\n listRpnGroups = (request = {}) => resourcePaginator.enrichForPagination(\"rpnGroups\", this.pageOfListRpnGroups, request);\n getRpnGroup = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/dedibox/v1/rpnv1/groups/${marshalling.validatePathParam(\"groupId\", request.groupId)}`\n },\n marshalling_gen.unmarshalRpnGroup\n );\n createRpnGroup = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalRpnV1ApiCreateRpnGroupRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/dedibox/v1/rpnv1/groups`\n },\n marshalling_gen.unmarshalRpnGroup\n );\n deleteRpnGroup = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/dedibox/v1/rpnv1/groups/${marshalling.validatePathParam(\"groupId\", request.groupId)}`\n });\n updateRpnGroupName = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalRpnV1ApiUpdateRpnGroupNameRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/dedibox/v1/rpnv1/groups/${marshalling.validatePathParam(\"groupId\", request.groupId)}`\n },\n marshalling_gen.unmarshalRpnGroup\n );\n pageOfListRpnGroupMembers = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/dedibox/v1/rpnv1/groups/${marshalling.validatePathParam(\"groupId\", request.groupId)}/members`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId]\n )\n },\n marshalling_gen.unmarshalListRpnGroupMembersResponse\n );\n listRpnGroupMembers = (request) => resourcePaginator.enrichForPagination(\"members\", this.pageOfListRpnGroupMembers, request);\n rpnGroupInvite = (request) => this.client.fetch({\n body: JSON.stringify(\n marshalling_gen.marshalRpnV1ApiRpnGroupInviteRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/dedibox/v1/rpnv1/groups/${marshalling.validatePathParam(\"groupId\", request.groupId)}/invite`\n });\n leaveRpnGroup = (request) => this.client.fetch({\n body: JSON.stringify(\n marshalling_gen.marshalRpnV1ApiLeaveRpnGroupRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/dedibox/v1/rpnv1/groups/${marshalling.validatePathParam(\"groupId\", request.groupId)}/leave`\n });\n addRpnGroupMembers = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalRpnV1ApiAddRpnGroupMembersRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/dedibox/v1/rpnv1/groups/${marshalling.validatePathParam(\"groupId\", request.groupId)}/members`\n },\n marshalling_gen.unmarshalRpnGroup\n );\n deleteRpnGroupMembers = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalRpnV1ApiDeleteRpnGroupMembersRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"DELETE\",\n path: `/dedibox/v1/rpnv1/groups/${marshalling.validatePathParam(\"groupId\", request.groupId)}/members`\n },\n marshalling_gen.unmarshalRpnGroup\n );\n pageOfListRpnCapableServers = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/dedibox/v1/rpnv1/capable-servers`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId]\n )\n },\n marshalling_gen.unmarshalListRpnCapableServersResponse\n );\n listRpnCapableServers = (request = {}) => resourcePaginator.enrichForPagination(\"servers\", this.pageOfListRpnCapableServers, request);\n pageOfListRpnCapableSanServers = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/dedibox/v1/rpnv1/capable-san-servers`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId]\n )\n },\n marshalling_gen.unmarshalListRpnCapableSanServersResponse\n );\n listRpnCapableSanServers = (request = {}) => resourcePaginator.enrichForPagination(\n \"sanServers\",\n this.pageOfListRpnCapableSanServers,\n request\n );\n pageOfListRpnInvites = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/dedibox/v1/rpnv1/invites`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\n \"project_id\",\n request.projectId ?? this.client.settings.defaultProjectId\n ]\n )\n },\n marshalling_gen.unmarshalListRpnInvitesResponse\n );\n listRpnInvites = (request = {}) => resourcePaginator.enrichForPagination(\"members\", this.pageOfListRpnInvites, request);\n acceptRpnInvite = (request) => this.client.fetch({\n method: \"POST\",\n path: `/dedibox/v1/rpnv1/invites/${marshalling.validatePathParam(\"memberId\", request.memberId)}/accept`\n });\n refuseRpnInvite = (request) => this.client.fetch({\n method: \"POST\",\n path: `/dedibox/v1/rpnv1/invites/${marshalling.validatePathParam(\"memberId\", request.memberId)}/refuse`\n });\n}\nclass RpnV2API extends api.API {\n pageOfListRpnV2Groups = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/dedibox/v1/rpnv2/groups`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId]\n )\n },\n marshalling_gen.unmarshalListRpnV2GroupsResponse\n );\n listRpnV2Groups = (request = {}) => resourcePaginator.enrichForPagination(\"rpnGroups\", this.pageOfListRpnV2Groups, request);\n pageOfListRpnV2Members = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/dedibox/v1/rpnv2/groups/${marshalling.validatePathParam(\"groupId\", request.groupId)}/members`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"type\", request.type]\n )\n },\n marshalling_gen.unmarshalListRpnV2MembersResponse\n );\n listRpnV2Members = (request) => resourcePaginator.enrichForPagination(\"members\", this.pageOfListRpnV2Members, request);\n getRpnV2Group = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/dedibox/v1/rpnv2/groups/${marshalling.validatePathParam(\"groupId\", request.groupId)}`\n },\n marshalling_gen.unmarshalRpnV2Group\n );\n /**\n * Waits for {@link RpnV2Group} to be in a final state.\n *\n * @param request - The request {@link RpnV2ApiGetRpnV2GroupRequest}\n * @param options - The waiting options\n * @returns A Promise of RpnV2Group\n */\n waitForRpnV2Group = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(\n !content_gen.RPN_V2_GROUP_TRANSIENT_STATUSES.includes(res.status)\n )),\n this.getRpnV2Group,\n request,\n options\n );\n createRpnV2Group = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalRpnV2ApiCreateRpnV2GroupRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/dedibox/v1/rpnv2/groups`\n },\n marshalling_gen.unmarshalRpnV2Group\n );\n deleteRpnV2Group = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/dedibox/v1/rpnv2/groups/${marshalling.validatePathParam(\"groupId\", request.groupId)}`\n });\n updateRpnV2GroupName = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalRpnV2ApiUpdateRpnV2GroupNameRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/dedibox/v1/rpnv2/groups/${marshalling.validatePathParam(\"groupId\", request.groupId)}`\n },\n marshalling_gen.unmarshalRpnV2Group\n );\n addRpnV2Members = (request) => this.client.fetch({\n body: JSON.stringify(\n marshalling_gen.marshalRpnV2ApiAddRpnV2MembersRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/dedibox/v1/rpnv2/groups/${marshalling.validatePathParam(\"groupId\", request.groupId)}/members`\n });\n deleteRpnV2Members = (request) => this.client.fetch({\n body: JSON.stringify(\n marshalling_gen.marshalRpnV2ApiDeleteRpnV2MembersRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"DELETE\",\n path: `/dedibox/v1/rpnv2/groups/${marshalling.validatePathParam(\"groupId\", request.groupId)}/members`\n });\n pageOfListRpnV2CapableResources = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/dedibox/v1/rpnv2/groups/capable`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId]\n )\n },\n marshalling_gen.unmarshalListRpnV2CapableResourcesResponse\n );\n listRpnV2CapableResources = (request = {}) => resourcePaginator.enrichForPagination(\n \"servers\",\n this.pageOfListRpnV2CapableResources,\n request\n );\n pageOfListRpnV2GroupLogs = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/dedibox/v1/rpnv2/groups/${marshalling.validatePathParam(\"groupId\", request.groupId)}/logs`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListRpnV2GroupLogsResponse\n );\n listRpnV2GroupLogs = (request) => resourcePaginator.enrichForPagination(\"logs\", this.pageOfListRpnV2GroupLogs, request);\n updateRpnV2VlanForMembers = (request) => this.client.fetch({\n body: JSON.stringify(\n marshalling_gen.marshalRpnV2ApiUpdateRpnV2VlanForMembersRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/dedibox/v1/rpnv2/groups/${marshalling.validatePathParam(\"groupId\", request.groupId)}/vlan`\n });\n enableRpnV2GroupCompatibility = (request) => this.client.fetch({\n body: JSON.stringify(\n marshalling_gen.marshalRpnV2ApiEnableRpnV2GroupCompatibilityRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/dedibox/v1/rpnv2/groups/${marshalling.validatePathParam(\"groupId\", request.groupId)}/enable-compatibility`\n });\n disableRpnV2GroupCompatibility = (request) => this.client.fetch({\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/dedibox/v1/rpnv2/groups/${marshalling.validatePathParam(\"groupId\", request.groupId)}/disable-compatibility`\n });\n}\nexports.API = API;\nexports.BillingAPI = BillingAPI;\nexports.IPv6BlockAPI = IPv6BlockAPI;\nexports.RpnAPI = RpnAPI;\nexports.RpnSanAPI = RpnSanAPI;\nexports.RpnV1API = RpnV1API;\nexports.RpnV2API = RpnV2API;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst BMC_ACCESS_TRANSIENT_STATUSES = [\n \"creating\",\n \"deleting\"\n];\nconst I_PV6_BLOCK_DELEGATION_TRANSIENT_STATUSES = [\"updating\"];\nconst RPN_GROUP_MEMBER_TRANSIENT_STATUSES = [\n \"creating\",\n \"deleting\"\n];\nconst RPN_SAN_TRANSIENT_STATUSES = [\n \"creating\",\n \"deleting\"\n];\nconst RPN_V2_GROUP_TRANSIENT_STATUSES = [\n \"creating\",\n \"updating\",\n \"deleting\"\n];\nconst RPN_V2_MEMBER_TRANSIENT_STATUSES = [\n \"creating\",\n \"updating\",\n \"deleting\"\n];\nconst SERVER_INSTALL_TRANSIENT_STATUSES = [\n \"booting\",\n \"setting_up_raid\",\n \"partitioning\",\n \"formatting\",\n \"installing\",\n \"configuring\",\n \"configuring_bootloader\",\n \"rebooting\"\n];\nconst SERVER_TRANSIENT_STATUSES = [\n \"delivering\",\n \"installing\"\n];\nconst SERVICE_PROVISIONING_TRANSIENT_STATUSES = [\"delivering\", \"expiring\"];\nexports.BMC_ACCESS_TRANSIENT_STATUSES = BMC_ACCESS_TRANSIENT_STATUSES;\nexports.I_PV6_BLOCK_DELEGATION_TRANSIENT_STATUSES = I_PV6_BLOCK_DELEGATION_TRANSIENT_STATUSES;\nexports.RPN_GROUP_MEMBER_TRANSIENT_STATUSES = RPN_GROUP_MEMBER_TRANSIENT_STATUSES;\nexports.RPN_SAN_TRANSIENT_STATUSES = RPN_SAN_TRANSIENT_STATUSES;\nexports.RPN_V2_GROUP_TRANSIENT_STATUSES = RPN_V2_GROUP_TRANSIENT_STATUSES;\nexports.RPN_V2_MEMBER_TRANSIENT_STATUSES = RPN_V2_MEMBER_TRANSIENT_STATUSES;\nexports.SERVER_INSTALL_TRANSIENT_STATUSES = SERVER_INSTALL_TRANSIENT_STATUSES;\nexports.SERVER_TRANSIENT_STATUSES = SERVER_TRANSIENT_STATUSES;\nexports.SERVICE_PROVISIONING_TRANSIENT_STATUSES = SERVICE_PROVISIONING_TRANSIENT_STATUSES;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api_gen = require(\"./api.gen.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nconst validationRules_gen = require(\"./validation-rules.gen.cjs\");\nexports.API = api_gen.API;\nexports.BillingAPI = api_gen.BillingAPI;\nexports.IPv6BlockAPI = api_gen.IPv6BlockAPI;\nexports.RpnAPI = api_gen.RpnAPI;\nexports.RpnSanAPI = api_gen.RpnSanAPI;\nexports.RpnV1API = api_gen.RpnV1API;\nexports.RpnV2API = api_gen.RpnV2API;\nexports.BMC_ACCESS_TRANSIENT_STATUSES = content_gen.BMC_ACCESS_TRANSIENT_STATUSES;\nexports.I_PV6_BLOCK_DELEGATION_TRANSIENT_STATUSES = content_gen.I_PV6_BLOCK_DELEGATION_TRANSIENT_STATUSES;\nexports.RPN_GROUP_MEMBER_TRANSIENT_STATUSES = content_gen.RPN_GROUP_MEMBER_TRANSIENT_STATUSES;\nexports.RPN_SAN_TRANSIENT_STATUSES = content_gen.RPN_SAN_TRANSIENT_STATUSES;\nexports.RPN_V2_GROUP_TRANSIENT_STATUSES = content_gen.RPN_V2_GROUP_TRANSIENT_STATUSES;\nexports.RPN_V2_MEMBER_TRANSIENT_STATUSES = content_gen.RPN_V2_MEMBER_TRANSIENT_STATUSES;\nexports.SERVER_INSTALL_TRANSIENT_STATUSES = content_gen.SERVER_INSTALL_TRANSIENT_STATUSES;\nexports.SERVER_TRANSIENT_STATUSES = content_gen.SERVER_TRANSIENT_STATUSES;\nexports.SERVICE_PROVISIONING_TRANSIENT_STATUSES = content_gen.SERVICE_PROVISIONING_TRANSIENT_STATUSES;\nexports.ValidationRules = validationRules_gen;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst json = require(\"../../../helpers/json.cjs\");\nconst customMarshalling = require(\"../../../scw/custom-marshalling.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nconst unmarshalIP = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'IP' failed as data isn't a dictionary.`\n );\n }\n return {\n address: data.address,\n cidr: data.cidr,\n gateway: data.gateway,\n ipId: data.ip_id,\n netmask: data.netmask,\n reverse: data.reverse,\n semantic: data.semantic,\n status: data.status,\n version: data.version\n };\n};\nconst unmarshalCPU = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'CPU' failed as data isn't a dictionary.`\n );\n }\n return {\n coreCount: data.core_count,\n frequency: data.frequency,\n name: data.name,\n threadCount: data.thread_count\n };\n};\nconst unmarshalDisk = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Disk' failed as data isn't a dictionary.`\n );\n }\n return {\n capacity: data.capacity,\n type: data.type\n };\n};\nconst unmarshalMemory = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Memory' failed as data isn't a dictionary.`\n );\n }\n return {\n capacity: data.capacity,\n frequency: data.frequency,\n isEcc: data.is_ecc,\n type: data.type\n };\n};\nconst unmarshalPersistentMemory = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'PersistentMemory' failed as data isn't a dictionary.`\n );\n }\n return {\n capacity: data.capacity,\n frequency: data.frequency,\n model: data.model\n };\n};\nconst unmarshalRaidController = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'RaidController' failed as data isn't a dictionary.`\n );\n }\n return {\n model: data.model,\n raidLevel: data.raid_level\n };\n};\nconst unmarshalOfferAntiDosInfo = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'OfferAntiDosInfo' failed as data isn't a dictionary.`\n );\n }\n return {\n type: data.type\n };\n};\nconst unmarshalOfferBackupInfo = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'OfferBackupInfo' failed as data isn't a dictionary.`\n );\n }\n return {\n size: data.size\n };\n};\nconst unmarshalOfferBandwidthInfo = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'OfferBandwidthInfo' failed as data isn't a dictionary.`\n );\n }\n return {\n speed: data.speed\n };\n};\nconst unmarshalOfferFailoverBlockInfo = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'OfferFailoverBlockInfo' failed as data isn't a dictionary.`\n );\n }\n return {\n onetimeFees: data.onetime_fees ? unmarshalOffer(data.onetime_fees) : void 0\n };\n};\nconst unmarshalOfferFailoverIpInfo = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'OfferFailoverIpInfo' failed as data isn't a dictionary.`\n );\n }\n return {\n onetimeFees: data.onetime_fees ? unmarshalOffer(data.onetime_fees) : void 0\n };\n};\nconst unmarshalOfferLicenseInfo = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'OfferLicenseInfo' failed as data isn't a dictionary.`\n );\n }\n return {\n boundToIp: data.bound_to_ip\n };\n};\nconst unmarshalOfferRPNInfo = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'OfferRPNInfo' failed as data isn't a dictionary.`\n );\n }\n return {\n speed: data.speed\n };\n};\nconst unmarshalOfferSANInfo = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'OfferSANInfo' failed as data isn't a dictionary.`\n );\n }\n return {\n deviceType: data.device_type,\n ha: data.ha,\n size: data.size\n };\n};\nconst unmarshalOfferServerInfo = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'OfferServerInfo' failed as data isn't a dictionary.`\n );\n }\n return {\n availableOptions: marshalling.unmarshalArrayOfObject(\n data.available_options,\n unmarshalOffer\n ),\n bandwidth: data.bandwidth,\n commercialRange: data.commercial_range,\n connectivity: data.connectivity,\n cpus: marshalling.unmarshalArrayOfObject(data.cpus, unmarshalCPU),\n disks: marshalling.unmarshalArrayOfObject(data.disks, unmarshalDisk),\n memories: marshalling.unmarshalArrayOfObject(data.memories, unmarshalMemory),\n onetimeFees: data.onetime_fees ? unmarshalOffer(data.onetime_fees) : void 0,\n persistentMemories: marshalling.unmarshalArrayOfObject(\n data.persistent_memories,\n unmarshalPersistentMemory\n ),\n raidControllers: marshalling.unmarshalArrayOfObject(\n data.raid_controllers,\n unmarshalRaidController\n ),\n rpnVersion: data.rpn_version,\n stock: data.stock,\n stockByDatacenter: data.stock_by_datacenter\n };\n};\nconst unmarshalOfferServiceLevelInfo = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'OfferServiceLevelInfo' failed as data isn't a dictionary.`\n );\n }\n return {\n antidos: data.antidos,\n availableOptions: marshalling.unmarshalArrayOfObject(\n data.available_options,\n unmarshalOffer\n ),\n customization: data.customization,\n extraFailoverQuota: data.extra_failover_quota,\n git: data.git,\n highRpnBandwidth: data.high_rpn_bandwidth,\n prioritySupport: data.priority_support,\n salesSupport: data.sales_support,\n sla: data.sla,\n supportPhone: data.support_phone,\n supportTicket: data.support_ticket\n };\n};\nconst unmarshalOfferStorageInfo = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'OfferStorageInfo' failed as data isn't a dictionary.`\n );\n }\n return {\n maxQuota: data.max_quota,\n size: data.size\n };\n};\nconst unmarshalOffer = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Offer' failed as data isn't a dictionary.`\n );\n }\n return {\n antidosInfo: data.antidos_info ? unmarshalOfferAntiDosInfo(data.antidos_info) : void 0,\n backupInfo: data.backup_info ? unmarshalOfferBackupInfo(data.backup_info) : void 0,\n bandwidthInfo: data.bandwidth_info ? unmarshalOfferBandwidthInfo(data.bandwidth_info) : void 0,\n catalog: data.catalog,\n failoverBlockInfo: data.failover_block_info ? unmarshalOfferFailoverBlockInfo(data.failover_block_info) : void 0,\n failoverIpInfo: data.failover_ip_info ? unmarshalOfferFailoverIpInfo(data.failover_ip_info) : void 0,\n id: data.id,\n licenseInfo: data.license_info ? unmarshalOfferLicenseInfo(data.license_info) : void 0,\n name: data.name,\n paymentFrequency: data.payment_frequency,\n pricing: data.pricing ? customMarshalling.unmarshalMoney(data.pricing) : void 0,\n rpnInfo: data.rpn_info ? unmarshalOfferRPNInfo(data.rpn_info) : void 0,\n sanInfo: data.san_info ? unmarshalOfferSANInfo(data.san_info) : void 0,\n serverInfo: data.server_info ? unmarshalOfferServerInfo(data.server_info) : void 0,\n serviceLevelInfo: data.service_level_info ? unmarshalOfferServiceLevelInfo(data.service_level_info) : void 0,\n storageInfo: data.storage_info ? unmarshalOfferStorageInfo(data.storage_info) : void 0,\n usbStorageInfo: data.usb_storage_info ? unmarshalOfferStorageInfo(data.usb_storage_info) : void 0\n };\n};\nconst unmarshalOS = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'OS' failed as data isn't a dictionary.`\n );\n }\n return {\n allowCustomPartitioning: data.allow_custom_partitioning,\n allowSshKeys: data.allow_ssh_keys,\n allowedFilesystems: data.allowed_filesystems,\n arch: data.arch,\n displayName: data.display_name,\n hostnameMaxLength: data.hostname_max_length,\n hostnameRegex: data.hostname_regex,\n id: data.id,\n licenseOffers: marshalling.unmarshalArrayOfObject(data.license_offers, unmarshalOffer),\n maxPartitions: data.max_partitions,\n name: data.name,\n panelPasswordRegex: data.panel_password_regex,\n passwordRegex: data.password_regex,\n releasedAt: marshalling.unmarshalDate(data.released_at),\n requiresAdminPassword: data.requires_admin_password,\n requiresLicense: data.requires_license,\n requiresPanelPassword: data.requires_panel_password,\n requiresUser: data.requires_user,\n requiresValidHostname: data.requires_valid_hostname,\n type: data.type,\n version: data.version\n };\n};\nconst unmarshalRpnSan = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'RpnSan' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n datacenterName: data.datacenter_name,\n deliveredAt: marshalling.unmarshalDate(data.delivered_at),\n expiresAt: marshalling.unmarshalDate(data.expires_at),\n id: data.id,\n iqn: data.iqn,\n iqnSuffix: data.iqn_suffix,\n offer: data.offer ? unmarshalOffer(data.offer) : void 0,\n offerId: data.offer_id,\n offerName: data.offer_name,\n organizationId: data.organization_id,\n projectId: data.project_id,\n rpnv1Compatible: data.rpnv1_compatible,\n rpnv1Implicit: data.rpnv1_implicit,\n serverHostname: data.server_hostname,\n status: data.status,\n storageSize: data.storage_size,\n terminatedAt: marshalling.unmarshalDate(data.terminated_at)\n };\n};\nconst unmarshalRpnGroup = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'RpnGroup' failed as data isn't a dictionary.`\n );\n }\n return {\n active: data.active,\n createdAt: marshalling.unmarshalDate(data.created_at),\n id: data.id,\n membersCount: data.members_count,\n name: data.name,\n organizationId: data.organization_id,\n owner: data.owner,\n projectId: data.project_id,\n type: data.type\n };\n};\nconst unmarshalNetworkInterface = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'NetworkInterface' failed as data isn't a dictionary.`\n );\n }\n return {\n cardId: data.card_id,\n deviceId: data.device_id,\n ips: marshalling.unmarshalArrayOfObject(data.ips, unmarshalIP),\n mac: data.mac,\n type: data.type\n };\n};\nconst unmarshalServerLocation = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ServerLocation' failed as data isn't a dictionary.`\n );\n }\n return {\n datacenterName: data.datacenter_name,\n rack: data.rack,\n room: data.room\n };\n};\nconst unmarshalServerOption = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ServerOption' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n expiredAt: marshalling.unmarshalDate(data.expired_at),\n offer: data.offer ? unmarshalOffer(data.offer) : void 0,\n options: marshalling.unmarshalArrayOfObject(data.options, unmarshalServerOption),\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalServiceLevel = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ServiceLevel' failed as data isn't a dictionary.`\n );\n }\n return {\n level: data.level,\n offerId: data.offer_id\n };\n};\nconst unmarshalServer = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Server' failed as data isn't a dictionary.`\n );\n }\n return {\n abuseContact: data.abuse_contact,\n createdAt: marshalling.unmarshalDate(data.created_at),\n expiredAt: marshalling.unmarshalDate(data.expired_at),\n hasBmc: data.has_bmc,\n hostname: data.hostname,\n id: data.id,\n interfaces: marshalling.unmarshalArrayOfObject(\n data.interfaces,\n unmarshalNetworkInterface\n ),\n ipv6Slaac: data.ipv6_slaac,\n isOutsourced: data.is_outsourced,\n isRpnv2Member: data.is_rpnv2_member,\n level: data.level ? unmarshalServiceLevel(data.level) : void 0,\n location: data.location ? unmarshalServerLocation(data.location) : void 0,\n offer: data.offer ? unmarshalOffer(data.offer) : void 0,\n options: marshalling.unmarshalArrayOfObject(data.options, unmarshalServerOption),\n organizationId: data.organization_id,\n os: data.os ? unmarshalOS(data.os) : void 0,\n projectId: data.project_id,\n qinq: data.qinq,\n rebootedAt: marshalling.unmarshalDate(data.rebooted_at),\n rescueOs: data.rescue_os ? unmarshalOS(data.rescue_os) : void 0,\n status: data.status,\n tags: data.tags,\n updatedAt: marshalling.unmarshalDate(data.updated_at),\n zone: data.zone\n };\n};\nconst unmarshalRpnV2GroupSubnet = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'RpnV2GroupSubnet' failed as data isn't a dictionary.`\n );\n }\n return {\n address: data.address,\n cidr: data.cidr\n };\n};\nconst unmarshalRpnV2Group = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'RpnV2Group' failed as data isn't a dictionary.`\n );\n }\n return {\n compatibleRpnv1: data.compatible_rpnv1,\n gateway: data.gateway,\n id: data.id,\n membersCount: data.members_count,\n name: data.name,\n organizationId: data.organization_id,\n owner: data.owner,\n projectId: data.project_id,\n rpnv1Group: data.rpnv1_group ? unmarshalRpnGroup(data.rpnv1_group) : void 0,\n status: data.status,\n subnet: data.subnet ? unmarshalRpnV2GroupSubnet(data.subnet) : void 0,\n type: data.type\n };\n};\nconst unmarshalService = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Service' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n deliveredAt: marshalling.unmarshalDate(data.delivered_at),\n expiresAt: marshalling.unmarshalDate(data.expires_at),\n id: data.id,\n offer: data.offer ? unmarshalOffer(data.offer) : void 0,\n provisioningStatus: data.provisioning_status,\n resourceId: data.resource_id,\n terminatedAt: marshalling.unmarshalDate(data.terminated_at),\n type: data.type\n };\n};\nconst unmarshalFailoverBlock = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'FailoverBlock' failed as data isn't a dictionary.`\n );\n }\n return {\n address: data.address,\n cidr: data.cidr,\n gatewayIp: data.gateway_ip,\n id: data.id,\n ipVersion: data.ip_version,\n nameservers: data.nameservers,\n netmask: data.netmask\n };\n};\nconst unmarshalFailoverIP = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'FailoverIP' failed as data isn't a dictionary.`\n );\n }\n return {\n address: data.address,\n block: data.block ? unmarshalFailoverBlock(data.block) : void 0,\n cidr: data.cidr,\n gatewayIp: data.gateway_ip,\n id: data.id,\n ipVersion: data.ip_version,\n mac: data.mac,\n netmask: data.netmask,\n reverse: data.reverse,\n serverId: data.server_id,\n serverZone: data.server_zone,\n status: data.status,\n type: data.type\n };\n};\nconst unmarshalBMCAccess = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'BMCAccess' failed as data isn't a dictionary.`\n );\n }\n return {\n expiresAt: marshalling.unmarshalDate(data.expires_at),\n login: data.login,\n password: data.password,\n status: data.status,\n url: data.url\n };\n};\nconst unmarshalBackup = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Backup' failed as data isn't a dictionary.`\n );\n }\n return {\n aclEnabled: data.acl_enabled,\n autologin: data.autologin,\n id: data.id,\n login: data.login,\n quotaFiles: data.quota_files,\n quotaFilesUsed: data.quota_files_used,\n quotaSpace: data.quota_space,\n quotaSpaceUsed: data.quota_space_used,\n server: data.server,\n status: data.status\n };\n};\nconst unmarshalCanOrderResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'CanOrderResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n billingOk: data.billing_ok,\n canOrder: data.can_order,\n emailConfirmed: data.email_confirmed,\n message: data.message,\n paymentMode: data.payment_mode,\n phoneConfirmed: data.phone_confirmed,\n quotaOk: data.quota_ok,\n userConfirmed: data.user_confirmed\n };\n};\nconst unmarshalCreateFailoverIPsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'CreateFailoverIPsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n services: marshalling.unmarshalArrayOfObject(data.services, unmarshalService),\n totalCount: data.total_count\n };\n};\nconst unmarshalGetIPv6BlockQuotasResponseQuota = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'GetIPv6BlockQuotasResponseQuota' failed as data isn't a dictionary.`\n );\n }\n return {\n cidr: data.cidr,\n quota: data.quota\n };\n};\nconst unmarshalGetIPv6BlockQuotasResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'GetIPv6BlockQuotasResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n quotas: marshalling.unmarshalArrayOfObject(\n data.quotas,\n unmarshalGetIPv6BlockQuotasResponseQuota\n ),\n totalCount: data.total_count\n };\n};\nconst unmarshalGetRemainingQuotaResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'GetRemainingQuotaResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n failoverBlockQuota: data.failover_block_quota,\n failoverBlockRemainingQuota: data.failover_block_remaining_quota,\n failoverIpQuota: data.failover_ip_quota,\n failoverIpRemainingQuota: data.failover_ip_remaining_quota\n };\n};\nconst unmarshalGetRpnStatusResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'GetRpnStatusResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n operationsLeft: data.operations_left,\n status: data.status\n };\n};\nconst unmarshalIPv6Block = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'IPv6Block' failed as data isn't a dictionary.`\n );\n }\n return {\n address: data.address,\n cidr: data.cidr,\n delegationStatus: data.delegation_status,\n duid: data.duid,\n id: data.id,\n nameservers: data.nameservers,\n subnets: marshalling.unmarshalArrayOfObject(data.subnets, unmarshalIPv6Block)\n };\n};\nconst unmarshalInvoice = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Invoice' failed as data isn't a dictionary.`\n );\n }\n return {\n content: data.content,\n createdAt: marshalling.unmarshalDate(data.created_at),\n id: data.id,\n paidAt: marshalling.unmarshalDate(data.paid_at),\n paymentMethod: data.payment_method,\n status: data.status,\n totalWithTaxes: data.total_with_taxes ? customMarshalling.unmarshalMoney(data.total_with_taxes) : void 0,\n totalWithoutTaxes: data.total_without_taxes ? customMarshalling.unmarshalMoney(data.total_without_taxes) : void 0,\n transactionId: data.transaction_id\n };\n};\nconst unmarshalListFailoverIPsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListFailoverIPsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n failoverIps: marshalling.unmarshalArrayOfObject(data.failover_ips, unmarshalFailoverIP),\n totalCount: data.total_count\n };\n};\nconst unmarshalListIPv6BlockSubnetsAvailableResponseSubnet = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListIPv6BlockSubnetsAvailableResponseSubnet' failed as data isn't a dictionary.`\n );\n }\n return {\n address: data.address,\n cidr: data.cidr\n };\n};\nconst unmarshalListIPv6BlockSubnetsAvailableResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListIPv6BlockSubnetsAvailableResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n subnetAvailables: marshalling.unmarshalArrayOfObject(\n data.subnet_availables,\n unmarshalListIPv6BlockSubnetsAvailableResponseSubnet\n ),\n totalCount: data.total_count\n };\n};\nconst unmarshalInvoiceSummary = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'InvoiceSummary' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n id: data.id,\n paidAt: marshalling.unmarshalDate(data.paid_at),\n paymentMethod: data.payment_method,\n status: data.status,\n totalWithTaxes: data.total_with_taxes ? customMarshalling.unmarshalMoney(data.total_with_taxes) : void 0,\n totalWithoutTaxes: data.total_without_taxes ? customMarshalling.unmarshalMoney(data.total_without_taxes) : void 0,\n transactionId: data.transaction_id\n };\n};\nconst unmarshalListInvoicesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListInvoicesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n invoices: marshalling.unmarshalArrayOfObject(data.invoices, unmarshalInvoiceSummary),\n totalCount: data.total_count\n };\n};\nconst unmarshalRpnSanIpRpnV2Group = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'RpnSanIpRpnV2Group' failed as data isn't a dictionary.`\n );\n }\n return {\n id: data.id,\n name: data.name\n };\n};\nconst unmarshalRpnSanIpServer = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'RpnSanIpServer' failed as data isn't a dictionary.`\n );\n }\n return {\n datacenterName: data.datacenter_name,\n hostname: data.hostname,\n id: data.id\n };\n};\nconst unmarshalRpnSanIp = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'RpnSanIp' failed as data isn't a dictionary.`\n );\n }\n return {\n ip: data.ip ? unmarshalIP(data.ip) : void 0,\n rpnv2Group: data.rpnv2_group ? unmarshalRpnSanIpRpnV2Group(data.rpnv2_group) : void 0,\n server: data.server ? unmarshalRpnSanIpServer(data.server) : void 0,\n type: data.type\n };\n};\nconst unmarshalListIpsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListIpsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n ips: marshalling.unmarshalArrayOfObject(data.ips, unmarshalRpnSanIp),\n totalCount: data.total_count\n };\n};\nconst unmarshalListOSResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListOSResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n os: marshalling.unmarshalArrayOfObject(data.os, unmarshalOS),\n totalCount: data.total_count\n };\n};\nconst unmarshalListOffersResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListOffersResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n offers: marshalling.unmarshalArrayOfObject(data.offers, unmarshalOffer),\n totalCount: data.total_count\n };\n};\nconst unmarshalRefundSummary = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'RefundSummary' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n id: data.id,\n method: data.method,\n refundedAt: marshalling.unmarshalDate(data.refunded_at),\n status: data.status,\n totalWithTaxes: data.total_with_taxes ? customMarshalling.unmarshalMoney(data.total_with_taxes) : void 0,\n totalWithoutTaxes: data.total_without_taxes ? customMarshalling.unmarshalMoney(data.total_without_taxes) : void 0\n };\n};\nconst unmarshalListRefundsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListRefundsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n refunds: marshalling.unmarshalArrayOfObject(data.refunds, unmarshalRefundSummary),\n totalCount: data.total_count\n };\n};\nconst unmarshalRpnSanServer = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'RpnSanServer' failed as data isn't a dictionary.`\n );\n }\n return {\n datacenterName: data.datacenter_name,\n hostname: data.hostname,\n id: data.id,\n sans: marshalling.unmarshalArrayOfObject(data.sans, unmarshalRpnSan),\n zone: data.zone\n };\n};\nconst unmarshalListRpnCapableSanServersResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListRpnCapableSanServersResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n sanServers: marshalling.unmarshalArrayOfObject(data.san_servers, unmarshalRpnSanServer),\n totalCount: data.total_count\n };\n};\nconst unmarshalListRpnCapableServersResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListRpnCapableServersResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n servers: marshalling.unmarshalArrayOfObject(data.servers, unmarshalServer),\n totalCount: data.total_count\n };\n};\nconst unmarshalRpnGroupMember = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'RpnGroupMember' failed as data isn't a dictionary.`\n );\n }\n return {\n groupId: data.group_id,\n groupName: data.group_name,\n groupOwner: data.group_owner,\n id: data.id,\n owner: data.owner,\n sanServer: data.san_server ? unmarshalRpnSanServer(data.san_server) : void 0,\n server: data.server ? unmarshalServer(data.server) : void 0,\n speed: data.speed,\n status: data.status\n };\n};\nconst unmarshalListRpnGroupMembersResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListRpnGroupMembersResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n members: marshalling.unmarshalArrayOfObject(data.members, unmarshalRpnGroupMember),\n totalCount: data.total_count\n };\n};\nconst unmarshalListRpnGroupsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListRpnGroupsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n rpnGroups: marshalling.unmarshalArrayOfObject(data.rpn_groups, unmarshalRpnGroup),\n totalCount: data.total_count\n };\n};\nconst unmarshalListRpnInvitesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListRpnInvitesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n members: marshalling.unmarshalArrayOfObject(data.members, unmarshalRpnGroupMember),\n totalCount: data.total_count\n };\n};\nconst unmarshalRpnSanSummary = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'RpnSanSummary' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n datacenterName: data.datacenter_name,\n deliveredAt: marshalling.unmarshalDate(data.delivered_at),\n expiresAt: marshalling.unmarshalDate(data.expires_at),\n id: data.id,\n iqnSuffix: data.iqn_suffix,\n offerId: data.offer_id,\n offerName: data.offer_name,\n organizationId: data.organization_id,\n projectId: data.project_id,\n rpnv1Compatible: data.rpnv1_compatible,\n rpnv1Implicit: data.rpnv1_implicit,\n serverHostname: data.server_hostname,\n status: data.status,\n storageSize: data.storage_size,\n terminatedAt: marshalling.unmarshalDate(data.terminated_at)\n };\n};\nconst unmarshalListRpnSansResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListRpnSansResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n rpnSans: marshalling.unmarshalArrayOfObject(data.rpn_sans, unmarshalRpnSanSummary),\n totalCount: data.total_count\n };\n};\nconst unmarshalRpnServerCapability = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'RpnServerCapability' failed as data isn't a dictionary.`\n );\n }\n return {\n canJoinQinqGroup: data.can_join_qinq_group,\n canJoinRpnv2Group: data.can_join_rpnv2_group,\n compatibleQinq: data.compatible_qinq,\n datacenterName: data.datacenter_name,\n hostname: data.hostname,\n id: data.id,\n ipAddress: data.ip_address,\n rpnVersion: data.rpn_version,\n rpnv1GroupCount: data.rpnv1_group_count,\n rpnv2GroupCount: data.rpnv2_group_count,\n zone: data.zone\n };\n};\nconst unmarshalListRpnServerCapabilitiesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListRpnServerCapabilitiesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n servers: marshalling.unmarshalArrayOfObject(data.servers, unmarshalRpnServerCapability),\n totalCount: data.total_count\n };\n};\nconst unmarshalListRpnV2CapableResourcesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListRpnV2CapableResourcesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n servers: marshalling.unmarshalArrayOfObject(data.servers, unmarshalServer),\n totalCount: data.total_count\n };\n};\nconst unmarshalRpnV2Member = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'RpnV2Member' failed as data isn't a dictionary.`\n );\n }\n return {\n id: data.id,\n rpnv1Group: data.rpnv1_group ? unmarshalRpnGroup(data.rpnv1_group) : void 0,\n server: data.server ? unmarshalServer(data.server) : void 0,\n speed: data.speed,\n status: data.status,\n vlan: data.vlan\n };\n};\nconst unmarshalLog = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Log' failed as data isn't a dictionary.`\n );\n }\n return {\n action: data.action,\n createdAt: marshalling.unmarshalDate(data.created_at),\n finishedAt: marshalling.unmarshalDate(data.finished_at),\n group: data.group ? unmarshalRpnV2Group(data.group) : void 0,\n id: data.id,\n member: data.member ? unmarshalRpnV2Member(data.member) : void 0,\n status: data.status\n };\n};\nconst unmarshalListRpnV2GroupLogsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListRpnV2GroupLogsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n logs: marshalling.unmarshalArrayOfObject(data.logs, unmarshalLog),\n totalCount: data.total_count\n };\n};\nconst unmarshalListRpnV2GroupsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListRpnV2GroupsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n rpnGroups: marshalling.unmarshalArrayOfObject(data.rpn_groups, unmarshalRpnV2Group),\n totalCount: data.total_count\n };\n};\nconst unmarshalListRpnV2MembersResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListRpnV2MembersResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n members: marshalling.unmarshalArrayOfObject(data.members, unmarshalRpnV2Member),\n totalCount: data.total_count\n };\n};\nconst unmarshalServerDisk = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ServerDisk' failed as data isn't a dictionary.`\n );\n }\n return {\n capacity: data.capacity,\n connector: data.connector,\n id: data.id,\n isAddon: data.is_addon,\n type: data.type\n };\n};\nconst unmarshalListServerDisksResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListServerDisksResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n disks: marshalling.unmarshalArrayOfObject(data.disks, unmarshalServerDisk),\n totalCount: data.total_count\n };\n};\nconst unmarshalServerEvent = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ServerEvent' failed as data isn't a dictionary.`\n );\n }\n return {\n date: marshalling.unmarshalDate(data.date),\n description: data.description,\n eventId: data.event_id\n };\n};\nconst unmarshalListServerEventsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListServerEventsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n events: marshalling.unmarshalArrayOfObject(data.events, unmarshalServerEvent),\n totalCount: data.total_count\n };\n};\nconst unmarshalServerSummary = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ServerSummary' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n datacenterName: data.datacenter_name,\n expiredAt: marshalling.unmarshalDate(data.expired_at),\n hostname: data.hostname,\n id: data.id,\n interfaces: marshalling.unmarshalArrayOfObject(\n data.interfaces,\n unmarshalNetworkInterface\n ),\n isOutsourced: data.is_outsourced,\n level: data.level ? unmarshalServiceLevel(data.level) : void 0,\n offerId: data.offer_id,\n offerName: data.offer_name,\n organizationId: data.organization_id,\n osId: data.os_id,\n projectId: data.project_id,\n qinq: data.qinq,\n rpnVersion: data.rpn_version,\n status: data.status,\n updatedAt: marshalling.unmarshalDate(data.updated_at),\n zone: data.zone\n };\n};\nconst unmarshalListServersResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListServersResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n servers: marshalling.unmarshalArrayOfObject(data.servers, unmarshalServerSummary),\n totalCount: data.total_count\n };\n};\nconst unmarshalListServicesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListServicesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n services: marshalling.unmarshalArrayOfObject(data.services, unmarshalService),\n totalCount: data.total_count\n };\n};\nconst unmarshalListSubscribableServerOptionsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListSubscribableServerOptionsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n serverOptions: marshalling.unmarshalArrayOfObject(data.server_options, unmarshalOffer),\n totalCount: data.total_count\n };\n};\nconst unmarshalRaidArray = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'RaidArray' failed as data isn't a dictionary.`\n );\n }\n return {\n disks: marshalling.unmarshalArrayOfObject(data.disks, unmarshalServerDisk),\n raidLevel: data.raid_level\n };\n};\nconst unmarshalRaid = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Raid' failed as data isn't a dictionary.`\n );\n }\n return {\n raidArrays: marshalling.unmarshalArrayOfObject(data.raid_arrays, unmarshalRaidArray)\n };\n};\nconst unmarshalRefund = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Refund' failed as data isn't a dictionary.`\n );\n }\n return {\n content: data.content,\n createdAt: marshalling.unmarshalDate(data.created_at),\n id: data.id,\n method: data.method,\n refundedAt: marshalling.unmarshalDate(data.refunded_at),\n status: data.status,\n totalWithTaxes: data.total_with_taxes ? customMarshalling.unmarshalMoney(data.total_with_taxes) : void 0,\n totalWithoutTaxes: data.total_without_taxes ? customMarshalling.unmarshalMoney(data.total_without_taxes) : void 0\n };\n};\nconst unmarshalRescue = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Rescue' failed as data isn't a dictionary.`\n );\n }\n return {\n login: data.login,\n osId: data.os_id,\n password: data.password,\n protocol: data.protocol\n };\n};\nconst unmarshalPartition = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Partition' failed as data isn't a dictionary.`\n );\n }\n return {\n capacity: data.capacity,\n connectors: data.connectors,\n fileSystem: data.file_system,\n mountPoint: data.mount_point,\n raidLevel: data.raid_level,\n type: data.type\n };\n};\nconst unmarshalServerDefaultPartitioning = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ServerDefaultPartitioning' failed as data isn't a dictionary.`\n );\n }\n return {\n partitions: marshalling.unmarshalArrayOfObject(data.partitions, unmarshalPartition)\n };\n};\nconst unmarshalServerInstall = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ServerInstall' failed as data isn't a dictionary.`\n );\n }\n return {\n hostname: data.hostname,\n osId: data.os_id,\n panelUrl: data.panel_url,\n partitions: marshalling.unmarshalArrayOfObject(data.partitions, unmarshalPartition),\n sshKeyIds: data.ssh_key_ids,\n status: data.status,\n userLogin: data.user_login\n };\n};\nconst unmarshalSubscribeStorageOptionsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SubscribeStorageOptionsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n services: marshalling.unmarshalArrayOfObject(data.services, unmarshalService)\n };\n};\nconst marshalAttachFailoverIPToMacAddressRequest = (request, defaults) => ({\n mac: request.mac,\n type: request.type\n});\nconst marshalAttachFailoverIPsRequest = (request, defaults) => ({\n fips_ids: request.fipsIds,\n server_id: request.serverId\n});\nconst marshalCreateFailoverIPsRequest = (request, defaults) => ({\n offer_id: request.offerId,\n project_id: request.projectId ?? defaults.defaultProjectId,\n quantity: request.quantity\n});\nconst marshalCreateServerRequest = (request, defaults) => ({\n datacenter_name: request.datacenterName,\n offer_id: request.offerId,\n project_id: request.projectId ?? defaults.defaultProjectId,\n server_option_ids: request.serverOptionIds\n});\nconst marshalDetachFailoverIPsRequest = (request, defaults) => ({\n fips_ids: request.fipsIds\n});\nconst marshalIPv6BlockApiCreateIPv6BlockRequest = (request, defaults) => ({\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalIPv6BlockApiCreateIPv6BlockSubnetRequest = (request, defaults) => ({\n address: request.address,\n cidr: request.cidr\n});\nconst marshalIPv6BlockApiUpdateIPv6BlockRequest = (request, defaults) => ({\n nameservers: request.nameservers\n});\nconst marshalInstallPartition = (request, defaults) => ({\n capacity: request.capacity,\n connectors: request.connectors,\n file_system: request.fileSystem,\n mount_point: request.mountPoint,\n raid_level: request.raidLevel\n});\nconst marshalInstallServerRequest = (request, defaults) => ({\n hostname: request.hostname,\n ip_id: request.ipId,\n license_offer_id: request.licenseOfferId,\n os_id: request.osId,\n panel_password: request.panelPassword,\n partitions: request.partitions !== void 0 ? request.partitions.map((elt) => marshalInstallPartition(elt)) : void 0,\n root_password: request.rootPassword,\n ssh_key_ids: request.sshKeyIds,\n user_login: request.userLogin,\n user_password: request.userPassword\n});\nconst marshalRpnSanApiAddIpRequest = (request, defaults) => ({\n ip_ids: request.ipIds\n});\nconst marshalRpnSanApiCreateRpnSanRequest = (request, defaults) => ({\n offer_id: request.offerId,\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalRpnSanApiRemoveIpRequest = (request, defaults) => ({\n ip_ids: request.ipIds\n});\nconst marshalRpnV1ApiAddRpnGroupMembersRequest = (request, defaults) => ({\n san_server_ids: request.sanServerIds,\n server_ids: request.serverIds\n});\nconst marshalRpnV1ApiCreateRpnGroupRequest = (request, defaults) => ({\n name: request.name,\n project_id: request.projectId ?? defaults.defaultProjectId,\n san_server_ids: request.sanServerIds,\n server_ids: request.serverIds\n});\nconst marshalRpnV1ApiDeleteRpnGroupMembersRequest = (request, defaults) => ({\n member_ids: request.memberIds\n});\nconst marshalRpnV1ApiLeaveRpnGroupRequest = (request, defaults) => ({\n member_ids: request.memberIds,\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalRpnV1ApiRpnGroupInviteRequest = (request, defaults) => ({\n project_id: request.projectId ?? defaults.defaultProjectId,\n server_ids: request.serverIds\n});\nconst marshalRpnV1ApiUpdateRpnGroupNameRequest = (request, defaults) => ({\n name: request.name\n});\nconst marshalRpnV2ApiAddRpnV2MembersRequest = (request, defaults) => ({\n servers: request.servers\n});\nconst marshalRpnV2ApiCreateRpnV2GroupRequest = (request, defaults) => ({\n name: request.name,\n project_id: request.projectId ?? defaults.defaultProjectId,\n servers: request.servers,\n type: request.type\n});\nconst marshalRpnV2ApiDeleteRpnV2MembersRequest = (request, defaults) => ({\n member_ids: request.memberIds\n});\nconst marshalRpnV2ApiEnableRpnV2GroupCompatibilityRequest = (request, defaults) => ({\n rpnv1_group_id: request.rpnv1GroupId\n});\nconst marshalRpnV2ApiUpdateRpnV2GroupNameRequest = (request, defaults) => ({\n name: request.name\n});\nconst marshalRpnV2ApiUpdateRpnV2VlanForMembersRequest = (request, defaults) => ({\n member_ids: request.memberIds,\n vlan: request.vlan\n});\nconst marshalStartBMCAccessRequest = (request, defaults) => ({\n ip: request.ip\n});\nconst marshalStartRescueRequest = (request, defaults) => ({\n os_id: request.osId\n});\nconst marshalSubscribeServerOptionRequest = (request, defaults) => ({\n option_id: request.optionId\n});\nconst marshalSubscribeStorageOptionsRequest = (request, defaults) => ({\n options_ids: request.optionsIds\n});\nconst marshalUpdatableRaidArray = (request, defaults) => ({\n disk_ids: request.diskIds,\n raid_level: request.raidLevel\n});\nconst marshalUpdateRaidRequest = (request, defaults) => ({\n raid_arrays: request.raidArrays.map(\n (elt) => marshalUpdatableRaidArray(elt)\n )\n});\nconst marshalUpdateReverseRequest = (request, defaults) => ({\n reverse: request.reverse\n});\nconst marshalUpdateServerBackupRequest = (request, defaults) => ({\n acl_enabled: request.aclEnabled,\n autologin: request.autologin,\n password: request.password\n});\nconst marshalUpdateServerRequest = (request, defaults) => ({\n enable_ipv6: request.enableIpv6,\n hostname: request.hostname\n});\nconst marshalUpdateServerTagsRequest = (request, defaults) => ({\n tags: request.tags\n});\nexports.marshalAttachFailoverIPToMacAddressRequest = marshalAttachFailoverIPToMacAddressRequest;\nexports.marshalAttachFailoverIPsRequest = marshalAttachFailoverIPsRequest;\nexports.marshalCreateFailoverIPsRequest = marshalCreateFailoverIPsRequest;\nexports.marshalCreateServerRequest = marshalCreateServerRequest;\nexports.marshalDetachFailoverIPsRequest = marshalDetachFailoverIPsRequest;\nexports.marshalIPv6BlockApiCreateIPv6BlockRequest = marshalIPv6BlockApiCreateIPv6BlockRequest;\nexports.marshalIPv6BlockApiCreateIPv6BlockSubnetRequest = marshalIPv6BlockApiCreateIPv6BlockSubnetRequest;\nexports.marshalIPv6BlockApiUpdateIPv6BlockRequest = marshalIPv6BlockApiUpdateIPv6BlockRequest;\nexports.marshalInstallServerRequest = marshalInstallServerRequest;\nexports.marshalRpnSanApiAddIpRequest = marshalRpnSanApiAddIpRequest;\nexports.marshalRpnSanApiCreateRpnSanRequest = marshalRpnSanApiCreateRpnSanRequest;\nexports.marshalRpnSanApiRemoveIpRequest = marshalRpnSanApiRemoveIpRequest;\nexports.marshalRpnV1ApiAddRpnGroupMembersRequest = marshalRpnV1ApiAddRpnGroupMembersRequest;\nexports.marshalRpnV1ApiCreateRpnGroupRequest = marshalRpnV1ApiCreateRpnGroupRequest;\nexports.marshalRpnV1ApiDeleteRpnGroupMembersRequest = marshalRpnV1ApiDeleteRpnGroupMembersRequest;\nexports.marshalRpnV1ApiLeaveRpnGroupRequest = marshalRpnV1ApiLeaveRpnGroupRequest;\nexports.marshalRpnV1ApiRpnGroupInviteRequest = marshalRpnV1ApiRpnGroupInviteRequest;\nexports.marshalRpnV1ApiUpdateRpnGroupNameRequest = marshalRpnV1ApiUpdateRpnGroupNameRequest;\nexports.marshalRpnV2ApiAddRpnV2MembersRequest = marshalRpnV2ApiAddRpnV2MembersRequest;\nexports.marshalRpnV2ApiCreateRpnV2GroupRequest = marshalRpnV2ApiCreateRpnV2GroupRequest;\nexports.marshalRpnV2ApiDeleteRpnV2MembersRequest = marshalRpnV2ApiDeleteRpnV2MembersRequest;\nexports.marshalRpnV2ApiEnableRpnV2GroupCompatibilityRequest = marshalRpnV2ApiEnableRpnV2GroupCompatibilityRequest;\nexports.marshalRpnV2ApiUpdateRpnV2GroupNameRequest = marshalRpnV2ApiUpdateRpnV2GroupNameRequest;\nexports.marshalRpnV2ApiUpdateRpnV2VlanForMembersRequest = marshalRpnV2ApiUpdateRpnV2VlanForMembersRequest;\nexports.marshalStartBMCAccessRequest = marshalStartBMCAccessRequest;\nexports.marshalStartRescueRequest = marshalStartRescueRequest;\nexports.marshalSubscribeServerOptionRequest = marshalSubscribeServerOptionRequest;\nexports.marshalSubscribeStorageOptionsRequest = marshalSubscribeStorageOptionsRequest;\nexports.marshalUpdateRaidRequest = marshalUpdateRaidRequest;\nexports.marshalUpdateReverseRequest = marshalUpdateReverseRequest;\nexports.marshalUpdateServerBackupRequest = marshalUpdateServerBackupRequest;\nexports.marshalUpdateServerRequest = marshalUpdateServerRequest;\nexports.marshalUpdateServerTagsRequest = marshalUpdateServerTagsRequest;\nexports.unmarshalBMCAccess = unmarshalBMCAccess;\nexports.unmarshalBackup = unmarshalBackup;\nexports.unmarshalCanOrderResponse = unmarshalCanOrderResponse;\nexports.unmarshalCreateFailoverIPsResponse = unmarshalCreateFailoverIPsResponse;\nexports.unmarshalFailoverIP = unmarshalFailoverIP;\nexports.unmarshalGetIPv6BlockQuotasResponse = unmarshalGetIPv6BlockQuotasResponse;\nexports.unmarshalGetRemainingQuotaResponse = unmarshalGetRemainingQuotaResponse;\nexports.unmarshalGetRpnStatusResponse = unmarshalGetRpnStatusResponse;\nexports.unmarshalIP = unmarshalIP;\nexports.unmarshalIPv6Block = unmarshalIPv6Block;\nexports.unmarshalInvoice = unmarshalInvoice;\nexports.unmarshalListFailoverIPsResponse = unmarshalListFailoverIPsResponse;\nexports.unmarshalListIPv6BlockSubnetsAvailableResponse = unmarshalListIPv6BlockSubnetsAvailableResponse;\nexports.unmarshalListInvoicesResponse = unmarshalListInvoicesResponse;\nexports.unmarshalListIpsResponse = unmarshalListIpsResponse;\nexports.unmarshalListOSResponse = unmarshalListOSResponse;\nexports.unmarshalListOffersResponse = unmarshalListOffersResponse;\nexports.unmarshalListRefundsResponse = unmarshalListRefundsResponse;\nexports.unmarshalListRpnCapableSanServersResponse = unmarshalListRpnCapableSanServersResponse;\nexports.unmarshalListRpnCapableServersResponse = unmarshalListRpnCapableServersResponse;\nexports.unmarshalListRpnGroupMembersResponse = unmarshalListRpnGroupMembersResponse;\nexports.unmarshalListRpnGroupsResponse = unmarshalListRpnGroupsResponse;\nexports.unmarshalListRpnInvitesResponse = unmarshalListRpnInvitesResponse;\nexports.unmarshalListRpnSansResponse = unmarshalListRpnSansResponse;\nexports.unmarshalListRpnServerCapabilitiesResponse = unmarshalListRpnServerCapabilitiesResponse;\nexports.unmarshalListRpnV2CapableResourcesResponse = unmarshalListRpnV2CapableResourcesResponse;\nexports.unmarshalListRpnV2GroupLogsResponse = unmarshalListRpnV2GroupLogsResponse;\nexports.unmarshalListRpnV2GroupsResponse = unmarshalListRpnV2GroupsResponse;\nexports.unmarshalListRpnV2MembersResponse = unmarshalListRpnV2MembersResponse;\nexports.unmarshalListServerDisksResponse = unmarshalListServerDisksResponse;\nexports.unmarshalListServerEventsResponse = unmarshalListServerEventsResponse;\nexports.unmarshalListServersResponse = unmarshalListServersResponse;\nexports.unmarshalListServicesResponse = unmarshalListServicesResponse;\nexports.unmarshalListSubscribableServerOptionsResponse = unmarshalListSubscribableServerOptionsResponse;\nexports.unmarshalOS = unmarshalOS;\nexports.unmarshalOffer = unmarshalOffer;\nexports.unmarshalRaid = unmarshalRaid;\nexports.unmarshalRefund = unmarshalRefund;\nexports.unmarshalRescue = unmarshalRescue;\nexports.unmarshalRpnGroup = unmarshalRpnGroup;\nexports.unmarshalRpnSan = unmarshalRpnSan;\nexports.unmarshalRpnV2Group = unmarshalRpnV2Group;\nexports.unmarshalServer = unmarshalServer;\nexports.unmarshalServerDefaultPartitioning = unmarshalServerDefaultPartitioning;\nexports.unmarshalServerInstall = unmarshalServerInstall;\nexports.unmarshalService = unmarshalService;\nexports.unmarshalSubscribeStorageOptionsResponse = unmarshalSubscribeStorageOptionsResponse;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst AttachFailoverIPToMacAddressRequest = {\n ipId: {\n greaterThan: 0\n }\n};\nconst AttachFailoverIPsRequest = {\n serverId: {\n greaterThan: 0\n }\n};\nconst BillingApiDownloadInvoiceRequest = {\n invoiceId: {\n greaterThan: 0\n }\n};\nconst BillingApiDownloadRefundRequest = {\n refundId: {\n greaterThan: 0\n }\n};\nconst BillingApiGetInvoiceRequest = {\n invoiceId: {\n greaterThan: 0\n }\n};\nconst BillingApiGetRefundRequest = {\n refundId: {\n greaterThan: 0\n }\n};\nconst BillingApiListInvoicesRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nconst BillingApiListRefundsRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nconst CancelServerInstallRequest = {\n serverId: {\n greaterThan: 0\n }\n};\nconst DeleteFailoverIPRequest = {\n ipId: {\n greaterThan: 0\n }\n};\nconst DeleteServerRequest = {\n serverId: {\n greaterThan: 0\n }\n};\nconst DeleteServiceRequest = {\n serviceId: {\n greaterThan: 0\n }\n};\nconst DetachFailoverIPFromMacAddressRequest = {\n ipId: {\n greaterThan: 0\n }\n};\nconst GetBMCAccessRequest = {\n serverId: {\n greaterThan: 0\n }\n};\nconst GetFailoverIPRequest = {\n ipId: {\n greaterThan: 0\n }\n};\nconst GetOSRequest = {\n osId: {\n greaterThan: 0\n },\n serverId: {\n greaterThan: 0\n }\n};\nconst GetOfferRequest = {\n offerId: {\n greaterThan: 0\n }\n};\nconst GetOrderedServiceRequest = {\n orderedServiceId: {\n greaterThan: 0\n }\n};\nconst GetRaidRequest = {\n serverId: {\n greaterThan: 0\n }\n};\nconst GetRescueRequest = {\n serverId: {\n greaterThan: 0\n }\n};\nconst GetServerBackupRequest = {\n serverId: {\n greaterThan: 0\n }\n};\nconst GetServerInstallRequest = {\n serverId: {\n greaterThan: 0\n }\n};\nconst GetServerRequest = {\n serverId: {\n greaterThan: 0\n }\n};\nconst GetServiceRequest = {\n serviceId: {\n greaterThan: 0\n }\n};\nconst IPv6Block = {\n id: {\n greaterThan: 0\n }\n};\nconst IPv6BlockApiCreateIPv6BlockSubnetRequest = {\n blockId: {\n greaterThan: 0\n }\n};\nconst IPv6BlockApiDeleteIPv6BlockRequest = {\n blockId: {\n greaterThan: 0\n }\n};\nconst IPv6BlockApiListIPv6BlockSubnetsAvailableRequest = {\n blockId: {\n greaterThan: 0\n }\n};\nconst IPv6BlockApiUpdateIPv6BlockRequest = {\n blockId: {\n greaterThan: 0\n }\n};\nconst InstallServerRequest = {\n osId: {\n greaterThan: 0\n },\n serverId: {\n greaterThan: 0\n }\n};\nconst ListFailoverIPsRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nconst ListOSRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n },\n serverId: {\n greaterThan: 0\n }\n};\nconst ListOffersRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nconst ListServerDisksRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n },\n serverId: {\n greaterThan: 0\n }\n};\nconst ListServerEventsRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n },\n serverId: {\n greaterThan: 0\n }\n};\nconst ListServersRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nconst ListServicesRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nconst ListSubscribableServerOptionsRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n },\n serverId: {\n greaterThan: 0\n }\n};\nconst RebootServerRequest = {\n serverId: {\n greaterThan: 0\n }\n};\nconst RpnApiListRpnServerCapabilitiesRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nconst RpnSanApiAddIpRequest = {\n rpnSanId: {\n greaterThan: 0\n }\n};\nconst RpnSanApiDeleteRpnSanRequest = {\n rpnSanId: {\n greaterThan: 0\n }\n};\nconst RpnSanApiGetRpnSanRequest = {\n rpnSanId: {\n greaterThan: 0\n }\n};\nconst RpnSanApiListAvailableIpsRequest = {\n rpnSanId: {\n greaterThan: 0\n }\n};\nconst RpnSanApiListIpsRequest = {\n rpnSanId: {\n greaterThan: 0\n }\n};\nconst RpnSanApiListRpnSansRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nconst RpnSanApiRemoveIpRequest = {\n rpnSanId: {\n greaterThan: 0\n }\n};\nconst RpnV1ApiAcceptRpnInviteRequest = {\n memberId: {\n greaterThan: 0\n }\n};\nconst RpnV1ApiAddRpnGroupMembersRequest = {\n groupId: {\n greaterThan: 0\n }\n};\nconst RpnV1ApiDeleteRpnGroupMembersRequest = {\n groupId: {\n greaterThan: 0\n }\n};\nconst RpnV1ApiDeleteRpnGroupRequest = {\n groupId: {\n greaterThan: 0\n }\n};\nconst RpnV1ApiGetRpnGroupRequest = {\n groupId: {\n greaterThan: 0\n }\n};\nconst RpnV1ApiLeaveRpnGroupRequest = {\n groupId: {\n greaterThan: 0\n }\n};\nconst RpnV1ApiListRpnCapableSanServersRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nconst RpnV1ApiListRpnCapableServersRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nconst RpnV1ApiListRpnGroupMembersRequest = {\n groupId: {\n greaterThan: 0\n },\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nconst RpnV1ApiListRpnGroupsRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nconst RpnV1ApiListRpnInvitesRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nconst RpnV1ApiRefuseRpnInviteRequest = {\n memberId: {\n greaterThan: 0\n }\n};\nconst RpnV1ApiRpnGroupInviteRequest = {\n groupId: {\n greaterThan: 0\n }\n};\nconst RpnV1ApiUpdateRpnGroupNameRequest = {\n groupId: {\n greaterThan: 0\n }\n};\nconst RpnV2ApiAddRpnV2MembersRequest = {\n groupId: {\n greaterThan: 0\n }\n};\nconst RpnV2ApiDeleteRpnV2GroupRequest = {\n groupId: {\n greaterThan: 0\n }\n};\nconst RpnV2ApiDeleteRpnV2MembersRequest = {\n groupId: {\n greaterThan: 0\n }\n};\nconst RpnV2ApiDisableRpnV2GroupCompatibilityRequest = {\n groupId: {\n greaterThan: 0\n }\n};\nconst RpnV2ApiEnableRpnV2GroupCompatibilityRequest = {\n groupId: {\n greaterThan: 0\n }\n};\nconst RpnV2ApiGetRpnV2GroupRequest = {\n groupId: {\n greaterThan: 0\n }\n};\nconst RpnV2ApiListRpnV2CapableResourcesRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nconst RpnV2ApiListRpnV2GroupLogsRequest = {\n groupId: {\n greaterThan: 0\n },\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nconst RpnV2ApiListRpnV2GroupsRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nconst RpnV2ApiListRpnV2MembersRequest = {\n groupId: {\n greaterThan: 0\n },\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nconst RpnV2ApiUpdateRpnV2GroupNameRequest = {\n groupId: {\n greaterThan: 0\n }\n};\nconst RpnV2ApiUpdateRpnV2VlanForMembersRequest = {\n groupId: {\n greaterThan: 0\n }\n};\nconst StartRescueRequest = {\n serverId: {\n greaterThan: 0\n }\n};\nconst StartServerRequest = {\n serverId: {\n greaterThan: 0\n }\n};\nconst StopBMCAccessRequest = {\n serverId: {\n greaterThan: 0\n }\n};\nconst StopRescueRequest = {\n serverId: {\n greaterThan: 0\n }\n};\nconst StopServerRequest = {\n serverId: {\n greaterThan: 0\n }\n};\nconst SubscribeServerOptionRequest = {\n optionId: {\n greaterThan: 0\n },\n serverId: {\n greaterThan: 0\n }\n};\nconst SubscribeStorageOptionsRequest = {\n serverId: {\n greaterThan: 0\n }\n};\nconst UpdateRaidRequest = {\n serverId: {\n greaterThan: 0\n }\n};\nconst UpdateReverseRequest = {\n ipId: {\n greaterThan: 0\n }\n};\nconst UpdateServerBackupRequest = {\n serverId: {\n greaterThan: 0\n }\n};\nconst UpdateServerRequest = {\n serverId: {\n greaterThan: 0\n }\n};\nconst UpdateServerTagsRequest = {\n serverId: {\n greaterThan: 0\n }\n};\nexports.AttachFailoverIPToMacAddressRequest = AttachFailoverIPToMacAddressRequest;\nexports.AttachFailoverIPsRequest = AttachFailoverIPsRequest;\nexports.BillingApiDownloadInvoiceRequest = BillingApiDownloadInvoiceRequest;\nexports.BillingApiDownloadRefundRequest = BillingApiDownloadRefundRequest;\nexports.BillingApiGetInvoiceRequest = BillingApiGetInvoiceRequest;\nexports.BillingApiGetRefundRequest = BillingApiGetRefundRequest;\nexports.BillingApiListInvoicesRequest = BillingApiListInvoicesRequest;\nexports.BillingApiListRefundsRequest = BillingApiListRefundsRequest;\nexports.CancelServerInstallRequest = CancelServerInstallRequest;\nexports.DeleteFailoverIPRequest = DeleteFailoverIPRequest;\nexports.DeleteServerRequest = DeleteServerRequest;\nexports.DeleteServiceRequest = DeleteServiceRequest;\nexports.DetachFailoverIPFromMacAddressRequest = DetachFailoverIPFromMacAddressRequest;\nexports.GetBMCAccessRequest = GetBMCAccessRequest;\nexports.GetFailoverIPRequest = GetFailoverIPRequest;\nexports.GetOSRequest = GetOSRequest;\nexports.GetOfferRequest = GetOfferRequest;\nexports.GetOrderedServiceRequest = GetOrderedServiceRequest;\nexports.GetRaidRequest = GetRaidRequest;\nexports.GetRescueRequest = GetRescueRequest;\nexports.GetServerBackupRequest = GetServerBackupRequest;\nexports.GetServerInstallRequest = GetServerInstallRequest;\nexports.GetServerRequest = GetServerRequest;\nexports.GetServiceRequest = GetServiceRequest;\nexports.IPv6Block = IPv6Block;\nexports.IPv6BlockApiCreateIPv6BlockSubnetRequest = IPv6BlockApiCreateIPv6BlockSubnetRequest;\nexports.IPv6BlockApiDeleteIPv6BlockRequest = IPv6BlockApiDeleteIPv6BlockRequest;\nexports.IPv6BlockApiListIPv6BlockSubnetsAvailableRequest = IPv6BlockApiListIPv6BlockSubnetsAvailableRequest;\nexports.IPv6BlockApiUpdateIPv6BlockRequest = IPv6BlockApiUpdateIPv6BlockRequest;\nexports.InstallServerRequest = InstallServerRequest;\nexports.ListFailoverIPsRequest = ListFailoverIPsRequest;\nexports.ListOSRequest = ListOSRequest;\nexports.ListOffersRequest = ListOffersRequest;\nexports.ListServerDisksRequest = ListServerDisksRequest;\nexports.ListServerEventsRequest = ListServerEventsRequest;\nexports.ListServersRequest = ListServersRequest;\nexports.ListServicesRequest = ListServicesRequest;\nexports.ListSubscribableServerOptionsRequest = ListSubscribableServerOptionsRequest;\nexports.RebootServerRequest = RebootServerRequest;\nexports.RpnApiListRpnServerCapabilitiesRequest = RpnApiListRpnServerCapabilitiesRequest;\nexports.RpnSanApiAddIpRequest = RpnSanApiAddIpRequest;\nexports.RpnSanApiDeleteRpnSanRequest = RpnSanApiDeleteRpnSanRequest;\nexports.RpnSanApiGetRpnSanRequest = RpnSanApiGetRpnSanRequest;\nexports.RpnSanApiListAvailableIpsRequest = RpnSanApiListAvailableIpsRequest;\nexports.RpnSanApiListIpsRequest = RpnSanApiListIpsRequest;\nexports.RpnSanApiListRpnSansRequest = RpnSanApiListRpnSansRequest;\nexports.RpnSanApiRemoveIpRequest = RpnSanApiRemoveIpRequest;\nexports.RpnV1ApiAcceptRpnInviteRequest = RpnV1ApiAcceptRpnInviteRequest;\nexports.RpnV1ApiAddRpnGroupMembersRequest = RpnV1ApiAddRpnGroupMembersRequest;\nexports.RpnV1ApiDeleteRpnGroupMembersRequest = RpnV1ApiDeleteRpnGroupMembersRequest;\nexports.RpnV1ApiDeleteRpnGroupRequest = RpnV1ApiDeleteRpnGroupRequest;\nexports.RpnV1ApiGetRpnGroupRequest = RpnV1ApiGetRpnGroupRequest;\nexports.RpnV1ApiLeaveRpnGroupRequest = RpnV1ApiLeaveRpnGroupRequest;\nexports.RpnV1ApiListRpnCapableSanServersRequest = RpnV1ApiListRpnCapableSanServersRequest;\nexports.RpnV1ApiListRpnCapableServersRequest = RpnV1ApiListRpnCapableServersRequest;\nexports.RpnV1ApiListRpnGroupMembersRequest = RpnV1ApiListRpnGroupMembersRequest;\nexports.RpnV1ApiListRpnGroupsRequest = RpnV1ApiListRpnGroupsRequest;\nexports.RpnV1ApiListRpnInvitesRequest = RpnV1ApiListRpnInvitesRequest;\nexports.RpnV1ApiRefuseRpnInviteRequest = RpnV1ApiRefuseRpnInviteRequest;\nexports.RpnV1ApiRpnGroupInviteRequest = RpnV1ApiRpnGroupInviteRequest;\nexports.RpnV1ApiUpdateRpnGroupNameRequest = RpnV1ApiUpdateRpnGroupNameRequest;\nexports.RpnV2ApiAddRpnV2MembersRequest = RpnV2ApiAddRpnV2MembersRequest;\nexports.RpnV2ApiDeleteRpnV2GroupRequest = RpnV2ApiDeleteRpnV2GroupRequest;\nexports.RpnV2ApiDeleteRpnV2MembersRequest = RpnV2ApiDeleteRpnV2MembersRequest;\nexports.RpnV2ApiDisableRpnV2GroupCompatibilityRequest = RpnV2ApiDisableRpnV2GroupCompatibilityRequest;\nexports.RpnV2ApiEnableRpnV2GroupCompatibilityRequest = RpnV2ApiEnableRpnV2GroupCompatibilityRequest;\nexports.RpnV2ApiGetRpnV2GroupRequest = RpnV2ApiGetRpnV2GroupRequest;\nexports.RpnV2ApiListRpnV2CapableResourcesRequest = RpnV2ApiListRpnV2CapableResourcesRequest;\nexports.RpnV2ApiListRpnV2GroupLogsRequest = RpnV2ApiListRpnV2GroupLogsRequest;\nexports.RpnV2ApiListRpnV2GroupsRequest = RpnV2ApiListRpnV2GroupsRequest;\nexports.RpnV2ApiListRpnV2MembersRequest = RpnV2ApiListRpnV2MembersRequest;\nexports.RpnV2ApiUpdateRpnV2GroupNameRequest = RpnV2ApiUpdateRpnV2GroupNameRequest;\nexports.RpnV2ApiUpdateRpnV2VlanForMembersRequest = RpnV2ApiUpdateRpnV2VlanForMembersRequest;\nexports.StartRescueRequest = StartRescueRequest;\nexports.StartServerRequest = StartServerRequest;\nexports.StopBMCAccessRequest = StopBMCAccessRequest;\nexports.StopRescueRequest = StopRescueRequest;\nexports.StopServerRequest = StopServerRequest;\nexports.SubscribeServerOptionRequest = SubscribeServerOptionRequest;\nexports.SubscribeStorageOptionsRequest = SubscribeStorageOptionsRequest;\nexports.UpdateRaidRequest = UpdateRaidRequest;\nexports.UpdateReverseRequest = UpdateReverseRequest;\nexports.UpdateServerBackupRequest = UpdateServerBackupRequest;\nexports.UpdateServerRequest = UpdateServerRequest;\nexports.UpdateServerTagsRequest = UpdateServerTagsRequest;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst index_gen = require(\"./v1beta1/index.gen.cjs\");\nexports.v1beta1 = index_gen;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst intervalRetrier = require(\"../../../internal/async/interval-retrier.cjs\");\nconst api = require(\"../../../scw/api.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst resourcePaginator = require(\"../../../scw/fetch/resource-paginator.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nconst marshalling_gen = require(\"./marshalling.gen.cjs\");\nconst jsonContentHeaders = {\n \"Content-Type\": \"application/json; charset=utf-8\"\n};\nclass API extends api.API {\n /** Lists the available regions of the API. */\n static LOCALITIES = [\"fr-par\", \"nl-ams\", \"pl-waw\"];\n pageOfListDatabaseEngines = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/document-db/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/database-engines`,\n urlParams: marshalling.urlParams(\n [\"name\", request.name],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"version\", request.version]\n )\n },\n marshalling_gen.unmarshalListDatabaseEnginesResponse\n );\n /**\n * List available database engines. List the FerretDB database engines\n * available at Scaleway.\n *\n * @param request - The request {@link ListDatabaseEnginesRequest}\n * @returns A Promise of ListDatabaseEnginesResponse\n */\n listDatabaseEngines = (request = {}) => resourcePaginator.enrichForPagination(\"engines\", this.pageOfListDatabaseEngines, request);\n pageOfListNodeTypes = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/document-db/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/node-types`,\n urlParams: marshalling.urlParams(\n [\"include_disabled_types\", request.includeDisabledTypes],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListNodeTypesResponse\n );\n /**\n * List available node types. List all available node types. By default, the\n * node types returned in the list are ordered by creation date in ascending\n * order, though this can be modified via the `order_by` field.\n *\n * @param request - The request {@link ListNodeTypesRequest}\n * @returns A Promise of ListNodeTypesResponse\n */\n listNodeTypes = (request) => resourcePaginator.enrichForPagination(\"nodeTypes\", this.pageOfListNodeTypes, request);\n /**\n * Upgrade a Database Instance. Upgrade your current Database Instance\n * specifications like node type, high availability, volume, or the database\n * engine version. Note that upon upgrade the `enable_ha` parameter can only\n * be set to `true`.\n *\n * @param request - The request {@link UpgradeInstanceRequest}\n * @returns A Promise of Instance\n */\n upgradeInstance = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpgradeInstanceRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/document-db/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/upgrade`\n },\n marshalling_gen.unmarshalInstance\n );\n pageOfListInstances = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/document-db/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances`,\n urlParams: marshalling.urlParams(\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId],\n [\"tags\", request.tags]\n )\n },\n marshalling_gen.unmarshalListInstancesResponse\n );\n /**\n * List Database Instances. List all Database Instances in the specified\n * region, for a given Scaleway Organization or Scaleway Project. By default,\n * the Database Instances returned in the list are ordered by creation date in\n * ascending order, though this can be modified via the order_by field. You\n * can define additional parameters for your query, such as `tags` and `name`.\n * For the `name` parameter, the value you include will be checked against the\n * whole name string to see if it includes the string you put in the\n * parameter.\n *\n * @param request - The request {@link ListInstancesRequest}\n * @returns A Promise of ListInstancesResponse\n */\n listInstances = (request = {}) => resourcePaginator.enrichForPagination(\"instances\", this.pageOfListInstances, request);\n /**\n * Get a Database Instance. Retrieve information about a given Database\n * Instance, specified by the `region` and `instance_id` parameters. Its full\n * details, including name, status, IP address and port, are returned in the\n * response object.\n *\n * @param request - The request {@link GetInstanceRequest}\n * @returns A Promise of Instance\n */\n getInstance = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/document-db/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}`\n },\n marshalling_gen.unmarshalInstance\n );\n /**\n * Waits for {@link Instance} to be in a final state.\n *\n * @param request - The request {@link GetInstanceRequest}\n * @param options - The waiting options\n * @returns A Promise of Instance\n */\n waitForInstance = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(!content_gen.INSTANCE_TRANSIENT_STATUSES.includes(res.status))),\n this.getInstance,\n request,\n options\n );\n /**\n * Create a Database Instance. Create a new Database Instance. You must set\n * the `engine`, `user_name`, `password` and `node_type` parameters.\n * Optionally, you can specify the volume type and size.\n *\n * @param request - The request {@link CreateInstanceRequest}\n * @returns A Promise of Instance\n */\n createInstance = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateInstanceRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/document-db/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances`\n },\n marshalling_gen.unmarshalInstance\n );\n /**\n * Update a Database Instance. Update the parameters of a Database Instance,\n * including name, tags and backup schedule details.\n *\n * @param request - The request {@link UpdateInstanceRequest}\n * @returns A Promise of Instance\n */\n updateInstance = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateInstanceRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/document-db/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}`\n },\n marshalling_gen.unmarshalInstance\n );\n /**\n * Delete a Database Instance. Delete a given Database Instance, specified by\n * the `region` and `instance_id` parameters. Deleting a Database Instance is\n * permanent, and cannot be undone. Note that upon deletion all your data will\n * be lost.\n *\n * @param request - The request {@link DeleteInstanceRequest}\n * @returns A Promise of Instance\n */\n deleteInstance = (request) => this.client.fetch(\n {\n method: \"DELETE\",\n path: `/document-db/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}`\n },\n marshalling_gen.unmarshalInstance\n );\n /**\n * Clone a Database Instance. Clone a given Database Instance, specified by\n * the `region` and `instance_id` parameters. The clone feature allows you to\n * create a new Database Instance from an existing one. The clone includes all\n * existing databases, users and permissions. You can create a clone on a\n * Database Instance bigger than your current one.\n *\n * @param request - The request {@link CloneInstanceRequest}\n * @returns A Promise of Instance\n */\n cloneInstance = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCloneInstanceRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/document-db/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/clone`\n },\n marshalling_gen.unmarshalInstance\n );\n /**\n * Restart Database Instance. Restart a given Database Instance, specified by\n * the `region` and `instance_id` parameters. The status of the Database\n * Instance returned in the response.\n *\n * @param request - The request {@link RestartInstanceRequest}\n * @returns A Promise of Instance\n */\n restartInstance = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/document-db/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/restart`\n },\n marshalling_gen.unmarshalInstance\n );\n /**\n * Get the TLS certificate of a Database Instance. Retrieve information about\n * the TLS certificate of a given Database Instance. Details like name and\n * content are returned in the response.\n *\n * @param request - The request {@link GetInstanceCertificateRequest}\n * @returns A Promise of Blob\n */\n getInstanceCertificate = (request) => this.client.fetch({\n method: \"GET\",\n path: `/document-db/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/certificate`,\n urlParams: marshalling.urlParams([\"dl\", 1]),\n responseType: \"blob\"\n });\n /**\n * Renew the TLS certificate of a Database Instance. Renew a TLS for a\n * Database Instance. Renewing a certificate means that you will not be able\n * to connect to your Database Instance using the previous certificate. You\n * will also need to download and update the new certificate for all database\n * clients.\n *\n * @param request - The request {@link RenewInstanceCertificateRequest}\n */\n renewInstanceCertificate = (request) => this.client.fetch({\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/document-db/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/renew-certificate`\n });\n /**\n * Get Database Instance metrics. Retrieve the time series metrics of a given\n * Database Instance. You can define the period from which to retrieve metrics\n * by specifying the `start_date` and `end_date`.\n *\n * @param request - The request {@link GetInstanceMetricsRequest}\n * @returns A Promise of InstanceMetrics\n */\n getInstanceMetrics = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/document-db/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/metrics`,\n urlParams: marshalling.urlParams(\n [\"end_date\", request.endDate],\n [\"metric_name\", request.metricName],\n [\"start_date\", request.startDate]\n )\n },\n marshalling_gen.unmarshalInstanceMetrics\n );\n /**\n * Create a Read Replica. Create a new Read Replica of a Database Instance.\n * You must specify the `region` and the `instance_id`. You can only create a\n * maximum of 3 Read Replicas per Database Instance.\n *\n * @param request - The request {@link CreateReadReplicaRequest}\n * @returns A Promise of ReadReplica\n */\n createReadReplica = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateReadReplicaRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/document-db/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/read-replicas`\n },\n marshalling_gen.unmarshalReadReplica\n );\n /**\n * Get a Read Replica. Retrieve information about a Database Instance Read\n * Replica. Full details about the Read Replica, like `endpoints`, `status`\n * and `region` are returned in the response.\n *\n * @param request - The request {@link GetReadReplicaRequest}\n * @returns A Promise of ReadReplica\n */\n getReadReplica = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/document-db/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/read-replicas/${marshalling.validatePathParam(\"readReplicaId\", request.readReplicaId)}`\n },\n marshalling_gen.unmarshalReadReplica\n );\n /**\n * Waits for {@link ReadReplica} to be in a final state.\n *\n * @param request - The request {@link GetReadReplicaRequest}\n * @param options - The waiting options\n * @returns A Promise of ReadReplica\n */\n waitForReadReplica = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(\n !content_gen.READ_REPLICA_TRANSIENT_STATUSES.includes(res.status)\n )),\n this.getReadReplica,\n request,\n options\n );\n /**\n * Delete a Read Replica. Delete a Read Replica of a Database Instance. You\n * must specify the `region` and `read_replica_id` parameters of the Read\n * Replica you want to delete.\n *\n * @param request - The request {@link DeleteReadReplicaRequest}\n * @returns A Promise of ReadReplica\n */\n deleteReadReplica = (request) => this.client.fetch(\n {\n method: \"DELETE\",\n path: `/document-db/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/read-replicas/${marshalling.validatePathParam(\"readReplicaId\", request.readReplicaId)}`\n },\n marshalling_gen.unmarshalReadReplica\n );\n /**\n * Resync a Read Replica. When you resync a Read Replica, first it is reset,\n * then its data is resynchronized from the primary node. Your Read Replica\n * remains unavailable during the resync process. The duration of this process\n * is proportional to the size of your Database Instance. The configured\n * endpoints do not change.\n *\n * @param request - The request {@link ResetReadReplicaRequest}\n * @returns A Promise of ReadReplica\n */\n resetReadReplica = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/document-db/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/read-replicas/${marshalling.validatePathParam(\"readReplicaId\", request.readReplicaId)}/reset`\n },\n marshalling_gen.unmarshalReadReplica\n );\n /**\n * Promote a Read Replica. Promote a Read Replica to Database Instance\n * automatically.\n *\n * @param request - The request {@link PromoteReadReplicaRequest}\n * @returns A Promise of Instance\n */\n promoteReadReplica = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/document-db/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/read-replicas/${marshalling.validatePathParam(\"readReplicaId\", request.readReplicaId)}/promote`\n },\n marshalling_gen.unmarshalInstance\n );\n /**\n * Create an endpoint for a Read Replica. Create a new endpoint for a Read\n * Replica. Read Replicas can have at most one direct access and one Private\n * Network endpoint.\n *\n * @param request - The request {@link CreateReadReplicaEndpointRequest}\n * @returns A Promise of ReadReplica\n */\n createReadReplicaEndpoint = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateReadReplicaEndpointRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/document-db/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/read-replicas/${marshalling.validatePathParam(\"readReplicaId\", request.readReplicaId)}/endpoints`\n },\n marshalling_gen.unmarshalReadReplica\n );\n /**\n * List available logs of a Database Instance. List the available logs of a\n * Database Instance. By default, the logs returned in the list are ordered by\n * creation date in ascending order, though this can be modified via the\n * order_by field.\n *\n * @param request - The request {@link ListInstanceLogsRequest}\n * @returns A Promise of ListInstanceLogsResponse\n */\n listInstanceLogs = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/document-db/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/logs`,\n urlParams: marshalling.urlParams([\"order_by\", request.orderBy])\n },\n marshalling_gen.unmarshalListInstanceLogsResponse\n );\n /**\n * Get given logs of a Database Instance. Retrieve information about the logs\n * of a Database Instance. Specify the `instance_log_id` and `region` in your\n * request to get information such as `download_url`, `status`, `expires_at`\n * and `created_at` about your logs in the response.\n *\n * @param request - The request {@link GetInstanceLogRequest}\n * @returns A Promise of InstanceLog\n */\n getInstanceLog = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/document-db/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/logs/${marshalling.validatePathParam(\"instanceLogId\", request.instanceLogId)}`\n },\n marshalling_gen.unmarshalInstanceLog\n );\n /**\n * Waits for {@link InstanceLog} to be in a final state.\n *\n * @param request - The request {@link GetInstanceLogRequest}\n * @param options - The waiting options\n * @returns A Promise of InstanceLog\n */\n waitForInstanceLog = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(\n !content_gen.INSTANCE_LOG_TRANSIENT_STATUSES.includes(res.status)\n )),\n this.getInstanceLog,\n request,\n options\n );\n /**\n * Purge remote Database Instance logs. Purge a given remote log from a\n * Database Instance. You can specify the `log_name` of the log you wish to\n * clean from your Database Instance.\n *\n * @param request - The request {@link PurgeInstanceLogsRequest}\n */\n purgeInstanceLogs = (request) => this.client.fetch({\n body: JSON.stringify(\n marshalling_gen.marshalPurgeInstanceLogsRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/document-db/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/purge-logs`\n });\n /**\n * List remote Database Instance logs details. List remote log details. By\n * default, the details returned in the list are ordered by creation date in\n * ascending order, though this can be modified via the order_by field.\n *\n * @param request - The request {@link ListInstanceLogsDetailsRequest}\n * @returns A Promise of ListInstanceLogsDetailsResponse\n */\n listInstanceLogsDetails = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/document-db/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/logs-details`\n },\n marshalling_gen.unmarshalListInstanceLogsDetailsResponse\n );\n /**\n * Add Database Instance advanced settings. Add an advanced setting to a\n * Database Instance. You must set the `name` and the `value` of each\n * setting.\n *\n * @param request - The request {@link AddInstanceSettingsRequest}\n * @returns A Promise of AddInstanceSettingsResponse\n */\n addInstanceSettings = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalAddInstanceSettingsRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/document-db/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/settings`\n },\n marshalling_gen.unmarshalAddInstanceSettingsResponse\n );\n /**\n * Delete Database Instance advanced settings. Delete an advanced setting in a\n * Database Instance. You must specify the names of the settings you want to\n * delete in the request.\n *\n * @param request - The request {@link DeleteInstanceSettingsRequest}\n * @returns A Promise of DeleteInstanceSettingsResponse\n */\n deleteInstanceSettings = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalDeleteInstanceSettingsRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"DELETE\",\n path: `/document-db/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/settings`\n },\n marshalling_gen.unmarshalDeleteInstanceSettingsResponse\n );\n /**\n * Set Database Instance advanced settings. Update an advanced setting for a\n * Database Instance. Settings added upon database engine initalization can\n * only be defined once, and cannot, therefore, be updated.\n *\n * @param request - The request {@link SetInstanceSettingsRequest}\n * @returns A Promise of SetInstanceSettingsResponse\n */\n setInstanceSettings = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalSetInstanceSettingsRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PUT\",\n path: `/document-db/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/settings`\n },\n marshalling_gen.unmarshalSetInstanceSettingsResponse\n );\n pageOfListInstanceACLRules = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/document-db/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/acls`,\n urlParams: marshalling.urlParams(\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListInstanceACLRulesResponse\n );\n /**\n * List ACL rules of a Database Instance. List the ACL rules for a given\n * Database Instance. The response is an array of ACL objects, each one\n * representing an ACL that denies, allows or redirects traffic based on\n * certain conditions.\n *\n * @param request - The request {@link ListInstanceACLRulesRequest}\n * @returns A Promise of ListInstanceACLRulesResponse\n */\n listInstanceACLRules = (request) => resourcePaginator.enrichForPagination(\"rules\", this.pageOfListInstanceACLRules, request);\n /**\n * Add an ACL rule to a Database Instance. Add an additional ACL rule to a\n * Database Instance.\n *\n * @param request - The request {@link AddInstanceACLRulesRequest}\n * @returns A Promise of AddInstanceACLRulesResponse\n */\n addInstanceACLRules = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalAddInstanceACLRulesRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/document-db/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/acls`\n },\n marshalling_gen.unmarshalAddInstanceACLRulesResponse\n );\n /**\n * Set ACL rules for a Database Instance. Replace all the ACL rules of a\n * Database Instance.\n *\n * @param request - The request {@link SetInstanceACLRulesRequest}\n * @returns A Promise of SetInstanceACLRulesResponse\n */\n setInstanceACLRules = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalSetInstanceACLRulesRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PUT\",\n path: `/document-db/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/acls`\n },\n marshalling_gen.unmarshalSetInstanceACLRulesResponse\n );\n /**\n * Delete ACL rules of a Database Instance. Delete one or more ACL rules of a\n * Database Instance.\n *\n * @param request - The request {@link DeleteInstanceACLRulesRequest}\n * @returns A Promise of DeleteInstanceACLRulesResponse\n */\n deleteInstanceACLRules = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalDeleteInstanceACLRulesRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"DELETE\",\n path: `/document-db/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/acls`\n },\n marshalling_gen.unmarshalDeleteInstanceACLRulesResponse\n );\n pageOfListUsers = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/document-db/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/users`,\n urlParams: marshalling.urlParams(\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListUsersResponse\n );\n /**\n * List users of a Database Instance. List all users of a given Database\n * Instance. By default, the users returned in the list are ordered by\n * creation date in ascending order, though this can be modified via the\n * order_by field.\n *\n * @param request - The request {@link ListUsersRequest}\n * @returns A Promise of ListUsersResponse\n */\n listUsers = (request) => resourcePaginator.enrichForPagination(\"users\", this.pageOfListUsers, request);\n /**\n * Create a user for a Database Instance. Create a new user for a Database\n * Instance. You must define the `name`, `password` and `is_admin`\n * parameters.\n *\n * @param request - The request {@link CreateUserRequest}\n * @returns A Promise of User\n */\n createUser = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateUserRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/document-db/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/users`\n },\n marshalling_gen.unmarshalUser\n );\n /**\n * Update a user on a Database Instance. Update the parameters of a user on a\n * Database Instance. You can update the `password` and `is_admin` parameters,\n * but you cannot change the name of the user.\n *\n * @param request - The request {@link UpdateUserRequest}\n * @returns A Promise of User\n */\n updateUser = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateUserRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/document-db/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/users/${marshalling.validatePathParam(\"name\", request.name)}`\n },\n marshalling_gen.unmarshalUser\n );\n /**\n * Delete a user on a Database Instance. Delete a given user on a Database\n * Instance. You must specify, in the endpoint, the `region`, `instance_id`\n * and `name` parameters of the user you want to delete.\n *\n * @param request - The request {@link DeleteUserRequest}\n */\n deleteUser = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/document-db/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/users/${marshalling.validatePathParam(\"name\", request.name)}`\n });\n pageOfListDatabases = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/document-db/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/databases`,\n urlParams: marshalling.urlParams(\n [\"managed\", request.managed],\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\"owner\", request.owner],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListDatabasesResponse\n );\n /**\n * List databases in a Database Instance. List all databases of a given\n * Database Instance. By default, the databases returned in the list are\n * ordered by creation date in ascending order, though this can be modified\n * via the order_by field. You can define additional parameters for your\n * query, such as `name`, `managed` and `owner`.\n *\n * @param request - The request {@link ListDatabasesRequest}\n * @returns A Promise of ListDatabasesResponse\n */\n listDatabases = (request) => resourcePaginator.enrichForPagination(\"databases\", this.pageOfListDatabases, request);\n /**\n * Create a database in a Database Instance. Create a new database. You must\n * define the `name` parameter in the request.\n *\n * @param request - The request {@link CreateDatabaseRequest}\n * @returns A Promise of Database\n */\n createDatabase = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateDatabaseRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/document-db/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/databases`\n },\n marshalling_gen.unmarshalDatabase\n );\n /**\n * Delete a database in a Database Instance. Delete a given database on a\n * Database Instance. You must specify, in the endpoint, the `region`,\n * `instance_id` and `name` parameters of the database you want to delete.\n *\n * @param request - The request {@link DeleteDatabaseRequest}\n */\n deleteDatabase = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/document-db/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/databases/${marshalling.validatePathParam(\"name\", request.name)}`\n });\n pageOfListPrivileges = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/document-db/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/privileges`,\n urlParams: marshalling.urlParams(\n [\"database_name\", request.databaseName],\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"user_name\", request.userName]\n )\n },\n marshalling_gen.unmarshalListPrivilegesResponse\n );\n /**\n * List user privileges for a database. List privileges of a user on a\n * database. By default, the details returned in the list are ordered by\n * creation date in ascending order, though this can be modified via the\n * order_by field. You can define additional parameters for your query, such\n * as `database_name` and `user_name`.\n *\n * @param request - The request {@link ListPrivilegesRequest}\n * @returns A Promise of ListPrivilegesResponse\n */\n listPrivileges = (request) => resourcePaginator.enrichForPagination(\"privileges\", this.pageOfListPrivileges, request);\n /**\n * Set user privileges for a database. Set the privileges of a user on a\n * database. You must define `database_name`, `user_name` and `permission` in\n * the request body.\n *\n * @param request - The request {@link SetPrivilegeRequest}\n * @returns A Promise of Privilege\n */\n setPrivilege = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalSetPrivilegeRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PUT\",\n path: `/document-db/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/privileges`\n },\n marshalling_gen.unmarshalPrivilege\n );\n pageOfListSnapshots = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/document-db/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/snapshots`,\n urlParams: marshalling.urlParams(\n [\"instance_id\", request.instanceId],\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId]\n )\n },\n marshalling_gen.unmarshalListSnapshotsResponse\n );\n /**\n * List snapshots. List snapshots. You can include the `instance_id` or\n * `project_id` in your query to get the list of snapshots for specific\n * Database Instances and/or Projects. By default, the details returned in the\n * list are ordered by creation date in ascending order, though this can be\n * modified via the `order_by` field.\n *\n * @param request - The request {@link ListSnapshotsRequest}\n * @returns A Promise of ListSnapshotsResponse\n */\n listSnapshots = (request = {}) => resourcePaginator.enrichForPagination(\"snapshots\", this.pageOfListSnapshots, request);\n /**\n * Get a Database Instance snapshot. Retrieve information about a given\n * snapshot, specified by its `snapshot_id` and `region`. Full details about\n * the snapshot, like size and expiration date, are returned in the response.\n *\n * @param request - The request {@link GetSnapshotRequest}\n * @returns A Promise of Snapshot\n */\n getSnapshot = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/document-db/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/snapshots/${marshalling.validatePathParam(\"snapshotId\", request.snapshotId)}`\n },\n marshalling_gen.unmarshalSnapshot\n );\n /**\n * Waits for {@link Snapshot} to be in a final state.\n *\n * @param request - The request {@link GetSnapshotRequest}\n * @param options - The waiting options\n * @returns A Promise of Snapshot\n */\n waitForSnapshot = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(!content_gen.SNAPSHOT_TRANSIENT_STATUSES.includes(res.status))),\n this.getSnapshot,\n request,\n options\n );\n /**\n * Create a Database Instance snapshot. Create a new snapshot of a Database\n * Instance. You must define the `name` parameter in the request.\n *\n * @param request - The request {@link CreateSnapshotRequest}\n * @returns A Promise of Snapshot\n */\n createSnapshot = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateSnapshotRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/document-db/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/snapshots`\n },\n marshalling_gen.unmarshalSnapshot\n );\n /**\n * Update a Database Instance snapshot. Update the parameters of a snapshot of\n * a Database Instance. You can update the `name` and `expires_at`\n * parameters.\n *\n * @param request - The request {@link UpdateSnapshotRequest}\n * @returns A Promise of Snapshot\n */\n updateSnapshot = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateSnapshotRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/document-db/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/snapshots/${marshalling.validatePathParam(\"snapshotId\", request.snapshotId)}`\n },\n marshalling_gen.unmarshalSnapshot\n );\n /**\n * Delete a Database Instance snapshot. Delete a given snapshot of a Database\n * Instance. You must specify, in the endpoint, the `region` and `snapshot_id`\n * parameters of the snapshot you want to delete.\n *\n * @param request - The request {@link DeleteSnapshotRequest}\n * @returns A Promise of Snapshot\n */\n deleteSnapshot = (request) => this.client.fetch(\n {\n method: \"DELETE\",\n path: `/document-db/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/snapshots/${marshalling.validatePathParam(\"snapshotId\", request.snapshotId)}`\n },\n marshalling_gen.unmarshalSnapshot\n );\n /**\n * Create a new Database Instance from a snapshot. Restore a snapshot. When\n * you restore a snapshot, a new Instance is created and billed to your\n * account. Note that is possible to select a larger node type for your new\n * Database Instance. However, the Block volume size will be the same as the\n * size of the restored snapshot. All Instance settings will be restored if\n * you chose a node type with the same or more memory size than the initial\n * Instance. Settings will be reset to the default if your node type has less\n * memory.\n *\n * @param request - The request {@link CreateInstanceFromSnapshotRequest}\n * @returns A Promise of Instance\n */\n createInstanceFromSnapshot = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateInstanceFromSnapshotRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/document-db/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/snapshots/${marshalling.validatePathParam(\"snapshotId\", request.snapshotId)}/create-instance`\n },\n marshalling_gen.unmarshalInstance\n );\n /**\n * Create a new Database Instance endpoint. Create a new endpoint for a\n * Database Instance. You can add `load_balancer` and `private_network`\n * specifications to the body of the request.\n *\n * @param request - The request {@link CreateEndpointRequest}\n * @returns A Promise of Endpoint\n */\n createEndpoint = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateEndpointRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/document-db/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/endpoints`\n },\n marshalling_gen.unmarshalEndpoint\n );\n /**\n * Delete a Database Instance endpoint. Delete the endpoint of a Database\n * Instance. You must specify the `region` and `endpoint_id` parameters of the\n * endpoint you want to delete. Note that might need to update any environment\n * configurations that point to the deleted endpoint.\n *\n * @param request - The request {@link DeleteEndpointRequest}\n */\n deleteEndpoint = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/document-db/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/endpoints/${marshalling.validatePathParam(\"endpointId\", request.endpointId)}`\n });\n /**\n * Get a Database Instance endpoint. Retrieve information about a Database\n * Instance endpoint. Full details about the endpoint, like `ip`, `port`,\n * `private_network` and `load_balancer` specifications are returned in the\n * response.\n *\n * @param request - The request {@link GetEndpointRequest}\n * @returns A Promise of Endpoint\n */\n getEndpoint = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/document-db/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/endpoints/${marshalling.validatePathParam(\"endpointId\", request.endpointId)}`\n },\n marshalling_gen.unmarshalEndpoint\n );\n /**\n * Migrate Database Instance endpoint. Migrate an existing Database Instance\n * endpoint to another Database Instance.\n *\n * @param request - The request {@link MigrateEndpointRequest}\n * @returns A Promise of Endpoint\n */\n migrateEndpoint = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalMigrateEndpointRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/document-db/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/endpoints/${marshalling.validatePathParam(\"endpointId\", request.endpointId)}/migrate`\n },\n marshalling_gen.unmarshalEndpoint\n );\n /**\n * Apply an instance maintenance. Apply a pending instance maintenance on your\n * instance. This action can generate some service interruption.\n *\n * @param request - The request {@link ApplyInstanceMaintenanceRequest}\n * @returns A Promise of Maintenance\n */\n applyInstanceMaintenance = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/document-db/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/apply-maintenance`\n },\n marshalling_gen.unmarshalMaintenance\n );\n}\nexports.API = API;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst INSTANCE_LOG_TRANSIENT_STATUSES = [\"creating\"];\nconst INSTANCE_TRANSIENT_STATUSES = [\n \"provisioning\",\n \"configuring\",\n \"deleting\",\n \"autohealing\",\n \"initializing\",\n \"backuping\",\n \"snapshotting\",\n \"restarting\"\n];\nconst MAINTENANCE_TRANSIENT_STATUSES = [\"ongoing\"];\nconst READ_REPLICA_TRANSIENT_STATUSES = [\n \"provisioning\",\n \"initializing\",\n \"deleting\",\n \"configuring\",\n \"promoting\"\n];\nconst SNAPSHOT_TRANSIENT_STATUSES = [\n \"creating\",\n \"restoring\",\n \"deleting\"\n];\nexports.INSTANCE_LOG_TRANSIENT_STATUSES = INSTANCE_LOG_TRANSIENT_STATUSES;\nexports.INSTANCE_TRANSIENT_STATUSES = INSTANCE_TRANSIENT_STATUSES;\nexports.MAINTENANCE_TRANSIENT_STATUSES = MAINTENANCE_TRANSIENT_STATUSES;\nexports.READ_REPLICA_TRANSIENT_STATUSES = READ_REPLICA_TRANSIENT_STATUSES;\nexports.SNAPSHOT_TRANSIENT_STATUSES = SNAPSHOT_TRANSIENT_STATUSES;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api_gen = require(\"./api.gen.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nconst validationRules_gen = require(\"./validation-rules.gen.cjs\");\nexports.API = api_gen.API;\nexports.INSTANCE_LOG_TRANSIENT_STATUSES = content_gen.INSTANCE_LOG_TRANSIENT_STATUSES;\nexports.INSTANCE_TRANSIENT_STATUSES = content_gen.INSTANCE_TRANSIENT_STATUSES;\nexports.MAINTENANCE_TRANSIENT_STATUSES = content_gen.MAINTENANCE_TRANSIENT_STATUSES;\nexports.READ_REPLICA_TRANSIENT_STATUSES = content_gen.READ_REPLICA_TRANSIENT_STATUSES;\nexports.SNAPSHOT_TRANSIENT_STATUSES = content_gen.SNAPSHOT_TRANSIENT_STATUSES;\nexports.ValidationRules = validationRules_gen;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst randomName = require(\"@scaleway/random-name\");\nconst json = require(\"../../../helpers/json.cjs\");\nconst customMarshalling = require(\"../../../scw/custom-marshalling.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nconst unmarshalEndpointDirectAccessDetails = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'EndpointDirectAccessDetails' failed as data isn't a dictionary.`\n );\n }\n return {};\n};\nconst unmarshalEndpointLoadBalancerDetails = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'EndpointLoadBalancerDetails' failed as data isn't a dictionary.`\n );\n }\n return {};\n};\nconst unmarshalEndpointPrivateNetworkDetails = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'EndpointPrivateNetworkDetails' failed as data isn't a dictionary.`\n );\n }\n return {\n privateNetworkId: data.private_network_id,\n serviceIp: data.service_ip,\n zone: data.zone\n };\n};\nconst unmarshalEndpoint = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Endpoint' failed as data isn't a dictionary.`\n );\n }\n return {\n directAccess: data.direct_access ? unmarshalEndpointDirectAccessDetails(data.direct_access) : void 0,\n hostname: data.hostname,\n id: data.id,\n ip: data.ip,\n loadBalancer: data.load_balancer ? unmarshalEndpointLoadBalancerDetails(data.load_balancer) : void 0,\n name: data.name,\n port: data.port,\n privateNetwork: data.private_network ? unmarshalEndpointPrivateNetworkDetails(data.private_network) : void 0\n };\n};\nconst unmarshalMaintenance = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Maintenance' failed as data isn't a dictionary.`\n );\n }\n return {\n closedAt: marshalling.unmarshalDate(data.closed_at),\n forcedAt: marshalling.unmarshalDate(data.forced_at),\n reason: data.reason,\n startsAt: marshalling.unmarshalDate(data.starts_at),\n status: data.status,\n stopsAt: marshalling.unmarshalDate(data.stops_at)\n };\n};\nconst unmarshalReadReplica = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ReadReplica' failed as data isn't a dictionary.`\n );\n }\n return {\n endpoints: marshalling.unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint),\n id: data.id,\n region: data.region,\n sameZone: data.same_zone,\n status: data.status\n };\n};\nconst unmarshalDatabase = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Database' failed as data isn't a dictionary.`\n );\n }\n return {\n managed: data.managed,\n name: data.name,\n owner: data.owner,\n size: data.size\n };\n};\nconst unmarshalInstanceLog = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'InstanceLog' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n downloadUrl: data.download_url,\n expiresAt: marshalling.unmarshalDate(data.expires_at),\n id: data.id,\n nodeName: data.node_name,\n region: data.region,\n status: data.status\n };\n};\nconst unmarshalBackupSchedule = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'BackupSchedule' failed as data isn't a dictionary.`\n );\n }\n return {\n disabled: data.disabled,\n frequency: data.frequency,\n nextRunAt: marshalling.unmarshalDate(data.next_run_at),\n retention: data.retention\n };\n};\nconst unmarshalInstanceSetting = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'InstanceSetting' failed as data isn't a dictionary.`\n );\n }\n return {\n name: data.name,\n value: data.value\n };\n};\nconst unmarshalLogsPolicy = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'LogsPolicy' failed as data isn't a dictionary.`\n );\n }\n return {\n maxAgeRetention: data.max_age_retention,\n totalDiskRetention: data.total_disk_retention\n };\n};\nconst unmarshalUpgradableVersion = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'UpgradableVersion' failed as data isn't a dictionary.`\n );\n }\n return {\n id: data.id,\n minorVersion: data.minor_version,\n name: data.name,\n version: data.version\n };\n};\nconst unmarshalVolume = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Volume' failed as data isn't a dictionary.`\n );\n }\n return {\n class: data.class,\n size: data.size,\n type: data.type\n };\n};\nconst unmarshalInstance = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Instance' failed as data isn't a dictionary.`\n );\n }\n return {\n backupSameRegion: data.backup_same_region,\n backupSchedule: data.backup_schedule ? unmarshalBackupSchedule(data.backup_schedule) : void 0,\n createdAt: marshalling.unmarshalDate(data.created_at),\n endpoint: data.endpoint ? unmarshalEndpoint(data.endpoint) : void 0,\n endpoints: marshalling.unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint),\n engine: data.engine,\n id: data.id,\n initSettings: marshalling.unmarshalArrayOfObject(\n data.init_settings,\n unmarshalInstanceSetting\n ),\n isHaCluster: data.is_ha_cluster,\n logsPolicy: data.logs_policy ? unmarshalLogsPolicy(data.logs_policy) : void 0,\n maintenances: marshalling.unmarshalArrayOfObject(\n data.maintenances,\n unmarshalMaintenance\n ),\n name: data.name,\n nodeType: data.node_type,\n organizationId: data.organization_id,\n projectId: data.project_id,\n readReplicas: marshalling.unmarshalArrayOfObject(\n data.read_replicas,\n unmarshalReadReplica\n ),\n region: data.region,\n settings: marshalling.unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting),\n status: data.status,\n tags: data.tags,\n upgradableVersion: marshalling.unmarshalArrayOfObject(\n data.upgradable_version,\n unmarshalUpgradableVersion\n ),\n volume: data.volume ? unmarshalVolume(data.volume) : void 0\n };\n};\nconst unmarshalPrivilege = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Privilege' failed as data isn't a dictionary.`\n );\n }\n return {\n databaseName: data.database_name,\n permission: data.permission,\n userName: data.user_name\n };\n};\nconst unmarshalSnapshotVolumeType = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SnapshotVolumeType' failed as data isn't a dictionary.`\n );\n }\n return {\n class: data.class,\n type: data.type\n };\n};\nconst unmarshalSnapshot = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Snapshot' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n expiresAt: marshalling.unmarshalDate(data.expires_at),\n id: data.id,\n instanceId: data.instance_id,\n instanceName: data.instance_name,\n name: data.name,\n nodeType: data.node_type,\n region: data.region,\n size: data.size,\n status: data.status,\n updatedAt: marshalling.unmarshalDate(data.updated_at),\n volumeType: data.volume_type ? unmarshalSnapshotVolumeType(data.volume_type) : void 0\n };\n};\nconst unmarshalUser = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'User' failed as data isn't a dictionary.`\n );\n }\n return {\n isAdmin: data.is_admin,\n name: data.name\n };\n};\nconst unmarshalACLRule = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ACLRule' failed as data isn't a dictionary.`\n );\n }\n return {\n action: data.action,\n description: data.description,\n direction: data.direction,\n ip: data.ip,\n port: data.port,\n protocol: data.protocol\n };\n};\nconst unmarshalAddInstanceACLRulesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'AddInstanceACLRulesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n rules: marshalling.unmarshalArrayOfObject(data.rules, unmarshalACLRule)\n };\n};\nconst unmarshalAddInstanceSettingsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'AddInstanceSettingsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n settings: marshalling.unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting)\n };\n};\nconst unmarshalDeleteInstanceACLRulesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DeleteInstanceACLRulesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n rules: marshalling.unmarshalArrayOfObject(data.rules, unmarshalACLRule)\n };\n};\nconst unmarshalDeleteInstanceSettingsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DeleteInstanceSettingsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n settings: marshalling.unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting)\n };\n};\nconst unmarshalInstanceMetrics = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'InstanceMetrics' failed as data isn't a dictionary.`\n );\n }\n return {\n timeseries: marshalling.unmarshalArrayOfObject(data.timeseries, customMarshalling.unmarshalTimeSeries)\n };\n};\nconst unmarshalEngineSetting = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'EngineSetting' failed as data isn't a dictionary.`\n );\n }\n return {\n defaultValue: data.default_value,\n description: data.description,\n floatMax: data.float_max,\n floatMin: data.float_min,\n hotConfigurable: data.hot_configurable,\n intMax: data.int_max,\n intMin: data.int_min,\n name: data.name,\n propertyType: data.property_type,\n stringConstraint: data.string_constraint,\n unit: data.unit\n };\n};\nconst unmarshalEngineVersion = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'EngineVersion' failed as data isn't a dictionary.`\n );\n }\n return {\n availableInitSettings: marshalling.unmarshalArrayOfObject(\n data.available_init_settings,\n unmarshalEngineSetting\n ),\n availableSettings: marshalling.unmarshalArrayOfObject(\n data.available_settings,\n unmarshalEngineSetting\n ),\n beta: data.beta,\n disabled: data.disabled,\n endOfLife: marshalling.unmarshalDate(data.end_of_life),\n name: data.name,\n version: data.version\n };\n};\nconst unmarshalDatabaseEngine = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DatabaseEngine' failed as data isn't a dictionary.`\n );\n }\n return {\n logoUrl: data.logo_url,\n name: data.name,\n region: data.region,\n versions: marshalling.unmarshalArrayOfObject(data.versions, unmarshalEngineVersion)\n };\n};\nconst unmarshalListDatabaseEnginesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListDatabaseEnginesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n engines: marshalling.unmarshalArrayOfObject(data.engines, unmarshalDatabaseEngine),\n totalCount: data.total_count\n };\n};\nconst unmarshalListDatabasesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListDatabasesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n databases: marshalling.unmarshalArrayOfObject(data.databases, unmarshalDatabase),\n totalCount: data.total_count\n };\n};\nconst unmarshalListInstanceACLRulesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListInstanceACLRulesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n rules: marshalling.unmarshalArrayOfObject(data.rules, unmarshalACLRule),\n totalCount: data.total_count\n };\n};\nconst unmarshalListInstanceLogsDetailsResponseInstanceLogDetail = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListInstanceLogsDetailsResponseInstanceLogDetail' failed as data isn't a dictionary.`\n );\n }\n return {\n logName: data.log_name,\n size: data.size\n };\n};\nconst unmarshalListInstanceLogsDetailsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListInstanceLogsDetailsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n details: marshalling.unmarshalArrayOfObject(\n data.details,\n unmarshalListInstanceLogsDetailsResponseInstanceLogDetail\n )\n };\n};\nconst unmarshalListInstanceLogsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListInstanceLogsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n instanceLogs: marshalling.unmarshalArrayOfObject(\n data.instance_logs,\n unmarshalInstanceLog\n )\n };\n};\nconst unmarshalListInstancesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListInstancesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n instances: marshalling.unmarshalArrayOfObject(data.instances, unmarshalInstance),\n totalCount: data.total_count\n };\n};\nconst unmarshalNodeTypeVolumeConstraintSizes = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'NodeTypeVolumeConstraintSizes' failed as data isn't a dictionary.`\n );\n }\n return {\n maxSize: data.max_size,\n minSize: data.min_size\n };\n};\nconst unmarshalNodeTypeVolumeType = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'NodeTypeVolumeType' failed as data isn't a dictionary.`\n );\n }\n return {\n chunkSize: data.chunk_size,\n class: data.class,\n description: data.description,\n maxSize: data.max_size,\n minSize: data.min_size,\n type: data.type\n };\n};\nconst unmarshalNodeType = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'NodeType' failed as data isn't a dictionary.`\n );\n }\n return {\n availableVolumeTypes: marshalling.unmarshalArrayOfObject(\n data.available_volume_types,\n unmarshalNodeTypeVolumeType\n ),\n beta: data.beta,\n description: data.description,\n disabled: data.disabled,\n generation: data.generation,\n instanceRange: data.instance_range,\n isBssdCompatible: data.is_bssd_compatible,\n isHaRequired: data.is_ha_required,\n memory: data.memory,\n name: data.name,\n region: data.region,\n stockStatus: data.stock_status,\n vcpus: data.vcpus,\n volumeConstraint: data.volume_constraint ? unmarshalNodeTypeVolumeConstraintSizes(data.volume_constraint) : void 0\n };\n};\nconst unmarshalListNodeTypesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListNodeTypesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n nodeTypes: marshalling.unmarshalArrayOfObject(data.node_types, unmarshalNodeType),\n totalCount: data.total_count\n };\n};\nconst unmarshalListPrivilegesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListPrivilegesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n privileges: marshalling.unmarshalArrayOfObject(data.privileges, unmarshalPrivilege),\n totalCount: data.total_count\n };\n};\nconst unmarshalListSnapshotsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListSnapshotsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n snapshots: marshalling.unmarshalArrayOfObject(data.snapshots, unmarshalSnapshot),\n totalCount: data.total_count\n };\n};\nconst unmarshalListUsersResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListUsersResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n totalCount: data.total_count,\n users: marshalling.unmarshalArrayOfObject(data.users, unmarshalUser)\n };\n};\nconst unmarshalSetInstanceACLRulesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SetInstanceACLRulesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n rules: marshalling.unmarshalArrayOfObject(data.rules, unmarshalACLRule)\n };\n};\nconst unmarshalSetInstanceSettingsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SetInstanceSettingsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n settings: marshalling.unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting)\n };\n};\nconst marshalACLRuleRequest = (request, defaults) => ({\n description: request.description,\n ip: request.ip\n});\nconst marshalAddInstanceACLRulesRequest = (request, defaults) => ({\n rules: request.rules.map((elt) => marshalACLRuleRequest(elt))\n});\nconst marshalInstanceSetting = (request, defaults) => ({\n name: request.name,\n value: request.value\n});\nconst marshalAddInstanceSettingsRequest = (request, defaults) => ({\n settings: request.settings.map((elt) => marshalInstanceSetting(elt))\n});\nconst marshalCloneInstanceRequest = (request, defaults) => ({\n name: request.name,\n node_type: request.nodeType\n});\nconst marshalCreateDatabaseRequest = (request, defaults) => ({\n name: request.name\n});\nconst marshalEndpointSpecPrivateNetworkIpamConfig = (request, defaults) => ({});\nconst marshalEndpointSpecLoadBalancer = (request, defaults) => ({});\nconst marshalEndpointSpecPrivateNetwork = (request, defaults) => ({\n private_network_id: request.privateNetworkId,\n ...marshalling.resolveOneOf([\n { param: \"service_ip\", value: request.serviceIp },\n {\n param: \"ipam_config\",\n value: request.ipamConfig !== void 0 ? marshalEndpointSpecPrivateNetworkIpamConfig(\n request.ipamConfig\n ) : void 0\n }\n ])\n});\nconst marshalEndpointSpec = (request, defaults) => ({\n ...marshalling.resolveOneOf([\n {\n param: \"load_balancer\",\n value: request.loadBalancer !== void 0 ? marshalEndpointSpecLoadBalancer(request.loadBalancer) : void 0\n },\n {\n param: \"private_network\",\n value: request.privateNetwork !== void 0 ? marshalEndpointSpecPrivateNetwork(request.privateNetwork) : void 0\n }\n ])\n});\nconst marshalCreateEndpointRequest = (request, defaults) => ({\n endpoint_spec: request.endpointSpec !== void 0 ? marshalEndpointSpec(request.endpointSpec) : void 0\n});\nconst marshalCreateInstanceFromSnapshotRequest = (request, defaults) => ({\n instance_name: request.instanceName,\n is_ha_cluster: request.isHaCluster,\n node_type: request.nodeType\n});\nconst marshalCreateInstanceRequest = (request, defaults) => ({\n backup_same_region: request.backupSameRegion,\n disable_backup: request.disableBackup,\n engine: request.engine,\n init_endpoints: request.initEndpoints !== void 0 ? request.initEndpoints.map((elt) => marshalEndpointSpec(elt)) : void 0,\n init_settings: request.initSettings !== void 0 ? request.initSettings.map((elt) => marshalInstanceSetting(elt)) : void 0,\n is_ha_cluster: request.isHaCluster,\n name: request.name || randomName(\"ins\"),\n node_type: request.nodeType,\n password: request.password,\n tags: request.tags,\n user_name: request.userName,\n volume_size: request.volumeSize,\n volume_type: request.volumeType,\n ...marshalling.resolveOneOf([\n {\n default: defaults.defaultOrganizationId,\n param: \"organization_id\",\n value: request.organizationId\n },\n {\n default: defaults.defaultProjectId,\n param: \"project_id\",\n value: request.projectId\n }\n ])\n});\nconst marshalReadReplicaEndpointSpecPrivateNetworkIpamConfig = (request, defaults) => ({});\nconst marshalReadReplicaEndpointSpecDirectAccess = (request, defaults) => ({});\nconst marshalReadReplicaEndpointSpecPrivateNetwork = (request, defaults) => ({\n private_network_id: request.privateNetworkId,\n ...marshalling.resolveOneOf([\n { param: \"service_ip\", value: request.serviceIp },\n {\n param: \"ipam_config\",\n value: request.ipamConfig !== void 0 ? marshalReadReplicaEndpointSpecPrivateNetworkIpamConfig(\n request.ipamConfig\n ) : void 0\n }\n ])\n});\nconst marshalReadReplicaEndpointSpec = (request, defaults) => ({\n ...marshalling.resolveOneOf([\n {\n param: \"direct_access\",\n value: request.directAccess !== void 0 ? marshalReadReplicaEndpointSpecDirectAccess(\n request.directAccess\n ) : void 0\n },\n {\n param: \"private_network\",\n value: request.privateNetwork !== void 0 ? marshalReadReplicaEndpointSpecPrivateNetwork(\n request.privateNetwork\n ) : void 0\n }\n ])\n});\nconst marshalCreateReadReplicaEndpointRequest = (request, defaults) => ({\n endpoint_spec: request.endpointSpec.map(\n (elt) => marshalReadReplicaEndpointSpec(elt)\n )\n});\nconst marshalCreateReadReplicaRequest = (request, defaults) => ({\n endpoint_spec: request.endpointSpec !== void 0 ? request.endpointSpec.map(\n (elt) => marshalReadReplicaEndpointSpec(elt)\n ) : void 0,\n instance_id: request.instanceId,\n same_zone: request.sameZone\n});\nconst marshalCreateSnapshotRequest = (request, defaults) => ({\n expires_at: request.expiresAt,\n name: request.name || randomName(\"snp\")\n});\nconst marshalCreateUserRequest = (request, defaults) => ({\n is_admin: request.isAdmin,\n name: request.name,\n password: request.password\n});\nconst marshalDeleteInstanceACLRulesRequest = (request, defaults) => ({\n acl_rule_ips: request.aclRuleIps\n});\nconst marshalDeleteInstanceSettingsRequest = (request, defaults) => ({\n setting_names: request.settingNames\n});\nconst marshalMigrateEndpointRequest = (request, defaults) => ({\n instance_id: request.instanceId\n});\nconst marshalPurgeInstanceLogsRequest = (request, defaults) => ({\n log_name: request.logName\n});\nconst marshalSetInstanceACLRulesRequest = (request, defaults) => ({\n rules: request.rules.map((elt) => marshalACLRuleRequest(elt))\n});\nconst marshalSetInstanceSettingsRequest = (request, defaults) => ({\n settings: request.settings.map((elt) => marshalInstanceSetting(elt))\n});\nconst marshalSetPrivilegeRequest = (request, defaults) => ({\n database_name: request.databaseName,\n permission: request.permission,\n user_name: request.userName\n});\nconst marshalLogsPolicy = (request, defaults) => ({\n max_age_retention: request.maxAgeRetention,\n total_disk_retention: request.totalDiskRetention\n});\nconst marshalUpdateInstanceRequest = (request, defaults) => ({\n backup_same_region: request.backupSameRegion,\n backup_schedule_frequency: request.backupScheduleFrequency,\n backup_schedule_retention: request.backupScheduleRetention,\n backup_schedule_start_hour: request.backupScheduleStartHour,\n is_backup_schedule_disabled: request.isBackupScheduleDisabled,\n logs_policy: request.logsPolicy !== void 0 ? marshalLogsPolicy(request.logsPolicy) : void 0,\n name: request.name,\n tags: request.tags\n});\nconst marshalUpdateSnapshotRequest = (request, defaults) => ({\n expires_at: request.expiresAt,\n name: request.name\n});\nconst marshalUpdateUserRequest = (request, defaults) => ({\n is_admin: request.isAdmin,\n password: request.password\n});\nconst marshalUpgradeInstanceRequestMajorUpgradeWorkflow = (request, defaults) => ({\n upgradable_version_id: request.upgradableVersionId,\n with_endpoints: request.withEndpoints\n});\nconst marshalUpgradeInstanceRequest = (request, defaults) => ({\n ...marshalling.resolveOneOf([\n { param: \"node_type\", value: request.nodeType },\n { param: \"enable_ha\", value: request.enableHa },\n { param: \"volume_size\", value: request.volumeSize },\n { param: \"volume_type\", value: request.volumeType },\n { param: \"upgradable_version_id\", value: request.upgradableVersionId },\n {\n param: \"major_upgrade_workflow\",\n value: request.majorUpgradeWorkflow !== void 0 ? marshalUpgradeInstanceRequestMajorUpgradeWorkflow(\n request.majorUpgradeWorkflow\n ) : void 0\n }\n ])\n});\nexports.marshalAddInstanceACLRulesRequest = marshalAddInstanceACLRulesRequest;\nexports.marshalAddInstanceSettingsRequest = marshalAddInstanceSettingsRequest;\nexports.marshalCloneInstanceRequest = marshalCloneInstanceRequest;\nexports.marshalCreateDatabaseRequest = marshalCreateDatabaseRequest;\nexports.marshalCreateEndpointRequest = marshalCreateEndpointRequest;\nexports.marshalCreateInstanceFromSnapshotRequest = marshalCreateInstanceFromSnapshotRequest;\nexports.marshalCreateInstanceRequest = marshalCreateInstanceRequest;\nexports.marshalCreateReadReplicaEndpointRequest = marshalCreateReadReplicaEndpointRequest;\nexports.marshalCreateReadReplicaRequest = marshalCreateReadReplicaRequest;\nexports.marshalCreateSnapshotRequest = marshalCreateSnapshotRequest;\nexports.marshalCreateUserRequest = marshalCreateUserRequest;\nexports.marshalDeleteInstanceACLRulesRequest = marshalDeleteInstanceACLRulesRequest;\nexports.marshalDeleteInstanceSettingsRequest = marshalDeleteInstanceSettingsRequest;\nexports.marshalMigrateEndpointRequest = marshalMigrateEndpointRequest;\nexports.marshalPurgeInstanceLogsRequest = marshalPurgeInstanceLogsRequest;\nexports.marshalSetInstanceACLRulesRequest = marshalSetInstanceACLRulesRequest;\nexports.marshalSetInstanceSettingsRequest = marshalSetInstanceSettingsRequest;\nexports.marshalSetPrivilegeRequest = marshalSetPrivilegeRequest;\nexports.marshalUpdateInstanceRequest = marshalUpdateInstanceRequest;\nexports.marshalUpdateSnapshotRequest = marshalUpdateSnapshotRequest;\nexports.marshalUpdateUserRequest = marshalUpdateUserRequest;\nexports.marshalUpgradeInstanceRequest = marshalUpgradeInstanceRequest;\nexports.unmarshalAddInstanceACLRulesResponse = unmarshalAddInstanceACLRulesResponse;\nexports.unmarshalAddInstanceSettingsResponse = unmarshalAddInstanceSettingsResponse;\nexports.unmarshalDatabase = unmarshalDatabase;\nexports.unmarshalDeleteInstanceACLRulesResponse = unmarshalDeleteInstanceACLRulesResponse;\nexports.unmarshalDeleteInstanceSettingsResponse = unmarshalDeleteInstanceSettingsResponse;\nexports.unmarshalEndpoint = unmarshalEndpoint;\nexports.unmarshalInstance = unmarshalInstance;\nexports.unmarshalInstanceLog = unmarshalInstanceLog;\nexports.unmarshalInstanceMetrics = unmarshalInstanceMetrics;\nexports.unmarshalListDatabaseEnginesResponse = unmarshalListDatabaseEnginesResponse;\nexports.unmarshalListDatabasesResponse = unmarshalListDatabasesResponse;\nexports.unmarshalListInstanceACLRulesResponse = unmarshalListInstanceACLRulesResponse;\nexports.unmarshalListInstanceLogsDetailsResponse = unmarshalListInstanceLogsDetailsResponse;\nexports.unmarshalListInstanceLogsResponse = unmarshalListInstanceLogsResponse;\nexports.unmarshalListInstancesResponse = unmarshalListInstancesResponse;\nexports.unmarshalListNodeTypesResponse = unmarshalListNodeTypesResponse;\nexports.unmarshalListPrivilegesResponse = unmarshalListPrivilegesResponse;\nexports.unmarshalListSnapshotsResponse = unmarshalListSnapshotsResponse;\nexports.unmarshalListUsersResponse = unmarshalListUsersResponse;\nexports.unmarshalMaintenance = unmarshalMaintenance;\nexports.unmarshalPrivilege = unmarshalPrivilege;\nexports.unmarshalReadReplica = unmarshalReadReplica;\nexports.unmarshalSetInstanceACLRulesResponse = unmarshalSetInstanceACLRulesResponse;\nexports.unmarshalSetInstanceSettingsResponse = unmarshalSetInstanceSettingsResponse;\nexports.unmarshalSnapshot = unmarshalSnapshot;\nexports.unmarshalUser = unmarshalUser;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst UpdateInstanceRequest = {\n backupScheduleStartHour: {\n lessThanOrEqual: 23\n }\n};\nexports.UpdateInstanceRequest = UpdateInstanceRequest;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst index_gen = require(\"./v2beta1/index.gen.cjs\");\nexports.v2beta1 = index_gen;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst intervalRetrier = require(\"../../../internal/async/interval-retrier.cjs\");\nconst api = require(\"../../../scw/api.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst resourcePaginator = require(\"../../../scw/fetch/resource-paginator.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nconst marshalling_gen = require(\"./marshalling.gen.cjs\");\nconst jsonContentHeaders = {\n \"Content-Type\": \"application/json; charset=utf-8\"\n};\nclass API extends api.API {\n pageOfListDNSZones = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/domain/v2beta1/dns-zones`,\n urlParams: marshalling.urlParams(\n [\"created_after\", request.createdAfter],\n [\"created_before\", request.createdBefore],\n [\"dns_zone\", request.dnsZone],\n [\"dns_zones\", request.dnsZones],\n [\"domain\", request.domain],\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId],\n [\"updated_after\", request.updatedAfter],\n [\"updated_before\", request.updatedBefore]\n )\n },\n marshalling_gen.unmarshalListDNSZonesResponse\n );\n /**\n * List DNS zones. Retrieve the list of DNS zones you can manage and filter\n * DNS zones associated with specific domain names.\n *\n * @param request - The request {@link ListDNSZonesRequest}\n * @returns A Promise of ListDNSZonesResponse\n */\n listDNSZones = (request) => resourcePaginator.enrichForPagination(\"dnsZones\", this.pageOfListDNSZones, request);\n /**\n * Create a DNS zone. Create a new DNS zone specified by the domain name, the\n * subdomain and the Project ID.\n *\n * @param request - The request {@link CreateDNSZoneRequest}\n * @returns A Promise of DNSZone\n */\n createDNSZone = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateDNSZoneRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/domain/v2beta1/dns-zones`\n },\n marshalling_gen.unmarshalDNSZone\n );\n /**\n * Update a DNS zone. Update the name and/or the Organizations for a DNS zone.\n *\n * @param request - The request {@link UpdateDNSZoneRequest}\n * @returns A Promise of DNSZone\n */\n updateDNSZone = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateDNSZoneRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/domain/v2beta1/dns-zones/${marshalling.validatePathParam(\"dnsZone\", request.dnsZone)}`\n },\n marshalling_gen.unmarshalDNSZone\n );\n /**\n * Clone a DNS zone. Clone an existing DNS zone with all its records into a\n * new DNS zone.\n *\n * @param request - The request {@link CloneDNSZoneRequest}\n * @returns A Promise of DNSZone\n */\n cloneDNSZone = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCloneDNSZoneRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/domain/v2beta1/dns-zones/${marshalling.validatePathParam(\"dnsZone\", request.dnsZone)}/clone`\n },\n marshalling_gen.unmarshalDNSZone\n );\n /**\n * Delete a DNS zone. Delete a DNS zone and all its records.\n *\n * @param request - The request {@link DeleteDNSZoneRequest}\n * @returns A Promise of DeleteDNSZoneResponse\n */\n deleteDNSZone = (request) => this.client.fetch(\n {\n method: \"DELETE\",\n path: `/domain/v2beta1/dns-zones/${marshalling.validatePathParam(\"dnsZone\", request.dnsZone)}`,\n urlParams: marshalling.urlParams([\n \"project_id\",\n request.projectId ?? this.client.settings.defaultProjectId\n ])\n },\n marshalling_gen.unmarshalDeleteDNSZoneResponse\n );\n pageOfListDNSZoneRecords = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/domain/v2beta1/dns-zones/${marshalling.validatePathParam(\"dnsZone\", request.dnsZone)}/records`,\n urlParams: marshalling.urlParams(\n [\"id\", request.id],\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId],\n [\"type\", request.type]\n )\n },\n marshalling_gen.unmarshalListDNSZoneRecordsResponse\n );\n /**\n * List records within a DNS zone. Retrieve a list of DNS records within a DNS\n * zone that has default name servers. You can filter records by type and\n * name.\n *\n * @param request - The request {@link ListDNSZoneRecordsRequest}\n * @returns A Promise of ListDNSZoneRecordsResponse\n */\n listDNSZoneRecords = (request) => resourcePaginator.enrichForPagination(\"records\", this.pageOfListDNSZoneRecords, request);\n /**\n * Update records within a DNS zone. Update records within a DNS zone that has\n * default name servers and perform several actions on your records.\n *\n * Actions include:\n *\n * - Add: allows you to add a new record or add a new IP to an existing A\n * record, for example\n * - Set: allows you to edit a record or edit an IP from an existing A record,\n * for example\n * - Delete: allows you to delete a record or delete an IP from an existing A\n * record, for example\n * - Clear: allows you to delete all records from a DNS zone\n *\n * All edits will be versioned.\n *\n * @param request - The request {@link UpdateDNSZoneRecordsRequest}\n * @returns A Promise of UpdateDNSZoneRecordsResponse\n */\n updateDNSZoneRecords = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateDNSZoneRecordsRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/domain/v2beta1/dns-zones/${marshalling.validatePathParam(\"dnsZone\", request.dnsZone)}/records`\n },\n marshalling_gen.unmarshalUpdateDNSZoneRecordsResponse\n );\n /**\n * List name servers within a DNS zone. Retrieve a list of name servers within\n * a DNS zone and their optional glue records.\n *\n * @param request - The request {@link ListDNSZoneNameserversRequest}\n * @returns A Promise of ListDNSZoneNameserversResponse\n */\n listDNSZoneNameservers = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/domain/v2beta1/dns-zones/${marshalling.validatePathParam(\"dnsZone\", request.dnsZone)}/nameservers`,\n urlParams: marshalling.urlParams([\"project_id\", request.projectId])\n },\n marshalling_gen.unmarshalListDNSZoneNameserversResponse\n );\n /**\n * Update name servers within a DNS zone. Update name servers within a DNS\n * zone and set optional glue records.\n *\n * @param request - The request {@link UpdateDNSZoneNameserversRequest}\n * @returns A Promise of UpdateDNSZoneNameserversResponse\n */\n updateDNSZoneNameservers = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateDNSZoneNameserversRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PUT\",\n path: `/domain/v2beta1/dns-zones/${marshalling.validatePathParam(\"dnsZone\", request.dnsZone)}/nameservers`\n },\n marshalling_gen.unmarshalUpdateDNSZoneNameserversResponse\n );\n /**\n * Clear records within a DNS zone. Delete all records within a DNS zone that\n * has default name servers.
All edits will be versioned.\n *\n * @param request - The request {@link ClearDNSZoneRecordsRequest}\n * @returns A Promise of ClearDNSZoneRecordsResponse\n */\n clearDNSZoneRecords = (request) => this.client.fetch(\n {\n method: \"DELETE\",\n path: `/domain/v2beta1/dns-zones/${marshalling.validatePathParam(\"dnsZone\", request.dnsZone)}/records`\n },\n marshalling_gen.unmarshalClearDNSZoneRecordsResponse\n );\n /**\n * Export a raw DNS zone. Export a DNS zone with default name servers, in a\n * specific format.\n *\n * @param request - The request {@link ExportRawDNSZoneRequest}\n * @returns A Promise of Blob\n */\n exportRawDNSZone = (request) => this.client.fetch({\n method: \"GET\",\n path: `/domain/v2beta1/dns-zones/${marshalling.validatePathParam(\"dnsZone\", request.dnsZone)}/raw`,\n urlParams: marshalling.urlParams([\"dl\", 1], [\"format\", request.format]),\n responseType: \"blob\"\n });\n /**\n * Import a raw DNS zone. Import and replace the format of records from a\n * given provider, with default name servers.\n *\n * @param request - The request {@link ImportRawDNSZoneRequest}\n * @returns A Promise of ImportRawDNSZoneResponse\n */\n importRawDNSZone = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalImportRawDNSZoneRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/domain/v2beta1/dns-zones/${marshalling.validatePathParam(\"dnsZone\", request.dnsZone)}/raw`\n },\n marshalling_gen.unmarshalImportRawDNSZoneResponse\n );\n /**\n * Import a DNS zone from another provider. Import and replace the format of\n * records from a given provider, with default name servers.\n *\n * @param request - The request {@link ImportProviderDNSZoneRequest}\n * @returns A Promise of ImportProviderDNSZoneResponse\n */\n importProviderDNSZone = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalImportProviderDNSZoneRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/domain/v2beta1/dns-zones/${marshalling.validatePathParam(\"dnsZone\", request.dnsZone)}/import-provider`\n },\n marshalling_gen.unmarshalImportProviderDNSZoneResponse\n );\n /**\n * Refresh a DNS zone. Refresh an SOA DNS zone to reload the records in the\n * DNS zone and update the SOA serial. You can recreate the given DNS zone and\n * its sub DNS zone if needed.\n *\n * @param request - The request {@link RefreshDNSZoneRequest}\n * @returns A Promise of RefreshDNSZoneResponse\n */\n refreshDNSZone = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalRefreshDNSZoneRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/domain/v2beta1/dns-zones/${marshalling.validatePathParam(\"dnsZone\", request.dnsZone)}/refresh`\n },\n marshalling_gen.unmarshalRefreshDNSZoneResponse\n );\n pageOfListDNSZoneVersions = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/domain/v2beta1/dns-zones/${marshalling.validatePathParam(\"dnsZone\", request.dnsZone)}/versions`,\n urlParams: marshalling.urlParams(\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListDNSZoneVersionsResponse\n );\n /**\n * List versions of a DNS zone. Retrieve a list of a DNS zone's versions.
\n * The maximum version count is 100. If the count reaches this limit, the\n * oldest version will be deleted after each new modification.\n *\n * @param request - The request {@link ListDNSZoneVersionsRequest}\n * @returns A Promise of ListDNSZoneVersionsResponse\n */\n listDNSZoneVersions = (request) => resourcePaginator.enrichForPagination(\"versions\", this.pageOfListDNSZoneVersions, request);\n pageOfListDNSZoneVersionRecords = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/domain/v2beta1/dns-zones/version/${marshalling.validatePathParam(\"dnsZoneVersionId\", request.dnsZoneVersionId)}`,\n urlParams: marshalling.urlParams(\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListDNSZoneVersionRecordsResponse\n );\n /**\n * List records from a given version of a specific DNS zone. Retrieve a list\n * of records from a specific DNS zone version.\n *\n * @param request - The request {@link ListDNSZoneVersionRecordsRequest}\n * @returns A Promise of ListDNSZoneVersionRecordsResponse\n */\n listDNSZoneVersionRecords = (request) => resourcePaginator.enrichForPagination(\n \"records\",\n this.pageOfListDNSZoneVersionRecords,\n request\n );\n /**\n * Access differences from a specific DNS zone version. Access a previous DNS\n * zone version to see the differences from another specific version.\n *\n * @param request - The request {@link GetDNSZoneVersionDiffRequest}\n * @returns A Promise of GetDNSZoneVersionDiffResponse\n */\n getDNSZoneVersionDiff = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/domain/v2beta1/dns-zones/version/${marshalling.validatePathParam(\"dnsZoneVersionId\", request.dnsZoneVersionId)}/diff`\n },\n marshalling_gen.unmarshalGetDNSZoneVersionDiffResponse\n );\n /**\n * Restore a DNS zone version. Restore and activate a version of a specific\n * DNS zone.\n *\n * @param request - The request {@link RestoreDNSZoneVersionRequest}\n * @returns A Promise of RestoreDNSZoneVersionResponse\n */\n restoreDNSZoneVersion = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/domain/v2beta1/dns-zones/version/${marshalling.validatePathParam(\"dnsZoneVersionId\", request.dnsZoneVersionId)}/restore`\n },\n marshalling_gen.unmarshalRestoreDNSZoneVersionResponse\n );\n /**\n * Get a DNS zone's TLS certificate. Get the DNS zone's TLS certificate. If\n * you do not have a certificate, the ouptut returns `no certificate found`.\n *\n * @param request - The request {@link GetSSLCertificateRequest}\n * @returns A Promise of SSLCertificate\n */\n getSSLCertificate = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/domain/v2beta1/ssl-certificates/${marshalling.validatePathParam(\"dnsZone\", request.dnsZone)}`\n },\n marshalling_gen.unmarshalSSLCertificate\n );\n /**\n * Waits for {@link SSLCertificate} to be in a final state.\n *\n * @param request - The request {@link GetSSLCertificateRequest}\n * @param options - The waiting options\n * @returns A Promise of SSLCertificate\n */\n waitForSSLCertificate = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(\n !content_gen.SSL_CERTIFICATE_TRANSIENT_STATUSES.includes(res.status)\n )),\n this.getSSLCertificate,\n request,\n options\n );\n /**\n * Create or get the DNS zone's TLS certificate. Create a new TLS certificate\n * or retrieve information about an existing TLS certificate.\n *\n * @param request - The request {@link CreateSSLCertificateRequest}\n * @returns A Promise of SSLCertificate\n */\n createSSLCertificate = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateSSLCertificateRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/domain/v2beta1/ssl-certificates`\n },\n marshalling_gen.unmarshalSSLCertificate\n );\n pageOfListSSLCertificates = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/domain/v2beta1/ssl-certificates`,\n urlParams: marshalling.urlParams(\n [\"dns_zone\", request.dnsZone],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId]\n )\n },\n marshalling_gen.unmarshalListSSLCertificatesResponse\n );\n /**\n * List a user's TLS certificates. List all the TLS certificates a user has\n * created, specified by the user's Project ID and the DNS zone.\n *\n * @param request - The request {@link ListSSLCertificatesRequest}\n * @returns A Promise of ListSSLCertificatesResponse\n */\n listSSLCertificates = (request) => resourcePaginator.enrichForPagination(\"certificates\", this.pageOfListSSLCertificates, request);\n /**\n * Delete a TLS certificate. Delete an existing TLS certificate specified by\n * its DNS zone. Deleting a TLS certificate is permanent and cannot be\n * undone.\n *\n * @param request - The request {@link DeleteSSLCertificateRequest}\n * @returns A Promise of DeleteSSLCertificateResponse\n */\n deleteSSLCertificate = (request) => this.client.fetch(\n {\n method: \"DELETE\",\n path: `/domain/v2beta1/ssl-certificates/${marshalling.validatePathParam(\"dnsZone\", request.dnsZone)}`\n },\n marshalling_gen.unmarshalDeleteSSLCertificateResponse\n );\n /**\n * Get the DNS zone's TSIG key. Retrieve information about the TSIG key of a\n * given DNS zone to allow AXFR requests.\n *\n * @param request - The request {@link GetDNSZoneTsigKeyRequest}\n * @returns A Promise of GetDNSZoneTsigKeyResponse\n */\n getDNSZoneTsigKey = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/domain/v2beta1/dns-zones/${marshalling.validatePathParam(\"dnsZone\", request.dnsZone)}/tsig-key`\n },\n marshalling_gen.unmarshalGetDNSZoneTsigKeyResponse\n );\n /**\n * Delete the DNS zone's TSIG key. Delete an existing TSIG key specified by\n * its DNS zone. Deleting a TSIG key is permanent and cannot be undone.\n *\n * @param request - The request {@link DeleteDNSZoneTsigKeyRequest}\n */\n deleteDNSZoneTsigKey = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/domain/v2beta1/dns-zones/${marshalling.validatePathParam(\"dnsZone\", request.dnsZone)}/tsig-key`\n });\n}\nclass RegistrarAPI extends api.API {\n pageOfListTasks = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/domain/v2beta1/tasks`,\n urlParams: marshalling.urlParams(\n [\"domain\", request.domain],\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId],\n [\"statuses\", request.statuses],\n [\"types\", request.types]\n )\n },\n marshalling_gen.unmarshalListTasksResponse\n );\n /**\n * List tasks. List all operations performed on the account. You can filter\n * the list of tasks by domain name.\n *\n * @param request - The request {@link RegistrarApiListTasksRequest}\n * @returns A Promise of ListTasksResponse\n */\n listTasks = (request = {}) => resourcePaginator.enrichForPagination(\"tasks\", this.pageOfListTasks, request);\n /**\n * Purchase domains. Request the registration of domain names. You can provide\n * a domain's already existing contact or a new contact.\n *\n * @param request - The request {@link RegistrarApiBuyDomainsRequest}\n * @returns A Promise of OrderResponse\n */\n buyDomains = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalRegistrarApiBuyDomainsRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/domain/v2beta1/buy-domains`\n },\n marshalling_gen.unmarshalOrderResponse\n );\n /**\n * Renew domains. Request the renewal of one or more domain names.\n *\n * @param request - The request {@link RegistrarApiRenewDomainsRequest}\n * @returns A Promise of OrderResponse\n */\n renewDomains = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalRegistrarApiRenewDomainsRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/domain/v2beta1/renew-domains`\n },\n marshalling_gen.unmarshalOrderResponse\n );\n /**\n * Transfer a domain. Request the transfer of a domain from another registrar\n * to Scaleway Domains and DNS.\n *\n * @param request - The request {@link RegistrarApiTransferInDomainRequest}\n * @returns A Promise of OrderResponse\n */\n transferInDomain = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalRegistrarApiTransferInDomainRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/domain/v2beta1/domains/transfer-domains`\n },\n marshalling_gen.unmarshalOrderResponse\n );\n /**\n * Trade a domain's contact. Request to change a domain's contact owner.
\n * If you specify the `organization_id` of the domain's new owner, the contact\n * will change from the current owner's Scaleway account to the new owner's\n * Scaleway account.
If the new owner's current contact information is\n * not available, the first ever contact they have created for previous\n * domains is taken into account to operate the change.
If the new owner\n * has never created a contact to register domains before, an error message\n * displays.\n *\n * @param request - The request {@link RegistrarApiTradeDomainRequest}\n * @returns A Promise of OrderResponse\n */\n tradeDomain = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalRegistrarApiTradeDomainRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/domain/v2beta1/domains/${marshalling.validatePathParam(\"domain\", request.domain)}/trade`\n },\n marshalling_gen.unmarshalOrderResponse\n );\n /**\n * Register an external domain. Request the registration of an external domain\n * name.\n *\n * @param request - The request\n * {@link RegistrarApiRegisterExternalDomainRequest}\n * @returns A Promise of RegisterExternalDomainResponse\n */\n registerExternalDomain = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalRegistrarApiRegisterExternalDomainRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/domain/v2beta1/external-domains`\n },\n marshalling_gen.unmarshalRegisterExternalDomainResponse\n );\n /**\n * Delete an external domain. Delete an external domain name.\n *\n * @param request - The request {@link RegistrarApiDeleteExternalDomainRequest}\n * @returns A Promise of DeleteExternalDomainResponse\n */\n deleteExternalDomain = (request) => this.client.fetch(\n {\n method: \"DELETE\",\n path: `/domain/v2beta1/external-domains/${marshalling.validatePathParam(\"domain\", request.domain)}`\n },\n marshalling_gen.unmarshalDeleteExternalDomainResponse\n );\n /**\n * Check if contacts are compatible with a domain or a TLD. Check whether\n * contacts are compatible with a domain or a TLD. If contacts are not\n * compatible with either the domain or the TLD, the information that needs to\n * be corrected is returned.\n *\n * @param request - The request\n * {@link RegistrarApiCheckContactsCompatibilityRequest}\n * @returns A Promise of CheckContactsCompatibilityResponse\n */\n checkContactsCompatibility = (request = {}) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalRegistrarApiCheckContactsCompatibilityRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/domain/v2beta1/check-contacts-compatibility`\n },\n marshalling_gen.unmarshalCheckContactsCompatibilityResponse\n );\n pageOfListContacts = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/domain/v2beta1/contacts`,\n urlParams: marshalling.urlParams(\n [\"domain\", request.domain],\n [\"email_status\", request.emailStatus],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId],\n [\"role\", request.role]\n )\n },\n marshalling_gen.unmarshalListContactsResponse\n );\n /**\n * List contacts. Retrieve the list of contacts and their associated domains\n * and roles. You can filter the list by domain name.\n *\n * @param request - The request {@link RegistrarApiListContactsRequest}\n * @returns A Promise of ListContactsResponse\n */\n listContacts = (request = {}) => resourcePaginator.enrichForPagination(\"contacts\", this.pageOfListContacts, request);\n /**\n * Get a contact. Retrieve a contact's details from the registrar using the\n * given contact's ID.\n *\n * @param request - The request {@link RegistrarApiGetContactRequest}\n * @returns A Promise of Contact\n */\n getContact = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/domain/v2beta1/contacts/${marshalling.validatePathParam(\"contactId\", request.contactId)}`\n },\n marshalling_gen.unmarshalContact\n );\n /**\n * Update contact. Edit the contact's information.\n *\n * @param request - The request {@link RegistrarApiUpdateContactRequest}\n * @returns A Promise of Contact\n */\n updateContact = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalRegistrarApiUpdateContactRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/domain/v2beta1/contacts/${marshalling.validatePathParam(\"contactId\", request.contactId)}`\n },\n marshalling_gen.unmarshalContact\n );\n pageOfListDomains = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/domain/v2beta1/domains`,\n urlParams: marshalling.urlParams(\n [\"domain\", request.domain],\n [\"is_external\", request.isExternal],\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId],\n [\"registrar\", request.registrar],\n [\"status\", request.status]\n )\n },\n marshalling_gen.unmarshalListDomainsResponse\n );\n /**\n * List domains. Retrieve the list of domains you own.\n *\n * @param request - The request {@link RegistrarApiListDomainsRequest}\n * @returns A Promise of ListDomainsResponse\n */\n listDomains = (request = {}) => resourcePaginator.enrichForPagination(\"domains\", this.pageOfListDomains, request);\n pageOfListRenewableDomains = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/domain/v2beta1/renewable-domains`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId]\n )\n },\n marshalling_gen.unmarshalListRenewableDomainsResponse\n );\n /**\n * List domains that can be renewed. Retrieve the list of domains you own that\n * can be renewed. You can also see the maximum renewal duration in years for\n * your domains that are renewable.\n *\n * @param request - The request {@link RegistrarApiListRenewableDomainsRequest}\n * @returns A Promise of ListRenewableDomainsResponse\n */\n listRenewableDomains = (request = {}) => resourcePaginator.enrichForPagination(\"domains\", this.pageOfListRenewableDomains, request);\n /**\n * Get domain. Retrieve a specific domain and display the domain's\n * information.\n *\n * @param request - The request {@link RegistrarApiGetDomainRequest}\n * @returns A Promise of Domain\n */\n getDomain = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/domain/v2beta1/domains/${marshalling.validatePathParam(\"domain\", request.domain)}`\n },\n marshalling_gen.unmarshalDomain\n );\n /**\n * Waits for {@link Domain} to be in a final state.\n *\n * @param request - The request {@link RegistrarApiGetDomainRequest}\n * @param options - The waiting options\n * @returns A Promise of Domain\n */\n waitForDomain = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(!content_gen.DOMAIN_TRANSIENT_STATUSES.includes(res.status))),\n this.getDomain,\n request,\n options\n );\n /**\n * Update a domain's contacts. Update contacts for a specific domain or create\n * a new contact.
If you add the same contact for multiple roles (owner,\n * administrative, technical), only one ID will be created and used for all of\n * the roles.\n *\n * @param request - The request {@link RegistrarApiUpdateDomainRequest}\n * @returns A Promise of Domain\n */\n updateDomain = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalRegistrarApiUpdateDomainRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/domain/v2beta1/domains/${marshalling.validatePathParam(\"domain\", request.domain)}`\n },\n marshalling_gen.unmarshalDomain\n );\n /**\n * Lock the transfer of a domain. Lock the transfer of a domain. This means\n * that the domain cannot be transferred and the authorization code cannot be\n * requested to your current registrar.\n *\n * @param request - The request {@link RegistrarApiLockDomainTransferRequest}\n * @returns A Promise of Domain\n */\n lockDomainTransfer = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/domain/v2beta1/domains/${marshalling.validatePathParam(\"domain\", request.domain)}/lock-transfer`\n },\n marshalling_gen.unmarshalDomain\n );\n /**\n * Unlock the transfer of a domain. Unlock the transfer of a domain. This\n * means that the domain can be transferred and the authorization code can be\n * requested to your current registrar.\n *\n * @param request - The request {@link RegistrarApiUnlockDomainTransferRequest}\n * @returns A Promise of Domain\n */\n unlockDomainTransfer = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/domain/v2beta1/domains/${marshalling.validatePathParam(\"domain\", request.domain)}/unlock-transfer`\n },\n marshalling_gen.unmarshalDomain\n );\n /**\n * Enable auto renew. Enable the `auto renew` feature for a domain. This means\n * the domain will be automatically renewed before its expiry date.\n *\n * @param request - The request\n * {@link RegistrarApiEnableDomainAutoRenewRequest}\n * @returns A Promise of Domain\n */\n enableDomainAutoRenew = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/domain/v2beta1/domains/${marshalling.validatePathParam(\"domain\", request.domain)}/enable-auto-renew`\n },\n marshalling_gen.unmarshalDomain\n );\n /**\n * Disable auto renew. Disable the `auto renew` feature for a domain. This\n * means the domain will not be renewed before its expiry date.\n *\n * @param request - The request\n * {@link RegistrarApiDisableDomainAutoRenewRequest}\n * @returns A Promise of Domain\n */\n disableDomainAutoRenew = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/domain/v2beta1/domains/${marshalling.validatePathParam(\"domain\", request.domain)}/disable-auto-renew`\n },\n marshalling_gen.unmarshalDomain\n );\n /**\n * Get a domain's authorization code. Retrieve the authorization code to\n * tranfer an unlocked domain. The output returns an error if the domain is\n * locked. Some TLDs may have a different procedure to retrieve the\n * authorization code. In that case, the information displays in the message\n * field.\n *\n * @param request - The request {@link RegistrarApiGetDomainAuthCodeRequest}\n * @returns A Promise of GetDomainAuthCodeResponse\n */\n getDomainAuthCode = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/domain/v2beta1/domains/${marshalling.validatePathParam(\"domain\", request.domain)}/auth-code`\n },\n marshalling_gen.unmarshalGetDomainAuthCodeResponse\n );\n /**\n * Update domain DNSSEC. If your domain uses another registrar and has the\n * default Scaleway NS, you have to **update the DS record at your\n * registrar**.\n *\n * @param request - The request {@link RegistrarApiEnableDomainDNSSECRequest}\n * @returns A Promise of Domain\n */\n enableDomainDNSSEC = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalRegistrarApiEnableDomainDNSSECRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/domain/v2beta1/domains/${marshalling.validatePathParam(\"domain\", request.domain)}/enable-dnssec`\n },\n marshalling_gen.unmarshalDomain\n );\n /**\n * Disable a domain's DNSSEC. Disable DNSSEC for a domain.\n *\n * @param request - The request {@link RegistrarApiDisableDomainDNSSECRequest}\n * @returns A Promise of Domain\n */\n disableDomainDNSSEC = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/domain/v2beta1/domains/${marshalling.validatePathParam(\"domain\", request.domain)}/disable-dnssec`\n },\n marshalling_gen.unmarshalDomain\n );\n /**\n * Search available domains. Search a domain or a maximum of 10 domains that\n * are available.\n *\n * If the TLD list is empty or not set, the search returns the results from\n * the most popular TLDs.\n *\n * @param request - The request\n * {@link RegistrarApiSearchAvailableDomainsRequest}\n * @returns A Promise of SearchAvailableDomainsResponse\n */\n searchAvailableDomains = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/domain/v2beta1/search-domains`,\n urlParams: marshalling.urlParams(\n [\"domains\", request.domains],\n [\"strict_search\", request.strictSearch],\n [\"tlds\", request.tlds]\n )\n },\n marshalling_gen.unmarshalSearchAvailableDomainsResponse\n );\n pageOfListTlds = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/domain/v2beta1/tlds`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"tlds\", request.tlds]\n )\n },\n marshalling_gen.unmarshalListTldsResponse\n );\n /**\n * List TLD offers. Retrieve the list of TLDs and offers associated with them.\n *\n * @param request - The request {@link RegistrarApiListTldsRequest}\n * @returns A Promise of ListTldsResponse\n */\n listTlds = (request = {}) => resourcePaginator.enrichForPagination(\"tlds\", this.pageOfListTlds, request);\n /**\n * Create a hostname for a domain. Create a hostname for a domain with glue\n * IPs.\n *\n * @param request - The request {@link RegistrarApiCreateDomainHostRequest}\n * @returns A Promise of Host\n */\n createDomainHost = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalRegistrarApiCreateDomainHostRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/domain/v2beta1/domains/${marshalling.validatePathParam(\"domain\", request.domain)}/hosts`\n },\n marshalling_gen.unmarshalHost\n );\n pageOfListDomainHosts = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/domain/v2beta1/domains/${marshalling.validatePathParam(\"domain\", request.domain)}/hosts`,\n urlParams: marshalling.urlParams(\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListDomainHostsResponse\n );\n /**\n * List a domain's hostnames. List a domain's hostnames using their glue IPs.\n *\n * @param request - The request {@link RegistrarApiListDomainHostsRequest}\n * @returns A Promise of ListDomainHostsResponse\n */\n listDomainHosts = (request) => resourcePaginator.enrichForPagination(\"hosts\", this.pageOfListDomainHosts, request);\n /**\n * Update a domain's hostname. Update a domain's hostname with glue IPs.\n *\n * @param request - The request {@link RegistrarApiUpdateDomainHostRequest}\n * @returns A Promise of Host\n */\n updateDomainHost = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalRegistrarApiUpdateDomainHostRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/domain/v2beta1/domains/${marshalling.validatePathParam(\"domain\", request.domain)}/hosts/${marshalling.validatePathParam(\"name\", request.name)}`\n },\n marshalling_gen.unmarshalHost\n );\n /**\n * Delete a domain's hostname.\n *\n * @param request - The request {@link RegistrarApiDeleteDomainHostRequest}\n * @returns A Promise of Host\n */\n deleteDomainHost = (request) => this.client.fetch(\n {\n method: \"DELETE\",\n path: `/domain/v2beta1/domains/${marshalling.validatePathParam(\"domain\", request.domain)}/hosts/${marshalling.validatePathParam(\"name\", request.name)}`\n },\n marshalling_gen.unmarshalHost\n );\n}\nexports.API = API;\nexports.RegistrarAPI = RegistrarAPI;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst DNS_ZONE_TRANSIENT_STATUSES = [\"pending\"];\nconst DOMAIN_FEATURE_TRANSIENT_STATUSES = [\n \"enabling\",\n \"disabling\"\n];\nconst DOMAIN_REGISTRATION_STATUS_TRANSFER_TRANSIENT_STATUSES = [\"pending\", \"processing\"];\nconst DOMAIN_TRANSIENT_STATUSES = [\n \"creating\",\n \"renewing\",\n \"xfering\",\n \"expiring\",\n \"updating\",\n \"checking\",\n \"deleting\"\n];\nconst HOST_TRANSIENT_STATUSES = [\"updating\", \"deleting\"];\nconst SSL_CERTIFICATE_TRANSIENT_STATUSES = [\n \"pending\"\n];\nconst TASK_TRANSIENT_STATUSES = [\"pending\"];\nexports.DNS_ZONE_TRANSIENT_STATUSES = DNS_ZONE_TRANSIENT_STATUSES;\nexports.DOMAIN_FEATURE_TRANSIENT_STATUSES = DOMAIN_FEATURE_TRANSIENT_STATUSES;\nexports.DOMAIN_REGISTRATION_STATUS_TRANSFER_TRANSIENT_STATUSES = DOMAIN_REGISTRATION_STATUS_TRANSFER_TRANSIENT_STATUSES;\nexports.DOMAIN_TRANSIENT_STATUSES = DOMAIN_TRANSIENT_STATUSES;\nexports.HOST_TRANSIENT_STATUSES = HOST_TRANSIENT_STATUSES;\nexports.SSL_CERTIFICATE_TRANSIENT_STATUSES = SSL_CERTIFICATE_TRANSIENT_STATUSES;\nexports.TASK_TRANSIENT_STATUSES = TASK_TRANSIENT_STATUSES;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api_gen = require(\"./api.gen.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nexports.API = api_gen.API;\nexports.RegistrarAPI = api_gen.RegistrarAPI;\nexports.DNS_ZONE_TRANSIENT_STATUSES = content_gen.DNS_ZONE_TRANSIENT_STATUSES;\nexports.DOMAIN_FEATURE_TRANSIENT_STATUSES = content_gen.DOMAIN_FEATURE_TRANSIENT_STATUSES;\nexports.DOMAIN_REGISTRATION_STATUS_TRANSFER_TRANSIENT_STATUSES = content_gen.DOMAIN_REGISTRATION_STATUS_TRANSFER_TRANSIENT_STATUSES;\nexports.DOMAIN_TRANSIENT_STATUSES = content_gen.DOMAIN_TRANSIENT_STATUSES;\nexports.HOST_TRANSIENT_STATUSES = content_gen.HOST_TRANSIENT_STATUSES;\nexports.SSL_CERTIFICATE_TRANSIENT_STATUSES = content_gen.SSL_CERTIFICATE_TRANSIENT_STATUSES;\nexports.TASK_TRANSIENT_STATUSES = content_gen.TASK_TRANSIENT_STATUSES;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst json = require(\"../../../helpers/json.cjs\");\nconst customMarshalling = require(\"../../../scw/custom-marshalling.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nconst unmarshalContactExtensionFRAssociationInfo = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ContactExtensionFRAssociationInfo' failed as data isn't a dictionary.`\n );\n }\n return {\n publicationJo: marshalling.unmarshalDate(data.publication_jo),\n publicationJoPage: data.publication_jo_page\n };\n};\nconst unmarshalContactExtensionFRCodeAuthAfnicInfo = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ContactExtensionFRCodeAuthAfnicInfo' failed as data isn't a dictionary.`\n );\n }\n return {\n codeAuthAfnic: data.code_auth_afnic\n };\n};\nconst unmarshalContactExtensionFRDunsInfo = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ContactExtensionFRDunsInfo' failed as data isn't a dictionary.`\n );\n }\n return {\n dunsId: data.duns_id,\n localId: data.local_id\n };\n};\nconst unmarshalContactExtensionFRIndividualInfo = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ContactExtensionFRIndividualInfo' failed as data isn't a dictionary.`\n );\n }\n return {\n whoisOptIn: data.whois_opt_in\n };\n};\nconst unmarshalContactExtensionFRTrademarkInfo = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ContactExtensionFRTrademarkInfo' failed as data isn't a dictionary.`\n );\n }\n return {\n trademarkInpi: data.trademark_inpi\n };\n};\nconst unmarshalContactExtensionEU = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ContactExtensionEU' failed as data isn't a dictionary.`\n );\n }\n return {\n europeanCitizenship: data.european_citizenship\n };\n};\nconst unmarshalContactExtensionFR = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ContactExtensionFR' failed as data isn't a dictionary.`\n );\n }\n return {\n associationInfo: data.association_info ? unmarshalContactExtensionFRAssociationInfo(data.association_info) : void 0,\n codeAuthAfnicInfo: data.code_auth_afnic_info ? unmarshalContactExtensionFRCodeAuthAfnicInfo(data.code_auth_afnic_info) : void 0,\n dunsInfo: data.duns_info ? unmarshalContactExtensionFRDunsInfo(data.duns_info) : void 0,\n individualInfo: data.individual_info ? unmarshalContactExtensionFRIndividualInfo(data.individual_info) : void 0,\n mode: data.mode,\n trademarkInfo: data.trademark_info ? unmarshalContactExtensionFRTrademarkInfo(data.trademark_info) : void 0\n };\n};\nconst unmarshalContactExtensionNL = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ContactExtensionNL' failed as data isn't a dictionary.`\n );\n }\n return {\n legalForm: data.legal_form,\n legalFormRegistrationNumber: data.legal_form_registration_number\n };\n};\nconst unmarshalContactQuestion = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ContactQuestion' failed as data isn't a dictionary.`\n );\n }\n return {\n answer: data.answer,\n question: data.question\n };\n};\nconst unmarshalContact = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Contact' failed as data isn't a dictionary.`\n );\n }\n return {\n addressLine1: data.address_line_1,\n addressLine2: data.address_line_2,\n city: data.city,\n companyIdentificationCode: data.company_identification_code,\n companyName: data.company_name,\n country: data.country,\n email: data.email,\n emailAlt: data.email_alt,\n emailStatus: data.email_status,\n extensionEu: data.extension_eu ? unmarshalContactExtensionEU(data.extension_eu) : void 0,\n extensionFr: data.extension_fr ? unmarshalContactExtensionFR(data.extension_fr) : void 0,\n extensionNl: data.extension_nl ? unmarshalContactExtensionNL(data.extension_nl) : void 0,\n faxNumber: data.fax_number,\n firstname: data.firstname,\n id: data.id,\n lang: data.lang,\n lastname: data.lastname,\n legalForm: data.legal_form,\n phoneNumber: data.phone_number,\n questions: data.questions ? marshalling.unmarshalArrayOfObject(data.questions, unmarshalContactQuestion) : void 0,\n resale: data.resale,\n state: data.state,\n status: data.status,\n vatIdentificationCode: data.vat_identification_code,\n whoisOptIn: data.whois_opt_in,\n zip: data.zip\n };\n};\nconst unmarshalDNSZone = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DNSZone' failed as data isn't a dictionary.`\n );\n }\n return {\n domain: data.domain,\n linkedProducts: data.linked_products,\n message: data.message,\n ns: data.ns,\n nsDefault: data.ns_default,\n nsMaster: data.ns_master,\n projectId: data.project_id,\n status: data.status,\n subdomain: data.subdomain,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalHost = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Host' failed as data isn't a dictionary.`\n );\n }\n return {\n domain: data.domain,\n ips: data.ips,\n name: data.name,\n status: data.status\n };\n};\nconst unmarshalSSLCertificate = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SSLCertificate' failed as data isn't a dictionary.`\n );\n }\n return {\n alternativeDnsZones: data.alternative_dns_zones,\n certificateChain: data.certificate_chain,\n createdAt: marshalling.unmarshalDate(data.created_at),\n dnsZone: data.dns_zone,\n expiredAt: marshalling.unmarshalDate(data.expired_at),\n privateKey: data.private_key,\n status: data.status\n };\n};\nconst unmarshalCheckContactsCompatibilityResponseContactCheckResult = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'CheckContactsCompatibilityResponseContactCheckResult' failed as data isn't a dictionary.`\n );\n }\n return {\n compatible: data.compatible,\n errorMessage: data.error_message\n };\n};\nconst unmarshalCheckContactsCompatibilityResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'CheckContactsCompatibilityResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n administrativeCheckResult: data.administrative_check_result ? unmarshalCheckContactsCompatibilityResponseContactCheckResult(\n data.administrative_check_result\n ) : void 0,\n compatible: data.compatible,\n ownerCheckResult: data.owner_check_result ? unmarshalCheckContactsCompatibilityResponseContactCheckResult(\n data.owner_check_result\n ) : void 0,\n technicalCheckResult: data.technical_check_result ? unmarshalCheckContactsCompatibilityResponseContactCheckResult(\n data.technical_check_result\n ) : void 0\n };\n};\nconst unmarshalClearDNSZoneRecordsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ClearDNSZoneRecordsResponse' failed as data isn't a dictionary.`\n );\n }\n return {};\n};\nconst unmarshalDeleteDNSZoneResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DeleteDNSZoneResponse' failed as data isn't a dictionary.`\n );\n }\n return {};\n};\nconst unmarshalDeleteExternalDomainResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DeleteExternalDomainResponse' failed as data isn't a dictionary.`\n );\n }\n return {};\n};\nconst unmarshalDeleteSSLCertificateResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DeleteSSLCertificateResponse' failed as data isn't a dictionary.`\n );\n }\n return {};\n};\nconst unmarshalDSRecordPublicKey = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DSRecordPublicKey' failed as data isn't a dictionary.`\n );\n }\n return {\n key: data.key\n };\n};\nconst unmarshalDSRecordDigest = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DSRecordDigest' failed as data isn't a dictionary.`\n );\n }\n return {\n digest: data.digest,\n publicKey: data.public_key ? unmarshalDSRecordPublicKey(data.public_key) : void 0,\n type: data.type\n };\n};\nconst unmarshalDSRecord = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DSRecord' failed as data isn't a dictionary.`\n );\n }\n return {\n algorithm: data.algorithm,\n digest: data.digest ? unmarshalDSRecordDigest(data.digest) : void 0,\n keyId: data.key_id,\n publicKey: data.public_key ? unmarshalDSRecordPublicKey(data.public_key) : void 0\n };\n};\nconst unmarshalTldOffer = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'TldOffer' failed as data isn't a dictionary.`\n );\n }\n return {\n action: data.action,\n operationPath: data.operation_path,\n price: data.price ? customMarshalling.unmarshalMoney(data.price) : void 0\n };\n};\nconst unmarshalDomainDNSSEC = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DomainDNSSEC' failed as data isn't a dictionary.`\n );\n }\n return {\n dsRecords: marshalling.unmarshalArrayOfObject(data.ds_records, unmarshalDSRecord),\n status: data.status\n };\n};\nconst unmarshalDomainRegistrationStatusExternalDomain = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DomainRegistrationStatusExternalDomain' failed as data isn't a dictionary.`\n );\n }\n return {\n validationToken: data.validation_token\n };\n};\nconst unmarshalDomainRegistrationStatusTransfer = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DomainRegistrationStatusTransfer' failed as data isn't a dictionary.`\n );\n }\n return {\n status: data.status,\n voteCurrentOwner: data.vote_current_owner,\n voteNewOwner: data.vote_new_owner\n };\n};\nconst unmarshalTld = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Tld' failed as data isn't a dictionary.`\n );\n }\n return {\n dnssecSupport: data.dnssec_support,\n durationInYearsMax: data.duration_in_years_max,\n durationInYearsMin: data.duration_in_years_min,\n idnSupport: data.idn_support,\n name: data.name,\n offers: marshalling.unmarshalMapOfObject(data.offers, unmarshalTldOffer),\n specifications: data.specifications\n };\n};\nconst unmarshalDomain = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Domain' failed as data isn't a dictionary.`\n );\n }\n return {\n administrativeContact: data.administrative_contact ? unmarshalContact(data.administrative_contact) : void 0,\n autoRenewStatus: data.auto_renew_status,\n dnsZones: marshalling.unmarshalArrayOfObject(data.dns_zones, unmarshalDNSZone),\n dnssec: data.dnssec ? unmarshalDomainDNSSEC(data.dnssec) : void 0,\n domain: data.domain,\n eppCode: data.epp_code,\n expiredAt: marshalling.unmarshalDate(data.expired_at),\n externalDomainRegistrationStatus: data.external_domain_registration_status ? unmarshalDomainRegistrationStatusExternalDomain(\n data.external_domain_registration_status\n ) : void 0,\n isExternal: data.is_external,\n linkedProducts: data.linked_products,\n organizationId: data.organization_id,\n ownerContact: data.owner_contact ? unmarshalContact(data.owner_contact) : void 0,\n pendingTrade: data.pending_trade,\n projectId: data.project_id,\n registrar: data.registrar,\n status: data.status,\n technicalContact: data.technical_contact ? unmarshalContact(data.technical_contact) : void 0,\n tld: data.tld ? unmarshalTld(data.tld) : void 0,\n transferRegistrationStatus: data.transfer_registration_status ? unmarshalDomainRegistrationStatusTransfer(\n data.transfer_registration_status\n ) : void 0,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalGetDNSZoneTsigKeyResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'GetDNSZoneTsigKeyResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n algorithm: data.algorithm,\n key: data.key,\n name: data.name\n };\n};\nconst unmarshalDomainRecordGeoIPConfigMatch = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DomainRecordGeoIPConfigMatch' failed as data isn't a dictionary.`\n );\n }\n return {\n continents: data.continents,\n countries: data.countries,\n data: data.data\n };\n};\nconst unmarshalDomainRecordViewConfigView = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DomainRecordViewConfigView' failed as data isn't a dictionary.`\n );\n }\n return {\n data: data.data,\n subnet: data.subnet\n };\n};\nconst unmarshalDomainRecordWeightedConfigWeightedIP = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DomainRecordWeightedConfigWeightedIP' failed as data isn't a dictionary.`\n );\n }\n return {\n ip: data.ip,\n weight: data.weight\n };\n};\nconst unmarshalDomainRecordGeoIPConfig = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DomainRecordGeoIPConfig' failed as data isn't a dictionary.`\n );\n }\n return {\n default: data.default,\n matches: marshalling.unmarshalArrayOfObject(\n data.matches,\n unmarshalDomainRecordGeoIPConfigMatch\n )\n };\n};\nconst unmarshalDomainRecordHTTPServiceConfig = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DomainRecordHTTPServiceConfig' failed as data isn't a dictionary.`\n );\n }\n return {\n ips: data.ips,\n mustContain: data.must_contain,\n strategy: data.strategy,\n url: data.url,\n userAgent: data.user_agent\n };\n};\nconst unmarshalDomainRecordViewConfig = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DomainRecordViewConfig' failed as data isn't a dictionary.`\n );\n }\n return {\n views: marshalling.unmarshalArrayOfObject(\n data.views,\n unmarshalDomainRecordViewConfigView\n )\n };\n};\nconst unmarshalDomainRecordWeightedConfig = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DomainRecordWeightedConfig' failed as data isn't a dictionary.`\n );\n }\n return {\n weightedIps: marshalling.unmarshalArrayOfObject(\n data.weighted_ips,\n unmarshalDomainRecordWeightedConfigWeightedIP\n )\n };\n};\nconst unmarshalDomainRecord = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DomainRecord' failed as data isn't a dictionary.`\n );\n }\n return {\n comment: data.comment,\n data: data.data,\n geoIpConfig: data.geo_ip_config ? unmarshalDomainRecordGeoIPConfig(data.geo_ip_config) : void 0,\n httpServiceConfig: data.http_service_config ? unmarshalDomainRecordHTTPServiceConfig(data.http_service_config) : void 0,\n id: data.id,\n name: data.name,\n priority: data.priority,\n ttl: data.ttl,\n type: data.type,\n viewConfig: data.view_config ? unmarshalDomainRecordViewConfig(data.view_config) : void 0,\n weightedConfig: data.weighted_config ? unmarshalDomainRecordWeightedConfig(data.weighted_config) : void 0\n };\n};\nconst unmarshalRecordIdentifier = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'RecordIdentifier' failed as data isn't a dictionary.`\n );\n }\n return {\n data: data.data,\n name: data.name,\n ttl: data.ttl,\n type: data.type\n };\n};\nconst unmarshalRecordChangeAdd = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'RecordChangeAdd' failed as data isn't a dictionary.`\n );\n }\n return {\n records: marshalling.unmarshalArrayOfObject(data.records, unmarshalDomainRecord)\n };\n};\nconst unmarshalRecordChangeClear = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'RecordChangeClear' failed as data isn't a dictionary.`\n );\n }\n return {};\n};\nconst unmarshalRecordChangeDelete = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'RecordChangeDelete' failed as data isn't a dictionary.`\n );\n }\n return {\n id: data.id,\n idFields: data.id_fields ? unmarshalRecordIdentifier(data.id_fields) : void 0\n };\n};\nconst unmarshalRecordChangeSet = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'RecordChangeSet' failed as data isn't a dictionary.`\n );\n }\n return {\n id: data.id,\n idFields: data.id_fields ? unmarshalRecordIdentifier(data.id_fields) : void 0,\n records: marshalling.unmarshalArrayOfObject(data.records, unmarshalDomainRecord)\n };\n};\nconst unmarshalRecordChange = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'RecordChange' failed as data isn't a dictionary.`\n );\n }\n return {\n add: data.add ? unmarshalRecordChangeAdd(data.add) : void 0,\n clear: data.clear ? unmarshalRecordChangeClear(data.clear) : void 0,\n delete: data.delete ? unmarshalRecordChangeDelete(data.delete) : void 0,\n set: data.set ? unmarshalRecordChangeSet(data.set) : void 0\n };\n};\nconst unmarshalGetDNSZoneVersionDiffResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'GetDNSZoneVersionDiffResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n changes: marshalling.unmarshalArrayOfObject(data.changes, unmarshalRecordChange)\n };\n};\nconst unmarshalGetDomainAuthCodeResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'GetDomainAuthCodeResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n authCode: data.auth_code\n };\n};\nconst unmarshalImportProviderDNSZoneResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ImportProviderDNSZoneResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n records: marshalling.unmarshalArrayOfObject(data.records, unmarshalDomainRecord)\n };\n};\nconst unmarshalImportRawDNSZoneResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ImportRawDNSZoneResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n records: marshalling.unmarshalArrayOfObject(data.records, unmarshalDomainRecord)\n };\n};\nconst unmarshalContactRolesRoles = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ContactRolesRoles' failed as data isn't a dictionary.`\n );\n }\n return {\n isAdministrative: data.is_administrative,\n isOwner: data.is_owner,\n isTechnical: data.is_technical\n };\n};\nconst unmarshalContactRoles = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ContactRoles' failed as data isn't a dictionary.`\n );\n }\n return {\n contact: data.contact ? unmarshalContact(data.contact) : void 0,\n roles: marshalling.unmarshalMapOfObject(data.roles, unmarshalContactRolesRoles)\n };\n};\nconst unmarshalListContactsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListContactsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n contacts: marshalling.unmarshalArrayOfObject(data.contacts, unmarshalContactRoles),\n totalCount: data.total_count\n };\n};\nconst unmarshalNameserver = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Nameserver' failed as data isn't a dictionary.`\n );\n }\n return {\n ip: data.ip,\n name: data.name\n };\n};\nconst unmarshalListDNSZoneNameserversResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListDNSZoneNameserversResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n ns: marshalling.unmarshalArrayOfObject(data.ns, unmarshalNameserver)\n };\n};\nconst unmarshalListDNSZoneRecordsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListDNSZoneRecordsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n records: marshalling.unmarshalArrayOfObject(data.records, unmarshalDomainRecord),\n totalCount: data.total_count\n };\n};\nconst unmarshalListDNSZoneVersionRecordsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListDNSZoneVersionRecordsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n records: marshalling.unmarshalArrayOfObject(data.records, unmarshalDomainRecord),\n totalCount: data.total_count\n };\n};\nconst unmarshalDNSZoneVersion = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DNSZoneVersion' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n id: data.id\n };\n};\nconst unmarshalListDNSZoneVersionsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListDNSZoneVersionsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n totalCount: data.total_count,\n versions: marshalling.unmarshalArrayOfObject(data.versions, unmarshalDNSZoneVersion)\n };\n};\nconst unmarshalListDNSZonesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListDNSZonesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n dnsZones: marshalling.unmarshalArrayOfObject(data.dns_zones, unmarshalDNSZone),\n totalCount: data.total_count\n };\n};\nconst unmarshalListDomainHostsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListDomainHostsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n hosts: marshalling.unmarshalArrayOfObject(data.hosts, unmarshalHost),\n totalCount: data.total_count\n };\n};\nconst unmarshalDomainSummary = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DomainSummary' failed as data isn't a dictionary.`\n );\n }\n return {\n autoRenewStatus: data.auto_renew_status,\n createdAt: marshalling.unmarshalDate(data.created_at),\n dnssecStatus: data.dnssec_status,\n domain: data.domain,\n eppCode: data.epp_code,\n expiredAt: marshalling.unmarshalDate(data.expired_at),\n externalDomainRegistrationStatus: data.external_domain_registration_status ? unmarshalDomainRegistrationStatusExternalDomain(\n data.external_domain_registration_status\n ) : void 0,\n isExternal: data.is_external,\n organizationId: data.organization_id,\n pendingTrade: data.pending_trade,\n projectId: data.project_id,\n registrar: data.registrar,\n status: data.status,\n transferRegistrationStatus: data.transfer_registration_status ? unmarshalDomainRegistrationStatusTransfer(\n data.transfer_registration_status\n ) : void 0,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalListDomainsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListDomainsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n domains: marshalling.unmarshalArrayOfObject(data.domains, unmarshalDomainSummary),\n totalCount: data.total_count\n };\n};\nconst unmarshalRenewableDomain = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'RenewableDomain' failed as data isn't a dictionary.`\n );\n }\n return {\n domain: data.domain,\n estimatedDeleteAt: marshalling.unmarshalDate(data.estimated_delete_at),\n expiredAt: marshalling.unmarshalDate(data.expired_at),\n limitRedemptionAt: marshalling.unmarshalDate(data.limit_redemption_at),\n limitRenewAt: marshalling.unmarshalDate(data.limit_renew_at),\n organizationId: data.organization_id,\n projectId: data.project_id,\n renewableDurationInYears: data.renewable_duration_in_years,\n status: data.status,\n tld: data.tld ? unmarshalTld(data.tld) : void 0\n };\n};\nconst unmarshalListRenewableDomainsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListRenewableDomainsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n domains: marshalling.unmarshalArrayOfObject(data.domains, unmarshalRenewableDomain),\n totalCount: data.total_count\n };\n};\nconst unmarshalListSSLCertificatesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListSSLCertificatesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n certificates: marshalling.unmarshalArrayOfObject(\n data.certificates,\n unmarshalSSLCertificate\n ),\n totalCount: data.total_count\n };\n};\nconst unmarshalTask = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Task' failed as data isn't a dictionary.`\n );\n }\n return {\n contactIdentifier: data.contact_identifier,\n domain: data.domain,\n id: data.id,\n message: data.message,\n organizationId: data.organization_id,\n projectId: data.project_id,\n startedAt: marshalling.unmarshalDate(data.started_at),\n status: data.status,\n type: data.type,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalListTasksResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListTasksResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n tasks: marshalling.unmarshalArrayOfObject(data.tasks, unmarshalTask),\n totalCount: data.total_count\n };\n};\nconst unmarshalListTldsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListTldsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n tlds: marshalling.unmarshalArrayOfObject(data.tlds, unmarshalTld),\n totalCount: data.total_count\n };\n};\nconst unmarshalOrderResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'OrderResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n domains: data.domains,\n organizationId: data.organization_id,\n projectId: data.project_id,\n taskId: data.task_id\n };\n};\nconst unmarshalRefreshDNSZoneResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'RefreshDNSZoneResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n dnsZones: marshalling.unmarshalArrayOfObject(data.dns_zones, unmarshalDNSZone)\n };\n};\nconst unmarshalRegisterExternalDomainResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'RegisterExternalDomainResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n domain: data.domain,\n organizationId: data.organization_id,\n projectId: data.project_id,\n validationToken: data.validation_token\n };\n};\nconst unmarshalRestoreDNSZoneVersionResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'RestoreDNSZoneVersionResponse' failed as data isn't a dictionary.`\n );\n }\n return {};\n};\nconst unmarshalAvailableDomain = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'AvailableDomain' failed as data isn't a dictionary.`\n );\n }\n return {\n available: data.available,\n domain: data.domain,\n tld: data.tld ? unmarshalTld(data.tld) : void 0\n };\n};\nconst unmarshalSearchAvailableDomainsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SearchAvailableDomainsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n availableDomains: marshalling.unmarshalArrayOfObject(\n data.available_domains,\n unmarshalAvailableDomain\n )\n };\n};\nconst unmarshalUpdateDNSZoneNameserversResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'UpdateDNSZoneNameserversResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n ns: marshalling.unmarshalArrayOfObject(data.ns, unmarshalNameserver)\n };\n};\nconst unmarshalUpdateDNSZoneRecordsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'UpdateDNSZoneRecordsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n records: marshalling.unmarshalArrayOfObject(data.records, unmarshalDomainRecord)\n };\n};\nconst marshalCloneDNSZoneRequest = (request, defaults) => ({\n dest_dns_zone: request.destDnsZone,\n overwrite: request.overwrite,\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalCreateDNSZoneRequest = (request, defaults) => ({\n domain: request.domain,\n project_id: request.projectId ?? defaults.defaultProjectId,\n subdomain: request.subdomain\n});\nconst marshalCreateSSLCertificateRequest = (request, defaults) => ({\n alternative_dns_zones: request.alternativeDnsZones,\n dns_zone: request.dnsZone\n});\nconst marshalImportProviderDNSZoneRequestOnlineV1 = (request, defaults) => ({\n token: request.token\n});\nconst marshalImportProviderDNSZoneRequest = (request, defaults) => ({\n ...marshalling.resolveOneOf([\n {\n param: \"online_v1\",\n value: request.onlineV1 !== void 0 ? marshalImportProviderDNSZoneRequestOnlineV1(\n request.onlineV1\n ) : void 0\n }\n ])\n});\nconst marshalImportRawDNSZoneRequestTsigKey = (request, defaults) => ({\n algorithm: request.algorithm,\n key: request.key,\n name: request.name\n});\nconst marshalImportRawDNSZoneRequestAXFRSource = (request, defaults) => ({\n name_server: request.nameServer,\n tsig_key: request.tsigKey !== void 0 ? marshalImportRawDNSZoneRequestTsigKey(request.tsigKey) : void 0\n});\nconst marshalImportRawDNSZoneRequestBindSource = (request, defaults) => ({\n content: request.content\n});\nconst marshalImportRawDNSZoneRequest = (request, defaults) => ({\n content: request.content,\n format: request.format,\n project_id: request.projectId ?? defaults.defaultProjectId,\n ...marshalling.resolveOneOf([\n {\n param: \"bind_source\",\n value: request.bindSource !== void 0 ? marshalImportRawDNSZoneRequestBindSource(\n request.bindSource\n ) : void 0\n },\n {\n param: \"axfr_source\",\n value: request.axfrSource !== void 0 ? marshalImportRawDNSZoneRequestAXFRSource(\n request.axfrSource\n ) : void 0\n }\n ])\n});\nconst marshalRefreshDNSZoneRequest = (request, defaults) => ({\n recreate_dns_zone: request.recreateDnsZone,\n recreate_sub_dns_zone: request.recreateSubDnsZone\n});\nconst marshalContactExtensionFRAssociationInfo = (request, defaults) => ({\n publication_jo: request.publicationJo,\n publication_jo_page: request.publicationJoPage\n});\nconst marshalContactExtensionFRCodeAuthAfnicInfo = (request, defaults) => ({\n code_auth_afnic: request.codeAuthAfnic\n});\nconst marshalContactExtensionFRDunsInfo = (request, defaults) => ({\n duns_id: request.dunsId,\n local_id: request.localId\n});\nconst marshalContactExtensionFRIndividualInfo = (request, defaults) => ({\n whois_opt_in: request.whoisOptIn\n});\nconst marshalContactExtensionFRTrademarkInfo = (request, defaults) => ({\n trademark_inpi: request.trademarkInpi\n});\nconst marshalContactExtensionEU = (request, defaults) => ({\n european_citizenship: request.europeanCitizenship\n});\nconst marshalContactExtensionFR = (request, defaults) => ({\n mode: request.mode,\n ...marshalling.resolveOneOf([\n {\n param: \"individual_info\",\n value: request.individualInfo !== void 0 ? marshalContactExtensionFRIndividualInfo(\n request.individualInfo\n ) : void 0\n },\n {\n param: \"duns_info\",\n value: request.dunsInfo !== void 0 ? marshalContactExtensionFRDunsInfo(request.dunsInfo) : void 0\n },\n {\n param: \"association_info\",\n value: request.associationInfo !== void 0 ? marshalContactExtensionFRAssociationInfo(\n request.associationInfo\n ) : void 0\n },\n {\n param: \"trademark_info\",\n value: request.trademarkInfo !== void 0 ? marshalContactExtensionFRTrademarkInfo(\n request.trademarkInfo\n ) : void 0\n },\n {\n param: \"code_auth_afnic_info\",\n value: request.codeAuthAfnicInfo !== void 0 ? marshalContactExtensionFRCodeAuthAfnicInfo(\n request.codeAuthAfnicInfo\n ) : void 0\n }\n ])\n});\nconst marshalContactExtensionNL = (request, defaults) => ({\n legal_form: request.legalForm,\n legal_form_registration_number: request.legalFormRegistrationNumber\n});\nconst marshalContactQuestion = (request, defaults) => ({\n answer: request.answer,\n question: request.question\n});\nconst marshalNewContact = (request, defaults) => ({\n address_line_1: request.addressLine1,\n address_line_2: request.addressLine2,\n city: request.city,\n company_identification_code: request.companyIdentificationCode,\n company_name: request.companyName,\n country: request.country,\n email: request.email,\n email_alt: request.emailAlt,\n extension_eu: request.extensionEu !== void 0 ? marshalContactExtensionEU(request.extensionEu) : void 0,\n extension_fr: request.extensionFr !== void 0 ? marshalContactExtensionFR(request.extensionFr) : void 0,\n extension_nl: request.extensionNl !== void 0 ? marshalContactExtensionNL(request.extensionNl) : void 0,\n fax_number: request.faxNumber,\n firstname: request.firstname,\n lang: request.lang,\n lastname: request.lastname,\n legal_form: request.legalForm,\n phone_number: request.phoneNumber,\n questions: request.questions !== void 0 ? request.questions.map((elt) => marshalContactQuestion(elt)) : void 0,\n resale: request.resale,\n state: request.state,\n vat_identification_code: request.vatIdentificationCode,\n whois_opt_in: request.whoisOptIn,\n zip: request.zip\n});\nconst marshalRegistrarApiBuyDomainsRequest = (request, defaults) => ({\n domains: request.domains,\n duration_in_years: request.durationInYears,\n project_id: request.projectId ?? defaults.defaultProjectId,\n ...marshalling.resolveOneOf([\n { param: \"owner_contact_id\", value: request.ownerContactId },\n {\n param: \"owner_contact\",\n value: request.ownerContact !== void 0 ? marshalNewContact(request.ownerContact) : void 0\n }\n ]),\n ...marshalling.resolveOneOf([\n {\n param: \"administrative_contact_id\",\n value: request.administrativeContactId\n },\n {\n param: \"administrative_contact\",\n value: request.administrativeContact !== void 0 ? marshalNewContact(request.administrativeContact) : void 0\n }\n ]),\n ...marshalling.resolveOneOf([\n { param: \"technical_contact_id\", value: request.technicalContactId },\n {\n param: \"technical_contact\",\n value: request.technicalContact !== void 0 ? marshalNewContact(request.technicalContact) : void 0\n }\n ])\n});\nconst marshalRegistrarApiCheckContactsCompatibilityRequest = (request, defaults) => ({\n domains: request.domains,\n tlds: request.tlds,\n ...marshalling.resolveOneOf([\n { param: \"owner_contact_id\", value: request.ownerContactId },\n {\n param: \"owner_contact\",\n value: request.ownerContact !== void 0 ? marshalNewContact(request.ownerContact) : void 0\n }\n ]),\n ...marshalling.resolveOneOf([\n {\n param: \"administrative_contact_id\",\n value: request.administrativeContactId\n },\n {\n param: \"administrative_contact\",\n value: request.administrativeContact !== void 0 ? marshalNewContact(request.administrativeContact) : void 0\n }\n ]),\n ...marshalling.resolveOneOf([\n { param: \"technical_contact_id\", value: request.technicalContactId },\n {\n param: \"technical_contact\",\n value: request.technicalContact !== void 0 ? marshalNewContact(request.technicalContact) : void 0\n }\n ])\n});\nconst marshalRegistrarApiCreateDomainHostRequest = (request, defaults) => ({\n ips: request.ips,\n name: request.name\n});\nconst marshalDSRecordPublicKey = (request, defaults) => ({\n key: request.key\n});\nconst marshalDSRecordDigest = (request, defaults) => ({\n digest: request.digest,\n public_key: request.publicKey !== void 0 ? marshalDSRecordPublicKey(request.publicKey) : void 0,\n type: request.type\n});\nconst marshalDSRecord = (request, defaults) => ({\n algorithm: request.algorithm,\n key_id: request.keyId,\n ...marshalling.resolveOneOf([\n {\n param: \"digest\",\n value: request.digest !== void 0 ? marshalDSRecordDigest(request.digest) : void 0\n },\n {\n param: \"public_key\",\n value: request.publicKey !== void 0 ? marshalDSRecordPublicKey(request.publicKey) : void 0\n }\n ])\n});\nconst marshalRegistrarApiEnableDomainDNSSECRequest = (request, defaults) => ({\n ds_record: request.dsRecord !== void 0 ? marshalDSRecord(request.dsRecord) : void 0\n});\nconst marshalRegistrarApiRegisterExternalDomainRequest = (request, defaults) => ({\n domain: request.domain,\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalRegistrarApiRenewDomainsRequest = (request, defaults) => ({\n domains: request.domains,\n duration_in_years: request.durationInYears,\n force_late_renewal: request.forceLateRenewal\n});\nconst marshalRegistrarApiTradeDomainRequest = (request, defaults) => ({\n project_id: request.projectId ?? defaults.defaultProjectId,\n ...marshalling.resolveOneOf([\n { param: \"new_owner_contact_id\", value: request.newOwnerContactId },\n {\n param: \"new_owner_contact\",\n value: request.newOwnerContact !== void 0 ? marshalNewContact(request.newOwnerContact) : void 0\n }\n ])\n});\nconst marshalTransferInDomainRequestTransferRequest = (request, defaults) => ({\n auth_code: request.authCode,\n domain: request.domain\n});\nconst marshalRegistrarApiTransferInDomainRequest = (request, defaults) => ({\n domains: request.domains.map(\n (elt) => marshalTransferInDomainRequestTransferRequest(elt)\n ),\n project_id: request.projectId ?? defaults.defaultProjectId,\n ...marshalling.resolveOneOf([\n { param: \"owner_contact_id\", value: request.ownerContactId },\n {\n param: \"owner_contact\",\n value: request.ownerContact !== void 0 ? marshalNewContact(request.ownerContact) : void 0\n }\n ]),\n ...marshalling.resolveOneOf([\n {\n param: \"administrative_contact_id\",\n value: request.administrativeContactId\n },\n {\n param: \"administrative_contact\",\n value: request.administrativeContact !== void 0 ? marshalNewContact(request.administrativeContact) : void 0\n }\n ]),\n ...marshalling.resolveOneOf([\n { param: \"technical_contact_id\", value: request.technicalContactId },\n {\n param: \"technical_contact\",\n value: request.technicalContact !== void 0 ? marshalNewContact(request.technicalContact) : void 0\n }\n ])\n});\nconst marshalUpdateContactRequestQuestion = (request, defaults) => ({\n answer: request.answer,\n question: request.question\n});\nconst marshalRegistrarApiUpdateContactRequest = (request, defaults) => ({\n address_line_1: request.addressLine1,\n address_line_2: request.addressLine2,\n city: request.city,\n company_identification_code: request.companyIdentificationCode,\n country: request.country,\n email: request.email,\n email_alt: request.emailAlt,\n extension_eu: request.extensionEu !== void 0 ? marshalContactExtensionEU(request.extensionEu) : void 0,\n extension_fr: request.extensionFr !== void 0 ? marshalContactExtensionFR(request.extensionFr) : void 0,\n extension_nl: request.extensionNl !== void 0 ? marshalContactExtensionNL(request.extensionNl) : void 0,\n fax_number: request.faxNumber,\n lang: request.lang,\n phone_number: request.phoneNumber,\n questions: request.questions !== void 0 ? request.questions.map(\n (elt) => marshalUpdateContactRequestQuestion(elt)\n ) : void 0,\n resale: request.resale,\n state: request.state,\n vat_identification_code: request.vatIdentificationCode,\n whois_opt_in: request.whoisOptIn,\n zip: request.zip\n});\nconst marshalRegistrarApiUpdateDomainHostRequest = (request, defaults) => ({\n ips: request.ips\n});\nconst marshalRegistrarApiUpdateDomainRequest = (request, defaults) => ({\n ...marshalling.resolveOneOf([\n { param: \"technical_contact_id\", value: request.technicalContactId },\n {\n param: \"technical_contact\",\n value: request.technicalContact !== void 0 ? marshalNewContact(request.technicalContact) : void 0\n }\n ]),\n ...marshalling.resolveOneOf([\n { param: \"owner_contact_id\", value: request.ownerContactId },\n {\n param: \"owner_contact\",\n value: request.ownerContact !== void 0 ? marshalNewContact(request.ownerContact) : void 0\n }\n ]),\n ...marshalling.resolveOneOf([\n {\n param: \"administrative_contact_id\",\n value: request.administrativeContactId\n },\n {\n param: \"administrative_contact\",\n value: request.administrativeContact !== void 0 ? marshalNewContact(request.administrativeContact) : void 0\n }\n ])\n});\nconst marshalNameserver = (request, defaults) => ({\n ip: request.ip,\n name: request.name\n});\nconst marshalUpdateDNSZoneNameserversRequest = (request, defaults) => ({\n ns: request.ns.map((elt) => marshalNameserver(elt))\n});\nconst marshalDomainRecordGeoIPConfigMatch = (request, defaults) => ({\n continents: request.continents,\n countries: request.countries,\n data: request.data\n});\nconst marshalDomainRecordViewConfigView = (request, defaults) => ({\n data: request.data,\n subnet: request.subnet\n});\nconst marshalDomainRecordWeightedConfigWeightedIP = (request, defaults) => ({\n ip: request.ip,\n weight: request.weight\n});\nconst marshalDomainRecordGeoIPConfig = (request, defaults) => ({\n default: request.default,\n matches: request.matches.map(\n (elt) => marshalDomainRecordGeoIPConfigMatch(elt)\n )\n});\nconst marshalDomainRecordHTTPServiceConfig = (request, defaults) => ({\n ips: request.ips,\n must_contain: request.mustContain,\n strategy: request.strategy,\n url: request.url,\n user_agent: request.userAgent\n});\nconst marshalDomainRecordViewConfig = (request, defaults) => ({\n views: request.views.map(\n (elt) => marshalDomainRecordViewConfigView(elt)\n )\n});\nconst marshalDomainRecordWeightedConfig = (request, defaults) => ({\n weighted_ips: request.weightedIps.map(\n (elt) => marshalDomainRecordWeightedConfigWeightedIP(elt)\n )\n});\nconst marshalDomainRecord = (request, defaults) => ({\n comment: request.comment,\n data: request.data,\n id: request.id,\n name: request.name,\n priority: request.priority,\n ttl: request.ttl,\n type: request.type,\n ...marshalling.resolveOneOf([\n {\n param: \"geo_ip_config\",\n value: request.geoIpConfig !== void 0 ? marshalDomainRecordGeoIPConfig(request.geoIpConfig) : void 0\n },\n {\n param: \"http_service_config\",\n value: request.httpServiceConfig !== void 0 ? marshalDomainRecordHTTPServiceConfig(\n request.httpServiceConfig\n ) : void 0\n },\n {\n param: \"weighted_config\",\n value: request.weightedConfig !== void 0 ? marshalDomainRecordWeightedConfig(request.weightedConfig) : void 0\n },\n {\n param: \"view_config\",\n value: request.viewConfig !== void 0 ? marshalDomainRecordViewConfig(request.viewConfig) : void 0\n }\n ])\n});\nconst marshalRecordIdentifier = (request, defaults) => ({\n data: request.data,\n name: request.name,\n ttl: request.ttl,\n type: request.type\n});\nconst marshalRecordChangeAdd = (request, defaults) => ({\n records: request.records.map((elt) => marshalDomainRecord(elt))\n});\nconst marshalRecordChangeClear = (request, defaults) => ({});\nconst marshalRecordChangeDelete = (request, defaults) => ({\n ...marshalling.resolveOneOf([\n { param: \"id\", value: request.id },\n {\n param: \"id_fields\",\n value: request.idFields !== void 0 ? marshalRecordIdentifier(request.idFields) : void 0\n }\n ])\n});\nconst marshalRecordChangeSet = (request, defaults) => ({\n records: request.records.map((elt) => marshalDomainRecord(elt)),\n ...marshalling.resolveOneOf([\n { param: \"id\", value: request.id },\n {\n param: \"id_fields\",\n value: request.idFields !== void 0 ? marshalRecordIdentifier(request.idFields) : void 0\n }\n ])\n});\nconst marshalRecordChange = (request, defaults) => ({\n ...marshalling.resolveOneOf([\n {\n param: \"add\",\n value: request.add !== void 0 ? marshalRecordChangeAdd(request.add) : void 0\n },\n {\n param: \"set\",\n value: request.set !== void 0 ? marshalRecordChangeSet(request.set) : void 0\n },\n {\n param: \"delete\",\n value: request.delete !== void 0 ? marshalRecordChangeDelete(request.delete) : void 0\n },\n {\n param: \"clear\",\n value: request.clear !== void 0 ? marshalRecordChangeClear(request.clear) : void 0\n }\n ])\n});\nconst marshalUpdateDNSZoneRecordsRequest = (request, defaults) => ({\n changes: request.changes.map((elt) => marshalRecordChange(elt)),\n disallow_new_zone_creation: request.disallowNewZoneCreation,\n return_all_records: request.returnAllRecords,\n serial: request.serial\n});\nconst marshalUpdateDNSZoneRequest = (request, defaults) => ({\n new_dns_zone: request.newDnsZone,\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nexports.marshalCloneDNSZoneRequest = marshalCloneDNSZoneRequest;\nexports.marshalCreateDNSZoneRequest = marshalCreateDNSZoneRequest;\nexports.marshalCreateSSLCertificateRequest = marshalCreateSSLCertificateRequest;\nexports.marshalDSRecord = marshalDSRecord;\nexports.marshalImportProviderDNSZoneRequest = marshalImportProviderDNSZoneRequest;\nexports.marshalImportRawDNSZoneRequest = marshalImportRawDNSZoneRequest;\nexports.marshalRefreshDNSZoneRequest = marshalRefreshDNSZoneRequest;\nexports.marshalRegistrarApiBuyDomainsRequest = marshalRegistrarApiBuyDomainsRequest;\nexports.marshalRegistrarApiCheckContactsCompatibilityRequest = marshalRegistrarApiCheckContactsCompatibilityRequest;\nexports.marshalRegistrarApiCreateDomainHostRequest = marshalRegistrarApiCreateDomainHostRequest;\nexports.marshalRegistrarApiEnableDomainDNSSECRequest = marshalRegistrarApiEnableDomainDNSSECRequest;\nexports.marshalRegistrarApiRegisterExternalDomainRequest = marshalRegistrarApiRegisterExternalDomainRequest;\nexports.marshalRegistrarApiRenewDomainsRequest = marshalRegistrarApiRenewDomainsRequest;\nexports.marshalRegistrarApiTradeDomainRequest = marshalRegistrarApiTradeDomainRequest;\nexports.marshalRegistrarApiTransferInDomainRequest = marshalRegistrarApiTransferInDomainRequest;\nexports.marshalRegistrarApiUpdateContactRequest = marshalRegistrarApiUpdateContactRequest;\nexports.marshalRegistrarApiUpdateDomainHostRequest = marshalRegistrarApiUpdateDomainHostRequest;\nexports.marshalRegistrarApiUpdateDomainRequest = marshalRegistrarApiUpdateDomainRequest;\nexports.marshalUpdateDNSZoneNameserversRequest = marshalUpdateDNSZoneNameserversRequest;\nexports.marshalUpdateDNSZoneRecordsRequest = marshalUpdateDNSZoneRecordsRequest;\nexports.marshalUpdateDNSZoneRequest = marshalUpdateDNSZoneRequest;\nexports.unmarshalCheckContactsCompatibilityResponse = unmarshalCheckContactsCompatibilityResponse;\nexports.unmarshalClearDNSZoneRecordsResponse = unmarshalClearDNSZoneRecordsResponse;\nexports.unmarshalContact = unmarshalContact;\nexports.unmarshalDNSZone = unmarshalDNSZone;\nexports.unmarshalDSRecord = unmarshalDSRecord;\nexports.unmarshalDeleteDNSZoneResponse = unmarshalDeleteDNSZoneResponse;\nexports.unmarshalDeleteExternalDomainResponse = unmarshalDeleteExternalDomainResponse;\nexports.unmarshalDeleteSSLCertificateResponse = unmarshalDeleteSSLCertificateResponse;\nexports.unmarshalDomain = unmarshalDomain;\nexports.unmarshalGetDNSZoneTsigKeyResponse = unmarshalGetDNSZoneTsigKeyResponse;\nexports.unmarshalGetDNSZoneVersionDiffResponse = unmarshalGetDNSZoneVersionDiffResponse;\nexports.unmarshalGetDomainAuthCodeResponse = unmarshalGetDomainAuthCodeResponse;\nexports.unmarshalHost = unmarshalHost;\nexports.unmarshalImportProviderDNSZoneResponse = unmarshalImportProviderDNSZoneResponse;\nexports.unmarshalImportRawDNSZoneResponse = unmarshalImportRawDNSZoneResponse;\nexports.unmarshalListContactsResponse = unmarshalListContactsResponse;\nexports.unmarshalListDNSZoneNameserversResponse = unmarshalListDNSZoneNameserversResponse;\nexports.unmarshalListDNSZoneRecordsResponse = unmarshalListDNSZoneRecordsResponse;\nexports.unmarshalListDNSZoneVersionRecordsResponse = unmarshalListDNSZoneVersionRecordsResponse;\nexports.unmarshalListDNSZoneVersionsResponse = unmarshalListDNSZoneVersionsResponse;\nexports.unmarshalListDNSZonesResponse = unmarshalListDNSZonesResponse;\nexports.unmarshalListDomainHostsResponse = unmarshalListDomainHostsResponse;\nexports.unmarshalListDomainsResponse = unmarshalListDomainsResponse;\nexports.unmarshalListRenewableDomainsResponse = unmarshalListRenewableDomainsResponse;\nexports.unmarshalListSSLCertificatesResponse = unmarshalListSSLCertificatesResponse;\nexports.unmarshalListTasksResponse = unmarshalListTasksResponse;\nexports.unmarshalListTldsResponse = unmarshalListTldsResponse;\nexports.unmarshalOrderResponse = unmarshalOrderResponse;\nexports.unmarshalRefreshDNSZoneResponse = unmarshalRefreshDNSZoneResponse;\nexports.unmarshalRegisterExternalDomainResponse = unmarshalRegisterExternalDomainResponse;\nexports.unmarshalRestoreDNSZoneVersionResponse = unmarshalRestoreDNSZoneVersionResponse;\nexports.unmarshalSSLCertificate = unmarshalSSLCertificate;\nexports.unmarshalSearchAvailableDomainsResponse = unmarshalSearchAvailableDomainsResponse;\nexports.unmarshalTask = unmarshalTask;\nexports.unmarshalUpdateDNSZoneNameserversResponse = unmarshalUpdateDNSZoneNameserversResponse;\nexports.unmarshalUpdateDNSZoneRecordsResponse = unmarshalUpdateDNSZoneRecordsResponse;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst index_gen = require(\"./v1alpha1/index.gen.cjs\");\nexports.v1alpha1 = index_gen;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst intervalRetrier = require(\"../../../internal/async/interval-retrier.cjs\");\nconst api = require(\"../../../scw/api.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst resourcePaginator = require(\"../../../scw/fetch/resource-paginator.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nconst marshalling_gen = require(\"./marshalling.gen.cjs\");\nconst jsonContentHeaders = {\n \"Content-Type\": \"application/json; charset=utf-8\"\n};\nclass API extends api.API {\n pageOfListPipelines = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/edge-services/v1alpha1/pipelines`,\n urlParams: marshalling.urlParams(\n [\"has_backend_stage_lb\", request.hasBackendStageLb],\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId]\n )\n },\n marshalling_gen.unmarshalListPipelinesResponse\n );\n /**\n * List pipelines. List all pipelines, for a Scaleway Organization or Scaleway\n * Project. By default, the pipelines returned in the list are ordered by\n * creation date in ascending order, though this can be modified via the\n * `order_by` field.\n *\n * @param request - The request {@link ListPipelinesRequest}\n * @returns A Promise of ListPipelinesResponse\n */\n listPipelines = (request = {}) => resourcePaginator.enrichForPagination(\"pipelines\", this.pageOfListPipelines, request);\n /**\n * Create pipeline. Create a new pipeline. You must specify a `dns_stage_id`\n * to form a stage-chain that goes all the way to the backend stage (origin),\n * so the HTTP request will be processed according to the stages you created.\n *\n * @param request - The request {@link CreatePipelineRequest}\n * @returns A Promise of Pipeline\n */\n createPipeline = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreatePipelineRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/edge-services/v1alpha1/pipelines`\n },\n marshalling_gen.unmarshalPipeline\n );\n /**\n * Get pipeline. Retrieve information about an existing pipeline, specified by\n * its `pipeline_id`. Its full details, including errors, are returned in the\n * response object.\n *\n * @param request - The request {@link GetPipelineRequest}\n * @returns A Promise of Pipeline\n */\n getPipeline = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/edge-services/v1alpha1/pipelines/${marshalling.validatePathParam(\"pipelineId\", request.pipelineId)}`\n },\n marshalling_gen.unmarshalPipeline\n );\n /**\n * Waits for {@link Pipeline} to be in a final state.\n *\n * @param request - The request {@link GetPipelineRequest}\n * @param options - The waiting options\n * @returns A Promise of Pipeline\n */\n waitForPipeline = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(!content_gen.PIPELINE_TRANSIENT_STATUSES.includes(res.status))),\n this.getPipeline,\n request,\n options\n );\n /**\n * Update pipeline. Update the parameters of an existing pipeline, specified\n * by its `pipeline_id`. Parameters which can be updated include the `name`,\n * `description` and `dns_stage_id`.\n *\n * @param request - The request {@link UpdatePipelineRequest}\n * @returns A Promise of Pipeline\n */\n updatePipeline = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdatePipelineRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/edge-services/v1alpha1/pipelines/${marshalling.validatePathParam(\"pipelineId\", request.pipelineId)}`\n },\n marshalling_gen.unmarshalPipeline\n );\n /**\n * Delete pipeline. Delete an existing pipeline, specified by its\n * `pipeline_id`. Deleting a pipeline is permanent, and cannot be undone. Note\n * that all stages linked to the pipeline are also deleted.\n *\n * @param request - The request {@link DeletePipelineRequest}\n */\n deletePipeline = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/edge-services/v1alpha1/pipelines/${marshalling.validatePathParam(\"pipelineId\", request.pipelineId)}`\n });\n pageOfListDNSStages = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/edge-services/v1alpha1/dns-stages`,\n urlParams: marshalling.urlParams(\n [\"fqdn\", request.fqdn],\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"pipeline_id\", request.pipelineId],\n [\"project_id\", request.projectId]\n )\n },\n marshalling_gen.unmarshalListDNSStagesResponse\n );\n /**\n * List DNS stages. List all DNS stages, for a Scaleway Organization or\n * Scaleway Project. By default, the DNS stages returned in the list are\n * ordered by creation date in ascending order, though this can be modified\n * via the `order_by` field.\n *\n * @param request - The request {@link ListDNSStagesRequest}\n * @returns A Promise of ListDNSStagesResponse\n */\n listDNSStages = (request = {}) => resourcePaginator.enrichForPagination(\"stages\", this.pageOfListDNSStages, request);\n /**\n * Create DNS stage. Create a new DNS stage. You must specify the `fqdns`\n * field to customize the domain endpoint, using a domain you already own.\n *\n * @param request - The request {@link CreateDNSStageRequest}\n * @returns A Promise of DNSStage\n */\n createDNSStage = (request = {}) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateDNSStageRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/edge-services/v1alpha1/dns-stages`\n },\n marshalling_gen.unmarshalDNSStage\n );\n /**\n * Get DNS stage. Retrieve information about an existing DNS stage, specified\n * by its `dns_stage_id`. Its full details, including FQDNs, are returned in\n * the response object.\n *\n * @param request - The request {@link GetDNSStageRequest}\n * @returns A Promise of DNSStage\n */\n getDNSStage = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/edge-services/v1alpha1/dns-stages/${marshalling.validatePathParam(\"dnsStageId\", request.dnsStageId)}`\n },\n marshalling_gen.unmarshalDNSStage\n );\n /**\n * Update DNS stage. Update the parameters of an existing DNS stage, specified\n * by its `dns_stage_id`.\n *\n * @param request - The request {@link UpdateDNSStageRequest}\n * @returns A Promise of DNSStage\n */\n updateDNSStage = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateDNSStageRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/edge-services/v1alpha1/dns-stages/${marshalling.validatePathParam(\"dnsStageId\", request.dnsStageId)}`\n },\n marshalling_gen.unmarshalDNSStage\n );\n /**\n * Delete DNS stage. Delete an existing DNS stage, specified by its\n * `dns_stage_id`. Deleting a DNS stage is permanent, and cannot be undone.\n *\n * @param request - The request {@link DeleteDNSStageRequest}\n */\n deleteDNSStage = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/edge-services/v1alpha1/dns-stages/${marshalling.validatePathParam(\"dnsStageId\", request.dnsStageId)}`\n });\n pageOfListTLSStages = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/edge-services/v1alpha1/tls-stages`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"pipeline_id\", request.pipelineId],\n [\"project_id\", request.projectId],\n [\"secret_id\", request.secretId],\n [\"secret_region\", request.secretRegion]\n )\n },\n marshalling_gen.unmarshalListTLSStagesResponse\n );\n /**\n * List TLS stages. List all TLS stages, for a Scaleway Organization or\n * Scaleway Project. By default, the TLS stages returned in the list are\n * ordered by creation date in ascending order, though this can be modified\n * via the `order_by` field.\n *\n * @param request - The request {@link ListTLSStagesRequest}\n * @returns A Promise of ListTLSStagesResponse\n */\n listTLSStages = (request = {}) => resourcePaginator.enrichForPagination(\"stages\", this.pageOfListTLSStages, request);\n /**\n * Create TLS stage. Create a new TLS stage. You must specify either the\n * `secrets` or `managed_certificate` fields to customize the SSL/TLS\n * certificate of your endpoint. Choose `secrets` if you are using a\n * pre-existing certificate held in Scaleway Secret Manager, or\n * `managed_certificate` to let Scaleway generate and manage a Let's Encrypt\n * certificate for your customized endpoint.\n *\n * @param request - The request {@link CreateTLSStageRequest}\n * @returns A Promise of TLSStage\n */\n createTLSStage = (request = {}) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateTLSStageRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/edge-services/v1alpha1/tls-stages`\n },\n marshalling_gen.unmarshalTLSStage\n );\n /**\n * Get TLS stage. Retrieve information about an existing TLS stage, specified\n * by its `tls_stage_id`. Its full details, including secrets and certificate\n * expiration date are returned in the response object.\n *\n * @param request - The request {@link GetTLSStageRequest}\n * @returns A Promise of TLSStage\n */\n getTLSStage = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/edge-services/v1alpha1/tls-stages/${marshalling.validatePathParam(\"tlsStageId\", request.tlsStageId)}`\n },\n marshalling_gen.unmarshalTLSStage\n );\n /**\n * Update TLS stage. Update the parameters of an existing TLS stage, specified\n * by its `tls_stage_id`. Both `tls_secrets_config` and `managed_certificate`\n * parameters can be updated.\n *\n * @param request - The request {@link UpdateTLSStageRequest}\n * @returns A Promise of TLSStage\n */\n updateTLSStage = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateTLSStageRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/edge-services/v1alpha1/tls-stages/${marshalling.validatePathParam(\"tlsStageId\", request.tlsStageId)}`\n },\n marshalling_gen.unmarshalTLSStage\n );\n /**\n * Delete TLS stage. Delete an existing TLS stage, specified by its\n * `tls_stage_id`. Deleting a TLS stage is permanent, and cannot be undone.\n *\n * @param request - The request {@link DeleteTLSStageRequest}\n */\n deleteTLSStage = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/edge-services/v1alpha1/tls-stages/${marshalling.validatePathParam(\"tlsStageId\", request.tlsStageId)}`\n });\n pageOfListCacheStages = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/edge-services/v1alpha1/cache-stages`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"pipeline_id\", request.pipelineId],\n [\"project_id\", request.projectId]\n )\n },\n marshalling_gen.unmarshalListCacheStagesResponse\n );\n /**\n * List cache stages. List all cache stages, for a Scaleway Organization or\n * Scaleway Project. By default, the cache stages returned in the list are\n * ordered by creation date in ascending order, though this can be modified\n * via the `order_by` field.\n *\n * @param request - The request {@link ListCacheStagesRequest}\n * @returns A Promise of ListCacheStagesResponse\n */\n listCacheStages = (request = {}) => resourcePaginator.enrichForPagination(\"stages\", this.pageOfListCacheStages, request);\n /**\n * Create cache stage. Create a new cache stage. You must specify the\n * `fallback_ttl` field to customize the TTL of the cache.\n *\n * @param request - The request {@link CreateCacheStageRequest}\n * @returns A Promise of CacheStage\n */\n createCacheStage = (request = {}) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateCacheStageRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/edge-services/v1alpha1/cache-stages`\n },\n marshalling_gen.unmarshalCacheStage\n );\n /**\n * Get cache stage. Retrieve information about an existing cache stage,\n * specified by its `cache_stage_id`. Its full details, including Time To Live\n * (TTL), are returned in the response object.\n *\n * @param request - The request {@link GetCacheStageRequest}\n * @returns A Promise of CacheStage\n */\n getCacheStage = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/edge-services/v1alpha1/cache-stages/${marshalling.validatePathParam(\"cacheStageId\", request.cacheStageId)}`\n },\n marshalling_gen.unmarshalCacheStage\n );\n /**\n * Update cache stage. Update the parameters of an existing cache stage,\n * specified by its `cache_stage_id`. Parameters which can be updated include\n * the `fallback_ttl` and `backend_stage_id`.\n *\n * @param request - The request {@link UpdateCacheStageRequest}\n * @returns A Promise of CacheStage\n */\n updateCacheStage = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateCacheStageRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/edge-services/v1alpha1/cache-stages/${marshalling.validatePathParam(\"cacheStageId\", request.cacheStageId)}`\n },\n marshalling_gen.unmarshalCacheStage\n );\n /**\n * Delete cache stage. Delete an existing cache stage, specified by its\n * `cache_stage_id`. Deleting a cache stage is permanent, and cannot be\n * undone.\n *\n * @param request - The request {@link DeleteCacheStageRequest}\n */\n deleteCacheStage = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/edge-services/v1alpha1/cache-stages/${marshalling.validatePathParam(\"cacheStageId\", request.cacheStageId)}`\n });\n pageOfListBackendStages = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/edge-services/v1alpha1/backend-stages`,\n urlParams: marshalling.urlParams(\n [\"bucket_name\", request.bucketName],\n [\"bucket_region\", request.bucketRegion],\n [\"lb_id\", request.lbId],\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"pipeline_id\", request.pipelineId],\n [\"project_id\", request.projectId]\n )\n },\n marshalling_gen.unmarshalListBackendStagesResponse\n );\n /**\n * List backend stages. List all backend stages, for a Scaleway Organization\n * or Scaleway Project. By default, the backend stages returned in the list\n * are ordered by creation date in ascending order, though this can be\n * modified via the `order_by` field.\n *\n * @param request - The request {@link ListBackendStagesRequest}\n * @returns A Promise of ListBackendStagesResponse\n */\n listBackendStages = (request = {}) => resourcePaginator.enrichForPagination(\"stages\", this.pageOfListBackendStages, request);\n /**\n * Create backend stage. Create a new backend stage. You must specify either a\n * `scaleway_s3` (for a Scaleway Object Storage bucket) or `scaleway_lb` (for\n * a Scaleway Load Balancer) field to configure the origin.\n *\n * @param request - The request {@link CreateBackendStageRequest}\n * @returns A Promise of BackendStage\n */\n createBackendStage = (request = {}) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateBackendStageRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/edge-services/v1alpha1/backend-stages`\n },\n marshalling_gen.unmarshalBackendStage\n );\n /**\n * Get backend stage. Retrieve information about an existing backend stage,\n * specified by its `backend_stage_id`. Its full details, including\n * `scaleway_s3` or `scaleway_lb`, are returned in the response object.\n *\n * @param request - The request {@link GetBackendStageRequest}\n * @returns A Promise of BackendStage\n */\n getBackendStage = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/edge-services/v1alpha1/backend-stages/${marshalling.validatePathParam(\"backendStageId\", request.backendStageId)}`\n },\n marshalling_gen.unmarshalBackendStage\n );\n /**\n * Update backend stage. Update the parameters of an existing backend stage,\n * specified by its `backend_stage_id`.\n *\n * @param request - The request {@link UpdateBackendStageRequest}\n * @returns A Promise of BackendStage\n */\n updateBackendStage = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateBackendStageRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/edge-services/v1alpha1/backend-stages/${marshalling.validatePathParam(\"backendStageId\", request.backendStageId)}`\n },\n marshalling_gen.unmarshalBackendStage\n );\n /**\n * Delete backend stage. Delete an existing backend stage, specified by its\n * `backend_stage_id`. Deleting a backend stage is permanent, and cannot be\n * undone.\n *\n * @param request - The request {@link DeleteBackendStageRequest}\n */\n deleteBackendStage = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/edge-services/v1alpha1/backend-stages/${marshalling.validatePathParam(\"backendStageId\", request.backendStageId)}`\n });\n checkDomain = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCheckDomainRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/edge-services/v1alpha1/check-domain`\n },\n marshalling_gen.unmarshalCheckDomainResponse\n );\n checkPEMChain = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCheckPEMChainRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/edge-services/v1alpha1/check-pem-chain`\n },\n marshalling_gen.unmarshalCheckPEMChainResponse\n );\n pageOfListPurgeRequests = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/edge-services/v1alpha1/purge-requests`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"pipeline_id\", request.pipelineId],\n [\"project_id\", request.projectId]\n )\n },\n marshalling_gen.unmarshalListPurgeRequestsResponse\n );\n /**\n * List purge requests. List all purge requests, for a Scaleway Organization\n * or Scaleway Project. This enables you to retrieve a history of all\n * previously-made purge requests. By default, the purge requests returned in\n * the list are ordered by creation date in ascending order, though this can\n * be modified via the `order_by` field.\n *\n * @param request - The request {@link ListPurgeRequestsRequest}\n * @returns A Promise of ListPurgeRequestsResponse\n */\n listPurgeRequests = (request = {}) => resourcePaginator.enrichForPagination(\"purgeRequests\", this.pageOfListPurgeRequests, request);\n /**\n * Create purge request. Create a new purge request. You must specify either\n * the `all` field (to purge all content) or a list of `assets` (to define the\n * precise assets to purge).\n *\n * @param request - The request {@link CreatePurgeRequestRequest}\n * @returns A Promise of PurgeRequest\n */\n createPurgeRequest = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreatePurgeRequestRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/edge-services/v1alpha1/purge-requests`\n },\n marshalling_gen.unmarshalPurgeRequest\n );\n /**\n * Get purge request. Retrieve information about a purge request, specified by\n * its `purge_request_id`. Its full details, including `status` and `target`,\n * are returned in the response object.\n *\n * @param request - The request {@link GetPurgeRequestRequest}\n * @returns A Promise of PurgeRequest\n */\n getPurgeRequest = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/edge-services/v1alpha1/purge-requests/${marshalling.validatePathParam(\"purgeRequestId\", request.purgeRequestId)}`\n },\n marshalling_gen.unmarshalPurgeRequest\n );\n /**\n * Waits for {@link PurgeRequest} to be in a final state.\n *\n * @param request - The request {@link GetPurgeRequestRequest}\n * @param options - The waiting options\n * @returns A Promise of PurgeRequest\n */\n waitForPurgeRequest = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(\n !content_gen.PURGE_REQUEST_TRANSIENT_STATUSES.includes(res.status)\n )),\n this.getPurgeRequest,\n request,\n options\n );\n checkLbOrigin = (request = {}) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCheckLbOriginRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/edge-services/v1alpha1/check-lb-origin`\n },\n marshalling_gen.unmarshalCheckLbOriginResponse\n );\n listPlans = () => this.client.fetch(\n {\n method: \"GET\",\n path: `/edge-services/v1alpha1/plans`\n },\n marshalling_gen.unmarshalListPlansResponse\n );\n selectPlan = (request = {}) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalSelectPlanRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/edge-services/v1alpha1/current-plan`\n },\n marshalling_gen.unmarshalPlan\n );\n getCurrentPlan = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/edge-services/v1alpha1/current-plan/${marshalling.validatePathParam(\"projectId\", request.projectId ?? this.client.settings.defaultProjectId)}`\n },\n marshalling_gen.unmarshalPlan\n );\n deleteCurrentPlan = (request = {}) => this.client.fetch({\n method: \"DELETE\",\n path: `/edge-services/v1alpha1/current-plan/${marshalling.validatePathParam(\"projectId\", request.projectId ?? this.client.settings.defaultProjectId)}`\n });\n}\nexports.API = API;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst PIPELINE_TRANSIENT_STATUSES = [\"pending\"];\nconst PURGE_REQUEST_TRANSIENT_STATUSES = [\n \"pending\"\n];\nexports.PIPELINE_TRANSIENT_STATUSES = PIPELINE_TRANSIENT_STATUSES;\nexports.PURGE_REQUEST_TRANSIENT_STATUSES = PURGE_REQUEST_TRANSIENT_STATUSES;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api_gen = require(\"./api.gen.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nexports.API = api_gen.API;\nexports.PIPELINE_TRANSIENT_STATUSES = content_gen.PIPELINE_TRANSIENT_STATUSES;\nexports.PURGE_REQUEST_TRANSIENT_STATUSES = content_gen.PURGE_REQUEST_TRANSIENT_STATUSES;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst json = require(\"../../../helpers/json.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst unmarshalScalewayLb = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ScalewayLb' failed as data isn't a dictionary.`\n );\n }\n return {\n domainName: data.domain_name,\n frontendId: data.frontend_id,\n id: data.id,\n isSsl: data.is_ssl,\n zone: data.zone\n };\n};\nconst unmarshalScalewayLbBackendConfig = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ScalewayLbBackendConfig' failed as data isn't a dictionary.`\n );\n }\n return {\n lbs: marshalling.unmarshalArrayOfObject(data.lbs, unmarshalScalewayLb)\n };\n};\nconst unmarshalScalewayS3BackendConfig = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ScalewayS3BackendConfig' failed as data isn't a dictionary.`\n );\n }\n return {\n bucketName: data.bucket_name,\n bucketRegion: data.bucket_region,\n isWebsite: data.is_website\n };\n};\nconst unmarshalBackendStage = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'BackendStage' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n id: data.id,\n pipelineId: data.pipeline_id,\n projectId: data.project_id,\n scalewayLb: data.scaleway_lb ? unmarshalScalewayLbBackendConfig(data.scaleway_lb) : void 0,\n scalewayS3: data.scaleway_s3 ? unmarshalScalewayS3BackendConfig(data.scaleway_s3) : void 0,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalCacheStage = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'CacheStage' failed as data isn't a dictionary.`\n );\n }\n return {\n backendStageId: data.backend_stage_id,\n createdAt: marshalling.unmarshalDate(data.created_at),\n fallbackTtl: data.fallback_ttl,\n id: data.id,\n pipelineId: data.pipeline_id,\n projectId: data.project_id,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalDNSStage = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DNSStage' failed as data isn't a dictionary.`\n );\n }\n return {\n backendStageId: data.backend_stage_id,\n cacheStageId: data.cache_stage_id,\n createdAt: marshalling.unmarshalDate(data.created_at),\n fqdns: data.fqdns,\n id: data.id,\n pipelineId: data.pipeline_id,\n projectId: data.project_id,\n tlsStageId: data.tls_stage_id,\n type: data.type,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalPipelineError = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'PipelineError' failed as data isn't a dictionary.`\n );\n }\n return {\n code: data.code,\n message: data.message,\n severity: data.severity,\n stage: data.stage,\n type: data.type\n };\n};\nconst unmarshalPipeline = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Pipeline' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n description: data.description,\n dnsStageId: data.dns_stage_id,\n errors: marshalling.unmarshalArrayOfObject(data.errors, unmarshalPipelineError),\n id: data.id,\n name: data.name,\n projectId: data.project_id,\n status: data.status,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalTLSSecret = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'TLSSecret' failed as data isn't a dictionary.`\n );\n }\n return {\n region: data.region,\n secretId: data.secret_id\n };\n};\nconst unmarshalTLSStage = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'TLSStage' failed as data isn't a dictionary.`\n );\n }\n return {\n backendStageId: data.backend_stage_id,\n cacheStageId: data.cache_stage_id,\n certificateExpiresAt: marshalling.unmarshalDate(data.certificate_expires_at),\n createdAt: marshalling.unmarshalDate(data.created_at),\n id: data.id,\n managedCertificate: data.managed_certificate,\n pipelineId: data.pipeline_id,\n projectId: data.project_id,\n secrets: marshalling.unmarshalArrayOfObject(data.secrets, unmarshalTLSSecret),\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalPurgeRequest = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'PurgeRequest' failed as data isn't a dictionary.`\n );\n }\n return {\n all: data.all,\n assets: data.assets,\n createdAt: marshalling.unmarshalDate(data.created_at),\n id: data.id,\n pipelineId: data.pipeline_id,\n status: data.status,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalCheckDomainResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'CheckDomainResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n isValid: data.is_valid\n };\n};\nconst unmarshalCheckLbOriginResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'CheckLbOriginResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n errorType: data.error_type,\n isValid: data.is_valid\n };\n};\nconst unmarshalCheckPEMChainResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'CheckPEMChainResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n isValid: data.is_valid\n };\n};\nconst unmarshalListBackendStagesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListBackendStagesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n stages: marshalling.unmarshalArrayOfObject(data.stages, unmarshalBackendStage),\n totalCount: data.total_count\n };\n};\nconst unmarshalListCacheStagesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListCacheStagesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n stages: marshalling.unmarshalArrayOfObject(data.stages, unmarshalCacheStage),\n totalCount: data.total_count\n };\n};\nconst unmarshalListDNSStagesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListDNSStagesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n stages: marshalling.unmarshalArrayOfObject(data.stages, unmarshalDNSStage),\n totalCount: data.total_count\n };\n};\nconst unmarshalListPipelinesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListPipelinesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n pipelines: marshalling.unmarshalArrayOfObject(data.pipelines, unmarshalPipeline),\n totalCount: data.total_count\n };\n};\nconst unmarshalPlanDetails = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'PlanDetails' failed as data isn't a dictionary.`\n );\n }\n return {\n packageGb: data.package_gb,\n pipelineLimit: data.pipeline_limit,\n planName: data.plan_name\n };\n};\nconst unmarshalListPlansResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListPlansResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n plans: marshalling.unmarshalArrayOfObject(data.plans, unmarshalPlanDetails),\n totalCount: data.total_count\n };\n};\nconst unmarshalListPurgeRequestsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListPurgeRequestsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n purgeRequests: marshalling.unmarshalArrayOfObject(\n data.purge_requests,\n unmarshalPurgeRequest\n ),\n totalCount: data.total_count\n };\n};\nconst unmarshalListTLSStagesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListTLSStagesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n stages: marshalling.unmarshalArrayOfObject(data.stages, unmarshalTLSStage),\n totalCount: data.total_count\n };\n};\nconst unmarshalPlan = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Plan' failed as data isn't a dictionary.`\n );\n }\n return {\n planName: data.plan_name\n };\n};\nconst marshalCheckDomainRequest = (request, defaults) => ({\n cname: request.cname,\n fqdn: request.fqdn,\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalScalewayLb = (request, defaults) => ({\n domain_name: request.domainName,\n frontend_id: request.frontendId,\n id: request.id,\n is_ssl: request.isSsl,\n zone: request.zone\n});\nconst marshalCheckLbOriginRequest = (request, defaults) => ({\n lb: request.lb !== void 0 ? marshalScalewayLb(request.lb) : void 0\n});\nconst marshalCheckPEMChainRequestSecretChain = (request, defaults) => ({\n secret_id: request.secretId,\n secret_region: request.secretRegion\n});\nconst marshalCheckPEMChainRequest = (request, defaults) => ({\n fqdn: request.fqdn,\n project_id: request.projectId ?? defaults.defaultProjectId,\n ...marshalling.resolveOneOf([\n {\n param: \"secret\",\n value: request.secret !== void 0 ? marshalCheckPEMChainRequestSecretChain(request.secret) : void 0\n },\n { param: \"raw\", value: request.raw }\n ])\n});\nconst marshalScalewayLbBackendConfig = (request, defaults) => ({\n lbs: request.lbs.map((elt) => marshalScalewayLb(elt))\n});\nconst marshalScalewayS3BackendConfig = (request, defaults) => ({\n bucket_name: request.bucketName,\n bucket_region: request.bucketRegion,\n is_website: request.isWebsite\n});\nconst marshalCreateBackendStageRequest = (request, defaults) => ({\n project_id: request.projectId ?? defaults.defaultProjectId,\n ...marshalling.resolveOneOf([\n {\n param: \"scaleway_s3\",\n value: request.scalewayS3 !== void 0 ? marshalScalewayS3BackendConfig(request.scalewayS3) : void 0\n },\n {\n param: \"scaleway_lb\",\n value: request.scalewayLb !== void 0 ? marshalScalewayLbBackendConfig(request.scalewayLb) : void 0\n }\n ])\n});\nconst marshalCreateCacheStageRequest = (request, defaults) => ({\n fallback_ttl: request.fallbackTtl,\n project_id: request.projectId ?? defaults.defaultProjectId,\n ...marshalling.resolveOneOf([\n { param: \"backend_stage_id\", value: request.backendStageId }\n ])\n});\nconst marshalCreateDNSStageRequest = (request, defaults) => ({\n fqdns: request.fqdns,\n project_id: request.projectId ?? defaults.defaultProjectId,\n ...marshalling.resolveOneOf([\n { param: \"tls_stage_id\", value: request.tlsStageId },\n { param: \"cache_stage_id\", value: request.cacheStageId },\n { param: \"backend_stage_id\", value: request.backendStageId }\n ])\n});\nconst marshalCreatePipelineRequest = (request, defaults) => ({\n description: request.description,\n name: request.name,\n project_id: request.projectId ?? defaults.defaultProjectId,\n ...marshalling.resolveOneOf([{ param: \"dns_stage_id\", value: request.dnsStageId }])\n});\nconst marshalCreatePurgeRequestRequest = (request, defaults) => ({\n pipeline_id: request.pipelineId,\n ...marshalling.resolveOneOf([\n { param: \"assets\", value: request.assets },\n { param: \"all\", value: request.all }\n ])\n});\nconst marshalTLSSecret = (request, defaults) => ({\n region: request.region,\n secret_id: request.secretId\n});\nconst marshalCreateTLSStageRequest = (request, defaults) => ({\n managed_certificate: request.managedCertificate,\n project_id: request.projectId ?? defaults.defaultProjectId,\n secrets: request.secrets !== void 0 ? request.secrets.map((elt) => marshalTLSSecret(elt)) : void 0,\n ...marshalling.resolveOneOf([\n { param: \"cache_stage_id\", value: request.cacheStageId },\n { param: \"backend_stage_id\", value: request.backendStageId }\n ])\n});\nconst marshalSelectPlanRequest = (request, defaults) => ({\n plan_name: request.planName,\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalUpdateBackendStageRequest = (request, defaults) => ({\n ...marshalling.resolveOneOf([\n {\n param: \"scaleway_s3\",\n value: request.scalewayS3 !== void 0 ? marshalScalewayS3BackendConfig(request.scalewayS3) : void 0\n },\n {\n param: \"scaleway_lb\",\n value: request.scalewayLb !== void 0 ? marshalScalewayLbBackendConfig(request.scalewayLb) : void 0\n }\n ])\n});\nconst marshalUpdateCacheStageRequest = (request, defaults) => ({\n fallback_ttl: request.fallbackTtl,\n ...marshalling.resolveOneOf([\n { param: \"backend_stage_id\", value: request.backendStageId }\n ])\n});\nconst marshalUpdateDNSStageRequest = (request, defaults) => ({\n fqdns: request.fqdns,\n ...marshalling.resolveOneOf([\n { param: \"tls_stage_id\", value: request.tlsStageId },\n { param: \"cache_stage_id\", value: request.cacheStageId },\n { param: \"backend_stage_id\", value: request.backendStageId }\n ])\n});\nconst marshalUpdatePipelineRequest = (request, defaults) => ({\n description: request.description,\n name: request.name,\n ...marshalling.resolveOneOf([{ param: \"dns_stage_id\", value: request.dnsStageId }])\n});\nconst marshalTLSSecretsConfig = (request, defaults) => ({\n tls_secrets: request.tlsSecrets.map((elt) => marshalTLSSecret(elt))\n});\nconst marshalUpdateTLSStageRequest = (request, defaults) => ({\n managed_certificate: request.managedCertificate,\n tls_secrets_config: request.tlsSecretsConfig !== void 0 ? marshalTLSSecretsConfig(request.tlsSecretsConfig) : void 0,\n ...marshalling.resolveOneOf([\n { param: \"cache_stage_id\", value: request.cacheStageId },\n { param: \"backend_stage_id\", value: request.backendStageId }\n ])\n});\nexports.marshalCheckDomainRequest = marshalCheckDomainRequest;\nexports.marshalCheckLbOriginRequest = marshalCheckLbOriginRequest;\nexports.marshalCheckPEMChainRequest = marshalCheckPEMChainRequest;\nexports.marshalCreateBackendStageRequest = marshalCreateBackendStageRequest;\nexports.marshalCreateCacheStageRequest = marshalCreateCacheStageRequest;\nexports.marshalCreateDNSStageRequest = marshalCreateDNSStageRequest;\nexports.marshalCreatePipelineRequest = marshalCreatePipelineRequest;\nexports.marshalCreatePurgeRequestRequest = marshalCreatePurgeRequestRequest;\nexports.marshalCreateTLSStageRequest = marshalCreateTLSStageRequest;\nexports.marshalSelectPlanRequest = marshalSelectPlanRequest;\nexports.marshalUpdateBackendStageRequest = marshalUpdateBackendStageRequest;\nexports.marshalUpdateCacheStageRequest = marshalUpdateCacheStageRequest;\nexports.marshalUpdateDNSStageRequest = marshalUpdateDNSStageRequest;\nexports.marshalUpdatePipelineRequest = marshalUpdatePipelineRequest;\nexports.marshalUpdateTLSStageRequest = marshalUpdateTLSStageRequest;\nexports.unmarshalBackendStage = unmarshalBackendStage;\nexports.unmarshalCacheStage = unmarshalCacheStage;\nexports.unmarshalCheckDomainResponse = unmarshalCheckDomainResponse;\nexports.unmarshalCheckLbOriginResponse = unmarshalCheckLbOriginResponse;\nexports.unmarshalCheckPEMChainResponse = unmarshalCheckPEMChainResponse;\nexports.unmarshalDNSStage = unmarshalDNSStage;\nexports.unmarshalListBackendStagesResponse = unmarshalListBackendStagesResponse;\nexports.unmarshalListCacheStagesResponse = unmarshalListCacheStagesResponse;\nexports.unmarshalListDNSStagesResponse = unmarshalListDNSStagesResponse;\nexports.unmarshalListPipelinesResponse = unmarshalListPipelinesResponse;\nexports.unmarshalListPlansResponse = unmarshalListPlansResponse;\nexports.unmarshalListPurgeRequestsResponse = unmarshalListPurgeRequestsResponse;\nexports.unmarshalListTLSStagesResponse = unmarshalListTLSStagesResponse;\nexports.unmarshalPipeline = unmarshalPipeline;\nexports.unmarshalPlan = unmarshalPlan;\nexports.unmarshalPurgeRequest = unmarshalPurgeRequest;\nexports.unmarshalTLSStage = unmarshalTLSStage;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst index_gen = require(\"./v1alpha1/index.gen.cjs\");\nexports.v1alpha1 = index_gen;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst intervalRetrier = require(\"../../../internal/async/interval-retrier.cjs\");\nconst api = require(\"../../../scw/api.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst resourcePaginator = require(\"../../../scw/fetch/resource-paginator.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nconst marshalling_gen = require(\"./marshalling.gen.cjs\");\nconst jsonContentHeaders = {\n \"Content-Type\": \"application/json; charset=utf-8\"\n};\nclass API extends api.API {\n /** Lists the available zones of the API. */\n static LOCALITIES = [\n \"fr-par-1\",\n \"fr-par-2\",\n \"nl-ams-1\"\n ];\n /**\n * Create a new flexible IP. Generate a new flexible IP within a given zone,\n * specifying its configuration including Project ID and description.\n *\n * @param request - The request {@link CreateFlexibleIPRequest}\n * @returns A Promise of FlexibleIP\n */\n createFlexibleIP = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateFlexibleIPRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/flexible-ip/v1alpha1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/fips`\n },\n marshalling_gen.unmarshalFlexibleIP\n );\n /**\n * Get an existing flexible IP. Retrieve information about an existing\n * flexible IP, specified by its ID and zone. Its full details, including\n * Project ID, description and status, are returned in the response object.\n *\n * @param request - The request {@link GetFlexibleIPRequest}\n * @returns A Promise of FlexibleIP\n */\n getFlexibleIP = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/flexible-ip/v1alpha1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/fips/${marshalling.validatePathParam(\"fipId\", request.fipId)}`\n },\n marshalling_gen.unmarshalFlexibleIP\n );\n /**\n * Waits for {@link FlexibleIP} to be in a final state.\n *\n * @param request - The request {@link GetFlexibleIPRequest}\n * @param options - The waiting options\n * @returns A Promise of FlexibleIP\n */\n waitForFlexibleIP = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(\n !content_gen.FLEXIBLE_IP_TRANSIENT_STATUSES.includes(res.status)\n )),\n this.getFlexibleIP,\n request,\n options\n );\n pageOfListFlexibleIPs = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/flexible-ip/v1alpha1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/fips`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId],\n [\"server_ids\", request.serverIds],\n [\"status\", request.status],\n [\"tags\", request.tags]\n )\n },\n marshalling_gen.unmarshalListFlexibleIPsResponse\n );\n /**\n * List flexible IPs. List all flexible IPs within a given zone.\n *\n * @param request - The request {@link ListFlexibleIPsRequest}\n * @returns A Promise of ListFlexibleIPsResponse\n */\n listFlexibleIPs = (request = {}) => resourcePaginator.enrichForPagination(\"flexibleIps\", this.pageOfListFlexibleIPs, request);\n /**\n * Update an existing flexible IP. Update the parameters of an existing\n * flexible IP, specified by its ID and zone. These parameters include tags\n * and description.\n *\n * @param request - The request {@link UpdateFlexibleIPRequest}\n * @returns A Promise of FlexibleIP\n */\n updateFlexibleIP = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateFlexibleIPRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/flexible-ip/v1alpha1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/fips/${marshalling.validatePathParam(\"fipId\", request.fipId)}`\n },\n marshalling_gen.unmarshalFlexibleIP\n );\n /**\n * Delete an existing flexible IP. Delete an existing flexible IP, specified\n * by its ID and zone. Note that deleting a flexible IP is permanent and\n * cannot be undone.\n *\n * @param request - The request {@link DeleteFlexibleIPRequest}\n */\n deleteFlexibleIP = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/flexible-ip/v1alpha1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/fips/${marshalling.validatePathParam(\"fipId\", request.fipId)}`\n });\n /**\n * Attach an existing flexible IP to a server. Attach an existing flexible IP\n * to a specified Elastic Metal server.\n *\n * @param request - The request {@link AttachFlexibleIPRequest}\n * @returns A Promise of AttachFlexibleIPsResponse\n */\n attachFlexibleIP = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalAttachFlexibleIPRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/flexible-ip/v1alpha1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/fips/attach`\n },\n marshalling_gen.unmarshalAttachFlexibleIPsResponse\n );\n /**\n * Detach an existing flexible IP from a server. Detach an existing flexible\n * IP from a specified Elastic Metal server.\n *\n * @param request - The request {@link DetachFlexibleIPRequest}\n * @returns A Promise of DetachFlexibleIPsResponse\n */\n detachFlexibleIP = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalDetachFlexibleIPRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/flexible-ip/v1alpha1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/fips/detach`\n },\n marshalling_gen.unmarshalDetachFlexibleIPsResponse\n );\n /**\n * Generate a virtual MAC address on an existing flexible IP. Generate a\n * virtual MAC (Media Access Control) address on an existing flexible IP.\n *\n * @param request - The request {@link GenerateMACAddrRequest}\n * @returns A Promise of FlexibleIP\n */\n generateMACAddr = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalGenerateMACAddrRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/flexible-ip/v1alpha1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/fips/${marshalling.validatePathParam(\"fipId\", request.fipId)}/mac`\n },\n marshalling_gen.unmarshalFlexibleIP\n );\n /**\n * Duplicate a virtual MAC address to another flexible IP. Duplicate a virtual\n * MAC address from a given flexible IP to another flexible IP attached to the\n * same server.\n *\n * @param request - The request {@link DuplicateMACAddrRequest}\n * @returns A Promise of FlexibleIP\n */\n duplicateMACAddr = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalDuplicateMACAddrRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/flexible-ip/v1alpha1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/fips/${marshalling.validatePathParam(\"fipId\", request.fipId)}/mac/duplicate`\n },\n marshalling_gen.unmarshalFlexibleIP\n );\n /**\n * Relocate an existing virtual MAC address to a different flexible IP.\n * Relocate a virtual MAC (Media Access Control) address from an existing\n * flexible IP to a different flexible IP.\n *\n * @param request - The request {@link MoveMACAddrRequest}\n * @returns A Promise of FlexibleIP\n */\n moveMACAddr = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalMoveMACAddrRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/flexible-ip/v1alpha1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/fips/${marshalling.validatePathParam(\"fipId\", request.fipId)}/mac/move`\n },\n marshalling_gen.unmarshalFlexibleIP\n );\n /**\n * Detach a given virtual MAC address from an existing flexible IP. Detach a\n * given MAC (Media Access Control) address from an existing flexible IP.\n *\n * @param request - The request {@link DeleteMACAddrRequest}\n */\n deleteMACAddr = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/flexible-ip/v1alpha1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/fips/${marshalling.validatePathParam(\"fipId\", request.fipId)}/mac`\n });\n}\nexports.API = API;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst FLEXIBLE_IP_TRANSIENT_STATUSES = [\n \"updating\",\n \"detaching\"\n];\nconst MAC_ADDRESS_TRANSIENT_STATUSES = [\n \"updating\",\n \"deleting\"\n];\nexports.FLEXIBLE_IP_TRANSIENT_STATUSES = FLEXIBLE_IP_TRANSIENT_STATUSES;\nexports.MAC_ADDRESS_TRANSIENT_STATUSES = MAC_ADDRESS_TRANSIENT_STATUSES;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api_gen = require(\"./api.gen.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nconst validationRules_gen = require(\"./validation-rules.gen.cjs\");\nexports.API = api_gen.API;\nexports.FLEXIBLE_IP_TRANSIENT_STATUSES = content_gen.FLEXIBLE_IP_TRANSIENT_STATUSES;\nexports.MAC_ADDRESS_TRANSIENT_STATUSES = content_gen.MAC_ADDRESS_TRANSIENT_STATUSES;\nexports.ValidationRules = validationRules_gen;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst json = require(\"../../../helpers/json.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst unmarshalMACAddress = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'MACAddress' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n id: data.id,\n macAddress: data.mac_address,\n macType: data.mac_type,\n status: data.status,\n updatedAt: marshalling.unmarshalDate(data.updated_at),\n zone: data.zone\n };\n};\nconst unmarshalFlexibleIP = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'FlexibleIP' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n description: data.description,\n id: data.id,\n ipAddress: data.ip_address,\n macAddress: data.mac_address ? unmarshalMACAddress(data.mac_address) : void 0,\n organizationId: data.organization_id,\n projectId: data.project_id,\n reverse: data.reverse,\n serverId: data.server_id,\n status: data.status,\n tags: data.tags,\n updatedAt: marshalling.unmarshalDate(data.updated_at),\n zone: data.zone\n };\n};\nconst unmarshalAttachFlexibleIPsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'AttachFlexibleIPsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n flexibleIps: marshalling.unmarshalArrayOfObject(data.flexible_ips, unmarshalFlexibleIP),\n totalCount: data.total_count\n };\n};\nconst unmarshalDetachFlexibleIPsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DetachFlexibleIPsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n flexibleIps: marshalling.unmarshalArrayOfObject(data.flexible_ips, unmarshalFlexibleIP),\n totalCount: data.total_count\n };\n};\nconst unmarshalListFlexibleIPsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListFlexibleIPsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n flexibleIps: marshalling.unmarshalArrayOfObject(data.flexible_ips, unmarshalFlexibleIP),\n totalCount: data.total_count\n };\n};\nconst marshalAttachFlexibleIPRequest = (request, defaults) => ({\n fips_ids: request.fipsIds,\n server_id: request.serverId\n});\nconst marshalCreateFlexibleIPRequest = (request, defaults) => ({\n description: request.description,\n is_ipv6: request.isIpv6,\n project_id: request.projectId ?? defaults.defaultProjectId,\n reverse: request.reverse,\n server_id: request.serverId,\n tags: request.tags\n});\nconst marshalDetachFlexibleIPRequest = (request, defaults) => ({\n fips_ids: request.fipsIds\n});\nconst marshalDuplicateMACAddrRequest = (request, defaults) => ({\n duplicate_from_fip_id: request.duplicateFromFipId\n});\nconst marshalGenerateMACAddrRequest = (request, defaults) => ({\n mac_type: request.macType\n});\nconst marshalMoveMACAddrRequest = (request, defaults) => ({\n dst_fip_id: request.dstFipId\n});\nconst marshalUpdateFlexibleIPRequest = (request, defaults) => ({\n description: request.description,\n reverse: request.reverse,\n tags: request.tags\n});\nexports.marshalAttachFlexibleIPRequest = marshalAttachFlexibleIPRequest;\nexports.marshalCreateFlexibleIPRequest = marshalCreateFlexibleIPRequest;\nexports.marshalDetachFlexibleIPRequest = marshalDetachFlexibleIPRequest;\nexports.marshalDuplicateMACAddrRequest = marshalDuplicateMACAddrRequest;\nexports.marshalGenerateMACAddrRequest = marshalGenerateMACAddrRequest;\nexports.marshalMoveMACAddrRequest = marshalMoveMACAddrRequest;\nexports.marshalUpdateFlexibleIPRequest = marshalUpdateFlexibleIPRequest;\nexports.unmarshalAttachFlexibleIPsResponse = unmarshalAttachFlexibleIPsResponse;\nexports.unmarshalDetachFlexibleIPsResponse = unmarshalDetachFlexibleIPsResponse;\nexports.unmarshalFlexibleIP = unmarshalFlexibleIP;\nexports.unmarshalListFlexibleIPsResponse = unmarshalListFlexibleIPsResponse;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst ListFlexibleIPsRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nexports.ListFlexibleIPsRequest = ListFlexibleIPsRequest;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst index_gen = require(\"./v1beta1/index.gen.cjs\");\nexports.v1beta1 = index_gen;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst intervalRetrier = require(\"../../../internal/async/interval-retrier.cjs\");\nconst api = require(\"../../../scw/api.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst resourcePaginator = require(\"../../../scw/fetch/resource-paginator.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nconst marshalling_gen = require(\"./marshalling.gen.cjs\");\nconst jsonContentHeaders = {\n \"Content-Type\": \"application/json; charset=utf-8\"\n};\nclass API extends api.API {\n /** Lists the available regions of the API. */\n static LOCALITIES = [\"fr-par\", \"nl-ams\", \"pl-waw\"];\n pageOfListNamespaces = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/functions/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/namespaces`,\n urlParams: marshalling.urlParams(\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId]\n )\n },\n marshalling_gen.unmarshalListNamespacesResponse\n );\n /**\n * List all your namespaces. List all existing namespaces in the specified\n * region.\n *\n * @param request - The request {@link ListNamespacesRequest}\n * @returns A Promise of ListNamespacesResponse\n */\n listNamespaces = (request = {}) => resourcePaginator.enrichForPagination(\"namespaces\", this.pageOfListNamespaces, request);\n /**\n * Get a namespace. Get the namespace associated with the specified ID.\n *\n * @param request - The request {@link GetNamespaceRequest}\n * @returns A Promise of Namespace\n */\n getNamespace = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/functions/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/namespaces/${marshalling.validatePathParam(\"namespaceId\", request.namespaceId)}`\n },\n marshalling_gen.unmarshalNamespace\n );\n /**\n * Waits for {@link Namespace} to be in a final state.\n *\n * @param request - The request {@link GetNamespaceRequest}\n * @param options - The waiting options\n * @returns A Promise of Namespace\n */\n waitForNamespace = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(!content_gen.NAMESPACE_TRANSIENT_STATUSES.includes(res.status))),\n this.getNamespace,\n request,\n options\n );\n /**\n * Create a new namespace. Create a new namespace in a specified Organization\n * or Project.\n *\n * @param request - The request {@link CreateNamespaceRequest}\n * @returns A Promise of Namespace\n */\n createNamespace = (request = {}) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateNamespaceRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/functions/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/namespaces`\n },\n marshalling_gen.unmarshalNamespace\n );\n /**\n * Update an existing namespace. Update the namespace associated with the\n * specified ID.\n *\n * @param request - The request {@link UpdateNamespaceRequest}\n * @returns A Promise of Namespace\n */\n updateNamespace = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateNamespaceRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/functions/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/namespaces/${marshalling.validatePathParam(\"namespaceId\", request.namespaceId)}`\n },\n marshalling_gen.unmarshalNamespace\n );\n /**\n * Delete an existing namespace. Delete the namespace associated with the\n * specified ID.\n *\n * @param request - The request {@link DeleteNamespaceRequest}\n * @returns A Promise of Namespace\n */\n deleteNamespace = (request) => this.client.fetch(\n {\n method: \"DELETE\",\n path: `/functions/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/namespaces/${marshalling.validatePathParam(\"namespaceId\", request.namespaceId)}`\n },\n marshalling_gen.unmarshalNamespace\n );\n pageOfListFunctions = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/functions/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/functions`,\n urlParams: marshalling.urlParams(\n [\"name\", request.name],\n [\"namespace_id\", request.namespaceId],\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId]\n )\n },\n marshalling_gen.unmarshalListFunctionsResponse\n );\n /**\n * List all your functions.\n *\n * @param request - The request {@link ListFunctionsRequest}\n * @returns A Promise of ListFunctionsResponse\n */\n listFunctions = (request) => resourcePaginator.enrichForPagination(\"functions\", this.pageOfListFunctions, request);\n /**\n * Get a function. Get the function associated with the specified ID.\n *\n * @param request - The request {@link GetFunctionRequest}\n * @returns A Promise of Function\n */\n getFunction = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/functions/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/functions/${marshalling.validatePathParam(\"functionId\", request.functionId)}`\n },\n marshalling_gen.unmarshalFunction\n );\n /**\n * Waits for {@link Function} to be in a final state.\n *\n * @param request - The request {@link GetFunctionRequest}\n * @param options - The waiting options\n * @returns A Promise of Function\n */\n waitForFunction = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(!content_gen.FUNCTION_TRANSIENT_STATUSES.includes(res.status))),\n this.getFunction,\n request,\n options\n );\n /**\n * Create a new function. Create a new function in the specified region for a\n * specified Organization or Project.\n *\n * @param request - The request {@link CreateFunctionRequest}\n * @returns A Promise of Function\n */\n createFunction = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateFunctionRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/functions/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/functions`\n },\n marshalling_gen.unmarshalFunction\n );\n /**\n * Update an existing function. Update the function associated with the\n * specified ID.\n *\n * @param request - The request {@link UpdateFunctionRequest}\n * @returns A Promise of Function\n */\n updateFunction = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateFunctionRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/functions/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/functions/${marshalling.validatePathParam(\"functionId\", request.functionId)}`\n },\n marshalling_gen.unmarshalFunction\n );\n /**\n * Delete a function. Delete the function associated with the specified ID.\n *\n * @param request - The request {@link DeleteFunctionRequest}\n * @returns A Promise of Function\n */\n deleteFunction = (request) => this.client.fetch(\n {\n method: \"DELETE\",\n path: `/functions/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/functions/${marshalling.validatePathParam(\"functionId\", request.functionId)}`\n },\n marshalling_gen.unmarshalFunction\n );\n /**\n * Deploy a function. Deploy a function associated with the specified ID.\n *\n * @param request - The request {@link DeployFunctionRequest}\n * @returns A Promise of Function\n */\n deployFunction = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/functions/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/functions/${marshalling.validatePathParam(\"functionId\", request.functionId)}/deploy`\n },\n marshalling_gen.unmarshalFunction\n );\n /**\n * List function runtimes. List available function runtimes.\n *\n * @param request - The request {@link ListFunctionRuntimesRequest}\n * @returns A Promise of ListFunctionRuntimesResponse\n */\n listFunctionRuntimes = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/functions/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/runtimes`\n },\n marshalling_gen.unmarshalListFunctionRuntimesResponse\n );\n /**\n * Get an upload URL of a function. Get an upload URL of a function associated\n * with the specified ID.\n *\n * @param request - The request {@link GetFunctionUploadURLRequest}\n * @returns A Promise of UploadURL\n */\n getFunctionUploadURL = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/functions/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/functions/${marshalling.validatePathParam(\"functionId\", request.functionId)}/upload-url`,\n urlParams: marshalling.urlParams([\"content_length\", request.contentLength])\n },\n marshalling_gen.unmarshalUploadURL\n );\n /**\n * Get a download URL of a function. Get a download URL for a function\n * associated with the specified ID.\n *\n * @param request - The request {@link GetFunctionDownloadURLRequest}\n * @returns A Promise of DownloadURL\n */\n getFunctionDownloadURL = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/functions/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/functions/${marshalling.validatePathParam(\"functionId\", request.functionId)}/download-url`\n },\n marshalling_gen.unmarshalDownloadURL\n );\n pageOfListCrons = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/functions/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/crons`,\n urlParams: marshalling.urlParams(\n [\"function_id\", request.functionId],\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListCronsResponse\n );\n /**\n * List all crons. List all the cronjobs in a specified region.\n *\n * @param request - The request {@link ListCronsRequest}\n * @returns A Promise of ListCronsResponse\n */\n listCrons = (request) => resourcePaginator.enrichForPagination(\"crons\", this.pageOfListCrons, request);\n /**\n * Get a cron. Get the cron associated with the specified ID.\n *\n * @param request - The request {@link GetCronRequest}\n * @returns A Promise of Cron\n */\n getCron = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/functions/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/crons/${marshalling.validatePathParam(\"cronId\", request.cronId)}`\n },\n marshalling_gen.unmarshalCron\n );\n /**\n * Waits for {@link Cron} to be in a final state.\n *\n * @param request - The request {@link GetCronRequest}\n * @param options - The waiting options\n * @returns A Promise of Cron\n */\n waitForCron = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(!content_gen.CRON_TRANSIENT_STATUSES.includes(res.status))),\n this.getCron,\n request,\n options\n );\n /**\n * Create a new cron. Create a new cronjob for a function with the specified\n * ID.\n *\n * @param request - The request {@link CreateCronRequest}\n * @returns A Promise of Cron\n */\n createCron = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateCronRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/functions/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/crons`\n },\n marshalling_gen.unmarshalCron\n );\n /**\n * Update an existing cron. Update the cron associated with the specified ID.\n *\n * @param request - The request {@link UpdateCronRequest}\n * @returns A Promise of Cron\n */\n updateCron = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateCronRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/functions/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/crons/${marshalling.validatePathParam(\"cronId\", request.cronId)}`\n },\n marshalling_gen.unmarshalCron\n );\n /**\n * Delete an existing cron. Delete the cron associated with the specified ID.\n *\n * @param request - The request {@link DeleteCronRequest}\n * @returns A Promise of Cron\n */\n deleteCron = (request) => this.client.fetch(\n {\n method: \"DELETE\",\n path: `/functions/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/crons/${marshalling.validatePathParam(\"cronId\", request.cronId)}`\n },\n marshalling_gen.unmarshalCron\n );\n pageOfListDomains = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/functions/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/domains`,\n urlParams: marshalling.urlParams(\n [\"function_id\", request.functionId],\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListDomainsResponse\n );\n /**\n * List all domain name bindings. List all domain name bindings in a specified\n * region.\n *\n * @param request - The request {@link ListDomainsRequest}\n * @returns A Promise of ListDomainsResponse\n */\n listDomains = (request) => resourcePaginator.enrichForPagination(\"domains\", this.pageOfListDomains, request);\n /**\n * Get a domain name binding. Get a domain name binding for the function with\n * the specified ID.\n *\n * @param request - The request {@link GetDomainRequest}\n * @returns A Promise of Domain\n */\n getDomain = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/functions/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/domains/${marshalling.validatePathParam(\"domainId\", request.domainId)}`\n },\n marshalling_gen.unmarshalDomain\n );\n /**\n * Waits for {@link Domain} to be in a final state.\n *\n * @param request - The request {@link GetDomainRequest}\n * @param options - The waiting options\n * @returns A Promise of Domain\n */\n waitForDomain = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(!content_gen.DOMAIN_TRANSIENT_STATUSES.includes(res.status))),\n this.getDomain,\n request,\n options\n );\n /**\n * Create a domain name binding. Create a domain name binding for the function\n * with the specified ID.\n *\n * @param request - The request {@link CreateDomainRequest}\n * @returns A Promise of Domain\n */\n createDomain = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateDomainRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/functions/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/domains`\n },\n marshalling_gen.unmarshalDomain\n );\n /**\n * Delete a domain name binding. Delete a domain name binding for the function\n * with the specified ID.\n *\n * @param request - The request {@link DeleteDomainRequest}\n * @returns A Promise of Domain\n */\n deleteDomain = (request) => this.client.fetch(\n {\n method: \"DELETE\",\n path: `/functions/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/domains/${marshalling.validatePathParam(\"domainId\", request.domainId)}`\n },\n marshalling_gen.unmarshalDomain\n );\n /**\n * Create a new revocable token.\n *\n * @param request - The request {@link CreateTokenRequest}\n * @returns A Promise of Token\n */\n createToken = (request = {}) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateTokenRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/functions/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/tokens`\n },\n marshalling_gen.unmarshalToken\n );\n /**\n * Get a token.\n *\n * @param request - The request {@link GetTokenRequest}\n * @returns A Promise of Token\n */\n getToken = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/functions/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/tokens/${marshalling.validatePathParam(\"tokenId\", request.tokenId)}`\n },\n marshalling_gen.unmarshalToken\n );\n /**\n * Waits for {@link Token} to be in a final state.\n *\n * @param request - The request {@link GetTokenRequest}\n * @param options - The waiting options\n * @returns A Promise of Token\n */\n waitForToken = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(!content_gen.TOKEN_TRANSIENT_STATUSES.includes(res.status))),\n this.getToken,\n request,\n options\n );\n pageOfListTokens = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/functions/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/tokens`,\n urlParams: marshalling.urlParams(\n [\"function_id\", request.functionId],\n [\"namespace_id\", request.namespaceId],\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListTokensResponse\n );\n /**\n * List all tokens.\n *\n * @param request - The request {@link ListTokensRequest}\n * @returns A Promise of ListTokensResponse\n */\n listTokens = (request = {}) => resourcePaginator.enrichForPagination(\"tokens\", this.pageOfListTokens, request);\n /**\n * Delete a token.\n *\n * @param request - The request {@link DeleteTokenRequest}\n * @returns A Promise of Token\n */\n deleteToken = (request) => this.client.fetch(\n {\n method: \"DELETE\",\n path: `/functions/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/tokens/${marshalling.validatePathParam(\"tokenId\", request.tokenId)}`\n },\n marshalling_gen.unmarshalToken\n );\n /**\n * Create a trigger. Create a new trigger for a specified function.\n *\n * @param request - The request {@link CreateTriggerRequest}\n * @returns A Promise of Trigger\n */\n createTrigger = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateTriggerRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/functions/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/triggers`\n },\n marshalling_gen.unmarshalTrigger\n );\n /**\n * Get a trigger. Get a trigger with a specified ID.\n *\n * @param request - The request {@link GetTriggerRequest}\n * @returns A Promise of Trigger\n */\n getTrigger = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/functions/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/triggers/${marshalling.validatePathParam(\"triggerId\", request.triggerId)}`\n },\n marshalling_gen.unmarshalTrigger\n );\n /**\n * Waits for {@link Trigger} to be in a final state.\n *\n * @param request - The request {@link GetTriggerRequest}\n * @param options - The waiting options\n * @returns A Promise of Trigger\n */\n waitForTrigger = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(!content_gen.TRIGGER_TRANSIENT_STATUSES.includes(res.status))),\n this.getTrigger,\n request,\n options\n );\n pageOfListTriggers = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/functions/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/triggers`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n ...Object.entries(\n marshalling.resolveOneOf([\n { param: \"function_id\", value: request.functionId },\n { param: \"namespace_id\", value: request.namespaceId },\n {\n default: this.client.settings.defaultProjectId,\n param: \"project_id\",\n value: request.projectId\n }\n ])\n )\n )\n },\n marshalling_gen.unmarshalListTriggersResponse\n );\n /**\n * List all triggers. List all triggers belonging to a specified Organization\n * or Project.\n *\n * @param request - The request {@link ListTriggersRequest}\n * @returns A Promise of ListTriggersResponse\n */\n listTriggers = (request = {}) => resourcePaginator.enrichForPagination(\"triggers\", this.pageOfListTriggers, request);\n /**\n * Update a trigger. Update a trigger with a specified ID.\n *\n * @param request - The request {@link UpdateTriggerRequest}\n * @returns A Promise of Trigger\n */\n updateTrigger = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateTriggerRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/functions/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/triggers/${marshalling.validatePathParam(\"triggerId\", request.triggerId)}`\n },\n marshalling_gen.unmarshalTrigger\n );\n /**\n * Delete a trigger. Delete a trigger with a specified ID.\n *\n * @param request - The request {@link DeleteTriggerRequest}\n * @returns A Promise of Trigger\n */\n deleteTrigger = (request) => this.client.fetch(\n {\n method: \"DELETE\",\n path: `/functions/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/triggers/${marshalling.validatePathParam(\"triggerId\", request.triggerId)}`\n },\n marshalling_gen.unmarshalTrigger\n );\n}\nexports.API = API;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst CRON_TRANSIENT_STATUSES = [\n \"deleting\",\n \"creating\",\n \"pending\"\n];\nconst DOMAIN_TRANSIENT_STATUSES = [\n \"deleting\",\n \"creating\",\n \"pending\"\n];\nconst FUNCTION_TRANSIENT_STATUSES = [\n \"deleting\",\n \"creating\",\n \"pending\"\n];\nconst NAMESPACE_TRANSIENT_STATUSES = [\n \"deleting\",\n \"creating\",\n \"pending\"\n];\nconst TOKEN_TRANSIENT_STATUSES = [\"deleting\", \"creating\"];\nconst TRIGGER_TRANSIENT_STATUSES = [\n \"deleting\",\n \"creating\",\n \"pending\"\n];\nexports.CRON_TRANSIENT_STATUSES = CRON_TRANSIENT_STATUSES;\nexports.DOMAIN_TRANSIENT_STATUSES = DOMAIN_TRANSIENT_STATUSES;\nexports.FUNCTION_TRANSIENT_STATUSES = FUNCTION_TRANSIENT_STATUSES;\nexports.NAMESPACE_TRANSIENT_STATUSES = NAMESPACE_TRANSIENT_STATUSES;\nexports.TOKEN_TRANSIENT_STATUSES = TOKEN_TRANSIENT_STATUSES;\nexports.TRIGGER_TRANSIENT_STATUSES = TRIGGER_TRANSIENT_STATUSES;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api_gen = require(\"./api.gen.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nconst validationRules_gen = require(\"./validation-rules.gen.cjs\");\nexports.API = api_gen.API;\nexports.CRON_TRANSIENT_STATUSES = content_gen.CRON_TRANSIENT_STATUSES;\nexports.DOMAIN_TRANSIENT_STATUSES = content_gen.DOMAIN_TRANSIENT_STATUSES;\nexports.FUNCTION_TRANSIENT_STATUSES = content_gen.FUNCTION_TRANSIENT_STATUSES;\nexports.NAMESPACE_TRANSIENT_STATUSES = content_gen.NAMESPACE_TRANSIENT_STATUSES;\nexports.TOKEN_TRANSIENT_STATUSES = content_gen.TOKEN_TRANSIENT_STATUSES;\nexports.TRIGGER_TRANSIENT_STATUSES = content_gen.TRIGGER_TRANSIENT_STATUSES;\nexports.ValidationRules = validationRules_gen;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst randomName = require(\"@scaleway/random-name\");\nconst json = require(\"../../../helpers/json.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst unmarshalCron = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Cron' failed as data isn't a dictionary.`\n );\n }\n return {\n args: data.args,\n functionId: data.function_id,\n id: data.id,\n name: data.name,\n schedule: data.schedule,\n status: data.status\n };\n};\nconst unmarshalDomain = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Domain' failed as data isn't a dictionary.`\n );\n }\n return {\n errorMessage: data.error_message,\n functionId: data.function_id,\n hostname: data.hostname,\n id: data.id,\n status: data.status,\n url: data.url\n };\n};\nconst unmarshalSecretHashedValue = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SecretHashedValue' failed as data isn't a dictionary.`\n );\n }\n return {\n hashedValue: data.hashed_value,\n key: data.key\n };\n};\nconst unmarshalFunction = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Function' failed as data isn't a dictionary.`\n );\n }\n return {\n buildMessage: data.build_message,\n cpuLimit: data.cpu_limit,\n description: data.description,\n domainName: data.domain_name,\n environmentVariables: data.environment_variables,\n errorMessage: data.error_message,\n handler: data.handler,\n httpOption: data.http_option,\n id: data.id,\n maxScale: data.max_scale,\n memoryLimit: data.memory_limit,\n minScale: data.min_scale,\n name: data.name,\n namespaceId: data.namespace_id,\n privacy: data.privacy,\n region: data.region,\n runtime: data.runtime,\n runtimeMessage: data.runtime_message,\n sandbox: data.sandbox,\n secretEnvironmentVariables: marshalling.unmarshalArrayOfObject(\n data.secret_environment_variables,\n unmarshalSecretHashedValue\n ),\n status: data.status,\n timeout: data.timeout\n };\n};\nconst unmarshalNamespace = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Namespace' failed as data isn't a dictionary.`\n );\n }\n return {\n description: data.description,\n environmentVariables: data.environment_variables,\n errorMessage: data.error_message,\n id: data.id,\n name: data.name,\n organizationId: data.organization_id,\n projectId: data.project_id,\n region: data.region,\n registryEndpoint: data.registry_endpoint,\n registryNamespaceId: data.registry_namespace_id,\n secretEnvironmentVariables: marshalling.unmarshalArrayOfObject(\n data.secret_environment_variables,\n unmarshalSecretHashedValue\n ),\n status: data.status\n };\n};\nconst unmarshalToken = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Token' failed as data isn't a dictionary.`\n );\n }\n return {\n description: data.description,\n expiresAt: marshalling.unmarshalDate(data.expires_at),\n functionId: data.function_id,\n id: data.id,\n namespaceId: data.namespace_id,\n publicKey: data.public_key,\n status: data.status,\n token: data.token\n };\n};\nconst unmarshalTriggerMnqNatsClientConfig = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'TriggerMnqNatsClientConfig' failed as data isn't a dictionary.`\n );\n }\n return {\n mnqCredentialId: data.mnq_credential_id,\n mnqNatsAccountId: data.mnq_nats_account_id,\n mnqProjectId: data.mnq_project_id,\n mnqRegion: data.mnq_region,\n subject: data.subject\n };\n};\nconst unmarshalTriggerMnqSqsClientConfig = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'TriggerMnqSqsClientConfig' failed as data isn't a dictionary.`\n );\n }\n return {\n mnqCredentialId: data.mnq_credential_id,\n mnqProjectId: data.mnq_project_id,\n mnqRegion: data.mnq_region,\n queue: data.queue\n };\n};\nconst unmarshalTriggerSqsClientConfig = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'TriggerSqsClientConfig' failed as data isn't a dictionary.`\n );\n }\n return {\n accessKey: data.access_key,\n endpoint: data.endpoint,\n queueUrl: data.queue_url,\n secretKey: data.secret_key\n };\n};\nconst unmarshalTrigger = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Trigger' failed as data isn't a dictionary.`\n );\n }\n return {\n description: data.description,\n errorMessage: data.error_message,\n functionId: data.function_id,\n id: data.id,\n inputType: data.input_type,\n name: data.name,\n scwNatsConfig: data.scw_nats_config ? unmarshalTriggerMnqNatsClientConfig(data.scw_nats_config) : void 0,\n scwSqsConfig: data.scw_sqs_config ? unmarshalTriggerMnqSqsClientConfig(data.scw_sqs_config) : void 0,\n sqsConfig: data.sqs_config ? unmarshalTriggerSqsClientConfig(data.sqs_config) : void 0,\n status: data.status\n };\n};\nconst unmarshalDownloadURL = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DownloadURL' failed as data isn't a dictionary.`\n );\n }\n return {\n headers: data.headers,\n url: data.url\n };\n};\nconst unmarshalListCronsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListCronsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n crons: marshalling.unmarshalArrayOfObject(data.crons, unmarshalCron),\n totalCount: data.total_count\n };\n};\nconst unmarshalListDomainsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListDomainsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n domains: marshalling.unmarshalArrayOfObject(data.domains, unmarshalDomain),\n totalCount: data.total_count\n };\n};\nconst unmarshalRuntime = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Runtime' failed as data isn't a dictionary.`\n );\n }\n return {\n codeSample: data.code_sample,\n defaultHandler: data.default_handler,\n extension: data.extension,\n implementation: data.implementation,\n language: data.language,\n logoUrl: data.logo_url,\n name: data.name,\n status: data.status,\n statusMessage: data.status_message,\n version: data.version\n };\n};\nconst unmarshalListFunctionRuntimesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListFunctionRuntimesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n runtimes: marshalling.unmarshalArrayOfObject(data.runtimes, unmarshalRuntime),\n totalCount: data.total_count\n };\n};\nconst unmarshalListFunctionsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListFunctionsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n functions: marshalling.unmarshalArrayOfObject(data.functions, unmarshalFunction),\n totalCount: data.total_count\n };\n};\nconst unmarshalListNamespacesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListNamespacesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n namespaces: marshalling.unmarshalArrayOfObject(data.namespaces, unmarshalNamespace),\n totalCount: data.total_count\n };\n};\nconst unmarshalListTokensResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListTokensResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n tokens: marshalling.unmarshalArrayOfObject(data.tokens, unmarshalToken),\n totalCount: data.total_count\n };\n};\nconst unmarshalListTriggersResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListTriggersResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n totalCount: data.total_count,\n triggers: marshalling.unmarshalArrayOfObject(data.triggers, unmarshalTrigger)\n };\n};\nconst unmarshalUploadURL = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'UploadURL' failed as data isn't a dictionary.`\n );\n }\n return {\n headers: data.headers,\n url: data.url\n };\n};\nconst marshalCreateCronRequest = (request, defaults) => ({\n args: request.args,\n function_id: request.functionId,\n name: request.name,\n schedule: request.schedule\n});\nconst marshalCreateDomainRequest = (request, defaults) => ({\n function_id: request.functionId,\n hostname: request.hostname\n});\nconst marshalSecret = (request, defaults) => ({\n key: request.key,\n value: request.value\n});\nconst marshalCreateFunctionRequest = (request, defaults) => ({\n description: request.description,\n environment_variables: request.environmentVariables,\n handler: request.handler,\n http_option: request.httpOption,\n max_scale: request.maxScale,\n memory_limit: request.memoryLimit,\n min_scale: request.minScale,\n name: request.name || randomName(\"fn\"),\n namespace_id: request.namespaceId,\n privacy: request.privacy,\n runtime: request.runtime,\n sandbox: request.sandbox,\n secret_environment_variables: request.secretEnvironmentVariables !== void 0 ? request.secretEnvironmentVariables.map(\n (elt) => marshalSecret(elt)\n ) : void 0,\n timeout: request.timeout\n});\nconst marshalCreateNamespaceRequest = (request, defaults) => ({\n description: request.description,\n environment_variables: request.environmentVariables,\n name: request.name || randomName(\"ns\"),\n project_id: request.projectId ?? defaults.defaultProjectId,\n secret_environment_variables: request.secretEnvironmentVariables !== void 0 ? request.secretEnvironmentVariables.map(\n (elt) => marshalSecret(elt)\n ) : void 0\n});\nconst marshalCreateTokenRequest = (request, defaults) => ({\n description: request.description,\n expires_at: request.expiresAt,\n ...marshalling.resolveOneOf([\n { param: \"function_id\", value: request.functionId },\n { param: \"namespace_id\", value: request.namespaceId }\n ])\n});\nconst marshalCreateTriggerRequestMnqNatsClientConfig = (request, defaults) => ({\n mnq_nats_account_id: request.mnqNatsAccountId,\n mnq_project_id: request.mnqProjectId,\n mnq_region: request.mnqRegion,\n subject: request.subject\n});\nconst marshalCreateTriggerRequestMnqSqsClientConfig = (request, defaults) => ({\n mnq_project_id: request.mnqProjectId,\n mnq_region: request.mnqRegion,\n queue: request.queue\n});\nconst marshalCreateTriggerRequestSqsClientConfig = (request, defaults) => ({\n access_key: request.accessKey,\n endpoint: request.endpoint,\n queue_url: request.queueUrl,\n secret_key: request.secretKey\n});\nconst marshalCreateTriggerRequest = (request, defaults) => ({\n description: request.description,\n function_id: request.functionId,\n name: request.name,\n ...marshalling.resolveOneOf([\n {\n param: \"scw_sqs_config\",\n value: request.scwSqsConfig !== void 0 ? marshalCreateTriggerRequestMnqSqsClientConfig(\n request.scwSqsConfig\n ) : void 0\n },\n {\n param: \"scw_nats_config\",\n value: request.scwNatsConfig !== void 0 ? marshalCreateTriggerRequestMnqNatsClientConfig(\n request.scwNatsConfig\n ) : void 0\n },\n {\n param: \"sqs_config\",\n value: request.sqsConfig !== void 0 ? marshalCreateTriggerRequestSqsClientConfig(\n request.sqsConfig\n ) : void 0\n }\n ])\n});\nconst marshalUpdateCronRequest = (request, defaults) => ({\n args: request.args,\n function_id: request.functionId,\n name: request.name,\n schedule: request.schedule\n});\nconst marshalUpdateFunctionRequest = (request, defaults) => ({\n description: request.description,\n environment_variables: request.environmentVariables,\n handler: request.handler,\n http_option: request.httpOption,\n max_scale: request.maxScale,\n memory_limit: request.memoryLimit,\n min_scale: request.minScale,\n privacy: request.privacy,\n redeploy: request.redeploy,\n runtime: request.runtime,\n sandbox: request.sandbox,\n secret_environment_variables: request.secretEnvironmentVariables !== void 0 ? request.secretEnvironmentVariables.map(\n (elt) => marshalSecret(elt)\n ) : void 0,\n timeout: request.timeout\n});\nconst marshalUpdateNamespaceRequest = (request, defaults) => ({\n description: request.description,\n environment_variables: request.environmentVariables,\n secret_environment_variables: request.secretEnvironmentVariables !== void 0 ? request.secretEnvironmentVariables.map(\n (elt) => marshalSecret(elt)\n ) : void 0\n});\nconst marshalUpdateTriggerRequestSqsClientConfig = (request, defaults) => ({\n access_key: request.accessKey,\n secret_key: request.secretKey\n});\nconst marshalUpdateTriggerRequest = (request, defaults) => ({\n description: request.description,\n name: request.name,\n ...marshalling.resolveOneOf([\n {\n param: \"sqs_config\",\n value: request.sqsConfig !== void 0 ? marshalUpdateTriggerRequestSqsClientConfig(\n request.sqsConfig\n ) : void 0\n }\n ])\n});\nexports.marshalCreateCronRequest = marshalCreateCronRequest;\nexports.marshalCreateDomainRequest = marshalCreateDomainRequest;\nexports.marshalCreateFunctionRequest = marshalCreateFunctionRequest;\nexports.marshalCreateNamespaceRequest = marshalCreateNamespaceRequest;\nexports.marshalCreateTokenRequest = marshalCreateTokenRequest;\nexports.marshalCreateTriggerRequest = marshalCreateTriggerRequest;\nexports.marshalUpdateCronRequest = marshalUpdateCronRequest;\nexports.marshalUpdateFunctionRequest = marshalUpdateFunctionRequest;\nexports.marshalUpdateNamespaceRequest = marshalUpdateNamespaceRequest;\nexports.marshalUpdateTriggerRequest = marshalUpdateTriggerRequest;\nexports.unmarshalCron = unmarshalCron;\nexports.unmarshalDomain = unmarshalDomain;\nexports.unmarshalDownloadURL = unmarshalDownloadURL;\nexports.unmarshalFunction = unmarshalFunction;\nexports.unmarshalListCronsResponse = unmarshalListCronsResponse;\nexports.unmarshalListDomainsResponse = unmarshalListDomainsResponse;\nexports.unmarshalListFunctionRuntimesResponse = unmarshalListFunctionRuntimesResponse;\nexports.unmarshalListFunctionsResponse = unmarshalListFunctionsResponse;\nexports.unmarshalListNamespacesResponse = unmarshalListNamespacesResponse;\nexports.unmarshalListTokensResponse = unmarshalListTokensResponse;\nexports.unmarshalListTriggersResponse = unmarshalListTriggersResponse;\nexports.unmarshalNamespace = unmarshalNamespace;\nexports.unmarshalToken = unmarshalToken;\nexports.unmarshalTrigger = unmarshalTrigger;\nexports.unmarshalUploadURL = unmarshalUploadURL;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst CreateTriggerRequest = {\n description: {\n maxLength: 255\n },\n name: {\n maxLength: 50,\n minLength: 1\n }\n};\nconst CreateTriggerRequestMnqNatsClientConfig = {\n mnqRegion: {\n maxLength: 20,\n minLength: 1\n },\n subject: {\n maxLength: 100,\n minLength: 1,\n pattern: /^[^\\s]+$/\n }\n};\nconst CreateTriggerRequestMnqSqsClientConfig = {\n mnqRegion: {\n maxLength: 20,\n minLength: 1\n },\n queue: {\n maxLength: 100,\n minLength: 1\n }\n};\nconst UpdateTriggerRequest = {\n description: {\n maxLength: 255\n },\n name: {\n maxLength: 50,\n minLength: 1\n }\n};\nexports.CreateTriggerRequest = CreateTriggerRequest;\nexports.CreateTriggerRequestMnqNatsClientConfig = CreateTriggerRequestMnqNatsClientConfig;\nexports.CreateTriggerRequestMnqSqsClientConfig = CreateTriggerRequestMnqSqsClientConfig;\nexports.UpdateTriggerRequest = UpdateTriggerRequest;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst index_gen = require(\"./v1alpha1/index.gen.cjs\");\nexports.v1alpha1 = index_gen;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api = require(\"../../../scw/api.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst resourcePaginator = require(\"../../../scw/fetch/resource-paginator.cjs\");\nconst marshalling_gen = require(\"./marshalling.gen.cjs\");\nconst jsonContentHeaders = {\n \"Content-Type\": \"application/json; charset=utf-8\"\n};\nclass API extends api.API {\n pageOfListSSHKeys = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/iam/v1alpha1/ssh-keys`,\n urlParams: marshalling.urlParams(\n [\"disabled\", request.disabled],\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId]\n )\n },\n marshalling_gen.unmarshalListSSHKeysResponse\n );\n /**\n * List SSH keys. List SSH keys. By default, the SSH keys listed are ordered\n * by creation date in ascending order. This can be modified via the\n * `order_by` field. You can define additional parameters for your query such\n * as `organization_id`, `name`, `project_id` and `disabled`.\n *\n * @param request - The request {@link ListSSHKeysRequest}\n * @returns A Promise of ListSSHKeysResponse\n */\n listSSHKeys = (request = {}) => resourcePaginator.enrichForPagination(\"sshKeys\", this.pageOfListSSHKeys, request);\n /**\n * Create an SSH key. Add a new SSH key to a Scaleway Project. You must\n * specify the `name`, `public_key` and `project_id`.\n *\n * @param request - The request {@link CreateSSHKeyRequest}\n * @returns A Promise of SSHKey\n */\n createSSHKey = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateSSHKeyRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/iam/v1alpha1/ssh-keys`\n },\n marshalling_gen.unmarshalSSHKey\n );\n /**\n * Get an SSH key. Retrieve information about a given SSH key, specified by\n * the `ssh_key_id` parameter. The SSH key's full details, including `id`,\n * `name`, `public_key`, and `project_id` are returned in the response.\n *\n * @param request - The request {@link GetSSHKeyRequest}\n * @returns A Promise of SSHKey\n */\n getSSHKey = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/iam/v1alpha1/ssh-keys/${marshalling.validatePathParam(\"sshKeyId\", request.sshKeyId)}`\n },\n marshalling_gen.unmarshalSSHKey\n );\n /**\n * Update an SSH key. Update the parameters of an SSH key, including `name`\n * and `disable`.\n *\n * @param request - The request {@link UpdateSSHKeyRequest}\n * @returns A Promise of SSHKey\n */\n updateSSHKey = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateSSHKeyRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/iam/v1alpha1/ssh-keys/${marshalling.validatePathParam(\"sshKeyId\", request.sshKeyId)}`\n },\n marshalling_gen.unmarshalSSHKey\n );\n /**\n * Delete an SSH key. Delete a given SSH key, specified by the `ssh_key_id`.\n * Deleting an SSH is permanent, and cannot be undone. Note that you might\n * need to update any configurations that used the SSH key.\n *\n * @param request - The request {@link DeleteSSHKeyRequest}\n */\n deleteSSHKey = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/iam/v1alpha1/ssh-keys/${marshalling.validatePathParam(\"sshKeyId\", request.sshKeyId)}`\n });\n pageOfListUsers = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/iam/v1alpha1/users`,\n urlParams: marshalling.urlParams(\n [\"mfa\", request.mfa],\n [\"order_by\", request.orderBy],\n [\n \"organization_id\",\n request.organizationId ?? this.client.settings.defaultOrganizationId\n ],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"tag\", request.tag],\n [\"user_ids\", request.userIds]\n )\n },\n marshalling_gen.unmarshalListUsersResponse\n );\n /**\n * List users of an Organization. List the users of an Organization. By\n * default, the users listed are ordered by creation date in ascending order.\n * This can be modified via the `order_by` field. You must define the\n * `organization_id` in the query path of your request. You can also define\n * additional parameters for your query such as `user_ids`.\n *\n * @param request - The request {@link ListUsersRequest}\n * @returns A Promise of ListUsersResponse\n */\n listUsers = (request = {}) => resourcePaginator.enrichForPagination(\"users\", this.pageOfListUsers, request);\n /**\n * Get a given user. Retrieve information about a user, specified by the\n * `user_id` parameter. The user's full details, including `id`, `email`,\n * `organization_id`, `status` and `mfa` are returned in the response.\n *\n * @param request - The request {@link GetUserRequest}\n * @returns A Promise of User\n */\n getUser = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/iam/v1alpha1/users/${marshalling.validatePathParam(\"userId\", request.userId)}`\n },\n marshalling_gen.unmarshalUser\n );\n /**\n * Update a user. Update the parameters of a user, including `tags`.\n *\n * @param request - The request {@link UpdateUserRequest}\n * @returns A Promise of User\n */\n updateUser = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateUserRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/iam/v1alpha1/users/${marshalling.validatePathParam(\"userId\", request.userId)}`\n },\n marshalling_gen.unmarshalUser\n );\n /**\n * Delete a guest user from an Organization. Remove a user from an\n * Organization in which they are a guest. You must define the `user_id` in\n * your request. Note that removing a user from an Organization automatically\n * deletes their API keys, and any policies directly attached to them become\n * orphaned.\n *\n * @param request - The request {@link DeleteUserRequest}\n */\n deleteUser = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/iam/v1alpha1/users/${marshalling.validatePathParam(\"userId\", request.userId)}`\n });\n /**\n * Create a new user. Create a new user. You must define the `organization_id`\n * and the `email` in your request.\n *\n * @param request - The request {@link CreateUserRequest}\n * @returns A Promise of User\n */\n createUser = (request = {}) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateUserRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/iam/v1alpha1/users`\n },\n marshalling_gen.unmarshalUser\n );\n pageOfListApplications = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/iam/v1alpha1/applications`,\n urlParams: marshalling.urlParams(\n [\"application_ids\", request.applicationIds],\n [\"editable\", request.editable],\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\n \"organization_id\",\n request.organizationId ?? this.client.settings.defaultOrganizationId\n ],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"tag\", request.tag]\n )\n },\n marshalling_gen.unmarshalListApplicationsResponse\n );\n /**\n * List applications of an Organization. List the applications of an\n * Organization. By default, the applications listed are ordered by creation\n * date in ascending order. This can be modified via the `order_by` field. You\n * must define the `organization_id` in the query path of your request. You\n * can also define additional parameters for your query such as\n * `application_ids`.\n *\n * @param request - The request {@link ListApplicationsRequest}\n * @returns A Promise of ListApplicationsResponse\n */\n listApplications = (request = {}) => resourcePaginator.enrichForPagination(\"applications\", this.pageOfListApplications, request);\n /**\n * Create a new application. Create a new application. You must define the\n * `name` parameter in the request.\n *\n * @param request - The request {@link CreateApplicationRequest}\n * @returns A Promise of Application\n */\n createApplication = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateApplicationRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/iam/v1alpha1/applications`\n },\n marshalling_gen.unmarshalApplication\n );\n /**\n * Get a given application. Retrieve information about an application,\n * specified by the `application_id` parameter. The application's full\n * details, including `id`, `email`, `organization_id`, `status` and\n * `two_factor_enabled` are returned in the response.\n *\n * @param request - The request {@link GetApplicationRequest}\n * @returns A Promise of Application\n */\n getApplication = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/iam/v1alpha1/applications/${marshalling.validatePathParam(\"applicationId\", request.applicationId)}`\n },\n marshalling_gen.unmarshalApplication\n );\n /**\n * Update an application. Update the parameters of an application, including\n * `name` and `description`.\n *\n * @param request - The request {@link UpdateApplicationRequest}\n * @returns A Promise of Application\n */\n updateApplication = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateApplicationRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/iam/v1alpha1/applications/${marshalling.validatePathParam(\"applicationId\", request.applicationId)}`\n },\n marshalling_gen.unmarshalApplication\n );\n /**\n * Delete an application. Delete an application. Note that this action is\n * irreversible and will automatically delete the application's API keys.\n * Policies attached to users and applications via this group will no longer\n * apply.\n *\n * @param request - The request {@link DeleteApplicationRequest}\n */\n deleteApplication = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/iam/v1alpha1/applications/${marshalling.validatePathParam(\"applicationId\", request.applicationId)}`\n });\n pageOfListGroups = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/iam/v1alpha1/groups`,\n urlParams: marshalling.urlParams(\n [\"application_ids\", request.applicationIds],\n [\"group_ids\", request.groupIds],\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\n \"organization_id\",\n request.organizationId ?? this.client.settings.defaultOrganizationId\n ],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"tag\", request.tag],\n [\"user_ids\", request.userIds]\n )\n },\n marshalling_gen.unmarshalListGroupsResponse\n );\n /**\n * List groups. List groups. By default, the groups listed are ordered by\n * creation date in ascending order. This can be modified via the `order_by`\n * field. You can define additional parameters to filter your query. Use\n * `user_ids` or `application_ids` to list all groups certain users or\n * applications belong to.\n *\n * @param request - The request {@link ListGroupsRequest}\n * @returns A Promise of ListGroupsResponse\n */\n listGroups = (request = {}) => resourcePaginator.enrichForPagination(\"groups\", this.pageOfListGroups, request);\n /**\n * Create a group. Create a new group. You must define the `name` and\n * `organization_id` parameters in the request.\n *\n * @param request - The request {@link CreateGroupRequest}\n * @returns A Promise of Group\n */\n createGroup = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateGroupRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/iam/v1alpha1/groups`\n },\n marshalling_gen.unmarshalGroup\n );\n /**\n * Get a group. Retrive information about a given group, specified by the\n * `group_id` parameter. The group's full details, including `user_ids` and\n * `application_ids` are returned in the response.\n *\n * @param request - The request {@link GetGroupRequest}\n * @returns A Promise of Group\n */\n getGroup = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/iam/v1alpha1/groups/${marshalling.validatePathParam(\"groupId\", request.groupId)}`\n },\n marshalling_gen.unmarshalGroup\n );\n /**\n * Update a group. Update the parameters of group, including `name` and\n * `description`.\n *\n * @param request - The request {@link UpdateGroupRequest}\n * @returns A Promise of Group\n */\n updateGroup = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateGroupRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/iam/v1alpha1/groups/${marshalling.validatePathParam(\"groupId\", request.groupId)}`\n },\n marshalling_gen.unmarshalGroup\n );\n /**\n * Overwrite users and applications of a group. Overwrite users and\n * applications configuration in a group. Any information that you add using\n * this command will overwrite the previous configuration.\n *\n * @param request - The request {@link SetGroupMembersRequest}\n * @returns A Promise of Group\n */\n setGroupMembers = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalSetGroupMembersRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PUT\",\n path: `/iam/v1alpha1/groups/${marshalling.validatePathParam(\"groupId\", request.groupId)}/members`\n },\n marshalling_gen.unmarshalGroup\n );\n /**\n * Add a user or an application to a group. Add a user or an application to a\n * group. You can specify a `user_id` and and `application_id` in the body of\n * your request. Note that you can only add one of each per request.\n *\n * @param request - The request {@link AddGroupMemberRequest}\n * @returns A Promise of Group\n */\n addGroupMember = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalAddGroupMemberRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/iam/v1alpha1/groups/${marshalling.validatePathParam(\"groupId\", request.groupId)}/add-member`\n },\n marshalling_gen.unmarshalGroup\n );\n /**\n * Add multiple users and applications to a group. Add multiple users and\n * applications to a group in a single call. You can specify an array of\n * `user_id`s and `application_id`s. Note that any existing users and\n * applications in the group will remain. To add new users/applications and\n * delete pre-existing ones, use the [Overwrite users and applications of a\n * group](#path-groups-overwrite-users-and-applications-of-a-group) method.\n *\n * @param request - The request {@link AddGroupMembersRequest}\n * @returns A Promise of Group\n */\n addGroupMembers = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalAddGroupMembersRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/iam/v1alpha1/groups/${marshalling.validatePathParam(\"groupId\", request.groupId)}/add-members`\n },\n marshalling_gen.unmarshalGroup\n );\n /**\n * Remove a user or an application from a group. Remove a user or an\n * application from a group. You can specify a `user_id` and and\n * `application_id` in the body of your request. Note that you can only remove\n * one of each per request. Removing a user from a group means that any\n * permissions given to them via the group (i.e. from an attached policy) will\n * no longer apply. Be sure you want to remove these permissions from the user\n * before proceeding.\n *\n * @param request - The request {@link RemoveGroupMemberRequest}\n * @returns A Promise of Group\n */\n removeGroupMember = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalRemoveGroupMemberRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/iam/v1alpha1/groups/${marshalling.validatePathParam(\"groupId\", request.groupId)}/remove-member`\n },\n marshalling_gen.unmarshalGroup\n );\n /**\n * Delete a group. Delete a group. Note that this action is irreversible and\n * could delete permissions for group members. Policies attached to users and\n * applications via this group will no longer apply.\n *\n * @param request - The request {@link DeleteGroupRequest}\n */\n deleteGroup = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/iam/v1alpha1/groups/${marshalling.validatePathParam(\"groupId\", request.groupId)}`\n });\n pageOfListPolicies = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/iam/v1alpha1/policies`,\n urlParams: marshalling.urlParams(\n [\"application_ids\", request.applicationIds],\n [\"editable\", request.editable],\n [\"group_ids\", request.groupIds],\n [\"no_principal\", request.noPrincipal],\n [\"order_by\", request.orderBy],\n [\n \"organization_id\",\n request.organizationId ?? this.client.settings.defaultOrganizationId\n ],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"policy_ids\", request.policyIds],\n [\"policy_name\", request.policyName],\n [\"tag\", request.tag],\n [\"user_ids\", request.userIds]\n )\n },\n marshalling_gen.unmarshalListPoliciesResponse\n );\n /**\n * List policies of an Organization. List the policies of an Organization. By\n * default, the policies listed are ordered by creation date in ascending\n * order. This can be modified via the `order_by` field. You must define the\n * `organization_id` in the query path of your request. You can also define\n * additional parameters to filter your query, such as `user_ids`,\n * `groups_ids`, `application_ids`, and `policy_name`.\n *\n * @param request - The request {@link ListPoliciesRequest}\n * @returns A Promise of ListPoliciesResponse\n */\n listPolicies = (request = {}) => resourcePaginator.enrichForPagination(\"policies\", this.pageOfListPolicies, request);\n /**\n * Create a new policy. Create a new application. You must define the `name`\n * parameter in the request. You can specify parameters such as `user_id`,\n * `groups_id`, `application_id`, `no_principal`, `rules` and its child\n * attributes.\n *\n * @param request - The request {@link CreatePolicyRequest}\n * @returns A Promise of Policy\n */\n createPolicy = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreatePolicyRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/iam/v1alpha1/policies`\n },\n marshalling_gen.unmarshalPolicy\n );\n /**\n * Get an existing policy. Retrieve information about a policy, speficified by\n * the `policy_id` parameter. The policy's full details, including `id`,\n * `name`, `organization_id`, `nb_rules` and `nb_scopes`, `nb_permission_sets`\n * are returned in the response.\n *\n * @param request - The request {@link GetPolicyRequest}\n * @returns A Promise of Policy\n */\n getPolicy = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/iam/v1alpha1/policies/${marshalling.validatePathParam(\"policyId\", request.policyId)}`\n },\n marshalling_gen.unmarshalPolicy\n );\n /**\n * Update an existing policy. Update the parameters of a policy, including\n * `name`, `description`, `user_id`, `group_id`, `application_id` and\n * `no_principal`.\n *\n * @param request - The request {@link UpdatePolicyRequest}\n * @returns A Promise of Policy\n */\n updatePolicy = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdatePolicyRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/iam/v1alpha1/policies/${marshalling.validatePathParam(\"policyId\", request.policyId)}`\n },\n marshalling_gen.unmarshalPolicy\n );\n /**\n * Delete a policy. Delete a policy. You must define specify the `policy_id`\n * parameter in your request. Note that when deleting a policy, all\n * permissions it gives to its principal (user, group or application) will be\n * revoked.\n *\n * @param request - The request {@link DeletePolicyRequest}\n */\n deletePolicy = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/iam/v1alpha1/policies/${marshalling.validatePathParam(\"policyId\", request.policyId)}`\n });\n /**\n * Clone a policy. Clone a policy. You must define specify the `policy_id`\n * parameter in your request.\n *\n * @param request - The request {@link ClonePolicyRequest}\n * @returns A Promise of Policy\n */\n clonePolicy = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/iam/v1alpha1/policies/${marshalling.validatePathParam(\"policyId\", request.policyId)}/clone`\n },\n marshalling_gen.unmarshalPolicy\n );\n /**\n * Set rules of a given policy. Overwrite the rules of a given policy. Any\n * information that you add using this command will overwrite the previous\n * configuration. If you include some of the rules you already had in your\n * previous configuration in your new one, but you change their order, the new\n * order of display will apply. While policy rules are ordered, they have no\n * impact on the access logic of IAM because rules are allow-only.\n *\n * @param request - The request {@link SetRulesRequest}\n * @returns A Promise of SetRulesResponse\n */\n setRules = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalSetRulesRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PUT\",\n path: `/iam/v1alpha1/rules`\n },\n marshalling_gen.unmarshalSetRulesResponse\n );\n pageOfListRules = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/iam/v1alpha1/rules`,\n urlParams: marshalling.urlParams(\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"policy_id\", request.policyId]\n )\n },\n marshalling_gen.unmarshalListRulesResponse\n );\n /**\n * List rules of a given policy. List the rules of a given policy. By default,\n * the rules listed are ordered by creation date in ascending order. This can\n * be modified via the `order_by` field. You must define the `policy_id` in\n * the query path of your request.\n *\n * @param request - The request {@link ListRulesRequest}\n * @returns A Promise of ListRulesResponse\n */\n listRules = (request) => resourcePaginator.enrichForPagination(\"rules\", this.pageOfListRules, request);\n pageOfListPermissionSets = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/iam/v1alpha1/permission-sets`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\n \"organization_id\",\n request.organizationId ?? this.client.settings.defaultOrganizationId\n ],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListPermissionSetsResponse\n );\n /**\n * List permission sets. List permission sets available for given\n * Organization. You must define the `organization_id` in the query path of\n * your request.\n *\n * @param request - The request {@link ListPermissionSetsRequest}\n * @returns A Promise of ListPermissionSetsResponse\n */\n listPermissionSets = (request = {}) => resourcePaginator.enrichForPagination(\n \"permissionSets\",\n this.pageOfListPermissionSets,\n request\n );\n pageOfListAPIKeys = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/iam/v1alpha1/api-keys`,\n urlParams: marshalling.urlParams(\n [\"access_key\", request.accessKey],\n [\"access_keys\", request.accessKeys],\n [\"bearer_id\", request.bearerId],\n [\"bearer_type\", request.bearerType],\n [\"description\", request.description],\n [\"editable\", request.editable],\n [\"expired\", request.expired],\n [\"order_by\", request.orderBy],\n [\n \"organization_id\",\n request.organizationId ?? this.client.settings.defaultOrganizationId\n ],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n ...Object.entries(\n marshalling.resolveOneOf([\n { param: \"application_id\", value: request.applicationId },\n { param: \"user_id\", value: request.userId }\n ])\n )\n )\n },\n marshalling_gen.unmarshalListAPIKeysResponse\n );\n /**\n * List API keys. List API keys. By default, the API keys listed are ordered\n * by creation date in ascending order. This can be modified via the\n * `order_by` field. You can define additional parameters for your query such\n * as `editable`, `expired`, `access_key` and `bearer_id`.\n *\n * @param request - The request {@link ListAPIKeysRequest}\n * @returns A Promise of ListAPIKeysResponse\n */\n listAPIKeys = (request = {}) => resourcePaginator.enrichForPagination(\"apiKeys\", this.pageOfListAPIKeys, request);\n /**\n * Create an API key. Create an API key. You must specify the `application_id`\n * or the `user_id` and the description. You can also specify the\n * `default_project_id` which is the Project ID of your preferred Project, to\n * use with Object Storage. The `access_key` and `secret_key` values are\n * returned in the response. Note that he secret key is only showed once. Make\n * sure that you copy and store both keys somewhere safe.\n *\n * @param request - The request {@link CreateAPIKeyRequest}\n * @returns A Promise of APIKey\n */\n createAPIKey = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateAPIKeyRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/iam/v1alpha1/api-keys`\n },\n marshalling_gen.unmarshalAPIKey\n );\n /**\n * Get an API key. Retrive information about an API key, specified by the\n * `access_key` parameter. The API key's details, including either the\n * `user_id` or `application_id` of its bearer are returned in the response.\n * Note that the string value for the `secret_key` is nullable, and therefore\n * is not displayed in the response. The `secret_key` value is only displayed\n * upon API key creation.\n *\n * @param request - The request {@link GetAPIKeyRequest}\n * @returns A Promise of APIKey\n */\n getAPIKey = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/iam/v1alpha1/api-keys/${marshalling.validatePathParam(\"accessKey\", request.accessKey)}`\n },\n marshalling_gen.unmarshalAPIKey\n );\n /**\n * Update an API key. Update the parameters of an API key, including\n * `default_project_id` and `description`.\n *\n * @param request - The request {@link UpdateAPIKeyRequest}\n * @returns A Promise of APIKey\n */\n updateAPIKey = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateAPIKeyRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/iam/v1alpha1/api-keys/${marshalling.validatePathParam(\"accessKey\", request.accessKey)}`\n },\n marshalling_gen.unmarshalAPIKey\n );\n /**\n * Delete an API key. Delete an API key. Note that this action is irreversible\n * and cannot be undone. Make sure you update any configurations using the API\n * keys you delete.\n *\n * @param request - The request {@link DeleteAPIKeyRequest}\n */\n deleteAPIKey = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/iam/v1alpha1/api-keys/${marshalling.validatePathParam(\"accessKey\", request.accessKey)}`\n });\n pageOfListQuota = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/iam/v1alpha1/quota`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\n \"organization_id\",\n request.organizationId ?? this.client.settings.defaultOrganizationId\n ],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"quotum_names\", request.quotumNames]\n )\n },\n marshalling_gen.unmarshalListQuotaResponse\n );\n /**\n * List all quotas in the Organization. List all product and features quota\n * for an Organization, with their associated limits. By default, the quota\n * listed are ordered by creation date in ascending order. This can be\n * modified via the `order_by` field. You must define the `organization_id` in\n * the query path of your request.\n *\n * @param request - The request {@link ListQuotaRequest}\n * @returns A Promise of ListQuotaResponse\n */\n listQuota = (request = {}) => resourcePaginator.enrichForPagination(\"quota\", this.pageOfListQuota, request);\n /**\n * Get a quota in the Organization. Retrieve information about a resource\n * quota, specified by the `quotum_name` parameter. The quota's `limit`, or\n * whether it is unlimited, is returned in the response.\n *\n * @param request - The request {@link GetQuotumRequest}\n * @returns A Promise of Quotum\n */\n getQuotum = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/iam/v1alpha1/quota/${marshalling.validatePathParam(\"quotumName\", request.quotumName)}`,\n urlParams: marshalling.urlParams([\n \"organization_id\",\n request.organizationId ?? this.client.settings.defaultOrganizationId\n ])\n },\n marshalling_gen.unmarshalQuotum\n );\n pageOfListJWTs = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/iam/v1alpha1/jwts`,\n urlParams: marshalling.urlParams(\n [\"audience_id\", request.audienceId],\n [\"expired\", request.expired],\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListJWTsResponse\n );\n /**\n * List JWTs.\n *\n * @param request - The request {@link ListJWTsRequest}\n * @returns A Promise of ListJWTsResponse\n */\n listJWTs = (request = {}) => resourcePaginator.enrichForPagination(\"jwts\", this.pageOfListJWTs, request);\n /**\n * Create a JWT.\n *\n * @param request - The request {@link CreateJWTRequest}\n * @returns A Promise of EncodedJWT\n */\n createJWT = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateJWTRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/iam/v1alpha1/jwts`\n },\n marshalling_gen.unmarshalEncodedJWT\n );\n /**\n * Get a JWT.\n *\n * @param request - The request {@link GetJWTRequest}\n * @returns A Promise of JWT\n */\n getJWT = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/iam/v1alpha1/jwts/${marshalling.validatePathParam(\"jti\", request.jti)}`\n },\n marshalling_gen.unmarshalJWT\n );\n /**\n * Delete a JWT.\n *\n * @param request - The request {@link DeleteJWTRequest}\n */\n deleteJWT = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/iam/v1alpha1/jwts/${marshalling.validatePathParam(\"jti\", request.jti)}`\n });\n pageOfListLogs = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/iam/v1alpha1/logs`,\n urlParams: marshalling.urlParams(\n [\"action\", request.action],\n [\"created_after\", request.createdAfter],\n [\"created_before\", request.createdBefore],\n [\"order_by\", request.orderBy],\n [\n \"organization_id\",\n request.organizationId ?? this.client.settings.defaultOrganizationId\n ],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"resource_type\", request.resourceType],\n [\"search\", request.search]\n )\n },\n marshalling_gen.unmarshalListLogsResponse\n );\n /**\n * List logs. List logs available for given Organization. You must define the\n * `organization_id` in the query path of your request.\n *\n * @param request - The request {@link ListLogsRequest}\n * @returns A Promise of ListLogsResponse\n */\n listLogs = (request = {}) => resourcePaginator.enrichForPagination(\"logs\", this.pageOfListLogs, request);\n /**\n * Get a log. Retrieve information about a log, specified by the `log_id`\n * parameter. The log's full details, including `id`, `ip`, `user_agent`,\n * `action`, `bearer_id`, `resource_type` and `resource_id` are returned in\n * the response.\n *\n * @param request - The request {@link GetLogRequest}\n * @returns A Promise of Log\n */\n getLog = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/iam/v1alpha1/logs/${marshalling.validatePathParam(\"logId\", request.logId)}`\n },\n marshalling_gen.unmarshalLog\n );\n}\nexports.API = API;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api_gen = require(\"./api.gen.cjs\");\nconst validationRules_gen = require(\"./validation-rules.gen.cjs\");\nexports.API = api_gen.API;\nexports.ValidationRules = validationRules_gen;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst randomName = require(\"@scaleway/random-name\");\nconst json = require(\"../../../helpers/json.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst unmarshalJWT = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'JWT' failed as data isn't a dictionary.`\n );\n }\n return {\n audienceId: data.audience_id,\n createdAt: marshalling.unmarshalDate(data.created_at),\n expiresAt: marshalling.unmarshalDate(data.expires_at),\n ip: data.ip,\n issuerId: data.issuer_id,\n jti: data.jti,\n updatedAt: marshalling.unmarshalDate(data.updated_at),\n userAgent: data.user_agent\n };\n};\nconst unmarshalAPIKey = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'APIKey' failed as data isn't a dictionary.`\n );\n }\n return {\n accessKey: data.access_key,\n applicationId: data.application_id,\n createdAt: marshalling.unmarshalDate(data.created_at),\n creationIp: data.creation_ip,\n defaultProjectId: data.default_project_id,\n description: data.description,\n editable: data.editable,\n expiresAt: marshalling.unmarshalDate(data.expires_at),\n secretKey: data.secret_key,\n updatedAt: marshalling.unmarshalDate(data.updated_at),\n userId: data.user_id\n };\n};\nconst unmarshalApplication = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Application' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n description: data.description,\n editable: data.editable,\n id: data.id,\n name: data.name,\n nbApiKeys: data.nb_api_keys,\n organizationId: data.organization_id,\n tags: data.tags,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalGroup = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Group' failed as data isn't a dictionary.`\n );\n }\n return {\n applicationIds: data.application_ids,\n createdAt: marshalling.unmarshalDate(data.created_at),\n description: data.description,\n id: data.id,\n name: data.name,\n organizationId: data.organization_id,\n tags: data.tags,\n updatedAt: marshalling.unmarshalDate(data.updated_at),\n userIds: data.user_ids\n };\n};\nconst unmarshalLog = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Log' failed as data isn't a dictionary.`\n );\n }\n return {\n action: data.action,\n bearerId: data.bearer_id,\n createdAt: marshalling.unmarshalDate(data.created_at),\n id: data.id,\n ip: data.ip,\n organizationId: data.organization_id,\n resourceId: data.resource_id,\n resourceType: data.resource_type,\n userAgent: data.user_agent\n };\n};\nconst unmarshalPolicy = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Policy' failed as data isn't a dictionary.`\n );\n }\n return {\n applicationId: data.application_id,\n createdAt: marshalling.unmarshalDate(data.created_at),\n description: data.description,\n editable: data.editable,\n groupId: data.group_id,\n id: data.id,\n name: data.name,\n nbPermissionSets: data.nb_permission_sets,\n nbRules: data.nb_rules,\n nbScopes: data.nb_scopes,\n noPrincipal: data.no_principal,\n organizationId: data.organization_id,\n tags: data.tags,\n updatedAt: marshalling.unmarshalDate(data.updated_at),\n userId: data.user_id\n };\n};\nconst unmarshalQuotum = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Quotum' failed as data isn't a dictionary.`\n );\n }\n return {\n description: data.description,\n limit: data.limit,\n name: data.name,\n prettyName: data.pretty_name,\n unit: data.unit,\n unlimited: data.unlimited\n };\n};\nconst unmarshalSSHKey = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SSHKey' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n disabled: data.disabled,\n fingerprint: data.fingerprint,\n id: data.id,\n name: data.name,\n organizationId: data.organization_id,\n projectId: data.project_id,\n publicKey: data.public_key,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalUser = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'User' failed as data isn't a dictionary.`\n );\n }\n return {\n accountRootUserId: data.account_root_user_id,\n createdAt: marshalling.unmarshalDate(data.created_at),\n deletable: data.deletable,\n email: data.email,\n id: data.id,\n lastLoginAt: marshalling.unmarshalDate(data.last_login_at),\n locked: data.locked,\n mfa: data.mfa,\n organizationId: data.organization_id,\n status: data.status,\n tags: data.tags,\n twoFactorEnabled: data.two_factor_enabled,\n type: data.type,\n updatedAt: marshalling.unmarshalDate(data.updated_at),\n username: data.username\n };\n};\nconst unmarshalEncodedJWT = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'EncodedJWT' failed as data isn't a dictionary.`\n );\n }\n return {\n jwt: data.jwt ? unmarshalJWT(data.jwt) : void 0,\n renewToken: data.renew_token,\n token: data.token\n };\n};\nconst unmarshalListAPIKeysResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListAPIKeysResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n apiKeys: marshalling.unmarshalArrayOfObject(data.api_keys, unmarshalAPIKey),\n totalCount: data.total_count\n };\n};\nconst unmarshalListApplicationsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListApplicationsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n applications: marshalling.unmarshalArrayOfObject(\n data.applications,\n unmarshalApplication\n ),\n totalCount: data.total_count\n };\n};\nconst unmarshalListGroupsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListGroupsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n groups: marshalling.unmarshalArrayOfObject(data.groups, unmarshalGroup),\n totalCount: data.total_count\n };\n};\nconst unmarshalListJWTsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListJWTsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n jwts: marshalling.unmarshalArrayOfObject(data.jwts, unmarshalJWT),\n totalCount: data.total_count\n };\n};\nconst unmarshalListLogsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListLogsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n logs: marshalling.unmarshalArrayOfObject(data.logs, unmarshalLog),\n totalCount: data.total_count\n };\n};\nconst unmarshalPermissionSet = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'PermissionSet' failed as data isn't a dictionary.`\n );\n }\n return {\n categories: data.categories,\n description: data.description,\n id: data.id,\n name: data.name,\n scopeType: data.scope_type\n };\n};\nconst unmarshalListPermissionSetsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListPermissionSetsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n permissionSets: marshalling.unmarshalArrayOfObject(\n data.permission_sets,\n unmarshalPermissionSet\n ),\n totalCount: data.total_count\n };\n};\nconst unmarshalListPoliciesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListPoliciesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n policies: marshalling.unmarshalArrayOfObject(data.policies, unmarshalPolicy),\n totalCount: data.total_count\n };\n};\nconst unmarshalListQuotaResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListQuotaResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n quota: marshalling.unmarshalArrayOfObject(data.quota, unmarshalQuotum),\n totalCount: data.total_count\n };\n};\nconst unmarshalRule = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Rule' failed as data isn't a dictionary.`\n );\n }\n return {\n accountRootUserId: data.account_root_user_id,\n condition: data.condition,\n id: data.id,\n organizationId: data.organization_id,\n permissionSetNames: data.permission_set_names,\n permissionSetsScopeType: data.permission_sets_scope_type,\n projectIds: data.project_ids\n };\n};\nconst unmarshalListRulesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListRulesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n rules: marshalling.unmarshalArrayOfObject(data.rules, unmarshalRule),\n totalCount: data.total_count\n };\n};\nconst unmarshalListSSHKeysResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListSSHKeysResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n sshKeys: marshalling.unmarshalArrayOfObject(data.ssh_keys, unmarshalSSHKey),\n totalCount: data.total_count\n };\n};\nconst unmarshalListUsersResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListUsersResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n totalCount: data.total_count,\n users: marshalling.unmarshalArrayOfObject(data.users, unmarshalUser)\n };\n};\nconst unmarshalSetRulesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SetRulesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n rules: marshalling.unmarshalArrayOfObject(data.rules, unmarshalRule)\n };\n};\nconst marshalAddGroupMemberRequest = (request, defaults) => ({\n ...marshalling.resolveOneOf([\n { param: \"user_id\", value: request.userId },\n { param: \"application_id\", value: request.applicationId }\n ])\n});\nconst marshalAddGroupMembersRequest = (request, defaults) => ({\n application_ids: request.applicationIds,\n user_ids: request.userIds\n});\nconst marshalCreateAPIKeyRequest = (request, defaults) => ({\n default_project_id: request.defaultProjectId,\n description: request.description,\n expires_at: request.expiresAt,\n ...marshalling.resolveOneOf([\n { param: \"application_id\", value: request.applicationId },\n { param: \"user_id\", value: request.userId }\n ])\n});\nconst marshalCreateApplicationRequest = (request, defaults) => ({\n description: request.description,\n name: request.name || randomName(\"app\"),\n organization_id: request.organizationId ?? defaults.defaultOrganizationId,\n tags: request.tags\n});\nconst marshalCreateGroupRequest = (request, defaults) => ({\n description: request.description,\n name: request.name || randomName(\"grp\"),\n organization_id: request.organizationId ?? defaults.defaultOrganizationId,\n tags: request.tags\n});\nconst marshalCreateJWTRequest = (request, defaults) => ({\n referrer: request.referrer,\n user_id: request.userId\n});\nconst marshalRuleSpecs = (request, defaults) => ({\n condition: request.condition,\n permission_set_names: request.permissionSetNames,\n ...marshalling.resolveOneOf([\n { param: \"project_ids\", value: request.projectIds },\n { param: \"organization_id\", value: request.organizationId }\n ])\n});\nconst marshalCreatePolicyRequest = (request, defaults) => ({\n description: request.description,\n name: request.name || randomName(\"pol\"),\n organization_id: request.organizationId ?? defaults.defaultOrganizationId,\n rules: request.rules !== void 0 ? request.rules.map((elt) => marshalRuleSpecs(elt)) : void 0,\n tags: request.tags,\n ...marshalling.resolveOneOf([\n { param: \"user_id\", value: request.userId },\n { param: \"group_id\", value: request.groupId },\n { param: \"application_id\", value: request.applicationId },\n { param: \"no_principal\", value: request.noPrincipal }\n ])\n});\nconst marshalCreateSSHKeyRequest = (request, defaults) => ({\n name: request.name || randomName(\"key\"),\n project_id: request.projectId ?? defaults.defaultProjectId,\n public_key: request.publicKey\n});\nconst marshalCreateUserRequestMember = (request, defaults) => ({\n email: request.email,\n password: request.password,\n send_password_email: request.sendPasswordEmail,\n username: request.username\n});\nconst marshalCreateUserRequest = (request, defaults) => ({\n organization_id: request.organizationId ?? defaults.defaultOrganizationId,\n tags: request.tags,\n ...marshalling.resolveOneOf([\n { param: \"email\", value: request.email },\n {\n param: \"member\",\n value: request.member !== void 0 ? marshalCreateUserRequestMember(request.member) : void 0\n }\n ])\n});\nconst marshalRemoveGroupMemberRequest = (request, defaults) => ({\n ...marshalling.resolveOneOf([\n { param: \"user_id\", value: request.userId },\n { param: \"application_id\", value: request.applicationId }\n ])\n});\nconst marshalSetGroupMembersRequest = (request, defaults) => ({\n application_ids: request.applicationIds,\n user_ids: request.userIds\n});\nconst marshalSetRulesRequest = (request, defaults) => ({\n policy_id: request.policyId,\n rules: request.rules.map((elt) => marshalRuleSpecs(elt))\n});\nconst marshalUpdateAPIKeyRequest = (request, defaults) => ({\n default_project_id: request.defaultProjectId,\n description: request.description\n});\nconst marshalUpdateApplicationRequest = (request, defaults) => ({\n description: request.description,\n name: request.name,\n tags: request.tags\n});\nconst marshalUpdateGroupRequest = (request, defaults) => ({\n description: request.description,\n name: request.name,\n tags: request.tags\n});\nconst marshalUpdatePolicyRequest = (request, defaults) => ({\n description: request.description,\n name: request.name,\n tags: request.tags,\n ...marshalling.resolveOneOf([\n { param: \"user_id\", value: request.userId },\n { param: \"group_id\", value: request.groupId },\n { param: \"application_id\", value: request.applicationId },\n { param: \"no_principal\", value: request.noPrincipal }\n ])\n});\nconst marshalUpdateSSHKeyRequest = (request, defaults) => ({\n disabled: request.disabled,\n name: request.name\n});\nconst marshalUpdateUserRequest = (request, defaults) => ({\n tags: request.tags\n});\nexports.marshalAddGroupMemberRequest = marshalAddGroupMemberRequest;\nexports.marshalAddGroupMembersRequest = marshalAddGroupMembersRequest;\nexports.marshalCreateAPIKeyRequest = marshalCreateAPIKeyRequest;\nexports.marshalCreateApplicationRequest = marshalCreateApplicationRequest;\nexports.marshalCreateGroupRequest = marshalCreateGroupRequest;\nexports.marshalCreateJWTRequest = marshalCreateJWTRequest;\nexports.marshalCreatePolicyRequest = marshalCreatePolicyRequest;\nexports.marshalCreateSSHKeyRequest = marshalCreateSSHKeyRequest;\nexports.marshalCreateUserRequest = marshalCreateUserRequest;\nexports.marshalRemoveGroupMemberRequest = marshalRemoveGroupMemberRequest;\nexports.marshalSetGroupMembersRequest = marshalSetGroupMembersRequest;\nexports.marshalSetRulesRequest = marshalSetRulesRequest;\nexports.marshalUpdateAPIKeyRequest = marshalUpdateAPIKeyRequest;\nexports.marshalUpdateApplicationRequest = marshalUpdateApplicationRequest;\nexports.marshalUpdateGroupRequest = marshalUpdateGroupRequest;\nexports.marshalUpdatePolicyRequest = marshalUpdatePolicyRequest;\nexports.marshalUpdateSSHKeyRequest = marshalUpdateSSHKeyRequest;\nexports.marshalUpdateUserRequest = marshalUpdateUserRequest;\nexports.unmarshalAPIKey = unmarshalAPIKey;\nexports.unmarshalApplication = unmarshalApplication;\nexports.unmarshalEncodedJWT = unmarshalEncodedJWT;\nexports.unmarshalGroup = unmarshalGroup;\nexports.unmarshalJWT = unmarshalJWT;\nexports.unmarshalListAPIKeysResponse = unmarshalListAPIKeysResponse;\nexports.unmarshalListApplicationsResponse = unmarshalListApplicationsResponse;\nexports.unmarshalListGroupsResponse = unmarshalListGroupsResponse;\nexports.unmarshalListJWTsResponse = unmarshalListJWTsResponse;\nexports.unmarshalListLogsResponse = unmarshalListLogsResponse;\nexports.unmarshalListPermissionSetsResponse = unmarshalListPermissionSetsResponse;\nexports.unmarshalListPoliciesResponse = unmarshalListPoliciesResponse;\nexports.unmarshalListQuotaResponse = unmarshalListQuotaResponse;\nexports.unmarshalListRulesResponse = unmarshalListRulesResponse;\nexports.unmarshalListSSHKeysResponse = unmarshalListSSHKeysResponse;\nexports.unmarshalListUsersResponse = unmarshalListUsersResponse;\nexports.unmarshalLog = unmarshalLog;\nexports.unmarshalPolicy = unmarshalPolicy;\nexports.unmarshalQuotum = unmarshalQuotum;\nexports.unmarshalSSHKey = unmarshalSSHKey;\nexports.unmarshalSetRulesResponse = unmarshalSetRulesResponse;\nexports.unmarshalUser = unmarshalUser;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst CreateAPIKeyRequest = {\n description: {\n ignoreEmpty: true,\n maxLength: 200\n }\n};\nconst CreateApplicationRequest = {\n description: {\n ignoreEmpty: true,\n maxLength: 200\n },\n name: {\n maxLength: 64,\n minLength: 1,\n pattern: /^[a-zA-Z0-9\\(\\)\\._\\- ]+$/\n }\n};\nconst CreateGroupRequest = {\n description: {\n ignoreEmpty: true,\n maxLength: 200\n },\n name: {\n maxLength: 64,\n minLength: 1,\n pattern: /^[a-zA-Z0-9\\(\\)\\._\\- ]+$/\n }\n};\nconst CreatePolicyRequest = {\n description: {\n ignoreEmpty: true,\n maxLength: 200\n },\n name: {\n maxLength: 64,\n minLength: 1,\n pattern: /^[a-zA-Z0-9\\(\\)\\._\\- ]+$/\n }\n};\nconst CreateSSHKeyRequest = {\n name: {\n ignoreEmpty: true,\n maxLength: 1e3\n },\n publicKey: {\n maxLength: 65e3,\n minLength: 1\n }\n};\nconst CreateUserRequestMember = {\n email: {\n ignoreEmpty: true\n },\n password: {\n ignoreEmpty: true,\n maxLength: 72\n },\n username: {\n maxLength: 64,\n minLength: 2,\n pattern: /^[a-zA-Z0-9._-]+$/\n }\n};\nconst GetQuotumRequest = {\n quotumName: {\n minLength: 1\n }\n};\nconst ListAPIKeysRequest = {\n description: {\n maxLength: 200\n },\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThanOrEqual: 1,\n lessThanOrEqual: 100\n }\n};\nconst ListApplicationsRequest = {\n name: {\n maxLength: 64,\n minLength: 1,\n pattern: /^[a-zA-Z0-9\\(\\)\\._\\- ]+$/\n },\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThanOrEqual: 1,\n lessThanOrEqual: 100\n }\n};\nconst ListGroupsRequest = {\n name: {\n minLength: 1\n },\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThanOrEqual: 1,\n lessThanOrEqual: 100\n }\n};\nconst ListJWTsRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThanOrEqual: 1,\n lessThanOrEqual: 100\n }\n};\nconst ListLogsRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThanOrEqual: 1,\n lessThanOrEqual: 100\n }\n};\nconst ListPermissionSetsRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThanOrEqual: 1,\n lessThanOrEqual: 100\n }\n};\nconst ListPoliciesRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThanOrEqual: 1,\n lessThanOrEqual: 100\n },\n policyName: {\n minLength: 1\n }\n};\nconst ListQuotaRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThanOrEqual: 1,\n lessThanOrEqual: 100\n }\n};\nconst ListRulesRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThanOrEqual: 1,\n lessThanOrEqual: 100\n }\n};\nconst ListSSHKeysRequest = {\n name: {\n maxLength: 1e3,\n minLength: 1\n },\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThanOrEqual: 1,\n lessThanOrEqual: 100\n }\n};\nconst ListUsersRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThanOrEqual: 1,\n lessThanOrEqual: 100\n }\n};\nconst RuleSpecs = {\n condition: {\n maxLength: 255\n }\n};\nconst UpdateAPIKeyRequest = {\n description: {\n maxLength: 200\n }\n};\nconst UpdateApplicationRequest = {\n description: {\n maxLength: 200\n },\n name: {\n maxLength: 64,\n minLength: 1,\n pattern: /^[a-zA-Z0-9\\(\\)\\._\\- ]+$/\n }\n};\nconst UpdateGroupRequest = {\n description: {\n maxLength: 200\n },\n name: {\n maxLength: 64,\n minLength: 1,\n pattern: /^[a-zA-Z0-9\\(\\)\\._\\- ]+$/\n }\n};\nconst UpdatePolicyRequest = {\n description: {\n maxLength: 200\n },\n name: {\n maxLength: 64,\n minLength: 1,\n pattern: /^[a-zA-Z0-9\\(\\)\\._\\- ]+$/\n }\n};\nconst UpdateSSHKeyRequest = {\n name: {\n maxLength: 1e3\n }\n};\nexports.CreateAPIKeyRequest = CreateAPIKeyRequest;\nexports.CreateApplicationRequest = CreateApplicationRequest;\nexports.CreateGroupRequest = CreateGroupRequest;\nexports.CreatePolicyRequest = CreatePolicyRequest;\nexports.CreateSSHKeyRequest = CreateSSHKeyRequest;\nexports.CreateUserRequestMember = CreateUserRequestMember;\nexports.GetQuotumRequest = GetQuotumRequest;\nexports.ListAPIKeysRequest = ListAPIKeysRequest;\nexports.ListApplicationsRequest = ListApplicationsRequest;\nexports.ListGroupsRequest = ListGroupsRequest;\nexports.ListJWTsRequest = ListJWTsRequest;\nexports.ListLogsRequest = ListLogsRequest;\nexports.ListPermissionSetsRequest = ListPermissionSetsRequest;\nexports.ListPoliciesRequest = ListPoliciesRequest;\nexports.ListQuotaRequest = ListQuotaRequest;\nexports.ListRulesRequest = ListRulesRequest;\nexports.ListSSHKeysRequest = ListSSHKeysRequest;\nexports.ListUsersRequest = ListUsersRequest;\nexports.RuleSpecs = RuleSpecs;\nexports.UpdateAPIKeyRequest = UpdateAPIKeyRequest;\nexports.UpdateApplicationRequest = UpdateApplicationRequest;\nexports.UpdateGroupRequest = UpdateGroupRequest;\nexports.UpdatePolicyRequest = UpdatePolicyRequest;\nexports.UpdateSSHKeyRequest = UpdateSSHKeyRequest;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst index_gen = require(\"./v1beta1/index.gen.cjs\");\nexports.v1beta1 = index_gen;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst intervalRetrier = require(\"../../../internal/async/interval-retrier.cjs\");\nconst api = require(\"../../../scw/api.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst resourcePaginator = require(\"../../../scw/fetch/resource-paginator.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nconst marshalling_gen = require(\"./marshalling.gen.cjs\");\nconst jsonContentHeaders = {\n \"Content-Type\": \"application/json; charset=utf-8\"\n};\nclass API extends api.API {\n /** Lists the available regions of the API. */\n static LOCALITIES = [\"fr-par\"];\n pageOfListDeployments = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/inference/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/deployments`,\n urlParams: marshalling.urlParams(\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId],\n [\"tags\", request.tags]\n )\n },\n marshalling_gen.unmarshalListDeploymentsResponse\n );\n /**\n * List inference deployments. List all your inference deployments.\n *\n * @param request - The request {@link ListDeploymentsRequest}\n * @returns A Promise of ListDeploymentsResponse\n */\n listDeployments = (request = {}) => resourcePaginator.enrichForPagination(\"deployments\", this.pageOfListDeployments, request);\n /**\n * Get a deployment. Get the deployment for the given ID.\n *\n * @param request - The request {@link GetDeploymentRequest}\n * @returns A Promise of Deployment\n */\n getDeployment = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/inference/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/deployments/${marshalling.validatePathParam(\"deploymentId\", request.deploymentId)}`\n },\n marshalling_gen.unmarshalDeployment\n );\n /**\n * Waits for {@link Deployment} to be in a final state.\n *\n * @param request - The request {@link GetDeploymentRequest}\n * @param options - The waiting options\n * @returns A Promise of Deployment\n */\n waitForDeployment = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(!content_gen.DEPLOYMENT_TRANSIENT_STATUSES.includes(res.status))),\n this.getDeployment,\n request,\n options\n );\n /**\n * Create a deployment. Create a new inference deployment related to a\n * specific model.\n *\n * @param request - The request {@link CreateDeploymentRequest}\n * @returns A Promise of Deployment\n */\n createDeployment = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateDeploymentRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/inference/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/deployments`\n },\n marshalling_gen.unmarshalDeployment\n );\n /**\n * Update a deployment. Update an existing inference deployment.\n *\n * @param request - The request {@link UpdateDeploymentRequest}\n * @returns A Promise of Deployment\n */\n updateDeployment = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateDeploymentRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/inference/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/deployments/${marshalling.validatePathParam(\"deploymentId\", request.deploymentId)}`\n },\n marshalling_gen.unmarshalDeployment\n );\n /**\n * Delete a deployment. Delete an existing inference deployment.\n *\n * @param request - The request {@link DeleteDeploymentRequest}\n * @returns A Promise of Deployment\n */\n deleteDeployment = (request) => this.client.fetch(\n {\n method: \"DELETE\",\n path: `/inference/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/deployments/${marshalling.validatePathParam(\"deploymentId\", request.deploymentId)}`\n },\n marshalling_gen.unmarshalDeployment\n );\n /**\n * Get the CA certificate. Get the CA certificate used for the deployment of\n * private endpoints. The CA certificate will be returned as a PEM file.\n *\n * @param request - The request {@link GetDeploymentCertificateRequest}\n * @returns A Promise of Blob\n */\n getDeploymentCertificate = (request) => this.client.fetch({\n method: \"GET\",\n path: `/inference/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/deployments/${marshalling.validatePathParam(\"deploymentId\", request.deploymentId)}/certificate`,\n urlParams: marshalling.urlParams([\"dl\", 1]),\n responseType: \"blob\"\n });\n /**\n * Create an endpoint. Create a new Endpoint related to a specific deployment.\n *\n * @param request - The request {@link CreateEndpointRequest}\n * @returns A Promise of Endpoint\n */\n createEndpoint = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateEndpointRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/inference/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/endpoints`\n },\n marshalling_gen.unmarshalEndpoint\n );\n /**\n * Update an endpoint. Update an existing Endpoint.\n *\n * @param request - The request {@link UpdateEndpointRequest}\n * @returns A Promise of Endpoint\n */\n updateEndpoint = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateEndpointRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/inference/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/endpoints/${marshalling.validatePathParam(\"endpointId\", request.endpointId)}`\n },\n marshalling_gen.unmarshalEndpoint\n );\n /**\n * Delete an endpoint. Delete an existing Endpoint.\n *\n * @param request - The request {@link DeleteEndpointRequest}\n */\n deleteEndpoint = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/inference/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/endpoints/${marshalling.validatePathParam(\"endpointId\", request.endpointId)}`\n });\n pageOfListDeploymentACLRules = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/inference/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/deployments/${marshalling.validatePathParam(\"deploymentId\", request.deploymentId)}/acls`,\n urlParams: marshalling.urlParams(\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListDeploymentACLRulesResponse\n );\n /**\n * List your ACLs. List ACLs for a specific deployment.\n *\n * @param request - The request {@link ListDeploymentACLRulesRequest}\n * @returns A Promise of ListDeploymentACLRulesResponse\n */\n listDeploymentACLRules = (request) => resourcePaginator.enrichForPagination(\"rules\", this.pageOfListDeploymentACLRules, request);\n /**\n * Add new ACLs. Add new ACL rules for a specific deployment.\n *\n * @param request - The request {@link AddDeploymentACLRulesRequest}\n * @returns A Promise of AddDeploymentACLRulesResponse\n */\n addDeploymentACLRules = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalAddDeploymentACLRulesRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/inference/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/deployments/${marshalling.validatePathParam(\"deploymentId\", request.deploymentId)}/acls`\n },\n marshalling_gen.unmarshalAddDeploymentACLRulesResponse\n );\n /**\n * Set new ACL. Set new ACL rules for a specific deployment.\n *\n * @param request - The request {@link SetDeploymentACLRulesRequest}\n * @returns A Promise of SetDeploymentACLRulesResponse\n */\n setDeploymentACLRules = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalSetDeploymentACLRulesRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PUT\",\n path: `/inference/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/deployments/${marshalling.validatePathParam(\"deploymentId\", request.deploymentId)}/acls`\n },\n marshalling_gen.unmarshalSetDeploymentACLRulesResponse\n );\n /**\n * Delete an exising ACL.\n *\n * @param request - The request {@link DeleteDeploymentACLRuleRequest}\n */\n deleteDeploymentACLRule = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/inference/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/acls/${marshalling.validatePathParam(\"aclId\", request.aclId)}`\n });\n pageOfListModels = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/inference/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/models`,\n urlParams: marshalling.urlParams(\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId],\n [\"tags\", request.tags]\n )\n },\n marshalling_gen.unmarshalListModelsResponse\n );\n /**\n * List models. List all available models.\n *\n * @param request - The request {@link ListModelsRequest}\n * @returns A Promise of ListModelsResponse\n */\n listModels = (request = {}) => resourcePaginator.enrichForPagination(\"models\", this.pageOfListModels, request);\n /**\n * Get a model. Get the model for the given ID.\n *\n * @param request - The request {@link GetModelRequest}\n * @returns A Promise of Model\n */\n getModel = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/inference/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/models/${marshalling.validatePathParam(\"modelId\", request.modelId)}`\n },\n marshalling_gen.unmarshalModel\n );\n getModelEula = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/inference/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/models/${marshalling.validatePathParam(\"modelId\", request.modelId)}/eula`\n },\n marshalling_gen.unmarshalEula\n );\n pageOfListNodeTypes = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/inference/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/node-types`,\n urlParams: marshalling.urlParams(\n [\"include_disabled_types\", request.includeDisabledTypes],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListNodeTypesResponse\n );\n /**\n * List available node types. List all available node types. By default, the\n * node types returned in the list are ordered by creation date in ascending\n * order, though this can be modified via the `order_by` field.\n *\n * @param request - The request {@link ListNodeTypesRequest}\n * @returns A Promise of ListNodeTypesResponse\n */\n listNodeTypes = (request) => resourcePaginator.enrichForPagination(\"nodeTypes\", this.pageOfListNodeTypes, request);\n}\nexports.API = API;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst DEPLOYMENT_TRANSIENT_STATUSES = [\n \"creating\",\n \"deploying\",\n \"deleting\"\n];\nexports.DEPLOYMENT_TRANSIENT_STATUSES = DEPLOYMENT_TRANSIENT_STATUSES;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api_gen = require(\"./api.gen.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nconst validationRules_gen = require(\"./validation-rules.gen.cjs\");\nexports.API = api_gen.API;\nexports.DEPLOYMENT_TRANSIENT_STATUSES = content_gen.DEPLOYMENT_TRANSIENT_STATUSES;\nexports.ValidationRules = validationRules_gen;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst randomName = require(\"@scaleway/random-name\");\nconst json = require(\"../../../helpers/json.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst unmarshalEndpointPrivateNetworkDetails = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'EndpointPrivateNetworkDetails' failed as data isn't a dictionary.`\n );\n }\n return {\n privateNetworkId: data.private_network_id\n };\n};\nconst unmarshalEndpointPublicAccessDetails = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'EndpointPublicAccessDetails' failed as data isn't a dictionary.`\n );\n }\n return {};\n};\nconst unmarshalEndpoint = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Endpoint' failed as data isn't a dictionary.`\n );\n }\n return {\n disableAuth: data.disable_auth,\n id: data.id,\n privateNetwork: data.private_network ? unmarshalEndpointPrivateNetworkDetails(data.private_network) : void 0,\n publicAccess: data.public_access ? unmarshalEndpointPublicAccessDetails(data.public_access) : void 0,\n url: data.url\n };\n};\nconst unmarshalDeployment = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Deployment' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n endpoints: marshalling.unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint),\n errorMessage: data.error_message,\n id: data.id,\n maxSize: data.max_size,\n minSize: data.min_size,\n modelId: data.model_id,\n modelName: data.model_name,\n name: data.name,\n nodeType: data.node_type,\n projectId: data.project_id,\n region: data.region,\n size: data.size,\n status: data.status,\n tags: data.tags,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalModelS3Model = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ModelS3Model' failed as data isn't a dictionary.`\n );\n }\n return {\n nodeType: data.node_type,\n pythonDependencies: data.python_dependencies,\n s3Url: data.s3_url,\n tritonServerVersion: data.triton_server_version\n };\n};\nconst unmarshalModel = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Model' failed as data isn't a dictionary.`\n );\n }\n return {\n compatibleNodeTypes: data.compatible_node_types,\n createdAt: marshalling.unmarshalDate(data.created_at),\n description: data.description,\n hasEula: data.has_eula,\n id: data.id,\n isPublic: data.is_public,\n name: data.name,\n projectId: data.project_id,\n provider: data.provider,\n quantizationLevel: data.quantization_level,\n region: data.region,\n s3Model: data.s3_model ? unmarshalModelS3Model(data.s3_model) : void 0,\n tags: data.tags,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalACLRule = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ACLRule' failed as data isn't a dictionary.`\n );\n }\n return {\n description: data.description,\n id: data.id,\n ip: data.ip\n };\n};\nconst unmarshalAddDeploymentACLRulesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'AddDeploymentACLRulesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n rules: marshalling.unmarshalArrayOfObject(data.rules, unmarshalACLRule)\n };\n};\nconst unmarshalEula = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Eula' failed as data isn't a dictionary.`\n );\n }\n return {\n content: data.content\n };\n};\nconst unmarshalListDeploymentACLRulesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListDeploymentACLRulesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n rules: marshalling.unmarshalArrayOfObject(data.rules, unmarshalACLRule),\n totalCount: data.total_count\n };\n};\nconst unmarshalListDeploymentsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListDeploymentsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n deployments: marshalling.unmarshalArrayOfObject(data.deployments, unmarshalDeployment),\n totalCount: data.total_count\n };\n};\nconst unmarshalListModelsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListModelsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n models: marshalling.unmarshalArrayOfObject(data.models, unmarshalModel),\n totalCount: data.total_count\n };\n};\nconst unmarshalNodeType = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'NodeType' failed as data isn't a dictionary.`\n );\n }\n return {\n beta: data.beta,\n createdAt: marshalling.unmarshalDate(data.created_at),\n description: data.description,\n disabled: data.disabled,\n gpus: data.gpus,\n memory: data.memory,\n name: data.name,\n region: data.region,\n stockStatus: data.stock_status,\n updatedAt: marshalling.unmarshalDate(data.updated_at),\n vcpus: data.vcpus,\n vram: data.vram\n };\n};\nconst unmarshalListNodeTypesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListNodeTypesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n nodeTypes: marshalling.unmarshalArrayOfObject(data.node_types, unmarshalNodeType),\n totalCount: data.total_count\n };\n};\nconst unmarshalSetDeploymentACLRulesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SetDeploymentACLRulesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n rules: marshalling.unmarshalArrayOfObject(data.rules, unmarshalACLRule)\n };\n};\nconst marshalACLRuleRequest = (request, defaults) => ({\n description: request.description,\n ip: request.ip\n});\nconst marshalAddDeploymentACLRulesRequest = (request, defaults) => ({\n acls: request.acls !== void 0 ? request.acls.map((elt) => marshalACLRuleRequest(elt)) : void 0\n});\nconst marshalEndpointSpecPrivateNetwork = (request, defaults) => ({\n private_network_id: request.privateNetworkId\n});\nconst marshalEndpointSpecPublic = (request, defaults) => ({});\nconst marshalEndpointSpec = (request, defaults) => ({\n disable_auth: request.disableAuth,\n ...marshalling.resolveOneOf([\n {\n param: \"public\",\n value: request.public !== void 0 ? marshalEndpointSpecPublic(request.public) : void 0\n },\n {\n param: \"private_network\",\n value: request.privateNetwork !== void 0 ? marshalEndpointSpecPrivateNetwork(request.privateNetwork) : void 0\n }\n ])\n});\nconst marshalCreateDeploymentRequest = (request, defaults) => ({\n accept_eula: request.acceptEula,\n endpoints: request.endpoints.map((elt) => marshalEndpointSpec(elt)),\n max_size: request.maxSize,\n min_size: request.minSize,\n model_name: request.modelName,\n name: request.name || randomName(\"inference\"),\n node_type: request.nodeType,\n project_id: request.projectId ?? defaults.defaultProjectId,\n tags: request.tags\n});\nconst marshalCreateEndpointRequest = (request, defaults) => ({\n deployment_id: request.deploymentId,\n endpoint: marshalEndpointSpec(request.endpoint)\n});\nconst marshalSetDeploymentACLRulesRequest = (request, defaults) => ({\n acls: request.acls !== void 0 ? request.acls.map((elt) => marshalACLRuleRequest(elt)) : void 0\n});\nconst marshalUpdateDeploymentRequest = (request, defaults) => ({\n max_size: request.maxSize,\n min_size: request.minSize,\n name: request.name,\n tags: request.tags\n});\nconst marshalUpdateEndpointRequest = (request, defaults) => ({\n disable_auth: request.disableAuth\n});\nexports.marshalAddDeploymentACLRulesRequest = marshalAddDeploymentACLRulesRequest;\nexports.marshalCreateDeploymentRequest = marshalCreateDeploymentRequest;\nexports.marshalCreateEndpointRequest = marshalCreateEndpointRequest;\nexports.marshalSetDeploymentACLRulesRequest = marshalSetDeploymentACLRulesRequest;\nexports.marshalUpdateDeploymentRequest = marshalUpdateDeploymentRequest;\nexports.marshalUpdateEndpointRequest = marshalUpdateEndpointRequest;\nexports.unmarshalAddDeploymentACLRulesResponse = unmarshalAddDeploymentACLRulesResponse;\nexports.unmarshalDeployment = unmarshalDeployment;\nexports.unmarshalEndpoint = unmarshalEndpoint;\nexports.unmarshalEula = unmarshalEula;\nexports.unmarshalListDeploymentACLRulesResponse = unmarshalListDeploymentACLRulesResponse;\nexports.unmarshalListDeploymentsResponse = unmarshalListDeploymentsResponse;\nexports.unmarshalListModelsResponse = unmarshalListModelsResponse;\nexports.unmarshalListNodeTypesResponse = unmarshalListNodeTypesResponse;\nexports.unmarshalModel = unmarshalModel;\nexports.unmarshalSetDeploymentACLRulesResponse = unmarshalSetDeploymentACLRulesResponse;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst CreateDeploymentRequest = {\n maxSize: {\n greaterThanOrEqual: 1,\n lessThanOrEqual: 50\n },\n minSize: {\n greaterThanOrEqual: 1,\n lessThanOrEqual: 50\n },\n modelName: {\n maxLength: 255,\n minLength: 0,\n pattern: /^[\\w-_]+\\/[\\w-_.]+(:[\\w]+)?$/\n },\n name: {\n maxLength: 255,\n minLength: 1,\n pattern: /^[A-Za-z0-9-_]+$/\n },\n nodeType: {\n maxLength: 64,\n minLength: 1\n }\n};\nconst ListDeploymentsRequest = {\n name: {\n maxLength: 255,\n minLength: 1\n }\n};\nconst ListModelsRequest = {\n name: {\n maxLength: 255,\n minLength: 1\n }\n};\nconst UpdateDeploymentRequest = {\n maxSize: {\n greaterThanOrEqual: 1,\n lessThanOrEqual: 50\n },\n minSize: {\n greaterThanOrEqual: 1,\n lessThanOrEqual: 50\n },\n name: {\n maxLength: 255,\n minLength: 1\n }\n};\nexports.CreateDeploymentRequest = CreateDeploymentRequest;\nexports.ListDeploymentsRequest = ListDeploymentsRequest;\nexports.ListModelsRequest = ListModelsRequest;\nexports.UpdateDeploymentRequest = UpdateDeploymentRequest;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst index = require(\"./v1/index.cjs\");\nexports.v1 = index;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api = require(\"../../../scw/api.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst resourcePaginator = require(\"../../../scw/fetch/resource-paginator.cjs\");\nconst marshalling_gen = require(\"./marshalling.gen.cjs\");\nconst jsonContentHeaders = {\n \"Content-Type\": \"application/json; charset=utf-8\"\n};\nclass API extends api.API {\n /** Lists the available zones of the API. */\n static LOCALITIES = [\n \"fr-par-1\",\n \"fr-par-2\",\n \"fr-par-3\",\n \"nl-ams-1\",\n \"nl-ams-2\",\n \"nl-ams-3\",\n \"pl-waw-1\",\n \"pl-waw-2\",\n \"pl-waw-3\"\n ];\n /**\n * Get availability. Get availability for all Instance types.\n *\n * @param request - The request {@link GetServerTypesAvailabilityRequest}\n * @returns A Promise of GetServerTypesAvailabilityResponse\n */\n getServerTypesAvailability = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/products/servers/availability`,\n urlParams: marshalling.urlParams(\n [\"page\", request.page],\n [\"per_page\", request.perPage ?? this.client.settings.defaultPageSize]\n )\n },\n marshalling_gen.unmarshalGetServerTypesAvailabilityResponse\n );\n /**\n * List Instance types. List available Instance types and their technical\n * details.\n *\n * @param request - The request {@link ListServersTypesRequest}\n * @returns A Promise of ListServersTypesResponse\n */\n listServersTypes = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/products/servers`,\n urlParams: marshalling.urlParams(\n [\"page\", request.page],\n [\"per_page\", request.perPage ?? this.client.settings.defaultPageSize]\n )\n },\n marshalling_gen.unmarshalListServersTypesResponse\n );\n /**\n * List volume types. List all volume types and their technical details.\n *\n * @param request - The request {@link ListVolumesTypesRequest}\n * @returns A Promise of ListVolumesTypesResponse\n */\n listVolumesTypes = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/products/volumes`,\n urlParams: marshalling.urlParams(\n [\"page\", request.page],\n [\"per_page\", request.perPage ?? this.client.settings.defaultPageSize]\n )\n },\n marshalling_gen.unmarshalListVolumesTypesResponse\n );\n pageOfListServers = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers`,\n urlParams: marshalling.urlParams(\n [\"commercial_type\", request.commercialType],\n [\"name\", request.name],\n [\"order\", request.order],\n [\"organization\", request.organization],\n [\"page\", request.page],\n [\"per_page\", request.perPage ?? this.client.settings.defaultPageSize],\n [\"private_ip\", request.privateIp],\n [\"private_network\", request.privateNetwork],\n [\n \"private_networks\",\n request.privateNetworks && request.privateNetworks.length > 0 ? request.privateNetworks.join(\",\") : void 0\n ],\n [\"private_nic_mac_address\", request.privateNicMacAddress],\n [\"project\", request.project],\n [\n \"servers\",\n request.servers && request.servers.length > 0 ? request.servers.join(\",\") : void 0\n ],\n [\"state\", request.state],\n [\n \"tags\",\n request.tags && request.tags.length > 0 ? request.tags.join(\",\") : void 0\n ],\n [\"with_ip\", request.withIp],\n [\"without_ip\", request.withoutIp]\n )\n },\n marshalling_gen.unmarshalListServersResponse\n );\n /**\n * List all Instances. List all Instances in a specified Availability Zone,\n * e.g. `fr-par-1`.\n *\n * @param request - The request {@link ListServersRequest}\n * @returns A Promise of ListServersResponse\n */\n listServers = (request = {}) => resourcePaginator.enrichForPagination(\"servers\", this.pageOfListServers, request);\n _createServer = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateServerRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers`\n },\n marshalling_gen.unmarshalCreateServerResponse\n );\n /**\n * Delete an Instance. Delete the Instance with the specified ID.\n *\n * @param request - The request {@link DeleteServerRequest}\n */\n deleteServer = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}`\n });\n /**\n * Get an Instance. Get the details of a specified Instance.\n *\n * @param request - The request {@link GetServerRequest}\n * @returns A Promise of GetServerResponse\n */\n getServer = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}`\n },\n marshalling_gen.unmarshalGetServerResponse\n );\n _setServer = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalSetServerRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PUT\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"id\", request.id)}`\n },\n marshalling_gen.unmarshalSetServerResponse\n );\n _updateServer = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateServerRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}`\n },\n marshalling_gen.unmarshalUpdateServerResponse\n );\n /**\n * List Instance actions. List all actions (e.g. power on, power off, reboot)\n * that can currently be performed on an Instance.\n *\n * @param request - The request {@link ListServerActionsRequest}\n * @returns A Promise of ListServerActionsResponse\n */\n listServerActions = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/action`\n },\n marshalling_gen.unmarshalListServerActionsResponse\n );\n /**\n * Perform action. Perform an action on an Instance. Available actions are:\n * `poweron`: Start a stopped Instance. `poweroff`: Fully stop the Instance\n * and release the hypervisor slot. `stop_in_place`: Stop the Instance, but\n * keep the slot on the hypervisor. `reboot`: Stop the instance and restart\n * it. `backup`: Create an image with all the volumes of an Instance.\n * `terminate`: Delete the Instance along with its attached volumes, except\n * for SBS volumes. `enable_routed_ip`: Migrate the Instance to the new\n * network stack.\n *\n * Keep in mind that `terminate` an Instance will result in the deletion of\n * `l_ssd`, `b_ssd` and `scratch` volumes types, `sbs_volume` volumes type\n * will only be detached. If you want to preserve your volumes, you should\n * detach them before the Instance deletion or `terminate` action.\n *\n * @param request - The request {@link ServerActionRequest}\n * @returns A Promise of ServerActionResponse\n */\n serverAction = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalServerActionRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/action`\n },\n marshalling_gen.unmarshalServerActionResponse\n );\n /**\n * List user data. List all user data keys registered on a specified Instance.\n *\n * @param request - The request {@link ListServerUserDataRequest}\n * @returns A Promise of ListServerUserDataResponse\n */\n listServerUserData = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/user_data`\n },\n marshalling_gen.unmarshalListServerUserDataResponse\n );\n /**\n * Delete user data. Delete the specified key from an Instance's user data.\n *\n * @param request - The request {@link DeleteServerUserDataRequest}\n */\n deleteServerUserData = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/user_data/${marshalling.validatePathParam(\"key\", request.key)}`\n });\n attachServerVolume = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalAttachServerVolumeRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/attach-volume`\n },\n marshalling_gen.unmarshalAttachServerVolumeResponse\n );\n detachServerVolume = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalDetachServerVolumeRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/detach-volume`\n },\n marshalling_gen.unmarshalDetachServerVolumeResponse\n );\n pageOfListImages = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/images`,\n urlParams: marshalling.urlParams(\n [\"arch\", request.arch],\n [\"name\", request.name],\n [\"organization\", request.organization],\n [\"page\", request.page],\n [\"per_page\", request.perPage ?? this.client.settings.defaultPageSize],\n [\"project\", request.project],\n [\"public\", request.public],\n [\"tags\", request.tags]\n )\n },\n marshalling_gen.unmarshalListImagesResponse\n );\n /**\n * List Instance images. List all existing Instance images.\n *\n * @param request - The request {@link ListImagesRequest}\n * @returns A Promise of ListImagesResponse\n */\n listImages = (request = {}) => resourcePaginator.enrichForPagination(\"images\", this.pageOfListImages, request);\n /**\n * Get an Instance image. Get details of an image with the specified ID.\n *\n * @param request - The request {@link GetImageRequest}\n * @returns A Promise of GetImageResponse\n */\n getImage = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/images/${marshalling.validatePathParam(\"imageId\", request.imageId)}`\n },\n marshalling_gen.unmarshalGetImageResponse\n );\n /**\n * Create an Instance image. Create an Instance image from the specified\n * snapshot ID.\n *\n * @param request - The request {@link CreateImageRequest}\n * @returns A Promise of CreateImageResponse\n */\n createImage = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateImageRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/images`\n },\n marshalling_gen.unmarshalCreateImageResponse\n );\n _setImage = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalSetImageRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PUT\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/images/${marshalling.validatePathParam(\"id\", request.id)}`\n },\n marshalling_gen.unmarshalSetImageResponse\n );\n /**\n * Update image. Update the properties of an image.\n *\n * @param request - The request {@link UpdateImageRequest}\n * @returns A Promise of UpdateImageResponse\n */\n updateImage = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateImageRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/images/${marshalling.validatePathParam(\"imageId\", request.imageId)}`\n },\n marshalling_gen.unmarshalUpdateImageResponse\n );\n /**\n * Delete an Instance image. Delete the image with the specified ID.\n *\n * @param request - The request {@link DeleteImageRequest}\n */\n deleteImage = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/images/${marshalling.validatePathParam(\"imageId\", request.imageId)}`\n });\n pageOfListSnapshots = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/snapshots`,\n urlParams: marshalling.urlParams(\n [\"base_volume_id\", request.baseVolumeId],\n [\"name\", request.name],\n [\"organization\", request.organization],\n [\"page\", request.page],\n [\"per_page\", request.perPage ?? this.client.settings.defaultPageSize],\n [\"project\", request.project],\n [\"tags\", request.tags]\n )\n },\n marshalling_gen.unmarshalListSnapshotsResponse\n );\n /**\n * List snapshots. List all snapshots of an Organization in a specified\n * Availability Zone.\n *\n * @param request - The request {@link ListSnapshotsRequest}\n * @returns A Promise of ListSnapshotsResponse\n */\n listSnapshots = (request = {}) => resourcePaginator.enrichForPagination(\"snapshots\", this.pageOfListSnapshots, request);\n /**\n * Create a snapshot from a specified volume or from a QCOW2 file. Create a\n * snapshot from a specified volume or from a QCOW2 file in a specified\n * Availability Zone.\n *\n * @param request - The request {@link CreateSnapshotRequest}\n * @returns A Promise of CreateSnapshotResponse\n */\n createSnapshot = (request = {}) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateSnapshotRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/snapshots`\n },\n marshalling_gen.unmarshalCreateSnapshotResponse\n );\n /**\n * Get a snapshot. Get details of a snapshot with the specified ID.\n *\n * @param request - The request {@link GetSnapshotRequest}\n * @returns A Promise of GetSnapshotResponse\n */\n getSnapshot = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/snapshots/${marshalling.validatePathParam(\"snapshotId\", request.snapshotId)}`\n },\n marshalling_gen.unmarshalGetSnapshotResponse\n );\n _setSnapshot = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalSetSnapshotRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PUT\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/snapshots/${marshalling.validatePathParam(\"snapshotId\", request.snapshotId)}`\n },\n marshalling_gen.unmarshalSetSnapshotResponse\n );\n /**\n * Update a snapshot. Update the properties of a snapshot.\n *\n * @param request - The request {@link UpdateSnapshotRequest}\n * @returns A Promise of UpdateSnapshotResponse\n */\n updateSnapshot = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateSnapshotRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/snapshots/${marshalling.validatePathParam(\"snapshotId\", request.snapshotId)}`\n },\n marshalling_gen.unmarshalUpdateSnapshotResponse\n );\n /**\n * Delete a snapshot. Delete the snapshot with the specified ID.\n *\n * @param request - The request {@link DeleteSnapshotRequest}\n */\n deleteSnapshot = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/snapshots/${marshalling.validatePathParam(\"snapshotId\", request.snapshotId)}`\n });\n /**\n * Export a snapshot. Export a snapshot to a specified S3 bucket in the same\n * region.\n *\n * @param request - The request {@link ExportSnapshotRequest}\n * @returns A Promise of ExportSnapshotResponse\n */\n exportSnapshot = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalExportSnapshotRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/snapshots/${marshalling.validatePathParam(\"snapshotId\", request.snapshotId)}/export`\n },\n marshalling_gen.unmarshalExportSnapshotResponse\n );\n pageOfListVolumes = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/volumes`,\n urlParams: marshalling.urlParams(\n [\"name\", request.name],\n [\"organization\", request.organization],\n [\"page\", request.page],\n [\"per_page\", request.perPage ?? this.client.settings.defaultPageSize],\n [\"project\", request.project],\n [\n \"tags\",\n request.tags && request.tags.length > 0 ? request.tags.join(\",\") : void 0\n ],\n [\"volume_type\", request.volumeType]\n )\n },\n marshalling_gen.unmarshalListVolumesResponse\n );\n /**\n * List volumes. List volumes in the specified Availability Zone. You can\n * filter the output by volume type.\n *\n * @param request - The request {@link ListVolumesRequest}\n * @returns A Promise of ListVolumesResponse\n */\n listVolumes = (request = {}) => resourcePaginator.enrichForPagination(\"volumes\", this.pageOfListVolumes, request);\n /**\n * Create a volume. Create a volume of a specified type in an Availability\n * Zone.\n *\n * @param request - The request {@link CreateVolumeRequest}\n * @returns A Promise of CreateVolumeResponse\n */\n createVolume = (request = {}) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateVolumeRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/volumes`\n },\n marshalling_gen.unmarshalCreateVolumeResponse\n );\n /**\n * Get a volume. Get details of a volume with the specified ID.\n *\n * @param request - The request {@link GetVolumeRequest}\n * @returns A Promise of GetVolumeResponse\n */\n getVolume = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/volumes/${marshalling.validatePathParam(\"volumeId\", request.volumeId)}`\n },\n marshalling_gen.unmarshalGetVolumeResponse\n );\n /**\n * Update a volume. Replace the name and/or size properties of a volume\n * specified by its ID, with the specified value(s). Any volume name can be\n * changed, however only `b_ssd` volumes can currently be increased in size.\n *\n * @param request - The request {@link UpdateVolumeRequest}\n * @returns A Promise of UpdateVolumeResponse\n */\n updateVolume = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateVolumeRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/volumes/${marshalling.validatePathParam(\"volumeId\", request.volumeId)}`\n },\n marshalling_gen.unmarshalUpdateVolumeResponse\n );\n /**\n * Delete a volume. Delete the volume with the specified ID.\n *\n * @param request - The request {@link DeleteVolumeRequest}\n */\n deleteVolume = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/volumes/${marshalling.validatePathParam(\"volumeId\", request.volumeId)}`\n });\n pageOfListSecurityGroups = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/security_groups`,\n urlParams: marshalling.urlParams(\n [\"name\", request.name],\n [\"organization\", request.organization],\n [\"page\", request.page],\n [\"per_page\", request.perPage ?? this.client.settings.defaultPageSize],\n [\"project\", request.project],\n [\"project_default\", request.projectDefault],\n [\n \"tags\",\n request.tags && request.tags.length > 0 ? request.tags.join(\",\") : void 0\n ]\n )\n },\n marshalling_gen.unmarshalListSecurityGroupsResponse\n );\n /**\n * List security groups. List all existing security groups.\n *\n * @param request - The request {@link ListSecurityGroupsRequest}\n * @returns A Promise of ListSecurityGroupsResponse\n */\n listSecurityGroups = (request = {}) => resourcePaginator.enrichForPagination(\n \"securityGroups\",\n this.pageOfListSecurityGroups,\n request\n );\n /**\n * Create a security group. Create a security group with a specified name and\n * description.\n *\n * @param request - The request {@link CreateSecurityGroupRequest}\n * @returns A Promise of CreateSecurityGroupResponse\n */\n createSecurityGroup = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateSecurityGroupRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/security_groups`\n },\n marshalling_gen.unmarshalCreateSecurityGroupResponse\n );\n /**\n * Get a security group. Get the details of a security group with the\n * specified ID.\n *\n * @param request - The request {@link GetSecurityGroupRequest}\n * @returns A Promise of GetSecurityGroupResponse\n */\n getSecurityGroup = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/security_groups/${marshalling.validatePathParam(\"securityGroupId\", request.securityGroupId)}`\n },\n marshalling_gen.unmarshalGetSecurityGroupResponse\n );\n /**\n * Delete a security group. Delete a security group with the specified ID.\n *\n * @param request - The request {@link DeleteSecurityGroupRequest}\n */\n deleteSecurityGroup = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/security_groups/${marshalling.validatePathParam(\"securityGroupId\", request.securityGroupId)}`\n });\n _setSecurityGroup = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalSetSecurityGroupRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PUT\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/security_groups/${marshalling.validatePathParam(\"id\", request.id)}`\n },\n marshalling_gen.unmarshalSetSecurityGroupResponse\n );\n /**\n * Update a security group. Update the properties of security group.\n *\n * @param request - The request {@link UpdateSecurityGroupRequest}\n * @returns A Promise of UpdateSecurityGroupResponse\n */\n updateSecurityGroup = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateSecurityGroupRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/security_groups/${marshalling.validatePathParam(\"securityGroupId\", request.securityGroupId)}`\n },\n marshalling_gen.unmarshalUpdateSecurityGroupResponse\n );\n /**\n * Get default rules. Lists the default rules applied to all the security\n * groups.\n *\n * @param request - The request {@link ListDefaultSecurityGroupRulesRequest}\n * @returns A Promise of ListSecurityGroupRulesResponse\n */\n listDefaultSecurityGroupRules = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/security_groups/default/rules`\n },\n marshalling_gen.unmarshalListSecurityGroupRulesResponse\n );\n pageOfListSecurityGroupRules = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/security_groups/${marshalling.validatePathParam(\"securityGroupId\", request.securityGroupId)}/rules`,\n urlParams: marshalling.urlParams(\n [\"page\", request.page],\n [\"per_page\", request.perPage ?? this.client.settings.defaultPageSize]\n )\n },\n marshalling_gen.unmarshalListSecurityGroupRulesResponse\n );\n /**\n * List rules. List the rules of the a specified security group ID.\n *\n * @param request - The request {@link ListSecurityGroupRulesRequest}\n * @returns A Promise of ListSecurityGroupRulesResponse\n */\n listSecurityGroupRules = (request) => resourcePaginator.enrichForPagination(\"rules\", this.pageOfListSecurityGroupRules, request);\n /**\n * Create rule. Create a rule in the specified security group ID.\n *\n * @param request - The request {@link CreateSecurityGroupRuleRequest}\n * @returns A Promise of CreateSecurityGroupRuleResponse\n */\n createSecurityGroupRule = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateSecurityGroupRuleRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/security_groups/${marshalling.validatePathParam(\"securityGroupId\", request.securityGroupId)}/rules`\n },\n marshalling_gen.unmarshalCreateSecurityGroupRuleResponse\n );\n /**\n * Update all the rules of a security group. Replaces the existing rules of\n * the security group with the rules provided. This endpoint supports the\n * update of existing rules, creation of new rules and deletion of existing\n * rules when they are not passed in the request.\n *\n * @param request - The request {@link SetSecurityGroupRulesRequest}\n * @returns A Promise of SetSecurityGroupRulesResponse\n */\n setSecurityGroupRules = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalSetSecurityGroupRulesRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PUT\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/security_groups/${marshalling.validatePathParam(\"securityGroupId\", request.securityGroupId)}/rules`\n },\n marshalling_gen.unmarshalSetSecurityGroupRulesResponse\n );\n /**\n * Delete rule. Delete a security group rule with the specified ID.\n *\n * @param request - The request {@link DeleteSecurityGroupRuleRequest}\n */\n deleteSecurityGroupRule = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/security_groups/${marshalling.validatePathParam(\"securityGroupId\", request.securityGroupId)}/rules/${marshalling.validatePathParam(\"securityGroupRuleId\", request.securityGroupRuleId)}`\n });\n /**\n * Get rule. Get details of a security group rule with the specified ID.\n *\n * @param request - The request {@link GetSecurityGroupRuleRequest}\n * @returns A Promise of GetSecurityGroupRuleResponse\n */\n getSecurityGroupRule = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/security_groups/${marshalling.validatePathParam(\"securityGroupId\", request.securityGroupId)}/rules/${marshalling.validatePathParam(\"securityGroupRuleId\", request.securityGroupRuleId)}`\n },\n marshalling_gen.unmarshalGetSecurityGroupRuleResponse\n );\n _setSecurityGroupRule = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalSetSecurityGroupRuleRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PUT\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/security_groups/${marshalling.validatePathParam(\"securityGroupId\", request.securityGroupId)}/rules/${marshalling.validatePathParam(\"securityGroupRuleId\", request.securityGroupRuleId)}`\n },\n marshalling_gen.unmarshalSetSecurityGroupRuleResponse\n );\n /**\n * Update security group rule. Update the properties of a rule from a\n * specified security group.\n *\n * @param request - The request {@link UpdateSecurityGroupRuleRequest}\n * @returns A Promise of UpdateSecurityGroupRuleResponse\n */\n updateSecurityGroupRule = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateSecurityGroupRuleRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/security_groups/${marshalling.validatePathParam(\"securityGroupId\", request.securityGroupId)}/rules/${marshalling.validatePathParam(\"securityGroupRuleId\", request.securityGroupRuleId)}`\n },\n marshalling_gen.unmarshalUpdateSecurityGroupRuleResponse\n );\n pageOfListPlacementGroups = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/placement_groups`,\n urlParams: marshalling.urlParams(\n [\"name\", request.name],\n [\"organization\", request.organization],\n [\"page\", request.page],\n [\"per_page\", request.perPage ?? this.client.settings.defaultPageSize],\n [\"project\", request.project],\n [\n \"tags\",\n request.tags && request.tags.length > 0 ? request.tags.join(\",\") : void 0\n ]\n )\n },\n marshalling_gen.unmarshalListPlacementGroupsResponse\n );\n /**\n * List placement groups. List all placement groups in a specified\n * Availability Zone.\n *\n * @param request - The request {@link ListPlacementGroupsRequest}\n * @returns A Promise of ListPlacementGroupsResponse\n */\n listPlacementGroups = (request = {}) => resourcePaginator.enrichForPagination(\n \"placementGroups\",\n this.pageOfListPlacementGroups,\n request\n );\n /**\n * Create a placement group. Create a new placement group in a specified\n * Availability Zone.\n *\n * @param request - The request {@link CreatePlacementGroupRequest}\n * @returns A Promise of CreatePlacementGroupResponse\n */\n createPlacementGroup = (request = {}) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreatePlacementGroupRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/placement_groups`\n },\n marshalling_gen.unmarshalCreatePlacementGroupResponse\n );\n /**\n * Get a placement group. Get the specified placement group.\n *\n * @param request - The request {@link GetPlacementGroupRequest}\n * @returns A Promise of GetPlacementGroupResponse\n */\n getPlacementGroup = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/placement_groups/${marshalling.validatePathParam(\"placementGroupId\", request.placementGroupId)}`\n },\n marshalling_gen.unmarshalGetPlacementGroupResponse\n );\n /**\n * Set placement group. Set all parameters of the specified placement group.\n *\n * @param request - The request {@link SetPlacementGroupRequest}\n * @returns A Promise of SetPlacementGroupResponse\n */\n setPlacementGroup = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalSetPlacementGroupRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PUT\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/placement_groups/${marshalling.validatePathParam(\"placementGroupId\", request.placementGroupId)}`\n },\n marshalling_gen.unmarshalSetPlacementGroupResponse\n );\n /**\n * Update a placement group. Update one or more parameter of the specified\n * placement group.\n *\n * @param request - The request {@link UpdatePlacementGroupRequest}\n * @returns A Promise of UpdatePlacementGroupResponse\n */\n updatePlacementGroup = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdatePlacementGroupRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/placement_groups/${marshalling.validatePathParam(\"placementGroupId\", request.placementGroupId)}`\n },\n marshalling_gen.unmarshalUpdatePlacementGroupResponse\n );\n /**\n * Delete the specified placement group.\n *\n * @param request - The request {@link DeletePlacementGroupRequest}\n */\n deletePlacementGroup = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/placement_groups/${marshalling.validatePathParam(\"placementGroupId\", request.placementGroupId)}`\n });\n /**\n * Get placement group servers. Get all Instances belonging to the specified\n * placement group.\n *\n * @param request - The request {@link GetPlacementGroupServersRequest}\n * @returns A Promise of GetPlacementGroupServersResponse\n */\n getPlacementGroupServers = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/placement_groups/${marshalling.validatePathParam(\"placementGroupId\", request.placementGroupId)}/servers`\n },\n marshalling_gen.unmarshalGetPlacementGroupServersResponse\n );\n /**\n * Set placement group servers. Set all Instances belonging to the specified\n * placement group.\n *\n * @param request - The request {@link SetPlacementGroupServersRequest}\n * @returns A Promise of SetPlacementGroupServersResponse\n */\n setPlacementGroupServers = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalSetPlacementGroupServersRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PUT\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/placement_groups/${marshalling.validatePathParam(\"placementGroupId\", request.placementGroupId)}/servers`\n },\n marshalling_gen.unmarshalSetPlacementGroupServersResponse\n );\n /**\n * Update placement group servers. Update all Instances belonging to the\n * specified placement group.\n *\n * @param request - The request {@link UpdatePlacementGroupServersRequest}\n * @returns A Promise of UpdatePlacementGroupServersResponse\n */\n updatePlacementGroupServers = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdatePlacementGroupServersRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/placement_groups/${marshalling.validatePathParam(\"placementGroupId\", request.placementGroupId)}/servers`\n },\n marshalling_gen.unmarshalUpdatePlacementGroupServersResponse\n );\n pageOfListIps = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/ips`,\n urlParams: marshalling.urlParams(\n [\"name\", request.name],\n [\"organization\", request.organization],\n [\"page\", request.page],\n [\"per_page\", request.perPage ?? this.client.settings.defaultPageSize],\n [\"project\", request.project],\n [\n \"tags\",\n request.tags && request.tags.length > 0 ? request.tags.join(\",\") : void 0\n ],\n [\"type\", request.type]\n )\n },\n marshalling_gen.unmarshalListIpsResponse\n );\n /**\n * List all flexible IPs. List all flexible IPs in a specified zone.\n *\n * @param request - The request {@link ListIpsRequest}\n * @returns A Promise of ListIpsResponse\n */\n listIps = (request = {}) => resourcePaginator.enrichForPagination(\"ips\", this.pageOfListIps, request);\n /**\n * Reserve a flexible IP. Reserve a flexible IP and attach it to the specified\n * Instance.\n *\n * @param request - The request {@link CreateIpRequest}\n * @returns A Promise of CreateIpResponse\n */\n createIp = (request = {}) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateIpRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/ips`\n },\n marshalling_gen.unmarshalCreateIpResponse\n );\n /**\n * Get a flexible IP. Get details of an IP with the specified ID or address.\n *\n * @param request - The request {@link GetIpRequest}\n * @returns A Promise of GetIpResponse\n */\n getIp = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/ips/${marshalling.validatePathParam(\"ip\", request.ip)}`\n },\n marshalling_gen.unmarshalGetIpResponse\n );\n /**\n * Update a flexible IP. Update a flexible IP in the specified zone with the\n * specified ID.\n *\n * @param request - The request {@link UpdateIpRequest}\n * @returns A Promise of UpdateIpResponse\n */\n updateIp = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateIpRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/ips/${marshalling.validatePathParam(\"ip\", request.ip)}`\n },\n marshalling_gen.unmarshalUpdateIpResponse\n );\n /**\n * Delete a flexible IP. Delete the IP with the specified ID.\n *\n * @param request - The request {@link DeleteIpRequest}\n */\n deleteIp = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/ips/${marshalling.validatePathParam(\"ip\", request.ip)}`\n });\n pageOfListPrivateNICs = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/private_nics`,\n urlParams: marshalling.urlParams(\n [\"page\", request.page],\n [\"per_page\", request.perPage ?? this.client.settings.defaultPageSize],\n [\n \"tags\",\n request.tags && request.tags.length > 0 ? request.tags.join(\",\") : void 0\n ]\n )\n },\n marshalling_gen.unmarshalListPrivateNICsResponse\n );\n /**\n * List all private NICs. List all private NICs of a specified Instance.\n *\n * @param request - The request {@link ListPrivateNICsRequest}\n * @returns A Promise of ListPrivateNICsResponse\n */\n listPrivateNICs = (request) => resourcePaginator.enrichForPagination(\"privateNics\", this.pageOfListPrivateNICs, request);\n /**\n * Create a private NIC connecting an Instance to a Private Network.\n *\n * @param request - The request {@link CreatePrivateNICRequest}\n * @returns A Promise of CreatePrivateNICResponse\n */\n createPrivateNIC = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreatePrivateNICRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/private_nics`\n },\n marshalling_gen.unmarshalCreatePrivateNICResponse\n );\n /**\n * Get a private NIC. Get private NIC properties.\n *\n * @param request - The request {@link GetPrivateNICRequest}\n * @returns A Promise of GetPrivateNICResponse\n */\n getPrivateNIC = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/private_nics/${marshalling.validatePathParam(\"privateNicId\", request.privateNicId)}`\n },\n marshalling_gen.unmarshalGetPrivateNICResponse\n );\n /**\n * Update a private NIC. Update one or more parameter(s) of a specified\n * private NIC.\n *\n * @param request - The request {@link UpdatePrivateNICRequest}\n * @returns A Promise of PrivateNIC\n */\n updatePrivateNIC = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdatePrivateNICRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/private_nics/${marshalling.validatePathParam(\"privateNicId\", request.privateNicId)}`\n },\n marshalling_gen.unmarshalPrivateNIC\n );\n /**\n * Delete a private NIC.\n *\n * @param request - The request {@link DeletePrivateNICRequest}\n */\n deletePrivateNIC = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/servers/${marshalling.validatePathParam(\"serverId\", request.serverId)}/private_nics/${marshalling.validatePathParam(\"privateNicId\", request.privateNicId)}`\n });\n pageOfListBootscripts = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/bootscripts`,\n urlParams: marshalling.urlParams(\n [\"arch\", request.arch],\n [\"default\", request.default],\n [\"page\", request.page],\n [\"per_page\", request.perPage ?? this.client.settings.defaultPageSize],\n [\"public\", request.public],\n [\"title\", request.title]\n )\n },\n marshalling_gen.unmarshalListBootscriptsResponse\n );\n /**\n * List bootscripts.\n *\n * @deprecated\n * @param request - The request {@link ListBootscriptsRequest}\n * @returns A Promise of ListBootscriptsResponse\n */\n listBootscripts = (request = {}) => resourcePaginator.enrichForPagination(\"bootscripts\", this.pageOfListBootscripts, request);\n /**\n * Get bootscripts. Get details of a bootscript with the specified ID.\n *\n * @deprecated\n * @param request - The request {@link GetBootscriptRequest}\n * @returns A Promise of GetBootscriptResponse\n */\n getBootscript = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/bootscripts/${marshalling.validatePathParam(\"bootscriptId\", request.bootscriptId)}`\n },\n marshalling_gen.unmarshalGetBootscriptResponse\n );\n getDashboard = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/dashboard`,\n urlParams: marshalling.urlParams(\n [\"organization\", request.organization],\n [\"project\", request.project]\n )\n },\n marshalling_gen.unmarshalGetDashboardResponse\n );\n /**\n * Get a volume or snapshot's migration plan. Given a volume or snapshot,\n * returns the migration plan for a call to the \"Apply a migration plan\"\n * endpoint. This plan will include zero or one volume, and zero or more\n * snapshots, which will need to be migrated together. This endpoint does not\n * perform the actual migration itself, the \"Apply a migration plan\" endpoint\n * must be used. The validation_key value returned by this endpoint must be\n * provided to the call to the \"Apply a migration plan\" endpoint to confirm\n * that all resources listed in the plan should be migrated.\n *\n * @param request - The request {@link PlanBlockMigrationRequest}\n * @returns A Promise of MigrationPlan\n */\n planBlockMigration = (request = {}) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalPlanBlockMigrationRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/block-migration/plan`\n },\n marshalling_gen.unmarshalMigrationPlan\n );\n /**\n * Migrate a volume and/or snapshots to SBS (Scaleway Block Storage). To be\n * used, the call to this endpoint must be preceded by a call to the \"Plan a\n * migration\" endpoint. To migrate all resources mentioned in the migration\n * plan, the validation_key returned in the plan must be provided.\n *\n * @param request - The request {@link ApplyBlockMigrationRequest}\n */\n applyBlockMigration = (request) => this.client.fetch({\n body: JSON.stringify(\n marshalling_gen.marshalApplyBlockMigrationRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/block-migration/apply`\n });\n}\nexports.API = API;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst intervalRetrier = require(\"../../../internal/async/interval-retrier.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst api_gen = require(\"./api.gen.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nconst validateNotUndefined = (obj) => {\n if (obj === void 0) throw new TypeError(`object was found undefined`);\n return obj;\n};\nclass InstanceV1UtilsAPI extends api_gen.API {\n /**\n * Waits for {@link Image} to be in a final state.\n *\n * @param request - The request {@link GetImageRequest}\n * @param options - The waiting options\n * @returns A Promise of Image\n */\n waitForImage = (request, options) => intervalRetrier.tryAtIntervals(\n async () => {\n const value = await this.getImage(request).then(\n (res) => res.image\n );\n return {\n done: !content_gen.IMAGE_TRANSIENT_STATUSES.includes(value.state),\n value\n };\n },\n intervalRetrier.createExponentialBackoffStrategy(\n options?.minDelay ?? 1,\n options?.maxDelay ?? 30\n ),\n options?.timeout\n );\n /**\n * Waits for {@link PrivateNIC} to be in a final state.\n *\n * @param request - The request {@link GetPrivateNICRequest}\n * @param options - The waiting options\n * @returns A Promise of PrivateNIC\n */\n waitForPrivateNIC = (request, options) => intervalRetrier.tryAtIntervals(\n async () => {\n const value = await this.getPrivateNIC(request).then(\n (res) => res.privateNic\n );\n return {\n done: !content_gen.PRIVATE_NIC_TRANSIENT_STATUSES.includes(value.state),\n value\n };\n },\n intervalRetrier.createExponentialBackoffStrategy(\n options?.minDelay ?? 1,\n options?.maxDelay ?? 30\n ),\n options?.timeout\n );\n /**\n * Waits for {@link Server} to be in a final state.\n *\n * @param request - The request {@link GetServerRequest}\n * @param options - The waiting options\n * @returns A Promise of Server\n */\n waitForServer = (request, options) => intervalRetrier.tryAtIntervals(\n async () => {\n const value = await this.getServer(request).then(\n (res) => res.server\n );\n return {\n done: !content_gen.SERVER_TRANSIENT_STATUSES.includes(value.state),\n value\n };\n },\n intervalRetrier.createExponentialBackoffStrategy(\n options?.minDelay ?? 1,\n options?.maxDelay ?? 30\n ),\n options?.timeout\n );\n /**\n * Waits for {@link Server} to be in a final state.\n *\n * @param request - The request {@link GetServerRequest}\n * @param options - The waiting options\n * @returns A Promise of Server\n */\n waitForSnapshot = (request, options) => intervalRetrier.tryAtIntervals(\n async () => {\n const value = await this.getSnapshot(request).then(\n (res) => res.snapshot\n );\n return {\n done: !content_gen.SNAPSHOT_TRANSIENT_STATUSES.includes(value.state),\n value\n };\n },\n intervalRetrier.createExponentialBackoffStrategy(\n options?.minDelay ?? 1,\n options?.maxDelay ?? 30\n ),\n options?.timeout\n );\n /**\n * Waits for {@link Volume} to be in a final state.\n *\n * @param request - The request {@link GetVolumeRequest}\n * @param options - The waiting options\n * @returns A Promise of Volume\n */\n waitForVolume = (request, options) => intervalRetrier.tryAtIntervals(\n async () => {\n const value = await this.getVolume(request).then(\n (res) => res.volume\n );\n return {\n done: !content_gen.VOLUME_TRANSIENT_STATUSES.includes(value.state),\n value\n };\n },\n intervalRetrier.createExponentialBackoffStrategy(\n options?.minDelay ?? 1,\n options?.maxDelay ?? 30\n ),\n options?.timeout\n );\n /**\n * Updates a server.\n *\n * @param request - The request {@link UpdateServerRequest}\n * @returns A Promise of UpdateServerResponse\n */\n updateServer = (request) => this._updateServer(request);\n /**\n * Creates a server.\n *\n * @param request - The request {@link CreateServerRequest}\n * @returns A Promise of CreateServerResponse\n */\n createServer = (request) => this._createServer(request);\n /**\n * Starts an action and wait for the server to be in the correct \"terminal\n * state\" expected by this action.\n *\n * @param request - The request {@link ServerActionRequest}\n * @returns A Promise of Server\n */\n serverActionAndWait = async (request, options) => {\n const finalServer = await this.serverAction(request).then(\n () => this.waitForServer(\n {\n serverId: request.serverId,\n zone: request.zone\n },\n options\n )\n );\n let expectedState;\n switch (request.action) {\n case \"poweron\":\n case \"reboot\":\n expectedState = \"running\";\n break;\n case \"poweroff\":\n expectedState = \"stopped\";\n break;\n case \"stop_in_place\":\n expectedState = \"stopped in place\";\n break;\n }\n if (expectedState && finalServer.state !== expectedState) {\n throw new Error(\n `expected state ${expectedState} but found ${finalServer.state}: ${finalServer.stateDetail}`\n );\n }\n return finalServer;\n };\n /**\n * Attaches a volume to a server.\n *\n * @param request - The request {@link AttachVolumeRequest}\n * @returns A Promise of AttachVolumeResponse\n */\n attachVolume = async (request) => {\n const volumes = await this.getServer({\n serverId: request.serverId,\n zone: request.zone\n }).then((res) => validateNotUndefined(res.server?.volumes));\n const newVolumes = {};\n for (const [key, server] of Object.entries(volumes)) {\n newVolumes[key] = { id: server.id, name: server.name };\n }\n let found = false;\n const volumesLength = Object.keys(volumes).length;\n for (let index = 0; index <= volumesLength; index += 1) {\n const key = index.toString();\n if (!(key in newVolumes)) {\n newVolumes[key] = {\n id: request.volumeId,\n name: request.volumeId\n // name is ignored on this PATCH\n };\n found = true;\n break;\n }\n }\n if (!found) {\n throw new Error(`could not find key to attach volume ${request.volumeId}`);\n }\n return this.updateServer({\n serverId: request.serverId,\n volumes: newVolumes,\n zone: request.zone\n }).then((obj) => obj);\n };\n /**\n * Detaches a volume from a server.\n *\n * @param request - The request {@link DetachVolumeRequest}\n * @returns A Promise of DetachVolumeResponse\n */\n detachVolume = async (request) => {\n const server = await this.getVolume({\n volumeId: request.volumeId,\n zone: request.zone\n }).then((res) => validateNotUndefined(res.volume?.server?.id)).then(\n (serverId) => this.getServer({\n serverId,\n zone: request.zone\n })\n ).then((res) => validateNotUndefined(res.server));\n const newVolumes = {};\n for (const [key, volume] of Object.entries(server.volumes)) {\n if (volume.id !== request.volumeId) {\n newVolumes[key] = { id: volume.id, name: volume.name };\n }\n }\n return this.updateServer({\n serverId: server.id,\n volumes: newVolumes,\n zone: request.zone\n }).then((obj) => obj);\n };\n /**\n * Get the content of a user data on a server for the given key.\n *\n * @param request - The request {@link GetServerUserDataRequest}\n * @returns The content of the key\n */\n getServerUserData = (request) => this.client.fetch({\n method: \"GET\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\n \"zone\",\n request.zone ?? this.client.settings.defaultZone\n )}/servers/${marshalling.validatePathParam(\n \"serverId\",\n request.serverId\n )}/user_data/${marshalling.validatePathParam(\"key\", request.key)}`\n });\n /**\n * Sets the content of a user data on a server for the given key.\n *\n * @param request - The request {@link SetServerUserDataRequest}\n */\n setServerUserData = (request) => this.client.fetch({\n body: request.content,\n headers: { \"Content-Type\": \"text/plain\" },\n method: \"PATCH\",\n path: `/instance/v1/zones/${marshalling.validatePathParam(\n \"zone\",\n request.zone ?? this.client.settings.defaultZone\n )}/servers/${marshalling.validatePathParam(\n \"serverId\",\n request.serverId\n )}/user_data/${marshalling.validatePathParam(\"key\", request.key)}`\n });\n}\nexports.InstanceV1UtilsAPI = InstanceV1UtilsAPI;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst IMAGE_TRANSIENT_STATUSES = [\"creating\"];\nconst IP_TRANSIENT_STATUSES = [\"pending\"];\nconst PRIVATE_NIC_TRANSIENT_STATUSES = [\"syncing\"];\nconst SECURITY_GROUP_TRANSIENT_STATUSES = [\n \"syncing\"\n];\nconst SERVER_IP_TRANSIENT_STATUSES = [\"pending\"];\nconst SERVER_TRANSIENT_STATUSES = [\"starting\", \"stopping\"];\nconst SNAPSHOT_TRANSIENT_STATUSES = [\n \"snapshotting\",\n \"importing\",\n \"exporting\"\n];\nconst TASK_TRANSIENT_STATUSES = [\n \"pending\",\n \"started\",\n \"retry\"\n];\nconst VOLUME_SERVER_TRANSIENT_STATUSES = [\n \"snapshotting\",\n \"fetching\",\n \"resizing\",\n \"saving\",\n \"hotsyncing\"\n];\nconst VOLUME_TRANSIENT_STATUSES = [\n \"snapshotting\",\n \"fetching\",\n \"resizing\",\n \"saving\",\n \"hotsyncing\"\n];\nexports.IMAGE_TRANSIENT_STATUSES = IMAGE_TRANSIENT_STATUSES;\nexports.IP_TRANSIENT_STATUSES = IP_TRANSIENT_STATUSES;\nexports.PRIVATE_NIC_TRANSIENT_STATUSES = PRIVATE_NIC_TRANSIENT_STATUSES;\nexports.SECURITY_GROUP_TRANSIENT_STATUSES = SECURITY_GROUP_TRANSIENT_STATUSES;\nexports.SERVER_IP_TRANSIENT_STATUSES = SERVER_IP_TRANSIENT_STATUSES;\nexports.SERVER_TRANSIENT_STATUSES = SERVER_TRANSIENT_STATUSES;\nexports.SNAPSHOT_TRANSIENT_STATUSES = SNAPSHOT_TRANSIENT_STATUSES;\nexports.TASK_TRANSIENT_STATUSES = TASK_TRANSIENT_STATUSES;\nexports.VOLUME_SERVER_TRANSIENT_STATUSES = VOLUME_SERVER_TRANSIENT_STATUSES;\nexports.VOLUME_TRANSIENT_STATUSES = VOLUME_TRANSIENT_STATUSES;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api_utils = require(\"./api.utils.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nexports.API = api_utils.InstanceV1UtilsAPI;\nexports.IMAGE_TRANSIENT_STATUSES = content_gen.IMAGE_TRANSIENT_STATUSES;\nexports.IP_TRANSIENT_STATUSES = content_gen.IP_TRANSIENT_STATUSES;\nexports.PRIVATE_NIC_TRANSIENT_STATUSES = content_gen.PRIVATE_NIC_TRANSIENT_STATUSES;\nexports.SECURITY_GROUP_TRANSIENT_STATUSES = content_gen.SECURITY_GROUP_TRANSIENT_STATUSES;\nexports.SERVER_IP_TRANSIENT_STATUSES = content_gen.SERVER_IP_TRANSIENT_STATUSES;\nexports.SERVER_TRANSIENT_STATUSES = content_gen.SERVER_TRANSIENT_STATUSES;\nexports.SNAPSHOT_TRANSIENT_STATUSES = content_gen.SNAPSHOT_TRANSIENT_STATUSES;\nexports.TASK_TRANSIENT_STATUSES = content_gen.TASK_TRANSIENT_STATUSES;\nexports.VOLUME_SERVER_TRANSIENT_STATUSES = content_gen.VOLUME_SERVER_TRANSIENT_STATUSES;\nexports.VOLUME_TRANSIENT_STATUSES = content_gen.VOLUME_TRANSIENT_STATUSES;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst randomName = require(\"@scaleway/random-name\");\nconst json = require(\"../../../helpers/json.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst unmarshalPrivateNIC = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'PrivateNIC' failed as data isn't a dictionary.`\n );\n }\n return {\n id: data.id,\n macAddress: data.mac_address,\n privateNetworkId: data.private_network_id,\n serverId: data.server_id,\n state: data.state,\n tags: data.tags\n };\n};\nconst unmarshalServerSummary = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ServerSummary' failed as data isn't a dictionary.`\n );\n }\n return {\n id: data.id,\n name: data.name\n };\n};\nconst unmarshalBootscript = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Bootscript' failed as data isn't a dictionary.`\n );\n }\n return {\n architecture: data.architecture,\n bootcmdargs: data.bootcmdargs,\n default: data.default,\n dtb: data.dtb,\n id: data.id,\n initrd: data.initrd,\n kernel: data.kernel,\n organization: data.organization,\n project: data.project,\n public: data.public,\n title: data.title,\n zone: data.zone\n };\n};\nconst unmarshalVolume = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Volume' failed as data isn't a dictionary.`\n );\n }\n return {\n creationDate: marshalling.unmarshalDate(data.creation_date),\n exportUri: data.export_uri,\n id: data.id,\n modificationDate: marshalling.unmarshalDate(data.modification_date),\n name: data.name,\n organization: data.organization,\n project: data.project,\n server: data.server ? unmarshalServerSummary(data.server) : void 0,\n size: data.size,\n state: data.state,\n tags: data.tags,\n volumeType: data.volume_type,\n zone: data.zone\n };\n};\nconst unmarshalVolumeSummary = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'VolumeSummary' failed as data isn't a dictionary.`\n );\n }\n return {\n id: data.id,\n name: data.name,\n size: data.size,\n volumeType: data.volume_type\n };\n};\nconst unmarshalImage = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Image' failed as data isn't a dictionary.`\n );\n }\n return {\n arch: data.arch,\n creationDate: marshalling.unmarshalDate(data.creation_date),\n defaultBootscript: data.default_bootscript ? unmarshalBootscript(data.default_bootscript) : void 0,\n extraVolumes: marshalling.unmarshalMapOfObject(data.extra_volumes, unmarshalVolume),\n fromServer: data.from_server,\n id: data.id,\n modificationDate: marshalling.unmarshalDate(data.modification_date),\n name: data.name,\n organization: data.organization,\n project: data.project,\n public: data.public,\n rootVolume: data.root_volume ? unmarshalVolumeSummary(data.root_volume) : void 0,\n state: data.state,\n tags: data.tags,\n zone: data.zone\n };\n};\nconst unmarshalPlacementGroup = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'PlacementGroup' failed as data isn't a dictionary.`\n );\n }\n return {\n id: data.id,\n name: data.name,\n organization: data.organization,\n policyMode: data.policy_mode,\n policyRespected: data.policy_respected,\n policyType: data.policy_type,\n project: data.project,\n tags: data.tags,\n zone: data.zone\n };\n};\nconst unmarshalSecurityGroupSummary = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SecurityGroupSummary' failed as data isn't a dictionary.`\n );\n }\n return {\n id: data.id,\n name: data.name\n };\n};\nconst unmarshalServerIp = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ServerIp' failed as data isn't a dictionary.`\n );\n }\n return {\n address: data.address,\n dynamic: data.dynamic,\n family: data.family,\n gateway: data.gateway,\n id: data.id,\n ipamId: data.ipam_id,\n netmask: data.netmask,\n provisioningMode: data.provisioning_mode,\n state: data.state,\n tags: data.tags\n };\n};\nconst unmarshalServerIpv6 = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ServerIpv6' failed as data isn't a dictionary.`\n );\n }\n return {\n address: data.address,\n gateway: data.gateway,\n netmask: data.netmask\n };\n};\nconst unmarshalServerLocation = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ServerLocation' failed as data isn't a dictionary.`\n );\n }\n return {\n clusterId: data.cluster_id,\n hypervisorId: data.hypervisor_id,\n nodeId: data.node_id,\n platformId: data.platform_id,\n zoneId: data.zone_id\n };\n};\nconst unmarshalServerMaintenance = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ServerMaintenance' failed as data isn't a dictionary.`\n );\n }\n return {\n reason: data.reason,\n startDate: marshalling.unmarshalDate(data.start_date)\n };\n};\nconst unmarshalVolumeServer = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'VolumeServer' failed as data isn't a dictionary.`\n );\n }\n return {\n boot: data.boot,\n creationDate: marshalling.unmarshalDate(data.creation_date),\n exportUri: data.export_uri,\n id: data.id,\n modificationDate: marshalling.unmarshalDate(data.modification_date),\n name: data.name,\n organization: data.organization,\n project: data.project,\n server: data.server ? unmarshalServerSummary(data.server) : void 0,\n size: data.size,\n state: data.state,\n volumeType: data.volume_type,\n zone: data.zone\n };\n};\nconst unmarshalServer = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Server' failed as data isn't a dictionary.`\n );\n }\n return {\n adminPasswordEncryptedValue: data.admin_password_encrypted_value,\n adminPasswordEncryptionSshKeyId: data.admin_password_encryption_ssh_key_id,\n allowedActions: data.allowed_actions,\n arch: data.arch,\n bootType: data.boot_type,\n bootscript: data.bootscript ? unmarshalBootscript(data.bootscript) : void 0,\n commercialType: data.commercial_type,\n creationDate: marshalling.unmarshalDate(data.creation_date),\n dynamicIpRequired: data.dynamic_ip_required,\n enableIpv6: data.enable_ipv6,\n hostname: data.hostname,\n id: data.id,\n image: data.image ? unmarshalImage(data.image) : void 0,\n ipv6: data.ipv6 ? unmarshalServerIpv6(data.ipv6) : void 0,\n location: data.location ? unmarshalServerLocation(data.location) : void 0,\n macAddress: data.mac_address,\n maintenances: marshalling.unmarshalArrayOfObject(\n data.maintenances,\n unmarshalServerMaintenance\n ),\n modificationDate: marshalling.unmarshalDate(data.modification_date),\n name: data.name,\n organization: data.organization,\n placementGroup: data.placement_group ? unmarshalPlacementGroup(data.placement_group) : void 0,\n privateIp: data.private_ip,\n privateNics: marshalling.unmarshalArrayOfObject(data.private_nics, unmarshalPrivateNIC),\n project: data.project,\n protected: data.protected,\n publicIp: data.public_ip ? unmarshalServerIp(data.public_ip) : void 0,\n publicIps: marshalling.unmarshalArrayOfObject(data.public_ips, unmarshalServerIp),\n routedIpEnabled: data.routed_ip_enabled,\n securityGroup: data.security_group ? unmarshalSecurityGroupSummary(data.security_group) : void 0,\n state: data.state,\n stateDetail: data.state_detail,\n tags: data.tags,\n volumes: marshalling.unmarshalMapOfObject(data.volumes, unmarshalVolumeServer),\n zone: data.zone\n };\n};\nconst unmarshalAttachServerVolumeResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'AttachServerVolumeResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n server: data.server ? unmarshalServer(data.server) : void 0\n };\n};\nconst unmarshalCreateImageResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'CreateImageResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n image: data.image ? unmarshalImage(data.image) : void 0\n };\n};\nconst unmarshalIp = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Ip' failed as data isn't a dictionary.`\n );\n }\n return {\n address: data.address,\n id: data.id,\n ipamId: data.ipam_id,\n organization: data.organization,\n prefix: data.prefix,\n project: data.project,\n reverse: data.reverse,\n server: data.server ? unmarshalServerSummary(data.server) : void 0,\n state: data.state,\n tags: data.tags,\n type: data.type,\n zone: data.zone\n };\n};\nconst unmarshalCreateIpResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'CreateIpResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n ip: data.ip ? unmarshalIp(data.ip) : void 0\n };\n};\nconst unmarshalCreatePlacementGroupResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'CreatePlacementGroupResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n placementGroup: data.placement_group ? unmarshalPlacementGroup(data.placement_group) : void 0\n };\n};\nconst unmarshalCreatePrivateNICResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'CreatePrivateNICResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n privateNic: data.private_nic ? unmarshalPrivateNIC(data.private_nic) : void 0\n };\n};\nconst unmarshalSecurityGroup = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SecurityGroup' failed as data isn't a dictionary.`\n );\n }\n return {\n creationDate: marshalling.unmarshalDate(data.creation_date),\n description: data.description,\n enableDefaultSecurity: data.enable_default_security,\n id: data.id,\n inboundDefaultPolicy: data.inbound_default_policy,\n modificationDate: marshalling.unmarshalDate(data.modification_date),\n name: data.name,\n organization: data.organization,\n organizationDefault: data.organization_default,\n outboundDefaultPolicy: data.outbound_default_policy,\n project: data.project,\n projectDefault: data.project_default,\n servers: marshalling.unmarshalArrayOfObject(data.servers, unmarshalServerSummary),\n state: data.state,\n stateful: data.stateful,\n tags: data.tags,\n zone: data.zone\n };\n};\nconst unmarshalCreateSecurityGroupResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'CreateSecurityGroupResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n securityGroup: data.security_group ? unmarshalSecurityGroup(data.security_group) : void 0\n };\n};\nconst unmarshalSecurityGroupRule = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SecurityGroupRule' failed as data isn't a dictionary.`\n );\n }\n return {\n action: data.action,\n destPortFrom: data.dest_port_from,\n destPortTo: data.dest_port_to,\n direction: data.direction,\n editable: data.editable,\n id: data.id,\n ipRange: data.ip_range,\n position: data.position,\n protocol: data.protocol,\n zone: data.zone\n };\n};\nconst unmarshalCreateSecurityGroupRuleResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'CreateSecurityGroupRuleResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n rule: data.rule ? unmarshalSecurityGroupRule(data.rule) : void 0\n };\n};\nconst unmarshalCreateServerResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'CreateServerResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n server: data.server ? unmarshalServer(data.server) : void 0\n };\n};\nconst unmarshalSnapshotBaseVolume = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SnapshotBaseVolume' failed as data isn't a dictionary.`\n );\n }\n return {\n id: data.id,\n name: data.name\n };\n};\nconst unmarshalSnapshot = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Snapshot' failed as data isn't a dictionary.`\n );\n }\n return {\n baseVolume: data.base_volume ? unmarshalSnapshotBaseVolume(data.base_volume) : void 0,\n creationDate: marshalling.unmarshalDate(data.creation_date),\n errorReason: data.error_reason,\n id: data.id,\n modificationDate: marshalling.unmarshalDate(data.modification_date),\n name: data.name,\n organization: data.organization,\n project: data.project,\n size: data.size,\n state: data.state,\n tags: data.tags,\n volumeType: data.volume_type,\n zone: data.zone\n };\n};\nconst unmarshalTask = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Task' failed as data isn't a dictionary.`\n );\n }\n return {\n description: data.description,\n hrefFrom: data.href_from,\n hrefResult: data.href_result,\n id: data.id,\n progress: data.progress,\n startedAt: marshalling.unmarshalDate(data.started_at),\n status: data.status,\n terminatedAt: marshalling.unmarshalDate(data.terminated_at),\n zone: data.zone\n };\n};\nconst unmarshalCreateSnapshotResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'CreateSnapshotResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n snapshot: data.snapshot ? unmarshalSnapshot(data.snapshot) : void 0,\n task: data.task ? unmarshalTask(data.task) : void 0\n };\n};\nconst unmarshalCreateVolumeResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'CreateVolumeResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n volume: data.volume ? unmarshalVolume(data.volume) : void 0\n };\n};\nconst unmarshalDetachServerVolumeResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DetachServerVolumeResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n server: data.server ? unmarshalServer(data.server) : void 0\n };\n};\nconst unmarshalExportSnapshotResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ExportSnapshotResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n task: data.task ? unmarshalTask(data.task) : void 0\n };\n};\nconst unmarshalGetBootscriptResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'GetBootscriptResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n bootscript: data.bootscript ? unmarshalBootscript(data.bootscript) : void 0\n };\n};\nconst unmarshalDashboard = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Dashboard' failed as data isn't a dictionary.`\n );\n }\n return {\n imagesCount: data.images_count,\n ipsCount: data.ips_count,\n ipsUnused: data.ips_unused,\n placementGroupsCount: data.placement_groups_count,\n privateNicsCount: data.private_nics_count,\n runningServersCount: data.running_servers_count,\n securityGroupsCount: data.security_groups_count,\n serversByTypes: data.servers_by_types,\n serversCount: data.servers_count,\n snapshotsCount: data.snapshots_count,\n volumesBSsdCount: data.volumes_b_ssd_count,\n volumesBSsdTotalSize: data.volumes_b_ssd_total_size,\n volumesCount: data.volumes_count,\n volumesLSsdCount: data.volumes_l_ssd_count,\n volumesLSsdTotalSize: data.volumes_l_ssd_total_size\n };\n};\nconst unmarshalGetDashboardResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'GetDashboardResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n dashboard: data.dashboard ? unmarshalDashboard(data.dashboard) : void 0\n };\n};\nconst unmarshalGetImageResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'GetImageResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n image: data.image ? unmarshalImage(data.image) : void 0\n };\n};\nconst unmarshalGetIpResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'GetIpResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n ip: data.ip ? unmarshalIp(data.ip) : void 0\n };\n};\nconst unmarshalGetPlacementGroupResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'GetPlacementGroupResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n placementGroup: data.placement_group ? unmarshalPlacementGroup(data.placement_group) : void 0\n };\n};\nconst unmarshalPlacementGroupServer = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'PlacementGroupServer' failed as data isn't a dictionary.`\n );\n }\n return {\n id: data.id,\n name: data.name,\n policyRespected: data.policy_respected\n };\n};\nconst unmarshalGetPlacementGroupServersResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'GetPlacementGroupServersResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n servers: marshalling.unmarshalArrayOfObject(\n data.servers,\n unmarshalPlacementGroupServer\n )\n };\n};\nconst unmarshalGetPrivateNICResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'GetPrivateNICResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n privateNic: data.private_nic ? unmarshalPrivateNIC(data.private_nic) : void 0\n };\n};\nconst unmarshalGetSecurityGroupResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'GetSecurityGroupResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n securityGroup: data.security_group ? unmarshalSecurityGroup(data.security_group) : void 0\n };\n};\nconst unmarshalGetSecurityGroupRuleResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'GetSecurityGroupRuleResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n rule: data.rule ? unmarshalSecurityGroupRule(data.rule) : void 0\n };\n};\nconst unmarshalGetServerResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'GetServerResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n server: data.server ? unmarshalServer(data.server) : void 0\n };\n};\nconst unmarshalGetServerTypesAvailabilityResponseAvailability = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'GetServerTypesAvailabilityResponseAvailability' failed as data isn't a dictionary.`\n );\n }\n return {\n availability: data.availability\n };\n};\nconst unmarshalGetServerTypesAvailabilityResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'GetServerTypesAvailabilityResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n servers: marshalling.unmarshalMapOfObject(\n data.servers,\n unmarshalGetServerTypesAvailabilityResponseAvailability\n ),\n totalCount: data.total_count\n };\n};\nconst unmarshalGetSnapshotResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'GetSnapshotResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n snapshot: data.snapshot ? unmarshalSnapshot(data.snapshot) : void 0\n };\n};\nconst unmarshalGetVolumeResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'GetVolumeResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n volume: data.volume ? unmarshalVolume(data.volume) : void 0\n };\n};\nconst unmarshalListBootscriptsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListBootscriptsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n bootscripts: marshalling.unmarshalArrayOfObject(data.bootscripts, unmarshalBootscript),\n totalCount: data.total_count\n };\n};\nconst unmarshalListImagesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListImagesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n images: marshalling.unmarshalArrayOfObject(data.images, unmarshalImage),\n totalCount: data.total_count\n };\n};\nconst unmarshalListIpsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListIpsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n ips: marshalling.unmarshalArrayOfObject(data.ips, unmarshalIp),\n totalCount: data.total_count\n };\n};\nconst unmarshalListPlacementGroupsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListPlacementGroupsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n placementGroups: marshalling.unmarshalArrayOfObject(\n data.placement_groups,\n unmarshalPlacementGroup\n ),\n totalCount: data.total_count\n };\n};\nconst unmarshalListPrivateNICsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListPrivateNICsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n privateNics: marshalling.unmarshalArrayOfObject(data.private_nics, unmarshalPrivateNIC),\n totalCount: data.total_count\n };\n};\nconst unmarshalListSecurityGroupRulesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListSecurityGroupRulesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n rules: marshalling.unmarshalArrayOfObject(data.rules, unmarshalSecurityGroupRule),\n totalCount: data.total_count\n };\n};\nconst unmarshalListSecurityGroupsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListSecurityGroupsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n securityGroups: marshalling.unmarshalArrayOfObject(\n data.security_groups,\n unmarshalSecurityGroup\n ),\n totalCount: data.total_count\n };\n};\nconst unmarshalListServerActionsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListServerActionsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n actions: data.actions\n };\n};\nconst unmarshalListServerUserDataResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListServerUserDataResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n userData: data.user_data\n };\n};\nconst unmarshalListServersResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListServersResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n servers: marshalling.unmarshalArrayOfObject(data.servers, unmarshalServer),\n totalCount: data.total_count\n };\n};\nconst unmarshalServerTypeNetworkInterface = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ServerTypeNetworkInterface' failed as data isn't a dictionary.`\n );\n }\n return {\n internalBandwidth: data.internal_bandwidth,\n internetBandwidth: data.internet_bandwidth\n };\n};\nconst unmarshalServerTypeVolumeConstraintSizes = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ServerTypeVolumeConstraintSizes' failed as data isn't a dictionary.`\n );\n }\n return {\n maxSize: data.max_size,\n minSize: data.min_size\n };\n};\nconst unmarshalServerTypeCapabilities = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ServerTypeCapabilities' failed as data isn't a dictionary.`\n );\n }\n return {\n blockStorage: data.block_storage,\n bootTypes: data.boot_types\n };\n};\nconst unmarshalServerTypeNetwork = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ServerTypeNetwork' failed as data isn't a dictionary.`\n );\n }\n return {\n interfaces: marshalling.unmarshalArrayOfObject(\n data.interfaces,\n unmarshalServerTypeNetworkInterface\n ),\n ipv6Support: data.ipv6_support,\n sumInternalBandwidth: data.sum_internal_bandwidth,\n sumInternetBandwidth: data.sum_internet_bandwidth\n };\n};\nconst unmarshalServerTypeVolumeConstraintsByType = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ServerTypeVolumeConstraintsByType' failed as data isn't a dictionary.`\n );\n }\n return {\n lSsd: data.l_ssd ? unmarshalServerTypeVolumeConstraintSizes(data.l_ssd) : void 0\n };\n};\nconst unmarshalServerType = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ServerType' failed as data isn't a dictionary.`\n );\n }\n return {\n altNames: data.alt_names,\n arch: data.arch,\n baremetal: data.baremetal,\n blockBandwidth: data.block_bandwidth,\n capabilities: data.capabilities ? unmarshalServerTypeCapabilities(data.capabilities) : void 0,\n gpu: data.gpu,\n hourlyPrice: data.hourly_price,\n monthlyPrice: data.monthly_price,\n ncpus: data.ncpus,\n network: data.network ? unmarshalServerTypeNetwork(data.network) : void 0,\n perVolumeConstraint: data.per_volume_constraint ? unmarshalServerTypeVolumeConstraintsByType(data.per_volume_constraint) : void 0,\n ram: data.ram,\n scratchStorageMaxSize: data.scratch_storage_max_size,\n volumesConstraint: data.volumes_constraint ? unmarshalServerTypeVolumeConstraintSizes(data.volumes_constraint) : void 0\n };\n};\nconst unmarshalListServersTypesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListServersTypesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n servers: marshalling.unmarshalMapOfObject(data.servers, unmarshalServerType),\n totalCount: data.total_count\n };\n};\nconst unmarshalListSnapshotsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListSnapshotsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n snapshots: marshalling.unmarshalArrayOfObject(data.snapshots, unmarshalSnapshot),\n totalCount: data.total_count\n };\n};\nconst unmarshalListVolumesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListVolumesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n totalCount: data.total_count,\n volumes: marshalling.unmarshalArrayOfObject(data.volumes, unmarshalVolume)\n };\n};\nconst unmarshalVolumeTypeCapabilities = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'VolumeTypeCapabilities' failed as data isn't a dictionary.`\n );\n }\n return {\n snapshot: data.snapshot\n };\n};\nconst unmarshalVolumeTypeConstraints = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'VolumeTypeConstraints' failed as data isn't a dictionary.`\n );\n }\n return {\n max: data.max,\n min: data.min\n };\n};\nconst unmarshalVolumeType = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'VolumeType' failed as data isn't a dictionary.`\n );\n }\n return {\n capabilities: data.capabilities ? unmarshalVolumeTypeCapabilities(data.capabilities) : void 0,\n constraints: data.constraints ? unmarshalVolumeTypeConstraints(data.constraints) : void 0,\n displayName: data.display_name\n };\n};\nconst unmarshalListVolumesTypesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListVolumesTypesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n totalCount: data.total_count,\n volumes: marshalling.unmarshalMapOfObject(data.volumes, unmarshalVolumeType)\n };\n};\nconst unmarshalMigrationPlan = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'MigrationPlan' failed as data isn't a dictionary.`\n );\n }\n return {\n snapshots: marshalling.unmarshalArrayOfObject(data.snapshots, unmarshalSnapshot),\n validationKey: data.validation_key,\n volume: data.volume ? unmarshalVolume(data.volume) : void 0\n };\n};\nconst unmarshalServerActionResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ServerActionResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n task: data.task ? unmarshalTask(data.task) : void 0\n };\n};\nconst unmarshalSetImageResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SetImageResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n image: data.image ? unmarshalImage(data.image) : void 0\n };\n};\nconst unmarshalSetPlacementGroupResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SetPlacementGroupResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n placementGroup: data.placement_group ? unmarshalPlacementGroup(data.placement_group) : void 0\n };\n};\nconst unmarshalSetPlacementGroupServersResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SetPlacementGroupServersResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n servers: marshalling.unmarshalArrayOfObject(\n data.servers,\n unmarshalPlacementGroupServer\n )\n };\n};\nconst unmarshalSetSecurityGroupResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SetSecurityGroupResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n securityGroup: data.security_group ? unmarshalSecurityGroup(data.security_group) : void 0\n };\n};\nconst unmarshalSetSecurityGroupRuleResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SetSecurityGroupRuleResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n rule: data.rule ? unmarshalSecurityGroupRule(data.rule) : void 0\n };\n};\nconst unmarshalSetSecurityGroupRulesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SetSecurityGroupRulesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n rules: marshalling.unmarshalArrayOfObject(data.rules, unmarshalSecurityGroupRule)\n };\n};\nconst unmarshalSetServerResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SetServerResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n server: data.server ? unmarshalServer(data.server) : void 0\n };\n};\nconst unmarshalSetSnapshotResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SetSnapshotResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n snapshot: data.snapshot ? unmarshalSnapshot(data.snapshot) : void 0\n };\n};\nconst unmarshalUpdateImageResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'UpdateImageResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n image: data.image ? unmarshalImage(data.image) : void 0\n };\n};\nconst unmarshalUpdateIpResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'UpdateIpResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n ip: data.ip ? unmarshalIp(data.ip) : void 0\n };\n};\nconst unmarshalUpdatePlacementGroupResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'UpdatePlacementGroupResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n placementGroup: data.placement_group ? unmarshalPlacementGroup(data.placement_group) : void 0\n };\n};\nconst unmarshalUpdatePlacementGroupServersResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'UpdatePlacementGroupServersResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n servers: marshalling.unmarshalArrayOfObject(\n data.servers,\n unmarshalPlacementGroupServer\n )\n };\n};\nconst unmarshalUpdateSecurityGroupResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'UpdateSecurityGroupResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n securityGroup: data.security_group ? unmarshalSecurityGroup(data.security_group) : void 0\n };\n};\nconst unmarshalUpdateSecurityGroupRuleResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'UpdateSecurityGroupRuleResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n rule: data.rule ? unmarshalSecurityGroupRule(data.rule) : void 0\n };\n};\nconst unmarshalUpdateServerResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'UpdateServerResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n server: data.server ? unmarshalServer(data.server) : void 0\n };\n};\nconst unmarshalUpdateSnapshotResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'UpdateSnapshotResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n snapshot: data.snapshot ? unmarshalSnapshot(data.snapshot) : void 0\n };\n};\nconst unmarshalUpdateVolumeResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'UpdateVolumeResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n volume: data.volume ? unmarshalVolume(data.volume) : void 0\n };\n};\nconst marshalApplyBlockMigrationRequest = (request, defaults) => ({\n validation_key: request.validationKey,\n ...marshalling.resolveOneOf([\n { param: \"volume_id\", value: request.volumeId },\n { param: \"snapshot_id\", value: request.snapshotId }\n ])\n});\nconst marshalAttachServerVolumeRequest = (request, defaults) => ({\n boot: request.boot,\n volume_id: request.volumeId,\n volume_type: request.volumeType\n});\nconst marshalVolumeTemplate = (request, defaults) => ({\n id: request.id,\n name: request.name,\n size: request.size,\n volume_type: request.volumeType,\n ...marshalling.resolveOneOf([\n { param: \"project\", value: request.project },\n { param: \"organization\", value: request.organization }\n ])\n});\nconst marshalCreateImageRequest = (request, defaults) => ({\n arch: request.arch,\n default_bootscript: request.defaultBootscript,\n extra_volumes: request.extraVolumes !== void 0 ? Object.entries(request.extraVolumes).reduce(\n (acc, [key, value]) => ({\n ...acc,\n [key]: marshalVolumeTemplate(value)\n }),\n {}\n ) : void 0,\n name: request.name || randomName(\"img\"),\n public: request.public,\n root_volume: request.rootVolume,\n tags: request.tags,\n ...marshalling.resolveOneOf([\n {\n default: defaults.defaultProjectId,\n param: \"project\",\n value: request.project\n },\n {\n default: defaults.defaultOrganizationId,\n param: \"organization\",\n value: request.organization\n }\n ])\n});\nconst marshalCreateIpRequest = (request, defaults) => ({\n server: request.server,\n tags: request.tags,\n type: request.type,\n ...marshalling.resolveOneOf([\n {\n default: defaults.defaultProjectId,\n param: \"project\",\n value: request.project\n },\n {\n default: defaults.defaultOrganizationId,\n param: \"organization\",\n value: request.organization\n }\n ])\n});\nconst marshalCreatePlacementGroupRequest = (request, defaults) => ({\n name: request.name || randomName(\"pg\"),\n policy_mode: request.policyMode,\n policy_type: request.policyType,\n tags: request.tags,\n ...marshalling.resolveOneOf([\n {\n default: defaults.defaultProjectId,\n param: \"project\",\n value: request.project\n },\n {\n default: defaults.defaultOrganizationId,\n param: \"organization\",\n value: request.organization\n }\n ])\n});\nconst marshalCreatePrivateNICRequest = (request, defaults) => ({\n ip_ids: request.ipIds,\n ipam_ip_ids: request.ipamIpIds,\n private_network_id: request.privateNetworkId,\n tags: request.tags\n});\nconst marshalCreateSecurityGroupRequest = (request, defaults) => ({\n description: request.description,\n enable_default_security: request.enableDefaultSecurity,\n inbound_default_policy: request.inboundDefaultPolicy,\n name: request.name || randomName(\"sg\"),\n outbound_default_policy: request.outboundDefaultPolicy,\n stateful: request.stateful,\n tags: request.tags,\n ...marshalling.resolveOneOf([\n {\n default: defaults.defaultProjectId,\n param: \"project\",\n value: request.project\n },\n {\n default: defaults.defaultOrganizationId,\n param: \"organization\",\n value: request.organization\n }\n ]),\n ...marshalling.resolveOneOf([\n { param: \"organization_default\", value: request.organizationDefault },\n { param: \"project_default\", value: request.projectDefault }\n ])\n});\nconst marshalCreateSecurityGroupRuleRequest = (request, defaults) => ({\n action: request.action,\n dest_port_from: request.destPortFrom,\n dest_port_to: request.destPortTo,\n direction: request.direction,\n editable: request.editable,\n ip_range: request.ipRange,\n position: request.position,\n protocol: request.protocol\n});\nconst marshalVolumeServerTemplate = (request, defaults) => ({\n base_snapshot: request.baseSnapshot,\n boot: request.boot,\n id: request.id,\n name: request.name,\n organization: request.organization,\n project: request.project,\n size: request.size,\n volume_type: request.volumeType\n});\nconst marshalCreateServerRequest = (request, defaults) => ({\n admin_password_encryption_ssh_key_id: request.adminPasswordEncryptionSshKeyId,\n boot_type: request.bootType,\n bootscript: request.bootscript,\n commercial_type: request.commercialType,\n dynamic_ip_required: request.dynamicIpRequired,\n enable_ipv6: request.enableIpv6,\n image: request.image,\n name: request.name || randomName(\"srv\"),\n placement_group: request.placementGroup,\n public_ip: request.publicIp,\n public_ips: request.publicIps,\n routed_ip_enabled: request.routedIpEnabled,\n security_group: request.securityGroup,\n tags: request.tags,\n volumes: request.volumes !== void 0 ? Object.entries(request.volumes).reduce(\n (acc, [key, value]) => ({\n ...acc,\n [key]: marshalVolumeServerTemplate(value)\n }),\n {}\n ) : void 0,\n ...marshalling.resolveOneOf([\n {\n default: defaults.defaultProjectId,\n param: \"project\",\n value: request.project\n },\n {\n default: defaults.defaultOrganizationId,\n param: \"organization\",\n value: request.organization\n }\n ])\n});\nconst marshalCreateSnapshotRequest = (request, defaults) => ({\n bucket: request.bucket,\n key: request.key,\n name: request.name || randomName(\"snp\"),\n size: request.size,\n tags: request.tags,\n volume_id: request.volumeId,\n volume_type: request.volumeType,\n ...marshalling.resolveOneOf([\n {\n default: defaults.defaultProjectId,\n param: \"project\",\n value: request.project\n },\n {\n default: defaults.defaultOrganizationId,\n param: \"organization\",\n value: request.organization\n }\n ])\n});\nconst marshalCreateVolumeRequest = (request, defaults) => ({\n name: request.name || randomName(\"vol\"),\n tags: request.tags,\n volume_type: request.volumeType,\n ...marshalling.resolveOneOf([\n {\n default: defaults.defaultProjectId,\n param: \"project\",\n value: request.project\n },\n {\n default: defaults.defaultOrganizationId,\n param: \"organization\",\n value: request.organization\n }\n ]),\n ...marshalling.resolveOneOf([\n { param: \"size\", value: request.size },\n { param: \"base_snapshot\", value: request.baseSnapshot }\n ])\n});\nconst marshalDetachServerVolumeRequest = (request, defaults) => ({\n volume_id: request.volumeId\n});\nconst marshalExportSnapshotRequest = (request, defaults) => ({\n bucket: request.bucket,\n key: request.key\n});\nconst marshalPlanBlockMigrationRequest = (request, defaults) => ({\n ...marshalling.resolveOneOf([\n { param: \"volume_id\", value: request.volumeId },\n { param: \"snapshot_id\", value: request.snapshotId }\n ])\n});\nconst marshalServerActionRequestVolumeBackupTemplate = (request, defaults) => ({\n volume_type: request.volumeType\n});\nconst marshalServerActionRequest = (request, defaults) => ({\n action: request.action,\n name: request.name,\n volumes: request.volumes !== void 0 ? Object.entries(request.volumes).reduce(\n (acc, [key, value]) => ({\n ...acc,\n [key]: marshalServerActionRequestVolumeBackupTemplate(\n value\n )\n }),\n {}\n ) : void 0\n});\nconst marshalServerSummary = (request, defaults) => ({\n id: request.id,\n name: request.name\n});\nconst marshalBootscript = (request, defaults) => ({\n architecture: request.architecture,\n bootcmdargs: request.bootcmdargs,\n default: request.default,\n dtb: request.dtb,\n id: request.id,\n initrd: request.initrd,\n kernel: request.kernel,\n organization: request.organization,\n project: request.project,\n public: request.public,\n title: request.title,\n zone: request.zone\n});\nconst marshalVolume = (request, defaults) => ({\n creation_date: request.creationDate,\n export_uri: request.exportUri,\n id: request.id,\n modification_date: request.modificationDate,\n name: request.name,\n organization: request.organization,\n project: request.project,\n server: request.server !== void 0 ? marshalServerSummary(request.server) : void 0,\n size: request.size,\n state: request.state,\n tags: request.tags,\n volume_type: request.volumeType,\n zone: request.zone\n});\nconst marshalVolumeSummary = (request, defaults) => ({\n id: request.id,\n name: request.name,\n size: request.size,\n volume_type: request.volumeType\n});\nconst marshalSetImageRequest = (request, defaults) => ({\n arch: request.arch,\n creation_date: request.creationDate,\n default_bootscript: request.defaultBootscript !== void 0 ? marshalBootscript(request.defaultBootscript) : void 0,\n extra_volumes: request.extraVolumes !== void 0 ? Object.entries(request.extraVolumes).reduce(\n (acc, [key, value]) => ({\n ...acc,\n [key]: marshalVolume(value)\n }),\n {}\n ) : void 0,\n from_server: request.fromServer,\n modification_date: request.modificationDate,\n name: request.name,\n organization: request.organization ?? defaults.defaultOrganizationId,\n project: request.project ?? defaults.defaultProjectId,\n public: request.public,\n root_volume: request.rootVolume !== void 0 ? marshalVolumeSummary(request.rootVolume) : void 0,\n state: request.state,\n tags: request.tags\n});\nconst marshalSetPlacementGroupRequest = (request, defaults) => ({\n name: request.name,\n organization: request.organization ?? defaults.defaultOrganizationId,\n policy_mode: request.policyMode,\n policy_type: request.policyType,\n project: request.project ?? defaults.defaultProjectId,\n tags: request.tags\n});\nconst marshalSetPlacementGroupServersRequest = (request, defaults) => ({\n servers: request.servers\n});\nconst marshalSetSecurityGroupRequest = (request, defaults) => ({\n creation_date: request.creationDate,\n description: request.description,\n enable_default_security: request.enableDefaultSecurity,\n inbound_default_policy: request.inboundDefaultPolicy,\n modification_date: request.modificationDate,\n name: request.name,\n organization: request.organization ?? defaults.defaultOrganizationId,\n organization_default: request.organizationDefault,\n outbound_default_policy: request.outboundDefaultPolicy,\n project: request.project ?? defaults.defaultProjectId,\n project_default: request.projectDefault,\n servers: request.servers !== void 0 ? request.servers.map((elt) => marshalServerSummary(elt)) : void 0,\n stateful: request.stateful,\n tags: request.tags\n});\nconst marshalSetSecurityGroupRuleRequest = (request, defaults) => ({\n action: request.action,\n dest_port_from: request.destPortFrom,\n dest_port_to: request.destPortTo,\n direction: request.direction,\n editable: request.editable,\n id: request.id,\n ip_range: request.ipRange,\n position: request.position,\n protocol: request.protocol\n});\nconst marshalSetSecurityGroupRulesRequestRule = (request, defaults) => ({\n action: request.action,\n dest_port_from: request.destPortFrom,\n dest_port_to: request.destPortTo,\n direction: request.direction,\n editable: request.editable,\n id: request.id,\n ip_range: request.ipRange,\n position: request.position,\n protocol: request.protocol,\n zone: request.zone\n});\nconst marshalSetSecurityGroupRulesRequest = (request, defaults) => ({\n rules: request.rules !== void 0 ? request.rules.map(\n (elt) => marshalSetSecurityGroupRulesRequestRule(elt)\n ) : void 0\n});\nconst marshalImage = (request, defaults) => ({\n arch: request.arch,\n creation_date: request.creationDate,\n default_bootscript: request.defaultBootscript !== void 0 ? marshalBootscript(request.defaultBootscript) : void 0,\n extra_volumes: Object.entries(request.extraVolumes).reduce(\n (acc, [key, value]) => ({ ...acc, [key]: marshalVolume(value) }),\n {}\n ),\n from_server: request.fromServer,\n id: request.id,\n modification_date: request.modificationDate,\n name: request.name,\n organization: request.organization,\n project: request.project,\n public: request.public,\n root_volume: request.rootVolume !== void 0 ? marshalVolumeSummary(request.rootVolume) : void 0,\n state: request.state,\n tags: request.tags,\n zone: request.zone\n});\nconst marshalPlacementGroup = (request, defaults) => ({\n id: request.id,\n name: request.name,\n organization: request.organization,\n policy_mode: request.policyMode,\n policy_respected: request.policyRespected,\n policy_type: request.policyType,\n project: request.project,\n tags: request.tags,\n zone: request.zone\n});\nconst marshalPrivateNIC = (request, defaults) => ({\n id: request.id,\n mac_address: request.macAddress,\n private_network_id: request.privateNetworkId,\n server_id: request.serverId,\n state: request.state,\n tags: request.tags\n});\nconst marshalSecurityGroupSummary = (request, defaults) => ({\n id: request.id,\n name: request.name\n});\nconst marshalServerIp = (request, defaults) => ({\n address: request.address,\n dynamic: request.dynamic,\n family: request.family,\n gateway: request.gateway,\n id: request.id,\n ipam_id: request.ipamId,\n netmask: request.netmask,\n provisioning_mode: request.provisioningMode,\n state: request.state,\n tags: request.tags\n});\nconst marshalServerIpv6 = (request, defaults) => ({\n address: request.address,\n gateway: request.gateway,\n netmask: request.netmask\n});\nconst marshalServerLocation = (request, defaults) => ({\n cluster_id: request.clusterId,\n hypervisor_id: request.hypervisorId,\n node_id: request.nodeId,\n platform_id: request.platformId,\n zone_id: request.zoneId\n});\nconst marshalServerMaintenance = (request, defaults) => ({\n reason: request.reason,\n start_date: request.startDate\n});\nconst marshalSetServerRequest = (request, defaults) => ({\n admin_password_encryption_ssh_key_id: request.adminPasswordEncryptionSshKeyId,\n allowed_actions: request.allowedActions !== void 0 ? request.allowedActions : void 0,\n arch: request.arch,\n boot_type: request.bootType,\n bootscript: request.bootscript !== void 0 ? marshalBootscript(request.bootscript) : void 0,\n commercial_type: request.commercialType,\n creation_date: request.creationDate,\n dynamic_ip_required: request.dynamicIpRequired,\n enable_ipv6: request.enableIpv6,\n hostname: request.hostname,\n image: request.image !== void 0 ? marshalImage(request.image) : void 0,\n ipv6: request.ipv6 !== void 0 ? marshalServerIpv6(request.ipv6) : void 0,\n location: request.location !== void 0 ? marshalServerLocation(request.location) : void 0,\n maintenances: request.maintenances !== void 0 ? request.maintenances.map((elt) => marshalServerMaintenance(elt)) : void 0,\n modification_date: request.modificationDate,\n name: request.name,\n organization: request.organization ?? defaults.defaultOrganizationId,\n placement_group: request.placementGroup !== void 0 ? marshalPlacementGroup(request.placementGroup) : void 0,\n private_ip: request.privateIp,\n private_nics: request.privateNics !== void 0 ? request.privateNics.map((elt) => marshalPrivateNIC(elt)) : void 0,\n project: request.project ?? defaults.defaultProjectId,\n protected: request.protected,\n public_ip: request.publicIp !== void 0 ? marshalServerIp(request.publicIp) : void 0,\n public_ips: request.publicIps !== void 0 ? request.publicIps.map((elt) => marshalServerIp(elt)) : void 0,\n routed_ip_enabled: request.routedIpEnabled,\n security_group: request.securityGroup !== void 0 ? marshalSecurityGroupSummary(request.securityGroup) : void 0,\n state: request.state,\n state_detail: request.stateDetail,\n tags: request.tags,\n volumes: request.volumes !== void 0 ? Object.entries(request.volumes).reduce(\n (acc, [key, value]) => ({\n ...acc,\n [key]: marshalVolume(value)\n }),\n {}\n ) : void 0\n});\nconst marshalSnapshotBaseVolume = (request, defaults) => ({\n id: request.id,\n name: request.name\n});\nconst marshalSetSnapshotRequest = (request, defaults) => ({\n base_volume: request.baseVolume !== void 0 ? marshalSnapshotBaseVolume(request.baseVolume) : void 0,\n creation_date: request.creationDate,\n id: request.id,\n modification_date: request.modificationDate,\n name: request.name,\n organization: request.organization ?? defaults.defaultOrganizationId,\n project: request.project ?? defaults.defaultProjectId,\n size: request.size,\n state: request.state,\n tags: request.tags,\n volume_type: request.volumeType\n});\nconst marshalVolumeImageUpdateTemplate = (request, defaults) => ({\n id: request.id\n});\nconst marshalUpdateImageRequest = (request, defaults) => ({\n arch: request.arch,\n extra_volumes: request.extraVolumes !== void 0 ? Object.entries(request.extraVolumes).reduce(\n (acc, [key, value]) => ({\n ...acc,\n [key]: marshalVolumeImageUpdateTemplate(value)\n }),\n {}\n ) : void 0,\n name: request.name,\n public: request.public,\n tags: request.tags\n});\nconst marshalUpdateIpRequest = (request, defaults) => ({\n reverse: request.reverse,\n server: request.server,\n tags: request.tags,\n type: request.type\n});\nconst marshalUpdatePlacementGroupRequest = (request, defaults) => ({\n name: request.name,\n policy_mode: request.policyMode,\n policy_type: request.policyType,\n tags: request.tags\n});\nconst marshalUpdatePlacementGroupServersRequest = (request, defaults) => ({\n servers: request.servers\n});\nconst marshalUpdatePrivateNICRequest = (request, defaults) => ({\n tags: request.tags\n});\nconst marshalUpdateSecurityGroupRequest = (request, defaults) => ({\n description: request.description,\n enable_default_security: request.enableDefaultSecurity,\n inbound_default_policy: request.inboundDefaultPolicy,\n name: request.name,\n organization_default: request.organizationDefault,\n outbound_default_policy: request.outboundDefaultPolicy,\n project_default: request.projectDefault,\n stateful: request.stateful,\n tags: request.tags\n});\nconst marshalUpdateSecurityGroupRuleRequest = (request, defaults) => ({\n action: request.action,\n dest_port_from: request.destPortFrom,\n dest_port_to: request.destPortTo,\n direction: request.direction,\n ip_range: request.ipRange,\n position: request.position,\n protocol: request.protocol\n});\nconst marshalSecurityGroupTemplate = (request, defaults) => ({\n id: request.id,\n name: request.name\n});\nconst marshalUpdateServerRequest = (request, defaults) => ({\n admin_password_encryption_ssh_key_id: request.adminPasswordEncryptionSshKeyId,\n boot_type: request.bootType,\n bootscript: request.bootscript,\n commercial_type: request.commercialType,\n dynamic_ip_required: request.dynamicIpRequired,\n enable_ipv6: request.enableIpv6,\n name: request.name,\n placement_group: request.placementGroup,\n private_nics: request.privateNics,\n protected: request.protected,\n public_ips: request.publicIps,\n routed_ip_enabled: request.routedIpEnabled,\n security_group: request.securityGroup !== void 0 ? marshalSecurityGroupTemplate(request.securityGroup) : void 0,\n tags: request.tags,\n volumes: request.volumes !== void 0 ? Object.entries(request.volumes).reduce(\n (acc, [key, value]) => ({\n ...acc,\n [key]: marshalVolumeServerTemplate(value)\n }),\n {}\n ) : void 0\n});\nconst marshalUpdateSnapshotRequest = (request, defaults) => ({\n name: request.name,\n tags: request.tags\n});\nconst marshalUpdateVolumeRequest = (request, defaults) => ({\n name: request.name,\n size: request.size,\n tags: request.tags\n});\nexports.marshalApplyBlockMigrationRequest = marshalApplyBlockMigrationRequest;\nexports.marshalAttachServerVolumeRequest = marshalAttachServerVolumeRequest;\nexports.marshalCreateImageRequest = marshalCreateImageRequest;\nexports.marshalCreateIpRequest = marshalCreateIpRequest;\nexports.marshalCreatePlacementGroupRequest = marshalCreatePlacementGroupRequest;\nexports.marshalCreatePrivateNICRequest = marshalCreatePrivateNICRequest;\nexports.marshalCreateSecurityGroupRequest = marshalCreateSecurityGroupRequest;\nexports.marshalCreateSecurityGroupRuleRequest = marshalCreateSecurityGroupRuleRequest;\nexports.marshalCreateServerRequest = marshalCreateServerRequest;\nexports.marshalCreateSnapshotRequest = marshalCreateSnapshotRequest;\nexports.marshalCreateVolumeRequest = marshalCreateVolumeRequest;\nexports.marshalDetachServerVolumeRequest = marshalDetachServerVolumeRequest;\nexports.marshalExportSnapshotRequest = marshalExportSnapshotRequest;\nexports.marshalPlanBlockMigrationRequest = marshalPlanBlockMigrationRequest;\nexports.marshalServerActionRequest = marshalServerActionRequest;\nexports.marshalSetImageRequest = marshalSetImageRequest;\nexports.marshalSetPlacementGroupRequest = marshalSetPlacementGroupRequest;\nexports.marshalSetPlacementGroupServersRequest = marshalSetPlacementGroupServersRequest;\nexports.marshalSetSecurityGroupRequest = marshalSetSecurityGroupRequest;\nexports.marshalSetSecurityGroupRuleRequest = marshalSetSecurityGroupRuleRequest;\nexports.marshalSetSecurityGroupRulesRequest = marshalSetSecurityGroupRulesRequest;\nexports.marshalSetServerRequest = marshalSetServerRequest;\nexports.marshalSetSnapshotRequest = marshalSetSnapshotRequest;\nexports.marshalUpdateImageRequest = marshalUpdateImageRequest;\nexports.marshalUpdateIpRequest = marshalUpdateIpRequest;\nexports.marshalUpdatePlacementGroupRequest = marshalUpdatePlacementGroupRequest;\nexports.marshalUpdatePlacementGroupServersRequest = marshalUpdatePlacementGroupServersRequest;\nexports.marshalUpdatePrivateNICRequest = marshalUpdatePrivateNICRequest;\nexports.marshalUpdateSecurityGroupRequest = marshalUpdateSecurityGroupRequest;\nexports.marshalUpdateSecurityGroupRuleRequest = marshalUpdateSecurityGroupRuleRequest;\nexports.marshalUpdateServerRequest = marshalUpdateServerRequest;\nexports.marshalUpdateSnapshotRequest = marshalUpdateSnapshotRequest;\nexports.marshalUpdateVolumeRequest = marshalUpdateVolumeRequest;\nexports.unmarshalAttachServerVolumeResponse = unmarshalAttachServerVolumeResponse;\nexports.unmarshalCreateImageResponse = unmarshalCreateImageResponse;\nexports.unmarshalCreateIpResponse = unmarshalCreateIpResponse;\nexports.unmarshalCreatePlacementGroupResponse = unmarshalCreatePlacementGroupResponse;\nexports.unmarshalCreatePrivateNICResponse = unmarshalCreatePrivateNICResponse;\nexports.unmarshalCreateSecurityGroupResponse = unmarshalCreateSecurityGroupResponse;\nexports.unmarshalCreateSecurityGroupRuleResponse = unmarshalCreateSecurityGroupRuleResponse;\nexports.unmarshalCreateServerResponse = unmarshalCreateServerResponse;\nexports.unmarshalCreateSnapshotResponse = unmarshalCreateSnapshotResponse;\nexports.unmarshalCreateVolumeResponse = unmarshalCreateVolumeResponse;\nexports.unmarshalDetachServerVolumeResponse = unmarshalDetachServerVolumeResponse;\nexports.unmarshalExportSnapshotResponse = unmarshalExportSnapshotResponse;\nexports.unmarshalGetBootscriptResponse = unmarshalGetBootscriptResponse;\nexports.unmarshalGetDashboardResponse = unmarshalGetDashboardResponse;\nexports.unmarshalGetImageResponse = unmarshalGetImageResponse;\nexports.unmarshalGetIpResponse = unmarshalGetIpResponse;\nexports.unmarshalGetPlacementGroupResponse = unmarshalGetPlacementGroupResponse;\nexports.unmarshalGetPlacementGroupServersResponse = unmarshalGetPlacementGroupServersResponse;\nexports.unmarshalGetPrivateNICResponse = unmarshalGetPrivateNICResponse;\nexports.unmarshalGetSecurityGroupResponse = unmarshalGetSecurityGroupResponse;\nexports.unmarshalGetSecurityGroupRuleResponse = unmarshalGetSecurityGroupRuleResponse;\nexports.unmarshalGetServerResponse = unmarshalGetServerResponse;\nexports.unmarshalGetServerTypesAvailabilityResponse = unmarshalGetServerTypesAvailabilityResponse;\nexports.unmarshalGetSnapshotResponse = unmarshalGetSnapshotResponse;\nexports.unmarshalGetVolumeResponse = unmarshalGetVolumeResponse;\nexports.unmarshalListBootscriptsResponse = unmarshalListBootscriptsResponse;\nexports.unmarshalListImagesResponse = unmarshalListImagesResponse;\nexports.unmarshalListIpsResponse = unmarshalListIpsResponse;\nexports.unmarshalListPlacementGroupsResponse = unmarshalListPlacementGroupsResponse;\nexports.unmarshalListPrivateNICsResponse = unmarshalListPrivateNICsResponse;\nexports.unmarshalListSecurityGroupRulesResponse = unmarshalListSecurityGroupRulesResponse;\nexports.unmarshalListSecurityGroupsResponse = unmarshalListSecurityGroupsResponse;\nexports.unmarshalListServerActionsResponse = unmarshalListServerActionsResponse;\nexports.unmarshalListServerUserDataResponse = unmarshalListServerUserDataResponse;\nexports.unmarshalListServersResponse = unmarshalListServersResponse;\nexports.unmarshalListServersTypesResponse = unmarshalListServersTypesResponse;\nexports.unmarshalListSnapshotsResponse = unmarshalListSnapshotsResponse;\nexports.unmarshalListVolumesResponse = unmarshalListVolumesResponse;\nexports.unmarshalListVolumesTypesResponse = unmarshalListVolumesTypesResponse;\nexports.unmarshalMigrationPlan = unmarshalMigrationPlan;\nexports.unmarshalPrivateNIC = unmarshalPrivateNIC;\nexports.unmarshalServerActionResponse = unmarshalServerActionResponse;\nexports.unmarshalSetImageResponse = unmarshalSetImageResponse;\nexports.unmarshalSetPlacementGroupResponse = unmarshalSetPlacementGroupResponse;\nexports.unmarshalSetPlacementGroupServersResponse = unmarshalSetPlacementGroupServersResponse;\nexports.unmarshalSetSecurityGroupResponse = unmarshalSetSecurityGroupResponse;\nexports.unmarshalSetSecurityGroupRuleResponse = unmarshalSetSecurityGroupRuleResponse;\nexports.unmarshalSetSecurityGroupRulesResponse = unmarshalSetSecurityGroupRulesResponse;\nexports.unmarshalSetServerResponse = unmarshalSetServerResponse;\nexports.unmarshalSetSnapshotResponse = unmarshalSetSnapshotResponse;\nexports.unmarshalUpdateImageResponse = unmarshalUpdateImageResponse;\nexports.unmarshalUpdateIpResponse = unmarshalUpdateIpResponse;\nexports.unmarshalUpdatePlacementGroupResponse = unmarshalUpdatePlacementGroupResponse;\nexports.unmarshalUpdatePlacementGroupServersResponse = unmarshalUpdatePlacementGroupServersResponse;\nexports.unmarshalUpdateSecurityGroupResponse = unmarshalUpdateSecurityGroupResponse;\nexports.unmarshalUpdateSecurityGroupRuleResponse = unmarshalUpdateSecurityGroupRuleResponse;\nexports.unmarshalUpdateServerResponse = unmarshalUpdateServerResponse;\nexports.unmarshalUpdateSnapshotResponse = unmarshalUpdateSnapshotResponse;\nexports.unmarshalUpdateVolumeResponse = unmarshalUpdateVolumeResponse;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst index_gen = require(\"./v1/index.gen.cjs\");\nexports.v1 = index_gen;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst intervalRetrier = require(\"../../../internal/async/interval-retrier.cjs\");\nconst api = require(\"../../../scw/api.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst resourcePaginator = require(\"../../../scw/fetch/resource-paginator.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nconst marshalling_gen = require(\"./marshalling.gen.cjs\");\nconst jsonContentHeaders = {\n \"Content-Type\": \"application/json; charset=utf-8\"\n};\nclass API extends api.API {\n /** Lists the available regions of the API. */\n static LOCALITIES = [\"fr-par\"];\n pageOfListHubs = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/iot/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/hubs`,\n urlParams: marshalling.urlParams(\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId]\n )\n },\n marshalling_gen.unmarshalListHubsResponse\n );\n /**\n * List hubs. List all Hubs in the specified zone. By default, returned Hubs\n * are ordered by creation date in ascending order, though this can be\n * modified via the `order_by` field.\n *\n * @param request - The request {@link ListHubsRequest}\n * @returns A Promise of ListHubsResponse\n */\n listHubs = (request = {}) => resourcePaginator.enrichForPagination(\"hubs\", this.pageOfListHubs, request);\n /**\n * Create a hub. Create a new Hub in the targeted region, specifying its\n * configuration including name and product plan.\n *\n * @param request - The request {@link CreateHubRequest}\n * @returns A Promise of Hub\n */\n createHub = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateHubRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/iot/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/hubs`\n },\n marshalling_gen.unmarshalHub\n );\n /**\n * Get a hub. Retrieve information about an existing IoT Hub, specified by its\n * Hub ID. Its full details, including name, status and endpoint, are returned\n * in the response object.\n *\n * @param request - The request {@link GetHubRequest}\n * @returns A Promise of Hub\n */\n getHub = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/iot/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/hubs/${marshalling.validatePathParam(\"hubId\", request.hubId)}`\n },\n marshalling_gen.unmarshalHub\n );\n /**\n * Waits for {@link Hub} to be in a final state.\n *\n * @param request - The request {@link GetHubRequest}\n * @param options - The waiting options\n * @returns A Promise of Hub\n */\n waitForHub = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(!content_gen.HUB_TRANSIENT_STATUSES.includes(res.status))),\n this.getHub,\n request,\n options\n );\n /**\n * Update a hub. Update the parameters of an existing IoT Hub, specified by\n * its Hub ID.\n *\n * @param request - The request {@link UpdateHubRequest}\n * @returns A Promise of Hub\n */\n updateHub = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateHubRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/iot/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/hubs/${marshalling.validatePathParam(\"hubId\", request.hubId)}`\n },\n marshalling_gen.unmarshalHub\n );\n /**\n * Enable a hub. Enable an existing IoT Hub, specified by its Hub ID.\n *\n * @param request - The request {@link EnableHubRequest}\n * @returns A Promise of Hub\n */\n enableHub = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/iot/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/hubs/${marshalling.validatePathParam(\"hubId\", request.hubId)}/enable`\n },\n marshalling_gen.unmarshalHub\n );\n /**\n * Disable a hub. Disable an existing IoT Hub, specified by its Hub ID.\n *\n * @param request - The request {@link DisableHubRequest}\n * @returns A Promise of Hub\n */\n disableHub = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/iot/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/hubs/${marshalling.validatePathParam(\"hubId\", request.hubId)}/disable`\n },\n marshalling_gen.unmarshalHub\n );\n /**\n * Delete a hub. Delete an existing IoT Hub, specified by its Hub ID. Deleting\n * a Hub is permanent, and cannot be undone.\n *\n * @param request - The request {@link DeleteHubRequest}\n */\n deleteHub = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/iot/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/hubs/${marshalling.validatePathParam(\"hubId\", request.hubId)}`,\n urlParams: marshalling.urlParams([\"delete_devices\", request.deleteDevices])\n });\n /**\n * Get a hub's metrics. Get the metrics of an existing IoT Hub, specified by\n * its Hub ID.\n *\n * @deprecated\n * @param request - The request {@link GetHubMetricsRequest}\n * @returns A Promise of GetHubMetricsResponse\n */\n getHubMetrics = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/iot/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/hubs/${marshalling.validatePathParam(\"hubId\", request.hubId)}/metrics`,\n urlParams: marshalling.urlParams([\"start_date\", request.startDate])\n },\n marshalling_gen.unmarshalGetHubMetricsResponse\n );\n /**\n * Set the certificate authority of a hub. Set a particular PEM-encoded\n * certificate, specified by the Hub ID.\n *\n * @param request - The request {@link SetHubCARequest}\n * @returns A Promise of Hub\n */\n setHubCA = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalSetHubCARequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/iot/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/hubs/${marshalling.validatePathParam(\"hubId\", request.hubId)}/ca`\n },\n marshalling_gen.unmarshalHub\n );\n /**\n * Get the certificate authority of a hub. Get information for a particular\n * PEM-encoded certificate, specified by the Hub ID.\n *\n * @param request - The request {@link GetHubCARequest}\n * @returns A Promise of GetHubCAResponse\n */\n getHubCA = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/iot/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/hubs/${marshalling.validatePathParam(\"hubId\", request.hubId)}/ca`\n },\n marshalling_gen.unmarshalGetHubCAResponse\n );\n pageOfListDevices = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/iot/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/devices`,\n urlParams: marshalling.urlParams(\n [\"allow_insecure\", request.allowInsecure],\n [\"hub_id\", request.hubId],\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"status\", request.status]\n )\n },\n marshalling_gen.unmarshalListDevicesResponse\n );\n /**\n * List devices. List all devices in the specified region. By default,\n * returned devices are ordered by creation date in ascending order, though\n * this can be modified via the `order_by` field.\n *\n * @param request - The request {@link ListDevicesRequest}\n * @returns A Promise of ListDevicesResponse\n */\n listDevices = (request = {}) => resourcePaginator.enrichForPagination(\"devices\", this.pageOfListDevices, request);\n /**\n * Add a device. Attach a device to a given Hub.\n *\n * @param request - The request {@link CreateDeviceRequest}\n * @returns A Promise of CreateDeviceResponse\n */\n createDevice = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateDeviceRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/iot/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/devices`\n },\n marshalling_gen.unmarshalCreateDeviceResponse\n );\n /**\n * Get a device. Retrieve information about an existing device, specified by\n * its device ID. Its full details, including name, status and ID, are\n * returned in the response object.\n *\n * @param request - The request {@link GetDeviceRequest}\n * @returns A Promise of Device\n */\n getDevice = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/iot/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/devices/${marshalling.validatePathParam(\"deviceId\", request.deviceId)}`\n },\n marshalling_gen.unmarshalDevice\n );\n /**\n * Update a device. Update the parameters of an existing device, specified by\n * its device ID.\n *\n * @param request - The request {@link UpdateDeviceRequest}\n * @returns A Promise of Device\n */\n updateDevice = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateDeviceRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/iot/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/devices/${marshalling.validatePathParam(\"deviceId\", request.deviceId)}`\n },\n marshalling_gen.unmarshalDevice\n );\n /**\n * Enable a device. Enable a specific device, specified by its device ID.\n *\n * @param request - The request {@link EnableDeviceRequest}\n * @returns A Promise of Device\n */\n enableDevice = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/iot/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/devices/${marshalling.validatePathParam(\"deviceId\", request.deviceId)}/enable`\n },\n marshalling_gen.unmarshalDevice\n );\n /**\n * Disable a device. Disable an existing device, specified by its device ID.\n *\n * @param request - The request {@link DisableDeviceRequest}\n * @returns A Promise of Device\n */\n disableDevice = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/iot/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/devices/${marshalling.validatePathParam(\"deviceId\", request.deviceId)}/disable`\n },\n marshalling_gen.unmarshalDevice\n );\n /**\n * Renew a device certificate. Renew the certificate of an existing device,\n * specified by its device ID.\n *\n * @param request - The request {@link RenewDeviceCertificateRequest}\n * @returns A Promise of RenewDeviceCertificateResponse\n */\n renewDeviceCertificate = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/iot/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/devices/${marshalling.validatePathParam(\"deviceId\", request.deviceId)}/renew-certificate`\n },\n marshalling_gen.unmarshalRenewDeviceCertificateResponse\n );\n /**\n * Set a custom certificate on a device. Switch the existing certificate of a\n * given device with an EM-encoded custom certificate.\n *\n * @param request - The request {@link SetDeviceCertificateRequest}\n * @returns A Promise of SetDeviceCertificateResponse\n */\n setDeviceCertificate = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalSetDeviceCertificateRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PUT\",\n path: `/iot/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/devices/${marshalling.validatePathParam(\"deviceId\", request.deviceId)}/certificate`\n },\n marshalling_gen.unmarshalSetDeviceCertificateResponse\n );\n /**\n * Get a device's certificate. Get information for a particular PEM-encoded\n * certificate, specified by the device ID. The response returns full details\n * of the device, including its type of certificate.\n *\n * @param request - The request {@link GetDeviceCertificateRequest}\n * @returns A Promise of GetDeviceCertificateResponse\n */\n getDeviceCertificate = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/iot/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/devices/${marshalling.validatePathParam(\"deviceId\", request.deviceId)}/certificate`\n },\n marshalling_gen.unmarshalGetDeviceCertificateResponse\n );\n /**\n * Remove a device. Remove a specific device from the specific Hub it is\n * attached to.\n *\n * @param request - The request {@link DeleteDeviceRequest}\n */\n deleteDevice = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/iot/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/devices/${marshalling.validatePathParam(\"deviceId\", request.deviceId)}`\n });\n /**\n * Get a device's metrics. Get the metrics of an existing device, specified by\n * its device ID.\n *\n * @deprecated\n * @param request - The request {@link GetDeviceMetricsRequest}\n * @returns A Promise of GetDeviceMetricsResponse\n */\n getDeviceMetrics = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/iot/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/devices/${marshalling.validatePathParam(\"deviceId\", request.deviceId)}/metrics`,\n urlParams: marshalling.urlParams([\"start_date\", request.startDate])\n },\n marshalling_gen.unmarshalGetDeviceMetricsResponse\n );\n pageOfListRoutes = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/iot/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/routes`,\n urlParams: marshalling.urlParams(\n [\"hub_id\", request.hubId],\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListRoutesResponse\n );\n /**\n * List routes. List all routes in the specified region. By default, returned\n * routes are ordered by creation date in ascending order, though this can be\n * modified via the `order_by` field.\n *\n * @param request - The request {@link ListRoutesRequest}\n * @returns A Promise of ListRoutesResponse\n */\n listRoutes = (request = {}) => resourcePaginator.enrichForPagination(\"routes\", this.pageOfListRoutes, request);\n /**\n * Create a route. Multiple kinds of routes can be created, such as:\n *\n * - Database Route Create a route that will record subscribed MQTT messages\n * into your database. You need to manage the database by yourself.\n * - REST Route. Create a route that will call a REST API on received subscribed\n * MQTT messages.\n * - S3 Routes. Create a route that will put subscribed MQTT messages into an S3\n * bucket. You need to create the bucket yourself and grant write access.\n * Granting can be done with s3cmd (`s3cmd setacl s3://\n * --acl-grant=write:555c69c3-87d0-4bf8-80f1-99a2f757d031:555c69c3-87d0-4bf8-80f1-99a2f757d031`).\n *\n * @param request - The request {@link CreateRouteRequest}\n * @returns A Promise of Route\n */\n createRoute = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateRouteRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/iot/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/routes`\n },\n marshalling_gen.unmarshalRoute\n );\n /**\n * Update a route. Update the parameters of an existing route, specified by\n * its route ID.\n *\n * @param request - The request {@link UpdateRouteRequest}\n * @returns A Promise of Route\n */\n updateRoute = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateRouteRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/iot/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/routes/${marshalling.validatePathParam(\"routeId\", request.routeId)}`\n },\n marshalling_gen.unmarshalRoute\n );\n /**\n * Get a route. Get information for a particular route, specified by the route\n * ID. The response returns full details of the route, including its type, the\n * topic it subscribes to and its configuration.\n *\n * @param request - The request {@link GetRouteRequest}\n * @returns A Promise of Route\n */\n getRoute = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/iot/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/routes/${marshalling.validatePathParam(\"routeId\", request.routeId)}`\n },\n marshalling_gen.unmarshalRoute\n );\n /**\n * Delete a route. Delete an existing route, specified by its route ID.\n * Deleting a route is permanent, and cannot be undone.\n *\n * @param request - The request {@link DeleteRouteRequest}\n */\n deleteRoute = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/iot/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/routes/${marshalling.validatePathParam(\"routeId\", request.routeId)}`\n });\n pageOfListNetworks = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/iot/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/networks`,\n urlParams: marshalling.urlParams(\n [\"hub_id\", request.hubId],\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"topic_prefix\", request.topicPrefix]\n )\n },\n marshalling_gen.unmarshalListNetworksResponse\n );\n /**\n * List the networks.\n *\n * @param request - The request {@link ListNetworksRequest}\n * @returns A Promise of ListNetworksResponse\n */\n listNetworks = (request = {}) => resourcePaginator.enrichForPagination(\"networks\", this.pageOfListNetworks, request);\n /**\n * Create a new network. Create a new network for an existing hub. Beside the\n * default network, you can add networks for different data providers.\n * Possible network types are Sigfox and REST.\n *\n * @param request - The request {@link CreateNetworkRequest}\n * @returns A Promise of CreateNetworkResponse\n */\n createNetwork = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateNetworkRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/iot/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/networks`\n },\n marshalling_gen.unmarshalCreateNetworkResponse\n );\n /**\n * Retrieve a specific network. Retrieve an existing network, specified by its\n * network ID. The response returns full details of the network, including its\n * type, the topic prefix and its endpoint.\n *\n * @param request - The request {@link GetNetworkRequest}\n * @returns A Promise of Network\n */\n getNetwork = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/iot/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/networks/${marshalling.validatePathParam(\"networkId\", request.networkId)}`\n },\n marshalling_gen.unmarshalNetwork\n );\n /**\n * Delete a Network. Delete an existing network, specified by its network ID.\n * Deleting a network is permanent, and cannot be undone.\n *\n * @param request - The request {@link DeleteNetworkRequest}\n */\n deleteNetwork = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/iot/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/networks/${marshalling.validatePathParam(\"networkId\", request.networkId)}`\n });\n /**\n * BETA - Get a Cloud Twin Document.\n *\n * @param request - The request {@link GetTwinDocumentRequest}\n * @returns A Promise of TwinDocument\n */\n getTwinDocument = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/iot/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/twins/${marshalling.validatePathParam(\"twinId\", request.twinId)}/documents/${marshalling.validatePathParam(\"documentName\", request.documentName)}`\n },\n marshalling_gen.unmarshalTwinDocument\n );\n /**\n * BETA - Update a Cloud Twin Document.\n *\n * @param request - The request {@link PutTwinDocumentRequest}\n * @returns A Promise of TwinDocument\n */\n putTwinDocument = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalPutTwinDocumentRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PUT\",\n path: `/iot/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/twins/${marshalling.validatePathParam(\"twinId\", request.twinId)}/documents/${marshalling.validatePathParam(\"documentName\", request.documentName)}`\n },\n marshalling_gen.unmarshalTwinDocument\n );\n /**\n * BETA - Patch a Cloud Twin Document.\n *\n * @param request - The request {@link PatchTwinDocumentRequest}\n * @returns A Promise of TwinDocument\n */\n patchTwinDocument = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalPatchTwinDocumentRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/iot/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/twins/${marshalling.validatePathParam(\"twinId\", request.twinId)}/documents/${marshalling.validatePathParam(\"documentName\", request.documentName)}`\n },\n marshalling_gen.unmarshalTwinDocument\n );\n /**\n * BETA - Delete a Cloud Twin Document.\n *\n * @param request - The request {@link DeleteTwinDocumentRequest}\n */\n deleteTwinDocument = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/iot/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/twins/${marshalling.validatePathParam(\"twinId\", request.twinId)}/documents/${marshalling.validatePathParam(\"documentName\", request.documentName)}`\n });\n /**\n * BETA - List the documents of a Cloud Twin.\n *\n * @param request - The request {@link ListTwinDocumentsRequest}\n * @returns A Promise of ListTwinDocumentsResponse\n */\n listTwinDocuments = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/iot/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/twins/${marshalling.validatePathParam(\"twinId\", request.twinId)}`\n },\n marshalling_gen.unmarshalListTwinDocumentsResponse\n );\n /**\n * BETA - Delete all the documents of a Cloud Twin.\n *\n * @param request - The request {@link DeleteTwinDocumentsRequest}\n */\n deleteTwinDocuments = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/iot/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/twins/${marshalling.validatePathParam(\"twinId\", request.twinId)}`\n });\n}\nexports.API = API;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst HUB_TRANSIENT_STATUSES = [\"enabling\", \"disabling\"];\nexports.HUB_TRANSIENT_STATUSES = HUB_TRANSIENT_STATUSES;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api_gen = require(\"./api.gen.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nexports.API = api_gen.API;\nexports.HUB_TRANSIENT_STATUSES = content_gen.HUB_TRANSIENT_STATUSES;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst randomName = require(\"@scaleway/random-name\");\nconst json = require(\"../../../helpers/json.cjs\");\nconst customMarshalling = require(\"../../../scw/custom-marshalling.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nconst unmarshalDeviceMessageFiltersRule = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DeviceMessageFiltersRule' failed as data isn't a dictionary.`\n );\n }\n return {\n policy: data.policy,\n topics: data.topics\n };\n};\nconst unmarshalDeviceMessageFilters = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DeviceMessageFilters' failed as data isn't a dictionary.`\n );\n }\n return {\n publish: data.publish ? unmarshalDeviceMessageFiltersRule(data.publish) : void 0,\n subscribe: data.subscribe ? unmarshalDeviceMessageFiltersRule(data.subscribe) : void 0\n };\n};\nconst unmarshalDevice = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Device' failed as data isn't a dictionary.`\n );\n }\n return {\n allowInsecure: data.allow_insecure,\n allowMultipleConnections: data.allow_multiple_connections,\n createdAt: marshalling.unmarshalDate(data.created_at),\n description: data.description,\n hasCustomCertificate: data.has_custom_certificate,\n hubId: data.hub_id,\n id: data.id,\n isConnected: data.is_connected,\n lastActivityAt: marshalling.unmarshalDate(data.last_activity_at),\n messageFilters: data.message_filters ? unmarshalDeviceMessageFilters(data.message_filters) : void 0,\n name: data.name,\n status: data.status,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalNetwork = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Network' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n endpoint: data.endpoint,\n hubId: data.hub_id,\n id: data.id,\n name: data.name,\n topicPrefix: data.topic_prefix,\n type: data.type\n };\n};\nconst unmarshalHubTwinsGraphiteConfig = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'HubTwinsGraphiteConfig' failed as data isn't a dictionary.`\n );\n }\n return {\n pushUri: data.push_uri\n };\n};\nconst unmarshalHub = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Hub' failed as data isn't a dictionary.`\n );\n }\n return {\n connectedDeviceCount: data.connected_device_count,\n createdAt: marshalling.unmarshalDate(data.created_at),\n deviceCount: data.device_count,\n disableEvents: data.disable_events,\n enableDeviceAutoProvisioning: data.enable_device_auto_provisioning,\n enabled: data.enabled,\n endpoint: data.endpoint,\n eventsTopicPrefix: data.events_topic_prefix,\n hasCustomCa: data.has_custom_ca,\n id: data.id,\n name: data.name,\n organizationId: data.organization_id,\n productPlan: data.product_plan,\n projectId: data.project_id,\n region: data.region,\n status: data.status,\n twinsGraphiteConfig: data.twins_graphite_config ? unmarshalHubTwinsGraphiteConfig(data.twins_graphite_config) : void 0,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalCertificate = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Certificate' failed as data isn't a dictionary.`\n );\n }\n return {\n crt: data.crt,\n key: data.key\n };\n};\nconst unmarshalCreateDeviceResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'CreateDeviceResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n certificate: data.certificate ? unmarshalCertificate(data.certificate) : void 0,\n device: data.device ? unmarshalDevice(data.device) : void 0\n };\n};\nconst unmarshalCreateNetworkResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'CreateNetworkResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n network: data.network ? unmarshalNetwork(data.network) : void 0,\n secret: data.secret\n };\n};\nconst unmarshalGetDeviceCertificateResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'GetDeviceCertificateResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n certificatePem: data.certificate_pem,\n device: data.device ? unmarshalDevice(data.device) : void 0\n };\n};\nconst unmarshalGetDeviceMetricsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'GetDeviceMetricsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n metrics: marshalling.unmarshalArrayOfObject(data.metrics, customMarshalling.unmarshalTimeSeries)\n };\n};\nconst unmarshalGetHubCAResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'GetHubCAResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n caCertPem: data.ca_cert_pem\n };\n};\nconst unmarshalGetHubMetricsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'GetHubMetricsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n metrics: marshalling.unmarshalArrayOfObject(data.metrics, customMarshalling.unmarshalTimeSeries)\n };\n};\nconst unmarshalListDevicesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListDevicesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n devices: marshalling.unmarshalArrayOfObject(data.devices, unmarshalDevice),\n totalCount: data.total_count\n };\n};\nconst unmarshalListHubsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListHubsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n hubs: marshalling.unmarshalArrayOfObject(data.hubs, unmarshalHub),\n totalCount: data.total_count\n };\n};\nconst unmarshalListNetworksResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListNetworksResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n networks: marshalling.unmarshalArrayOfObject(data.networks, unmarshalNetwork),\n totalCount: data.total_count\n };\n};\nconst unmarshalRouteSummary = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'RouteSummary' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n hubId: data.hub_id,\n id: data.id,\n name: data.name,\n topic: data.topic,\n type: data.type,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalListRoutesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListRoutesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n routes: marshalling.unmarshalArrayOfObject(data.routes, unmarshalRouteSummary),\n totalCount: data.total_count\n };\n};\nconst unmarshalListTwinDocumentsResponseDocumentSummary = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListTwinDocumentsResponseDocumentSummary' failed as data isn't a dictionary.`\n );\n }\n return {\n documentName: data.document_name\n };\n};\nconst unmarshalListTwinDocumentsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListTwinDocumentsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n documents: marshalling.unmarshalArrayOfObject(\n data.documents,\n unmarshalListTwinDocumentsResponseDocumentSummary\n )\n };\n};\nconst unmarshalRenewDeviceCertificateResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'RenewDeviceCertificateResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n certificate: data.certificate ? unmarshalCertificate(data.certificate) : void 0,\n device: data.device ? unmarshalDevice(data.device) : void 0\n };\n};\nconst unmarshalRouteDatabaseConfig = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'RouteDatabaseConfig' failed as data isn't a dictionary.`\n );\n }\n return {\n dbname: data.dbname,\n engine: data.engine,\n host: data.host,\n password: data.password,\n port: data.port,\n query: data.query,\n username: data.username\n };\n};\nconst unmarshalRouteRestConfig = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'RouteRestConfig' failed as data isn't a dictionary.`\n );\n }\n return {\n headers: data.headers,\n uri: data.uri,\n verb: data.verb\n };\n};\nconst unmarshalRouteS3Config = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'RouteS3Config' failed as data isn't a dictionary.`\n );\n }\n return {\n bucketName: data.bucket_name,\n bucketRegion: data.bucket_region,\n objectPrefix: data.object_prefix,\n strategy: data.strategy\n };\n};\nconst unmarshalRoute = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Route' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n dbConfig: data.db_config ? unmarshalRouteDatabaseConfig(data.db_config) : void 0,\n hubId: data.hub_id,\n id: data.id,\n name: data.name,\n restConfig: data.rest_config ? unmarshalRouteRestConfig(data.rest_config) : void 0,\n s3Config: data.s3_config ? unmarshalRouteS3Config(data.s3_config) : void 0,\n topic: data.topic,\n type: data.type,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalSetDeviceCertificateResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SetDeviceCertificateResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n certificatePem: data.certificate_pem,\n device: data.device ? unmarshalDevice(data.device) : void 0\n };\n};\nconst unmarshalTwinDocument = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'TwinDocument' failed as data isn't a dictionary.`\n );\n }\n return {\n data: data.data,\n documentName: data.document_name,\n twinId: data.twin_id,\n version: data.version\n };\n};\nconst marshalDeviceMessageFiltersRule = (request, defaults) => ({\n policy: request.policy,\n topics: request.topics\n});\nconst marshalDeviceMessageFilters = (request, defaults) => ({\n publish: request.publish !== void 0 ? marshalDeviceMessageFiltersRule(request.publish) : void 0,\n subscribe: request.subscribe !== void 0 ? marshalDeviceMessageFiltersRule(request.subscribe) : void 0\n});\nconst marshalCreateDeviceRequest = (request, defaults) => ({\n allow_insecure: request.allowInsecure,\n allow_multiple_connections: request.allowMultipleConnections,\n description: request.description,\n hub_id: request.hubId,\n message_filters: request.messageFilters !== void 0 ? marshalDeviceMessageFilters(request.messageFilters) : void 0,\n name: request.name || randomName(\"device\")\n});\nconst marshalHubTwinsGraphiteConfig = (request, defaults) => ({\n push_uri: request.pushUri\n});\nconst marshalCreateHubRequest = (request, defaults) => ({\n disable_events: request.disableEvents,\n events_topic_prefix: request.eventsTopicPrefix,\n name: request.name || randomName(\"hub\"),\n product_plan: request.productPlan,\n project_id: request.projectId ?? defaults.defaultProjectId,\n ...marshalling.resolveOneOf([\n {\n param: \"twins_graphite_config\",\n value: request.twinsGraphiteConfig !== void 0 ? marshalHubTwinsGraphiteConfig(request.twinsGraphiteConfig) : void 0\n }\n ])\n});\nconst marshalCreateNetworkRequest = (request, defaults) => ({\n hub_id: request.hubId,\n name: request.name || randomName(\"network\"),\n topic_prefix: request.topicPrefix,\n type: request.type\n});\nconst marshalCreateRouteRequestDatabaseConfig = (request, defaults) => ({\n dbname: request.dbname,\n engine: request.engine,\n host: request.host,\n password: request.password,\n port: request.port,\n query: request.query,\n username: request.username\n});\nconst marshalCreateRouteRequestRestConfig = (request, defaults) => ({\n headers: request.headers,\n uri: request.uri,\n verb: request.verb\n});\nconst marshalCreateRouteRequestS3Config = (request, defaults) => ({\n bucket_name: request.bucketName,\n bucket_region: request.bucketRegion,\n object_prefix: request.objectPrefix,\n strategy: request.strategy\n});\nconst marshalCreateRouteRequest = (request, defaults) => ({\n hub_id: request.hubId,\n name: request.name || randomName(\"route\"),\n topic: request.topic,\n ...marshalling.resolveOneOf([\n {\n param: \"s3_config\",\n value: request.s3Config !== void 0 ? marshalCreateRouteRequestS3Config(request.s3Config) : void 0\n },\n {\n param: \"db_config\",\n value: request.dbConfig !== void 0 ? marshalCreateRouteRequestDatabaseConfig(request.dbConfig) : void 0\n },\n {\n param: \"rest_config\",\n value: request.restConfig !== void 0 ? marshalCreateRouteRequestRestConfig(request.restConfig) : void 0\n }\n ])\n});\nconst marshalPatchTwinDocumentRequest = (request, defaults) => ({\n data: request.data,\n version: request.version\n});\nconst marshalPutTwinDocumentRequest = (request, defaults) => ({\n data: request.data,\n version: request.version\n});\nconst marshalSetDeviceCertificateRequest = (request, defaults) => ({\n certificate_pem: request.certificatePem\n});\nconst marshalSetHubCARequest = (request, defaults) => ({\n ca_cert_pem: request.caCertPem,\n challenge_cert_pem: request.challengeCertPem\n});\nconst marshalUpdateDeviceRequest = (request, defaults) => ({\n allow_insecure: request.allowInsecure,\n allow_multiple_connections: request.allowMultipleConnections,\n description: request.description,\n hub_id: request.hubId,\n message_filters: request.messageFilters !== void 0 ? marshalDeviceMessageFilters(request.messageFilters) : void 0\n});\nconst marshalUpdateHubRequest = (request, defaults) => ({\n disable_events: request.disableEvents,\n enable_device_auto_provisioning: request.enableDeviceAutoProvisioning,\n events_topic_prefix: request.eventsTopicPrefix,\n name: request.name,\n product_plan: request.productPlan,\n ...marshalling.resolveOneOf([\n {\n param: \"twins_graphite_config\",\n value: request.twinsGraphiteConfig !== void 0 ? marshalHubTwinsGraphiteConfig(request.twinsGraphiteConfig) : void 0\n }\n ])\n});\nconst marshalUpdateRouteRequestDatabaseConfig = (request, defaults) => ({\n dbname: request.dbname,\n engine: request.engine,\n host: request.host,\n password: request.password,\n port: request.port,\n query: request.query,\n username: request.username\n});\nconst marshalUpdateRouteRequestRestConfig = (request, defaults) => ({\n headers: request.headers,\n uri: request.uri,\n verb: request.verb\n});\nconst marshalUpdateRouteRequestS3Config = (request, defaults) => ({\n bucket_name: request.bucketName,\n bucket_region: request.bucketRegion,\n object_prefix: request.objectPrefix,\n strategy: request.strategy\n});\nconst marshalUpdateRouteRequest = (request, defaults) => ({\n name: request.name,\n topic: request.topic,\n ...marshalling.resolveOneOf([\n {\n param: \"s3_config\",\n value: request.s3Config !== void 0 ? marshalUpdateRouteRequestS3Config(request.s3Config) : void 0\n },\n {\n param: \"db_config\",\n value: request.dbConfig !== void 0 ? marshalUpdateRouteRequestDatabaseConfig(request.dbConfig) : void 0\n },\n {\n param: \"rest_config\",\n value: request.restConfig !== void 0 ? marshalUpdateRouteRequestRestConfig(request.restConfig) : void 0\n }\n ])\n});\nexports.marshalCreateDeviceRequest = marshalCreateDeviceRequest;\nexports.marshalCreateHubRequest = marshalCreateHubRequest;\nexports.marshalCreateNetworkRequest = marshalCreateNetworkRequest;\nexports.marshalCreateRouteRequest = marshalCreateRouteRequest;\nexports.marshalPatchTwinDocumentRequest = marshalPatchTwinDocumentRequest;\nexports.marshalPutTwinDocumentRequest = marshalPutTwinDocumentRequest;\nexports.marshalSetDeviceCertificateRequest = marshalSetDeviceCertificateRequest;\nexports.marshalSetHubCARequest = marshalSetHubCARequest;\nexports.marshalUpdateDeviceRequest = marshalUpdateDeviceRequest;\nexports.marshalUpdateHubRequest = marshalUpdateHubRequest;\nexports.marshalUpdateRouteRequest = marshalUpdateRouteRequest;\nexports.unmarshalCreateDeviceResponse = unmarshalCreateDeviceResponse;\nexports.unmarshalCreateNetworkResponse = unmarshalCreateNetworkResponse;\nexports.unmarshalDevice = unmarshalDevice;\nexports.unmarshalGetDeviceCertificateResponse = unmarshalGetDeviceCertificateResponse;\nexports.unmarshalGetDeviceMetricsResponse = unmarshalGetDeviceMetricsResponse;\nexports.unmarshalGetHubCAResponse = unmarshalGetHubCAResponse;\nexports.unmarshalGetHubMetricsResponse = unmarshalGetHubMetricsResponse;\nexports.unmarshalHub = unmarshalHub;\nexports.unmarshalListDevicesResponse = unmarshalListDevicesResponse;\nexports.unmarshalListHubsResponse = unmarshalListHubsResponse;\nexports.unmarshalListNetworksResponse = unmarshalListNetworksResponse;\nexports.unmarshalListRoutesResponse = unmarshalListRoutesResponse;\nexports.unmarshalListTwinDocumentsResponse = unmarshalListTwinDocumentsResponse;\nexports.unmarshalNetwork = unmarshalNetwork;\nexports.unmarshalRenewDeviceCertificateResponse = unmarshalRenewDeviceCertificateResponse;\nexports.unmarshalRoute = unmarshalRoute;\nexports.unmarshalSetDeviceCertificateResponse = unmarshalSetDeviceCertificateResponse;\nexports.unmarshalTwinDocument = unmarshalTwinDocument;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst index_gen = require(\"./v1/index.gen.cjs\");\nexports.v1 = index_gen;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api = require(\"../../../scw/api.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst resourcePaginator = require(\"../../../scw/fetch/resource-paginator.cjs\");\nconst marshalling_gen = require(\"./marshalling.gen.cjs\");\nconst jsonContentHeaders = {\n \"Content-Type\": \"application/json; charset=utf-8\"\n};\nclass API extends api.API {\n /** Lists the available regions of the API. */\n static LOCALITIES = [\"fr-par\", \"nl-ams\", \"pl-waw\"];\n /**\n * Reserve a new IP. Reserve a new IP from the specified source. Currently IPs\n * can only be reserved from a Private Network.\n *\n * @param request - The request {@link BookIPRequest}\n * @returns A Promise of IP\n */\n bookIP = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalBookIPRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/ipam/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/ips`\n },\n marshalling_gen.unmarshalIP\n );\n /**\n * Release an IP. Release an IP not currently attached to a resource, and\n * returns it to the available IP pool.\n *\n * @param request - The request {@link ReleaseIPRequest}\n */\n releaseIP = (request) => this.client.fetch({\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"DELETE\",\n path: `/ipam/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/ips/${marshalling.validatePathParam(\"ipId\", request.ipId)}`\n });\n releaseIPSet = (request = {}) => this.client.fetch({\n body: JSON.stringify(\n marshalling_gen.marshalReleaseIPSetRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/ipam/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/ip-sets/release`\n });\n /**\n * Get an IP. Retrieve details of an existing IP, specified by its IP ID.\n *\n * @param request - The request {@link GetIPRequest}\n * @returns A Promise of IP\n */\n getIP = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/ipam/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/ips/${marshalling.validatePathParam(\"ipId\", request.ipId)}`\n },\n marshalling_gen.unmarshalIP\n );\n /**\n * Update an IP. Update parameters including tags of the specified IP.\n *\n * @param request - The request {@link UpdateIPRequest}\n * @returns A Promise of IP\n */\n updateIP = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateIPRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/ipam/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/ips/${marshalling.validatePathParam(\"ipId\", request.ipId)}`\n },\n marshalling_gen.unmarshalIP\n );\n pageOfListIPs = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/ipam/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/ips`,\n urlParams: marshalling.urlParams(\n [\"attached\", request.attached],\n [\"is_ipv6\", request.isIpv6],\n [\"mac_address\", request.macAddress],\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId],\n [\"resource_id\", request.resourceId],\n [\"resource_name\", request.resourceName],\n [\"resource_type\", request.resourceType],\n [\"resource_types\", request.resourceTypes],\n [\"tags\", request.tags],\n [\"vpc_id\", request.vpcId],\n ...Object.entries(\n marshalling.resolveOneOf([\n { param: \"zonal\", value: request.zonal },\n { param: \"private_network_id\", value: request.privateNetworkId },\n { param: \"subnet_id\", value: request.subnetId }\n ])\n )\n )\n },\n marshalling_gen.unmarshalListIPsResponse\n );\n /**\n * List existing IPs. List existing IPs in the specified region using various\n * filters. For example, you can filter for IPs within a specified Private\n * Network, or for public IPs within a specified Project. By default, the IPs\n * returned in the list are ordered by creation date in ascending order,\n * though this can be modified via the order_by field.\n *\n * @param request - The request {@link ListIPsRequest}\n * @returns A Promise of ListIPsResponse\n */\n listIPs = (request = {}) => resourcePaginator.enrichForPagination(\"ips\", this.pageOfListIPs, request);\n /**\n * Attach IP to custom resource. Attach an existing reserved IP from a Private\n * Network subnet to a custom, named resource via its MAC address. An example\n * of a custom resource is a virtual machine hosted on an Elastic Metal\n * server. Do not use this method for attaching IP addresses to standard\n * Scaleway resources as it will fail - see the relevant product API for an\n * equivalent method.\n *\n * @param request - The request {@link AttachIPRequest}\n * @returns A Promise of IP\n */\n attachIP = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalAttachIPRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/ipam/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/ips/${marshalling.validatePathParam(\"ipId\", request.ipId)}/attach`\n },\n marshalling_gen.unmarshalIP\n );\n /**\n * Detach IP from a custom resource. Detach a private IP from a custom\n * resource. An example of a custom resource is a virtual machine hosted on an\n * Elastic Metal server. Do not use this method for detaching IP addresses\n * from standard Scaleway resources (e.g. Instances, Load Balancers) as it\n * will fail - see the relevant product API for an equivalent method.\n *\n * @param request - The request {@link DetachIPRequest}\n * @returns A Promise of IP\n */\n detachIP = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalDetachIPRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/ipam/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/ips/${marshalling.validatePathParam(\"ipId\", request.ipId)}/detach`\n },\n marshalling_gen.unmarshalIP\n );\n /**\n * Move IP to a custom resource. Move an existing reserved private IP from one\n * custom resource (e.g. a virtual machine hosted on an Elastic Metal server)\n * to another custom resource. This will detach it from the first resource,\n * and attach it to the second. Do not use this method for moving IP addresses\n * between standard Scaleway resources (e.g. Instances, Load Balancers) as it\n * will fail - see the relevant product API for an equivalent method.\n *\n * @param request - The request {@link MoveIPRequest}\n * @returns A Promise of IP\n */\n moveIP = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalMoveIPRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/ipam/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/ips/${marshalling.validatePathParam(\"ipId\", request.ipId)}/move`\n },\n marshalling_gen.unmarshalIP\n );\n}\nexports.API = API;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api_gen = require(\"./api.gen.cjs\");\nconst validationRules_gen = require(\"./validation-rules.gen.cjs\");\nexports.API = api_gen.API;\nexports.ValidationRules = validationRules_gen;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst json = require(\"../../../helpers/json.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst unmarshalResource = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Resource' failed as data isn't a dictionary.`\n );\n }\n return {\n id: data.id,\n macAddress: data.mac_address,\n name: data.name,\n type: data.type\n };\n};\nconst unmarshalReverse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Reverse' failed as data isn't a dictionary.`\n );\n }\n return {\n address: data.address,\n hostname: data.hostname\n };\n};\nconst unmarshalSource = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Source' failed as data isn't a dictionary.`\n );\n }\n return {\n privateNetworkId: data.private_network_id,\n subnetId: data.subnet_id,\n zonal: data.zonal\n };\n};\nconst unmarshalIP = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'IP' failed as data isn't a dictionary.`\n );\n }\n return {\n address: data.address,\n createdAt: marshalling.unmarshalDate(data.created_at),\n id: data.id,\n isIpv6: data.is_ipv6,\n projectId: data.project_id,\n region: data.region,\n resource: data.resource ? unmarshalResource(data.resource) : void 0,\n reverses: marshalling.unmarshalArrayOfObject(data.reverses, unmarshalReverse),\n source: data.source ? unmarshalSource(data.source) : void 0,\n tags: data.tags,\n updatedAt: marshalling.unmarshalDate(data.updated_at),\n zone: data.zone\n };\n};\nconst unmarshalListIPsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListIPsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n ips: marshalling.unmarshalArrayOfObject(data.ips, unmarshalIP),\n totalCount: data.total_count\n };\n};\nconst marshalCustomResource = (request, defaults) => ({\n mac_address: request.macAddress,\n name: request.name\n});\nconst marshalAttachIPRequest = (request, defaults) => ({\n resource: marshalCustomResource(request.resource)\n});\nconst marshalSource = (request, defaults) => ({\n ...marshalling.resolveOneOf([\n { param: \"zonal\", value: request.zonal },\n { param: \"private_network_id\", value: request.privateNetworkId },\n { param: \"subnet_id\", value: request.subnetId }\n ])\n});\nconst marshalBookIPRequest = (request, defaults) => ({\n address: request.address,\n is_ipv6: request.isIpv6,\n project_id: request.projectId ?? defaults.defaultProjectId,\n resource: request.resource !== void 0 ? marshalCustomResource(request.resource) : void 0,\n source: marshalSource(request.source),\n tags: request.tags\n});\nconst marshalDetachIPRequest = (request, defaults) => ({\n resource: marshalCustomResource(request.resource)\n});\nconst marshalMoveIPRequest = (request, defaults) => ({\n from_resource: marshalCustomResource(request.fromResource),\n to_resource: request.toResource !== void 0 ? marshalCustomResource(request.toResource) : void 0\n});\nconst marshalReleaseIPSetRequest = (request, defaults) => ({\n ip_ids: request.ipIds\n});\nconst marshalReverse = (request, defaults) => ({\n address: request.address,\n hostname: request.hostname\n});\nconst marshalUpdateIPRequest = (request, defaults) => ({\n reverses: request.reverses !== void 0 ? request.reverses.map((elt) => marshalReverse(elt)) : void 0,\n tags: request.tags\n});\nexports.marshalAttachIPRequest = marshalAttachIPRequest;\nexports.marshalBookIPRequest = marshalBookIPRequest;\nexports.marshalDetachIPRequest = marshalDetachIPRequest;\nexports.marshalMoveIPRequest = marshalMoveIPRequest;\nexports.marshalReleaseIPSetRequest = marshalReleaseIPSetRequest;\nexports.marshalUpdateIPRequest = marshalUpdateIPRequest;\nexports.unmarshalIP = unmarshalIP;\nexports.unmarshalListIPsResponse = unmarshalListIPsResponse;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst ListIPsRequest = {\n resourceName: {\n maxLength: 63,\n minLength: 2\n }\n};\nexports.ListIPsRequest = ListIPsRequest;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst index_gen = require(\"./v1alpha1/index.gen.cjs\");\nexports.v1alpha1 = index_gen;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst intervalRetrier = require(\"../../../internal/async/interval-retrier.cjs\");\nconst api = require(\"../../../scw/api.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst resourcePaginator = require(\"../../../scw/fetch/resource-paginator.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nconst marshalling_gen = require(\"./marshalling.gen.cjs\");\nconst jsonContentHeaders = {\n \"Content-Type\": \"application/json; charset=utf-8\"\n};\nclass API extends api.API {\n /** Lists the available regions of the API. */\n static LOCALITIES = [\"fr-par\", \"nl-ams\", \"pl-waw\"];\n /**\n * Create a new volume. Create a new volume from a Project ID. Volume is\n * identified by an ID and used to host pin references. Volume is personal (at\n * least to your organization) even if IPFS blocks and CID are available to\n * anyone. Should be the first command you made because every pin must be\n * attached to a volume.\n *\n * @param request - The request {@link CreateVolumeRequest}\n * @returns A Promise of Volume\n */\n createVolume = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateVolumeRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/ipfs/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/volumes`\n },\n marshalling_gen.unmarshalVolume\n );\n /**\n * Get information about a volume. Retrieve information about a specific\n * volume.\n *\n * @param request - The request {@link GetVolumeRequest}\n * @returns A Promise of Volume\n */\n getVolume = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/ipfs/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/volumes/${marshalling.validatePathParam(\"volumeId\", request.volumeId)}`\n },\n marshalling_gen.unmarshalVolume\n );\n pageOfListVolumes = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/ipfs/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/volumes`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\n \"project_id\",\n request.projectId ?? this.client.settings.defaultProjectId\n ]\n )\n },\n marshalling_gen.unmarshalListVolumesResponse\n );\n /**\n * List all volumes by a Project ID. Retrieve information about all volumes\n * from a Project ID.\n *\n * @param request - The request {@link ListVolumesRequest}\n * @returns A Promise of ListVolumesResponse\n */\n listVolumes = (request = {}) => resourcePaginator.enrichForPagination(\"volumes\", this.pageOfListVolumes, request);\n /**\n * Update volume information. Update volume information (tag, name...).\n *\n * @param request - The request {@link UpdateVolumeRequest}\n * @returns A Promise of Volume\n */\n updateVolume = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateVolumeRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/ipfs/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/volumes/${marshalling.validatePathParam(\"volumeId\", request.volumeId)}`\n },\n marshalling_gen.unmarshalVolume\n );\n /**\n * Delete an existing volume. Delete a volume by its ID and every pin attached\n * to this volume. This process can take a while to conclude, depending on the\n * size of your pinned content.\n *\n * @param request - The request {@link DeleteVolumeRequest}\n */\n deleteVolume = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/ipfs/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/volumes/${marshalling.validatePathParam(\"volumeId\", request.volumeId)}`\n });\n /**\n * Create a pin by URL. Will fetch and store the content pointed by the\n * provided URL. The content must be available on the public IPFS network. The\n * content (IPFS blocks) will be host by the pinning service until pin\n * deletion. From that point, any other IPFS peer can fetch and host your\n * content: Make sure to pin public or encrypted content. Many pin requests\n * (from different users) can target the same CID. A pin is defined by its ID\n * (UUID), its status (queued, pinning, pinned or failed) and target CID.\n *\n * @param request - The request {@link CreatePinByURLRequest}\n * @returns A Promise of Pin\n */\n createPinByURL = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreatePinByURLRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/ipfs/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/pins/create-by-url`\n },\n marshalling_gen.unmarshalPin\n );\n /**\n * Create a pin by CID. Will fetch and store the content pointed by the\n * provided CID. The content must be available on the public IPFS network. The\n * content (IPFS blocks) will be host by the pinning service until pin\n * deletion. From that point, any other IPFS peer can fetch and host your\n * content: Make sure to pin public or encrypted content. Many pin requests\n * (from different users) can target the same CID. A pin is defined by its ID\n * (UUID), its status (queued, pinning, pinned or failed) and target CID.\n *\n * @param request - The request {@link CreatePinByCIDRequest}\n * @returns A Promise of Pin\n */\n createPinByCID = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreatePinByCIDRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/ipfs/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/pins/create-by-cid`\n },\n marshalling_gen.unmarshalPin\n );\n /**\n * Replace pin by CID. Deletes the given resource ID and pins the new CID in\n * its place. Will fetch and store the content pointed by the provided CID.\n * The content must be available on the public IPFS network. The content (IPFS\n * blocks) is hosted by the pinning service until the pin is deleted. While\n * the content is available any other IPFS peer can fetch and host your\n * content. For this reason, we recommend that you pin either public or\n * encrypted content. Several different pin requests can target the same CID.\n * A pin is defined by its ID (UUID), its status (queued, pinning, pinned or\n * failed) and target CID.\n *\n * @param request - The request {@link ReplacePinRequest}\n * @returns A Promise of ReplacePinResponse\n */\n replacePin = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalReplacePinRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/ipfs/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/pins/${marshalling.validatePathParam(\"pinId\", request.pinId)}/replace`\n },\n marshalling_gen.unmarshalReplacePinResponse\n );\n /**\n * Get pin information. Retrieve information about the provided **pin ID**,\n * such as status, last modification, and CID.\n *\n * @param request - The request {@link GetPinRequest}\n * @returns A Promise of Pin\n */\n getPin = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/ipfs/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/pins/${marshalling.validatePathParam(\"pinId\", request.pinId)}`,\n urlParams: marshalling.urlParams([\"volume_id\", request.volumeId])\n },\n marshalling_gen.unmarshalPin\n );\n /**\n * Waits for {@link Pin} to be in a final state.\n *\n * @param request - The request {@link GetPinRequest}\n * @param options - The waiting options\n * @returns A Promise of Pin\n */\n waitForPin = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(!content_gen.PIN_TRANSIENT_STATUSES.includes(res.status))),\n this.getPin,\n request,\n options\n );\n pageOfListPins = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/ipfs/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/pins`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId],\n [\"status\", request.status],\n [\"volume_id\", request.volumeId]\n )\n },\n marshalling_gen.unmarshalListPinsResponse\n );\n /**\n * List all pins within a volume. Retrieve information about all pins within a\n * volume.\n *\n * @param request - The request {@link ListPinsRequest}\n * @returns A Promise of ListPinsResponse\n */\n listPins = (request) => resourcePaginator.enrichForPagination(\"pins\", this.pageOfListPins, request);\n /**\n * Create an unpin request. An unpin request means that you no longer own the\n * content. This content can therefore be removed and no longer provided on\n * the IPFS network.\n *\n * @param request - The request {@link DeletePinRequest}\n */\n deletePin = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/ipfs/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/pins/${marshalling.validatePathParam(\"pinId\", request.pinId)}`,\n urlParams: marshalling.urlParams([\"volume_id\", request.volumeId])\n });\n}\nclass IpnsAPI extends api.API {\n /** Lists the available regions of the API. */\n static LOCALITIES = [\"fr-par\", \"nl-ams\", \"pl-waw\"];\n /**\n * Create a new name. You can use the `ipns key` command to list and generate\n * more names and their respective keys.\n *\n * @param request - The request {@link IpnsApiCreateNameRequest}\n * @returns A Promise of Name\n */\n createName = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalIpnsApiCreateNameRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/ipfs/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/names`\n },\n marshalling_gen.unmarshalName\n );\n /**\n * Get information about a name. Retrieve information about a specific name.\n *\n * @param request - The request {@link IpnsApiGetNameRequest}\n * @returns A Promise of Name\n */\n getName = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/ipfs/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/names/${marshalling.validatePathParam(\"nameId\", request.nameId)}`\n },\n marshalling_gen.unmarshalName\n );\n /**\n * Waits for {@link Name} to be in a final state.\n *\n * @param request - The request {@link IpnsApiGetNameRequest}\n * @param options - The waiting options\n * @returns A Promise of Name\n */\n waitForName = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(!content_gen.NAME_TRANSIENT_STATUSES.includes(res.status))),\n this.getName,\n request,\n options\n );\n /**\n * Delete an existing name. Delete a name by its ID.\n *\n * @param request - The request {@link IpnsApiDeleteNameRequest}\n */\n deleteName = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/ipfs/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/names/${marshalling.validatePathParam(\"nameId\", request.nameId)}`\n });\n pageOfListNames = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/ipfs/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/names`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId]\n )\n },\n marshalling_gen.unmarshalListNamesResponse\n );\n /**\n * List all names by a Project ID. Retrieve information about all names from a\n * Project ID.\n *\n * @param request - The request {@link IpnsApiListNamesRequest}\n * @returns A Promise of ListNamesResponse\n */\n listNames = (request = {}) => resourcePaginator.enrichForPagination(\"names\", this.pageOfListNames, request);\n /**\n * Update name information. Update name information (CID, tag, name...).\n *\n * @param request - The request {@link IpnsApiUpdateNameRequest}\n * @returns A Promise of Name\n */\n updateName = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalIpnsApiUpdateNameRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/ipfs/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/names/${marshalling.validatePathParam(\"nameId\", request.nameId)}`\n },\n marshalling_gen.unmarshalName\n );\n /**\n * Export your private key. Export a private key by its ID.\n *\n * @param request - The request {@link IpnsApiExportKeyNameRequest}\n * @returns A Promise of ExportKeyNameResponse\n */\n exportKeyName = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/ipfs/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/names/${marshalling.validatePathParam(\"nameId\", request.nameId)}/export-key`\n },\n marshalling_gen.unmarshalExportKeyNameResponse\n );\n /**\n * Import your private key. Import a private key.\n *\n * @param request - The request {@link IpnsApiImportKeyNameRequest}\n * @returns A Promise of Name\n */\n importKeyName = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalIpnsApiImportKeyNameRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/ipfs/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/names/import-key`\n },\n marshalling_gen.unmarshalName\n );\n}\nexports.API = API;\nexports.IpnsAPI = IpnsAPI;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst NAME_TRANSIENT_STATUSES = [\"queued\", \"publishing\"];\nconst PIN_TRANSIENT_STATUSES = [\"queued\", \"pinning\"];\nexports.NAME_TRANSIENT_STATUSES = NAME_TRANSIENT_STATUSES;\nexports.PIN_TRANSIENT_STATUSES = PIN_TRANSIENT_STATUSES;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api_gen = require(\"./api.gen.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nexports.API = api_gen.API;\nexports.IpnsAPI = api_gen.IpnsAPI;\nexports.NAME_TRANSIENT_STATUSES = content_gen.NAME_TRANSIENT_STATUSES;\nexports.PIN_TRANSIENT_STATUSES = content_gen.PIN_TRANSIENT_STATUSES;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst json = require(\"../../../helpers/json.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst unmarshalName = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Name' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n key: data.key,\n name: data.name,\n nameId: data.name_id,\n projectId: data.project_id,\n region: data.region,\n status: data.status,\n tags: data.tags,\n updatedAt: marshalling.unmarshalDate(data.updated_at),\n value: data.value\n };\n};\nconst unmarshalPinCIDMeta = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'PinCIDMeta' failed as data isn't a dictionary.`\n );\n }\n return {\n id: data.id\n };\n};\nconst unmarshalPinCID = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'PinCID' failed as data isn't a dictionary.`\n );\n }\n return {\n cid: data.cid,\n meta: data.meta ? unmarshalPinCIDMeta(data.meta) : void 0,\n name: data.name,\n origins: data.origins\n };\n};\nconst unmarshalPinInfo = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'PinInfo' failed as data isn't a dictionary.`\n );\n }\n return {\n id: data.id,\n progress: data.progress,\n size: data.size,\n statusDetails: data.status_details,\n url: data.url\n };\n};\nconst unmarshalPin = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Pin' failed as data isn't a dictionary.`\n );\n }\n return {\n cid: data.cid ? unmarshalPinCID(data.cid) : void 0,\n createdAt: marshalling.unmarshalDate(data.created_at),\n delegates: data.delegates,\n info: data.info ? unmarshalPinInfo(data.info) : void 0,\n pinId: data.pin_id,\n status: data.status\n };\n};\nconst unmarshalVolume = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Volume' failed as data isn't a dictionary.`\n );\n }\n return {\n countPin: data.count_pin,\n createdAt: marshalling.unmarshalDate(data.created_at),\n id: data.id,\n name: data.name,\n projectId: data.project_id,\n region: data.region,\n size: data.size,\n tags: data.tags,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalExportKeyNameResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ExportKeyNameResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n nameId: data.name_id,\n privateKey: data.private_key,\n projectId: data.project_id,\n publicKey: data.public_key,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalListNamesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListNamesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n names: marshalling.unmarshalArrayOfObject(data.names, unmarshalName),\n totalCount: data.total_count\n };\n};\nconst unmarshalListPinsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListPinsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n pins: marshalling.unmarshalArrayOfObject(data.pins, unmarshalPin),\n totalCount: data.total_count\n };\n};\nconst unmarshalListVolumesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListVolumesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n totalCount: data.total_count,\n volumes: marshalling.unmarshalArrayOfObject(data.volumes, unmarshalVolume)\n };\n};\nconst unmarshalReplacePinResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ReplacePinResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n pin: data.pin ? unmarshalPin(data.pin) : void 0\n };\n};\nconst marshalCreatePinByCIDRequest = (request, defaults) => ({\n cid: request.cid,\n name: request.name,\n origins: request.origins,\n volume_id: request.volumeId\n});\nconst marshalCreatePinByURLRequest = (request, defaults) => ({\n name: request.name,\n url: request.url,\n volume_id: request.volumeId\n});\nconst marshalCreateVolumeRequest = (request, defaults) => ({\n name: request.name,\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalIpnsApiCreateNameRequest = (request, defaults) => ({\n name: request.name,\n project_id: request.projectId ?? defaults.defaultProjectId,\n value: request.value\n});\nconst marshalIpnsApiImportKeyNameRequest = (request, defaults) => ({\n name: request.name,\n private_key: request.privateKey,\n project_id: request.projectId ?? defaults.defaultProjectId,\n value: request.value\n});\nconst marshalIpnsApiUpdateNameRequest = (request, defaults) => ({\n name: request.name,\n tags: request.tags,\n value: request.value\n});\nconst marshalReplacePinRequest = (request, defaults) => ({\n cid: request.cid,\n name: request.name,\n origins: request.origins,\n volume_id: request.volumeId\n});\nconst marshalUpdateVolumeRequest = (request, defaults) => ({\n name: request.name,\n tags: request.tags\n});\nexports.marshalCreatePinByCIDRequest = marshalCreatePinByCIDRequest;\nexports.marshalCreatePinByURLRequest = marshalCreatePinByURLRequest;\nexports.marshalCreateVolumeRequest = marshalCreateVolumeRequest;\nexports.marshalIpnsApiCreateNameRequest = marshalIpnsApiCreateNameRequest;\nexports.marshalIpnsApiImportKeyNameRequest = marshalIpnsApiImportKeyNameRequest;\nexports.marshalIpnsApiUpdateNameRequest = marshalIpnsApiUpdateNameRequest;\nexports.marshalReplacePinRequest = marshalReplacePinRequest;\nexports.marshalUpdateVolumeRequest = marshalUpdateVolumeRequest;\nexports.unmarshalExportKeyNameResponse = unmarshalExportKeyNameResponse;\nexports.unmarshalListNamesResponse = unmarshalListNamesResponse;\nexports.unmarshalListPinsResponse = unmarshalListPinsResponse;\nexports.unmarshalListVolumesResponse = unmarshalListVolumesResponse;\nexports.unmarshalName = unmarshalName;\nexports.unmarshalPin = unmarshalPin;\nexports.unmarshalReplacePinResponse = unmarshalReplacePinResponse;\nexports.unmarshalVolume = unmarshalVolume;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst index_gen = require(\"./v1alpha1/index.gen.cjs\");\nexports.v1alpha1 = index_gen;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api = require(\"../../../scw/api.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst resourcePaginator = require(\"../../../scw/fetch/resource-paginator.cjs\");\nconst marshalling_gen = require(\"./marshalling.gen.cjs\");\nconst jsonContentHeaders = {\n \"Content-Type\": \"application/json; charset=utf-8\"\n};\nclass API extends api.API {\n /** Lists the available regions of the API. */\n static LOCALITIES = [\"fr-par\", \"nl-ams\", \"pl-waw\"];\n /**\n * Create a new job definition in a specified Project.\n *\n * @param request - The request {@link CreateJobDefinitionRequest}\n * @returns A Promise of JobDefinition\n */\n createJobDefinition = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateJobDefinitionRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/serverless-jobs/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/job-definitions`\n },\n marshalling_gen.unmarshalJobDefinition\n );\n /**\n * Get a job definition by its unique identifier.\n *\n * @param request - The request {@link GetJobDefinitionRequest}\n * @returns A Promise of JobDefinition\n */\n getJobDefinition = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/serverless-jobs/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/job-definitions/${marshalling.validatePathParam(\"jobDefinitionId\", request.jobDefinitionId)}`\n },\n marshalling_gen.unmarshalJobDefinition\n );\n pageOfListJobDefinitions = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/serverless-jobs/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/job-definitions`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId]\n )\n },\n marshalling_gen.unmarshalListJobDefinitionsResponse\n );\n /**\n * List all your job definitions with filters.\n *\n * @param request - The request {@link ListJobDefinitionsRequest}\n * @returns A Promise of ListJobDefinitionsResponse\n */\n listJobDefinitions = (request = {}) => resourcePaginator.enrichForPagination(\n \"jobDefinitions\",\n this.pageOfListJobDefinitions,\n request\n );\n /**\n * Update an existing job definition associated with the specified unique\n * identifier.\n *\n * @param request - The request {@link UpdateJobDefinitionRequest}\n * @returns A Promise of JobDefinition\n */\n updateJobDefinition = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateJobDefinitionRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/serverless-jobs/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/job-definitions/${marshalling.validatePathParam(\"jobDefinitionId\", request.jobDefinitionId)}`\n },\n marshalling_gen.unmarshalJobDefinition\n );\n /**\n * Delete an exsisting job definition by its unique identifier.\n *\n * @param request - The request {@link DeleteJobDefinitionRequest}\n */\n deleteJobDefinition = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/serverless-jobs/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/job-definitions/${marshalling.validatePathParam(\"jobDefinitionId\", request.jobDefinitionId)}`\n });\n /**\n * Run an existing job definition by its unique identifier. This will create a\n * new job run.\n *\n * @param request - The request {@link StartJobDefinitionRequest}\n * @returns A Promise of StartJobDefinitionResponse\n */\n startJobDefinition = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalStartJobDefinitionRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/serverless-jobs/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/job-definitions/${marshalling.validatePathParam(\"jobDefinitionId\", request.jobDefinitionId)}/start`\n },\n marshalling_gen.unmarshalStartJobDefinitionResponse\n );\n /**\n * Get a job run by its unique identifier.\n *\n * @param request - The request {@link GetJobRunRequest}\n * @returns A Promise of JobRun\n */\n getJobRun = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/serverless-jobs/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/job-runs/${marshalling.validatePathParam(\"jobRunId\", request.jobRunId)}`\n },\n marshalling_gen.unmarshalJobRun\n );\n /**\n * Stop a job run by its unique identifier.\n *\n * @param request - The request {@link StopJobRunRequest}\n * @returns A Promise of JobRun\n */\n stopJobRun = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/serverless-jobs/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/job-runs/${marshalling.validatePathParam(\"jobRunId\", request.jobRunId)}/stop`\n },\n marshalling_gen.unmarshalJobRun\n );\n pageOfListJobRuns = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/serverless-jobs/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/job-runs`,\n urlParams: marshalling.urlParams(\n [\"job_definition_id\", request.jobDefinitionId],\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId]\n )\n },\n marshalling_gen.unmarshalListJobRunsResponse\n );\n /**\n * List all job runs with filters.\n *\n * @param request - The request {@link ListJobRunsRequest}\n * @returns A Promise of ListJobRunsResponse\n */\n listJobRuns = (request = {}) => resourcePaginator.enrichForPagination(\"jobRuns\", this.pageOfListJobRuns, request);\n /**\n * List jobs resources for the console.\n *\n * @param request - The request {@link ListJobsResourcesRequest}\n * @returns A Promise of ListJobsResourcesResponse\n */\n listJobsResources = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/serverless-jobs/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/jobs-resources`\n },\n marshalling_gen.unmarshalListJobsResourcesResponse\n );\n}\nexports.API = API;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst JOB_RUN_TRANSIENT_STATUSES = [\n \"queued\",\n \"scheduled\",\n \"running\"\n];\nexports.JOB_RUN_TRANSIENT_STATUSES = JOB_RUN_TRANSIENT_STATUSES;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api_gen = require(\"./api.gen.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nconst validationRules_gen = require(\"./validation-rules.gen.cjs\");\nexports.API = api_gen.API;\nexports.JOB_RUN_TRANSIENT_STATUSES = content_gen.JOB_RUN_TRANSIENT_STATUSES;\nexports.ValidationRules = validationRules_gen;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst randomName = require(\"@scaleway/random-name\");\nconst json = require(\"../../../helpers/json.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst unmarshalCronSchedule = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'CronSchedule' failed as data isn't a dictionary.`\n );\n }\n return {\n schedule: data.schedule,\n timezone: data.timezone\n };\n};\nconst unmarshalJobDefinition = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'JobDefinition' failed as data isn't a dictionary.`\n );\n }\n return {\n command: data.command,\n cpuLimit: data.cpu_limit,\n createdAt: marshalling.unmarshalDate(data.created_at),\n cronSchedule: data.cron_schedule ? unmarshalCronSchedule(data.cron_schedule) : void 0,\n description: data.description,\n environmentVariables: data.environment_variables,\n id: data.id,\n imageUri: data.image_uri,\n jobTimeout: data.job_timeout,\n localStorageCapacity: data.local_storage_capacity,\n memoryLimit: data.memory_limit,\n name: data.name,\n projectId: data.project_id,\n region: data.region,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalJobRun = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'JobRun' failed as data isn't a dictionary.`\n );\n }\n return {\n command: data.command,\n cpuLimit: data.cpu_limit,\n createdAt: marshalling.unmarshalDate(data.created_at),\n environmentVariables: data.environment_variables,\n errorMessage: data.error_message,\n exitCode: data.exit_code,\n id: data.id,\n jobDefinitionId: data.job_definition_id,\n localStorageCapacity: data.local_storage_capacity,\n memoryLimit: data.memory_limit,\n region: data.region,\n runDuration: data.run_duration,\n startedAt: marshalling.unmarshalDate(data.started_at),\n state: data.state,\n terminatedAt: marshalling.unmarshalDate(data.terminated_at),\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalListJobDefinitionsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListJobDefinitionsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n jobDefinitions: marshalling.unmarshalArrayOfObject(\n data.job_definitions,\n unmarshalJobDefinition\n ),\n totalCount: data.total_count\n };\n};\nconst unmarshalListJobRunsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListJobRunsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n jobRuns: marshalling.unmarshalArrayOfObject(data.job_runs, unmarshalJobRun),\n totalCount: data.total_count\n };\n};\nconst unmarshalResource = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Resource' failed as data isn't a dictionary.`\n );\n }\n return {\n cpuLimit: data.cpu_limit,\n memoryLimit: data.memory_limit\n };\n};\nconst unmarshalListJobsResourcesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListJobsResourcesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n resources: marshalling.unmarshalArrayOfObject(data.resources, unmarshalResource)\n };\n};\nconst unmarshalStartJobDefinitionResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'StartJobDefinitionResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n jobRuns: marshalling.unmarshalArrayOfObject(data.job_runs, unmarshalJobRun)\n };\n};\nconst marshalCreateJobDefinitionRequestCronScheduleConfig = (request, defaults) => ({\n schedule: request.schedule,\n timezone: request.timezone\n});\nconst marshalCreateJobDefinitionRequest = (request, defaults) => ({\n command: request.command,\n cpu_limit: request.cpuLimit,\n cron_schedule: request.cronSchedule !== void 0 ? marshalCreateJobDefinitionRequestCronScheduleConfig(\n request.cronSchedule\n ) : void 0,\n description: request.description,\n environment_variables: request.environmentVariables !== void 0 ? request.environmentVariables : void 0,\n image_uri: request.imageUri,\n job_timeout: request.jobTimeout,\n local_storage_capacity: request.localStorageCapacity,\n memory_limit: request.memoryLimit,\n name: request.name || randomName(\"job\"),\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalStartJobDefinitionRequest = (request, defaults) => ({\n command: request.command,\n environment_variables: request.environmentVariables,\n replicas: request.replicas\n});\nconst marshalUpdateJobDefinitionRequestCronScheduleConfig = (request, defaults) => ({\n schedule: request.schedule,\n timezone: request.timezone\n});\nconst marshalUpdateJobDefinitionRequest = (request, defaults) => ({\n command: request.command,\n cpu_limit: request.cpuLimit,\n cron_schedule: request.cronSchedule !== void 0 ? marshalUpdateJobDefinitionRequestCronScheduleConfig(\n request.cronSchedule\n ) : void 0,\n description: request.description,\n environment_variables: request.environmentVariables,\n image_uri: request.imageUri,\n job_timeout: request.jobTimeout,\n local_storage_capacity: request.localStorageCapacity,\n memory_limit: request.memoryLimit,\n name: request.name\n});\nexports.marshalCreateJobDefinitionRequest = marshalCreateJobDefinitionRequest;\nexports.marshalStartJobDefinitionRequest = marshalStartJobDefinitionRequest;\nexports.marshalUpdateJobDefinitionRequest = marshalUpdateJobDefinitionRequest;\nexports.unmarshalJobDefinition = unmarshalJobDefinition;\nexports.unmarshalJobRun = unmarshalJobRun;\nexports.unmarshalListJobDefinitionsResponse = unmarshalListJobDefinitionsResponse;\nexports.unmarshalListJobRunsResponse = unmarshalListJobRunsResponse;\nexports.unmarshalListJobsResourcesResponse = unmarshalListJobsResourcesResponse;\nexports.unmarshalStartJobDefinitionResponse = unmarshalStartJobDefinitionResponse;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst CreateJobDefinitionRequest = {\n cpuLimit: {\n greaterThan: 0\n },\n imageUri: {\n pattern: /^((?:(?:(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])(?:\\.(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]))*|\\[(?:[a-fA-F0-9:]+)\\])(?::[0-9]+)?\\/)?[a-z0-9]+(?:(?:[._]|__|[-]+)[a-z0-9]+)*(?:\\/[a-z0-9]+(?:(?:[._]|__|[-]+)[a-z0-9]+)*)*)(?::([\\w][\\w.-]{0,127}))?(?:@([A-Za-z][A-Za-z0-9]*(?:[-_+.][A-Za-z][A-Za-z0-9]*)*[:][[:xdigit:]]{32,}))?$/\n },\n localStorageCapacity: {\n greaterThan: 0\n },\n memoryLimit: {\n greaterThan: 0\n },\n name: {\n pattern: /^[A-Za-z0-9-_]{3,50}$/\n }\n};\nconst CreateJobDefinitionRequestCronScheduleConfig = {\n schedule: {\n maxLength: 255,\n minLength: 1\n },\n timezone: {\n maxLength: 255,\n minLength: 1\n }\n};\nconst CronSchedule = {\n schedule: {\n maxLength: 255,\n minLength: 1\n },\n timezone: {\n maxLength: 255,\n minLength: 1\n }\n};\nconst ListJobDefinitionsRequest = {\n page: {\n greaterThanOrEqual: 1\n },\n pageSize: {\n greaterThanOrEqual: 1,\n lessThanOrEqual: 1e3\n }\n};\nconst ListJobRunsRequest = {\n page: {\n greaterThanOrEqual: 1\n },\n pageSize: {\n greaterThanOrEqual: 1,\n lessThanOrEqual: 1e3\n }\n};\nconst StartJobDefinitionRequest = {\n replicas: {\n greaterThan: 0\n }\n};\nconst UpdateJobDefinitionRequest = {\n cpuLimit: {\n greaterThan: 0\n },\n imageUri: {\n pattern: /^((?:(?:(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])(?:\\.(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]))*|\\[(?:[a-fA-F0-9:]+)\\])(?::[0-9]+)?\\/)?[a-z0-9]+(?:(?:[._]|__|[-]+)[a-z0-9]+)*(?:\\/[a-z0-9]+(?:(?:[._]|__|[-]+)[a-z0-9]+)*)*)(?::([\\w][\\w.-]{0,127}))?(?:@([A-Za-z][A-Za-z0-9]*(?:[-_+.][A-Za-z][A-Za-z0-9]*)*[:][[:xdigit:]]{32,}))?$/\n },\n localStorageCapacity: {\n greaterThan: 0\n },\n memoryLimit: {\n greaterThan: 0\n },\n name: {\n pattern: /^[A-Za-z0-9-_]{3,50}$/\n }\n};\nconst UpdateJobDefinitionRequestCronScheduleConfig = {\n schedule: {\n maxLength: 255,\n minLength: 1\n },\n timezone: {\n maxLength: 255,\n minLength: 1\n }\n};\nexports.CreateJobDefinitionRequest = CreateJobDefinitionRequest;\nexports.CreateJobDefinitionRequestCronScheduleConfig = CreateJobDefinitionRequestCronScheduleConfig;\nexports.CronSchedule = CronSchedule;\nexports.ListJobDefinitionsRequest = ListJobDefinitionsRequest;\nexports.ListJobRunsRequest = ListJobRunsRequest;\nexports.StartJobDefinitionRequest = StartJobDefinitionRequest;\nexports.UpdateJobDefinitionRequest = UpdateJobDefinitionRequest;\nexports.UpdateJobDefinitionRequestCronScheduleConfig = UpdateJobDefinitionRequestCronScheduleConfig;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst index = require(\"./v1/index.cjs\");\nexports.v1 = index;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst intervalRetrier = require(\"../../../internal/async/interval-retrier.cjs\");\nconst api = require(\"../../../scw/api.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst resourcePaginator = require(\"../../../scw/fetch/resource-paginator.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nconst marshalling_gen = require(\"./marshalling.gen.cjs\");\nconst jsonContentHeaders = {\n \"Content-Type\": \"application/json; charset=utf-8\"\n};\nclass API extends api.API {\n /** Lists the available regions of the API. */\n static LOCALITIES = [\"fr-par\", \"nl-ams\", \"pl-waw\"];\n pageOfListClusters = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/k8s/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/clusters`,\n urlParams: marshalling.urlParams(\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"private_network_id\", request.privateNetworkId],\n [\"project_id\", request.projectId],\n [\"status\", request.status],\n [\"type\", request.type]\n )\n },\n marshalling_gen.unmarshalListClustersResponse\n );\n /**\n * List Clusters. List all existing Kubernetes clusters in a specific region.\n *\n * @param request - The request {@link ListClustersRequest}\n * @returns A Promise of ListClustersResponse\n */\n listClusters = (request = {}) => resourcePaginator.enrichForPagination(\"clusters\", this.pageOfListClusters, request);\n /**\n * Create a new Cluster. Create a new Kubernetes cluster in a Scaleway region.\n *\n * @param request - The request {@link CreateClusterRequest}\n * @returns A Promise of Cluster\n */\n createCluster = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateClusterRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/k8s/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/clusters`\n },\n marshalling_gen.unmarshalCluster\n );\n /**\n * Get a Cluster. Retrieve information about a specific Kubernetes cluster.\n *\n * @param request - The request {@link GetClusterRequest}\n * @returns A Promise of Cluster\n */\n getCluster = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/k8s/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/clusters/${marshalling.validatePathParam(\"clusterId\", request.clusterId)}`\n },\n marshalling_gen.unmarshalCluster\n );\n /**\n * Waits for {@link Cluster} to be in a final state.\n *\n * @param request - The request {@link GetClusterRequest}\n * @param options - The waiting options\n * @returns A Promise of Cluster\n */\n waitForCluster = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(!content_gen.CLUSTER_TRANSIENT_STATUSES.includes(res.status))),\n this.getCluster,\n request,\n options\n );\n /**\n * Update a Cluster. Update information on a specific Kubernetes cluster. You\n * can update details such as its name, description, tags and configuration.\n * To upgrade a cluster, you will need to use the dedicated endpoint.\n *\n * @param request - The request {@link UpdateClusterRequest}\n * @returns A Promise of Cluster\n */\n updateCluster = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateClusterRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/k8s/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/clusters/${marshalling.validatePathParam(\"clusterId\", request.clusterId)}`\n },\n marshalling_gen.unmarshalCluster\n );\n /**\n * Delete a Cluster. Delete a specific Kubernetes cluster and all its\n * associated pools and nodes. Note that this method will not delete any Load\n * Balancer or Block Volume that are associated with the cluster.\n *\n * @param request - The request {@link DeleteClusterRequest}\n * @returns A Promise of Cluster\n */\n deleteCluster = (request) => this.client.fetch(\n {\n method: \"DELETE\",\n path: `/k8s/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/clusters/${marshalling.validatePathParam(\"clusterId\", request.clusterId)}`,\n urlParams: marshalling.urlParams([\n \"with_additional_resources\",\n request.withAdditionalResources\n ])\n },\n marshalling_gen.unmarshalCluster\n );\n /**\n * Upgrade a Cluster. Upgrade a specific Kubernetes cluster and possibly its\n * associated pools to a specific and supported Kubernetes version.\n *\n * @param request - The request {@link UpgradeClusterRequest}\n * @returns A Promise of Cluster\n */\n upgradeCluster = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpgradeClusterRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/k8s/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/clusters/${marshalling.validatePathParam(\"clusterId\", request.clusterId)}/upgrade`\n },\n marshalling_gen.unmarshalCluster\n );\n /**\n * Change the Cluster type. Change the type of a specific Kubernetes cluster.\n * To see the possible values you can enter for the `type` field, [list\n * available cluster\n * types](#path-clusters-list-available-cluster-types-for-a-cluster).\n *\n * @param request - The request {@link SetClusterTypeRequest}\n * @returns A Promise of Cluster\n */\n setClusterType = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalSetClusterTypeRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/k8s/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/clusters/${marshalling.validatePathParam(\"clusterId\", request.clusterId)}/set-type`\n },\n marshalling_gen.unmarshalCluster\n );\n /**\n * List available versions for a Cluster. List the versions that a specific\n * Kubernetes cluster is allowed to upgrade to. Results will include every\n * patch version greater than the current patch, as well as one minor version\n * ahead of the current version. Any upgrade skipping a minor version will not\n * work.\n *\n * @param request - The request {@link ListClusterAvailableVersionsRequest}\n * @returns A Promise of ListClusterAvailableVersionsResponse\n */\n listClusterAvailableVersions = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/k8s/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/clusters/${marshalling.validatePathParam(\"clusterId\", request.clusterId)}/available-versions`\n },\n marshalling_gen.unmarshalListClusterAvailableVersionsResponse\n );\n /**\n * List available cluster types for a cluster. List the cluster types that a\n * specific Kubernetes cluster is allowed to switch to.\n *\n * @param request - The request {@link ListClusterAvailableTypesRequest}\n * @returns A Promise of ListClusterAvailableTypesResponse\n */\n listClusterAvailableTypes = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/k8s/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/clusters/${marshalling.validatePathParam(\"clusterId\", request.clusterId)}/available-types`\n },\n marshalling_gen.unmarshalListClusterAvailableTypesResponse\n );\n _getClusterKubeConfig = (request) => this.client.fetch({\n method: \"GET\",\n path: `/k8s/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/clusters/${marshalling.validatePathParam(\"clusterId\", request.clusterId)}/kubeconfig`,\n urlParams: marshalling.urlParams([\"dl\", 1], [\"redacted\", request.redacted]),\n responseType: \"blob\"\n });\n /**\n * Reset the admin token of a Cluster. Reset the admin token for a specific\n * Kubernetes cluster. This will revoke the old admin token (which will not be\n * usable afterwards) and create a new one. Note that you will need to\n * download kubeconfig again to keep interacting with the cluster.\n *\n * @param request - The request {@link ResetClusterAdminTokenRequest}\n */\n resetClusterAdminToken = (request) => this.client.fetch({\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/k8s/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/clusters/${marshalling.validatePathParam(\"clusterId\", request.clusterId)}/reset-admin-token`\n });\n /**\n * Migrate a cluster to Routed IPs. Migrate the nodes of an existing cluster\n * to Routed IPs and enable Routed IPs for all future nodes.\n *\n * @param request - The request {@link MigrateClusterToRoutedIPsRequest}\n * @returns A Promise of Cluster\n */\n migrateClusterToRoutedIPs = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/k8s/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/clusters/${marshalling.validatePathParam(\"clusterId\", request.clusterId)}/migrate-to-routed-ips`\n },\n marshalling_gen.unmarshalCluster\n );\n /**\n * Migrate a cluster to SBS CSI. Enable the latest CSI compatible with\n * Scaleway Block Storage (SBS) and migrate all existing\n * PersistentVolumes/VolumeSnapshotContents to SBS.\n *\n * @param request - The request {@link MigrateClusterToSBSCSIRequest}\n * @returns A Promise of Cluster\n */\n migrateClusterToSBSCSI = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/k8s/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/clusters/${marshalling.validatePathParam(\"clusterId\", request.clusterId)}/migrate-to-sbs-csi`\n },\n marshalling_gen.unmarshalCluster\n );\n pageOfListPools = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/k8s/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/clusters/${marshalling.validatePathParam(\"clusterId\", request.clusterId)}/pools`,\n urlParams: marshalling.urlParams(\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"status\", request.status]\n )\n },\n marshalling_gen.unmarshalListPoolsResponse\n );\n /**\n * List Pools in a Cluster. List all the existing pools for a specific\n * Kubernetes cluster.\n *\n * @param request - The request {@link ListPoolsRequest}\n * @returns A Promise of ListPoolsResponse\n */\n listPools = (request) => resourcePaginator.enrichForPagination(\"pools\", this.pageOfListPools, request);\n /**\n * Create a new Pool in a Cluster. Create a new pool in a specific Kubernetes\n * cluster.\n *\n * @param request - The request {@link CreatePoolRequest}\n * @returns A Promise of Pool\n */\n createPool = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreatePoolRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/k8s/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/clusters/${marshalling.validatePathParam(\"clusterId\", request.clusterId)}/pools`\n },\n marshalling_gen.unmarshalPool\n );\n /**\n * Get a Pool in a Cluster. Retrieve details about a specific pool in a\n * Kubernetes cluster.\n *\n * @param request - The request {@link GetPoolRequest}\n * @returns A Promise of Pool\n */\n getPool = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/k8s/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/pools/${marshalling.validatePathParam(\"poolId\", request.poolId)}`\n },\n marshalling_gen.unmarshalPool\n );\n /**\n * Waits for {@link Pool} to be in a final state.\n *\n * @param request - The request {@link GetPoolRequest}\n * @param options - The waiting options\n * @returns A Promise of Pool\n */\n waitForPool = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(!content_gen.POOL_TRANSIENT_STATUSES.includes(res.status))),\n this.getPool,\n request,\n options\n );\n /**\n * Upgrade a Pool in a Cluster. Upgrade the Kubernetes version of a specific\n * pool. Note that it only works if the targeted version matches the cluster's\n * version.\n *\n * @param request - The request {@link UpgradePoolRequest}\n * @returns A Promise of Pool\n */\n upgradePool = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpgradePoolRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/k8s/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/pools/${marshalling.validatePathParam(\"poolId\", request.poolId)}/upgrade`\n },\n marshalling_gen.unmarshalPool\n );\n /**\n * Update a Pool in a Cluster. Update the attributes of a specific pool, such\n * as its desired size, autoscaling settings, and tags.\n *\n * @param request - The request {@link UpdatePoolRequest}\n * @returns A Promise of Pool\n */\n updatePool = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdatePoolRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/k8s/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/pools/${marshalling.validatePathParam(\"poolId\", request.poolId)}`\n },\n marshalling_gen.unmarshalPool\n );\n /**\n * Delete a Pool in a Cluster. Delete a specific pool from a cluster. Note\n * that all the pool's nodes will also be deleted.\n *\n * @param request - The request {@link DeletePoolRequest}\n * @returns A Promise of Pool\n */\n deletePool = (request) => this.client.fetch(\n {\n method: \"DELETE\",\n path: `/k8s/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/pools/${marshalling.validatePathParam(\"poolId\", request.poolId)}`\n },\n marshalling_gen.unmarshalPool\n );\n /**\n * Fetch node metadata. Rerieve metadata to instantiate a Kapsule/Kosmos node.\n * This method is not intended to be called by end users but rather\n * programmatically by the node-installer.\n *\n * @param request - The request {@link GetNodeMetadataRequest}\n * @returns A Promise of NodeMetadata\n */\n getNodeMetadata = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/k8s/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/nodes/metadata`\n },\n marshalling_gen.unmarshalNodeMetadata\n );\n /**\n * Authenticate Kosmos external node. Creates a newer Kosmos node and returns\n * its token. This method is not intended to be called by end users but rather\n * programmatically by the node-installer.\n *\n * @param request - The request {@link AuthExternalNodeRequest}\n * @returns A Promise of ExternalNodeAuth\n */\n authExternalNode = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/k8s/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/pools/${marshalling.validatePathParam(\"poolId\", request.poolId)}/external-nodes/auth`\n },\n marshalling_gen.unmarshalExternalNodeAuth\n );\n /**\n * Create a Kosmos node. Retrieve metadata for a Kosmos node. This method is\n * not intended to be called by end users but rather programmatically by the\n * kapsule-node-agent.\n *\n * @param request - The request {@link CreateExternalNodeRequest}\n * @returns A Promise of ExternalNode\n */\n createExternalNode = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/k8s/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/pools/${marshalling.validatePathParam(\"poolId\", request.poolId)}/external-nodes`\n },\n marshalling_gen.unmarshalExternalNode\n );\n pageOfListNodes = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/k8s/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/clusters/${marshalling.validatePathParam(\"clusterId\", request.clusterId)}/nodes`,\n urlParams: marshalling.urlParams(\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"pool_id\", request.poolId],\n [\"status\", request.status]\n )\n },\n marshalling_gen.unmarshalListNodesResponse\n );\n /**\n * List Nodes in a Cluster. List all the existing nodes for a specific\n * Kubernetes cluster.\n *\n * @param request - The request {@link ListNodesRequest}\n * @returns A Promise of ListNodesResponse\n */\n listNodes = (request) => resourcePaginator.enrichForPagination(\"nodes\", this.pageOfListNodes, request);\n /**\n * Get a Node in a Cluster. Retrieve details about a specific Kubernetes Node.\n *\n * @param request - The request {@link GetNodeRequest}\n * @returns A Promise of Node\n */\n getNode = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/k8s/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/nodes/${marshalling.validatePathParam(\"nodeId\", request.nodeId)}`\n },\n marshalling_gen.unmarshalNode\n );\n /**\n * Waits for {@link Node} to be in a final state.\n *\n * @param request - The request {@link GetNodeRequest}\n * @param options - The waiting options\n * @returns A Promise of Node\n */\n waitForNode = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(!content_gen.NODE_TRANSIENT_STATUSES.includes(res.status))),\n this.getNode,\n request,\n options\n );\n /**\n * Replace a Node in a Cluster. Replace a specific Node. The node will first\n * be cordoned (scheduling will be disabled on it). The existing pods on the\n * node will then be drained and rescheduled onto another schedulable node.\n * Note that when there is not enough space to reschedule all the pods (such\n * as in a one-node cluster), disruption of your applications can be\n * expected.\n *\n * @deprecated\n * @param request - The request {@link ReplaceNodeRequest}\n * @returns A Promise of Node\n */\n replaceNode = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/k8s/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/nodes/${marshalling.validatePathParam(\"nodeId\", request.nodeId)}/replace`\n },\n marshalling_gen.unmarshalNode\n );\n /**\n * Reboot a Node in a Cluster. Reboot a specific Node. The node will first be\n * cordoned (scheduling will be disabled on it). The existing pods on the node\n * will then be drained and rescheduled onto another schedulable node. Note\n * that when there is not enough space to reschedule all the pods (such as in\n * a one-node cluster), disruption of your applications can be expected.\n *\n * @param request - The request {@link RebootNodeRequest}\n * @returns A Promise of Node\n */\n rebootNode = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/k8s/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/nodes/${marshalling.validatePathParam(\"nodeId\", request.nodeId)}/reboot`\n },\n marshalling_gen.unmarshalNode\n );\n /**\n * Delete a Node in a Cluster. Delete a specific Node. Note that when there is\n * not enough space to reschedule all the pods (such as in a one-node\n * cluster), disruption of your applications can be expected.\n *\n * @param request - The request {@link DeleteNodeRequest}\n * @returns A Promise of Node\n */\n deleteNode = (request) => this.client.fetch(\n {\n method: \"DELETE\",\n path: `/k8s/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/nodes/${marshalling.validatePathParam(\"nodeId\", request.nodeId)}`,\n urlParams: marshalling.urlParams(\n [\"replace\", request.replace],\n [\"skip_drain\", request.skipDrain]\n )\n },\n marshalling_gen.unmarshalNode\n );\n /**\n * List all available Versions. List all available versions for the creation\n * of a new Kubernetes cluster.\n *\n * @param request - The request {@link ListVersionsRequest}\n * @returns A Promise of ListVersionsResponse\n */\n listVersions = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/k8s/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/versions`\n },\n marshalling_gen.unmarshalListVersionsResponse\n );\n /**\n * Get a Version. Retrieve a specific Kubernetes version and its details.\n *\n * @param request - The request {@link GetVersionRequest}\n * @returns A Promise of Version\n */\n getVersion = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/k8s/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/versions/${marshalling.validatePathParam(\"versionName\", request.versionName)}`\n },\n marshalling_gen.unmarshalVersion\n );\n pageOfListClusterTypes = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/k8s/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/cluster-types`,\n urlParams: marshalling.urlParams(\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListClusterTypesResponse\n );\n /**\n * List cluster types. List available cluster types and their technical\n * details.\n *\n * @param request - The request {@link ListClusterTypesRequest}\n * @returns A Promise of ListClusterTypesResponse\n */\n listClusterTypes = (request = {}) => resourcePaginator.enrichForPagination(\"clusterTypes\", this.pageOfListClusterTypes, request);\n}\nexports.API = API;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api_gen = require(\"./api.gen.cjs\");\nclass K8SUtilsAPI extends api_gen.API {\n /**\n * Get configuration of a kube cluster.\n *\n * @param request - The request {@link GetClusterKubeConfigRequest}\n * @returns A Promise of Blob\n */\n getClusterKubeConfig = (request) => this._getClusterKubeConfig(request);\n}\nexports.K8SUtilsAPI = K8SUtilsAPI;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst CLUSTER_TRANSIENT_STATUSES = [\n \"creating\",\n \"deleting\",\n \"updating\"\n];\nconst NODE_TRANSIENT_STATUSES = [\n \"creating\",\n \"deleting\",\n \"rebooting\",\n \"upgrading\",\n \"starting\",\n \"registering\"\n];\nconst POOL_TRANSIENT_STATUSES = [\n \"deleting\",\n \"scaling\",\n \"upgrading\"\n];\nexports.CLUSTER_TRANSIENT_STATUSES = CLUSTER_TRANSIENT_STATUSES;\nexports.NODE_TRANSIENT_STATUSES = NODE_TRANSIENT_STATUSES;\nexports.POOL_TRANSIENT_STATUSES = POOL_TRANSIENT_STATUSES;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api_utils = require(\"./api.utils.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nconst validationRules_gen = require(\"./validation-rules.gen.cjs\");\nexports.API = api_utils.K8SUtilsAPI;\nexports.CLUSTER_TRANSIENT_STATUSES = content_gen.CLUSTER_TRANSIENT_STATUSES;\nexports.NODE_TRANSIENT_STATUSES = content_gen.NODE_TRANSIENT_STATUSES;\nexports.POOL_TRANSIENT_STATUSES = content_gen.POOL_TRANSIENT_STATUSES;\nexports.ValidationRules = validationRules_gen;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst randomName = require(\"@scaleway/random-name\");\nconst json = require(\"../../../helpers/json.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst unmarshalPoolUpgradePolicy = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'PoolUpgradePolicy' failed as data isn't a dictionary.`\n );\n }\n return {\n maxSurge: data.max_surge,\n maxUnavailable: data.max_unavailable\n };\n};\nconst unmarshalPool = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Pool' failed as data isn't a dictionary.`\n );\n }\n return {\n autohealing: data.autohealing,\n autoscaling: data.autoscaling,\n clusterId: data.cluster_id,\n containerRuntime: data.container_runtime,\n createdAt: marshalling.unmarshalDate(data.created_at),\n id: data.id,\n kubeletArgs: data.kubelet_args,\n maxSize: data.max_size,\n minSize: data.min_size,\n name: data.name,\n nodeType: data.node_type,\n placementGroupId: data.placement_group_id,\n publicIpDisabled: data.public_ip_disabled,\n region: data.region,\n rootVolumeSize: data.root_volume_size,\n rootVolumeType: data.root_volume_type,\n size: data.size,\n status: data.status,\n tags: data.tags,\n updatedAt: marshalling.unmarshalDate(data.updated_at),\n upgradePolicy: data.upgrade_policy ? unmarshalPoolUpgradePolicy(data.upgrade_policy) : void 0,\n version: data.version,\n zone: data.zone\n };\n};\nconst unmarshalVersion = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Version' failed as data isn't a dictionary.`\n );\n }\n return {\n availableAdmissionPlugins: data.available_admission_plugins,\n availableCnis: data.available_cnis,\n availableContainerRuntimes: data.available_container_runtimes,\n availableFeatureGates: data.available_feature_gates,\n availableKubeletArgs: data.available_kubelet_args,\n label: data.label,\n name: data.name,\n region: data.region\n };\n};\nconst unmarshalMaintenanceWindow = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'MaintenanceWindow' failed as data isn't a dictionary.`\n );\n }\n return {\n day: data.day,\n startHour: data.start_hour\n };\n};\nconst unmarshalClusterAutoUpgrade = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ClusterAutoUpgrade' failed as data isn't a dictionary.`\n );\n }\n return {\n enabled: data.enabled,\n maintenanceWindow: data.maintenance_window ? unmarshalMaintenanceWindow(data.maintenance_window) : void 0\n };\n};\nconst unmarshalClusterAutoscalerConfig = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ClusterAutoscalerConfig' failed as data isn't a dictionary.`\n );\n }\n return {\n balanceSimilarNodeGroups: data.balance_similar_node_groups,\n estimator: data.estimator,\n expander: data.expander,\n expendablePodsPriorityCutoff: data.expendable_pods_priority_cutoff,\n ignoreDaemonsetsUtilization: data.ignore_daemonsets_utilization,\n maxGracefulTerminationSec: data.max_graceful_termination_sec,\n scaleDownDelayAfterAdd: data.scale_down_delay_after_add,\n scaleDownDisabled: data.scale_down_disabled,\n scaleDownUnneededTime: data.scale_down_unneeded_time,\n scaleDownUtilizationThreshold: data.scale_down_utilization_threshold\n };\n};\nconst unmarshalClusterOpenIDConnectConfig = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ClusterOpenIDConnectConfig' failed as data isn't a dictionary.`\n );\n }\n return {\n clientId: data.client_id,\n groupsClaim: data.groups_claim,\n groupsPrefix: data.groups_prefix,\n issuerUrl: data.issuer_url,\n requiredClaim: data.required_claim,\n usernameClaim: data.username_claim,\n usernamePrefix: data.username_prefix\n };\n};\nconst unmarshalCluster = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Cluster' failed as data isn't a dictionary.`\n );\n }\n return {\n admissionPlugins: data.admission_plugins,\n apiserverCertSans: data.apiserver_cert_sans,\n autoUpgrade: data.auto_upgrade ? unmarshalClusterAutoUpgrade(data.auto_upgrade) : void 0,\n autoscalerConfig: data.autoscaler_config ? unmarshalClusterAutoscalerConfig(data.autoscaler_config) : void 0,\n clusterUrl: data.cluster_url,\n cni: data.cni,\n commitmentEndsAt: marshalling.unmarshalDate(data.commitment_ends_at),\n createdAt: marshalling.unmarshalDate(data.created_at),\n description: data.description,\n dnsWildcard: data.dns_wildcard,\n featureGates: data.feature_gates,\n fullVpcIntegratonEnabled: data.full_vpc_integraton_enabled,\n id: data.id,\n name: data.name,\n openIdConnectConfig: data.open_id_connect_config ? unmarshalClusterOpenIDConnectConfig(data.open_id_connect_config) : void 0,\n organizationId: data.organization_id,\n privateNetworkId: data.private_network_id,\n projectId: data.project_id,\n region: data.region,\n routedIpEnabled: data.routed_ip_enabled,\n sbsCsiEnabled: data.sbs_csi_enabled,\n status: data.status,\n tags: data.tags,\n type: data.type,\n updatedAt: marshalling.unmarshalDate(data.updated_at),\n upgradeAvailable: data.upgrade_available,\n version: data.version\n };\n};\nconst unmarshalNode = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Node' failed as data isn't a dictionary.`\n );\n }\n return {\n clusterId: data.cluster_id,\n conditions: data.conditions ? data.conditions : void 0,\n createdAt: marshalling.unmarshalDate(data.created_at),\n errorMessage: data.error_message,\n id: data.id,\n name: data.name,\n poolId: data.pool_id,\n providerId: data.provider_id,\n publicIpV4: data.public_ip_v4,\n publicIpV6: data.public_ip_v6,\n region: data.region,\n status: data.status,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalExternalNodeCoreV1Taint = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ExternalNodeCoreV1Taint' failed as data isn't a dictionary.`\n );\n }\n return {\n effect: data.effect,\n key: data.key,\n value: data.value\n };\n};\nconst unmarshalExternalNode = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ExternalNode' failed as data isn't a dictionary.`\n );\n }\n return {\n clusterCa: data.cluster_ca,\n clusterUrl: data.cluster_url,\n cniPluginsVersion: data.cni_plugins_version,\n containerdVersion: data.containerd_version,\n externalIp: data.external_ip,\n id: data.id,\n kubeToken: data.kube_token,\n kubeletConfig: data.kubelet_config,\n name: data.name,\n nodeLabels: data.node_labels,\n nodeTaints: marshalling.unmarshalArrayOfObject(\n data.node_taints,\n unmarshalExternalNodeCoreV1Taint\n ),\n poolVersion: data.pool_version,\n runcVersion: data.runc_version\n };\n};\nconst unmarshalExternalNodeAuth = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ExternalNodeAuth' failed as data isn't a dictionary.`\n );\n }\n return {\n apiUrl: data.api_url,\n nodeToken: data.node_token\n };\n};\nconst unmarshalClusterType = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ClusterType' failed as data isn't a dictionary.`\n );\n }\n return {\n auditLogsSupported: data.audit_logs_supported,\n availability: data.availability,\n commitmentDelay: data.commitment_delay,\n dedicated: data.dedicated,\n maxEtcdSize: data.max_etcd_size,\n maxNodes: data.max_nodes,\n memory: data.memory,\n name: data.name,\n resiliency: data.resiliency,\n sla: data.sla\n };\n};\nconst unmarshalListClusterAvailableTypesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListClusterAvailableTypesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n clusterTypes: marshalling.unmarshalArrayOfObject(\n data.cluster_types,\n unmarshalClusterType\n ),\n totalCount: data.total_count\n };\n};\nconst unmarshalListClusterAvailableVersionsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListClusterAvailableVersionsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n versions: marshalling.unmarshalArrayOfObject(data.versions, unmarshalVersion)\n };\n};\nconst unmarshalListClusterTypesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListClusterTypesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n clusterTypes: marshalling.unmarshalArrayOfObject(\n data.cluster_types,\n unmarshalClusterType\n ),\n totalCount: data.total_count\n };\n};\nconst unmarshalListClustersResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListClustersResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n clusters: marshalling.unmarshalArrayOfObject(data.clusters, unmarshalCluster),\n totalCount: data.total_count\n };\n};\nconst unmarshalListNodesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListNodesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n nodes: marshalling.unmarshalArrayOfObject(data.nodes, unmarshalNode),\n totalCount: data.total_count\n };\n};\nconst unmarshalListPoolsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListPoolsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n pools: marshalling.unmarshalArrayOfObject(data.pools, unmarshalPool),\n totalCount: data.total_count\n };\n};\nconst unmarshalListVersionsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListVersionsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n versions: marshalling.unmarshalArrayOfObject(data.versions, unmarshalVersion)\n };\n};\nconst unmarshalNodeMetadataCoreV1Taint = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'NodeMetadataCoreV1Taint' failed as data isn't a dictionary.`\n );\n }\n return {\n effect: data.effect,\n key: data.key,\n value: data.value\n };\n};\nconst unmarshalNodeMetadata = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'NodeMetadata' failed as data isn't a dictionary.`\n );\n }\n return {\n clusterCa: data.cluster_ca,\n clusterUrl: data.cluster_url,\n credentialProviderConfig: data.credential_provider_config,\n externalIp: data.external_ip,\n fullIsolation: data.full_isolation,\n hasGpu: data.has_gpu,\n id: data.id,\n kapsuleIfaceMac: data.kapsule_iface_mac,\n kubeletConfig: data.kubelet_config,\n name: data.name,\n nodeLabels: data.node_labels,\n nodeTaints: marshalling.unmarshalArrayOfObject(\n data.node_taints,\n unmarshalNodeMetadataCoreV1Taint\n ),\n poolVersion: data.pool_version,\n privateNetworkMode: data.private_network_mode\n };\n};\nconst marshalMaintenanceWindow = (request, defaults) => ({\n day: request.day,\n start_hour: request.startHour\n});\nconst marshalCreateClusterRequestPoolConfigUpgradePolicy = (request, defaults) => ({\n max_surge: request.maxSurge,\n max_unavailable: request.maxUnavailable\n});\nconst marshalCreateClusterRequestAutoUpgrade = (request, defaults) => ({\n enable: request.enable,\n maintenance_window: request.maintenanceWindow !== void 0 ? marshalMaintenanceWindow(request.maintenanceWindow) : void 0\n});\nconst marshalCreateClusterRequestAutoscalerConfig = (request, defaults) => ({\n balance_similar_node_groups: request.balanceSimilarNodeGroups,\n estimator: request.estimator,\n expander: request.expander,\n expendable_pods_priority_cutoff: request.expendablePodsPriorityCutoff,\n ignore_daemonsets_utilization: request.ignoreDaemonsetsUtilization,\n max_graceful_termination_sec: request.maxGracefulTerminationSec,\n scale_down_delay_after_add: request.scaleDownDelayAfterAdd,\n scale_down_disabled: request.scaleDownDisabled,\n scale_down_unneeded_time: request.scaleDownUnneededTime,\n scale_down_utilization_threshold: request.scaleDownUtilizationThreshold\n});\nconst marshalCreateClusterRequestOpenIDConnectConfig = (request, defaults) => ({\n client_id: request.clientId,\n groups_claim: request.groupsClaim,\n groups_prefix: request.groupsPrefix,\n issuer_url: request.issuerUrl,\n required_claim: request.requiredClaim,\n username_claim: request.usernameClaim,\n username_prefix: request.usernamePrefix\n});\nconst marshalCreateClusterRequestPoolConfig = (request, defaults) => ({\n autohealing: request.autohealing,\n autoscaling: request.autoscaling,\n container_runtime: request.containerRuntime,\n kubelet_args: request.kubeletArgs,\n max_size: request.maxSize,\n min_size: request.minSize,\n name: request.name,\n node_type: request.nodeType,\n placement_group_id: request.placementGroupId,\n public_ip_disabled: request.publicIpDisabled,\n root_volume_size: request.rootVolumeSize,\n root_volume_type: request.rootVolumeType,\n size: request.size,\n tags: request.tags,\n upgrade_policy: request.upgradePolicy !== void 0 ? marshalCreateClusterRequestPoolConfigUpgradePolicy(\n request.upgradePolicy\n ) : void 0,\n zone: request.zone\n});\nconst marshalCreateClusterRequest = (request, defaults) => ({\n admission_plugins: request.admissionPlugins,\n apiserver_cert_sans: request.apiserverCertSans,\n auto_upgrade: request.autoUpgrade !== void 0 ? marshalCreateClusterRequestAutoUpgrade(request.autoUpgrade) : void 0,\n autoscaler_config: request.autoscalerConfig !== void 0 ? marshalCreateClusterRequestAutoscalerConfig(\n request.autoscalerConfig\n ) : void 0,\n cni: request.cni,\n description: request.description,\n feature_gates: request.featureGates,\n name: request.name || randomName(\"k8s\"),\n open_id_connect_config: request.openIdConnectConfig !== void 0 ? marshalCreateClusterRequestOpenIDConnectConfig(\n request.openIdConnectConfig\n ) : void 0,\n pools: request.pools !== void 0 ? request.pools.map(\n (elt) => marshalCreateClusterRequestPoolConfig(elt)\n ) : void 0,\n private_network_id: request.privateNetworkId,\n tags: request.tags,\n type: request.type,\n version: request.version,\n ...marshalling.resolveOneOf([\n {\n default: defaults.defaultProjectId,\n param: \"project_id\",\n value: request.projectId\n },\n {\n default: defaults.defaultOrganizationId,\n param: \"organization_id\",\n value: request.organizationId\n }\n ])\n});\nconst marshalCreatePoolRequestUpgradePolicy = (request, defaults) => ({\n max_surge: request.maxSurge,\n max_unavailable: request.maxUnavailable\n});\nconst marshalCreatePoolRequest = (request, defaults) => ({\n autohealing: request.autohealing,\n autoscaling: request.autoscaling,\n container_runtime: request.containerRuntime,\n kubelet_args: request.kubeletArgs !== void 0 ? request.kubeletArgs : void 0,\n max_size: request.maxSize,\n min_size: request.minSize,\n name: request.name || randomName(\"pool\"),\n node_type: request.nodeType,\n placement_group_id: request.placementGroupId,\n public_ip_disabled: request.publicIpDisabled,\n root_volume_size: request.rootVolumeSize,\n root_volume_type: request.rootVolumeType,\n size: request.size,\n tags: request.tags,\n upgrade_policy: request.upgradePolicy !== void 0 ? marshalCreatePoolRequestUpgradePolicy(request.upgradePolicy) : void 0,\n zone: request.zone ?? defaults.defaultZone\n});\nconst marshalSetClusterTypeRequest = (request, defaults) => ({\n type: request.type\n});\nconst marshalUpdateClusterRequestAutoUpgrade = (request, defaults) => ({\n enable: request.enable,\n maintenance_window: request.maintenanceWindow !== void 0 ? marshalMaintenanceWindow(request.maintenanceWindow) : void 0\n});\nconst marshalUpdateClusterRequestAutoscalerConfig = (request, defaults) => ({\n balance_similar_node_groups: request.balanceSimilarNodeGroups,\n estimator: request.estimator,\n expander: request.expander,\n expendable_pods_priority_cutoff: request.expendablePodsPriorityCutoff,\n ignore_daemonsets_utilization: request.ignoreDaemonsetsUtilization,\n max_graceful_termination_sec: request.maxGracefulTerminationSec,\n scale_down_delay_after_add: request.scaleDownDelayAfterAdd,\n scale_down_disabled: request.scaleDownDisabled,\n scale_down_unneeded_time: request.scaleDownUnneededTime,\n scale_down_utilization_threshold: request.scaleDownUtilizationThreshold\n});\nconst marshalUpdateClusterRequestOpenIDConnectConfig = (request, defaults) => ({\n client_id: request.clientId,\n groups_claim: request.groupsClaim,\n groups_prefix: request.groupsPrefix,\n issuer_url: request.issuerUrl,\n required_claim: request.requiredClaim,\n username_claim: request.usernameClaim,\n username_prefix: request.usernamePrefix\n});\nconst marshalUpdateClusterRequest = (request, defaults) => ({\n admission_plugins: request.admissionPlugins,\n apiserver_cert_sans: request.apiserverCertSans,\n auto_upgrade: request.autoUpgrade !== void 0 ? marshalUpdateClusterRequestAutoUpgrade(request.autoUpgrade) : void 0,\n autoscaler_config: request.autoscalerConfig !== void 0 ? marshalUpdateClusterRequestAutoscalerConfig(\n request.autoscalerConfig\n ) : void 0,\n description: request.description,\n feature_gates: request.featureGates,\n name: request.name,\n open_id_connect_config: request.openIdConnectConfig !== void 0 ? marshalUpdateClusterRequestOpenIDConnectConfig(\n request.openIdConnectConfig\n ) : void 0,\n tags: request.tags\n});\nconst marshalUpdatePoolRequestUpgradePolicy = (request, defaults) => ({\n max_surge: request.maxSurge,\n max_unavailable: request.maxUnavailable\n});\nconst marshalUpdatePoolRequest = (request, defaults) => ({\n autohealing: request.autohealing,\n autoscaling: request.autoscaling,\n kubelet_args: request.kubeletArgs,\n max_size: request.maxSize,\n min_size: request.minSize,\n size: request.size,\n tags: request.tags,\n upgrade_policy: request.upgradePolicy !== void 0 ? marshalUpdatePoolRequestUpgradePolicy(request.upgradePolicy) : void 0\n});\nconst marshalUpgradeClusterRequest = (request, defaults) => ({\n upgrade_pools: request.upgradePools,\n version: request.version\n});\nconst marshalUpgradePoolRequest = (request, defaults) => ({\n version: request.version\n});\nexports.marshalCreateClusterRequest = marshalCreateClusterRequest;\nexports.marshalCreatePoolRequest = marshalCreatePoolRequest;\nexports.marshalSetClusterTypeRequest = marshalSetClusterTypeRequest;\nexports.marshalUpdateClusterRequest = marshalUpdateClusterRequest;\nexports.marshalUpdatePoolRequest = marshalUpdatePoolRequest;\nexports.marshalUpgradeClusterRequest = marshalUpgradeClusterRequest;\nexports.marshalUpgradePoolRequest = marshalUpgradePoolRequest;\nexports.unmarshalCluster = unmarshalCluster;\nexports.unmarshalExternalNode = unmarshalExternalNode;\nexports.unmarshalExternalNodeAuth = unmarshalExternalNodeAuth;\nexports.unmarshalListClusterAvailableTypesResponse = unmarshalListClusterAvailableTypesResponse;\nexports.unmarshalListClusterAvailableVersionsResponse = unmarshalListClusterAvailableVersionsResponse;\nexports.unmarshalListClusterTypesResponse = unmarshalListClusterTypesResponse;\nexports.unmarshalListClustersResponse = unmarshalListClustersResponse;\nexports.unmarshalListNodesResponse = unmarshalListNodesResponse;\nexports.unmarshalListPoolsResponse = unmarshalListPoolsResponse;\nexports.unmarshalListVersionsResponse = unmarshalListVersionsResponse;\nexports.unmarshalNode = unmarshalNode;\nexports.unmarshalNodeMetadata = unmarshalNodeMetadata;\nexports.unmarshalPool = unmarshalPool;\nexports.unmarshalVersion = unmarshalVersion;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst CreateClusterRequest = {\n description: {\n maxLength: 4096\n },\n name: {\n maxLength: 100,\n minLength: 1\n },\n type: {\n maxLength: 100\n },\n version: {\n maxLength: 10\n }\n};\nconst CreateClusterRequestAutoscalerConfig = {\n scaleDownDelayAfterAdd: {\n maxLength: 100\n },\n scaleDownUtilizationThreshold: {\n greaterThan: 0,\n lessThan: 1\n }\n};\nconst CreateClusterRequestOpenIDConnectConfig = {\n clientId: {\n maxLength: 255,\n minLength: 1\n },\n groupsPrefix: {\n maxLength: 100,\n minLength: 1\n },\n issuerUrl: {\n maxLength: 255\n },\n usernameClaim: {\n maxLength: 100,\n minLength: 1\n },\n usernamePrefix: {\n maxLength: 100,\n minLength: 1\n }\n};\nconst CreateClusterRequestPoolConfig = {\n name: {\n maxLength: 100,\n minLength: 1\n }\n};\nconst CreatePoolRequest = {\n name: {\n maxLength: 100,\n minLength: 1\n }\n};\nconst ListClusterTypesRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nconst ListClustersRequest = {\n name: {\n minLength: 1\n },\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nconst ListNodesRequest = {\n name: {\n minLength: 1\n },\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nconst ListPoolsRequest = {\n name: {\n minLength: 1\n },\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nconst MaintenanceWindow = {\n startHour: {\n lessThanOrEqual: 23\n }\n};\nconst SetClusterTypeRequest = {\n type: {\n maxLength: 100\n }\n};\nconst UpdateClusterRequest = {\n description: {\n maxLength: 4096\n },\n name: {\n maxLength: 100,\n minLength: 1\n }\n};\nconst UpdateClusterRequestAutoscalerConfig = {\n scaleDownDelayAfterAdd: {\n maxLength: 100\n },\n scaleDownUtilizationThreshold: {\n greaterThan: 0,\n lessThan: 1\n }\n};\nconst UpdateClusterRequestOpenIDConnectConfig = {\n clientId: {\n maxLength: 255,\n minLength: 1\n },\n groupsPrefix: {\n maxLength: 100,\n minLength: 1\n },\n issuerUrl: {\n maxLength: 255\n },\n usernameClaim: {\n maxLength: 100,\n minLength: 1\n },\n usernamePrefix: {\n maxLength: 100,\n minLength: 1\n }\n};\nconst UpgradeClusterRequest = {\n version: {\n maxLength: 10\n }\n};\nexports.CreateClusterRequest = CreateClusterRequest;\nexports.CreateClusterRequestAutoscalerConfig = CreateClusterRequestAutoscalerConfig;\nexports.CreateClusterRequestOpenIDConnectConfig = CreateClusterRequestOpenIDConnectConfig;\nexports.CreateClusterRequestPoolConfig = CreateClusterRequestPoolConfig;\nexports.CreatePoolRequest = CreatePoolRequest;\nexports.ListClusterTypesRequest = ListClusterTypesRequest;\nexports.ListClustersRequest = ListClustersRequest;\nexports.ListNodesRequest = ListNodesRequest;\nexports.ListPoolsRequest = ListPoolsRequest;\nexports.MaintenanceWindow = MaintenanceWindow;\nexports.SetClusterTypeRequest = SetClusterTypeRequest;\nexports.UpdateClusterRequest = UpdateClusterRequest;\nexports.UpdateClusterRequestAutoscalerConfig = UpdateClusterRequestAutoscalerConfig;\nexports.UpdateClusterRequestOpenIDConnectConfig = UpdateClusterRequestOpenIDConnectConfig;\nexports.UpgradeClusterRequest = UpgradeClusterRequest;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst index_gen = require(\"./v1alpha1/index.gen.cjs\");\nexports.v1alpha1 = index_gen;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api = require(\"../../../scw/api.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst resourcePaginator = require(\"../../../scw/fetch/resource-paginator.cjs\");\nconst marshalling_gen = require(\"./marshalling.gen.cjs\");\nconst jsonContentHeaders = {\n \"Content-Type\": \"application/json; charset=utf-8\"\n};\nclass API extends api.API {\n /** Lists the available regions of the API. */\n static LOCALITIES = [\"fr-par\", \"nl-ams\", \"pl-waw\"];\n /**\n * Create a key. Create a key in a given region specified by the `region`\n * parameter. Keys only support symmetric encryption. You can use keys to\n * encrypt or decrypt arbitrary payloads, or to generate data encryption keys\n * that can be used without being stored in Key Manager.\n *\n * @param request - The request {@link CreateKeyRequest}\n * @returns A Promise of Key\n */\n createKey = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateKeyRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/key-manager/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/keys`\n },\n marshalling_gen.unmarshalKey\n );\n /**\n * Get key metadata. Retrieve the metadata of a key specified by the `region`\n * and `key_id` parameters.\n *\n * @param request - The request {@link GetKeyRequest}\n * @returns A Promise of Key\n */\n getKey = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/key-manager/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/keys/${marshalling.validatePathParam(\"keyId\", request.keyId)}`\n },\n marshalling_gen.unmarshalKey\n );\n /**\n * Update a key. Update a key's metadata (name, description and tags),\n * specified by the `key_id` and `region` parameters.\n *\n * @param request - The request {@link UpdateKeyRequest}\n * @returns A Promise of Key\n */\n updateKey = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateKeyRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/key-manager/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/keys/${marshalling.validatePathParam(\"keyId\", request.keyId)}`\n },\n marshalling_gen.unmarshalKey\n );\n /**\n * Delete a key. Delete an existing key specified by the `region` and `key_id`\n * parameters. Deleting a key is permanent and cannot be undone. All data\n * encrypted using this key, including data encryption keys, will become\n * unusable.\n *\n * @param request - The request {@link DeleteKeyRequest}\n */\n deleteKey = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/key-manager/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/keys/${marshalling.validatePathParam(\"keyId\", request.keyId)}`\n });\n /**\n * Rotate a key. Generate a new version of an existing key with randomly\n * generated key material. Rotated keys can still be used to decrypt\n * previously encrypted data. The key's new material will be used for\n * subsequent encryption operations and data key generation.\n *\n * @param request - The request {@link RotateKeyRequest}\n * @returns A Promise of Key\n */\n rotateKey = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/key-manager/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/keys/${marshalling.validatePathParam(\"keyId\", request.keyId)}/rotate`\n },\n marshalling_gen.unmarshalKey\n );\n /**\n * Apply key protection. Apply key protection to a given key specified by the\n * `key_id` parameter. Applying key protection means that your key can be used\n * and modified, but it cannot be deleted.\n *\n * @param request - The request {@link ProtectKeyRequest}\n * @returns A Promise of Key\n */\n protectKey = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/key-manager/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/keys/${marshalling.validatePathParam(\"keyId\", request.keyId)}/protect`\n },\n marshalling_gen.unmarshalKey\n );\n /**\n * Remove key protection. Remove key protection from a given key specified by\n * the `key_id` parameter. Removing key protection means that your key can be\n * deleted anytime.\n *\n * @param request - The request {@link UnprotectKeyRequest}\n * @returns A Promise of Key\n */\n unprotectKey = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/key-manager/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/keys/${marshalling.validatePathParam(\"keyId\", request.keyId)}/unprotect`\n },\n marshalling_gen.unmarshalKey\n );\n /**\n * Enable key. Enable a given key to be used for cryptographic operations.\n * Enabling a key allows you to make a disabled key usable again. You must\n * specify the `region` and `key_id` parameters.\n *\n * @param request - The request {@link EnableKeyRequest}\n * @returns A Promise of Key\n */\n enableKey = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/key-manager/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/keys/${marshalling.validatePathParam(\"keyId\", request.keyId)}/enable`\n },\n marshalling_gen.unmarshalKey\n );\n /**\n * Disable key. Disable a given key to be used for cryptographic operations.\n * Disabling a key renders it unusable. You must specify the `region` and\n * `key_id` parameters.\n *\n * @param request - The request {@link DisableKeyRequest}\n * @returns A Promise of Key\n */\n disableKey = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/key-manager/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/keys/${marshalling.validatePathParam(\"keyId\", request.keyId)}/disable`\n },\n marshalling_gen.unmarshalKey\n );\n pageOfListKeys = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/key-manager/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/keys`,\n urlParams: marshalling.urlParams(\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId],\n [\"tags\", request.tags]\n )\n },\n marshalling_gen.unmarshalListKeysResponse\n );\n /**\n * List keys. Retrieve the list of keys created within all Projects of an\n * Organization or in a given Project. You must specify the `region`, and\n * either the `organization_id` or the `project_id`.\n *\n * @param request - The request {@link ListKeysRequest}\n * @returns A Promise of ListKeysResponse\n */\n listKeys = (request = {}) => resourcePaginator.enrichForPagination(\"keys\", this.pageOfListKeys, request);\n /**\n * Generate a data encryption key. Generate a new data encryption key to use\n * for cryptographic operations outside of Key Manager. Note that Key Manager\n * does not store your data encryption key. The data encryption key is\n * encrypted and must be decrypted using the key you have created in Key\n * Manager. The data encryption key's plaintext is returned in the response\n * object, for immediate usage.\n *\n * Always store the data encryption key's ciphertext, rather than its\n * plaintext, which must not be stored. To retrieve your key's plaintext, call\n * the Decrypt endpoint with your key's ID and ciphertext.\n *\n * @param request - The request {@link GenerateDataKeyRequest}\n * @returns A Promise of DataKey\n */\n generateDataKey = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalGenerateDataKeyRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/key-manager/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/keys/${marshalling.validatePathParam(\"keyId\", request.keyId)}/generate-data-key`\n },\n marshalling_gen.unmarshalDataKey\n );\n /**\n * Encrypt data. Encrypt data using an existing key, specified by the `key_id`\n * parameter. Only keys with a usage set to **symmetric_encryption** are\n * supported by this method. The maximum payload size that can be encrypted is\n * 64KB of plaintext.\n *\n * @param request - The request {@link EncryptRequest}\n * @returns A Promise of EncryptResponse\n */\n encrypt = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalEncryptRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/key-manager/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/keys/${marshalling.validatePathParam(\"keyId\", request.keyId)}/encrypt`\n },\n marshalling_gen.unmarshalEncryptResponse\n );\n /**\n * Decrypt data. Decrypt data using an existing key, specified by the `key_id`\n * parameter. The maximum payload size that can be decrypted is the result of\n * the encryption of 64KB of data (around 131KB).\n *\n * @param request - The request {@link DecryptRequest}\n * @returns A Promise of DecryptResponse\n */\n decrypt = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalDecryptRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/key-manager/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/keys/${marshalling.validatePathParam(\"keyId\", request.keyId)}/decrypt`\n },\n marshalling_gen.unmarshalDecryptResponse\n );\n /**\n * Import key material. Import key material to use to derive a new\n * cryptographic key. The key's origin must be `external`.\n *\n * @param request - The request {@link ImportKeyMaterialRequest}\n * @returns A Promise of Key\n */\n importKeyMaterial = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalImportKeyMaterialRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/key-manager/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/keys/${marshalling.validatePathParam(\"keyId\", request.keyId)}/import-key-material`\n },\n marshalling_gen.unmarshalKey\n );\n /**\n * Delete key material. Delete previously imported key material. This renders\n * the associated cryptographic key unusable for any operation. The key's\n * origin must be `external`.\n *\n * @param request - The request {@link DeleteKeyMaterialRequest}\n */\n deleteKeyMaterial = (request) => this.client.fetch({\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/key-manager/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/keys/${marshalling.validatePathParam(\"keyId\", request.keyId)}/delete-key-material`\n });\n}\nexports.API = API;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api_gen = require(\"./api.gen.cjs\");\nexports.API = api_gen.API;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst json = require(\"../../../helpers/json.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst unmarshalKeyRotationPolicy = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'KeyRotationPolicy' failed as data isn't a dictionary.`\n );\n }\n return {\n nextRotationAt: marshalling.unmarshalDate(data.next_rotation_at),\n rotationPeriod: data.rotation_period\n };\n};\nconst unmarshalKeyUsage = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'KeyUsage' failed as data isn't a dictionary.`\n );\n }\n return {\n symmetricEncryption: data.symmetric_encryption ? data.symmetric_encryption : void 0\n };\n};\nconst unmarshalKey = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Key' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n description: data.description,\n id: data.id,\n locked: data.locked,\n name: data.name,\n origin: data.origin,\n projectId: data.project_id,\n protected: data.protected,\n region: data.region,\n rotatedAt: marshalling.unmarshalDate(data.rotated_at),\n rotationCount: data.rotation_count,\n rotationPolicy: data.rotation_policy ? unmarshalKeyRotationPolicy(data.rotation_policy) : void 0,\n state: data.state,\n tags: data.tags,\n updatedAt: marshalling.unmarshalDate(data.updated_at),\n usage: data.usage ? unmarshalKeyUsage(data.usage) : void 0\n };\n};\nconst unmarshalDataKey = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DataKey' failed as data isn't a dictionary.`\n );\n }\n return {\n algorithm: data.algorithm,\n ciphertext: data.ciphertext,\n createdAt: marshalling.unmarshalDate(data.created_at),\n keyId: data.key_id,\n plaintext: data.plaintext\n };\n};\nconst unmarshalDecryptResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DecryptResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n ciphertext: data.ciphertext,\n keyId: data.key_id,\n plaintext: data.plaintext\n };\n};\nconst unmarshalEncryptResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'EncryptResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n ciphertext: data.ciphertext,\n keyId: data.key_id\n };\n};\nconst unmarshalListKeysResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListKeysResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n keys: marshalling.unmarshalArrayOfObject(data.keys, unmarshalKey),\n totalCount: data.total_count\n };\n};\nconst marshalKeyRotationPolicy = (request, defaults) => ({\n next_rotation_at: request.nextRotationAt,\n rotation_period: request.rotationPeriod\n});\nconst marshalKeyUsage = (request, defaults) => ({\n ...marshalling.resolveOneOf([\n { param: \"symmetric_encryption\", value: request.symmetricEncryption }\n ])\n});\nconst marshalCreateKeyRequest = (request, defaults) => ({\n description: request.description,\n name: request.name,\n origin: request.origin,\n project_id: request.projectId ?? defaults.defaultProjectId,\n rotation_policy: request.rotationPolicy !== void 0 ? marshalKeyRotationPolicy(request.rotationPolicy) : void 0,\n tags: request.tags,\n unprotected: request.unprotected,\n usage: request.usage !== void 0 ? marshalKeyUsage(request.usage) : void 0\n});\nconst marshalDecryptRequest = (request, defaults) => ({\n associated_data: request.associatedData,\n ciphertext: request.ciphertext\n});\nconst marshalEncryptRequest = (request, defaults) => ({\n associated_data: request.associatedData,\n plaintext: request.plaintext\n});\nconst marshalGenerateDataKeyRequest = (request, defaults) => ({\n algorithm: request.algorithm,\n without_plaintext: request.withoutPlaintext\n});\nconst marshalImportKeyMaterialRequest = (request, defaults) => ({\n key_material: request.keyMaterial,\n salt: request.salt\n});\nconst marshalUpdateKeyRequest = (request, defaults) => ({\n description: request.description,\n name: request.name,\n rotation_policy: request.rotationPolicy !== void 0 ? marshalKeyRotationPolicy(request.rotationPolicy) : void 0,\n tags: request.tags\n});\nexports.marshalCreateKeyRequest = marshalCreateKeyRequest;\nexports.marshalDecryptRequest = marshalDecryptRequest;\nexports.marshalEncryptRequest = marshalEncryptRequest;\nexports.marshalGenerateDataKeyRequest = marshalGenerateDataKeyRequest;\nexports.marshalImportKeyMaterialRequest = marshalImportKeyMaterialRequest;\nexports.marshalUpdateKeyRequest = marshalUpdateKeyRequest;\nexports.unmarshalDataKey = unmarshalDataKey;\nexports.unmarshalDecryptResponse = unmarshalDecryptResponse;\nexports.unmarshalEncryptResponse = unmarshalEncryptResponse;\nexports.unmarshalKey = unmarshalKey;\nexports.unmarshalListKeysResponse = unmarshalListKeysResponse;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst index = require(\"./v1/index.cjs\");\nexports.v1 = index;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst intervalRetrier = require(\"../../../internal/async/interval-retrier.cjs\");\nconst api = require(\"../../../scw/api.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst resourcePaginator = require(\"../../../scw/fetch/resource-paginator.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nconst marshalling_gen = require(\"./marshalling.gen.cjs\");\nconst jsonContentHeaders = {\n \"Content-Type\": \"application/json; charset=utf-8\"\n};\nclass ZonedAPI extends api.API {\n /** Lists the available zones of the API. */\n static LOCALITIES = [\n \"fr-par-1\",\n \"fr-par-2\",\n \"nl-ams-1\",\n \"nl-ams-2\",\n \"nl-ams-3\",\n \"pl-waw-1\",\n \"pl-waw-2\",\n \"pl-waw-3\"\n ];\n pageOfListLbs = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/lbs`,\n urlParams: marshalling.urlParams(\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId],\n [\"tags\", request.tags]\n )\n },\n marshalling_gen.unmarshalListLbsResponse\n );\n /**\n * List Load Balancers. List all Load Balancers in the specified zone, for a\n * Scaleway Organization or Scaleway Project. By default, the Load Balancers\n * returned in the list are ordered by creation date in ascending order,\n * though this can be modified via the `order_by` field.\n *\n * @param request - The request {@link ZonedApiListLbsRequest}\n * @returns A Promise of ListLbsResponse\n */\n listLbs = (request = {}) => resourcePaginator.enrichForPagination(\"lbs\", this.pageOfListLbs, request);\n /**\n * Create a Load Balancer. Create a new Load Balancer. Note that the Load\n * Balancer will be created without frontends or backends; these must be\n * created separately via the dedicated endpoints.\n *\n * @param request - The request {@link ZonedApiCreateLbRequest}\n * @returns A Promise of Lb\n */\n createLb = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalZonedApiCreateLbRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/lbs`\n },\n marshalling_gen.unmarshalLb\n );\n /**\n * Get a Load Balancer. Retrieve information about an existing Load Balancer,\n * specified by its Load Balancer ID. Its full details, including name, status\n * and IP address, are returned in the response object.\n *\n * @param request - The request {@link ZonedApiGetLbRequest}\n * @returns A Promise of Lb\n */\n getLb = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/lbs/${marshalling.validatePathParam(\"lbId\", request.lbId)}`\n },\n marshalling_gen.unmarshalLb\n );\n /**\n * Waits for {@link Lb} to be in a final state.\n *\n * @param request - The request {@link ZonedApiGetLbRequest}\n * @param options - The waiting options\n * @returns A Promise of Lb\n */\n waitForLb = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(!content_gen.LB_TRANSIENT_STATUSES.includes(res.status))),\n this.getLb,\n request,\n options\n );\n /**\n * Update a Load Balancer. Update the parameters of an existing Load Balancer,\n * specified by its Load Balancer ID. Note that the request type is PUT and\n * not PATCH. You must set all parameters.\n *\n * @param request - The request {@link ZonedApiUpdateLbRequest}\n * @returns A Promise of Lb\n */\n updateLb = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalZonedApiUpdateLbRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PUT\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/lbs/${marshalling.validatePathParam(\"lbId\", request.lbId)}`\n },\n marshalling_gen.unmarshalLb\n );\n /**\n * Delete a Load Balancer. Delete an existing Load Balancer, specified by its\n * Load Balancer ID. Deleting a Load Balancer is permanent, and cannot be\n * undone. The Load Balancer's flexible IP address can either be deleted with\n * the Load Balancer, or kept in your account for future use.\n *\n * @param request - The request {@link ZonedApiDeleteLbRequest}\n */\n deleteLb = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/lbs/${marshalling.validatePathParam(\"lbId\", request.lbId)}`,\n urlParams: marshalling.urlParams([\"release_ip\", request.releaseIp])\n });\n /**\n * Migrate a Load Balancer. Migrate an existing Load Balancer from one\n * commercial type to another. Allows you to scale your Load Balancer up or\n * down in terms of bandwidth or multi-cloud provision.\n *\n * @param request - The request {@link ZonedApiMigrateLbRequest}\n * @returns A Promise of Lb\n */\n migrateLb = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalZonedApiMigrateLbRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/lbs/${marshalling.validatePathParam(\"lbId\", request.lbId)}/migrate`\n },\n marshalling_gen.unmarshalLb\n );\n pageOfListIPs = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/ips`,\n urlParams: marshalling.urlParams(\n [\"ip_address\", request.ipAddress],\n [\"ip_type\", request.ipType],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId],\n [\"tags\", request.tags]\n )\n },\n marshalling_gen.unmarshalListIpsResponse\n );\n /**\n * List IP addresses. List the Load Balancer flexible IP addresses held in the\n * account (filtered by Organization ID or Project ID). It is also possible to\n * search for a specific IP address.\n *\n * @param request - The request {@link ZonedApiListIPsRequest}\n * @returns A Promise of ListIpsResponse\n */\n listIPs = (request = {}) => resourcePaginator.enrichForPagination(\"ips\", this.pageOfListIPs, request);\n /**\n * Create an IP address. Create a new Load Balancer flexible IP address, in\n * the specified Scaleway Project. This can be attached to new Load Balancers\n * created in the future.\n *\n * @param request - The request {@link ZonedApiCreateIpRequest}\n * @returns A Promise of Ip\n */\n createIp = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalZonedApiCreateIpRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/ips`\n },\n marshalling_gen.unmarshalIp\n );\n /**\n * Get an IP address. Retrieve the full details of a Load Balancer flexible IP\n * address.\n *\n * @param request - The request {@link ZonedApiGetIpRequest}\n * @returns A Promise of Ip\n */\n getIp = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/ips/${marshalling.validatePathParam(\"ipId\", request.ipId)}`\n },\n marshalling_gen.unmarshalIp\n );\n /**\n * Delete an IP address. Delete a Load Balancer flexible IP address. This\n * action is irreversible, and cannot be undone.\n *\n * @param request - The request {@link ZonedApiReleaseIpRequest}\n */\n releaseIp = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/ips/${marshalling.validatePathParam(\"ipId\", request.ipId)}`\n });\n /**\n * Update an IP address. Update the reverse DNS of a Load Balancer flexible IP\n * address.\n *\n * @param request - The request {@link ZonedApiUpdateIpRequest}\n * @returns A Promise of Ip\n */\n updateIp = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalZonedApiUpdateIpRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/ips/${marshalling.validatePathParam(\"ipId\", request.ipId)}`\n },\n marshalling_gen.unmarshalIp\n );\n pageOfListBackends = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/lbs/${marshalling.validatePathParam(\"lbId\", request.lbId)}/backends`,\n urlParams: marshalling.urlParams(\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListBackendsResponse\n );\n /**\n * List the backends of a given Load Balancer. List all the backends of a Load\n * Balancer, specified by its Load Balancer ID. By default, results are\n * returned in ascending order by the creation date of each backend. The\n * response is an array of backend objects, containing full details of each\n * one including their configuration parameters such as protocol, port and\n * forwarding algorithm.\n *\n * @param request - The request {@link ZonedApiListBackendsRequest}\n * @returns A Promise of ListBackendsResponse\n */\n listBackends = (request) => resourcePaginator.enrichForPagination(\"backends\", this.pageOfListBackends, request);\n /**\n * Create a backend for a given Load Balancer. Create a new backend for a\n * given Load Balancer, specifying its full configuration including protocol,\n * port and forwarding algorithm.\n *\n * @param request - The request {@link ZonedApiCreateBackendRequest}\n * @returns A Promise of Backend\n */\n createBackend = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalZonedApiCreateBackendRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/lbs/${marshalling.validatePathParam(\"lbId\", request.lbId)}/backends`\n },\n marshalling_gen.unmarshalBackend\n );\n /**\n * Get a backend of a given Load Balancer. Get the full details of a given\n * backend, specified by its backend ID. The response contains the backend's\n * full configuration parameters including protocol, port and forwarding\n * algorithm.\n *\n * @param request - The request {@link ZonedApiGetBackendRequest}\n * @returns A Promise of Backend\n */\n getBackend = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/backends/${marshalling.validatePathParam(\"backendId\", request.backendId)}`\n },\n marshalling_gen.unmarshalBackend\n );\n /**\n * Update a backend of a given Load Balancer. Update a backend of a given Load\n * Balancer, specified by its backend ID. Note that the request type is PUT\n * and not PATCH. You must set all parameters.\n *\n * @param request - The request {@link ZonedApiUpdateBackendRequest}\n * @returns A Promise of Backend\n */\n updateBackend = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalZonedApiUpdateBackendRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PUT\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/backends/${marshalling.validatePathParam(\"backendId\", request.backendId)}`\n },\n marshalling_gen.unmarshalBackend\n );\n /**\n * Delete a backend of a given Load Balancer. Delete a backend of a given Load\n * Balancer, specified by its backend ID. This action is irreversible and\n * cannot be undone.\n *\n * @param request - The request {@link ZonedApiDeleteBackendRequest}\n */\n deleteBackend = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/backends/${marshalling.validatePathParam(\"backendId\", request.backendId)}`\n });\n /**\n * Add a set of backend servers to a given backend. For a given backend\n * specified by its backend ID, add a set of backend servers (identified by\n * their IP addresses) it should forward traffic to. These will be appended to\n * any existing set of backend servers for this backend.\n *\n * @param request - The request {@link ZonedApiAddBackendServersRequest}\n * @returns A Promise of Backend\n */\n addBackendServers = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalZonedApiAddBackendServersRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/backends/${marshalling.validatePathParam(\"backendId\", request.backendId)}/servers`\n },\n marshalling_gen.unmarshalBackend\n );\n /**\n * Remove a set of servers for a given backend. For a given backend specified\n * by its backend ID, remove the specified backend servers (identified by\n * their IP addresses) so that it no longer forwards traffic to them.\n *\n * @param request - The request {@link ZonedApiRemoveBackendServersRequest}\n * @returns A Promise of Backend\n */\n removeBackendServers = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalZonedApiRemoveBackendServersRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"DELETE\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/backends/${marshalling.validatePathParam(\"backendId\", request.backendId)}/servers`\n },\n marshalling_gen.unmarshalBackend\n );\n /**\n * Define all backend servers for a given backend. For a given backend\n * specified by its backend ID, define the set of backend servers (identified\n * by their IP addresses) that it should forward traffic to. Any existing\n * backend servers configured for this backend will be removed.\n *\n * @param request - The request {@link ZonedApiSetBackendServersRequest}\n * @returns A Promise of Backend\n */\n setBackendServers = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalZonedApiSetBackendServersRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"PUT\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/backends/${marshalling.validatePathParam(\"backendId\", request.backendId)}/servers`\n },\n marshalling_gen.unmarshalBackend\n );\n /**\n * Update a health check for a given backend. Update the configuration of the\n * health check performed by a given backend to verify the health of its\n * backend servers, identified by its backend ID. Note that the request type\n * is PUT and not PATCH. You must set all parameters.\n *\n * @param request - The request {@link ZonedApiUpdateHealthCheckRequest}\n * @returns A Promise of HealthCheck\n */\n updateHealthCheck = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalZonedApiUpdateHealthCheckRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"PUT\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/backends/${marshalling.validatePathParam(\"backendId\", request.backendId)}/healthcheck`\n },\n marshalling_gen.unmarshalHealthCheck\n );\n pageOfListFrontends = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/lbs/${marshalling.validatePathParam(\"lbId\", request.lbId)}/frontends`,\n urlParams: marshalling.urlParams(\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListFrontendsResponse\n );\n /**\n * List frontends of a given Load Balancer. List all the frontends of a Load\n * Balancer, specified by its Load Balancer ID. By default, results are\n * returned in ascending order by the creation date of each frontend. The\n * response is an array of frontend objects, containing full details of each\n * one including the port they listen on and the backend they are attached\n * to.\n *\n * @param request - The request {@link ZonedApiListFrontendsRequest}\n * @returns A Promise of ListFrontendsResponse\n */\n listFrontends = (request) => resourcePaginator.enrichForPagination(\"frontends\", this.pageOfListFrontends, request);\n /**\n * Create a frontend in a given Load Balancer. Create a new frontend for a\n * given Load Balancer, specifying its configuration including the port it\n * should listen on and the backend to attach it to.\n *\n * @param request - The request {@link ZonedApiCreateFrontendRequest}\n * @returns A Promise of Frontend\n */\n createFrontend = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalZonedApiCreateFrontendRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/lbs/${marshalling.validatePathParam(\"lbId\", request.lbId)}/frontends`\n },\n marshalling_gen.unmarshalFrontend\n );\n /**\n * Get a frontend. Get the full details of a given frontend, specified by its\n * frontend ID. The response contains the frontend's full configuration\n * parameters including the backend it is attached to, the port it listens on,\n * and any certificates it has.\n *\n * @param request - The request {@link ZonedApiGetFrontendRequest}\n * @returns A Promise of Frontend\n */\n getFrontend = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/frontends/${marshalling.validatePathParam(\"frontendId\", request.frontendId)}`\n },\n marshalling_gen.unmarshalFrontend\n );\n /**\n * Update a frontend. Update a given frontend, specified by its frontend ID.\n * You can update configuration parameters including its name and the port it\n * listens on. Note that the request type is PUT and not PATCH. You must set\n * all parameters.\n *\n * @param request - The request {@link ZonedApiUpdateFrontendRequest}\n * @returns A Promise of Frontend\n */\n updateFrontend = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalZonedApiUpdateFrontendRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PUT\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/frontends/${marshalling.validatePathParam(\"frontendId\", request.frontendId)}`\n },\n marshalling_gen.unmarshalFrontend\n );\n /**\n * Delete a frontend. Delete a given frontend, specified by its frontend ID.\n * This action is irreversible and cannot be undone.\n *\n * @param request - The request {@link ZonedApiDeleteFrontendRequest}\n */\n deleteFrontend = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/frontends/${marshalling.validatePathParam(\"frontendId\", request.frontendId)}`\n });\n pageOfListRoutes = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/routes`,\n urlParams: marshalling.urlParams(\n [\"frontend_id\", request.frontendId],\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListRoutesResponse\n );\n /**\n * List all routes. List all routes for a given frontend. The response is an\n * array of routes, each one with a specified backend to direct to if a\n * certain condition is matched (based on the value of the SNI field or HTTP\n * Host header).\n *\n * @param request - The request {@link ZonedApiListRoutesRequest}\n * @returns A Promise of ListRoutesResponse\n */\n listRoutes = (request = {}) => resourcePaginator.enrichForPagination(\"routes\", this.pageOfListRoutes, request);\n /**\n * Create a route. Create a new route on a given frontend. To configure a\n * route, specify the backend to direct to if a certain condition is matched\n * (based on the value of the SNI field or HTTP Host header).\n *\n * @param request - The request {@link ZonedApiCreateRouteRequest}\n * @returns A Promise of Route\n */\n createRoute = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalZonedApiCreateRouteRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/routes`\n },\n marshalling_gen.unmarshalRoute\n );\n /**\n * Get a route. Retrieve information about an existing route, specified by its\n * route ID. Its full details, origin frontend, target backend and match\n * condition, are returned in the response object.\n *\n * @param request - The request {@link ZonedApiGetRouteRequest}\n * @returns A Promise of Route\n */\n getRoute = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/routes/${marshalling.validatePathParam(\"routeId\", request.routeId)}`\n },\n marshalling_gen.unmarshalRoute\n );\n /**\n * Update a route. Update the configuration of an existing route, specified by\n * its route ID.\n *\n * @param request - The request {@link ZonedApiUpdateRouteRequest}\n * @returns A Promise of Route\n */\n updateRoute = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalZonedApiUpdateRouteRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PUT\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/routes/${marshalling.validatePathParam(\"routeId\", request.routeId)}`\n },\n marshalling_gen.unmarshalRoute\n );\n /**\n * Delete a route. Delete an existing route, specified by its route ID.\n * Deleting a route is permanent, and cannot be undone.\n *\n * @param request - The request {@link ZonedApiDeleteRouteRequest}\n */\n deleteRoute = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/routes/${marshalling.validatePathParam(\"routeId\", request.routeId)}`\n });\n /**\n * Get usage statistics of a given Load Balancer.\n *\n * @deprecated\n * @param request - The request {@link ZonedApiGetLbStatsRequest}\n * @returns A Promise of LbStats\n */\n getLbStats = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/lbs/${marshalling.validatePathParam(\"lbId\", request.lbId)}/stats`,\n urlParams: marshalling.urlParams([\"backend_id\", request.backendId])\n },\n marshalling_gen.unmarshalLbStats\n );\n pageOfListBackendStats = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/lbs/${marshalling.validatePathParam(\"lbId\", request.lbId)}/backend-stats`,\n urlParams: marshalling.urlParams(\n [\"backend_id\", request.backendId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListBackendStatsResponse\n );\n /**\n * List backend server statistics. List information about your backend\n * servers, including their state and the result of their last health check.\n *\n * @param request - The request {@link ZonedApiListBackendStatsRequest}\n * @returns A Promise of ListBackendStatsResponse\n */\n listBackendStats = (request) => resourcePaginator.enrichForPagination(\n \"backendServersStats\",\n this.pageOfListBackendStats,\n request\n );\n pageOfListAcls = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/frontends/${marshalling.validatePathParam(\"frontendId\", request.frontendId)}/acls`,\n urlParams: marshalling.urlParams(\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListAclResponse\n );\n /**\n * List ACLs for a given frontend. List the ACLs for a given frontend,\n * specified by its frontend ID. The response is an array of ACL objects, each\n * one representing an ACL that denies or allows traffic based on certain\n * conditions.\n *\n * @param request - The request {@link ZonedApiListAclsRequest}\n * @returns A Promise of ListAclResponse\n */\n listAcls = (request) => resourcePaginator.enrichForPagination(\"acls\", this.pageOfListAcls, request);\n /**\n * Create an ACL for a given frontend. Create a new ACL for a given frontend.\n * Each ACL must have a name, an action to perform (allow or deny), and a\n * match rule (the action is carried out when the incoming traffic matches the\n * rule).\n *\n * @param request - The request {@link ZonedApiCreateAclRequest}\n * @returns A Promise of Acl\n */\n createAcl = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalZonedApiCreateAclRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/frontends/${marshalling.validatePathParam(\"frontendId\", request.frontendId)}/acls`\n },\n marshalling_gen.unmarshalAcl\n );\n /**\n * Get an ACL. Get information for a particular ACL, specified by its ACL ID.\n * The response returns full details of the ACL, including its name, action,\n * match rule and frontend.\n *\n * @param request - The request {@link ZonedApiGetAclRequest}\n * @returns A Promise of Acl\n */\n getAcl = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/acls/${marshalling.validatePathParam(\"aclId\", request.aclId)}`\n },\n marshalling_gen.unmarshalAcl\n );\n /**\n * Update an ACL. Update a particular ACL, specified by its ACL ID. You can\n * update details including its name, action and match rule.\n *\n * @param request - The request {@link ZonedApiUpdateAclRequest}\n * @returns A Promise of Acl\n */\n updateAcl = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalZonedApiUpdateAclRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PUT\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/acls/${marshalling.validatePathParam(\"aclId\", request.aclId)}`\n },\n marshalling_gen.unmarshalAcl\n );\n /**\n * Delete an ACL. Delete an ACL, specified by its ACL ID. Deleting an ACL is\n * irreversible and cannot be undone.\n *\n * @param request - The request {@link ZonedApiDeleteAclRequest}\n */\n deleteAcl = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/acls/${marshalling.validatePathParam(\"aclId\", request.aclId)}`\n });\n /**\n * Define all ACLs for a given frontend. For a given frontend specified by its\n * frontend ID, define and add the complete set of ACLS for that frontend. Any\n * existing ACLs on this frontend will be removed.\n *\n * @param request - The request {@link ZonedApiSetAclsRequest}\n * @returns A Promise of SetAclsResponse\n */\n setAcls = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalZonedApiSetAclsRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PUT\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/frontends/${marshalling.validatePathParam(\"frontendId\", request.frontendId)}/acls`\n },\n marshalling_gen.unmarshalSetAclsResponse\n );\n /**\n * Create an SSL/TLS certificate. Generate a new SSL/TLS certificate for a\n * given Load Balancer. You can choose to create a Let's Encrypt certificate,\n * or import a custom certificate.\n *\n * @param request - The request {@link ZonedApiCreateCertificateRequest}\n * @returns A Promise of Certificate\n */\n createCertificate = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalZonedApiCreateCertificateRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/lbs/${marshalling.validatePathParam(\"lbId\", request.lbId)}/certificates`\n },\n marshalling_gen.unmarshalCertificate\n );\n pageOfListCertificates = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/lbs/${marshalling.validatePathParam(\"lbId\", request.lbId)}/certificates`,\n urlParams: marshalling.urlParams(\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListCertificatesResponse\n );\n /**\n * List all SSL/TLS certificates on a given Load Balancer. List all the\n * SSL/TLS certificates on a given Load Balancer. The response is an array of\n * certificate objects, which are by default listed in ascending order of\n * creation date.\n *\n * @param request - The request {@link ZonedApiListCertificatesRequest}\n * @returns A Promise of ListCertificatesResponse\n */\n listCertificates = (request) => resourcePaginator.enrichForPagination(\"certificates\", this.pageOfListCertificates, request);\n /**\n * Get an SSL/TLS certificate. Get information for a particular SSL/TLS\n * certificate, specified by its certificate ID. The response returns full\n * details of the certificate, including its type, main domain name, and\n * alternative domain names.\n *\n * @param request - The request {@link ZonedApiGetCertificateRequest}\n * @returns A Promise of Certificate\n */\n getCertificate = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/certificates/${marshalling.validatePathParam(\"certificateId\", request.certificateId)}`\n },\n marshalling_gen.unmarshalCertificate\n );\n /**\n * Waits for {@link Certificate} to be in a final state.\n *\n * @param request - The request {@link ZonedApiGetCertificateRequest}\n * @param options - The waiting options\n * @returns A Promise of Certificate\n */\n waitForCertificate = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(\n !content_gen.CERTIFICATE_TRANSIENT_STATUSES.includes(res.status)\n )),\n this.getCertificate,\n request,\n options\n );\n /**\n * Update an SSL/TLS certificate. Update the name of a particular SSL/TLS\n * certificate, specified by its certificate ID.\n *\n * @param request - The request {@link ZonedApiUpdateCertificateRequest}\n * @returns A Promise of Certificate\n */\n updateCertificate = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalZonedApiUpdateCertificateRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"PUT\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/certificates/${marshalling.validatePathParam(\"certificateId\", request.certificateId)}`\n },\n marshalling_gen.unmarshalCertificate\n );\n /**\n * Delete an SSL/TLS certificate. Delete an SSL/TLS certificate, specified by\n * its certificate ID. Deleting a certificate is irreversible and cannot be\n * undone.\n *\n * @param request - The request {@link ZonedApiDeleteCertificateRequest}\n */\n deleteCertificate = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/certificates/${marshalling.validatePathParam(\"certificateId\", request.certificateId)}`\n });\n pageOfListLbTypes = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/lb-types`,\n urlParams: marshalling.urlParams(\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListLbTypesResponse\n );\n /**\n * List all Load Balancer offer types. List all the different commercial Load\n * Balancer types. The response includes an array of offer types, each with a\n * name, description, and information about its stock availability.\n *\n * @param request - The request {@link ZonedApiListLbTypesRequest}\n * @returns A Promise of ListLbTypesResponse\n */\n listLbTypes = (request = {}) => resourcePaginator.enrichForPagination(\"lbTypes\", this.pageOfListLbTypes, request);\n /**\n * Create a subscriber. Create a new subscriber, either with an email\n * configuration or a webhook configuration, for a specified Scaleway\n * Project.\n *\n * @param request - The request {@link ZonedApiCreateSubscriberRequest}\n * @returns A Promise of Subscriber\n */\n createSubscriber = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalZonedApiCreateSubscriberRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/subscribers`\n },\n marshalling_gen.unmarshalSubscriber\n );\n /**\n * Get a subscriber. Retrieve information about an existing subscriber,\n * specified by its subscriber ID. Its full details, including name and\n * email/webhook configuration, are returned in the response object.\n *\n * @param request - The request {@link ZonedApiGetSubscriberRequest}\n * @returns A Promise of Subscriber\n */\n getSubscriber = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/subscribers/${marshalling.validatePathParam(\"subscriberId\", request.subscriberId)}`\n },\n marshalling_gen.unmarshalSubscriber\n );\n pageOfListSubscriber = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/subscribers`,\n urlParams: marshalling.urlParams(\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId]\n )\n },\n marshalling_gen.unmarshalListSubscriberResponse\n );\n /**\n * List all subscribers. List all subscribers to Load Balancer alerts. By\n * default, returns all subscribers to Load Balancer alerts for the\n * Organization associated with the authentication token used for the\n * request.\n *\n * @param request - The request {@link ZonedApiListSubscriberRequest}\n * @returns A Promise of ListSubscriberResponse\n */\n listSubscriber = (request = {}) => resourcePaginator.enrichForPagination(\"subscribers\", this.pageOfListSubscriber, request);\n /**\n * Update a subscriber. Update the parameters of a given subscriber (e.g.\n * name, webhook configuration, email configuration), specified by its\n * subscriber ID.\n *\n * @param request - The request {@link ZonedApiUpdateSubscriberRequest}\n * @returns A Promise of Subscriber\n */\n updateSubscriber = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalZonedApiUpdateSubscriberRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PUT\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/subscribers/${marshalling.validatePathParam(\"subscriberId\", request.subscriberId)}`\n },\n marshalling_gen.unmarshalSubscriber\n );\n /**\n * Delete a subscriber. Delete an existing subscriber, specified by its\n * subscriber ID. Deleting a subscriber is permanent, and cannot be undone.\n *\n * @param request - The request {@link ZonedApiDeleteSubscriberRequest}\n */\n deleteSubscriber = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/lb/subscription/${marshalling.validatePathParam(\"subscriberId\", request.subscriberId)}`\n });\n /**\n * Subscribe a subscriber to alerts for a given Load Balancer. Subscribe an\n * existing subscriber to alerts for a given Load Balancer.\n *\n * @param request - The request {@link ZonedApiSubscribeToLbRequest}\n * @returns A Promise of Lb\n */\n subscribeToLb = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalZonedApiSubscribeToLbRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/lb/${marshalling.validatePathParam(\"lbId\", request.lbId)}/subscribe`\n },\n marshalling_gen.unmarshalLb\n );\n /**\n * Unsubscribe a subscriber from alerts for a given Load Balancer. Unsubscribe\n * a subscriber from alerts for a given Load Balancer. The subscriber is not\n * deleted, and can be resubscribed in the future if necessary.\n *\n * @param request - The request {@link ZonedApiUnsubscribeFromLbRequest}\n * @returns A Promise of Lb\n */\n unsubscribeFromLb = (request) => this.client.fetch(\n {\n method: \"DELETE\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/lb/${marshalling.validatePathParam(\"lbId\", request.lbId)}/unsubscribe`\n },\n marshalling_gen.unmarshalLb\n );\n pageOfListLbPrivateNetworks = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/lbs/${marshalling.validatePathParam(\"lbId\", request.lbId)}/private-networks`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListLbPrivateNetworksResponse\n );\n /**\n * List Private Networks attached to a Load Balancer. List the Private\n * Networks attached to a given Load Balancer, specified by its Load Balancer\n * ID. The response is an array of Private Network objects, giving information\n * including the status, configuration, name and creation date of each Private\n * Network.\n *\n * @param request - The request {@link ZonedApiListLbPrivateNetworksRequest}\n * @returns A Promise of ListLbPrivateNetworksResponse\n */\n listLbPrivateNetworks = (request) => resourcePaginator.enrichForPagination(\n \"privateNetwork\",\n this.pageOfListLbPrivateNetworks,\n request\n );\n /**\n * Attach a Load Balancer to a Private Network. Attach a specified Load\n * Balancer to a specified Private Network, defining a static or DHCP\n * configuration for the Load Balancer on the network.\n *\n * @param request - The request {@link ZonedApiAttachPrivateNetworkRequest}\n * @returns A Promise of PrivateNetwork\n */\n attachPrivateNetwork = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalZonedApiAttachPrivateNetworkRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/lbs/${marshalling.validatePathParam(\"lbId\", request.lbId)}/private-networks/${marshalling.validatePathParam(\"privateNetworkId\", request.privateNetworkId)}/attach`\n },\n marshalling_gen.unmarshalPrivateNetwork\n );\n /**\n * Detach Load Balancer from Private Network. Detach a specified Load Balancer\n * from a specified Private Network.\n *\n * @param request - The request {@link ZonedApiDetachPrivateNetworkRequest}\n */\n detachPrivateNetwork = (request) => this.client.fetch({\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/lb/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/lbs/${marshalling.validatePathParam(\"lbId\", request.lbId)}/private-networks/${marshalling.validatePathParam(\"privateNetworkId\", request.privateNetworkId)}/detach`\n });\n}\nclass API extends api.API {\n /** Lists the available regions of the API. */\n static LOCALITIES = [\"fr-par\", \"nl-ams\", \"pl-waw\"];\n pageOfListLbs = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/lb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/lbs`,\n urlParams: marshalling.urlParams(\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId],\n [\"tags\", request.tags]\n )\n },\n marshalling_gen.unmarshalListLbsResponse\n );\n /**\n * List load balancers.\n *\n * @param request - The request {@link ListLbsRequest}\n * @returns A Promise of ListLbsResponse\n */\n listLbs = (request = {}) => resourcePaginator.enrichForPagination(\"lbs\", this.pageOfListLbs, request);\n /**\n * Create a load balancer.\n *\n * @param request - The request {@link CreateLbRequest}\n * @returns A Promise of Lb\n */\n createLb = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateLbRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/lb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/lbs`\n },\n marshalling_gen.unmarshalLb\n );\n /**\n * Get a load balancer.\n *\n * @param request - The request {@link GetLbRequest}\n * @returns A Promise of Lb\n */\n getLb = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/lb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/lbs/${marshalling.validatePathParam(\"lbId\", request.lbId)}`\n },\n marshalling_gen.unmarshalLb\n );\n /**\n * Waits for {@link Lb} to be in a final state.\n *\n * @param request - The request {@link GetLbRequest}\n * @param options - The waiting options\n * @returns A Promise of Lb\n */\n waitForLb = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(!content_gen.LB_TRANSIENT_STATUSES.includes(res.status))),\n this.getLb,\n request,\n options\n );\n /**\n * Update a load balancer.\n *\n * @param request - The request {@link UpdateLbRequest}\n * @returns A Promise of Lb\n */\n updateLb = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateLbRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PUT\",\n path: `/lb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/lbs/${marshalling.validatePathParam(\"lbId\", request.lbId)}`\n },\n marshalling_gen.unmarshalLb\n );\n /**\n * Delete a load balancer.\n *\n * @param request - The request {@link DeleteLbRequest}\n */\n deleteLb = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/lb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/lbs/${marshalling.validatePathParam(\"lbId\", request.lbId)}`,\n urlParams: marshalling.urlParams([\"release_ip\", request.releaseIp])\n });\n /**\n * Migrate a load balancer.\n *\n * @param request - The request {@link MigrateLbRequest}\n * @returns A Promise of Lb\n */\n migrateLb = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalMigrateLbRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/lb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/lbs/${marshalling.validatePathParam(\"lbId\", request.lbId)}/migrate`\n },\n marshalling_gen.unmarshalLb\n );\n pageOfListIPs = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/lb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/ips`,\n urlParams: marshalling.urlParams(\n [\"ip_address\", request.ipAddress],\n [\"ip_type\", request.ipType],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId],\n [\"tags\", request.tags]\n )\n },\n marshalling_gen.unmarshalListIpsResponse\n );\n /**\n * List IPs.\n *\n * @param request - The request {@link ListIPsRequest}\n * @returns A Promise of ListIpsResponse\n */\n listIPs = (request = {}) => resourcePaginator.enrichForPagination(\"ips\", this.pageOfListIPs, request);\n /**\n * Create an IP.\n *\n * @param request - The request {@link CreateIpRequest}\n * @returns A Promise of Ip\n */\n createIp = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateIpRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/lb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/ips`\n },\n marshalling_gen.unmarshalIp\n );\n /**\n * Get an IP.\n *\n * @param request - The request {@link GetIpRequest}\n * @returns A Promise of Ip\n */\n getIp = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/lb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/ips/${marshalling.validatePathParam(\"ipId\", request.ipId)}`\n },\n marshalling_gen.unmarshalIp\n );\n /**\n * Delete an IP.\n *\n * @param request - The request {@link ReleaseIpRequest}\n */\n releaseIp = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/lb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/ips/${marshalling.validatePathParam(\"ipId\", request.ipId)}`\n });\n /**\n * Update an IP.\n *\n * @param request - The request {@link UpdateIpRequest}\n * @returns A Promise of Ip\n */\n updateIp = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateIpRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/lb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/ips/${marshalling.validatePathParam(\"ipId\", request.ipId)}`\n },\n marshalling_gen.unmarshalIp\n );\n pageOfListBackends = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/lb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/lbs/${marshalling.validatePathParam(\"lbId\", request.lbId)}/backends`,\n urlParams: marshalling.urlParams(\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListBackendsResponse\n );\n /**\n * List backends in a given load balancer.\n *\n * @param request - The request {@link ListBackendsRequest}\n * @returns A Promise of ListBackendsResponse\n */\n listBackends = (request) => resourcePaginator.enrichForPagination(\"backends\", this.pageOfListBackends, request);\n /**\n * Create a backend in a given load balancer.\n *\n * @param request - The request {@link CreateBackendRequest}\n * @returns A Promise of Backend\n */\n createBackend = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateBackendRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/lb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/lbs/${marshalling.validatePathParam(\"lbId\", request.lbId)}/backends`\n },\n marshalling_gen.unmarshalBackend\n );\n /**\n * Get a backend in a given load balancer.\n *\n * @param request - The request {@link GetBackendRequest}\n * @returns A Promise of Backend\n */\n getBackend = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/lb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/backends/${marshalling.validatePathParam(\"backendId\", request.backendId)}`\n },\n marshalling_gen.unmarshalBackend\n );\n /**\n * Update a backend in a given load balancer.\n *\n * @param request - The request {@link UpdateBackendRequest}\n * @returns A Promise of Backend\n */\n updateBackend = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateBackendRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PUT\",\n path: `/lb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/backends/${marshalling.validatePathParam(\"backendId\", request.backendId)}`\n },\n marshalling_gen.unmarshalBackend\n );\n /**\n * Delete a backend in a given load balancer.\n *\n * @param request - The request {@link DeleteBackendRequest}\n */\n deleteBackend = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/lb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/backends/${marshalling.validatePathParam(\"backendId\", request.backendId)}`\n });\n /**\n * Add a set of servers in a given backend.\n *\n * @param request - The request {@link AddBackendServersRequest}\n * @returns A Promise of Backend\n */\n addBackendServers = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalAddBackendServersRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/lb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/backends/${marshalling.validatePathParam(\"backendId\", request.backendId)}/servers`\n },\n marshalling_gen.unmarshalBackend\n );\n /**\n * Remove a set of servers for a given backend.\n *\n * @param request - The request {@link RemoveBackendServersRequest}\n * @returns A Promise of Backend\n */\n removeBackendServers = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalRemoveBackendServersRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"DELETE\",\n path: `/lb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/backends/${marshalling.validatePathParam(\"backendId\", request.backendId)}/servers`\n },\n marshalling_gen.unmarshalBackend\n );\n /**\n * Define all servers in a given backend.\n *\n * @param request - The request {@link SetBackendServersRequest}\n * @returns A Promise of Backend\n */\n setBackendServers = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalSetBackendServersRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PUT\",\n path: `/lb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/backends/${marshalling.validatePathParam(\"backendId\", request.backendId)}/servers`\n },\n marshalling_gen.unmarshalBackend\n );\n /**\n * Update an health check for a given backend.\n *\n * @param request - The request {@link UpdateHealthCheckRequest}\n * @returns A Promise of HealthCheck\n */\n updateHealthCheck = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateHealthCheckRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PUT\",\n path: `/lb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/backends/${marshalling.validatePathParam(\"backendId\", request.backendId)}/healthcheck`\n },\n marshalling_gen.unmarshalHealthCheck\n );\n pageOfListFrontends = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/lb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/lbs/${marshalling.validatePathParam(\"lbId\", request.lbId)}/frontends`,\n urlParams: marshalling.urlParams(\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListFrontendsResponse\n );\n /**\n * List frontends in a given load balancer.\n *\n * @param request - The request {@link ListFrontendsRequest}\n * @returns A Promise of ListFrontendsResponse\n */\n listFrontends = (request) => resourcePaginator.enrichForPagination(\"frontends\", this.pageOfListFrontends, request);\n /**\n * Create a frontend in a given load balancer.\n *\n * @param request - The request {@link CreateFrontendRequest}\n * @returns A Promise of Frontend\n */\n createFrontend = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateFrontendRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/lb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/lbs/${marshalling.validatePathParam(\"lbId\", request.lbId)}/frontends`\n },\n marshalling_gen.unmarshalFrontend\n );\n /**\n * Get a frontend.\n *\n * @param request - The request {@link GetFrontendRequest}\n * @returns A Promise of Frontend\n */\n getFrontend = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/lb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/frontends/${marshalling.validatePathParam(\"frontendId\", request.frontendId)}`\n },\n marshalling_gen.unmarshalFrontend\n );\n /**\n * Update a frontend.\n *\n * @param request - The request {@link UpdateFrontendRequest}\n * @returns A Promise of Frontend\n */\n updateFrontend = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateFrontendRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PUT\",\n path: `/lb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/frontends/${marshalling.validatePathParam(\"frontendId\", request.frontendId)}`\n },\n marshalling_gen.unmarshalFrontend\n );\n /**\n * Delete a frontend.\n *\n * @param request - The request {@link DeleteFrontendRequest}\n */\n deleteFrontend = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/lb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/frontends/${marshalling.validatePathParam(\"frontendId\", request.frontendId)}`\n });\n pageOfListRoutes = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/lb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/routes`,\n urlParams: marshalling.urlParams(\n [\"frontend_id\", request.frontendId],\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListRoutesResponse\n );\n /**\n * List all backend redirections.\n *\n * @param request - The request {@link ListRoutesRequest}\n * @returns A Promise of ListRoutesResponse\n */\n listRoutes = (request = {}) => resourcePaginator.enrichForPagination(\"routes\", this.pageOfListRoutes, request);\n /**\n * Create a backend redirection.\n *\n * @param request - The request {@link CreateRouteRequest}\n * @returns A Promise of Route\n */\n createRoute = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateRouteRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/lb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/routes`\n },\n marshalling_gen.unmarshalRoute\n );\n /**\n * Get single backend redirection.\n *\n * @param request - The request {@link GetRouteRequest}\n * @returns A Promise of Route\n */\n getRoute = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/lb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/routes/${marshalling.validatePathParam(\"routeId\", request.routeId)}`\n },\n marshalling_gen.unmarshalRoute\n );\n /**\n * Edit a backend redirection.\n *\n * @param request - The request {@link UpdateRouteRequest}\n * @returns A Promise of Route\n */\n updateRoute = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateRouteRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PUT\",\n path: `/lb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/routes/${marshalling.validatePathParam(\"routeId\", request.routeId)}`\n },\n marshalling_gen.unmarshalRoute\n );\n /**\n * Delete a backend redirection.\n *\n * @param request - The request {@link DeleteRouteRequest}\n */\n deleteRoute = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/lb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/routes/${marshalling.validatePathParam(\"routeId\", request.routeId)}`\n });\n /**\n * Get usage statistics of a given load balancer.\n *\n * @deprecated\n * @param request - The request {@link GetLbStatsRequest}\n * @returns A Promise of LbStats\n */\n getLbStats = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/lb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/lbs/${marshalling.validatePathParam(\"lbId\", request.lbId)}/stats`,\n urlParams: marshalling.urlParams([\"backend_id\", request.backendId])\n },\n marshalling_gen.unmarshalLbStats\n );\n pageOfListBackendStats = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/lb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/lbs/${marshalling.validatePathParam(\"lbId\", request.lbId)}/backend-stats`,\n urlParams: marshalling.urlParams(\n [\"backend_id\", request.backendId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListBackendStatsResponse\n );\n /**\n * List backend server statistics.\n *\n * @param request - The request {@link ListBackendStatsRequest}\n * @returns A Promise of ListBackendStatsResponse\n */\n listBackendStats = (request) => resourcePaginator.enrichForPagination(\n \"backendServersStats\",\n this.pageOfListBackendStats,\n request\n );\n pageOfListAcls = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/lb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/frontends/${marshalling.validatePathParam(\"frontendId\", request.frontendId)}/acls`,\n urlParams: marshalling.urlParams(\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListAclResponse\n );\n /**\n * List ACL for a given frontend.\n *\n * @param request - The request {@link ListAclsRequest}\n * @returns A Promise of ListAclResponse\n */\n listAcls = (request) => resourcePaginator.enrichForPagination(\"acls\", this.pageOfListAcls, request);\n /**\n * Create an ACL for a given frontend.\n *\n * @param request - The request {@link CreateAclRequest}\n * @returns A Promise of Acl\n */\n createAcl = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateAclRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/lb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/frontends/${marshalling.validatePathParam(\"frontendId\", request.frontendId)}/acls`\n },\n marshalling_gen.unmarshalAcl\n );\n /**\n * Get an ACL.\n *\n * @param request - The request {@link GetAclRequest}\n * @returns A Promise of Acl\n */\n getAcl = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/lb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/acls/${marshalling.validatePathParam(\"aclId\", request.aclId)}`\n },\n marshalling_gen.unmarshalAcl\n );\n /**\n * Update an ACL.\n *\n * @param request - The request {@link UpdateAclRequest}\n * @returns A Promise of Acl\n */\n updateAcl = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateAclRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PUT\",\n path: `/lb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/acls/${marshalling.validatePathParam(\"aclId\", request.aclId)}`\n },\n marshalling_gen.unmarshalAcl\n );\n /**\n * Delete an ACL.\n *\n * @param request - The request {@link DeleteAclRequest}\n */\n deleteAcl = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/lb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/acls/${marshalling.validatePathParam(\"aclId\", request.aclId)}`\n });\n /**\n * Create a TLS certificate. Generate a new TLS certificate using Let's\n * Encrypt or import your certificate.\n *\n * @param request - The request {@link CreateCertificateRequest}\n * @returns A Promise of Certificate\n */\n createCertificate = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateCertificateRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/lb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/lbs/${marshalling.validatePathParam(\"lbId\", request.lbId)}/certificates`\n },\n marshalling_gen.unmarshalCertificate\n );\n pageOfListCertificates = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/lb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/lbs/${marshalling.validatePathParam(\"lbId\", request.lbId)}/certificates`,\n urlParams: marshalling.urlParams(\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListCertificatesResponse\n );\n /**\n * List all TLS certificates on a given load balancer.\n *\n * @param request - The request {@link ListCertificatesRequest}\n * @returns A Promise of ListCertificatesResponse\n */\n listCertificates = (request) => resourcePaginator.enrichForPagination(\"certificates\", this.pageOfListCertificates, request);\n /**\n * Get a TLS certificate.\n *\n * @param request - The request {@link GetCertificateRequest}\n * @returns A Promise of Certificate\n */\n getCertificate = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/lb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/certificates/${marshalling.validatePathParam(\"certificateId\", request.certificateId)}`\n },\n marshalling_gen.unmarshalCertificate\n );\n /**\n * Waits for {@link Certificate} to be in a final state.\n *\n * @param request - The request {@link GetCertificateRequest}\n * @param options - The waiting options\n * @returns A Promise of Certificate\n */\n waitForCertificate = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(\n !content_gen.CERTIFICATE_TRANSIENT_STATUSES.includes(res.status)\n )),\n this.getCertificate,\n request,\n options\n );\n /**\n * Update a TLS certificate.\n *\n * @param request - The request {@link UpdateCertificateRequest}\n * @returns A Promise of Certificate\n */\n updateCertificate = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateCertificateRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PUT\",\n path: `/lb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/certificates/${marshalling.validatePathParam(\"certificateId\", request.certificateId)}`\n },\n marshalling_gen.unmarshalCertificate\n );\n /**\n * Delete a TLS certificate.\n *\n * @param request - The request {@link DeleteCertificateRequest}\n */\n deleteCertificate = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/lb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/certificates/${marshalling.validatePathParam(\"certificateId\", request.certificateId)}`\n });\n pageOfListLbTypes = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/lb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/lb-types`,\n urlParams: marshalling.urlParams(\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListLbTypesResponse\n );\n /**\n * List all load balancer offer type.\n *\n * @param request - The request {@link ListLbTypesRequest}\n * @returns A Promise of ListLbTypesResponse\n */\n listLbTypes = (request = {}) => resourcePaginator.enrichForPagination(\"lbTypes\", this.pageOfListLbTypes, request);\n /**\n * Create a subscriber, webhook or email.\n *\n * @param request - The request {@link CreateSubscriberRequest}\n * @returns A Promise of Subscriber\n */\n createSubscriber = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateSubscriberRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/lb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/subscribers`\n },\n marshalling_gen.unmarshalSubscriber\n );\n /**\n * Get a subscriber.\n *\n * @param request - The request {@link GetSubscriberRequest}\n * @returns A Promise of Subscriber\n */\n getSubscriber = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/lb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/subscribers/${marshalling.validatePathParam(\"subscriberId\", request.subscriberId)}`\n },\n marshalling_gen.unmarshalSubscriber\n );\n pageOfListSubscriber = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/lb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/subscribers`,\n urlParams: marshalling.urlParams(\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId]\n )\n },\n marshalling_gen.unmarshalListSubscriberResponse\n );\n /**\n * List all subscriber.\n *\n * @param request - The request {@link ListSubscriberRequest}\n * @returns A Promise of ListSubscriberResponse\n */\n listSubscriber = (request = {}) => resourcePaginator.enrichForPagination(\"subscribers\", this.pageOfListSubscriber, request);\n /**\n * Update a subscriber.\n *\n * @param request - The request {@link UpdateSubscriberRequest}\n * @returns A Promise of Subscriber\n */\n updateSubscriber = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateSubscriberRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PUT\",\n path: `/lb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/subscribers/${marshalling.validatePathParam(\"subscriberId\", request.subscriberId)}`\n },\n marshalling_gen.unmarshalSubscriber\n );\n /**\n * Delete a subscriber.\n *\n * @param request - The request {@link DeleteSubscriberRequest}\n */\n deleteSubscriber = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/lb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/lb/subscriber/${marshalling.validatePathParam(\"subscriberId\", request.subscriberId)}`\n });\n /**\n * Subscribe a subscriber to a given load balancer.\n *\n * @param request - The request {@link SubscribeToLbRequest}\n * @returns A Promise of Lb\n */\n subscribeToLb = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalSubscribeToLbRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/lb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/lb/${marshalling.validatePathParam(\"lbId\", request.lbId)}/subscribe`\n },\n marshalling_gen.unmarshalLb\n );\n /**\n * Unsubscribe a subscriber from a given load balancer.\n *\n * @param request - The request {@link UnsubscribeFromLbRequest}\n * @returns A Promise of Lb\n */\n unsubscribeFromLb = (request) => this.client.fetch(\n {\n method: \"DELETE\",\n path: `/lb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/lb/${marshalling.validatePathParam(\"lbId\", request.lbId)}/unsubscribe`\n },\n marshalling_gen.unmarshalLb\n );\n pageOfListLbPrivateNetworks = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/lb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/lbs/${marshalling.validatePathParam(\"lbId\", request.lbId)}/private-networks`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListLbPrivateNetworksResponse\n );\n /**\n * List attached private network of load balancer.\n *\n * @param request - The request {@link ListLbPrivateNetworksRequest}\n * @returns A Promise of ListLbPrivateNetworksResponse\n */\n listLbPrivateNetworks = (request) => resourcePaginator.enrichForPagination(\n \"privateNetwork\",\n this.pageOfListLbPrivateNetworks,\n request\n );\n /**\n * Add load balancer on instance private network.\n *\n * @param request - The request {@link AttachPrivateNetworkRequest}\n * @returns A Promise of PrivateNetwork\n */\n attachPrivateNetwork = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalAttachPrivateNetworkRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/lb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/lbs/${marshalling.validatePathParam(\"lbId\", request.lbId)}/private-networks/${marshalling.validatePathParam(\"privateNetworkId\", request.privateNetworkId)}/attach`\n },\n marshalling_gen.unmarshalPrivateNetwork\n );\n /**\n * Remove load balancer of private network.\n *\n * @param request - The request {@link DetachPrivateNetworkRequest}\n */\n detachPrivateNetwork = (request) => this.client.fetch({\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/lb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/lbs/${marshalling.validatePathParam(\"lbId\", request.lbId)}/private-networks/${marshalling.validatePathParam(\"privateNetworkId\", request.privateNetworkId)}/detach`\n });\n}\nexports.API = API;\nexports.ZonedAPI = ZonedAPI;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst intervalRetrier = require(\"../../../internal/async/interval-retrier.cjs\");\nconst api_gen = require(\"./api.gen.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nclass LbV1UtilsAPI extends api_gen.API {\n /**\n * Waits for all private networks of a load balancer to be in a final state.\n *\n * @param request - The request {@link WaitForLbPrivateNetworksRequest}\n * @param options - The waiting options\n * @returns A Promise of ListLbPrivateNetworksResponse\n */\n waitForLbPrivateNetworks = (request, options) => intervalRetrier.tryAtIntervals(\n async () => {\n const value = await this.listLbPrivateNetworks({\n lbId: request.lbId,\n region: request.region\n }).all().then((list) => ({\n privateNetwork: list,\n totalCount: list.length\n }));\n return {\n done: value.privateNetwork.find(\n (elt) => content_gen.PRIVATE_NETWORK_TRANSIENT_STATUSES.includes(elt.status)\n ) === void 0,\n value\n };\n },\n intervalRetrier.createExponentialBackoffStrategy(\n options?.minDelay ?? 1,\n options?.maxDelay ?? 30\n ),\n options?.timeout\n );\n /**\n * Waits for all instances of a load balancer to be in a final state.\n *\n * @param request - The request {@link GetLbRequest}\n * @param options - The waiting options\n * @returns A Promise of Lb\n */\n waitForLbInstances = (request, options) => intervalRetrier.tryAtIntervals(\n async () => {\n const value = await this.getLb(request);\n return {\n done: !content_gen.LB_TRANSIENT_STATUSES.includes(value.status) && value.instances.find(\n (elt) => content_gen.INSTANCE_TRANSIENT_STATUSES.includes(elt.status)\n ) === void 0,\n value\n };\n },\n intervalRetrier.createExponentialBackoffStrategy(\n options?.minDelay ?? 1,\n options?.maxDelay ?? 30\n ),\n options?.timeout\n );\n}\nclass LbZonedV1UtilsAPI extends api_gen.ZonedAPI {\n /**\n * Waits for all private networks of a (zoned) load balancer to be in a final\n * state.\n *\n * @param request - The request {@link ZonedWaitForLbPrivateNetworksRequest}\n * @param options - The waiting options\n * @returns A Promise of ListLbPrivateNetworksResponse\n */\n waitForLbPrivateNetworks = (request, options) => intervalRetrier.tryAtIntervals(\n async () => {\n const value = await this.listLbPrivateNetworks({\n lbId: request.lbId,\n zone: request.zone\n }).all().then((list) => ({\n privateNetwork: list,\n totalCount: list.length\n }));\n return {\n done: value.privateNetwork.find(\n (elt) => content_gen.PRIVATE_NETWORK_TRANSIENT_STATUSES.includes(elt.status)\n ) === void 0,\n value\n };\n },\n intervalRetrier.createExponentialBackoffStrategy(\n options?.minDelay ?? 1,\n options?.maxDelay ?? 30\n ),\n options?.timeout\n );\n /**\n * Waits for all instances of a (zoned) load balancer to be in a final state.\n *\n * @param request - The request {@link GetLbRequest}\n * @param options - The waiting options\n * @returns A Promise of Lb\n */\n waitForLbInstances = (request, options) => intervalRetrier.tryAtIntervals(\n async () => {\n const value = await this.getLb(request);\n return {\n done: !content_gen.LB_TRANSIENT_STATUSES.includes(value.status) && value.instances.find(\n (elt) => content_gen.INSTANCE_TRANSIENT_STATUSES.includes(elt.status)\n ) === void 0,\n value\n };\n },\n intervalRetrier.createExponentialBackoffStrategy(\n options?.minDelay ?? 1,\n options?.maxDelay ?? 30\n ),\n options?.timeout\n );\n}\nexports.LbV1UtilsAPI = LbV1UtilsAPI;\nexports.LbZonedV1UtilsAPI = LbZonedV1UtilsAPI;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst CERTIFICATE_TRANSIENT_STATUSES = [\"pending\"];\nconst INSTANCE_TRANSIENT_STATUSES = [\n \"pending\",\n \"migrating\"\n];\nconst LB_TRANSIENT_STATUSES = [\n \"pending\",\n \"migrating\",\n \"to_create\",\n \"creating\",\n \"to_delete\",\n \"deleting\"\n];\nconst PRIVATE_NETWORK_TRANSIENT_STATUSES = [\n \"pending\"\n];\nexports.CERTIFICATE_TRANSIENT_STATUSES = CERTIFICATE_TRANSIENT_STATUSES;\nexports.INSTANCE_TRANSIENT_STATUSES = INSTANCE_TRANSIENT_STATUSES;\nexports.LB_TRANSIENT_STATUSES = LB_TRANSIENT_STATUSES;\nexports.PRIVATE_NETWORK_TRANSIENT_STATUSES = PRIVATE_NETWORK_TRANSIENT_STATUSES;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api_utils = require(\"./api.utils.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nexports.API = api_utils.LbV1UtilsAPI;\nexports.ZonedAPI = api_utils.LbZonedV1UtilsAPI;\nexports.CERTIFICATE_TRANSIENT_STATUSES = content_gen.CERTIFICATE_TRANSIENT_STATUSES;\nexports.INSTANCE_TRANSIENT_STATUSES = content_gen.INSTANCE_TRANSIENT_STATUSES;\nexports.LB_TRANSIENT_STATUSES = content_gen.LB_TRANSIENT_STATUSES;\nexports.PRIVATE_NETWORK_TRANSIENT_STATUSES = content_gen.PRIVATE_NETWORK_TRANSIENT_STATUSES;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst randomName = require(\"@scaleway/random-name\");\nconst json = require(\"../../../helpers/json.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst unmarshalIp = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Ip' failed as data isn't a dictionary.`\n );\n }\n return {\n id: data.id,\n ipAddress: data.ip_address,\n lbId: data.lb_id,\n organizationId: data.organization_id,\n projectId: data.project_id,\n region: data.region,\n reverse: data.reverse,\n tags: data.tags,\n zone: data.zone\n };\n};\nconst unmarshalSubscriberEmailConfig = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SubscriberEmailConfig' failed as data isn't a dictionary.`\n );\n }\n return {\n email: data.email\n };\n};\nconst unmarshalSubscriberWebhookConfig = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SubscriberWebhookConfig' failed as data isn't a dictionary.`\n );\n }\n return {\n uri: data.uri\n };\n};\nconst unmarshalSubscriber = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Subscriber' failed as data isn't a dictionary.`\n );\n }\n return {\n emailConfig: data.email_config ? unmarshalSubscriberEmailConfig(data.email_config) : void 0,\n id: data.id,\n name: data.name,\n webhookConfig: data.webhook_config ? unmarshalSubscriberWebhookConfig(data.webhook_config) : void 0\n };\n};\nconst unmarshalHealthCheckHttpConfig = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'HealthCheckHttpConfig' failed as data isn't a dictionary.`\n );\n }\n return {\n code: data.code,\n hostHeader: data.host_header,\n method: data.method,\n uri: data.uri\n };\n};\nconst unmarshalHealthCheckHttpsConfig = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'HealthCheckHttpsConfig' failed as data isn't a dictionary.`\n );\n }\n return {\n code: data.code,\n hostHeader: data.host_header,\n method: data.method,\n sni: data.sni,\n uri: data.uri\n };\n};\nconst unmarshalHealthCheckLdapConfig = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'HealthCheckLdapConfig' failed as data isn't a dictionary.`\n );\n }\n return {};\n};\nconst unmarshalHealthCheckMysqlConfig = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'HealthCheckMysqlConfig' failed as data isn't a dictionary.`\n );\n }\n return {\n user: data.user\n };\n};\nconst unmarshalHealthCheckPgsqlConfig = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'HealthCheckPgsqlConfig' failed as data isn't a dictionary.`\n );\n }\n return {\n user: data.user\n };\n};\nconst unmarshalHealthCheckRedisConfig = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'HealthCheckRedisConfig' failed as data isn't a dictionary.`\n );\n }\n return {};\n};\nconst unmarshalHealthCheckTcpConfig = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'HealthCheckTcpConfig' failed as data isn't a dictionary.`\n );\n }\n return {};\n};\nconst unmarshalHealthCheck = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'HealthCheck' failed as data isn't a dictionary.`\n );\n }\n return {\n checkDelay: data.check_delay,\n checkMaxRetries: data.check_max_retries,\n checkSendProxy: data.check_send_proxy,\n checkTimeout: data.check_timeout,\n httpConfig: data.http_config ? unmarshalHealthCheckHttpConfig(data.http_config) : void 0,\n httpsConfig: data.https_config ? unmarshalHealthCheckHttpsConfig(data.https_config) : void 0,\n ldapConfig: data.ldap_config ? unmarshalHealthCheckLdapConfig(data.ldap_config) : void 0,\n mysqlConfig: data.mysql_config ? unmarshalHealthCheckMysqlConfig(data.mysql_config) : void 0,\n pgsqlConfig: data.pgsql_config ? unmarshalHealthCheckPgsqlConfig(data.pgsql_config) : void 0,\n port: data.port,\n redisConfig: data.redis_config ? unmarshalHealthCheckRedisConfig(data.redis_config) : void 0,\n tcpConfig: data.tcp_config ? unmarshalHealthCheckTcpConfig(data.tcp_config) : void 0,\n transientCheckDelay: data.transient_check_delay\n };\n};\nconst unmarshalInstance = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Instance' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n id: data.id,\n ipAddress: data.ip_address,\n region: data.region,\n status: data.status,\n updatedAt: marshalling.unmarshalDate(data.updated_at),\n zone: data.zone\n };\n};\nconst unmarshalLb = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Lb' failed as data isn't a dictionary.`\n );\n }\n return {\n backendCount: data.backend_count,\n createdAt: marshalling.unmarshalDate(data.created_at),\n description: data.description,\n frontendCount: data.frontend_count,\n id: data.id,\n instances: marshalling.unmarshalArrayOfObject(data.instances, unmarshalInstance),\n ip: marshalling.unmarshalArrayOfObject(data.ip, unmarshalIp),\n name: data.name,\n organizationId: data.organization_id,\n privateNetworkCount: data.private_network_count,\n projectId: data.project_id,\n region: data.region,\n routeCount: data.route_count,\n sslCompatibilityLevel: data.ssl_compatibility_level,\n status: data.status,\n subscriber: data.subscriber ? unmarshalSubscriber(data.subscriber) : void 0,\n tags: data.tags,\n type: data.type,\n updatedAt: marshalling.unmarshalDate(data.updated_at),\n zone: data.zone\n };\n};\nconst unmarshalBackend = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Backend' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n failoverHost: data.failover_host,\n forwardPort: data.forward_port,\n forwardPortAlgorithm: data.forward_port_algorithm,\n forwardProtocol: data.forward_protocol,\n healthCheck: data.health_check ? unmarshalHealthCheck(data.health_check) : void 0,\n id: data.id,\n ignoreSslServerVerify: data.ignore_ssl_server_verify,\n lb: data.lb ? unmarshalLb(data.lb) : void 0,\n maxConnections: data.max_connections,\n maxRetries: data.max_retries,\n name: data.name,\n onMarkedDownAction: data.on_marked_down_action,\n pool: data.pool,\n proxyProtocol: data.proxy_protocol,\n redispatchAttemptCount: data.redispatch_attempt_count,\n sendProxyV2: data.send_proxy_v2,\n sslBridging: data.ssl_bridging,\n stickySessions: data.sticky_sessions,\n stickySessionsCookieName: data.sticky_sessions_cookie_name,\n timeoutConnect: data.timeout_connect,\n timeoutQueue: data.timeout_queue,\n timeoutServer: data.timeout_server,\n timeoutTunnel: data.timeout_tunnel,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalCertificate = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Certificate' failed as data isn't a dictionary.`\n );\n }\n return {\n commonName: data.common_name,\n createdAt: marshalling.unmarshalDate(data.created_at),\n fingerprint: data.fingerprint,\n id: data.id,\n lb: data.lb ? unmarshalLb(data.lb) : void 0,\n name: data.name,\n notValidAfter: marshalling.unmarshalDate(data.not_valid_after),\n notValidBefore: marshalling.unmarshalDate(data.not_valid_before),\n status: data.status,\n statusDetails: data.status_details,\n subjectAlternativeName: data.subject_alternative_name,\n type: data.type,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalFrontend = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Frontend' failed as data isn't a dictionary.`\n );\n }\n return {\n backend: data.backend ? unmarshalBackend(data.backend) : void 0,\n certificate: data.certificate ? unmarshalCertificate(data.certificate) : void 0,\n certificateIds: data.certificate_ids,\n createdAt: marshalling.unmarshalDate(data.created_at),\n enableHttp3: data.enable_http3,\n id: data.id,\n inboundPort: data.inbound_port,\n lb: data.lb ? unmarshalLb(data.lb) : void 0,\n name: data.name,\n timeoutClient: data.timeout_client,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalAclActionRedirect = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'AclActionRedirect' failed as data isn't a dictionary.`\n );\n }\n return {\n code: data.code,\n target: data.target,\n type: data.type\n };\n};\nconst unmarshalAclAction = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'AclAction' failed as data isn't a dictionary.`\n );\n }\n return {\n redirect: data.redirect ? unmarshalAclActionRedirect(data.redirect) : void 0,\n type: data.type\n };\n};\nconst unmarshalAclMatch = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'AclMatch' failed as data isn't a dictionary.`\n );\n }\n return {\n httpFilter: data.http_filter,\n httpFilterOption: data.http_filter_option,\n httpFilterValue: data.http_filter_value,\n invert: data.invert,\n ipSubnet: data.ip_subnet\n };\n};\nconst unmarshalAcl = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Acl' failed as data isn't a dictionary.`\n );\n }\n return {\n action: data.action ? unmarshalAclAction(data.action) : void 0,\n createdAt: marshalling.unmarshalDate(data.created_at),\n description: data.description,\n frontend: data.frontend ? unmarshalFrontend(data.frontend) : void 0,\n id: data.id,\n index: data.index,\n match: data.match ? unmarshalAclMatch(data.match) : void 0,\n name: data.name,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalPrivateNetworkDHCPConfig = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'PrivateNetworkDHCPConfig' failed as data isn't a dictionary.`\n );\n }\n return {\n ipId: data.ip_id\n };\n};\nconst unmarshalPrivateNetworkIpamConfig = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'PrivateNetworkIpamConfig' failed as data isn't a dictionary.`\n );\n }\n return {};\n};\nconst unmarshalPrivateNetworkStaticConfig = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'PrivateNetworkStaticConfig' failed as data isn't a dictionary.`\n );\n }\n return {\n ipAddress: data.ip_address ? data.ip_address : void 0\n };\n};\nconst unmarshalPrivateNetwork = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'PrivateNetwork' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n dhcpConfig: data.dhcp_config ? unmarshalPrivateNetworkDHCPConfig(data.dhcp_config) : void 0,\n ipamConfig: data.ipam_config ? unmarshalPrivateNetworkIpamConfig(data.ipam_config) : void 0,\n ipamIds: data.ipam_ids,\n lb: data.lb ? unmarshalLb(data.lb) : void 0,\n privateNetworkId: data.private_network_id,\n staticConfig: data.static_config ? unmarshalPrivateNetworkStaticConfig(data.static_config) : void 0,\n status: data.status,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalRouteMatch = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'RouteMatch' failed as data isn't a dictionary.`\n );\n }\n return {\n hostHeader: data.host_header,\n sni: data.sni\n };\n};\nconst unmarshalRoute = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Route' failed as data isn't a dictionary.`\n );\n }\n return {\n backendId: data.backend_id,\n createdAt: marshalling.unmarshalDate(data.created_at),\n frontendId: data.frontend_id,\n id: data.id,\n match: data.match ? unmarshalRouteMatch(data.match) : void 0,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalBackendServerStats = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'BackendServerStats' failed as data isn't a dictionary.`\n );\n }\n return {\n backendId: data.backend_id,\n instanceId: data.instance_id,\n ip: data.ip,\n lastHealthCheckStatus: data.last_health_check_status,\n serverState: data.server_state,\n serverStateChangedAt: marshalling.unmarshalDate(data.server_state_changed_at)\n };\n};\nconst unmarshalLbStats = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'LbStats' failed as data isn't a dictionary.`\n );\n }\n return {\n backendServersStats: marshalling.unmarshalArrayOfObject(\n data.backend_servers_stats,\n unmarshalBackendServerStats\n )\n };\n};\nconst unmarshalListAclResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListAclResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n acls: marshalling.unmarshalArrayOfObject(data.acls, unmarshalAcl),\n totalCount: data.total_count\n };\n};\nconst unmarshalListBackendStatsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListBackendStatsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n backendServersStats: marshalling.unmarshalArrayOfObject(\n data.backend_servers_stats,\n unmarshalBackendServerStats\n ),\n totalCount: data.total_count\n };\n};\nconst unmarshalListBackendsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListBackendsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n backends: marshalling.unmarshalArrayOfObject(data.backends, unmarshalBackend),\n totalCount: data.total_count\n };\n};\nconst unmarshalListCertificatesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListCertificatesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n certificates: marshalling.unmarshalArrayOfObject(\n data.certificates,\n unmarshalCertificate\n ),\n totalCount: data.total_count\n };\n};\nconst unmarshalListFrontendsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListFrontendsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n frontends: marshalling.unmarshalArrayOfObject(data.frontends, unmarshalFrontend),\n totalCount: data.total_count\n };\n};\nconst unmarshalListIpsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListIpsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n ips: marshalling.unmarshalArrayOfObject(data.ips, unmarshalIp),\n totalCount: data.total_count\n };\n};\nconst unmarshalListLbPrivateNetworksResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListLbPrivateNetworksResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n privateNetwork: marshalling.unmarshalArrayOfObject(\n data.private_network,\n unmarshalPrivateNetwork\n ),\n totalCount: data.total_count\n };\n};\nconst unmarshalLbType = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'LbType' failed as data isn't a dictionary.`\n );\n }\n return {\n description: data.description,\n name: data.name,\n region: data.region,\n stockStatus: data.stock_status,\n zone: data.zone\n };\n};\nconst unmarshalListLbTypesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListLbTypesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n lbTypes: marshalling.unmarshalArrayOfObject(data.lb_types, unmarshalLbType),\n totalCount: data.total_count\n };\n};\nconst unmarshalListLbsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListLbsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n lbs: marshalling.unmarshalArrayOfObject(data.lbs, unmarshalLb),\n totalCount: data.total_count\n };\n};\nconst unmarshalListRoutesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListRoutesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n routes: marshalling.unmarshalArrayOfObject(data.routes, unmarshalRoute),\n totalCount: data.total_count\n };\n};\nconst unmarshalListSubscriberResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListSubscriberResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n subscribers: marshalling.unmarshalArrayOfObject(data.subscribers, unmarshalSubscriber),\n totalCount: data.total_count\n };\n};\nconst unmarshalSetAclsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SetAclsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n acls: marshalling.unmarshalArrayOfObject(data.acls, unmarshalAcl),\n totalCount: data.total_count\n };\n};\nconst marshalAddBackendServersRequest = (request, defaults) => ({\n server_ip: request.serverIp\n});\nconst marshalPrivateNetworkDHCPConfig = (request, defaults) => ({\n ip_id: request.ipId\n});\nconst marshalPrivateNetworkIpamConfig = (request, defaults) => ({});\nconst marshalPrivateNetworkStaticConfig = (request, defaults) => ({\n ip_address: request.ipAddress\n});\nconst marshalAttachPrivateNetworkRequest = (request, defaults) => ({\n ipam_ids: request.ipamIds,\n ...marshalling.resolveOneOf([\n {\n param: \"static_config\",\n value: request.staticConfig !== void 0 ? marshalPrivateNetworkStaticConfig(request.staticConfig) : void 0\n },\n {\n param: \"dhcp_config\",\n value: request.dhcpConfig !== void 0 ? marshalPrivateNetworkDHCPConfig(request.dhcpConfig) : void 0\n },\n {\n param: \"ipam_config\",\n value: request.ipamConfig !== void 0 ? marshalPrivateNetworkIpamConfig(request.ipamConfig) : void 0\n }\n ])\n});\nconst marshalAclActionRedirect = (request, defaults) => ({\n code: request.code,\n target: request.target,\n type: request.type\n});\nconst marshalAclAction = (request, defaults) => ({\n redirect: request.redirect !== void 0 ? marshalAclActionRedirect(request.redirect) : void 0,\n type: request.type\n});\nconst marshalAclMatch = (request, defaults) => ({\n http_filter: request.httpFilter,\n http_filter_option: request.httpFilterOption,\n http_filter_value: request.httpFilterValue,\n invert: request.invert,\n ip_subnet: request.ipSubnet\n});\nconst marshalCreateAclRequest = (request, defaults) => ({\n action: marshalAclAction(request.action),\n description: request.description,\n index: request.index,\n match: request.match !== void 0 ? marshalAclMatch(request.match) : void 0,\n name: request.name || randomName(\"acl\")\n});\nconst marshalHealthCheckHttpConfig = (request, defaults) => ({\n code: request.code,\n host_header: request.hostHeader,\n method: request.method,\n uri: request.uri\n});\nconst marshalHealthCheckHttpsConfig = (request, defaults) => ({\n code: request.code,\n host_header: request.hostHeader,\n method: request.method,\n sni: request.sni,\n uri: request.uri\n});\nconst marshalHealthCheckLdapConfig = (request, defaults) => ({});\nconst marshalHealthCheckMysqlConfig = (request, defaults) => ({\n user: request.user\n});\nconst marshalHealthCheckPgsqlConfig = (request, defaults) => ({\n user: request.user\n});\nconst marshalHealthCheckRedisConfig = (request, defaults) => ({});\nconst marshalHealthCheckTcpConfig = (request, defaults) => ({});\nconst marshalHealthCheck = (request, defaults) => ({\n check_delay: request.checkDelay,\n check_max_retries: request.checkMaxRetries,\n check_send_proxy: request.checkSendProxy,\n check_timeout: request.checkTimeout,\n port: request.port,\n transient_check_delay: request.transientCheckDelay,\n ...marshalling.resolveOneOf([\n {\n param: \"tcp_config\",\n value: request.tcpConfig !== void 0 ? marshalHealthCheckTcpConfig(request.tcpConfig) : void 0\n },\n {\n param: \"mysql_config\",\n value: request.mysqlConfig !== void 0 ? marshalHealthCheckMysqlConfig(request.mysqlConfig) : void 0\n },\n {\n param: \"pgsql_config\",\n value: request.pgsqlConfig !== void 0 ? marshalHealthCheckPgsqlConfig(request.pgsqlConfig) : void 0\n },\n {\n param: \"ldap_config\",\n value: request.ldapConfig !== void 0 ? marshalHealthCheckLdapConfig(request.ldapConfig) : void 0\n },\n {\n param: \"redis_config\",\n value: request.redisConfig !== void 0 ? marshalHealthCheckRedisConfig(request.redisConfig) : void 0\n },\n {\n param: \"http_config\",\n value: request.httpConfig !== void 0 ? marshalHealthCheckHttpConfig(request.httpConfig) : void 0\n },\n {\n param: \"https_config\",\n value: request.httpsConfig !== void 0 ? marshalHealthCheckHttpsConfig(request.httpsConfig) : void 0\n }\n ])\n});\nconst marshalCreateBackendRequest = (request, defaults) => ({\n failover_host: request.failoverHost,\n forward_port: request.forwardPort,\n forward_port_algorithm: request.forwardPortAlgorithm,\n forward_protocol: request.forwardProtocol,\n health_check: marshalHealthCheck(request.healthCheck),\n ignore_ssl_server_verify: request.ignoreSslServerVerify,\n max_connections: request.maxConnections,\n max_retries: request.maxRetries,\n name: request.name || randomName(\"lbb\"),\n on_marked_down_action: request.onMarkedDownAction,\n proxy_protocol: request.proxyProtocol,\n redispatch_attempt_count: request.redispatchAttemptCount,\n send_proxy_v2: request.sendProxyV2,\n server_ip: request.serverIp,\n ssl_bridging: request.sslBridging,\n sticky_sessions: request.stickySessions,\n sticky_sessions_cookie_name: request.stickySessionsCookieName,\n timeout_connect: request.timeoutConnect,\n timeout_queue: request.timeoutQueue,\n timeout_server: request.timeoutServer,\n timeout_tunnel: request.timeoutTunnel\n});\nconst marshalCreateCertificateRequestCustomCertificate = (request, defaults) => ({\n certificate_chain: request.certificateChain\n});\nconst marshalCreateCertificateRequestLetsencryptConfig = (request, defaults) => ({\n common_name: request.commonName,\n subject_alternative_name: request.subjectAlternativeName\n});\nconst marshalCreateCertificateRequest = (request, defaults) => ({\n name: request.name || randomName(\"certificate\"),\n ...marshalling.resolveOneOf([\n {\n param: \"letsencrypt\",\n value: request.letsencrypt !== void 0 ? marshalCreateCertificateRequestLetsencryptConfig(\n request.letsencrypt\n ) : void 0\n },\n {\n param: \"custom_certificate\",\n value: request.customCertificate !== void 0 ? marshalCreateCertificateRequestCustomCertificate(\n request.customCertificate\n ) : void 0\n }\n ])\n});\nconst marshalCreateFrontendRequest = (request, defaults) => ({\n backend_id: request.backendId,\n certificate_id: request.certificateId,\n certificate_ids: request.certificateIds,\n enable_http3: request.enableHttp3,\n inbound_port: request.inboundPort,\n name: request.name || randomName(\"lbf\"),\n timeout_client: request.timeoutClient\n});\nconst marshalCreateIpRequest = (request, defaults) => ({\n is_ipv6: request.isIpv6,\n reverse: request.reverse,\n tags: request.tags,\n ...marshalling.resolveOneOf([\n {\n default: defaults.defaultProjectId,\n param: \"project_id\",\n value: request.projectId\n },\n {\n default: defaults.defaultOrganizationId,\n param: \"organization_id\",\n value: request.organizationId\n }\n ])\n});\nconst marshalCreateLbRequest = (request, defaults) => ({\n assign_flexible_ip: request.assignFlexibleIp,\n assign_flexible_ipv6: request.assignFlexibleIpv6,\n description: request.description,\n ip_id: request.ipId,\n ip_ids: request.ipIds,\n name: request.name || randomName(\"lb\"),\n ssl_compatibility_level: request.sslCompatibilityLevel,\n tags: request.tags,\n type: request.type,\n ...marshalling.resolveOneOf([\n {\n default: defaults.defaultProjectId,\n param: \"project_id\",\n value: request.projectId\n },\n {\n default: defaults.defaultOrganizationId,\n param: \"organization_id\",\n value: request.organizationId\n }\n ])\n});\nconst marshalRouteMatch = (request, defaults) => ({\n ...marshalling.resolveOneOf([\n { param: \"sni\", value: request.sni },\n { param: \"host_header\", value: request.hostHeader }\n ])\n});\nconst marshalCreateRouteRequest = (request, defaults) => ({\n backend_id: request.backendId,\n frontend_id: request.frontendId,\n match: request.match !== void 0 ? marshalRouteMatch(request.match) : void 0\n});\nconst marshalSubscriberEmailConfig = (request, defaults) => ({\n email: request.email\n});\nconst marshalSubscriberWebhookConfig = (request, defaults) => ({\n uri: request.uri\n});\nconst marshalCreateSubscriberRequest = (request, defaults) => ({\n name: request.name,\n ...marshalling.resolveOneOf([\n {\n default: defaults.defaultProjectId,\n param: \"project_id\",\n value: request.projectId\n },\n {\n default: defaults.defaultOrganizationId,\n param: \"organization_id\",\n value: request.organizationId\n }\n ]),\n ...marshalling.resolveOneOf([\n {\n param: \"email_config\",\n value: request.emailConfig !== void 0 ? marshalSubscriberEmailConfig(request.emailConfig) : void 0\n },\n {\n param: \"webhook_config\",\n value: request.webhookConfig !== void 0 ? marshalSubscriberWebhookConfig(request.webhookConfig) : void 0\n }\n ])\n});\nconst marshalMigrateLbRequest = (request, defaults) => ({\n type: request.type\n});\nconst marshalRemoveBackendServersRequest = (request, defaults) => ({\n server_ip: request.serverIp\n});\nconst marshalSetBackendServersRequest = (request, defaults) => ({\n server_ip: request.serverIp\n});\nconst marshalSubscribeToLbRequest = (request, defaults) => ({\n subscriber_id: request.subscriberId\n});\nconst marshalUpdateAclRequest = (request, defaults) => ({\n action: marshalAclAction(request.action),\n description: request.description,\n index: request.index,\n match: request.match !== void 0 ? marshalAclMatch(request.match) : void 0,\n name: request.name\n});\nconst marshalUpdateBackendRequest = (request, defaults) => ({\n failover_host: request.failoverHost,\n forward_port: request.forwardPort,\n forward_port_algorithm: request.forwardPortAlgorithm,\n forward_protocol: request.forwardProtocol,\n ignore_ssl_server_verify: request.ignoreSslServerVerify,\n max_connections: request.maxConnections,\n max_retries: request.maxRetries,\n name: request.name,\n on_marked_down_action: request.onMarkedDownAction,\n proxy_protocol: request.proxyProtocol,\n redispatch_attempt_count: request.redispatchAttemptCount,\n send_proxy_v2: request.sendProxyV2,\n ssl_bridging: request.sslBridging,\n sticky_sessions: request.stickySessions,\n sticky_sessions_cookie_name: request.stickySessionsCookieName,\n timeout_connect: request.timeoutConnect,\n timeout_queue: request.timeoutQueue,\n timeout_server: request.timeoutServer,\n timeout_tunnel: request.timeoutTunnel\n});\nconst marshalUpdateCertificateRequest = (request, defaults) => ({\n name: request.name\n});\nconst marshalUpdateFrontendRequest = (request, defaults) => ({\n backend_id: request.backendId,\n certificate_id: request.certificateId,\n certificate_ids: request.certificateIds,\n enable_http3: request.enableHttp3,\n inbound_port: request.inboundPort,\n name: request.name,\n timeout_client: request.timeoutClient\n});\nconst marshalUpdateHealthCheckRequest = (request, defaults) => ({\n check_delay: request.checkDelay,\n check_max_retries: request.checkMaxRetries,\n check_send_proxy: request.checkSendProxy,\n check_timeout: request.checkTimeout,\n port: request.port,\n transient_check_delay: request.transientCheckDelay,\n ...marshalling.resolveOneOf([\n {\n param: \"tcp_config\",\n value: request.tcpConfig !== void 0 ? marshalHealthCheckTcpConfig(request.tcpConfig) : void 0\n },\n {\n param: \"mysql_config\",\n value: request.mysqlConfig !== void 0 ? marshalHealthCheckMysqlConfig(request.mysqlConfig) : void 0\n },\n {\n param: \"pgsql_config\",\n value: request.pgsqlConfig !== void 0 ? marshalHealthCheckPgsqlConfig(request.pgsqlConfig) : void 0\n },\n {\n param: \"ldap_config\",\n value: request.ldapConfig !== void 0 ? marshalHealthCheckLdapConfig(request.ldapConfig) : void 0\n },\n {\n param: \"redis_config\",\n value: request.redisConfig !== void 0 ? marshalHealthCheckRedisConfig(request.redisConfig) : void 0\n },\n {\n param: \"http_config\",\n value: request.httpConfig !== void 0 ? marshalHealthCheckHttpConfig(request.httpConfig) : void 0\n },\n {\n param: \"https_config\",\n value: request.httpsConfig !== void 0 ? marshalHealthCheckHttpsConfig(request.httpsConfig) : void 0\n }\n ])\n});\nconst marshalUpdateIpRequest = (request, defaults) => ({\n lb_id: request.lbId,\n reverse: request.reverse,\n tags: request.tags\n});\nconst marshalUpdateLbRequest = (request, defaults) => ({\n description: request.description,\n name: request.name,\n ssl_compatibility_level: request.sslCompatibilityLevel,\n tags: request.tags\n});\nconst marshalUpdateRouteRequest = (request, defaults) => ({\n backend_id: request.backendId,\n match: request.match !== void 0 ? marshalRouteMatch(request.match) : void 0\n});\nconst marshalUpdateSubscriberRequest = (request, defaults) => ({\n name: request.name,\n ...marshalling.resolveOneOf([\n {\n param: \"email_config\",\n value: request.emailConfig !== void 0 ? marshalSubscriberEmailConfig(request.emailConfig) : void 0\n },\n {\n param: \"webhook_config\",\n value: request.webhookConfig !== void 0 ? marshalSubscriberWebhookConfig(request.webhookConfig) : void 0\n }\n ])\n});\nconst marshalZonedApiAddBackendServersRequest = (request, defaults) => ({\n server_ip: request.serverIp\n});\nconst marshalZonedApiAttachPrivateNetworkRequest = (request, defaults) => ({\n ipam_ids: request.ipamIds,\n ...marshalling.resolveOneOf([\n {\n param: \"static_config\",\n value: request.staticConfig !== void 0 ? marshalPrivateNetworkStaticConfig(request.staticConfig) : void 0\n },\n {\n param: \"dhcp_config\",\n value: request.dhcpConfig !== void 0 ? marshalPrivateNetworkDHCPConfig(request.dhcpConfig) : void 0\n },\n {\n param: \"ipam_config\",\n value: request.ipamConfig !== void 0 ? marshalPrivateNetworkIpamConfig(request.ipamConfig) : void 0\n }\n ])\n});\nconst marshalZonedApiCreateAclRequest = (request, defaults) => ({\n action: marshalAclAction(request.action),\n description: request.description,\n index: request.index,\n match: request.match !== void 0 ? marshalAclMatch(request.match) : void 0,\n name: request.name || randomName(\"acl\")\n});\nconst marshalZonedApiCreateBackendRequest = (request, defaults) => ({\n failover_host: request.failoverHost,\n forward_port: request.forwardPort,\n forward_port_algorithm: request.forwardPortAlgorithm,\n forward_protocol: request.forwardProtocol,\n health_check: marshalHealthCheck(request.healthCheck),\n ignore_ssl_server_verify: request.ignoreSslServerVerify,\n max_connections: request.maxConnections,\n max_retries: request.maxRetries,\n name: request.name || randomName(\"lbb\"),\n on_marked_down_action: request.onMarkedDownAction,\n proxy_protocol: request.proxyProtocol,\n redispatch_attempt_count: request.redispatchAttemptCount,\n send_proxy_v2: request.sendProxyV2,\n server_ip: request.serverIp,\n ssl_bridging: request.sslBridging,\n sticky_sessions: request.stickySessions,\n sticky_sessions_cookie_name: request.stickySessionsCookieName,\n timeout_connect: request.timeoutConnect,\n timeout_queue: request.timeoutQueue,\n timeout_server: request.timeoutServer,\n timeout_tunnel: request.timeoutTunnel\n});\nconst marshalZonedApiCreateCertificateRequest = (request, defaults) => ({\n name: request.name || randomName(\"certificate\"),\n ...marshalling.resolveOneOf([\n {\n param: \"letsencrypt\",\n value: request.letsencrypt !== void 0 ? marshalCreateCertificateRequestLetsencryptConfig(\n request.letsencrypt\n ) : void 0\n },\n {\n param: \"custom_certificate\",\n value: request.customCertificate !== void 0 ? marshalCreateCertificateRequestCustomCertificate(\n request.customCertificate\n ) : void 0\n }\n ])\n});\nconst marshalZonedApiCreateFrontendRequest = (request, defaults) => ({\n backend_id: request.backendId,\n certificate_id: request.certificateId,\n certificate_ids: request.certificateIds,\n enable_http3: request.enableHttp3,\n inbound_port: request.inboundPort,\n name: request.name || randomName(\"lbf\"),\n timeout_client: request.timeoutClient\n});\nconst marshalZonedApiCreateIpRequest = (request, defaults) => ({\n is_ipv6: request.isIpv6,\n reverse: request.reverse,\n tags: request.tags,\n ...marshalling.resolveOneOf([\n {\n default: defaults.defaultProjectId,\n param: \"project_id\",\n value: request.projectId\n },\n {\n default: defaults.defaultOrganizationId,\n param: \"organization_id\",\n value: request.organizationId\n }\n ])\n});\nconst marshalZonedApiCreateLbRequest = (request, defaults) => ({\n assign_flexible_ip: request.assignFlexibleIp,\n assign_flexible_ipv6: request.assignFlexibleIpv6,\n description: request.description,\n ip_id: request.ipId,\n ip_ids: request.ipIds,\n name: request.name || randomName(\"lb\"),\n ssl_compatibility_level: request.sslCompatibilityLevel,\n tags: request.tags,\n type: request.type,\n ...marshalling.resolveOneOf([\n {\n default: defaults.defaultProjectId,\n param: \"project_id\",\n value: request.projectId\n },\n {\n default: defaults.defaultOrganizationId,\n param: \"organization_id\",\n value: request.organizationId\n }\n ])\n});\nconst marshalZonedApiCreateRouteRequest = (request, defaults) => ({\n backend_id: request.backendId,\n frontend_id: request.frontendId,\n match: request.match !== void 0 ? marshalRouteMatch(request.match) : void 0\n});\nconst marshalZonedApiCreateSubscriberRequest = (request, defaults) => ({\n name: request.name,\n ...marshalling.resolveOneOf([\n {\n default: defaults.defaultProjectId,\n param: \"project_id\",\n value: request.projectId\n },\n {\n default: defaults.defaultOrganizationId,\n param: \"organization_id\",\n value: request.organizationId\n }\n ]),\n ...marshalling.resolveOneOf([\n {\n param: \"email_config\",\n value: request.emailConfig !== void 0 ? marshalSubscriberEmailConfig(request.emailConfig) : void 0\n },\n {\n param: \"webhook_config\",\n value: request.webhookConfig !== void 0 ? marshalSubscriberWebhookConfig(request.webhookConfig) : void 0\n }\n ])\n});\nconst marshalZonedApiMigrateLbRequest = (request, defaults) => ({\n type: request.type\n});\nconst marshalZonedApiRemoveBackendServersRequest = (request, defaults) => ({\n server_ip: request.serverIp\n});\nconst marshalAclSpec = (request, defaults) => ({\n action: marshalAclAction(request.action),\n description: request.description,\n index: request.index,\n match: request.match !== void 0 ? marshalAclMatch(request.match) : void 0,\n name: request.name\n});\nconst marshalZonedApiSetAclsRequest = (request, defaults) => ({\n acls: request.acls.map((elt) => marshalAclSpec(elt))\n});\nconst marshalZonedApiSetBackendServersRequest = (request, defaults) => ({\n server_ip: request.serverIp\n});\nconst marshalZonedApiSubscribeToLbRequest = (request, defaults) => ({\n subscriber_id: request.subscriberId\n});\nconst marshalZonedApiUpdateAclRequest = (request, defaults) => ({\n action: marshalAclAction(request.action),\n description: request.description,\n index: request.index,\n match: request.match !== void 0 ? marshalAclMatch(request.match) : void 0,\n name: request.name\n});\nconst marshalZonedApiUpdateBackendRequest = (request, defaults) => ({\n failover_host: request.failoverHost,\n forward_port: request.forwardPort,\n forward_port_algorithm: request.forwardPortAlgorithm,\n forward_protocol: request.forwardProtocol,\n ignore_ssl_server_verify: request.ignoreSslServerVerify,\n max_connections: request.maxConnections,\n max_retries: request.maxRetries,\n name: request.name,\n on_marked_down_action: request.onMarkedDownAction,\n proxy_protocol: request.proxyProtocol,\n redispatch_attempt_count: request.redispatchAttemptCount,\n send_proxy_v2: request.sendProxyV2,\n ssl_bridging: request.sslBridging,\n sticky_sessions: request.stickySessions,\n sticky_sessions_cookie_name: request.stickySessionsCookieName,\n timeout_connect: request.timeoutConnect,\n timeout_queue: request.timeoutQueue,\n timeout_server: request.timeoutServer,\n timeout_tunnel: request.timeoutTunnel\n});\nconst marshalZonedApiUpdateCertificateRequest = (request, defaults) => ({\n name: request.name\n});\nconst marshalZonedApiUpdateFrontendRequest = (request, defaults) => ({\n backend_id: request.backendId,\n certificate_id: request.certificateId,\n certificate_ids: request.certificateIds,\n enable_http3: request.enableHttp3,\n inbound_port: request.inboundPort,\n name: request.name,\n timeout_client: request.timeoutClient\n});\nconst marshalZonedApiUpdateHealthCheckRequest = (request, defaults) => ({\n check_delay: request.checkDelay,\n check_max_retries: request.checkMaxRetries,\n check_send_proxy: request.checkSendProxy,\n check_timeout: request.checkTimeout,\n port: request.port,\n transient_check_delay: request.transientCheckDelay,\n ...marshalling.resolveOneOf([\n {\n param: \"tcp_config\",\n value: request.tcpConfig !== void 0 ? marshalHealthCheckTcpConfig(request.tcpConfig) : void 0\n },\n {\n param: \"mysql_config\",\n value: request.mysqlConfig !== void 0 ? marshalHealthCheckMysqlConfig(request.mysqlConfig) : void 0\n },\n {\n param: \"pgsql_config\",\n value: request.pgsqlConfig !== void 0 ? marshalHealthCheckPgsqlConfig(request.pgsqlConfig) : void 0\n },\n {\n param: \"ldap_config\",\n value: request.ldapConfig !== void 0 ? marshalHealthCheckLdapConfig(request.ldapConfig) : void 0\n },\n {\n param: \"redis_config\",\n value: request.redisConfig !== void 0 ? marshalHealthCheckRedisConfig(request.redisConfig) : void 0\n },\n {\n param: \"http_config\",\n value: request.httpConfig !== void 0 ? marshalHealthCheckHttpConfig(request.httpConfig) : void 0\n },\n {\n param: \"https_config\",\n value: request.httpsConfig !== void 0 ? marshalHealthCheckHttpsConfig(request.httpsConfig) : void 0\n }\n ])\n});\nconst marshalZonedApiUpdateIpRequest = (request, defaults) => ({\n lb_id: request.lbId,\n reverse: request.reverse,\n tags: request.tags\n});\nconst marshalZonedApiUpdateLbRequest = (request, defaults) => ({\n description: request.description,\n name: request.name,\n ssl_compatibility_level: request.sslCompatibilityLevel,\n tags: request.tags\n});\nconst marshalZonedApiUpdateRouteRequest = (request, defaults) => ({\n backend_id: request.backendId,\n match: request.match !== void 0 ? marshalRouteMatch(request.match) : void 0\n});\nconst marshalZonedApiUpdateSubscriberRequest = (request, defaults) => ({\n name: request.name,\n ...marshalling.resolveOneOf([\n {\n param: \"email_config\",\n value: request.emailConfig !== void 0 ? marshalSubscriberEmailConfig(request.emailConfig) : void 0\n },\n {\n param: \"webhook_config\",\n value: request.webhookConfig !== void 0 ? marshalSubscriberWebhookConfig(request.webhookConfig) : void 0\n }\n ])\n});\nexports.marshalAddBackendServersRequest = marshalAddBackendServersRequest;\nexports.marshalAttachPrivateNetworkRequest = marshalAttachPrivateNetworkRequest;\nexports.marshalCreateAclRequest = marshalCreateAclRequest;\nexports.marshalCreateBackendRequest = marshalCreateBackendRequest;\nexports.marshalCreateCertificateRequest = marshalCreateCertificateRequest;\nexports.marshalCreateFrontendRequest = marshalCreateFrontendRequest;\nexports.marshalCreateIpRequest = marshalCreateIpRequest;\nexports.marshalCreateLbRequest = marshalCreateLbRequest;\nexports.marshalCreateRouteRequest = marshalCreateRouteRequest;\nexports.marshalCreateSubscriberRequest = marshalCreateSubscriberRequest;\nexports.marshalMigrateLbRequest = marshalMigrateLbRequest;\nexports.marshalRemoveBackendServersRequest = marshalRemoveBackendServersRequest;\nexports.marshalSetBackendServersRequest = marshalSetBackendServersRequest;\nexports.marshalSubscribeToLbRequest = marshalSubscribeToLbRequest;\nexports.marshalUpdateAclRequest = marshalUpdateAclRequest;\nexports.marshalUpdateBackendRequest = marshalUpdateBackendRequest;\nexports.marshalUpdateCertificateRequest = marshalUpdateCertificateRequest;\nexports.marshalUpdateFrontendRequest = marshalUpdateFrontendRequest;\nexports.marshalUpdateHealthCheckRequest = marshalUpdateHealthCheckRequest;\nexports.marshalUpdateIpRequest = marshalUpdateIpRequest;\nexports.marshalUpdateLbRequest = marshalUpdateLbRequest;\nexports.marshalUpdateRouteRequest = marshalUpdateRouteRequest;\nexports.marshalUpdateSubscriberRequest = marshalUpdateSubscriberRequest;\nexports.marshalZonedApiAddBackendServersRequest = marshalZonedApiAddBackendServersRequest;\nexports.marshalZonedApiAttachPrivateNetworkRequest = marshalZonedApiAttachPrivateNetworkRequest;\nexports.marshalZonedApiCreateAclRequest = marshalZonedApiCreateAclRequest;\nexports.marshalZonedApiCreateBackendRequest = marshalZonedApiCreateBackendRequest;\nexports.marshalZonedApiCreateCertificateRequest = marshalZonedApiCreateCertificateRequest;\nexports.marshalZonedApiCreateFrontendRequest = marshalZonedApiCreateFrontendRequest;\nexports.marshalZonedApiCreateIpRequest = marshalZonedApiCreateIpRequest;\nexports.marshalZonedApiCreateLbRequest = marshalZonedApiCreateLbRequest;\nexports.marshalZonedApiCreateRouteRequest = marshalZonedApiCreateRouteRequest;\nexports.marshalZonedApiCreateSubscriberRequest = marshalZonedApiCreateSubscriberRequest;\nexports.marshalZonedApiMigrateLbRequest = marshalZonedApiMigrateLbRequest;\nexports.marshalZonedApiRemoveBackendServersRequest = marshalZonedApiRemoveBackendServersRequest;\nexports.marshalZonedApiSetAclsRequest = marshalZonedApiSetAclsRequest;\nexports.marshalZonedApiSetBackendServersRequest = marshalZonedApiSetBackendServersRequest;\nexports.marshalZonedApiSubscribeToLbRequest = marshalZonedApiSubscribeToLbRequest;\nexports.marshalZonedApiUpdateAclRequest = marshalZonedApiUpdateAclRequest;\nexports.marshalZonedApiUpdateBackendRequest = marshalZonedApiUpdateBackendRequest;\nexports.marshalZonedApiUpdateCertificateRequest = marshalZonedApiUpdateCertificateRequest;\nexports.marshalZonedApiUpdateFrontendRequest = marshalZonedApiUpdateFrontendRequest;\nexports.marshalZonedApiUpdateHealthCheckRequest = marshalZonedApiUpdateHealthCheckRequest;\nexports.marshalZonedApiUpdateIpRequest = marshalZonedApiUpdateIpRequest;\nexports.marshalZonedApiUpdateLbRequest = marshalZonedApiUpdateLbRequest;\nexports.marshalZonedApiUpdateRouteRequest = marshalZonedApiUpdateRouteRequest;\nexports.marshalZonedApiUpdateSubscriberRequest = marshalZonedApiUpdateSubscriberRequest;\nexports.unmarshalAcl = unmarshalAcl;\nexports.unmarshalBackend = unmarshalBackend;\nexports.unmarshalBackendServerStats = unmarshalBackendServerStats;\nexports.unmarshalCertificate = unmarshalCertificate;\nexports.unmarshalFrontend = unmarshalFrontend;\nexports.unmarshalHealthCheck = unmarshalHealthCheck;\nexports.unmarshalIp = unmarshalIp;\nexports.unmarshalLb = unmarshalLb;\nexports.unmarshalLbStats = unmarshalLbStats;\nexports.unmarshalListAclResponse = unmarshalListAclResponse;\nexports.unmarshalListBackendStatsResponse = unmarshalListBackendStatsResponse;\nexports.unmarshalListBackendsResponse = unmarshalListBackendsResponse;\nexports.unmarshalListCertificatesResponse = unmarshalListCertificatesResponse;\nexports.unmarshalListFrontendsResponse = unmarshalListFrontendsResponse;\nexports.unmarshalListIpsResponse = unmarshalListIpsResponse;\nexports.unmarshalListLbPrivateNetworksResponse = unmarshalListLbPrivateNetworksResponse;\nexports.unmarshalListLbTypesResponse = unmarshalListLbTypesResponse;\nexports.unmarshalListLbsResponse = unmarshalListLbsResponse;\nexports.unmarshalListRoutesResponse = unmarshalListRoutesResponse;\nexports.unmarshalListSubscriberResponse = unmarshalListSubscriberResponse;\nexports.unmarshalPrivateNetwork = unmarshalPrivateNetwork;\nexports.unmarshalRoute = unmarshalRoute;\nexports.unmarshalSetAclsResponse = unmarshalSetAclsResponse;\nexports.unmarshalSubscriber = unmarshalSubscriber;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst index_gen = require(\"./v1beta1/index.gen.cjs\");\nexports.v1beta1 = index_gen;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst intervalRetrier = require(\"../../../internal/async/interval-retrier.cjs\");\nconst api = require(\"../../../scw/api.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst resourcePaginator = require(\"../../../scw/fetch/resource-paginator.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nconst marshalling_gen = require(\"./marshalling.gen.cjs\");\nconst jsonContentHeaders = {\n \"Content-Type\": \"application/json; charset=utf-8\"\n};\nclass API extends api.API {\n /** Lists the available regions of the API. */\n static LOCALITIES = [\"fr-par\"];\n pageOfListDeployments = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/llm-inference/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/deployments`,\n urlParams: marshalling.urlParams(\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId],\n [\"tags\", request.tags]\n )\n },\n marshalling_gen.unmarshalListDeploymentsResponse\n );\n /**\n * List inference deployments. List all your inference deployments.\n *\n * @param request - The request {@link ListDeploymentsRequest}\n * @returns A Promise of ListDeploymentsResponse\n */\n listDeployments = (request = {}) => resourcePaginator.enrichForPagination(\"deployments\", this.pageOfListDeployments, request);\n /**\n * Get a deployment. Get the deployment for the given ID.\n *\n * @param request - The request {@link GetDeploymentRequest}\n * @returns A Promise of Deployment\n */\n getDeployment = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/llm-inference/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/deployments/${marshalling.validatePathParam(\"deploymentId\", request.deploymentId)}`\n },\n marshalling_gen.unmarshalDeployment\n );\n /**\n * Waits for {@link Deployment} to be in a final state.\n *\n * @param request - The request {@link GetDeploymentRequest}\n * @param options - The waiting options\n * @returns A Promise of Deployment\n */\n waitForDeployment = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(!content_gen.DEPLOYMENT_TRANSIENT_STATUSES.includes(res.status))),\n this.getDeployment,\n request,\n options\n );\n /**\n * Create a deployment. Create a new inference deployment related to a\n * specific model.\n *\n * @param request - The request {@link CreateDeploymentRequest}\n * @returns A Promise of Deployment\n */\n createDeployment = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateDeploymentRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/llm-inference/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/deployments`\n },\n marshalling_gen.unmarshalDeployment\n );\n /**\n * Update a deployment. Update an existing inference deployment.\n *\n * @param request - The request {@link UpdateDeploymentRequest}\n * @returns A Promise of Deployment\n */\n updateDeployment = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateDeploymentRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/llm-inference/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/deployments/${marshalling.validatePathParam(\"deploymentId\", request.deploymentId)}`\n },\n marshalling_gen.unmarshalDeployment\n );\n /**\n * Delete a deployment. Delete an existing inference deployment.\n *\n * @param request - The request {@link DeleteDeploymentRequest}\n * @returns A Promise of Deployment\n */\n deleteDeployment = (request) => this.client.fetch(\n {\n method: \"DELETE\",\n path: `/llm-inference/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/deployments/${marshalling.validatePathParam(\"deploymentId\", request.deploymentId)}`\n },\n marshalling_gen.unmarshalDeployment\n );\n /**\n * Get the CA certificate. Get the CA certificate used for the deployment of\n * private endpoints. The CA certificate will be returned as a PEM file.\n *\n * @param request - The request {@link GetDeploymentCertificateRequest}\n * @returns A Promise of Blob\n */\n getDeploymentCertificate = (request) => this.client.fetch({\n method: \"GET\",\n path: `/llm-inference/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/deployments/${marshalling.validatePathParam(\"deploymentId\", request.deploymentId)}/certificate`,\n urlParams: marshalling.urlParams([\"dl\", 1]),\n responseType: \"blob\"\n });\n /**\n * Create an endpoint. Create a new Endpoint related to a specific deployment.\n *\n * @param request - The request {@link CreateEndpointRequest}\n * @returns A Promise of Endpoint\n */\n createEndpoint = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateEndpointRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/llm-inference/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/endpoints`\n },\n marshalling_gen.unmarshalEndpoint\n );\n /**\n * Update an endpoint. Update an existing Endpoint.\n *\n * @param request - The request {@link UpdateEndpointRequest}\n * @returns A Promise of Endpoint\n */\n updateEndpoint = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateEndpointRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/llm-inference/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/endpoints/${marshalling.validatePathParam(\"endpointId\", request.endpointId)}`\n },\n marshalling_gen.unmarshalEndpoint\n );\n /**\n * Delete an endpoint. Delete an existing Endpoint.\n *\n * @param request - The request {@link DeleteEndpointRequest}\n */\n deleteEndpoint = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/llm-inference/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/endpoints/${marshalling.validatePathParam(\"endpointId\", request.endpointId)}`\n });\n pageOfListDeploymentACLRules = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/llm-inference/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/deployments/${marshalling.validatePathParam(\"deploymentId\", request.deploymentId)}/acls`,\n urlParams: marshalling.urlParams(\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListDeploymentACLRulesResponse\n );\n /**\n * List your ACLs. List ACLs for a specific deployment.\n *\n * @param request - The request {@link ListDeploymentACLRulesRequest}\n * @returns A Promise of ListDeploymentACLRulesResponse\n */\n listDeploymentACLRules = (request) => resourcePaginator.enrichForPagination(\"rules\", this.pageOfListDeploymentACLRules, request);\n /**\n * Add new ACLs. Add new ACL rules for a specific deployment.\n *\n * @param request - The request {@link AddDeploymentACLRulesRequest}\n * @returns A Promise of AddDeploymentACLRulesResponse\n */\n addDeploymentACLRules = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalAddDeploymentACLRulesRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/llm-inference/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/deployments/${marshalling.validatePathParam(\"deploymentId\", request.deploymentId)}/acls`\n },\n marshalling_gen.unmarshalAddDeploymentACLRulesResponse\n );\n /**\n * Set new ACL. Set new ACL rules for a specific deployment.\n *\n * @param request - The request {@link SetDeploymentACLRulesRequest}\n * @returns A Promise of SetDeploymentACLRulesResponse\n */\n setDeploymentACLRules = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalSetDeploymentACLRulesRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PUT\",\n path: `/llm-inference/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/deployments/${marshalling.validatePathParam(\"deploymentId\", request.deploymentId)}/acls`\n },\n marshalling_gen.unmarshalSetDeploymentACLRulesResponse\n );\n /**\n * Delete an exising ACL.\n *\n * @param request - The request {@link DeleteDeploymentACLRuleRequest}\n */\n deleteDeploymentACLRule = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/llm-inference/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/acls/${marshalling.validatePathParam(\"aclId\", request.aclId)}`\n });\n pageOfListModels = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/llm-inference/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/models`,\n urlParams: marshalling.urlParams(\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId],\n [\"tags\", request.tags]\n )\n },\n marshalling_gen.unmarshalListModelsResponse\n );\n /**\n * List models. List all available models.\n *\n * @param request - The request {@link ListModelsRequest}\n * @returns A Promise of ListModelsResponse\n */\n listModels = (request = {}) => resourcePaginator.enrichForPagination(\"models\", this.pageOfListModels, request);\n /**\n * Get a model. Get the model for the given ID.\n *\n * @param request - The request {@link GetModelRequest}\n * @returns A Promise of Model\n */\n getModel = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/llm-inference/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/models/${marshalling.validatePathParam(\"modelId\", request.modelId)}`\n },\n marshalling_gen.unmarshalModel\n );\n getModelEula = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/llm-inference/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/models/${marshalling.validatePathParam(\"modelId\", request.modelId)}/eula`\n },\n marshalling_gen.unmarshalEula\n );\n pageOfListNodeTypes = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/llm-inference/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/node-types`,\n urlParams: marshalling.urlParams(\n [\"include_disabled_types\", request.includeDisabledTypes],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListNodeTypesResponse\n );\n /**\n * List available node types. List all available node types. By default, the\n * node types returned in the list are ordered by creation date in ascending\n * order, though this can be modified via the `order_by` field.\n *\n * @param request - The request {@link ListNodeTypesRequest}\n * @returns A Promise of ListNodeTypesResponse\n */\n listNodeTypes = (request) => resourcePaginator.enrichForPagination(\"nodeTypes\", this.pageOfListNodeTypes, request);\n}\nexports.API = API;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst DEPLOYMENT_TRANSIENT_STATUSES = [\n \"creating\",\n \"deploying\",\n \"deleting\"\n];\nexports.DEPLOYMENT_TRANSIENT_STATUSES = DEPLOYMENT_TRANSIENT_STATUSES;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api_gen = require(\"./api.gen.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nconst validationRules_gen = require(\"./validation-rules.gen.cjs\");\nexports.API = api_gen.API;\nexports.DEPLOYMENT_TRANSIENT_STATUSES = content_gen.DEPLOYMENT_TRANSIENT_STATUSES;\nexports.ValidationRules = validationRules_gen;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst randomName = require(\"@scaleway/random-name\");\nconst json = require(\"../../../helpers/json.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst unmarshalEndpointPrivateNetworkDetails = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'EndpointPrivateNetworkDetails' failed as data isn't a dictionary.`\n );\n }\n return {\n privateNetworkId: data.private_network_id\n };\n};\nconst unmarshalEndpointPublicAccessDetails = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'EndpointPublicAccessDetails' failed as data isn't a dictionary.`\n );\n }\n return {};\n};\nconst unmarshalEndpoint = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Endpoint' failed as data isn't a dictionary.`\n );\n }\n return {\n disableAuth: data.disable_auth,\n id: data.id,\n privateNetwork: data.private_network ? unmarshalEndpointPrivateNetworkDetails(data.private_network) : void 0,\n publicAccess: data.public_access ? unmarshalEndpointPublicAccessDetails(data.public_access) : void 0,\n url: data.url\n };\n};\nconst unmarshalDeployment = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Deployment' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n endpoints: marshalling.unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint),\n errorMessage: data.error_message,\n id: data.id,\n maxSize: data.max_size,\n minSize: data.min_size,\n modelName: data.model_name,\n name: data.name,\n nodeType: data.node_type,\n projectId: data.project_id,\n region: data.region,\n size: data.size,\n status: data.status,\n tags: data.tags,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalModelS3Model = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ModelS3Model' failed as data isn't a dictionary.`\n );\n }\n return {\n nodeType: data.node_type,\n pythonDependencies: data.python_dependencies,\n s3Url: data.s3_url,\n tritonServerVersion: data.triton_server_version\n };\n};\nconst unmarshalModel = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Model' failed as data isn't a dictionary.`\n );\n }\n return {\n compatibleNodeTypes: data.compatible_node_types,\n createdAt: marshalling.unmarshalDate(data.created_at),\n description: data.description,\n hasEula: data.has_eula,\n id: data.id,\n isPublic: data.is_public,\n name: data.name,\n projectId: data.project_id,\n provider: data.provider,\n quantizationLevel: data.quantization_level,\n region: data.region,\n s3Model: data.s3_model ? unmarshalModelS3Model(data.s3_model) : void 0,\n tags: data.tags,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalACLRule = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ACLRule' failed as data isn't a dictionary.`\n );\n }\n return {\n description: data.description,\n id: data.id,\n ip: data.ip\n };\n};\nconst unmarshalAddDeploymentACLRulesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'AddDeploymentACLRulesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n rules: marshalling.unmarshalArrayOfObject(data.rules, unmarshalACLRule)\n };\n};\nconst unmarshalEula = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Eula' failed as data isn't a dictionary.`\n );\n }\n return {\n content: data.content\n };\n};\nconst unmarshalListDeploymentACLRulesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListDeploymentACLRulesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n rules: marshalling.unmarshalArrayOfObject(data.rules, unmarshalACLRule),\n totalCount: data.total_count\n };\n};\nconst unmarshalListDeploymentsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListDeploymentsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n deployments: marshalling.unmarshalArrayOfObject(data.deployments, unmarshalDeployment),\n totalCount: data.total_count\n };\n};\nconst unmarshalListModelsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListModelsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n models: marshalling.unmarshalArrayOfObject(data.models, unmarshalModel),\n totalCount: data.total_count\n };\n};\nconst unmarshalNodeType = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'NodeType' failed as data isn't a dictionary.`\n );\n }\n return {\n beta: data.beta,\n createdAt: marshalling.unmarshalDate(data.created_at),\n description: data.description,\n disabled: data.disabled,\n gpus: data.gpus,\n memory: data.memory,\n name: data.name,\n region: data.region,\n stockStatus: data.stock_status,\n updatedAt: marshalling.unmarshalDate(data.updated_at),\n vcpus: data.vcpus,\n vram: data.vram\n };\n};\nconst unmarshalListNodeTypesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListNodeTypesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n nodeTypes: marshalling.unmarshalArrayOfObject(data.node_types, unmarshalNodeType),\n totalCount: data.total_count\n };\n};\nconst unmarshalSetDeploymentACLRulesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SetDeploymentACLRulesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n rules: marshalling.unmarshalArrayOfObject(data.rules, unmarshalACLRule)\n };\n};\nconst marshalACLRuleRequest = (request, defaults) => ({\n description: request.description,\n ip: request.ip\n});\nconst marshalAddDeploymentACLRulesRequest = (request, defaults) => ({\n acls: request.acls !== void 0 ? request.acls.map((elt) => marshalACLRuleRequest(elt)) : void 0\n});\nconst marshalEndpointSpecPrivateNetwork = (request, defaults) => ({\n private_network_id: request.privateNetworkId\n});\nconst marshalEndpointSpecPublic = (request, defaults) => ({});\nconst marshalEndpointSpec = (request, defaults) => ({\n disable_auth: request.disableAuth,\n ...marshalling.resolveOneOf([\n {\n param: \"public\",\n value: request.public !== void 0 ? marshalEndpointSpecPublic(request.public) : void 0\n },\n {\n param: \"private_network\",\n value: request.privateNetwork !== void 0 ? marshalEndpointSpecPrivateNetwork(request.privateNetwork) : void 0\n }\n ])\n});\nconst marshalCreateDeploymentRequest = (request, defaults) => ({\n accept_eula: request.acceptEula,\n endpoints: request.endpoints.map((elt) => marshalEndpointSpec(elt)),\n max_size: request.maxSize,\n min_size: request.minSize,\n model_name: request.modelName,\n name: request.name || randomName(\"llm\"),\n node_type: request.nodeType,\n project_id: request.projectId ?? defaults.defaultProjectId,\n tags: request.tags\n});\nconst marshalCreateEndpointRequest = (request, defaults) => ({\n deployment_id: request.deploymentId,\n endpoint: marshalEndpointSpec(request.endpoint)\n});\nconst marshalSetDeploymentACLRulesRequest = (request, defaults) => ({\n acls: request.acls !== void 0 ? request.acls.map((elt) => marshalACLRuleRequest(elt)) : void 0\n});\nconst marshalUpdateDeploymentRequest = (request, defaults) => ({\n max_size: request.maxSize,\n min_size: request.minSize,\n name: request.name,\n tags: request.tags\n});\nconst marshalUpdateEndpointRequest = (request, defaults) => ({\n disable_auth: request.disableAuth\n});\nexports.marshalAddDeploymentACLRulesRequest = marshalAddDeploymentACLRulesRequest;\nexports.marshalCreateDeploymentRequest = marshalCreateDeploymentRequest;\nexports.marshalCreateEndpointRequest = marshalCreateEndpointRequest;\nexports.marshalSetDeploymentACLRulesRequest = marshalSetDeploymentACLRulesRequest;\nexports.marshalUpdateDeploymentRequest = marshalUpdateDeploymentRequest;\nexports.marshalUpdateEndpointRequest = marshalUpdateEndpointRequest;\nexports.unmarshalAddDeploymentACLRulesResponse = unmarshalAddDeploymentACLRulesResponse;\nexports.unmarshalDeployment = unmarshalDeployment;\nexports.unmarshalEndpoint = unmarshalEndpoint;\nexports.unmarshalEula = unmarshalEula;\nexports.unmarshalListDeploymentACLRulesResponse = unmarshalListDeploymentACLRulesResponse;\nexports.unmarshalListDeploymentsResponse = unmarshalListDeploymentsResponse;\nexports.unmarshalListModelsResponse = unmarshalListModelsResponse;\nexports.unmarshalListNodeTypesResponse = unmarshalListNodeTypesResponse;\nexports.unmarshalModel = unmarshalModel;\nexports.unmarshalSetDeploymentACLRulesResponse = unmarshalSetDeploymentACLRulesResponse;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst CreateDeploymentRequest = {\n maxSize: {\n greaterThanOrEqual: 1,\n lessThanOrEqual: 50\n },\n minSize: {\n greaterThanOrEqual: 1,\n lessThanOrEqual: 50\n },\n modelName: {\n maxLength: 255,\n minLength: 0,\n pattern: /^[\\w-_]+\\/[\\w-_.]+(:[\\w]+)?$/\n },\n name: {\n maxLength: 255,\n minLength: 1,\n pattern: /^[A-Za-z0-9-_]+$/\n },\n nodeType: {\n maxLength: 64,\n minLength: 1\n }\n};\nconst ListDeploymentsRequest = {\n name: {\n maxLength: 255,\n minLength: 1\n }\n};\nconst ListModelsRequest = {\n name: {\n maxLength: 255,\n minLength: 1\n }\n};\nconst UpdateDeploymentRequest = {\n maxSize: {\n greaterThanOrEqual: 1,\n lessThanOrEqual: 50\n },\n minSize: {\n greaterThanOrEqual: 1,\n lessThanOrEqual: 50\n },\n name: {\n maxLength: 255,\n minLength: 1\n }\n};\nexports.CreateDeploymentRequest = CreateDeploymentRequest;\nexports.ListDeploymentsRequest = ListDeploymentsRequest;\nexports.ListModelsRequest = ListModelsRequest;\nexports.UpdateDeploymentRequest = UpdateDeploymentRequest;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst index_gen = require(\"./v2/index.gen.cjs\");\nexports.v2 = index_gen;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api = require(\"../../../scw/api.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst resourcePaginator = require(\"../../../scw/fetch/resource-paginator.cjs\");\nconst marshalling_gen = require(\"./marshalling.gen.cjs\");\nclass API extends api.API {\n pageOfListImages = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/marketplace/v2/images`,\n urlParams: marshalling.urlParams(\n [\"arch\", request.arch],\n [\"category\", request.category],\n [\"include_eol\", request.includeEol],\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListImagesResponse\n );\n /**\n * List marketplace images. List all available images on the marketplace,\n * their UUID, CPU architecture and description.\n *\n * @param request - The request {@link ListImagesRequest}\n * @returns A Promise of ListImagesResponse\n */\n listImages = (request) => resourcePaginator.enrichForPagination(\"images\", this.pageOfListImages, request);\n /**\n * Get a specific marketplace image. Get detailed information about a\n * marketplace image, specified by its `image_id` (UUID format).\n *\n * @param request - The request {@link GetImageRequest}\n * @returns A Promise of Image\n */\n getImage = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/marketplace/v2/images/${marshalling.validatePathParam(\"imageId\", request.imageId)}`\n },\n marshalling_gen.unmarshalImage\n );\n pageOfListVersions = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/marketplace/v2/versions`,\n urlParams: marshalling.urlParams(\n [\"image_id\", request.imageId],\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListVersionsResponse\n );\n /**\n * List versions of an Image. Get a list of all available version of an image,\n * specified by its `image_id` (UUID format).\n *\n * @param request - The request {@link ListVersionsRequest}\n * @returns A Promise of ListVersionsResponse\n */\n listVersions = (request) => resourcePaginator.enrichForPagination(\"versions\", this.pageOfListVersions, request);\n /**\n * Get a specific image version. Get information such as the name, creation\n * date, last update and published date for an image version specified by its\n * `version_id` (UUID format).\n *\n * @param request - The request {@link GetVersionRequest}\n * @returns A Promise of Version\n */\n getVersion = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/marketplace/v2/versions/${marshalling.validatePathParam(\"versionId\", request.versionId)}`\n },\n marshalling_gen.unmarshalVersion\n );\n pageOfListLocalImages = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/marketplace/v2/local-images`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"type\", request.type],\n [\"zone\", request.zone],\n ...Object.entries(\n marshalling.resolveOneOf([\n { param: \"image_id\", value: request.imageId },\n { param: \"version_id\", value: request.versionId },\n { param: \"image_label\", value: request.imageLabel }\n ])\n )\n )\n },\n marshalling_gen.unmarshalListLocalImagesResponse\n );\n /**\n * List local images from a specific image or version. List information about\n * local images in a specific Availability Zone, specified by its `image_id`\n * (UUID format), `version_id` (UUID format) or `image_label`. Only one of\n * these three parameters may be set.\n *\n * @param request - The request {@link ListLocalImagesRequest}\n * @returns A Promise of ListLocalImagesResponse\n */\n listLocalImages = (request = {}) => resourcePaginator.enrichForPagination(\"localImages\", this.pageOfListLocalImages, request);\n /**\n * Get a specific local image by ID. Get detailed information about a local\n * image, including compatible commercial types, supported architecture,\n * labels and the Availability Zone of the image, specified by its\n * `local_image_id` (UUID format).\n *\n * @param request - The request {@link GetLocalImageRequest}\n * @returns A Promise of LocalImage\n */\n getLocalImage = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/marketplace/v2/local-images/${marshalling.validatePathParam(\"localImageId\", request.localImageId)}`\n },\n marshalling_gen.unmarshalLocalImage\n );\n pageOfListCategories = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/marketplace/v2/categories`,\n urlParams: marshalling.urlParams(\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListCategoriesResponse\n );\n /**\n * List existing image categories. Get a list of all existing categories. The\n * output can be paginated.\n *\n * @param request - The request {@link ListCategoriesRequest}\n * @returns A Promise of ListCategoriesResponse\n */\n listCategories = (request = {}) => resourcePaginator.enrichForPagination(\"categories\", this.pageOfListCategories, request);\n /**\n * Get a specific category. Get information about a specific category of the\n * marketplace catalog, specified by its `category_id` (UUID format).\n *\n * @param request - The request {@link GetCategoryRequest}\n * @returns A Promise of Category\n */\n getCategory = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/marketplace/v2/categories/${marshalling.validatePathParam(\"categoryId\", request.categoryId)}`\n },\n marshalling_gen.unmarshalCategory\n );\n}\nexports.API = API;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api_gen = require(\"./api.gen.cjs\");\nexports.API = api_gen.API;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst json = require(\"../../../helpers/json.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst unmarshalCategory = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Category' failed as data isn't a dictionary.`\n );\n }\n return {\n description: data.description,\n id: data.id,\n name: data.name\n };\n};\nconst unmarshalImage = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Image' failed as data isn't a dictionary.`\n );\n }\n return {\n categories: data.categories,\n createdAt: marshalling.unmarshalDate(data.created_at),\n description: data.description,\n id: data.id,\n label: data.label,\n logo: data.logo,\n name: data.name,\n updatedAt: marshalling.unmarshalDate(data.updated_at),\n validUntil: marshalling.unmarshalDate(data.valid_until)\n };\n};\nconst unmarshalLocalImage = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'LocalImage' failed as data isn't a dictionary.`\n );\n }\n return {\n arch: data.arch,\n compatibleCommercialTypes: data.compatible_commercial_types,\n id: data.id,\n label: data.label,\n type: data.type,\n zone: data.zone\n };\n};\nconst unmarshalVersion = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Version' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n id: data.id,\n name: data.name,\n publishedAt: marshalling.unmarshalDate(data.published_at),\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalListCategoriesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListCategoriesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n categories: marshalling.unmarshalArrayOfObject(data.categories, unmarshalCategory),\n totalCount: data.total_count\n };\n};\nconst unmarshalListImagesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListImagesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n images: marshalling.unmarshalArrayOfObject(data.images, unmarshalImage),\n totalCount: data.total_count\n };\n};\nconst unmarshalListLocalImagesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListLocalImagesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n localImages: marshalling.unmarshalArrayOfObject(data.local_images, unmarshalLocalImage),\n totalCount: data.total_count\n };\n};\nconst unmarshalListVersionsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListVersionsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n totalCount: data.total_count,\n versions: marshalling.unmarshalArrayOfObject(data.versions, unmarshalVersion)\n };\n};\nexports.unmarshalCategory = unmarshalCategory;\nexports.unmarshalImage = unmarshalImage;\nexports.unmarshalListCategoriesResponse = unmarshalListCategoriesResponse;\nexports.unmarshalListImagesResponse = unmarshalListImagesResponse;\nexports.unmarshalListLocalImagesResponse = unmarshalListLocalImagesResponse;\nexports.unmarshalListVersionsResponse = unmarshalListVersionsResponse;\nexports.unmarshalLocalImage = unmarshalLocalImage;\nexports.unmarshalVersion = unmarshalVersion;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst index_gen = require(\"./v1beta1/index.gen.cjs\");\nexports.v1beta1 = index_gen;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api = require(\"../../../scw/api.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst resourcePaginator = require(\"../../../scw/fetch/resource-paginator.cjs\");\nconst marshalling_gen = require(\"./marshalling.gen.cjs\");\nconst jsonContentHeaders = {\n \"Content-Type\": \"application/json; charset=utf-8\"\n};\nclass NatsAPI extends api.API {\n /** Lists the available regions of the API. */\n static LOCALITIES = [\"fr-par\", \"nl-ams\"];\n /**\n * Create a NATS account. Create a NATS account associated with a Project.\n *\n * @param request - The request {@link NatsApiCreateNatsAccountRequest}\n * @returns A Promise of NatsAccount\n */\n createNatsAccount = (request = {}) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalNatsApiCreateNatsAccountRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/mnq/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/nats-accounts`\n },\n marshalling_gen.unmarshalNatsAccount\n );\n /**\n * Delete a NATS account. Delete a NATS account, specified by its NATS account\n * ID. Note that deleting a NATS account is irreversible, and any credentials,\n * streams, consumer and stored messages belonging to this NATS account will\n * also be deleted.\n *\n * @param request - The request {@link NatsApiDeleteNatsAccountRequest}\n */\n deleteNatsAccount = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/mnq/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/nats-accounts/${marshalling.validatePathParam(\"natsAccountId\", request.natsAccountId)}`\n });\n /**\n * Update the name of a NATS account. Update the name of a NATS account,\n * specified by its NATS account ID.\n *\n * @param request - The request {@link NatsApiUpdateNatsAccountRequest}\n * @returns A Promise of NatsAccount\n */\n updateNatsAccount = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalNatsApiUpdateNatsAccountRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/mnq/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/nats-accounts/${marshalling.validatePathParam(\"natsAccountId\", request.natsAccountId)}`\n },\n marshalling_gen.unmarshalNatsAccount\n );\n /**\n * Get a NATS account. Retrieve information about an existing NATS account\n * identified by its NATS account ID. Its full details, including name and\n * endpoint, are returned in the response.\n *\n * @param request - The request {@link NatsApiGetNatsAccountRequest}\n * @returns A Promise of NatsAccount\n */\n getNatsAccount = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/mnq/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/nats-accounts/${marshalling.validatePathParam(\"natsAccountId\", request.natsAccountId)}`\n },\n marshalling_gen.unmarshalNatsAccount\n );\n pageOfListNatsAccounts = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/mnq/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/nats-accounts`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId]\n )\n },\n marshalling_gen.unmarshalListNatsAccountsResponse\n );\n /**\n * List NATS accounts. List all NATS accounts in the specified region, for a\n * Scaleway Organization or Project. By default, the NATS accounts returned in\n * the list are ordered by creation date in ascending order, though this can\n * be modified via the `order_by` field.\n *\n * @param request - The request {@link NatsApiListNatsAccountsRequest}\n * @returns A Promise of ListNatsAccountsResponse\n */\n listNatsAccounts = (request = {}) => resourcePaginator.enrichForPagination(\"natsAccounts\", this.pageOfListNatsAccounts, request);\n /**\n * Create NATS credentials. Create a set of credentials for a NATS account,\n * specified by its NATS account ID.\n *\n * @param request - The request {@link NatsApiCreateNatsCredentialsRequest}\n * @returns A Promise of NatsCredentials\n */\n createNatsCredentials = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalNatsApiCreateNatsCredentialsRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/mnq/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/nats-credentials`\n },\n marshalling_gen.unmarshalNatsCredentials\n );\n /**\n * Delete NATS credentials. Delete a set of credentials, specified by their\n * credentials ID. Deleting credentials is irreversible and cannot be undone.\n * The credentials can no longer be used to access the NATS account, and\n * active connections using this credentials will be closed.\n *\n * @param request - The request {@link NatsApiDeleteNatsCredentialsRequest}\n */\n deleteNatsCredentials = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/mnq/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/nats-credentials/${marshalling.validatePathParam(\"natsCredentialsId\", request.natsCredentialsId)}`\n });\n /**\n * Get NATS credentials. Retrieve an existing set of credentials, identified\n * by the `nats_credentials_id`. The credentials themselves are NOT returned,\n * only their metadata (NATS account ID, credentials name, etc), are returned\n * in the response.\n *\n * @param request - The request {@link NatsApiGetNatsCredentialsRequest}\n * @returns A Promise of NatsCredentials\n */\n getNatsCredentials = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/mnq/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/nats-credentials/${marshalling.validatePathParam(\"natsCredentialsId\", request.natsCredentialsId)}`\n },\n marshalling_gen.unmarshalNatsCredentials\n );\n pageOfListNatsCredentials = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/mnq/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/nats-credentials`,\n urlParams: marshalling.urlParams(\n [\"nats_account_id\", request.natsAccountId],\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListNatsCredentialsResponse\n );\n /**\n * List NATS credentials. List existing credentials in the specified NATS\n * account. The response contains only the metadata for the credentials, not\n * the credentials themselves, which are only returned after a **Create\n * Credentials** call.\n *\n * @param request - The request {@link NatsApiListNatsCredentialsRequest}\n * @returns A Promise of ListNatsCredentialsResponse\n */\n listNatsCredentials = (request = {}) => resourcePaginator.enrichForPagination(\n \"natsCredentials\",\n this.pageOfListNatsCredentials,\n request\n );\n}\nclass SnsAPI extends api.API {\n /** Lists the available regions of the API. */\n static LOCALITIES = [\"fr-par\", \"nl-ams\"];\n /**\n * Activate SNS. Activate SNS for the specified Project ID. SNS must be\n * activated before any usage. Activating SNS does not trigger any billing,\n * and you can deactivate at any time.\n *\n * @param request - The request {@link SnsApiActivateSnsRequest}\n * @returns A Promise of SnsInfo\n */\n activateSns = (request = {}) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalSnsApiActivateSnsRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/mnq/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/activate-sns`\n },\n marshalling_gen.unmarshalSnsInfo\n );\n /**\n * Get SNS info. Retrieve the SNS information of the specified Project ID.\n * Informations include the activation status and the SNS API endpoint URL.\n *\n * @param request - The request {@link SnsApiGetSnsInfoRequest}\n * @returns A Promise of SnsInfo\n */\n getSnsInfo = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/mnq/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/sns-info`,\n urlParams: marshalling.urlParams([\n \"project_id\",\n request.projectId ?? this.client.settings.defaultProjectId\n ])\n },\n marshalling_gen.unmarshalSnsInfo\n );\n /**\n * Deactivate SNS. Deactivate SNS for the specified Project ID.You must delete\n * all topics and credentials before this call or you need to set the\n * force_delete parameter.\n *\n * @param request - The request {@link SnsApiDeactivateSnsRequest}\n * @returns A Promise of SnsInfo\n */\n deactivateSns = (request = {}) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalSnsApiDeactivateSnsRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/mnq/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/deactivate-sns`\n },\n marshalling_gen.unmarshalSnsInfo\n );\n /**\n * Create SNS credentials. Create a set of credentials for SNS, specified by a\n * Project ID. Credentials give the bearer access to topics, and the level of\n * permissions can be defined granularly.\n *\n * @param request - The request {@link SnsApiCreateSnsCredentialsRequest}\n * @returns A Promise of SnsCredentials\n */\n createSnsCredentials = (request = {}) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalSnsApiCreateSnsCredentialsRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/mnq/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/sns-credentials`\n },\n marshalling_gen.unmarshalSnsCredentials\n );\n /**\n * Delete SNS credentials. Delete a set of SNS credentials, specified by their\n * credentials ID. Deleting credentials is irreversible and cannot be undone.\n * The credentials can then no longer be used to access SNS.\n *\n * @param request - The request {@link SnsApiDeleteSnsCredentialsRequest}\n */\n deleteSnsCredentials = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/mnq/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/sns-credentials/${marshalling.validatePathParam(\"snsCredentialsId\", request.snsCredentialsId)}`\n });\n /**\n * Update SNS credentials. Update a set of SNS credentials. You can update the\n * credentials' name, or their permissions.\n *\n * @param request - The request {@link SnsApiUpdateSnsCredentialsRequest}\n * @returns A Promise of SnsCredentials\n */\n updateSnsCredentials = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalSnsApiUpdateSnsCredentialsRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/mnq/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/sns-credentials/${marshalling.validatePathParam(\"snsCredentialsId\", request.snsCredentialsId)}`\n },\n marshalling_gen.unmarshalSnsCredentials\n );\n /**\n * Get SNS credentials. Retrieve an existing set of credentials, identified by\n * the `credentials_id`. The credentials themselves, as well as their metadata\n * (name, project ID etc), are returned in the response.\n *\n * @param request - The request {@link SnsApiGetSnsCredentialsRequest}\n * @returns A Promise of SnsCredentials\n */\n getSnsCredentials = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/mnq/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/sns-credentials/${marshalling.validatePathParam(\"snsCredentialsId\", request.snsCredentialsId)}`\n },\n marshalling_gen.unmarshalSnsCredentials\n );\n pageOfListSnsCredentials = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/mnq/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/sns-credentials`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId]\n )\n },\n marshalling_gen.unmarshalListSnsCredentialsResponse\n );\n /**\n * List SNS credentials. List existing SNS credentials in the specified\n * region. The response contains only the metadata for the credentials, not\n * the credentials themselves.\n *\n * @param request - The request {@link SnsApiListSnsCredentialsRequest}\n * @returns A Promise of ListSnsCredentialsResponse\n */\n listSnsCredentials = (request = {}) => resourcePaginator.enrichForPagination(\n \"snsCredentials\",\n this.pageOfListSnsCredentials,\n request\n );\n}\nclass SqsAPI extends api.API {\n /** Lists the available regions of the API. */\n static LOCALITIES = [\"fr-par\", \"nl-ams\"];\n /**\n * Activate SQS. Activate SQS for the specified Project ID. SQS must be\n * activated before any usage such as creating credentials and queues.\n * Activating SQS does not trigger any billing, and you can deactivate at any\n * time.\n *\n * @param request - The request {@link SqsApiActivateSqsRequest}\n * @returns A Promise of SqsInfo\n */\n activateSqs = (request = {}) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalSqsApiActivateSqsRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/mnq/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/activate-sqs`\n },\n marshalling_gen.unmarshalSqsInfo\n );\n /**\n * Get SQS info. Retrieve the SQS information of the specified Project ID.\n * Informations include the activation status and the SQS API endpoint URL.\n *\n * @param request - The request {@link SqsApiGetSqsInfoRequest}\n * @returns A Promise of SqsInfo\n */\n getSqsInfo = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/mnq/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/sqs-info`,\n urlParams: marshalling.urlParams([\n \"project_id\",\n request.projectId ?? this.client.settings.defaultProjectId\n ])\n },\n marshalling_gen.unmarshalSqsInfo\n );\n /**\n * Deactivate SQS. Deactivate SQS for the specified Project ID. You must\n * delete all queues and credentials before this call or you need to set the\n * force_delete parameter.\n *\n * @param request - The request {@link SqsApiDeactivateSqsRequest}\n * @returns A Promise of SqsInfo\n */\n deactivateSqs = (request = {}) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalSqsApiDeactivateSqsRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/mnq/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/deactivate-sqs`\n },\n marshalling_gen.unmarshalSqsInfo\n );\n /**\n * Create SQS credentials. Create a set of credentials for SQS, specified by a\n * Project ID. Credentials give the bearer access to queues, and the level of\n * permissions can be defined granularly.\n *\n * @param request - The request {@link SqsApiCreateSqsCredentialsRequest}\n * @returns A Promise of SqsCredentials\n */\n createSqsCredentials = (request = {}) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalSqsApiCreateSqsCredentialsRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/mnq/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/sqs-credentials`\n },\n marshalling_gen.unmarshalSqsCredentials\n );\n /**\n * Delete SQS credentials. Delete a set of SQS credentials, specified by their\n * credentials ID. Deleting credentials is irreversible and cannot be undone.\n * The credentials can then no longer be used to access SQS.\n *\n * @param request - The request {@link SqsApiDeleteSqsCredentialsRequest}\n */\n deleteSqsCredentials = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/mnq/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/sqs-credentials/${marshalling.validatePathParam(\"sqsCredentialsId\", request.sqsCredentialsId)}`\n });\n /**\n * Update SQS credentials. Update a set of SQS credentials. You can update the\n * credentials' name, or their permissions.\n *\n * @param request - The request {@link SqsApiUpdateSqsCredentialsRequest}\n * @returns A Promise of SqsCredentials\n */\n updateSqsCredentials = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalSqsApiUpdateSqsCredentialsRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/mnq/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/sqs-credentials/${marshalling.validatePathParam(\"sqsCredentialsId\", request.sqsCredentialsId)}`\n },\n marshalling_gen.unmarshalSqsCredentials\n );\n /**\n * Get SQS credentials. Retrieve an existing set of credentials, identified by\n * the `credentials_id`. The credentials themselves, as well as their metadata\n * (name, project ID etc), are returned in the response.\n *\n * @param request - The request {@link SqsApiGetSqsCredentialsRequest}\n * @returns A Promise of SqsCredentials\n */\n getSqsCredentials = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/mnq/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/sqs-credentials/${marshalling.validatePathParam(\"sqsCredentialsId\", request.sqsCredentialsId)}`\n },\n marshalling_gen.unmarshalSqsCredentials\n );\n pageOfListSqsCredentials = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/mnq/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/sqs-credentials`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId]\n )\n },\n marshalling_gen.unmarshalListSqsCredentialsResponse\n );\n /**\n * List SQS credentials. List existing SQS credentials in the specified\n * region. The response contains only the metadata for the credentials, not\n * the credentials themselves.\n *\n * @param request - The request {@link SqsApiListSqsCredentialsRequest}\n * @returns A Promise of ListSqsCredentialsResponse\n */\n listSqsCredentials = (request = {}) => resourcePaginator.enrichForPagination(\n \"sqsCredentials\",\n this.pageOfListSqsCredentials,\n request\n );\n}\nexports.NatsAPI = NatsAPI;\nexports.SnsAPI = SnsAPI;\nexports.SqsAPI = SqsAPI;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api_gen = require(\"./api.gen.cjs\");\nconst validationRules_gen = require(\"./validation-rules.gen.cjs\");\nexports.NatsAPI = api_gen.NatsAPI;\nexports.SnsAPI = api_gen.SnsAPI;\nexports.SqsAPI = api_gen.SqsAPI;\nexports.ValidationRules = validationRules_gen;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst randomName = require(\"@scaleway/random-name\");\nconst json = require(\"../../../helpers/json.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst unmarshalNatsAccount = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'NatsAccount' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n endpoint: data.endpoint,\n id: data.id,\n name: data.name,\n projectId: data.project_id,\n region: data.region,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalFile = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'File' failed as data isn't a dictionary.`\n );\n }\n return {\n content: data.content,\n name: data.name\n };\n};\nconst unmarshalNatsCredentials = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'NatsCredentials' failed as data isn't a dictionary.`\n );\n }\n return {\n checksum: data.checksum,\n createdAt: marshalling.unmarshalDate(data.created_at),\n credentials: data.credentials ? unmarshalFile(data.credentials) : void 0,\n id: data.id,\n name: data.name,\n natsAccountId: data.nats_account_id,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalSnsPermissions = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SnsPermissions' failed as data isn't a dictionary.`\n );\n }\n return {\n canManage: data.can_manage,\n canPublish: data.can_publish,\n canReceive: data.can_receive\n };\n};\nconst unmarshalSnsCredentials = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SnsCredentials' failed as data isn't a dictionary.`\n );\n }\n return {\n accessKey: data.access_key,\n createdAt: marshalling.unmarshalDate(data.created_at),\n id: data.id,\n name: data.name,\n permissions: data.permissions ? unmarshalSnsPermissions(data.permissions) : void 0,\n projectId: data.project_id,\n region: data.region,\n secretChecksum: data.secret_checksum,\n secretKey: data.secret_key,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalSqsPermissions = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SqsPermissions' failed as data isn't a dictionary.`\n );\n }\n return {\n canManage: data.can_manage,\n canPublish: data.can_publish,\n canReceive: data.can_receive\n };\n};\nconst unmarshalSqsCredentials = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SqsCredentials' failed as data isn't a dictionary.`\n );\n }\n return {\n accessKey: data.access_key,\n createdAt: marshalling.unmarshalDate(data.created_at),\n id: data.id,\n name: data.name,\n permissions: data.permissions ? unmarshalSqsPermissions(data.permissions) : void 0,\n projectId: data.project_id,\n region: data.region,\n secretChecksum: data.secret_checksum,\n secretKey: data.secret_key,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalListNatsAccountsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListNatsAccountsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n natsAccounts: marshalling.unmarshalArrayOfObject(\n data.nats_accounts,\n unmarshalNatsAccount\n ),\n totalCount: data.total_count\n };\n};\nconst unmarshalListNatsCredentialsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListNatsCredentialsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n natsCredentials: marshalling.unmarshalArrayOfObject(\n data.nats_credentials,\n unmarshalNatsCredentials\n ),\n totalCount: data.total_count\n };\n};\nconst unmarshalListSnsCredentialsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListSnsCredentialsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n snsCredentials: marshalling.unmarshalArrayOfObject(\n data.sns_credentials,\n unmarshalSnsCredentials\n ),\n totalCount: data.total_count\n };\n};\nconst unmarshalListSqsCredentialsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListSqsCredentialsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n sqsCredentials: marshalling.unmarshalArrayOfObject(\n data.sqs_credentials,\n unmarshalSqsCredentials\n ),\n totalCount: data.total_count\n };\n};\nconst unmarshalSnsInfo = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SnsInfo' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n projectId: data.project_id,\n region: data.region,\n snsEndpointUrl: data.sns_endpoint_url,\n status: data.status,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalSqsInfo = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SqsInfo' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n projectId: data.project_id,\n region: data.region,\n sqsEndpointUrl: data.sqs_endpoint_url,\n status: data.status,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst marshalNatsApiCreateNatsAccountRequest = (request, defaults) => ({\n name: request.name || randomName(\"mnq\"),\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalNatsApiCreateNatsCredentialsRequest = (request, defaults) => ({\n name: request.name || randomName(\"mnq\"),\n nats_account_id: request.natsAccountId\n});\nconst marshalNatsApiUpdateNatsAccountRequest = (request, defaults) => ({\n name: request.name\n});\nconst marshalSnsApiActivateSnsRequest = (request, defaults) => ({\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalSnsPermissions = (request, defaults) => ({\n can_manage: request.canManage,\n can_publish: request.canPublish,\n can_receive: request.canReceive\n});\nconst marshalSnsApiCreateSnsCredentialsRequest = (request, defaults) => ({\n name: request.name || randomName(\"mnq_sns\"),\n permissions: request.permissions !== void 0 ? marshalSnsPermissions(request.permissions) : void 0,\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalSnsApiDeactivateSnsRequest = (request, defaults) => ({\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalSnsApiUpdateSnsCredentialsRequest = (request, defaults) => ({\n name: request.name,\n permissions: request.permissions !== void 0 ? marshalSnsPermissions(request.permissions) : void 0\n});\nconst marshalSqsApiActivateSqsRequest = (request, defaults) => ({\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalSqsPermissions = (request, defaults) => ({\n can_manage: request.canManage,\n can_publish: request.canPublish,\n can_receive: request.canReceive\n});\nconst marshalSqsApiCreateSqsCredentialsRequest = (request, defaults) => ({\n name: request.name || randomName(\"mnq_sqs\"),\n permissions: request.permissions !== void 0 ? marshalSqsPermissions(request.permissions) : void 0,\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalSqsApiDeactivateSqsRequest = (request, defaults) => ({\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalSqsApiUpdateSqsCredentialsRequest = (request, defaults) => ({\n name: request.name,\n permissions: request.permissions !== void 0 ? marshalSqsPermissions(request.permissions) : void 0\n});\nexports.marshalNatsApiCreateNatsAccountRequest = marshalNatsApiCreateNatsAccountRequest;\nexports.marshalNatsApiCreateNatsCredentialsRequest = marshalNatsApiCreateNatsCredentialsRequest;\nexports.marshalNatsApiUpdateNatsAccountRequest = marshalNatsApiUpdateNatsAccountRequest;\nexports.marshalSnsApiActivateSnsRequest = marshalSnsApiActivateSnsRequest;\nexports.marshalSnsApiCreateSnsCredentialsRequest = marshalSnsApiCreateSnsCredentialsRequest;\nexports.marshalSnsApiDeactivateSnsRequest = marshalSnsApiDeactivateSnsRequest;\nexports.marshalSnsApiUpdateSnsCredentialsRequest = marshalSnsApiUpdateSnsCredentialsRequest;\nexports.marshalSqsApiActivateSqsRequest = marshalSqsApiActivateSqsRequest;\nexports.marshalSqsApiCreateSqsCredentialsRequest = marshalSqsApiCreateSqsCredentialsRequest;\nexports.marshalSqsApiDeactivateSqsRequest = marshalSqsApiDeactivateSqsRequest;\nexports.marshalSqsApiUpdateSqsCredentialsRequest = marshalSqsApiUpdateSqsCredentialsRequest;\nexports.unmarshalListNatsAccountsResponse = unmarshalListNatsAccountsResponse;\nexports.unmarshalListNatsCredentialsResponse = unmarshalListNatsCredentialsResponse;\nexports.unmarshalListSnsCredentialsResponse = unmarshalListSnsCredentialsResponse;\nexports.unmarshalListSqsCredentialsResponse = unmarshalListSqsCredentialsResponse;\nexports.unmarshalNatsAccount = unmarshalNatsAccount;\nexports.unmarshalNatsCredentials = unmarshalNatsCredentials;\nexports.unmarshalSnsCredentials = unmarshalSnsCredentials;\nexports.unmarshalSnsInfo = unmarshalSnsInfo;\nexports.unmarshalSqsCredentials = unmarshalSqsCredentials;\nexports.unmarshalSqsInfo = unmarshalSqsInfo;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst NatsAccount = {\n name: {\n maxLength: 64,\n minLength: 1\n }\n};\nconst NatsApiCreateNatsAccountRequest = {\n name: {\n maxLength: 64,\n minLength: 1\n }\n};\nconst NatsApiCreateNatsCredentialsRequest = {\n name: {\n maxLength: 500,\n minLength: 1\n }\n};\nconst NatsApiUpdateNatsAccountRequest = {\n name: {\n maxLength: 64,\n minLength: 1\n }\n};\nconst NatsCredentials = {\n name: {\n maxLength: 500,\n minLength: 1\n }\n};\nconst SnsApiCreateSnsCredentialsRequest = {\n name: {\n maxLength: 500,\n minLength: 1\n }\n};\nconst SnsApiUpdateSnsCredentialsRequest = {\n name: {\n maxLength: 500,\n minLength: 1\n }\n};\nconst SnsCredentials = {\n accessKey: {\n minLength: 1\n },\n name: {\n maxLength: 500,\n minLength: 1\n }\n};\nconst SqsApiCreateSqsCredentialsRequest = {\n name: {\n maxLength: 500,\n minLength: 1\n }\n};\nconst SqsApiUpdateSqsCredentialsRequest = {\n name: {\n maxLength: 500,\n minLength: 1\n }\n};\nconst SqsCredentials = {\n accessKey: {\n minLength: 1\n },\n name: {\n maxLength: 500,\n minLength: 1\n }\n};\nexports.NatsAccount = NatsAccount;\nexports.NatsApiCreateNatsAccountRequest = NatsApiCreateNatsAccountRequest;\nexports.NatsApiCreateNatsCredentialsRequest = NatsApiCreateNatsCredentialsRequest;\nexports.NatsApiUpdateNatsAccountRequest = NatsApiUpdateNatsAccountRequest;\nexports.NatsCredentials = NatsCredentials;\nexports.SnsApiCreateSnsCredentialsRequest = SnsApiCreateSnsCredentialsRequest;\nexports.SnsApiUpdateSnsCredentialsRequest = SnsApiUpdateSnsCredentialsRequest;\nexports.SnsCredentials = SnsCredentials;\nexports.SqsApiCreateSqsCredentialsRequest = SqsApiCreateSqsCredentialsRequest;\nexports.SqsApiUpdateSqsCredentialsRequest = SqsApiUpdateSqsCredentialsRequest;\nexports.SqsCredentials = SqsCredentials;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst index_gen = require(\"./v1alpha1/index.gen.cjs\");\nexports.v1alpha1 = index_gen;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst intervalRetrier = require(\"../../../internal/async/interval-retrier.cjs\");\nconst api = require(\"../../../scw/api.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst resourcePaginator = require(\"../../../scw/fetch/resource-paginator.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nconst marshalling_gen = require(\"./marshalling.gen.cjs\");\nconst jsonContentHeaders = {\n \"Content-Type\": \"application/json; charset=utf-8\"\n};\nclass API extends api.API {\n /**\n * Get job information. Retrieve information about the provided **job ID**,\n * such as status, payload, and result.\n *\n * @param request - The request {@link GetJobRequest}\n * @returns A Promise of Job\n */\n getJob = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/qaas/v1alpha1/jobs/${marshalling.validatePathParam(\"jobId\", request.jobId)}`\n },\n marshalling_gen.unmarshalJob\n );\n /**\n * Waits for {@link Job} to be in a final state.\n *\n * @param request - The request {@link GetJobRequest}\n * @param options - The waiting options\n * @returns A Promise of Job\n */\n waitForJob = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(!content_gen.JOB_TRANSIENT_STATUSES.includes(res.status))),\n this.getJob,\n request,\n options\n );\n pageOfListJobs = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/qaas/v1alpha1/jobs`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"tags\", request.tags],\n ...Object.entries(\n marshalling.resolveOneOf([\n { param: \"session_id\", value: request.sessionId },\n {\n default: this.client.settings.defaultProjectId,\n param: \"project_id\",\n value: request.projectId\n }\n ])\n )\n )\n },\n marshalling_gen.unmarshalListJobsResponse\n );\n /**\n * List all jobs within a project or session. Retrieve information about all\n * jobs within a given project or session.\n *\n * @param request - The request {@link ListJobsRequest}\n * @returns A Promise of ListJobsResponse\n */\n listJobs = (request = {}) => resourcePaginator.enrichForPagination(\"jobs\", this.pageOfListJobs, request);\n pageOfListJobResults = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/qaas/v1alpha1/jobs/${marshalling.validatePathParam(\"jobId\", request.jobId)}/results`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListJobResultsResponse\n );\n /**\n * List all results of a job. Retrieve all intermediate and final results of a\n * job.\n *\n * @param request - The request {@link ListJobResultsRequest}\n * @returns A Promise of ListJobResultsResponse\n */\n listJobResults = (request) => resourcePaginator.enrichForPagination(\"jobResults\", this.pageOfListJobResults, request);\n /**\n * Create a job. Create a job to be executed inside a session.\n *\n * @param request - The request {@link CreateJobRequest}\n * @returns A Promise of Job\n */\n createJob = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateJobRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/qaas/v1alpha1/jobs`\n },\n marshalling_gen.unmarshalJob\n );\n /**\n * Update job information. Update job information about the provided **job\n * ID**.\n *\n * @param request - The request {@link UpdateJobRequest}\n * @returns A Promise of Job\n */\n updateJob = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateJobRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/qaas/v1alpha1/jobs/${marshalling.validatePathParam(\"jobId\", request.jobId)}`\n },\n marshalling_gen.unmarshalJob\n );\n /**\n * Cancel a job. Cancel the job corresponding to the provided **job ID**.\n *\n * @param request - The request {@link CancelJobRequest}\n * @returns A Promise of Job\n */\n cancelJob = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/qaas/v1alpha1/jobs/${marshalling.validatePathParam(\"jobId\", request.jobId)}/cancel`\n },\n marshalling_gen.unmarshalJob\n );\n /**\n * Delete a job. Delete the job corresponding to the provided **job ID**.\n *\n * @param request - The request {@link DeleteJobRequest}\n */\n deleteJob = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/qaas/v1alpha1/jobs/${marshalling.validatePathParam(\"jobId\", request.jobId)}`\n });\n /**\n * Get a job circuit. Retrieve the circuit of the provided **job ID**.\n *\n * @param request - The request {@link GetJobCircuitRequest}\n * @returns A Promise of JobCircuit\n */\n getJobCircuit = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/qaas/v1alpha1/jobs/${marshalling.validatePathParam(\"jobId\", request.jobId)}/circuit`\n },\n marshalling_gen.unmarshalJobCircuit\n );\n /**\n * Get platform information. Retrieve information about the provided\n * **platform ID**, such as provider name, technology, and type.\n *\n * @param request - The request {@link GetPlatformRequest}\n * @returns A Promise of Platform\n */\n getPlatform = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/qaas/v1alpha1/platforms/${marshalling.validatePathParam(\"platformId\", request.platformId)}`\n },\n marshalling_gen.unmarshalPlatform\n );\n pageOfListPlatforms = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/qaas/v1alpha1/platforms`,\n urlParams: marshalling.urlParams(\n [\"backend_name\", request.backendName],\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"platform_technology\", request.platformTechnology],\n [\"platform_type\", request.platformType],\n [\"provider_name\", request.providerName]\n )\n },\n marshalling_gen.unmarshalListPlatformsResponse\n );\n /**\n * List all available platforms. Retrieve information about all platforms.\n *\n * @param request - The request {@link ListPlatformsRequest}\n * @returns A Promise of ListPlatformsResponse\n */\n listPlatforms = (request = {}) => resourcePaginator.enrichForPagination(\"platforms\", this.pageOfListPlatforms, request);\n /**\n * Get session infrormation. Retrieve information about the provided **session\n * ID**, such as name, status, and number of executed jobs.\n *\n * @param request - The request {@link GetSessionRequest}\n * @returns A Promise of Session\n */\n getSession = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/qaas/v1alpha1/sessions/${marshalling.validatePathParam(\"sessionId\", request.sessionId)}`\n },\n marshalling_gen.unmarshalSession\n );\n /**\n * Waits for {@link Session} to be in a final state.\n *\n * @param request - The request {@link GetSessionRequest}\n * @param options - The waiting options\n * @returns A Promise of Session\n */\n waitForSession = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(!content_gen.SESSION_TRANSIENT_STATUSES.includes(res.status))),\n this.getSession,\n request,\n options\n );\n pageOfListSessions = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/qaas/v1alpha1/sessions`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"platform_id\", request.platformId],\n [\n \"project_id\",\n request.projectId ?? this.client.settings.defaultProjectId\n ],\n [\"tags\", request.tags]\n )\n },\n marshalling_gen.unmarshalListSessionsResponse\n );\n /**\n * List all sessions. Retrieve information about all sessions.\n *\n * @param request - The request {@link ListSessionsRequest}\n * @returns A Promise of ListSessionsResponse\n */\n listSessions = (request = {}) => resourcePaginator.enrichForPagination(\"sessions\", this.pageOfListSessions, request);\n /**\n * Create a session. Create a dedicated session for the specified platform.\n *\n * @param request - The request {@link CreateSessionRequest}\n * @returns A Promise of Session\n */\n createSession = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateSessionRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/qaas/v1alpha1/sessions`\n },\n marshalling_gen.unmarshalSession\n );\n /**\n * Update session information. Update session information of the provided\n * **session ID**.\n *\n * @param request - The request {@link UpdateSessionRequest}\n * @returns A Promise of Session\n */\n updateSession = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateSessionRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/qaas/v1alpha1/sessions/${marshalling.validatePathParam(\"sessionId\", request.sessionId)}`\n },\n marshalling_gen.unmarshalSession\n );\n /**\n * Terminate an existing session. Terminate a session by its unique ID and\n * cancel all its attached jobs.\n *\n * @param request - The request {@link TerminateSessionRequest}\n * @returns A Promise of Session\n */\n terminateSession = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/qaas/v1alpha1/sessions/${marshalling.validatePathParam(\"sessionId\", request.sessionId)}/terminate`\n },\n marshalling_gen.unmarshalSession\n );\n /**\n * Delete an existing session. Delete a session by its unique ID and delete\n * all its attached jobs.\n *\n * @param request - The request {@link DeleteSessionRequest}\n */\n deleteSession = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/qaas/v1alpha1/sessions/${marshalling.validatePathParam(\"sessionId\", request.sessionId)}`\n });\n pageOfListSessionACLs = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/qaas/v1alpha1/sessions/${marshalling.validatePathParam(\"sessionId\", request.sessionId)}/acls`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListSessionACLsResponse\n );\n listSessionACLs = (request) => resourcePaginator.enrichForPagination(\"acls\", this.pageOfListSessionACLs, request);\n /**\n * Create a process. Create a new process for the specified application on a\n * specified platform.\n *\n * @param request - The request {@link CreateProcessRequest}\n * @returns A Promise of Process\n */\n createProcess = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateProcessRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/qaas/v1alpha1/processes`\n },\n marshalling_gen.unmarshalProcess\n );\n /**\n * Get process infrormation. Retrieve information about the provided **process\n * ID**, such as name, status and progress.\n *\n * @param request - The request {@link GetProcessRequest}\n * @returns A Promise of Process\n */\n getProcess = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/qaas/v1alpha1/processes/${marshalling.validatePathParam(\"processId\", request.processId)}`\n },\n marshalling_gen.unmarshalProcess\n );\n /**\n * Waits for {@link Process} to be in a final state.\n *\n * @param request - The request {@link GetProcessRequest}\n * @param options - The waiting options\n * @returns A Promise of Process\n */\n waitForProcess = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(!content_gen.PROCESS_TRANSIENT_STATUSES.includes(res.status))),\n this.getProcess,\n request,\n options\n );\n pageOfListProcesses = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/qaas/v1alpha1/processes`,\n urlParams: marshalling.urlParams(\n [\"application_id\", request.applicationId],\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\n \"project_id\",\n request.projectId ?? this.client.settings.defaultProjectId\n ],\n [\"tags\", request.tags]\n )\n },\n marshalling_gen.unmarshalListProcessesResponse\n );\n /**\n * List all processes. Retrieve information about all processes.\n *\n * @param request - The request {@link ListProcessesRequest}\n * @returns A Promise of ListProcessesResponse\n */\n listProcesses = (request = {}) => resourcePaginator.enrichForPagination(\"processes\", this.pageOfListProcesses, request);\n /**\n * Update process information. Update process information of the provided\n * **process ID**.\n *\n * @param request - The request {@link UpdateProcessRequest}\n * @returns A Promise of Process\n */\n updateProcess = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateProcessRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/qaas/v1alpha1/processes/${marshalling.validatePathParam(\"processId\", request.processId)}`\n },\n marshalling_gen.unmarshalProcess\n );\n /**\n * Cancel a running process. Cancel a process by its unique ID. Intermediate\n * results are still available.\n *\n * @param request - The request {@link CancelProcessRequest}\n * @returns A Promise of Process\n */\n cancelProcess = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/qaas/v1alpha1/processes/${marshalling.validatePathParam(\"processId\", request.processId)}/cancel`\n },\n marshalling_gen.unmarshalProcess\n );\n /**\n * Delete an existing process. Delete a process by its unique ID and delete\n * all its data.\n *\n * @param request - The request {@link DeleteProcessRequest}\n */\n deleteProcess = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/qaas/v1alpha1/processes/${marshalling.validatePathParam(\"processId\", request.processId)}`\n });\n pageOfListProcessResults = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/qaas/v1alpha1/processes/${marshalling.validatePathParam(\"processId\", request.processId)}/results`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListProcessResultsResponse\n );\n /**\n * List all results of a process. Retrieve all intermediate and final result\n * of a process.\n *\n * @param request - The request {@link ListProcessResultsRequest}\n * @returns A Promise of ListProcessResultsResponse\n */\n listProcessResults = (request) => resourcePaginator.enrichForPagination(\n \"processResults\",\n this.pageOfListProcessResults,\n request\n );\n /**\n * Get application information. Retrieve information about the provided\n * **applcation ID**, such as name, type and compatible platforms.\n *\n * @param request - The request {@link GetApplicationRequest}\n * @returns A Promise of Application\n */\n getApplication = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/qaas/v1alpha1/applications/${marshalling.validatePathParam(\"applicationId\", request.applicationId)}`\n },\n marshalling_gen.unmarshalApplication\n );\n pageOfListApplications = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/qaas/v1alpha1/applications`,\n urlParams: marshalling.urlParams(\n [\"application_type\", request.applicationType],\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListApplicationsResponse\n );\n /**\n * List all available applications. Retrieve information about all\n * applications.\n *\n * @param request - The request {@link ListApplicationsRequest}\n * @returns A Promise of ListApplicationsResponse\n */\n listApplications = (request = {}) => resourcePaginator.enrichForPagination(\"applications\", this.pageOfListApplications, request);\n}\nexports.API = API;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst JOB_TRANSIENT_STATUSES = [\n \"waiting\",\n \"running\",\n \"cancelling\"\n];\nconst PROCESS_TRANSIENT_STATUSES = [\n \"starting\",\n \"running\",\n \"cancelling\"\n];\nconst SESSION_TRANSIENT_STATUSES = [\n \"starting\",\n \"stopping\"\n];\nexports.JOB_TRANSIENT_STATUSES = JOB_TRANSIENT_STATUSES;\nexports.PROCESS_TRANSIENT_STATUSES = PROCESS_TRANSIENT_STATUSES;\nexports.SESSION_TRANSIENT_STATUSES = SESSION_TRANSIENT_STATUSES;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api_gen = require(\"./api.gen.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nconst validationRules_gen = require(\"./validation-rules.gen.cjs\");\nexports.API = api_gen.API;\nexports.JOB_TRANSIENT_STATUSES = content_gen.JOB_TRANSIENT_STATUSES;\nexports.PROCESS_TRANSIENT_STATUSES = content_gen.PROCESS_TRANSIENT_STATUSES;\nexports.SESSION_TRANSIENT_STATUSES = content_gen.SESSION_TRANSIENT_STATUSES;\nexports.ValidationRules = validationRules_gen;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst json = require(\"../../../helpers/json.cjs\");\nconst customMarshalling = require(\"../../../scw/custom-marshalling.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nconst unmarshalJobCircuit = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'JobCircuit' failed as data isn't a dictionary.`\n );\n }\n return {\n percevalCircuit: data.perceval_circuit,\n qiskitCircuit: data.qiskit_circuit\n };\n};\nconst unmarshalApplication = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Application' failed as data isn't a dictionary.`\n );\n }\n return {\n compatiblePlatformIds: data.compatible_platform_ids,\n id: data.id,\n inputTemplate: data.input_template,\n name: data.name,\n type: data.type\n };\n};\nconst unmarshalJob = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Job' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n id: data.id,\n jobDuration: data.job_duration,\n name: data.name,\n progressMessage: data.progress_message,\n resultDistribution: data.result_distribution,\n sessionId: data.session_id,\n startedAt: marshalling.unmarshalDate(data.started_at),\n status: data.status,\n tags: data.tags,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalPlatformHardware = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'PlatformHardware' failed as data isn't a dictionary.`\n );\n }\n return {\n gpus: data.gpus,\n gpusNetwork: data.gpus_network,\n name: data.name,\n ram: data.ram,\n vcpus: data.vcpus,\n vram: data.vram\n };\n};\nconst unmarshalPlatform = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Platform' failed as data isn't a dictionary.`\n );\n }\n return {\n availability: data.availability,\n backendName: data.backend_name,\n hardware: data.hardware ? unmarshalPlatformHardware(data.hardware) : void 0,\n id: data.id,\n maxQubitCount: data.max_qubit_count,\n metadata: data.metadata,\n name: data.name,\n pricePerHour: data.price_per_hour ? customMarshalling.unmarshalMoney(data.price_per_hour) : void 0,\n providerName: data.provider_name,\n technology: data.technology,\n type: data.type,\n version: data.version\n };\n};\nconst unmarshalProcess = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Process' failed as data isn't a dictionary.`\n );\n }\n return {\n applicationId: data.application_id,\n attachedSessionIds: data.attached_session_ids,\n createdAt: marshalling.unmarshalDate(data.created_at),\n finishedAt: marshalling.unmarshalDate(data.finished_at),\n id: data.id,\n input: data.input,\n name: data.name,\n platformId: data.platform_id,\n progress: data.progress,\n progressMessage: data.progress_message,\n projectId: data.project_id,\n startedAt: marshalling.unmarshalDate(data.started_at),\n status: data.status,\n tags: data.tags,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalSession = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Session' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n deduplicationId: data.deduplication_id,\n finishedJobCount: data.finished_job_count,\n id: data.id,\n maxDuration: data.max_duration,\n maxIdleDuration: data.max_idle_duration,\n name: data.name,\n originId: data.origin_id,\n originType: data.origin_type,\n platformId: data.platform_id,\n progressMessage: data.progress_message,\n projectId: data.project_id,\n startedAt: marshalling.unmarshalDate(data.started_at),\n status: data.status,\n tags: data.tags,\n terminatedAt: marshalling.unmarshalDate(data.terminated_at),\n updatedAt: marshalling.unmarshalDate(data.updated_at),\n waitingJobCount: data.waiting_job_count\n };\n};\nconst unmarshalListApplicationsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListApplicationsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n applications: marshalling.unmarshalArrayOfObject(\n data.applications,\n unmarshalApplication\n ),\n totalCount: data.total_count\n };\n};\nconst unmarshalJobResult = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'JobResult' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n jobId: data.job_id,\n result: data.result,\n url: data.url\n };\n};\nconst unmarshalListJobResultsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListJobResultsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n jobResults: marshalling.unmarshalArrayOfObject(data.job_results, unmarshalJobResult),\n totalCount: data.total_count\n };\n};\nconst unmarshalListJobsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListJobsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n jobs: marshalling.unmarshalArrayOfObject(data.jobs, unmarshalJob),\n totalCount: data.total_count\n };\n};\nconst unmarshalListPlatformsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListPlatformsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n platforms: marshalling.unmarshalArrayOfObject(data.platforms, unmarshalPlatform),\n totalCount: data.total_count\n };\n};\nconst unmarshalProcessResult = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ProcessResult' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n processId: data.process_id,\n result: data.result\n };\n};\nconst unmarshalListProcessResultsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListProcessResultsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n processResults: marshalling.unmarshalArrayOfObject(\n data.process_results,\n unmarshalProcessResult\n ),\n totalCount: data.total_count\n };\n};\nconst unmarshalListProcessesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListProcessesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n processes: marshalling.unmarshalArrayOfObject(data.processes, unmarshalProcess),\n totalCount: data.total_count\n };\n};\nconst unmarshalListSessionACLsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListSessionACLsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n acls: data.acls,\n totalCount: data.total_count\n };\n};\nconst unmarshalListSessionsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListSessionsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n sessions: marshalling.unmarshalArrayOfObject(data.sessions, unmarshalSession),\n totalCount: data.total_count\n };\n};\nconst marshalJobCircuit = (request, defaults) => ({\n ...marshalling.resolveOneOf([\n { param: \"perceval_circuit\", value: request.percevalCircuit },\n { param: \"qiskit_circuit\", value: request.qiskitCircuit }\n ])\n});\nconst marshalCreateJobRequest = (request, defaults) => ({\n circuit: marshalJobCircuit(request.circuit),\n max_duration: request.maxDuration,\n name: request.name,\n session_id: request.sessionId,\n tags: request.tags\n});\nconst marshalCreateProcessRequest = (request, defaults) => ({\n application_id: request.applicationId,\n input: request.input,\n name: request.name,\n platform_id: request.platformId,\n project_id: request.projectId ?? defaults.defaultProjectId,\n tags: request.tags\n});\nconst marshalCreateSessionRequest = (request, defaults) => ({\n deduplication_id: request.deduplicationId,\n max_duration: request.maxDuration,\n max_idle_duration: request.maxIdleDuration,\n name: request.name,\n platform_id: request.platformId,\n project_id: request.projectId ?? defaults.defaultProjectId,\n tags: request.tags\n});\nconst marshalUpdateJobRequest = (request, defaults) => ({\n name: request.name,\n tags: request.tags\n});\nconst marshalUpdateProcessRequest = (request, defaults) => ({\n name: request.name,\n tags: request.tags\n});\nconst marshalUpdateSessionRequest = (request, defaults) => ({\n max_duration: request.maxDuration,\n max_idle_duration: request.maxIdleDuration,\n name: request.name,\n tags: request.tags\n});\nexports.marshalCreateJobRequest = marshalCreateJobRequest;\nexports.marshalCreateProcessRequest = marshalCreateProcessRequest;\nexports.marshalCreateSessionRequest = marshalCreateSessionRequest;\nexports.marshalUpdateJobRequest = marshalUpdateJobRequest;\nexports.marshalUpdateProcessRequest = marshalUpdateProcessRequest;\nexports.marshalUpdateSessionRequest = marshalUpdateSessionRequest;\nexports.unmarshalApplication = unmarshalApplication;\nexports.unmarshalJob = unmarshalJob;\nexports.unmarshalJobCircuit = unmarshalJobCircuit;\nexports.unmarshalListApplicationsResponse = unmarshalListApplicationsResponse;\nexports.unmarshalListJobResultsResponse = unmarshalListJobResultsResponse;\nexports.unmarshalListJobsResponse = unmarshalListJobsResponse;\nexports.unmarshalListPlatformsResponse = unmarshalListPlatformsResponse;\nexports.unmarshalListProcessResultsResponse = unmarshalListProcessResultsResponse;\nexports.unmarshalListProcessesResponse = unmarshalListProcessesResponse;\nexports.unmarshalListSessionACLsResponse = unmarshalListSessionACLsResponse;\nexports.unmarshalListSessionsResponse = unmarshalListSessionsResponse;\nexports.unmarshalPlatform = unmarshalPlatform;\nexports.unmarshalProcess = unmarshalProcess;\nexports.unmarshalSession = unmarshalSession;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst CreateJobRequest = {\n name: {\n minLength: 1\n }\n};\nconst CreateProcessRequest = {\n name: {\n minLength: 1\n }\n};\nexports.CreateJobRequest = CreateJobRequest;\nexports.CreateProcessRequest = CreateProcessRequest;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst index_gen = require(\"./v1/index.gen.cjs\");\nexports.v1 = index_gen;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst intervalRetrier = require(\"../../../internal/async/interval-retrier.cjs\");\nconst api = require(\"../../../scw/api.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst resourcePaginator = require(\"../../../scw/fetch/resource-paginator.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nconst marshalling_gen = require(\"./marshalling.gen.cjs\");\nconst jsonContentHeaders = {\n \"Content-Type\": \"application/json; charset=utf-8\"\n};\nclass API extends api.API {\n /** Lists the available regions of the API. */\n static LOCALITIES = [\"fr-par\", \"nl-ams\", \"pl-waw\"];\n pageOfListDatabaseEngines = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/database-engines`,\n urlParams: marshalling.urlParams(\n [\"name\", request.name],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"version\", request.version]\n )\n },\n marshalling_gen.unmarshalListDatabaseEnginesResponse\n );\n /**\n * List available database engines. List the PostgreSQL and MySQL database\n * engines available at Scaleway.\n *\n * @param request - The request {@link ListDatabaseEnginesRequest}\n * @returns A Promise of ListDatabaseEnginesResponse\n */\n listDatabaseEngines = (request = {}) => resourcePaginator.enrichForPagination(\"engines\", this.pageOfListDatabaseEngines, request);\n pageOfListNodeTypes = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/node-types`,\n urlParams: marshalling.urlParams(\n [\"include_disabled_types\", request.includeDisabledTypes],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListNodeTypesResponse\n );\n /**\n * List available node types. List all available node types. By default, the\n * node types returned in the list are ordered by creation date in ascending\n * order, though this can be modified via the `order_by` field.\n *\n * @param request - The request {@link ListNodeTypesRequest}\n * @returns A Promise of ListNodeTypesResponse\n */\n listNodeTypes = (request) => resourcePaginator.enrichForPagination(\"nodeTypes\", this.pageOfListNodeTypes, request);\n pageOfListDatabaseBackups = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/backups`,\n urlParams: marshalling.urlParams(\n [\"instance_id\", request.instanceId],\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId]\n )\n },\n marshalling_gen.unmarshalListDatabaseBackupsResponse\n );\n /**\n * List database backups. List all backups in a specified region, for a given\n * Scaleway Organization or Scaleway Project. By default, the backups listed\n * are ordered by creation date in ascending order. This can be modified via\n * the `order_by` field.\n *\n * @param request - The request {@link ListDatabaseBackupsRequest}\n * @returns A Promise of ListDatabaseBackupsResponse\n */\n listDatabaseBackups = (request = {}) => resourcePaginator.enrichForPagination(\n \"databaseBackups\",\n this.pageOfListDatabaseBackups,\n request\n );\n /**\n * Create a database backup. Create a new backup. You must set the\n * `instance_id`, `database_name`, `name` and `expires_at` parameters.\n *\n * @param request - The request {@link CreateDatabaseBackupRequest}\n * @returns A Promise of DatabaseBackup\n */\n createDatabaseBackup = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateDatabaseBackupRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/backups`\n },\n marshalling_gen.unmarshalDatabaseBackup\n );\n /**\n * Get a database backup. Retrieve information about a given backup, specified\n * by its database backup ID and region. Full details about the backup, like\n * size, URL and expiration date, are returned in the response.\n *\n * @param request - The request {@link GetDatabaseBackupRequest}\n * @returns A Promise of DatabaseBackup\n */\n getDatabaseBackup = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/backups/${marshalling.validatePathParam(\"databaseBackupId\", request.databaseBackupId)}`\n },\n marshalling_gen.unmarshalDatabaseBackup\n );\n /**\n * Waits for {@link DatabaseBackup} to be in a final state.\n *\n * @param request - The request {@link GetDatabaseBackupRequest}\n * @param options - The waiting options\n * @returns A Promise of DatabaseBackup\n */\n waitForDatabaseBackup = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(\n !content_gen.DATABASE_BACKUP_TRANSIENT_STATUSES.includes(res.status)\n )),\n this.getDatabaseBackup,\n request,\n options\n );\n /**\n * Update a database backup. Update the parameters of a backup, including name\n * and expiration date.\n *\n * @param request - The request {@link UpdateDatabaseBackupRequest}\n * @returns A Promise of DatabaseBackup\n */\n updateDatabaseBackup = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateDatabaseBackupRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/backups/${marshalling.validatePathParam(\"databaseBackupId\", request.databaseBackupId)}`\n },\n marshalling_gen.unmarshalDatabaseBackup\n );\n /**\n * Delete a database backup. Delete a backup, specified by its database backup\n * ID and region. Deleting a backup is permanent, and cannot be undone.\n *\n * @param request - The request {@link DeleteDatabaseBackupRequest}\n * @returns A Promise of DatabaseBackup\n */\n deleteDatabaseBackup = (request) => this.client.fetch(\n {\n method: \"DELETE\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/backups/${marshalling.validatePathParam(\"databaseBackupId\", request.databaseBackupId)}`\n },\n marshalling_gen.unmarshalDatabaseBackup\n );\n /**\n * Restore a database backup. Launch the process of restoring database backup.\n * You must specify the `instance_id` of the Database Instance of destination,\n * where the backup will be restored. Note that large database backups can\n * take up to several hours to restore.\n *\n * @param request - The request {@link RestoreDatabaseBackupRequest}\n * @returns A Promise of DatabaseBackup\n */\n restoreDatabaseBackup = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalRestoreDatabaseBackupRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/backups/${marshalling.validatePathParam(\"databaseBackupId\", request.databaseBackupId)}/restore`\n },\n marshalling_gen.unmarshalDatabaseBackup\n );\n /**\n * Export a database backup. Export a backup, specified by the\n * `database_backup_id` and the `region` parameters. The download URL is\n * returned in the response.\n *\n * @param request - The request {@link ExportDatabaseBackupRequest}\n * @returns A Promise of DatabaseBackup\n */\n exportDatabaseBackup = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/backups/${marshalling.validatePathParam(\"databaseBackupId\", request.databaseBackupId)}/export`\n },\n marshalling_gen.unmarshalDatabaseBackup\n );\n /**\n * Upgrade a Database Instance. Upgrade your current Database Instance\n * specifications like node type, high availability, volume, or the database\n * engine version. Note that upon upgrade the `enable_ha` parameter can only\n * be set to `true`.\n *\n * @param request - The request {@link UpgradeInstanceRequest}\n * @returns A Promise of Instance\n */\n upgradeInstance = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpgradeInstanceRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/upgrade`\n },\n marshalling_gen.unmarshalInstance\n );\n pageOfListInstances = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances`,\n urlParams: marshalling.urlParams(\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId],\n [\"tags\", request.tags]\n )\n },\n marshalling_gen.unmarshalListInstancesResponse\n );\n /**\n * List Database Instances. List all Database Instances in the specified\n * region, for a given Scaleway Organization or Scaleway Project. By default,\n * the Database Instances returned in the list are ordered by creation date in\n * ascending order, though this can be modified via the order_by field. You\n * can define additional parameters for your query, such as `tags` and `name`.\n * For the `name` parameter, the value you include will be checked against the\n * whole name string to see if it includes the string you put in the\n * parameter.\n *\n * @param request - The request {@link ListInstancesRequest}\n * @returns A Promise of ListInstancesResponse\n */\n listInstances = (request = {}) => resourcePaginator.enrichForPagination(\"instances\", this.pageOfListInstances, request);\n /**\n * Get a Database Instance. Retrieve information about a given Database\n * Instance, specified by the `region` and `instance_id` parameters. Its full\n * details, including name, status, IP address and port, are returned in the\n * response object.\n *\n * @param request - The request {@link GetInstanceRequest}\n * @returns A Promise of Instance\n */\n getInstance = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}`\n },\n marshalling_gen.unmarshalInstance\n );\n /**\n * Waits for {@link Instance} to be in a final state.\n *\n * @param request - The request {@link GetInstanceRequest}\n * @param options - The waiting options\n * @returns A Promise of Instance\n */\n waitForInstance = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(!content_gen.INSTANCE_TRANSIENT_STATUSES.includes(res.status))),\n this.getInstance,\n request,\n options\n );\n /**\n * Create a Database Instance. Create a new Database Instance. You must set\n * the `engine`, `user_name`, `password` and `node_type` parameters.\n * Optionally, you can specify the volume type and size.\n *\n * @param request - The request {@link CreateInstanceRequest}\n * @returns A Promise of Instance\n */\n createInstance = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateInstanceRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances`\n },\n marshalling_gen.unmarshalInstance\n );\n /**\n * Update a Database Instance. Update the parameters of a Database Instance,\n * including name, tags and backup schedule details.\n *\n * @param request - The request {@link UpdateInstanceRequest}\n * @returns A Promise of Instance\n */\n updateInstance = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateInstanceRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}`\n },\n marshalling_gen.unmarshalInstance\n );\n /**\n * Delete a Database Instance. Delete a given Database Instance, specified by\n * the `region` and `instance_id` parameters. Deleting a Database Instance is\n * permanent, and cannot be undone. Note that upon deletion all your data will\n * be lost.\n *\n * @param request - The request {@link DeleteInstanceRequest}\n * @returns A Promise of Instance\n */\n deleteInstance = (request) => this.client.fetch(\n {\n method: \"DELETE\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}`\n },\n marshalling_gen.unmarshalInstance\n );\n /**\n * Clone a Database Instance. Clone a given Database Instance, specified by\n * the `region` and `instance_id` parameters. The clone feature allows you to\n * create a new Database Instance from an existing one. The clone includes all\n * existing databases, users and permissions. You can create a clone on a\n * Database Instance bigger than your current one.\n *\n * @param request - The request {@link CloneInstanceRequest}\n * @returns A Promise of Instance\n */\n cloneInstance = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCloneInstanceRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/clone`\n },\n marshalling_gen.unmarshalInstance\n );\n /**\n * Restart Database Instance. Restart a given Database Instance, specified by\n * the `region` and `instance_id` parameters. The status of the Database\n * Instance returned in the response.\n *\n * @param request - The request {@link RestartInstanceRequest}\n * @returns A Promise of Instance\n */\n restartInstance = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/restart`\n },\n marshalling_gen.unmarshalInstance\n );\n /**\n * Get the TLS certificate of a Database Instance. Retrieve information about\n * the TLS certificate of a given Database Instance. Details like name and\n * content are returned in the response.\n *\n * @param request - The request {@link GetInstanceCertificateRequest}\n * @returns A Promise of Blob\n */\n getInstanceCertificate = (request) => this.client.fetch({\n method: \"GET\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/certificate`,\n urlParams: marshalling.urlParams([\"dl\", 1]),\n responseType: \"blob\"\n });\n /**\n * Renew the TLS certificate of a Database Instance. Renew a TLS for a\n * Database Instance. Renewing a certificate means that you will not be able\n * to connect to your Database Instance using the previous certificate. You\n * will also need to download and update the new certificate for all database\n * clients.\n *\n * @param request - The request {@link RenewInstanceCertificateRequest}\n */\n renewInstanceCertificate = (request) => this.client.fetch({\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/renew-certificate`\n });\n /**\n * Get Database Instance metrics. Retrieve the time series metrics of a given\n * Database Instance. You can define the period from which to retrieve metrics\n * by specifying the `start_date` and `end_date`.\n *\n * @param request - The request {@link GetInstanceMetricsRequest}\n * @returns A Promise of InstanceMetrics\n */\n getInstanceMetrics = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/metrics`,\n urlParams: marshalling.urlParams(\n [\"end_date\", request.endDate],\n [\"metric_name\", request.metricName],\n [\"start_date\", request.startDate]\n )\n },\n marshalling_gen.unmarshalInstanceMetrics\n );\n /**\n * Create a Read Replica. Create a new Read Replica of a Database Instance.\n * You must specify the `region` and the `instance_id`. You can only create a\n * maximum of 3 Read Replicas per Database Instance.\n *\n * @param request - The request {@link CreateReadReplicaRequest}\n * @returns A Promise of ReadReplica\n */\n createReadReplica = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateReadReplicaRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/read-replicas`\n },\n marshalling_gen.unmarshalReadReplica\n );\n /**\n * Get a Read Replica. Retrieve information about a Database Instance Read\n * Replica. Full details about the Read Replica, like `endpoints`, `status`\n * and `region` are returned in the response.\n *\n * @param request - The request {@link GetReadReplicaRequest}\n * @returns A Promise of ReadReplica\n */\n getReadReplica = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/read-replicas/${marshalling.validatePathParam(\"readReplicaId\", request.readReplicaId)}`\n },\n marshalling_gen.unmarshalReadReplica\n );\n /**\n * Waits for {@link ReadReplica} to be in a final state.\n *\n * @param request - The request {@link GetReadReplicaRequest}\n * @param options - The waiting options\n * @returns A Promise of ReadReplica\n */\n waitForReadReplica = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(\n !content_gen.READ_REPLICA_TRANSIENT_STATUSES.includes(res.status)\n )),\n this.getReadReplica,\n request,\n options\n );\n /**\n * Delete a Read Replica. Delete a Read Replica of a Database Instance. You\n * must specify the `region` and `read_replica_id` parameters of the Read\n * Replica you want to delete.\n *\n * @param request - The request {@link DeleteReadReplicaRequest}\n * @returns A Promise of ReadReplica\n */\n deleteReadReplica = (request) => this.client.fetch(\n {\n method: \"DELETE\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/read-replicas/${marshalling.validatePathParam(\"readReplicaId\", request.readReplicaId)}`\n },\n marshalling_gen.unmarshalReadReplica\n );\n /**\n * Resync a Read Replica. When you resync a Read Replica, first it is reset,\n * then its data is resynchronized from the primary node. Your Read Replica\n * remains unavailable during the resync process. The duration of this process\n * is proportional to the size of your Database Instance. The configured\n * endpoints do not change.\n *\n * @param request - The request {@link ResetReadReplicaRequest}\n * @returns A Promise of ReadReplica\n */\n resetReadReplica = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/read-replicas/${marshalling.validatePathParam(\"readReplicaId\", request.readReplicaId)}/reset`\n },\n marshalling_gen.unmarshalReadReplica\n );\n /**\n * Promote a Read Replica. Promote a Read Replica to Database Instance\n * automatically.\n *\n * @param request - The request {@link PromoteReadReplicaRequest}\n * @returns A Promise of Instance\n */\n promoteReadReplica = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/read-replicas/${marshalling.validatePathParam(\"readReplicaId\", request.readReplicaId)}/promote`\n },\n marshalling_gen.unmarshalInstance\n );\n /**\n * Create an endpoint for a Read Replica. Create a new endpoint for a Read\n * Replica. Read Replicas can have at most one direct access and one Private\n * Network endpoint.\n *\n * @param request - The request {@link CreateReadReplicaEndpointRequest}\n * @returns A Promise of ReadReplica\n */\n createReadReplicaEndpoint = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateReadReplicaEndpointRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/read-replicas/${marshalling.validatePathParam(\"readReplicaId\", request.readReplicaId)}/endpoints`\n },\n marshalling_gen.unmarshalReadReplica\n );\n /**\n * Prepare logs of a Database Instance. Prepare your Database Instance logs.\n * You can define the `start_date` and `end_date` parameters for your query.\n * The download URL is returned in the response. Logs are recorded from 00h00\n * to 23h59 and then aggregated in a `.log` file once a day. Therefore, even\n * if you specify a timeframe from which you want to get the logs, you will\n * receive logs from the full 24 hours.\n *\n * @param request - The request {@link PrepareInstanceLogsRequest}\n * @returns A Promise of PrepareInstanceLogsResponse\n */\n prepareInstanceLogs = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalPrepareInstanceLogsRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/prepare-logs`\n },\n marshalling_gen.unmarshalPrepareInstanceLogsResponse\n );\n /**\n * List available logs of a Database Instance. List the available logs of a\n * Database Instance. By default, the logs returned in the list are ordered by\n * creation date in ascending order, though this can be modified via the\n * order_by field.\n *\n * @param request - The request {@link ListInstanceLogsRequest}\n * @returns A Promise of ListInstanceLogsResponse\n */\n listInstanceLogs = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/logs`,\n urlParams: marshalling.urlParams([\"order_by\", request.orderBy])\n },\n marshalling_gen.unmarshalListInstanceLogsResponse\n );\n /**\n * Get given logs of a Database Instance. Retrieve information about the logs\n * of a Database Instance. Specify the `instance_log_id` and `region` in your\n * request to get information such as `download_url`, `status`, `expires_at`\n * and `created_at` about your logs in the response.\n *\n * @param request - The request {@link GetInstanceLogRequest}\n * @returns A Promise of InstanceLog\n */\n getInstanceLog = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/logs/${marshalling.validatePathParam(\"instanceLogId\", request.instanceLogId)}`\n },\n marshalling_gen.unmarshalInstanceLog\n );\n /**\n * Waits for {@link InstanceLog} to be in a final state.\n *\n * @param request - The request {@link GetInstanceLogRequest}\n * @param options - The waiting options\n * @returns A Promise of InstanceLog\n */\n waitForInstanceLog = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(\n !content_gen.INSTANCE_LOG_TRANSIENT_STATUSES.includes(res.status)\n )),\n this.getInstanceLog,\n request,\n options\n );\n /**\n * Purge remote Database Instance logs. Purge a given remote log from a\n * Database Instance. You can specify the `log_name` of the log you wish to\n * clean from your Database Instance.\n *\n * @param request - The request {@link PurgeInstanceLogsRequest}\n */\n purgeInstanceLogs = (request) => this.client.fetch({\n body: JSON.stringify(\n marshalling_gen.marshalPurgeInstanceLogsRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/purge-logs`\n });\n /**\n * List remote Database Instance logs details. List remote log details. By\n * default, the details returned in the list are ordered by creation date in\n * ascending order, though this can be modified via the order_by field.\n *\n * @param request - The request {@link ListInstanceLogsDetailsRequest}\n * @returns A Promise of ListInstanceLogsDetailsResponse\n */\n listInstanceLogsDetails = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/logs-details`\n },\n marshalling_gen.unmarshalListInstanceLogsDetailsResponse\n );\n /**\n * Add Database Instance advanced settings. Add an advanced setting to a\n * Database Instance. You must set the `name` and the `value` of each\n * setting.\n *\n * @param request - The request {@link AddInstanceSettingsRequest}\n * @returns A Promise of AddInstanceSettingsResponse\n */\n addInstanceSettings = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalAddInstanceSettingsRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/settings`\n },\n marshalling_gen.unmarshalAddInstanceSettingsResponse\n );\n /**\n * Delete Database Instance advanced settings. Delete an advanced setting in a\n * Database Instance. You must specify the names of the settings you want to\n * delete in the request.\n *\n * @param request - The request {@link DeleteInstanceSettingsRequest}\n * @returns A Promise of DeleteInstanceSettingsResponse\n */\n deleteInstanceSettings = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalDeleteInstanceSettingsRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"DELETE\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/settings`\n },\n marshalling_gen.unmarshalDeleteInstanceSettingsResponse\n );\n /**\n * Set Database Instance advanced settings. Update an advanced setting for a\n * Database Instance. Settings added upon database engine initalization can\n * only be defined once, and cannot, therefore, be updated.\n *\n * @param request - The request {@link SetInstanceSettingsRequest}\n * @returns A Promise of SetInstanceSettingsResponse\n */\n setInstanceSettings = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalSetInstanceSettingsRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PUT\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/settings`\n },\n marshalling_gen.unmarshalSetInstanceSettingsResponse\n );\n pageOfListInstanceACLRules = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/acls`,\n urlParams: marshalling.urlParams(\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListInstanceACLRulesResponse\n );\n /**\n * List ACL rules of a Database Instance. List the ACL rules for a given\n * Database Instance. The response is an array of ACL objects, each one\n * representing an ACL that denies, allows or redirects traffic based on\n * certain conditions.\n *\n * @param request - The request {@link ListInstanceACLRulesRequest}\n * @returns A Promise of ListInstanceACLRulesResponse\n */\n listInstanceACLRules = (request) => resourcePaginator.enrichForPagination(\"rules\", this.pageOfListInstanceACLRules, request);\n /**\n * Add an ACL rule to a Database Instance. Add an additional ACL rule to a\n * Database Instance.\n *\n * @param request - The request {@link AddInstanceACLRulesRequest}\n * @returns A Promise of AddInstanceACLRulesResponse\n */\n addInstanceACLRules = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalAddInstanceACLRulesRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/acls`\n },\n marshalling_gen.unmarshalAddInstanceACLRulesResponse\n );\n /**\n * Set ACL rules for a Database Instance. Replace all the ACL rules of a\n * Database Instance.\n *\n * @param request - The request {@link SetInstanceACLRulesRequest}\n * @returns A Promise of SetInstanceACLRulesResponse\n */\n setInstanceACLRules = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalSetInstanceACLRulesRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PUT\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/acls`\n },\n marshalling_gen.unmarshalSetInstanceACLRulesResponse\n );\n /**\n * Delete ACL rules of a Database Instance. Delete one or more ACL rules of a\n * Database Instance.\n *\n * @param request - The request {@link DeleteInstanceACLRulesRequest}\n * @returns A Promise of DeleteInstanceACLRulesResponse\n */\n deleteInstanceACLRules = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalDeleteInstanceACLRulesRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"DELETE\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/acls`\n },\n marshalling_gen.unmarshalDeleteInstanceACLRulesResponse\n );\n pageOfListUsers = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/users`,\n urlParams: marshalling.urlParams(\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListUsersResponse\n );\n /**\n * List users of a Database Instance. List all users of a given Database\n * Instance. By default, the users returned in the list are ordered by\n * creation date in ascending order, though this can be modified via the\n * order_by field.\n *\n * @param request - The request {@link ListUsersRequest}\n * @returns A Promise of ListUsersResponse\n */\n listUsers = (request) => resourcePaginator.enrichForPagination(\"users\", this.pageOfListUsers, request);\n /**\n * Create a user for a Database Instance. Create a new user for a Database\n * Instance. You must define the `name`, `password` and `is_admin`\n * parameters.\n *\n * @param request - The request {@link CreateUserRequest}\n * @returns A Promise of User\n */\n createUser = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateUserRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/users`\n },\n marshalling_gen.unmarshalUser\n );\n /**\n * Update a user on a Database Instance. Update the parameters of a user on a\n * Database Instance. You can update the `password` and `is_admin` parameters,\n * but you cannot change the name of the user.\n *\n * @param request - The request {@link UpdateUserRequest}\n * @returns A Promise of User\n */\n updateUser = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateUserRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/users/${marshalling.validatePathParam(\"name\", request.name)}`\n },\n marshalling_gen.unmarshalUser\n );\n /**\n * Delete a user on a Database Instance. Delete a given user on a Database\n * Instance. You must specify, in the endpoint, the `region`, `instance_id`\n * and `name` parameters of the user you want to delete.\n *\n * @param request - The request {@link DeleteUserRequest}\n */\n deleteUser = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/users/${marshalling.validatePathParam(\"name\", request.name)}`\n });\n pageOfListDatabases = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/databases`,\n urlParams: marshalling.urlParams(\n [\"managed\", request.managed],\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\"owner\", request.owner],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListDatabasesResponse\n );\n /**\n * List databases in a Database Instance. List all databases of a given\n * Database Instance. By default, the databases returned in the list are\n * ordered by creation date in ascending order, though this can be modified\n * via the order_by field. You can define additional parameters for your\n * query, such as `name`, `managed` and `owner`.\n *\n * @param request - The request {@link ListDatabasesRequest}\n * @returns A Promise of ListDatabasesResponse\n */\n listDatabases = (request) => resourcePaginator.enrichForPagination(\"databases\", this.pageOfListDatabases, request);\n /**\n * Create a database in a Database Instance. Create a new database. You must\n * define the `name` parameter in the request.\n *\n * @param request - The request {@link CreateDatabaseRequest}\n * @returns A Promise of Database\n */\n createDatabase = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateDatabaseRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/databases`\n },\n marshalling_gen.unmarshalDatabase\n );\n /**\n * Delete a database in a Database Instance. Delete a given database on a\n * Database Instance. You must specify, in the endpoint, the `region`,\n * `instance_id` and `name` parameters of the database you want to delete.\n *\n * @param request - The request {@link DeleteDatabaseRequest}\n */\n deleteDatabase = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/databases/${marshalling.validatePathParam(\"name\", request.name)}`\n });\n pageOfListPrivileges = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/privileges`,\n urlParams: marshalling.urlParams(\n [\"database_name\", request.databaseName],\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"user_name\", request.userName]\n )\n },\n marshalling_gen.unmarshalListPrivilegesResponse\n );\n /**\n * List user privileges for a database. List privileges of a user on a\n * database. By default, the details returned in the list are ordered by\n * creation date in ascending order, though this can be modified via the\n * order_by field. You can define additional parameters for your query, such\n * as `database_name` and `user_name`.\n *\n * @param request - The request {@link ListPrivilegesRequest}\n * @returns A Promise of ListPrivilegesResponse\n */\n listPrivileges = (request) => resourcePaginator.enrichForPagination(\"privileges\", this.pageOfListPrivileges, request);\n /**\n * Set user privileges for a database. Set the privileges of a user on a\n * database. You must define `database_name`, `user_name` and `permission` in\n * the request body.\n *\n * @param request - The request {@link SetPrivilegeRequest}\n * @returns A Promise of Privilege\n */\n setPrivilege = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalSetPrivilegeRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PUT\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/privileges`\n },\n marshalling_gen.unmarshalPrivilege\n );\n pageOfListSnapshots = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/snapshots`,\n urlParams: marshalling.urlParams(\n [\"instance_id\", request.instanceId],\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId]\n )\n },\n marshalling_gen.unmarshalListSnapshotsResponse\n );\n /**\n * List snapshots. List snapshots. You can include the `instance_id` or\n * `project_id` in your query to get the list of snapshots for specific\n * Database Instances and/or Projects. By default, the details returned in the\n * list are ordered by creation date in ascending order, though this can be\n * modified via the `order_by` field.\n *\n * @param request - The request {@link ListSnapshotsRequest}\n * @returns A Promise of ListSnapshotsResponse\n */\n listSnapshots = (request = {}) => resourcePaginator.enrichForPagination(\"snapshots\", this.pageOfListSnapshots, request);\n /**\n * Get a Database Instance snapshot. Retrieve information about a given\n * snapshot, specified by its `snapshot_id` and `region`. Full details about\n * the snapshot, like size and expiration date, are returned in the response.\n *\n * @param request - The request {@link GetSnapshotRequest}\n * @returns A Promise of Snapshot\n */\n getSnapshot = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/snapshots/${marshalling.validatePathParam(\"snapshotId\", request.snapshotId)}`\n },\n marshalling_gen.unmarshalSnapshot\n );\n /**\n * Waits for {@link Snapshot} to be in a final state.\n *\n * @param request - The request {@link GetSnapshotRequest}\n * @param options - The waiting options\n * @returns A Promise of Snapshot\n */\n waitForSnapshot = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(!content_gen.SNAPSHOT_TRANSIENT_STATUSES.includes(res.status))),\n this.getSnapshot,\n request,\n options\n );\n /**\n * Create a Database Instance snapshot. Create a new snapshot of a Database\n * Instance. You must define the `name` parameter in the request.\n *\n * @param request - The request {@link CreateSnapshotRequest}\n * @returns A Promise of Snapshot\n */\n createSnapshot = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateSnapshotRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/snapshots`\n },\n marshalling_gen.unmarshalSnapshot\n );\n /**\n * Update a Database Instance snapshot. Update the parameters of a snapshot of\n * a Database Instance. You can update the `name` and `expires_at`\n * parameters.\n *\n * @param request - The request {@link UpdateSnapshotRequest}\n * @returns A Promise of Snapshot\n */\n updateSnapshot = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateSnapshotRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/snapshots/${marshalling.validatePathParam(\"snapshotId\", request.snapshotId)}`\n },\n marshalling_gen.unmarshalSnapshot\n );\n /**\n * Delete a Database Instance snapshot. Delete a given snapshot of a Database\n * Instance. You must specify, in the endpoint, the `region` and `snapshot_id`\n * parameters of the snapshot you want to delete.\n *\n * @param request - The request {@link DeleteSnapshotRequest}\n * @returns A Promise of Snapshot\n */\n deleteSnapshot = (request) => this.client.fetch(\n {\n method: \"DELETE\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/snapshots/${marshalling.validatePathParam(\"snapshotId\", request.snapshotId)}`\n },\n marshalling_gen.unmarshalSnapshot\n );\n /**\n * Create a new Database Instance from a snapshot. Restore a snapshot. When\n * you restore a snapshot, a new Instance is created and billed to your\n * account. Note that is possible to select a larger node type for your new\n * Database Instance. However, the Block volume size will be the same as the\n * size of the restored snapshot. All Instance settings will be restored if\n * you chose a node type with the same or more memory size than the initial\n * Instance. Settings will be reset to the default if your node type has less\n * memory.\n *\n * @param request - The request {@link CreateInstanceFromSnapshotRequest}\n * @returns A Promise of Instance\n */\n createInstanceFromSnapshot = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateInstanceFromSnapshotRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/snapshots/${marshalling.validatePathParam(\"snapshotId\", request.snapshotId)}/create-instance`\n },\n marshalling_gen.unmarshalInstance\n );\n /**\n * Create a new Database Instance endpoint. Create a new endpoint for a\n * Database Instance. You can add `load_balancer` and `private_network`\n * specifications to the body of the request.\n *\n * @param request - The request {@link CreateEndpointRequest}\n * @returns A Promise of Endpoint\n */\n createEndpoint = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateEndpointRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/endpoints`\n },\n marshalling_gen.unmarshalEndpoint\n );\n /**\n * Delete a Database Instance endpoint. Delete the endpoint of a Database\n * Instance. You must specify the `region` and `endpoint_id` parameters of the\n * endpoint you want to delete. Note that might need to update any environment\n * configurations that point to the deleted endpoint.\n *\n * @param request - The request {@link DeleteEndpointRequest}\n */\n deleteEndpoint = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/endpoints/${marshalling.validatePathParam(\"endpointId\", request.endpointId)}`\n });\n /**\n * Get a Database Instance endpoint. Retrieve information about a Database\n * Instance endpoint. Full details about the endpoint, like `ip`, `port`,\n * `private_network` and `load_balancer` specifications are returned in the\n * response.\n *\n * @param request - The request {@link GetEndpointRequest}\n * @returns A Promise of Endpoint\n */\n getEndpoint = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/endpoints/${marshalling.validatePathParam(\"endpointId\", request.endpointId)}`\n },\n marshalling_gen.unmarshalEndpoint\n );\n /**\n * Migrate an existing instance endpoint to another instance.\n *\n * @param request - The request {@link MigrateEndpointRequest}\n * @returns A Promise of Endpoint\n */\n migrateEndpoint = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalMigrateEndpointRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/endpoints/${marshalling.validatePathParam(\"endpointId\", request.endpointId)}/migrate`\n },\n marshalling_gen.unmarshalEndpoint\n );\n /**\n * Apply Database Instance maintenance. Apply maintenance tasks to your\n * Database Instance. This will trigger pending maintenance tasks to start in\n * your Database Instance and can generate service interruption. Maintenance\n * tasks can be applied between `starts_at` and `stops_at` times, and are run\n * directly by Scaleway at `forced_at` timestamp.\n *\n * @param request - The request {@link ApplyInstanceMaintenanceRequest}\n * @returns A Promise of Maintenance\n */\n applyInstanceMaintenance = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/rdb/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/instances/${marshalling.validatePathParam(\"instanceId\", request.instanceId)}/apply-maintenance`\n },\n marshalling_gen.unmarshalMaintenance\n );\n}\nexports.API = API;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst DATABASE_BACKUP_TRANSIENT_STATUSES = [\n \"creating\",\n \"restoring\",\n \"deleting\",\n \"exporting\"\n];\nconst INSTANCE_LOG_TRANSIENT_STATUSES = [\"creating\"];\nconst INSTANCE_TRANSIENT_STATUSES = [\n \"provisioning\",\n \"configuring\",\n \"deleting\",\n \"autohealing\",\n \"initializing\",\n \"backuping\",\n \"snapshotting\",\n \"restarting\"\n];\nconst MAINTENANCE_TRANSIENT_STATUSES = [\"ongoing\"];\nconst READ_REPLICA_TRANSIENT_STATUSES = [\n \"provisioning\",\n \"initializing\",\n \"deleting\",\n \"configuring\",\n \"promoting\"\n];\nconst SNAPSHOT_TRANSIENT_STATUSES = [\n \"creating\",\n \"restoring\",\n \"deleting\"\n];\nexports.DATABASE_BACKUP_TRANSIENT_STATUSES = DATABASE_BACKUP_TRANSIENT_STATUSES;\nexports.INSTANCE_LOG_TRANSIENT_STATUSES = INSTANCE_LOG_TRANSIENT_STATUSES;\nexports.INSTANCE_TRANSIENT_STATUSES = INSTANCE_TRANSIENT_STATUSES;\nexports.MAINTENANCE_TRANSIENT_STATUSES = MAINTENANCE_TRANSIENT_STATUSES;\nexports.READ_REPLICA_TRANSIENT_STATUSES = READ_REPLICA_TRANSIENT_STATUSES;\nexports.SNAPSHOT_TRANSIENT_STATUSES = SNAPSHOT_TRANSIENT_STATUSES;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api_gen = require(\"./api.gen.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nconst validationRules_gen = require(\"./validation-rules.gen.cjs\");\nexports.API = api_gen.API;\nexports.DATABASE_BACKUP_TRANSIENT_STATUSES = content_gen.DATABASE_BACKUP_TRANSIENT_STATUSES;\nexports.INSTANCE_LOG_TRANSIENT_STATUSES = content_gen.INSTANCE_LOG_TRANSIENT_STATUSES;\nexports.INSTANCE_TRANSIENT_STATUSES = content_gen.INSTANCE_TRANSIENT_STATUSES;\nexports.MAINTENANCE_TRANSIENT_STATUSES = content_gen.MAINTENANCE_TRANSIENT_STATUSES;\nexports.READ_REPLICA_TRANSIENT_STATUSES = content_gen.READ_REPLICA_TRANSIENT_STATUSES;\nexports.SNAPSHOT_TRANSIENT_STATUSES = content_gen.SNAPSHOT_TRANSIENT_STATUSES;\nexports.ValidationRules = validationRules_gen;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst randomName = require(\"@scaleway/random-name\");\nconst json = require(\"../../../helpers/json.cjs\");\nconst customMarshalling = require(\"../../../scw/custom-marshalling.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nconst unmarshalEndpointDirectAccessDetails = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'EndpointDirectAccessDetails' failed as data isn't a dictionary.`\n );\n }\n return {};\n};\nconst unmarshalEndpointLoadBalancerDetails = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'EndpointLoadBalancerDetails' failed as data isn't a dictionary.`\n );\n }\n return {};\n};\nconst unmarshalEndpointPrivateNetworkDetails = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'EndpointPrivateNetworkDetails' failed as data isn't a dictionary.`\n );\n }\n return {\n privateNetworkId: data.private_network_id,\n provisioningMode: data.provisioning_mode,\n serviceIp: data.service_ip,\n zone: data.zone\n };\n};\nconst unmarshalEndpoint = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Endpoint' failed as data isn't a dictionary.`\n );\n }\n return {\n directAccess: data.direct_access ? unmarshalEndpointDirectAccessDetails(data.direct_access) : void 0,\n hostname: data.hostname,\n id: data.id,\n ip: data.ip,\n loadBalancer: data.load_balancer ? unmarshalEndpointLoadBalancerDetails(data.load_balancer) : void 0,\n name: data.name,\n port: data.port,\n privateNetwork: data.private_network ? unmarshalEndpointPrivateNetworkDetails(data.private_network) : void 0\n };\n};\nconst unmarshalMaintenance = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Maintenance' failed as data isn't a dictionary.`\n );\n }\n return {\n closedAt: marshalling.unmarshalDate(data.closed_at),\n forcedAt: marshalling.unmarshalDate(data.forced_at),\n reason: data.reason,\n startsAt: marshalling.unmarshalDate(data.starts_at),\n status: data.status,\n stopsAt: marshalling.unmarshalDate(data.stops_at)\n };\n};\nconst unmarshalReadReplica = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ReadReplica' failed as data isn't a dictionary.`\n );\n }\n return {\n endpoints: marshalling.unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint),\n id: data.id,\n instanceId: data.instance_id,\n region: data.region,\n sameZone: data.same_zone,\n status: data.status\n };\n};\nconst unmarshalDatabaseBackup = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DatabaseBackup' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n databaseName: data.database_name,\n downloadUrl: data.download_url,\n downloadUrlExpiresAt: marshalling.unmarshalDate(data.download_url_expires_at),\n expiresAt: marshalling.unmarshalDate(data.expires_at),\n id: data.id,\n instanceId: data.instance_id,\n instanceName: data.instance_name,\n name: data.name,\n region: data.region,\n sameRegion: data.same_region,\n size: data.size,\n status: data.status,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalDatabase = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Database' failed as data isn't a dictionary.`\n );\n }\n return {\n managed: data.managed,\n name: data.name,\n owner: data.owner,\n size: data.size\n };\n};\nconst unmarshalInstanceLog = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'InstanceLog' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n downloadUrl: data.download_url,\n expiresAt: marshalling.unmarshalDate(data.expires_at),\n id: data.id,\n nodeName: data.node_name,\n region: data.region,\n status: data.status\n };\n};\nconst unmarshalBackupSchedule = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'BackupSchedule' failed as data isn't a dictionary.`\n );\n }\n return {\n disabled: data.disabled,\n frequency: data.frequency,\n nextRunAt: marshalling.unmarshalDate(data.next_run_at),\n retention: data.retention\n };\n};\nconst unmarshalEncryptionAtRest = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'EncryptionAtRest' failed as data isn't a dictionary.`\n );\n }\n return {\n enabled: data.enabled\n };\n};\nconst unmarshalInstanceSetting = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'InstanceSetting' failed as data isn't a dictionary.`\n );\n }\n return {\n name: data.name,\n value: data.value\n };\n};\nconst unmarshalLogsPolicy = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'LogsPolicy' failed as data isn't a dictionary.`\n );\n }\n return {\n maxAgeRetention: data.max_age_retention,\n totalDiskRetention: data.total_disk_retention\n };\n};\nconst unmarshalUpgradableVersion = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'UpgradableVersion' failed as data isn't a dictionary.`\n );\n }\n return {\n id: data.id,\n minorVersion: data.minor_version,\n name: data.name,\n version: data.version\n };\n};\nconst unmarshalVolume = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Volume' failed as data isn't a dictionary.`\n );\n }\n return {\n class: data.class,\n size: data.size,\n type: data.type\n };\n};\nconst unmarshalInstance = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Instance' failed as data isn't a dictionary.`\n );\n }\n return {\n backupSameRegion: data.backup_same_region,\n backupSchedule: data.backup_schedule ? unmarshalBackupSchedule(data.backup_schedule) : void 0,\n createdAt: marshalling.unmarshalDate(data.created_at),\n encryption: data.encryption ? unmarshalEncryptionAtRest(data.encryption) : void 0,\n endpoint: data.endpoint ? unmarshalEndpoint(data.endpoint) : void 0,\n endpoints: marshalling.unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint),\n engine: data.engine,\n id: data.id,\n initSettings: marshalling.unmarshalArrayOfObject(\n data.init_settings,\n unmarshalInstanceSetting\n ),\n isHaCluster: data.is_ha_cluster,\n logsPolicy: data.logs_policy ? unmarshalLogsPolicy(data.logs_policy) : void 0,\n maintenances: marshalling.unmarshalArrayOfObject(\n data.maintenances,\n unmarshalMaintenance\n ),\n name: data.name,\n nodeType: data.node_type,\n organizationId: data.organization_id,\n projectId: data.project_id,\n readReplicas: marshalling.unmarshalArrayOfObject(\n data.read_replicas,\n unmarshalReadReplica\n ),\n region: data.region,\n settings: marshalling.unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting),\n status: data.status,\n tags: data.tags,\n upgradableVersion: marshalling.unmarshalArrayOfObject(\n data.upgradable_version,\n unmarshalUpgradableVersion\n ),\n volume: data.volume ? unmarshalVolume(data.volume) : void 0\n };\n};\nconst unmarshalPrivilege = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Privilege' failed as data isn't a dictionary.`\n );\n }\n return {\n databaseName: data.database_name,\n permission: data.permission,\n userName: data.user_name\n };\n};\nconst unmarshalSnapshotVolumeType = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SnapshotVolumeType' failed as data isn't a dictionary.`\n );\n }\n return {\n class: data.class,\n type: data.type\n };\n};\nconst unmarshalSnapshot = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Snapshot' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n expiresAt: marshalling.unmarshalDate(data.expires_at),\n id: data.id,\n instanceId: data.instance_id,\n instanceName: data.instance_name,\n name: data.name,\n nodeType: data.node_type,\n region: data.region,\n size: data.size,\n status: data.status,\n updatedAt: marshalling.unmarshalDate(data.updated_at),\n volumeType: data.volume_type ? unmarshalSnapshotVolumeType(data.volume_type) : void 0\n };\n};\nconst unmarshalUser = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'User' failed as data isn't a dictionary.`\n );\n }\n return {\n isAdmin: data.is_admin,\n name: data.name\n };\n};\nconst unmarshalACLRule = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ACLRule' failed as data isn't a dictionary.`\n );\n }\n return {\n action: data.action,\n description: data.description,\n direction: data.direction,\n ip: data.ip,\n port: data.port,\n protocol: data.protocol\n };\n};\nconst unmarshalAddInstanceACLRulesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'AddInstanceACLRulesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n rules: marshalling.unmarshalArrayOfObject(data.rules, unmarshalACLRule)\n };\n};\nconst unmarshalAddInstanceSettingsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'AddInstanceSettingsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n settings: marshalling.unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting)\n };\n};\nconst unmarshalDeleteInstanceACLRulesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DeleteInstanceACLRulesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n rules: marshalling.unmarshalArrayOfObject(data.rules, unmarshalACLRule)\n };\n};\nconst unmarshalDeleteInstanceSettingsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DeleteInstanceSettingsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n settings: marshalling.unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting)\n };\n};\nconst unmarshalInstanceMetrics = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'InstanceMetrics' failed as data isn't a dictionary.`\n );\n }\n return {\n timeseries: marshalling.unmarshalArrayOfObject(data.timeseries, customMarshalling.unmarshalTimeSeries)\n };\n};\nconst unmarshalListDatabaseBackupsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListDatabaseBackupsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n databaseBackups: marshalling.unmarshalArrayOfObject(\n data.database_backups,\n unmarshalDatabaseBackup\n ),\n totalCount: data.total_count\n };\n};\nconst unmarshalEngineSetting = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'EngineSetting' failed as data isn't a dictionary.`\n );\n }\n return {\n defaultValue: data.default_value,\n description: data.description,\n floatMax: data.float_max,\n floatMin: data.float_min,\n hotConfigurable: data.hot_configurable,\n intMax: data.int_max,\n intMin: data.int_min,\n name: data.name,\n propertyType: data.property_type,\n stringConstraint: data.string_constraint,\n unit: data.unit\n };\n};\nconst unmarshalEngineVersion = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'EngineVersion' failed as data isn't a dictionary.`\n );\n }\n return {\n availableInitSettings: marshalling.unmarshalArrayOfObject(\n data.available_init_settings,\n unmarshalEngineSetting\n ),\n availableSettings: marshalling.unmarshalArrayOfObject(\n data.available_settings,\n unmarshalEngineSetting\n ),\n beta: data.beta,\n disabled: data.disabled,\n endOfLife: marshalling.unmarshalDate(data.end_of_life),\n name: data.name,\n version: data.version\n };\n};\nconst unmarshalDatabaseEngine = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DatabaseEngine' failed as data isn't a dictionary.`\n );\n }\n return {\n logoUrl: data.logo_url,\n name: data.name,\n region: data.region,\n versions: marshalling.unmarshalArrayOfObject(data.versions, unmarshalEngineVersion)\n };\n};\nconst unmarshalListDatabaseEnginesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListDatabaseEnginesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n engines: marshalling.unmarshalArrayOfObject(data.engines, unmarshalDatabaseEngine),\n totalCount: data.total_count\n };\n};\nconst unmarshalListDatabasesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListDatabasesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n databases: marshalling.unmarshalArrayOfObject(data.databases, unmarshalDatabase),\n totalCount: data.total_count\n };\n};\nconst unmarshalListInstanceACLRulesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListInstanceACLRulesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n rules: marshalling.unmarshalArrayOfObject(data.rules, unmarshalACLRule),\n totalCount: data.total_count\n };\n};\nconst unmarshalListInstanceLogsDetailsResponseInstanceLogDetail = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListInstanceLogsDetailsResponseInstanceLogDetail' failed as data isn't a dictionary.`\n );\n }\n return {\n logName: data.log_name,\n size: data.size\n };\n};\nconst unmarshalListInstanceLogsDetailsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListInstanceLogsDetailsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n details: marshalling.unmarshalArrayOfObject(\n data.details,\n unmarshalListInstanceLogsDetailsResponseInstanceLogDetail\n )\n };\n};\nconst unmarshalListInstanceLogsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListInstanceLogsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n instanceLogs: marshalling.unmarshalArrayOfObject(\n data.instance_logs,\n unmarshalInstanceLog\n )\n };\n};\nconst unmarshalListInstancesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListInstancesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n instances: marshalling.unmarshalArrayOfObject(data.instances, unmarshalInstance),\n totalCount: data.total_count\n };\n};\nconst unmarshalNodeTypeVolumeConstraintSizes = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'NodeTypeVolumeConstraintSizes' failed as data isn't a dictionary.`\n );\n }\n return {\n maxSize: data.max_size,\n minSize: data.min_size\n };\n};\nconst unmarshalNodeTypeVolumeType = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'NodeTypeVolumeType' failed as data isn't a dictionary.`\n );\n }\n return {\n chunkSize: data.chunk_size,\n class: data.class,\n description: data.description,\n maxSize: data.max_size,\n minSize: data.min_size,\n type: data.type\n };\n};\nconst unmarshalNodeType = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'NodeType' failed as data isn't a dictionary.`\n );\n }\n return {\n availableVolumeTypes: marshalling.unmarshalArrayOfObject(\n data.available_volume_types,\n unmarshalNodeTypeVolumeType\n ),\n beta: data.beta,\n description: data.description,\n disabled: data.disabled,\n generation: data.generation,\n instanceRange: data.instance_range,\n isBssdCompatible: data.is_bssd_compatible,\n isHaRequired: data.is_ha_required,\n memory: data.memory,\n name: data.name,\n region: data.region,\n stockStatus: data.stock_status,\n vcpus: data.vcpus,\n volumeConstraint: data.volume_constraint ? unmarshalNodeTypeVolumeConstraintSizes(data.volume_constraint) : void 0\n };\n};\nconst unmarshalListNodeTypesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListNodeTypesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n nodeTypes: marshalling.unmarshalArrayOfObject(data.node_types, unmarshalNodeType),\n totalCount: data.total_count\n };\n};\nconst unmarshalListPrivilegesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListPrivilegesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n privileges: marshalling.unmarshalArrayOfObject(data.privileges, unmarshalPrivilege),\n totalCount: data.total_count\n };\n};\nconst unmarshalListSnapshotsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListSnapshotsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n snapshots: marshalling.unmarshalArrayOfObject(data.snapshots, unmarshalSnapshot),\n totalCount: data.total_count\n };\n};\nconst unmarshalListUsersResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListUsersResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n totalCount: data.total_count,\n users: marshalling.unmarshalArrayOfObject(data.users, unmarshalUser)\n };\n};\nconst unmarshalPrepareInstanceLogsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'PrepareInstanceLogsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n instanceLogs: marshalling.unmarshalArrayOfObject(\n data.instance_logs,\n unmarshalInstanceLog\n )\n };\n};\nconst unmarshalSetInstanceACLRulesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SetInstanceACLRulesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n rules: marshalling.unmarshalArrayOfObject(data.rules, unmarshalACLRule)\n };\n};\nconst unmarshalSetInstanceSettingsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SetInstanceSettingsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n settings: marshalling.unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting)\n };\n};\nconst marshalACLRuleRequest = (request, defaults) => ({\n description: request.description,\n ip: request.ip\n});\nconst marshalAddInstanceACLRulesRequest = (request, defaults) => ({\n rules: request.rules.map((elt) => marshalACLRuleRequest(elt))\n});\nconst marshalInstanceSetting = (request, defaults) => ({\n name: request.name,\n value: request.value\n});\nconst marshalAddInstanceSettingsRequest = (request, defaults) => ({\n settings: request.settings.map((elt) => marshalInstanceSetting(elt))\n});\nconst marshalCloneInstanceRequest = (request, defaults) => ({\n name: request.name,\n node_type: request.nodeType\n});\nconst marshalCreateDatabaseBackupRequest = (request, defaults) => ({\n database_name: request.databaseName,\n expires_at: request.expiresAt,\n instance_id: request.instanceId,\n name: request.name || randomName(\"bkp\")\n});\nconst marshalCreateDatabaseRequest = (request, defaults) => ({\n name: request.name\n});\nconst marshalEndpointSpecPrivateNetworkIpamConfig = (request, defaults) => ({});\nconst marshalEndpointSpecLoadBalancer = (request, defaults) => ({});\nconst marshalEndpointSpecPrivateNetwork = (request, defaults) => ({\n private_network_id: request.privateNetworkId,\n ...marshalling.resolveOneOf([\n { param: \"service_ip\", value: request.serviceIp },\n {\n param: \"ipam_config\",\n value: request.ipamConfig !== void 0 ? marshalEndpointSpecPrivateNetworkIpamConfig(\n request.ipamConfig\n ) : void 0\n }\n ])\n});\nconst marshalEndpointSpec = (request, defaults) => ({\n ...marshalling.resolveOneOf([\n {\n param: \"load_balancer\",\n value: request.loadBalancer !== void 0 ? marshalEndpointSpecLoadBalancer(request.loadBalancer) : void 0\n },\n {\n param: \"private_network\",\n value: request.privateNetwork !== void 0 ? marshalEndpointSpecPrivateNetwork(request.privateNetwork) : void 0\n }\n ])\n});\nconst marshalCreateEndpointRequest = (request, defaults) => ({\n endpoint_spec: request.endpointSpec !== void 0 ? marshalEndpointSpec(request.endpointSpec) : void 0\n});\nconst marshalCreateInstanceFromSnapshotRequest = (request, defaults) => ({\n instance_name: request.instanceName,\n is_ha_cluster: request.isHaCluster,\n node_type: request.nodeType\n});\nconst marshalEncryptionAtRest = (request, defaults) => ({\n enabled: request.enabled\n});\nconst marshalCreateInstanceRequest = (request, defaults) => ({\n backup_same_region: request.backupSameRegion,\n disable_backup: request.disableBackup,\n encryption: request.encryption !== void 0 ? marshalEncryptionAtRest(request.encryption) : void 0,\n engine: request.engine,\n init_endpoints: request.initEndpoints !== void 0 ? request.initEndpoints.map((elt) => marshalEndpointSpec(elt)) : void 0,\n init_settings: request.initSettings !== void 0 ? request.initSettings.map((elt) => marshalInstanceSetting(elt)) : void 0,\n is_ha_cluster: request.isHaCluster,\n name: request.name || randomName(\"ins\"),\n node_type: request.nodeType,\n password: request.password,\n tags: request.tags,\n user_name: request.userName,\n volume_size: request.volumeSize,\n volume_type: request.volumeType,\n ...marshalling.resolveOneOf([\n {\n default: defaults.defaultProjectId,\n param: \"project_id\",\n value: request.projectId\n },\n {\n default: defaults.defaultOrganizationId,\n param: \"organization_id\",\n value: request.organizationId\n }\n ])\n});\nconst marshalReadReplicaEndpointSpecPrivateNetworkIpamConfig = (request, defaults) => ({});\nconst marshalReadReplicaEndpointSpecDirectAccess = (request, defaults) => ({});\nconst marshalReadReplicaEndpointSpecPrivateNetwork = (request, defaults) => ({\n private_network_id: request.privateNetworkId,\n ...marshalling.resolveOneOf([\n { param: \"service_ip\", value: request.serviceIp },\n {\n param: \"ipam_config\",\n value: request.ipamConfig !== void 0 ? marshalReadReplicaEndpointSpecPrivateNetworkIpamConfig(\n request.ipamConfig\n ) : void 0\n }\n ])\n});\nconst marshalReadReplicaEndpointSpec = (request, defaults) => ({\n ...marshalling.resolveOneOf([\n {\n param: \"direct_access\",\n value: request.directAccess !== void 0 ? marshalReadReplicaEndpointSpecDirectAccess(\n request.directAccess\n ) : void 0\n },\n {\n param: \"private_network\",\n value: request.privateNetwork !== void 0 ? marshalReadReplicaEndpointSpecPrivateNetwork(\n request.privateNetwork\n ) : void 0\n }\n ])\n});\nconst marshalCreateReadReplicaEndpointRequest = (request, defaults) => ({\n endpoint_spec: request.endpointSpec.map(\n (elt) => marshalReadReplicaEndpointSpec(elt)\n )\n});\nconst marshalCreateReadReplicaRequest = (request, defaults) => ({\n endpoint_spec: request.endpointSpec !== void 0 ? request.endpointSpec.map(\n (elt) => marshalReadReplicaEndpointSpec(elt)\n ) : void 0,\n instance_id: request.instanceId,\n same_zone: request.sameZone\n});\nconst marshalCreateSnapshotRequest = (request, defaults) => ({\n expires_at: request.expiresAt,\n name: request.name || randomName(\"snp\")\n});\nconst marshalCreateUserRequest = (request, defaults) => ({\n is_admin: request.isAdmin,\n name: request.name,\n password: request.password\n});\nconst marshalDeleteInstanceACLRulesRequest = (request, defaults) => ({\n acl_rule_ips: request.aclRuleIps\n});\nconst marshalDeleteInstanceSettingsRequest = (request, defaults) => ({\n setting_names: request.settingNames\n});\nconst marshalMigrateEndpointRequest = (request, defaults) => ({\n instance_id: request.instanceId\n});\nconst marshalPrepareInstanceLogsRequest = (request, defaults) => ({\n end_date: request.endDate,\n start_date: request.startDate\n});\nconst marshalPurgeInstanceLogsRequest = (request, defaults) => ({\n log_name: request.logName\n});\nconst marshalRestoreDatabaseBackupRequest = (request, defaults) => ({\n database_name: request.databaseName,\n instance_id: request.instanceId\n});\nconst marshalSetInstanceACLRulesRequest = (request, defaults) => ({\n rules: request.rules.map((elt) => marshalACLRuleRequest(elt))\n});\nconst marshalSetInstanceSettingsRequest = (request, defaults) => ({\n settings: request.settings.map((elt) => marshalInstanceSetting(elt))\n});\nconst marshalSetPrivilegeRequest = (request, defaults) => ({\n database_name: request.databaseName,\n permission: request.permission,\n user_name: request.userName\n});\nconst marshalUpdateDatabaseBackupRequest = (request, defaults) => ({\n expires_at: request.expiresAt,\n name: request.name\n});\nconst marshalLogsPolicy = (request, defaults) => ({\n max_age_retention: request.maxAgeRetention,\n total_disk_retention: request.totalDiskRetention\n});\nconst marshalUpdateInstanceRequest = (request, defaults) => ({\n backup_same_region: request.backupSameRegion,\n backup_schedule_frequency: request.backupScheduleFrequency,\n backup_schedule_retention: request.backupScheduleRetention,\n backup_schedule_start_hour: request.backupScheduleStartHour,\n is_backup_schedule_disabled: request.isBackupScheduleDisabled,\n logs_policy: request.logsPolicy !== void 0 ? marshalLogsPolicy(request.logsPolicy) : void 0,\n name: request.name,\n tags: request.tags\n});\nconst marshalUpdateSnapshotRequest = (request, defaults) => ({\n expires_at: request.expiresAt,\n name: request.name\n});\nconst marshalUpdateUserRequest = (request, defaults) => ({\n is_admin: request.isAdmin,\n password: request.password\n});\nconst marshalUpgradeInstanceRequestMajorUpgradeWorkflow = (request, defaults) => ({\n upgradable_version_id: request.upgradableVersionId,\n with_endpoints: request.withEndpoints\n});\nconst marshalUpgradeInstanceRequest = (request, defaults) => ({\n ...marshalling.resolveOneOf([\n { param: \"node_type\", value: request.nodeType },\n { param: \"enable_ha\", value: request.enableHa },\n { param: \"volume_size\", value: request.volumeSize },\n { param: \"volume_type\", value: request.volumeType },\n { param: \"upgradable_version_id\", value: request.upgradableVersionId },\n {\n param: \"major_upgrade_workflow\",\n value: request.majorUpgradeWorkflow !== void 0 ? marshalUpgradeInstanceRequestMajorUpgradeWorkflow(\n request.majorUpgradeWorkflow\n ) : void 0\n }\n ])\n});\nexports.marshalAddInstanceACLRulesRequest = marshalAddInstanceACLRulesRequest;\nexports.marshalAddInstanceSettingsRequest = marshalAddInstanceSettingsRequest;\nexports.marshalCloneInstanceRequest = marshalCloneInstanceRequest;\nexports.marshalCreateDatabaseBackupRequest = marshalCreateDatabaseBackupRequest;\nexports.marshalCreateDatabaseRequest = marshalCreateDatabaseRequest;\nexports.marshalCreateEndpointRequest = marshalCreateEndpointRequest;\nexports.marshalCreateInstanceFromSnapshotRequest = marshalCreateInstanceFromSnapshotRequest;\nexports.marshalCreateInstanceRequest = marshalCreateInstanceRequest;\nexports.marshalCreateReadReplicaEndpointRequest = marshalCreateReadReplicaEndpointRequest;\nexports.marshalCreateReadReplicaRequest = marshalCreateReadReplicaRequest;\nexports.marshalCreateSnapshotRequest = marshalCreateSnapshotRequest;\nexports.marshalCreateUserRequest = marshalCreateUserRequest;\nexports.marshalDeleteInstanceACLRulesRequest = marshalDeleteInstanceACLRulesRequest;\nexports.marshalDeleteInstanceSettingsRequest = marshalDeleteInstanceSettingsRequest;\nexports.marshalMigrateEndpointRequest = marshalMigrateEndpointRequest;\nexports.marshalPrepareInstanceLogsRequest = marshalPrepareInstanceLogsRequest;\nexports.marshalPurgeInstanceLogsRequest = marshalPurgeInstanceLogsRequest;\nexports.marshalRestoreDatabaseBackupRequest = marshalRestoreDatabaseBackupRequest;\nexports.marshalSetInstanceACLRulesRequest = marshalSetInstanceACLRulesRequest;\nexports.marshalSetInstanceSettingsRequest = marshalSetInstanceSettingsRequest;\nexports.marshalSetPrivilegeRequest = marshalSetPrivilegeRequest;\nexports.marshalUpdateDatabaseBackupRequest = marshalUpdateDatabaseBackupRequest;\nexports.marshalUpdateInstanceRequest = marshalUpdateInstanceRequest;\nexports.marshalUpdateSnapshotRequest = marshalUpdateSnapshotRequest;\nexports.marshalUpdateUserRequest = marshalUpdateUserRequest;\nexports.marshalUpgradeInstanceRequest = marshalUpgradeInstanceRequest;\nexports.unmarshalACLRule = unmarshalACLRule;\nexports.unmarshalAddInstanceACLRulesResponse = unmarshalAddInstanceACLRulesResponse;\nexports.unmarshalAddInstanceSettingsResponse = unmarshalAddInstanceSettingsResponse;\nexports.unmarshalBackupSchedule = unmarshalBackupSchedule;\nexports.unmarshalDatabase = unmarshalDatabase;\nexports.unmarshalDatabaseBackup = unmarshalDatabaseBackup;\nexports.unmarshalDeleteInstanceACLRulesResponse = unmarshalDeleteInstanceACLRulesResponse;\nexports.unmarshalDeleteInstanceSettingsResponse = unmarshalDeleteInstanceSettingsResponse;\nexports.unmarshalEndpoint = unmarshalEndpoint;\nexports.unmarshalInstance = unmarshalInstance;\nexports.unmarshalInstanceLog = unmarshalInstanceLog;\nexports.unmarshalInstanceMetrics = unmarshalInstanceMetrics;\nexports.unmarshalListDatabaseBackupsResponse = unmarshalListDatabaseBackupsResponse;\nexports.unmarshalListDatabaseEnginesResponse = unmarshalListDatabaseEnginesResponse;\nexports.unmarshalListDatabasesResponse = unmarshalListDatabasesResponse;\nexports.unmarshalListInstanceACLRulesResponse = unmarshalListInstanceACLRulesResponse;\nexports.unmarshalListInstanceLogsDetailsResponse = unmarshalListInstanceLogsDetailsResponse;\nexports.unmarshalListInstanceLogsResponse = unmarshalListInstanceLogsResponse;\nexports.unmarshalListInstancesResponse = unmarshalListInstancesResponse;\nexports.unmarshalListNodeTypesResponse = unmarshalListNodeTypesResponse;\nexports.unmarshalListPrivilegesResponse = unmarshalListPrivilegesResponse;\nexports.unmarshalListSnapshotsResponse = unmarshalListSnapshotsResponse;\nexports.unmarshalListUsersResponse = unmarshalListUsersResponse;\nexports.unmarshalMaintenance = unmarshalMaintenance;\nexports.unmarshalPrepareInstanceLogsResponse = unmarshalPrepareInstanceLogsResponse;\nexports.unmarshalPrivilege = unmarshalPrivilege;\nexports.unmarshalReadReplica = unmarshalReadReplica;\nexports.unmarshalSetInstanceACLRulesResponse = unmarshalSetInstanceACLRulesResponse;\nexports.unmarshalSetInstanceSettingsResponse = unmarshalSetInstanceSettingsResponse;\nexports.unmarshalSnapshot = unmarshalSnapshot;\nexports.unmarshalUser = unmarshalUser;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst UpdateInstanceRequest = {\n backupScheduleStartHour: {\n lessThanOrEqual: 23\n }\n};\nexports.UpdateInstanceRequest = UpdateInstanceRequest;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst index_gen = require(\"./v1/index.gen.cjs\");\nexports.v1 = index_gen;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst intervalRetrier = require(\"../../../internal/async/interval-retrier.cjs\");\nconst api = require(\"../../../scw/api.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst resourcePaginator = require(\"../../../scw/fetch/resource-paginator.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nconst marshalling_gen = require(\"./marshalling.gen.cjs\");\nconst jsonContentHeaders = {\n \"Content-Type\": \"application/json; charset=utf-8\"\n};\nclass API extends api.API {\n /** Lists the available zones of the API. */\n static LOCALITIES = [\n \"fr-par-1\",\n \"fr-par-2\",\n \"nl-ams-1\",\n \"nl-ams-2\",\n \"pl-waw-1\",\n \"pl-waw-2\"\n ];\n /**\n * Create a Redis™ Database Instance. Create a new Redis™ Database Instance\n * (Redis™ cluster). You must set the `zone`, `project_id`, `version`,\n * `node_type`, `user_name` and `password` parameters. Optionally you can\n * define `acl_rules`, `endpoints`, `tls_enabled` and `cluster_settings`.\n *\n * @param request - The request {@link CreateClusterRequest}\n * @returns A Promise of Cluster\n */\n createCluster = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateClusterRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/redis/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/clusters`\n },\n marshalling_gen.unmarshalCluster\n );\n /**\n * Update a Redis™ Database Instance. Update the parameters of a Redis™\n * Database Instance (Redis™ cluster), including `name`, `tags`, `user_name`\n * and `password`.\n *\n * @param request - The request {@link UpdateClusterRequest}\n * @returns A Promise of Cluster\n */\n updateCluster = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateClusterRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/redis/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/clusters/${marshalling.validatePathParam(\"clusterId\", request.clusterId)}`\n },\n marshalling_gen.unmarshalCluster\n );\n /**\n * Get a Redis™ Database Instance. Retrieve information about a Redis™\n * Database Instance (Redis™ cluster). Specify the `cluster_id` and `region`\n * in your request to get information such as `id`, `status`, `version`,\n * `tls_enabled`, `cluster_settings`, `upgradable_versions` and `endpoints`\n * about your cluster in the response.\n *\n * @param request - The request {@link GetClusterRequest}\n * @returns A Promise of Cluster\n */\n getCluster = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/redis/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/clusters/${marshalling.validatePathParam(\"clusterId\", request.clusterId)}`\n },\n marshalling_gen.unmarshalCluster\n );\n /**\n * Waits for {@link Cluster} to be in a final state.\n *\n * @param request - The request {@link GetClusterRequest}\n * @param options - The waiting options\n * @returns A Promise of Cluster\n */\n waitForCluster = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(!content_gen.CLUSTER_TRANSIENT_STATUSES.includes(res.status))),\n this.getCluster,\n request,\n options\n );\n pageOfListClusters = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/redis/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/clusters`,\n urlParams: marshalling.urlParams(\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId],\n [\"tags\", request.tags],\n [\"version\", request.version]\n )\n },\n marshalling_gen.unmarshalListClustersResponse\n );\n /**\n * List Redis™ Database Instances. List all Redis™ Database Instances (Redis™\n * cluster) in the specified zone. By default, the Database Instances returned\n * in the list are ordered by creation date in ascending order, though this\n * can be modified via the order_by field. You can define additional\n * parameters for your query, such as `tags`, `name`, `organization_id` and\n * `version`.\n *\n * @param request - The request {@link ListClustersRequest}\n * @returns A Promise of ListClustersResponse\n */\n listClusters = (request = {}) => resourcePaginator.enrichForPagination(\"clusters\", this.pageOfListClusters, request);\n /**\n * Scale up a Redis™ Database Instance. Upgrade your Redis™ Database Instance,\n * either by upgrading to a bigger node type (vertical scaling) or by adding\n * more nodes to your Database Instance to increase your number of endpoints\n * and distribute cache (horizontal scaling, available for clusters only).\n * Note that scaling horizontally your Redis™ Database Instance will not renew\n * its TLS certificate. In order to refresh the TLS certificate, you must use\n * the Renew TLS certificate endpoint.\n *\n * @param request - The request {@link MigrateClusterRequest}\n * @returns A Promise of Cluster\n */\n migrateCluster = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalMigrateClusterRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/redis/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/clusters/${marshalling.validatePathParam(\"clusterId\", request.clusterId)}/migrate`\n },\n marshalling_gen.unmarshalCluster\n );\n /**\n * Delete a Redis™ Database Instance. Delete a Redis™ Database Instance\n * (Redis™ cluster), specified by the `region` and `cluster_id` parameters.\n * Deleting a Database Instance is permanent, and cannot be undone. Note that\n * upon deletion all your data will be lost.\n *\n * @param request - The request {@link DeleteClusterRequest}\n * @returns A Promise of Cluster\n */\n deleteCluster = (request) => this.client.fetch(\n {\n method: \"DELETE\",\n path: `/redis/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/clusters/${marshalling.validatePathParam(\"clusterId\", request.clusterId)}`\n },\n marshalling_gen.unmarshalCluster\n );\n /**\n * Get metrics of a Redis™ Database Instance. Retrieve the metrics of a Redis™\n * Database Instance (Redis™ cluster). You can define the period from which to\n * retrieve metrics by specifying the `start_date` and `end_date`.\n *\n * @param request - The request {@link GetClusterMetricsRequest}\n * @returns A Promise of ClusterMetricsResponse\n */\n getClusterMetrics = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/redis/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/clusters/${marshalling.validatePathParam(\"clusterId\", request.clusterId)}/metrics`,\n urlParams: marshalling.urlParams(\n [\"end_at\", request.endAt],\n [\"metric_name\", request.metricName],\n [\"start_at\", request.startAt]\n )\n },\n marshalling_gen.unmarshalClusterMetricsResponse\n );\n pageOfListNodeTypes = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/redis/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/node-types`,\n urlParams: marshalling.urlParams(\n [\"include_disabled_types\", request.includeDisabledTypes],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListNodeTypesResponse\n );\n /**\n * List available node types. List all available node types. By default, the\n * node types returned in the list are ordered by creation date in ascending\n * order, though this can be modified via the `order_by` field.\n *\n * @param request - The request {@link ListNodeTypesRequest}\n * @returns A Promise of ListNodeTypesResponse\n */\n listNodeTypes = (request) => resourcePaginator.enrichForPagination(\"nodeTypes\", this.pageOfListNodeTypes, request);\n pageOfListClusterVersions = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/redis/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/cluster-versions`,\n urlParams: marshalling.urlParams(\n [\"include_beta\", request.includeBeta],\n [\"include_deprecated\", request.includeDeprecated],\n [\"include_disabled\", request.includeDisabled],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"version\", request.version]\n )\n },\n marshalling_gen.unmarshalListClusterVersionsResponse\n );\n /**\n * List available Redis™ versions. List the Redis™ database engine versions\n * available. You can define additional parameters for your query, such as\n * `include_disabled`, `include_beta`, `include_deprecated` and `version`.\n *\n * @param request - The request {@link ListClusterVersionsRequest}\n * @returns A Promise of ListClusterVersionsResponse\n */\n listClusterVersions = (request) => resourcePaginator.enrichForPagination(\"versions\", this.pageOfListClusterVersions, request);\n /**\n * Get the TLS certificate of a cluster. Retrieve information about the TLS\n * certificate of a Redis™ Database Instance (Redis™ cluster). Details like\n * name and content are returned in the response.\n *\n * @param request - The request {@link GetClusterCertificateRequest}\n * @returns A Promise of Blob\n */\n getClusterCertificate = (request) => this.client.fetch({\n method: \"GET\",\n path: `/redis/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/clusters/${marshalling.validatePathParam(\"clusterId\", request.clusterId)}/certificate`,\n urlParams: marshalling.urlParams([\"dl\", 1]),\n responseType: \"blob\"\n });\n /**\n * Renew the TLS certificate of a cluster. Renew a TLS certificate for a\n * Redis™ Database Instance (Redis™ cluster). Renewing a certificate means\n * that you will not be able to connect to your Database Instance using the\n * previous certificate. You will also need to download and update the new\n * certificate for all database clients.\n *\n * @param request - The request {@link RenewClusterCertificateRequest}\n * @returns A Promise of Cluster\n */\n renewClusterCertificate = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/redis/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/clusters/${marshalling.validatePathParam(\"clusterId\", request.clusterId)}/renew-certificate`\n },\n marshalling_gen.unmarshalCluster\n );\n /**\n * Add advanced settings. Add an advanced setting to a Redis™ Database\n * Instance (Redis™ cluster). You must set the `name` and the `value` of each\n * setting.\n *\n * @param request - The request {@link AddClusterSettingsRequest}\n * @returns A Promise of ClusterSettingsResponse\n */\n addClusterSettings = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalAddClusterSettingsRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/redis/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/clusters/${marshalling.validatePathParam(\"clusterId\", request.clusterId)}/settings`\n },\n marshalling_gen.unmarshalClusterSettingsResponse\n );\n /**\n * Delete advanced setting. Delete an advanced setting in a Redis™ Database\n * Instance (Redis™ cluster). You must specify the names of the settings you\n * want to delete in the request body.\n *\n * @param request - The request {@link DeleteClusterSettingRequest}\n * @returns A Promise of Cluster\n */\n deleteClusterSetting = (request) => this.client.fetch(\n {\n method: \"DELETE\",\n path: `/redis/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/clusters/${marshalling.validatePathParam(\"clusterId\", request.clusterId)}/settings/${marshalling.validatePathParam(\"settingName\", request.settingName)}`\n },\n marshalling_gen.unmarshalCluster\n );\n /**\n * Set advanced settings. Update an advanced setting for a Redis™ Database\n * Instance (Redis™ cluster). Settings added upon database engine\n * initalization can only be defined once, and cannot, therefore, be updated.\n *\n * @param request - The request {@link SetClusterSettingsRequest}\n * @returns A Promise of ClusterSettingsResponse\n */\n setClusterSettings = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalSetClusterSettingsRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PUT\",\n path: `/redis/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/clusters/${marshalling.validatePathParam(\"clusterId\", request.clusterId)}/settings`\n },\n marshalling_gen.unmarshalClusterSettingsResponse\n );\n /**\n * Set ACL rules for a cluster. Replace all the ACL rules of a Redis™ Database\n * Instance (Redis™ cluster).\n *\n * @param request - The request {@link SetAclRulesRequest}\n * @returns A Promise of SetAclRulesResponse\n */\n setAclRules = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalSetAclRulesRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PUT\",\n path: `/redis/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/clusters/${marshalling.validatePathParam(\"clusterId\", request.clusterId)}/acls`\n },\n marshalling_gen.unmarshalSetAclRulesResponse\n );\n /**\n * Add ACL rules for a cluster. Add an additional ACL rule to a Redis™\n * Database Instance (Redis™ cluster).\n *\n * @param request - The request {@link AddAclRulesRequest}\n * @returns A Promise of AddAclRulesResponse\n */\n addAclRules = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalAddAclRulesRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/redis/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/clusters/${marshalling.validatePathParam(\"clusterId\", request.clusterId)}/acls`\n },\n marshalling_gen.unmarshalAddAclRulesResponse\n );\n /**\n * Delete an ACL rule for a cluster. Delete an ACL rule of a Redis™ Database\n * Instance (Redis™ cluster). You must specify the `acl_id` of the rule you\n * want to delete in your request.\n *\n * @param request - The request {@link DeleteAclRuleRequest}\n * @returns A Promise of Cluster\n */\n deleteAclRule = (request) => this.client.fetch(\n {\n method: \"DELETE\",\n path: `/redis/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/acls/${marshalling.validatePathParam(\"aclId\", request.aclId)}`\n },\n marshalling_gen.unmarshalCluster\n );\n /**\n * Get an ACL rule. Retrieve information about an ACL rule of a Redis™\n * Database Instance (Redis™ cluster). You must specify the `acl_id` of the\n * rule in your request.\n *\n * @param request - The request {@link GetAclRuleRequest}\n * @returns A Promise of ACLRule\n */\n getAclRule = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/redis/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/acls/${marshalling.validatePathParam(\"aclId\", request.aclId)}`\n },\n marshalling_gen.unmarshalACLRule\n );\n /**\n * Set endpoints for a cluster. Update an endpoint for a Redis™ Database\n * Instance (Redis™ cluster). You must specify the `cluster_id` and the\n * `endpoints` parameters in your request.\n *\n * @param request - The request {@link SetEndpointsRequest}\n * @returns A Promise of SetEndpointsResponse\n */\n setEndpoints = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalSetEndpointsRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PUT\",\n path: `/redis/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/clusters/${marshalling.validatePathParam(\"clusterId\", request.clusterId)}/endpoints`\n },\n marshalling_gen.unmarshalSetEndpointsResponse\n );\n /**\n * Add endpoints for a cluster. Add a new endpoint for a Redis™ Database\n * Instance (Redis™ cluster). You can add `private_network` or\n * `public_network` specifications to the body of the request.\n *\n * @param request - The request {@link AddEndpointsRequest}\n * @returns A Promise of AddEndpointsResponse\n */\n addEndpoints = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalAddEndpointsRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/redis/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/clusters/${marshalling.validatePathParam(\"clusterId\", request.clusterId)}/endpoints`\n },\n marshalling_gen.unmarshalAddEndpointsResponse\n );\n /**\n * Delete an endpoint for a cluster. Delete the endpoint of a Redis™ Database\n * Instance (Redis™ cluster). You must specify the `region` and `endpoint_id`\n * parameters of the endpoint you want to delete. Note that might need to\n * update any environment configurations that point to the deleted endpoint.\n *\n * @param request - The request {@link DeleteEndpointRequest}\n * @returns A Promise of Cluster\n */\n deleteEndpoint = (request) => this.client.fetch(\n {\n method: \"DELETE\",\n path: `/redis/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/endpoints/${marshalling.validatePathParam(\"endpointId\", request.endpointId)}`\n },\n marshalling_gen.unmarshalCluster\n );\n /**\n * Get an endpoint. Retrieve information about a Redis™ Database Instance\n * (Redis™ cluster) endpoint. Full details about the endpoint, like `ips`,\n * `port`, `private_network` and `public_network` specifications are returned\n * in the response.\n *\n * @param request - The request {@link GetEndpointRequest}\n * @returns A Promise of Endpoint\n */\n getEndpoint = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/redis/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/endpoints/${marshalling.validatePathParam(\"endpointId\", request.endpointId)}`\n },\n marshalling_gen.unmarshalEndpoint\n );\n /**\n * Update an endpoint. Update information about a Redis™ Database Instance\n * (Redis™ cluster) endpoint. Full details about the endpoint, like `ips`,\n * `port`, `private_network` and `public_network` specifications are returned\n * in the response.\n *\n * @param request - The request {@link UpdateEndpointRequest}\n * @returns A Promise of Endpoint\n */\n updateEndpoint = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateEndpointRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/redis/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/endpoints/${marshalling.validatePathParam(\"endpointId\", request.endpointId)}`\n },\n marshalling_gen.unmarshalEndpoint\n );\n}\nexports.API = API;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst CLUSTER_TRANSIENT_STATUSES = [\n \"provisioning\",\n \"configuring\",\n \"deleting\",\n \"autohealing\",\n \"initializing\"\n];\nexports.CLUSTER_TRANSIENT_STATUSES = CLUSTER_TRANSIENT_STATUSES;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api_gen = require(\"./api.gen.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nexports.API = api_gen.API;\nexports.CLUSTER_TRANSIENT_STATUSES = content_gen.CLUSTER_TRANSIENT_STATUSES;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst randomName = require(\"@scaleway/random-name\");\nconst json = require(\"../../../helpers/json.cjs\");\nconst customMarshalling = require(\"../../../scw/custom-marshalling.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nconst unmarshalACLRule = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ACLRule' failed as data isn't a dictionary.`\n );\n }\n return {\n description: data.description,\n id: data.id,\n ipCidr: data.ip_cidr\n };\n};\nconst unmarshalPrivateNetwork = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'PrivateNetwork' failed as data isn't a dictionary.`\n );\n }\n return {\n id: data.id,\n provisioningMode: data.provisioning_mode,\n serviceIps: data.service_ips,\n zone: data.zone\n };\n};\nconst unmarshalPublicNetwork = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'PublicNetwork' failed as data isn't a dictionary.`\n );\n }\n return {};\n};\nconst unmarshalEndpoint = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Endpoint' failed as data isn't a dictionary.`\n );\n }\n return {\n id: data.id,\n ips: data.ips,\n port: data.port,\n privateNetwork: data.private_network ? unmarshalPrivateNetwork(data.private_network) : void 0,\n publicNetwork: data.public_network ? unmarshalPublicNetwork(data.public_network) : void 0\n };\n};\nconst unmarshalClusterSetting = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ClusterSetting' failed as data isn't a dictionary.`\n );\n }\n return {\n name: data.name,\n value: data.value\n };\n};\nconst unmarshalCluster = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Cluster' failed as data isn't a dictionary.`\n );\n }\n return {\n aclRules: marshalling.unmarshalArrayOfObject(data.acl_rules, unmarshalACLRule),\n clusterSettings: marshalling.unmarshalArrayOfObject(\n data.cluster_settings,\n unmarshalClusterSetting\n ),\n clusterSize: data.cluster_size,\n createdAt: marshalling.unmarshalDate(data.created_at),\n endpoints: marshalling.unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint),\n id: data.id,\n name: data.name,\n nodeType: data.node_type,\n projectId: data.project_id,\n status: data.status,\n tags: data.tags,\n tlsEnabled: data.tls_enabled,\n updatedAt: marshalling.unmarshalDate(data.updated_at),\n upgradableVersions: data.upgradable_versions,\n userName: data.user_name,\n version: data.version,\n zone: data.zone\n };\n};\nconst unmarshalAddAclRulesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'AddAclRulesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n aclRules: marshalling.unmarshalArrayOfObject(data.acl_rules, unmarshalACLRule),\n totalCount: data.total_count\n };\n};\nconst unmarshalAddEndpointsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'AddEndpointsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n endpoints: marshalling.unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint),\n totalCount: data.total_count\n };\n};\nconst unmarshalClusterMetricsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ClusterMetricsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n timeseries: marshalling.unmarshalArrayOfObject(data.timeseries, customMarshalling.unmarshalTimeSeries)\n };\n};\nconst unmarshalClusterSettingsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ClusterSettingsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n settings: marshalling.unmarshalArrayOfObject(data.settings, unmarshalClusterSetting)\n };\n};\nconst unmarshalAvailableClusterSetting = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'AvailableClusterSetting' failed as data isn't a dictionary.`\n );\n }\n return {\n defaultValue: data.default_value,\n deprecated: data.deprecated,\n description: data.description,\n maxValue: data.max_value,\n minValue: data.min_value,\n name: data.name,\n regex: data.regex,\n type: data.type\n };\n};\nconst unmarshalClusterVersion = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ClusterVersion' failed as data isn't a dictionary.`\n );\n }\n return {\n availableSettings: marshalling.unmarshalArrayOfObject(\n data.available_settings,\n unmarshalAvailableClusterSetting\n ),\n endOfLifeAt: marshalling.unmarshalDate(data.end_of_life_at),\n logoUrl: data.logo_url,\n version: data.version,\n zone: data.zone\n };\n};\nconst unmarshalListClusterVersionsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListClusterVersionsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n totalCount: data.total_count,\n versions: marshalling.unmarshalArrayOfObject(data.versions, unmarshalClusterVersion)\n };\n};\nconst unmarshalListClustersResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListClustersResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n clusters: marshalling.unmarshalArrayOfObject(data.clusters, unmarshalCluster),\n totalCount: data.total_count\n };\n};\nconst unmarshalNodeType = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'NodeType' failed as data isn't a dictionary.`\n );\n }\n return {\n beta: data.beta,\n description: data.description,\n disabled: data.disabled,\n memory: data.memory,\n name: data.name,\n stockStatus: data.stock_status,\n vcpus: data.vcpus,\n zone: data.zone\n };\n};\nconst unmarshalListNodeTypesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListNodeTypesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n nodeTypes: marshalling.unmarshalArrayOfObject(data.node_types, unmarshalNodeType),\n totalCount: data.total_count\n };\n};\nconst unmarshalSetAclRulesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SetAclRulesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n aclRules: marshalling.unmarshalArrayOfObject(data.acl_rules, unmarshalACLRule)\n };\n};\nconst unmarshalSetEndpointsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SetEndpointsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n endpoints: marshalling.unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint)\n };\n};\nconst marshalACLRuleSpec = (request, defaults) => ({\n description: request.description,\n ip_cidr: request.ipCidr\n});\nconst marshalAddAclRulesRequest = (request, defaults) => ({\n acl_rules: request.aclRules.map((elt) => marshalACLRuleSpec(elt))\n});\nconst marshalClusterSetting = (request, defaults) => ({\n name: request.name,\n value: request.value\n});\nconst marshalAddClusterSettingsRequest = (request, defaults) => ({\n settings: request.settings.map((elt) => marshalClusterSetting(elt))\n});\nconst marshalEndpointSpecPrivateNetworkSpecIpamConfig = (request, defaults) => ({});\nconst marshalEndpointSpecPrivateNetworkSpec = (request, defaults) => ({\n id: request.id,\n ipam_config: request.ipamConfig !== void 0 ? marshalEndpointSpecPrivateNetworkSpecIpamConfig(\n request.ipamConfig\n ) : void 0,\n service_ips: request.serviceIps\n});\nconst marshalEndpointSpecPublicNetworkSpec = (request, defaults) => ({});\nconst marshalEndpointSpec = (request, defaults) => ({\n ...marshalling.resolveOneOf([\n {\n param: \"private_network\",\n value: request.privateNetwork !== void 0 ? marshalEndpointSpecPrivateNetworkSpec(\n request.privateNetwork\n ) : void 0\n },\n {\n param: \"public_network\",\n value: request.publicNetwork !== void 0 ? marshalEndpointSpecPublicNetworkSpec(\n request.publicNetwork\n ) : void 0\n }\n ])\n});\nconst marshalAddEndpointsRequest = (request, defaults) => ({\n endpoints: request.endpoints.map((elt) => marshalEndpointSpec(elt))\n});\nconst marshalCreateClusterRequest = (request, defaults) => ({\n acl_rules: request.aclRules !== void 0 ? request.aclRules.map((elt) => marshalACLRuleSpec(elt)) : void 0,\n cluster_settings: request.clusterSettings !== void 0 ? request.clusterSettings.map((elt) => marshalClusterSetting(elt)) : void 0,\n cluster_size: request.clusterSize,\n endpoints: request.endpoints !== void 0 ? request.endpoints.map((elt) => marshalEndpointSpec(elt)) : void 0,\n name: request.name || randomName(\"ins\"),\n node_type: request.nodeType,\n password: request.password,\n project_id: request.projectId ?? defaults.defaultProjectId,\n tags: request.tags,\n tls_enabled: request.tlsEnabled,\n user_name: request.userName,\n version: request.version\n});\nconst marshalMigrateClusterRequest = (request, defaults) => ({\n ...marshalling.resolveOneOf([\n { param: \"version\", value: request.version },\n { param: \"node_type\", value: request.nodeType },\n { param: \"cluster_size\", value: request.clusterSize }\n ])\n});\nconst marshalSetAclRulesRequest = (request, defaults) => ({\n acl_rules: request.aclRules.map((elt) => marshalACLRuleSpec(elt))\n});\nconst marshalSetClusterSettingsRequest = (request, defaults) => ({\n settings: request.settings.map((elt) => marshalClusterSetting(elt))\n});\nconst marshalSetEndpointsRequest = (request, defaults) => ({\n endpoints: request.endpoints.map((elt) => marshalEndpointSpec(elt))\n});\nconst marshalUpdateClusterRequest = (request, defaults) => ({\n name: request.name,\n password: request.password,\n tags: request.tags,\n user_name: request.userName\n});\nconst marshalUpdateEndpointRequest = (request, defaults) => ({\n ...marshalling.resolveOneOf([\n {\n param: \"private_network\",\n value: request.privateNetwork !== void 0 ? marshalEndpointSpecPrivateNetworkSpec(\n request.privateNetwork\n ) : void 0\n },\n {\n param: \"public_network\",\n value: request.publicNetwork !== void 0 ? marshalEndpointSpecPublicNetworkSpec(\n request.publicNetwork\n ) : void 0\n }\n ])\n});\nexports.marshalAddAclRulesRequest = marshalAddAclRulesRequest;\nexports.marshalAddClusterSettingsRequest = marshalAddClusterSettingsRequest;\nexports.marshalAddEndpointsRequest = marshalAddEndpointsRequest;\nexports.marshalCreateClusterRequest = marshalCreateClusterRequest;\nexports.marshalMigrateClusterRequest = marshalMigrateClusterRequest;\nexports.marshalSetAclRulesRequest = marshalSetAclRulesRequest;\nexports.marshalSetClusterSettingsRequest = marshalSetClusterSettingsRequest;\nexports.marshalSetEndpointsRequest = marshalSetEndpointsRequest;\nexports.marshalUpdateClusterRequest = marshalUpdateClusterRequest;\nexports.marshalUpdateEndpointRequest = marshalUpdateEndpointRequest;\nexports.unmarshalACLRule = unmarshalACLRule;\nexports.unmarshalAddAclRulesResponse = unmarshalAddAclRulesResponse;\nexports.unmarshalAddEndpointsResponse = unmarshalAddEndpointsResponse;\nexports.unmarshalCluster = unmarshalCluster;\nexports.unmarshalClusterMetricsResponse = unmarshalClusterMetricsResponse;\nexports.unmarshalClusterSettingsResponse = unmarshalClusterSettingsResponse;\nexports.unmarshalEndpoint = unmarshalEndpoint;\nexports.unmarshalListClusterVersionsResponse = unmarshalListClusterVersionsResponse;\nexports.unmarshalListClustersResponse = unmarshalListClustersResponse;\nexports.unmarshalListNodeTypesResponse = unmarshalListNodeTypesResponse;\nexports.unmarshalSetAclRulesResponse = unmarshalSetAclRulesResponse;\nexports.unmarshalSetEndpointsResponse = unmarshalSetEndpointsResponse;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst index_gen = require(\"./v1/index.gen.cjs\");\nexports.v1 = index_gen;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst intervalRetrier = require(\"../../../internal/async/interval-retrier.cjs\");\nconst api = require(\"../../../scw/api.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst resourcePaginator = require(\"../../../scw/fetch/resource-paginator.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nconst marshalling_gen = require(\"./marshalling.gen.cjs\");\nconst jsonContentHeaders = {\n \"Content-Type\": \"application/json; charset=utf-8\"\n};\nclass API extends api.API {\n /** Lists the available regions of the API. */\n static LOCALITIES = [\"fr-par\", \"nl-ams\", \"pl-waw\"];\n pageOfListNamespaces = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/registry/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/namespaces`,\n urlParams: marshalling.urlParams(\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId]\n )\n },\n marshalling_gen.unmarshalListNamespacesResponse\n );\n /**\n * List namespaces. List all namespaces in a specified region. By default, the\n * namespaces listed are ordered by creation date in ascending order. This can\n * be modified via the order_by field. You can also define additional\n * parameters for your query, such as the `instance_id` and `project_id`\n * parameters.\n *\n * @param request - The request {@link ListNamespacesRequest}\n * @returns A Promise of ListNamespacesResponse\n */\n listNamespaces = (request = {}) => resourcePaginator.enrichForPagination(\"namespaces\", this.pageOfListNamespaces, request);\n /**\n * Get a namespace. Retrieve information about a given namespace, specified by\n * its `namespace_id` and region. Full details about the namespace, such as\n * `description`, `project_id`, `status`, `endpoint`, `is_public`, `size`, and\n * `image_count` are returned in the response.\n *\n * @param request - The request {@link GetNamespaceRequest}\n * @returns A Promise of Namespace\n */\n getNamespace = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/registry/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/namespaces/${marshalling.validatePathParam(\"namespaceId\", request.namespaceId)}`\n },\n marshalling_gen.unmarshalNamespace\n );\n /**\n * Waits for {@link Namespace} to be in a final state.\n *\n * @param request - The request {@link GetNamespaceRequest}\n * @param options - The waiting options\n * @returns A Promise of Namespace\n */\n waitForNamespace = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(!content_gen.NAMESPACE_TRANSIENT_STATUSES.includes(res.status))),\n this.getNamespace,\n request,\n options\n );\n /**\n * Create a namespace. Create a new Container Registry namespace. You must\n * specify the namespace name and region in which you want it to be created.\n * Optionally, you can specify the `project_id` and `is_public` in the request\n * payload.\n *\n * @param request - The request {@link CreateNamespaceRequest}\n * @returns A Promise of Namespace\n */\n createNamespace = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateNamespaceRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/registry/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/namespaces`\n },\n marshalling_gen.unmarshalNamespace\n );\n /**\n * Update a namespace. Update the parameters of a given namespace, specified\n * by its `namespace_id` and `region`. You can update the `description` and\n * `is_public` parameters.\n *\n * @param request - The request {@link UpdateNamespaceRequest}\n * @returns A Promise of Namespace\n */\n updateNamespace = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateNamespaceRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/registry/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/namespaces/${marshalling.validatePathParam(\"namespaceId\", request.namespaceId)}`\n },\n marshalling_gen.unmarshalNamespace\n );\n /**\n * Delete a namespace. Delete a given namespace. You must specify, in the\n * endpoint, the `region` and `namespace_id` parameters of the namespace you\n * want to delete.\n *\n * @param request - The request {@link DeleteNamespaceRequest}\n * @returns A Promise of Namespace\n */\n deleteNamespace = (request) => this.client.fetch(\n {\n method: \"DELETE\",\n path: `/registry/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/namespaces/${marshalling.validatePathParam(\"namespaceId\", request.namespaceId)}`\n },\n marshalling_gen.unmarshalNamespace\n );\n pageOfListImages = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/registry/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/images`,\n urlParams: marshalling.urlParams(\n [\"name\", request.name],\n [\"namespace_id\", request.namespaceId],\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId]\n )\n },\n marshalling_gen.unmarshalListImagesResponse\n );\n /**\n * List images. List all images in a specified region. By default, the images\n * listed are ordered by creation date in ascending order. This can be\n * modified via the order_by field. You can also define additional parameters\n * for your query, such as the `namespace_id` and `project_id` parameters.\n *\n * @param request - The request {@link ListImagesRequest}\n * @returns A Promise of ListImagesResponse\n */\n listImages = (request = {}) => resourcePaginator.enrichForPagination(\"images\", this.pageOfListImages, request);\n /**\n * Get an image. Retrieve information about a given container image, specified\n * by its `image_id` and region. Full details about the image, such as `name`,\n * `namespace_id`, `status`, `visibility`, and `size` are returned in the\n * response.\n *\n * @param request - The request {@link GetImageRequest}\n * @returns A Promise of Image\n */\n getImage = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/registry/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/images/${marshalling.validatePathParam(\"imageId\", request.imageId)}`\n },\n marshalling_gen.unmarshalImage\n );\n /**\n * Waits for {@link Image} to be in a final state.\n *\n * @param request - The request {@link GetImageRequest}\n * @param options - The waiting options\n * @returns A Promise of Image\n */\n waitForImage = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(!content_gen.IMAGE_TRANSIENT_STATUSES.includes(res.status))),\n this.getImage,\n request,\n options\n );\n /**\n * Update an image. Update the parameters of a given image, specified by its\n * `image_id` and `region`. You can update the `visibility` parameter.\n *\n * @param request - The request {@link UpdateImageRequest}\n * @returns A Promise of Image\n */\n updateImage = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateImageRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/registry/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/images/${marshalling.validatePathParam(\"imageId\", request.imageId)}`\n },\n marshalling_gen.unmarshalImage\n );\n /**\n * Delete an image. Delete a given image. You must specify, in the endpoint,\n * the `region` and `image_id` parameters of the image you want to delete.\n *\n * @param request - The request {@link DeleteImageRequest}\n * @returns A Promise of Image\n */\n deleteImage = (request) => this.client.fetch(\n {\n method: \"DELETE\",\n path: `/registry/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/images/${marshalling.validatePathParam(\"imageId\", request.imageId)}`\n },\n marshalling_gen.unmarshalImage\n );\n pageOfListTags = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/registry/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/images/${marshalling.validatePathParam(\"imageId\", request.imageId)}/tags`,\n urlParams: marshalling.urlParams(\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListTagsResponse\n );\n /**\n * List tags. List all tags for a given image, specified by region. By\n * default, the tags listed are ordered by creation date in ascending order.\n * This can be modified via the order_by field. You can also define additional\n * parameters for your query, such as the `name`.\n *\n * @param request - The request {@link ListTagsRequest}\n * @returns A Promise of ListTagsResponse\n */\n listTags = (request) => resourcePaginator.enrichForPagination(\"tags\", this.pageOfListTags, request);\n /**\n * Get a tag. Retrieve information about a given image tag, specified by its\n * `tag_id` and region. Full details about the tag, such as `name`,\n * `image_id`, `status`, and `digest` are returned in the response.\n *\n * @param request - The request {@link GetTagRequest}\n * @returns A Promise of Tag\n */\n getTag = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/registry/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/tags/${marshalling.validatePathParam(\"tagId\", request.tagId)}`\n },\n marshalling_gen.unmarshalTag\n );\n /**\n * Waits for {@link Tag} to be in a final state.\n *\n * @param request - The request {@link GetTagRequest}\n * @param options - The waiting options\n * @returns A Promise of Tag\n */\n waitForTag = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(!content_gen.TAG_TRANSIENT_STATUSES.includes(res.status))),\n this.getTag,\n request,\n options\n );\n /**\n * Delete a tag. Delete a given image tag. You must specify, in the endpoint,\n * the `region` and `tag_id` parameters of the tag you want to delete.\n *\n * @param request - The request {@link DeleteTagRequest}\n * @returns A Promise of Tag\n */\n deleteTag = (request) => this.client.fetch(\n {\n method: \"DELETE\",\n path: `/registry/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/tags/${marshalling.validatePathParam(\"tagId\", request.tagId)}`,\n urlParams: marshalling.urlParams([\"force\", request.force])\n },\n marshalling_gen.unmarshalTag\n );\n}\nexports.API = API;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst IMAGE_TRANSIENT_STATUSES = [\"deleting\"];\nconst NAMESPACE_TRANSIENT_STATUSES = [\"deleting\"];\nconst TAG_TRANSIENT_STATUSES = [\"deleting\"];\nexports.IMAGE_TRANSIENT_STATUSES = IMAGE_TRANSIENT_STATUSES;\nexports.NAMESPACE_TRANSIENT_STATUSES = NAMESPACE_TRANSIENT_STATUSES;\nexports.TAG_TRANSIENT_STATUSES = TAG_TRANSIENT_STATUSES;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api_gen = require(\"./api.gen.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nexports.API = api_gen.API;\nexports.IMAGE_TRANSIENT_STATUSES = content_gen.IMAGE_TRANSIENT_STATUSES;\nexports.NAMESPACE_TRANSIENT_STATUSES = content_gen.NAMESPACE_TRANSIENT_STATUSES;\nexports.TAG_TRANSIENT_STATUSES = content_gen.TAG_TRANSIENT_STATUSES;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst randomName = require(\"@scaleway/random-name\");\nconst json = require(\"../../../helpers/json.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst unmarshalImage = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Image' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n id: data.id,\n name: data.name,\n namespaceId: data.namespace_id,\n size: data.size,\n status: data.status,\n statusMessage: data.status_message,\n tags: data.tags,\n updatedAt: marshalling.unmarshalDate(data.updated_at),\n visibility: data.visibility\n };\n};\nconst unmarshalNamespace = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Namespace' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n description: data.description,\n endpoint: data.endpoint,\n id: data.id,\n imageCount: data.image_count,\n isPublic: data.is_public,\n name: data.name,\n organizationId: data.organization_id,\n projectId: data.project_id,\n region: data.region,\n size: data.size,\n status: data.status,\n statusMessage: data.status_message,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalTag = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Tag' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n digest: data.digest,\n id: data.id,\n imageId: data.image_id,\n name: data.name,\n status: data.status,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalListImagesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListImagesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n images: marshalling.unmarshalArrayOfObject(data.images, unmarshalImage),\n totalCount: data.total_count\n };\n};\nconst unmarshalListNamespacesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListNamespacesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n namespaces: marshalling.unmarshalArrayOfObject(data.namespaces, unmarshalNamespace),\n totalCount: data.total_count\n };\n};\nconst unmarshalListTagsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListTagsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n tags: marshalling.unmarshalArrayOfObject(data.tags, unmarshalTag),\n totalCount: data.total_count\n };\n};\nconst marshalCreateNamespaceRequest = (request, defaults) => ({\n description: request.description,\n is_public: request.isPublic,\n name: request.name || randomName(\"ns\"),\n ...marshalling.resolveOneOf([\n {\n default: defaults.defaultProjectId,\n param: \"project_id\",\n value: request.projectId\n },\n {\n default: defaults.defaultOrganizationId,\n param: \"organization_id\",\n value: request.organizationId\n }\n ])\n});\nconst marshalUpdateImageRequest = (request, defaults) => ({\n visibility: request.visibility\n});\nconst marshalUpdateNamespaceRequest = (request, defaults) => ({\n description: request.description,\n is_public: request.isPublic\n});\nexports.marshalCreateNamespaceRequest = marshalCreateNamespaceRequest;\nexports.marshalUpdateImageRequest = marshalUpdateImageRequest;\nexports.marshalUpdateNamespaceRequest = marshalUpdateNamespaceRequest;\nexports.unmarshalImage = unmarshalImage;\nexports.unmarshalListImagesResponse = unmarshalListImagesResponse;\nexports.unmarshalListNamespacesResponse = unmarshalListNamespacesResponse;\nexports.unmarshalListTagsResponse = unmarshalListTagsResponse;\nexports.unmarshalNamespace = unmarshalNamespace;\nexports.unmarshalTag = unmarshalTag;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst index_gen = require(\"./v1alpha1/index.gen.cjs\");\nconst index_gen$1 = require(\"./v1beta1/index.gen.cjs\");\nexports.v1alpha1 = index_gen;\nexports.v1beta1 = index_gen$1;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api = require(\"../../../scw/api.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst resourcePaginator = require(\"../../../scw/fetch/resource-paginator.cjs\");\nconst marshalling_gen = require(\"./marshalling.gen.cjs\");\nconst jsonContentHeaders = {\n \"Content-Type\": \"application/json; charset=utf-8\"\n};\nclass API extends api.API {\n /** Lists the available regions of the API. */\n static LOCALITIES = [\"fr-par\", \"nl-ams\", \"pl-waw\"];\n /**\n * Create a secret. You must specify the `region` to create a secret.\n *\n * @param request - The request {@link CreateSecretRequest}\n * @returns A Promise of Secret\n */\n createSecret = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateSecretRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/secret-manager/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/secrets`\n },\n marshalling_gen.unmarshalSecret\n );\n /**\n * Create folder.\n *\n * @param request - The request {@link CreateFolderRequest}\n * @returns A Promise of Folder\n */\n createFolder = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateFolderRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/secret-manager/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/folders`\n },\n marshalling_gen.unmarshalFolder\n );\n /**\n * Get metadata using the secret's ID. Retrieve the metadata of a secret\n * specified by the `region` and `secret_id` parameters.\n *\n * @param request - The request {@link GetSecretRequest}\n * @returns A Promise of Secret\n */\n getSecret = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/secret-manager/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam(\"secretId\", request.secretId)}`\n },\n marshalling_gen.unmarshalSecret\n );\n /**\n * Get metadata using the secret's name. Retrieve the metadata of a secret\n * specified by the `region` and `secret_name` parameters.\n *\n * GetSecretByName usage is now deprecated.\n *\n * Scaleway recommends that you use the `ListSecrets` request with the `name`\n * filter.\n *\n * @deprecated\n * @param request - The request {@link GetSecretByNameRequest}\n * @returns A Promise of Secret\n */\n getSecretByName = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/secret-manager/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/secrets-by-name/${marshalling.validatePathParam(\"secretName\", request.secretName)}`,\n urlParams: marshalling.urlParams([\"project_id\", request.projectId])\n },\n marshalling_gen.unmarshalSecret\n );\n /**\n * Update metadata of a secret. Edit a secret's metadata such as name, tag(s),\n * description and ephemeral policy. The secret to update is specified by the\n * `secret_id` and `region` parameters.\n *\n * @param request - The request {@link UpdateSecretRequest}\n * @returns A Promise of Secret\n */\n updateSecret = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateSecretRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/secret-manager/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam(\"secretId\", request.secretId)}`\n },\n marshalling_gen.unmarshalSecret\n );\n pageOfListSecrets = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/secret-manager/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/secrets`,\n urlParams: marshalling.urlParams(\n [\"is_ephemeral\", request.isEphemeral],\n [\"is_managed\", request.isManaged],\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"path\", request.path],\n [\"project_id\", request.projectId],\n [\"tags\", request.tags]\n )\n },\n marshalling_gen.unmarshalListSecretsResponse\n );\n /**\n * List secrets. Retrieve the list of secrets created within an Organization\n * and/or Project. You must specify either the `organization_id` or the\n * `project_id` and the `region`.\n *\n * @param request - The request {@link ListSecretsRequest}\n * @returns A Promise of ListSecretsResponse\n */\n listSecrets = (request = {}) => resourcePaginator.enrichForPagination(\"secrets\", this.pageOfListSecrets, request);\n pageOfListFolders = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/secret-manager/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/folders`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"path\", request.path],\n [\"project_id\", request.projectId]\n )\n },\n marshalling_gen.unmarshalListFoldersResponse\n );\n /**\n * List folders. Retrieve the list of folders created within a Project.\n *\n * @param request - The request {@link ListFoldersRequest}\n * @returns A Promise of ListFoldersResponse\n */\n listFolders = (request = {}) => resourcePaginator.enrichForPagination(\"folders\", this.pageOfListFolders, request);\n /**\n * Delete a secret. Delete a given secret specified by the `region` and\n * `secret_id` parameters.\n *\n * @param request - The request {@link DeleteSecretRequest}\n */\n deleteSecret = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/secret-manager/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam(\"secretId\", request.secretId)}`\n });\n /**\n * Delete a given folder specified by the `region` and `folder_id` parameters.\n *\n * @param request - The request {@link DeleteFolderRequest}\n */\n deleteFolder = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/secret-manager/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/folders/${marshalling.validatePathParam(\"folderId\", request.folderId)}`\n });\n /**\n * Protect a secret. Protect a given secret specified by the `secret_id`\n * parameter. A protected secret can be read and modified but cannot be\n * deleted.\n *\n * @param request - The request {@link ProtectSecretRequest}\n * @returns A Promise of Secret\n */\n protectSecret = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/secret-manager/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam(\"secretId\", request.secretId)}/protect`\n },\n marshalling_gen.unmarshalSecret\n );\n /**\n * Unprotect a secret. Unprotect a given secret specified by the `secret_id`\n * parameter. An unprotected secret can be read, modified and deleted.\n *\n * @param request - The request {@link UnprotectSecretRequest}\n * @returns A Promise of Secret\n */\n unprotectSecret = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/secret-manager/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam(\"secretId\", request.secretId)}/unprotect`\n },\n marshalling_gen.unmarshalSecret\n );\n /**\n * Allow a product to use the secret.\n *\n * @param request - The request {@link AddSecretOwnerRequest}\n */\n addSecretOwner = (request) => this.client.fetch({\n body: JSON.stringify(\n marshalling_gen.marshalAddSecretOwnerRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/secret-manager/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam(\"secretId\", request.secretId)}/add-owner`\n });\n /**\n * Create a version. Create a version of a given secret specified by the\n * `region` and `secret_id` parameters.\n *\n * @param request - The request {@link CreateSecretVersionRequest}\n * @returns A Promise of SecretVersion\n */\n createSecretVersion = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateSecretVersionRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/secret-manager/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam(\"secretId\", request.secretId)}/versions`\n },\n marshalling_gen.unmarshalSecretVersion\n );\n /**\n * Generate a password in a new version. Generate a password for the given\n * secret specified by the `region` and `secret_id` parameters. This will also\n * create a new version of the secret that will store the password.\n *\n * @param request - The request {@link GeneratePasswordRequest}\n * @returns A Promise of SecretVersion\n */\n generatePassword = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalGeneratePasswordRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/secret-manager/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam(\"secretId\", request.secretId)}/generate-password`\n },\n marshalling_gen.unmarshalSecretVersion\n );\n /**\n * Get metadata of a secret's version using the secret's ID. Retrieve the\n * metadata of a secret's given version specified by the `region`, `secret_id`\n * and `revision` parameters.\n *\n * @param request - The request {@link GetSecretVersionRequest}\n * @returns A Promise of SecretVersion\n */\n getSecretVersion = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/secret-manager/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam(\"secretId\", request.secretId)}/versions/${marshalling.validatePathParam(\"revision\", request.revision)}`\n },\n marshalling_gen.unmarshalSecretVersion\n );\n /**\n * Get metadata of a secret's version using the secret's name. Retrieve the\n * metadata of a secret's given version specified by the `region`,\n * `secret_name`, `revision` and `project_id` parameters.\n *\n * This method is deprecated.\n *\n * Scaleway recommends that you use the `ListSecrets` request with the `name`\n * filter to specify the secret version desired, then use the\n * `GetSecretVersion` request.\n *\n * @deprecated\n * @param request - The request {@link GetSecretVersionByNameRequest}\n * @returns A Promise of SecretVersion\n */\n getSecretVersionByName = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/secret-manager/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/secrets-by-name/${marshalling.validatePathParam(\"secretName\", request.secretName)}/versions/${marshalling.validatePathParam(\"revision\", request.revision)}`,\n urlParams: marshalling.urlParams([\"project_id\", request.projectId])\n },\n marshalling_gen.unmarshalSecretVersion\n );\n /**\n * Update metadata of a version. Edit the metadata of a secret's given\n * version, specified by the `region`, `secret_id` and `revision` parameters.\n *\n * @param request - The request {@link UpdateSecretVersionRequest}\n * @returns A Promise of SecretVersion\n */\n updateSecretVersion = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateSecretVersionRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/secret-manager/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam(\"secretId\", request.secretId)}/versions/${marshalling.validatePathParam(\"revision\", request.revision)}`\n },\n marshalling_gen.unmarshalSecretVersion\n );\n pageOfListSecretVersions = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/secret-manager/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam(\"secretId\", request.secretId)}/versions`,\n urlParams: marshalling.urlParams(\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"status\", request.status]\n )\n },\n marshalling_gen.unmarshalListSecretVersionsResponse\n );\n /**\n * List versions of a secret using the secret's ID. Retrieve the list of a\n * given secret's versions specified by the `secret_id` and `region`\n * parameters.\n *\n * @param request - The request {@link ListSecretVersionsRequest}\n * @returns A Promise of ListSecretVersionsResponse\n */\n listSecretVersions = (request) => resourcePaginator.enrichForPagination(\"versions\", this.pageOfListSecretVersions, request);\n pageOfListSecretVersionsByName = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/secret-manager/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/secrets-by-name/${marshalling.validatePathParam(\"secretName\", request.secretName)}/versions`,\n urlParams: marshalling.urlParams(\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId],\n [\"status\", request.status]\n )\n },\n marshalling_gen.unmarshalListSecretVersionsResponse\n );\n /**\n * List versions of a secret using the secret's name. Retrieve the list of a\n * given secret's versions specified by the `secret_name`,`region` and\n * `project_id` parameters.\n *\n * This method is deprecated.\n *\n * Scaleway recommends that you use the `ListSecrets` request with the `name`\n * filter to specify the secret version desired, then use the\n * `ListSecretVersions` request.\n *\n * @deprecated\n * @param request - The request {@link ListSecretVersionsByNameRequest}\n * @returns A Promise of ListSecretVersionsResponse\n */\n listSecretVersionsByName = (request) => resourcePaginator.enrichForPagination(\n \"versions\",\n this.pageOfListSecretVersionsByName,\n request\n );\n /**\n * Enable a version. Make a specific version accessible. You must specify the\n * `region`, `secret_id` and `revision` parameters.\n *\n * @param request - The request {@link EnableSecretVersionRequest}\n * @returns A Promise of SecretVersion\n */\n enableSecretVersion = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/secret-manager/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam(\"secretId\", request.secretId)}/versions/${marshalling.validatePathParam(\"revision\", request.revision)}/enable`\n },\n marshalling_gen.unmarshalSecretVersion\n );\n /**\n * Disable a version. Make a specific version inaccessible. You must specify\n * the `region`, `secret_id` and `revision` parameters.\n *\n * @param request - The request {@link DisableSecretVersionRequest}\n * @returns A Promise of SecretVersion\n */\n disableSecretVersion = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/secret-manager/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam(\"secretId\", request.secretId)}/versions/${marshalling.validatePathParam(\"revision\", request.revision)}/disable`\n },\n marshalling_gen.unmarshalSecretVersion\n );\n /**\n * Access a secret's version using the secret's ID. Access sensitive data in a\n * secret's version specified by the `region`, `secret_id` and `revision`\n * parameters.\n *\n * @param request - The request {@link AccessSecretVersionRequest}\n * @returns A Promise of AccessSecretVersionResponse\n */\n accessSecretVersion = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/secret-manager/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam(\"secretId\", request.secretId)}/versions/${marshalling.validatePathParam(\"revision\", request.revision)}/access`\n },\n marshalling_gen.unmarshalAccessSecretVersionResponse\n );\n /**\n * Access a secret's version using the secret's name. Access sensitive data in\n * a secret's version specified by the `region`, `secret_name`, `revision` and\n * `project_id` parameters.\n *\n * This method is deprecated.\n *\n * Scaleway recommends that you use the `ListSecrets` request with the `name`\n * filter to specify the secret version desired, then use the\n * `AccessSecretVersion` request.\n *\n * @deprecated\n * @param request - The request {@link AccessSecretVersionByNameRequest}\n * @returns A Promise of AccessSecretVersionResponse\n */\n accessSecretVersionByName = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/secret-manager/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/secrets-by-name/${marshalling.validatePathParam(\"secretName\", request.secretName)}/versions/${marshalling.validatePathParam(\"revision\", request.revision)}/access`,\n urlParams: marshalling.urlParams([\"project_id\", request.projectId])\n },\n marshalling_gen.unmarshalAccessSecretVersionResponse\n );\n /**\n * Delete a version. Delete a secret's version and the sensitive data\n * contained in it. Deleting a version is permanent and cannot be undone.\n *\n * @param request - The request {@link DestroySecretVersionRequest}\n * @returns A Promise of SecretVersion\n */\n destroySecretVersion = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/secret-manager/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam(\"secretId\", request.secretId)}/versions/${marshalling.validatePathParam(\"revision\", request.revision)}/destroy`\n },\n marshalling_gen.unmarshalSecretVersion\n );\n pageOfListTags = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/secret-manager/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/tags`,\n urlParams: marshalling.urlParams(\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId]\n )\n },\n marshalling_gen.unmarshalListTagsResponse\n );\n /**\n * List tags. List all tags associated with secrets within a given Project.\n *\n * @param request - The request {@link ListTagsRequest}\n * @returns A Promise of ListTagsResponse\n */\n listTags = (request = {}) => resourcePaginator.enrichForPagination(\"tags\", this.pageOfListTags, request);\n}\nexports.API = API;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api_gen = require(\"./api.gen.cjs\");\nexports.API = api_gen.API;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst json = require(\"../../../helpers/json.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst unmarshalFolder = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Folder' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n id: data.id,\n name: data.name,\n path: data.path,\n projectId: data.project_id,\n region: data.region\n };\n};\nconst unmarshalEphemeralProperties = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'EphemeralProperties' failed as data isn't a dictionary.`\n );\n }\n return {\n action: data.action,\n expiresAt: marshalling.unmarshalDate(data.expires_at),\n expiresOnceAccessed: data.expires_once_accessed\n };\n};\nconst unmarshalSecretVersion = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SecretVersion' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n description: data.description,\n ephemeralProperties: data.ephemeral_properties ? unmarshalEphemeralProperties(data.ephemeral_properties) : void 0,\n isLatest: data.is_latest,\n revision: data.revision,\n secretId: data.secret_id,\n status: data.status,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalEphemeralPolicy = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'EphemeralPolicy' failed as data isn't a dictionary.`\n );\n }\n return {\n action: data.action,\n expiresOnceAccessed: data.expires_once_accessed,\n timeToLive: data.time_to_live\n };\n};\nconst unmarshalSecret = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Secret' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n description: data.description,\n ephemeralPolicy: data.ephemeral_policy ? unmarshalEphemeralPolicy(data.ephemeral_policy) : void 0,\n id: data.id,\n isManaged: data.is_managed,\n isProtected: data.is_protected,\n name: data.name,\n path: data.path,\n projectId: data.project_id,\n region: data.region,\n status: data.status,\n tags: data.tags,\n type: data.type,\n updatedAt: marshalling.unmarshalDate(data.updated_at),\n versionCount: data.version_count\n };\n};\nconst unmarshalAccessSecretVersionResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'AccessSecretVersionResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n data: data.data,\n dataCrc32: data.data_crc32,\n revision: data.revision,\n secretId: data.secret_id\n };\n};\nconst unmarshalListFoldersResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListFoldersResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n folders: marshalling.unmarshalArrayOfObject(data.folders, unmarshalFolder),\n totalCount: data.total_count\n };\n};\nconst unmarshalListSecretVersionsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListSecretVersionsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n totalCount: data.total_count,\n versions: marshalling.unmarshalArrayOfObject(data.versions, unmarshalSecretVersion)\n };\n};\nconst unmarshalListSecretsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListSecretsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n secrets: marshalling.unmarshalArrayOfObject(data.secrets, unmarshalSecret),\n totalCount: data.total_count\n };\n};\nconst unmarshalListTagsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListTagsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n tags: data.tags,\n totalCount: data.total_count\n };\n};\nconst marshalAddSecretOwnerRequest = (request, defaults) => ({\n product: request.product,\n product_name: request.productName\n});\nconst marshalCreateFolderRequest = (request, defaults) => ({\n name: request.name,\n path: request.path,\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalEphemeralPolicy = (request, defaults) => ({\n action: request.action,\n expires_once_accessed: request.expiresOnceAccessed,\n time_to_live: request.timeToLive\n});\nconst marshalCreateSecretRequest = (request, defaults) => ({\n description: request.description,\n ephemeral_policy: request.ephemeralPolicy !== void 0 ? marshalEphemeralPolicy(request.ephemeralPolicy) : void 0,\n is_protected: request.isProtected,\n name: request.name,\n path: request.path,\n project_id: request.projectId ?? defaults.defaultProjectId,\n tags: request.tags,\n type: request.type\n});\nconst marshalPasswordGenerationParams = (request, defaults) => ({\n additional_chars: request.additionalChars,\n length: request.length,\n no_digits: request.noDigits,\n no_lowercase_letters: request.noLowercaseLetters,\n no_uppercase_letters: request.noUppercaseLetters\n});\nconst marshalCreateSecretVersionRequest = (request, defaults) => ({\n data: request.data,\n data_crc32: request.dataCrc32,\n description: request.description,\n disable_previous: request.disablePrevious,\n password_generation: request.passwordGeneration !== void 0 ? marshalPasswordGenerationParams(request.passwordGeneration) : void 0\n});\nconst marshalGeneratePasswordRequest = (request, defaults) => ({\n additional_chars: request.additionalChars,\n description: request.description,\n disable_previous: request.disablePrevious,\n length: request.length,\n no_digits: request.noDigits,\n no_lowercase_letters: request.noLowercaseLetters,\n no_uppercase_letters: request.noUppercaseLetters\n});\nconst marshalUpdateSecretRequest = (request, defaults) => ({\n description: request.description,\n ephemeral_policy: request.ephemeralPolicy !== void 0 ? marshalEphemeralPolicy(request.ephemeralPolicy) : void 0,\n name: request.name,\n path: request.path,\n tags: request.tags\n});\nconst marshalEphemeralProperties = (request, defaults) => ({\n action: request.action,\n expires_at: request.expiresAt,\n expires_once_accessed: request.expiresOnceAccessed\n});\nconst marshalUpdateSecretVersionRequest = (request, defaults) => ({\n description: request.description,\n ephemeral_properties: request.ephemeralProperties !== void 0 ? marshalEphemeralProperties(request.ephemeralProperties) : void 0\n});\nexports.marshalAddSecretOwnerRequest = marshalAddSecretOwnerRequest;\nexports.marshalCreateFolderRequest = marshalCreateFolderRequest;\nexports.marshalCreateSecretRequest = marshalCreateSecretRequest;\nexports.marshalCreateSecretVersionRequest = marshalCreateSecretVersionRequest;\nexports.marshalEphemeralPolicy = marshalEphemeralPolicy;\nexports.marshalGeneratePasswordRequest = marshalGeneratePasswordRequest;\nexports.marshalUpdateSecretRequest = marshalUpdateSecretRequest;\nexports.marshalUpdateSecretVersionRequest = marshalUpdateSecretVersionRequest;\nexports.unmarshalAccessSecretVersionResponse = unmarshalAccessSecretVersionResponse;\nexports.unmarshalEphemeralPolicy = unmarshalEphemeralPolicy;\nexports.unmarshalFolder = unmarshalFolder;\nexports.unmarshalListFoldersResponse = unmarshalListFoldersResponse;\nexports.unmarshalListSecretVersionsResponse = unmarshalListSecretVersionsResponse;\nexports.unmarshalListSecretsResponse = unmarshalListSecretsResponse;\nexports.unmarshalListTagsResponse = unmarshalListTagsResponse;\nexports.unmarshalSecret = unmarshalSecret;\nexports.unmarshalSecretVersion = unmarshalSecretVersion;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api = require(\"../../../scw/api.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst resourcePaginator = require(\"../../../scw/fetch/resource-paginator.cjs\");\nconst marshalling_gen = require(\"./marshalling.gen.cjs\");\nconst jsonContentHeaders = {\n \"Content-Type\": \"application/json; charset=utf-8\"\n};\nclass API extends api.API {\n /** Lists the available regions of the API. */\n static LOCALITIES = [\"fr-par\", \"nl-ams\", \"pl-waw\"];\n /**\n * Create a secret. Create a secret in a given region specified by the\n * `region` parameter.\n *\n * @param request - The request {@link CreateSecretRequest}\n * @returns A Promise of Secret\n */\n createSecret = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateSecretRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/secret-manager/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/secrets`\n },\n marshalling_gen.unmarshalSecret\n );\n /**\n * Get metadata using the secret's ID. Retrieve the metadata of a secret\n * specified by the `region` and `secret_id` parameters.\n *\n * @param request - The request {@link GetSecretRequest}\n * @returns A Promise of Secret\n */\n getSecret = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/secret-manager/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam(\"secretId\", request.secretId)}`\n },\n marshalling_gen.unmarshalSecret\n );\n /**\n * Update metadata of a secret. Edit a secret's metadata such as name, tag(s),\n * description and ephemeral policy. The secret to update is specified by the\n * `secret_id` and `region` parameters.\n *\n * @param request - The request {@link UpdateSecretRequest}\n * @returns A Promise of Secret\n */\n updateSecret = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateSecretRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/secret-manager/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam(\"secretId\", request.secretId)}`\n },\n marshalling_gen.unmarshalSecret\n );\n /**\n * Delete a secret. Delete a given secret specified by the `region` and\n * `secret_id` parameters.\n *\n * @param request - The request {@link DeleteSecretRequest}\n */\n deleteSecret = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/secret-manager/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam(\"secretId\", request.secretId)}`\n });\n pageOfListSecrets = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/secret-manager/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/secrets`,\n urlParams: marshalling.urlParams(\n [\"ephemeral\", request.ephemeral],\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"path\", request.path],\n [\"project_id\", request.projectId],\n [\"tags\", request.tags],\n [\"type\", request.type]\n )\n },\n marshalling_gen.unmarshalListSecretsResponse\n );\n /**\n * List secrets. Retrieve the list of secrets created within an Organization\n * and/or Project. You must specify either the `organization_id` or the\n * `project_id` and the `region`.\n *\n * @param request - The request {@link ListSecretsRequest}\n * @returns A Promise of ListSecretsResponse\n */\n listSecrets = (request = {}) => resourcePaginator.enrichForPagination(\"secrets\", this.pageOfListSecrets, request);\n /**\n * Browse secrets. Retrieve the list of secrets and folders for the given\n * prefix. You must specify either the `organization_id` or the `project_id`\n * and the `region`.\n *\n * @param request - The request {@link BrowseSecretsRequest}\n * @returns A Promise of BrowseSecretsResponse\n */\n browseSecrets = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/secret-manager/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/secrets/browse`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"prefix\", request.prefix],\n [\"project_id\", request.projectId],\n [\"tags\", request.tags],\n [\"type\", request.type]\n )\n },\n marshalling_gen.unmarshalBrowseSecretsResponse\n );\n /**\n * Enable secret protection. Enable secret protection for a given secret\n * specified by the `secret_id` parameter. Enabling secret protection means\n * that your secret can be read and modified, but it cannot be deleted.\n *\n * @param request - The request {@link ProtectSecretRequest}\n * @returns A Promise of Secret\n */\n protectSecret = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/secret-manager/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam(\"secretId\", request.secretId)}/protect`\n },\n marshalling_gen.unmarshalSecret\n );\n /**\n * Disable secret protection. Disable secret protection for a given secret\n * specified by the `secret_id` parameter. Disabling secret protection means\n * that your secret can be read, modified and deleted.\n *\n * @param request - The request {@link UnprotectSecretRequest}\n * @returns A Promise of Secret\n */\n unprotectSecret = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/secret-manager/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam(\"secretId\", request.secretId)}/unprotect`\n },\n marshalling_gen.unmarshalSecret\n );\n /**\n * Allow a product to use the secret.\n *\n * @param request - The request {@link AddSecretOwnerRequest}\n */\n addSecretOwner = (request) => this.client.fetch({\n body: JSON.stringify(\n marshalling_gen.marshalAddSecretOwnerRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/secret-manager/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam(\"secretId\", request.secretId)}/add-owner`\n });\n /**\n * Create a version. Create a version of a given secret specified by the\n * `region` and `secret_id` parameters.\n *\n * @param request - The request {@link CreateSecretVersionRequest}\n * @returns A Promise of SecretVersion\n */\n createSecretVersion = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateSecretVersionRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/secret-manager/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam(\"secretId\", request.secretId)}/versions`\n },\n marshalling_gen.unmarshalSecretVersion\n );\n /**\n * Get metadata of a secret's version using the secret's ID. Retrieve the\n * metadata of a secret's given version specified by the `region`, `secret_id`\n * and `revision` parameters.\n *\n * @param request - The request {@link GetSecretVersionRequest}\n * @returns A Promise of SecretVersion\n */\n getSecretVersion = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/secret-manager/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam(\"secretId\", request.secretId)}/versions/${marshalling.validatePathParam(\"revision\", request.revision)}`\n },\n marshalling_gen.unmarshalSecretVersion\n );\n /**\n * Update metadata of a version. Edit the metadata of a secret's given\n * version, specified by the `region`, `secret_id` and `revision` parameters.\n *\n * @param request - The request {@link UpdateSecretVersionRequest}\n * @returns A Promise of SecretVersion\n */\n updateSecretVersion = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateSecretVersionRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/secret-manager/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam(\"secretId\", request.secretId)}/versions/${marshalling.validatePathParam(\"revision\", request.revision)}`\n },\n marshalling_gen.unmarshalSecretVersion\n );\n /**\n * Delete a version. Delete a secret's version and the sensitive data\n * contained in it. Deleting a version is permanent and cannot be undone.\n *\n * @param request - The request {@link DeleteSecretVersionRequest}\n */\n deleteSecretVersion = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/secret-manager/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam(\"secretId\", request.secretId)}/versions/${marshalling.validatePathParam(\"revision\", request.revision)}`\n });\n pageOfListSecretVersions = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/secret-manager/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam(\"secretId\", request.secretId)}/versions`,\n urlParams: marshalling.urlParams(\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"status\", request.status]\n )\n },\n marshalling_gen.unmarshalListSecretVersionsResponse\n );\n /**\n * List versions of a secret using the secret's ID. Retrieve the list of a\n * given secret's versions specified by the `secret_id` and `region`\n * parameters.\n *\n * @param request - The request {@link ListSecretVersionsRequest}\n * @returns A Promise of ListSecretVersionsResponse\n */\n listSecretVersions = (request) => resourcePaginator.enrichForPagination(\"versions\", this.pageOfListSecretVersions, request);\n /**\n * Access a secret's version using the secret's ID. Access sensitive data in a\n * secret's version specified by the `region`, `secret_id` and `revision`\n * parameters.\n *\n * @param request - The request {@link AccessSecretVersionRequest}\n * @returns A Promise of AccessSecretVersionResponse\n */\n accessSecretVersion = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/secret-manager/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam(\"secretId\", request.secretId)}/versions/${marshalling.validatePathParam(\"revision\", request.revision)}/access`\n },\n marshalling_gen.unmarshalAccessSecretVersionResponse\n );\n /**\n * Access a secret's version using the secret's name and path. Access\n * sensitive data in a secret's version specified by the `region`,\n * `secret_name`, `secret_path` and `revision` parameters.\n *\n * @param request - The request {@link AccessSecretVersionByPathRequest}\n * @returns A Promise of AccessSecretVersionResponse\n */\n accessSecretVersionByPath = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/secret-manager/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/secrets-by-path/versions/${marshalling.validatePathParam(\"revision\", request.revision)}/access`,\n urlParams: marshalling.urlParams(\n [\n \"project_id\",\n request.projectId ?? this.client.settings.defaultProjectId\n ],\n [\"secret_name\", request.secretName],\n [\"secret_path\", request.secretPath]\n )\n },\n marshalling_gen.unmarshalAccessSecretVersionResponse\n );\n /**\n * Enable a version. Make a specific version accessible. You must specify the\n * `region`, `secret_id` and `revision` parameters.\n *\n * @param request - The request {@link EnableSecretVersionRequest}\n * @returns A Promise of SecretVersion\n */\n enableSecretVersion = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/secret-manager/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam(\"secretId\", request.secretId)}/versions/${marshalling.validatePathParam(\"revision\", request.revision)}/enable`\n },\n marshalling_gen.unmarshalSecretVersion\n );\n /**\n * Disable a version. Make a specific version inaccessible. You must specify\n * the `region`, `secret_id` and `revision` parameters.\n *\n * @param request - The request {@link DisableSecretVersionRequest}\n * @returns A Promise of SecretVersion\n */\n disableSecretVersion = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/secret-manager/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/secrets/${marshalling.validatePathParam(\"secretId\", request.secretId)}/versions/${marshalling.validatePathParam(\"revision\", request.revision)}/disable`\n },\n marshalling_gen.unmarshalSecretVersion\n );\n pageOfListTags = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/secret-manager/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/tags`,\n urlParams: marshalling.urlParams(\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\n \"project_id\",\n request.projectId ?? this.client.settings.defaultProjectId\n ]\n )\n },\n marshalling_gen.unmarshalListTagsResponse\n );\n /**\n * List tags. List all tags associated with secrets within a given Project.\n *\n * @param request - The request {@link ListTagsRequest}\n * @returns A Promise of ListTagsResponse\n */\n listTags = (request = {}) => resourcePaginator.enrichForPagination(\"tags\", this.pageOfListTags, request);\n pageOfListSecretTypes = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/secret-manager/v1beta1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/secret-types`,\n urlParams: marshalling.urlParams(\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\n \"project_id\",\n request.projectId ?? this.client.settings.defaultProjectId\n ]\n )\n },\n marshalling_gen.unmarshalListSecretTypesResponse\n );\n /**\n * List secret types. List all secret types created within a given Project.\n *\n * @param request - The request {@link ListSecretTypesRequest}\n * @returns A Promise of ListSecretTypesResponse\n */\n listSecretTypes = (request = {}) => resourcePaginator.enrichForPagination(\"types\", this.pageOfListSecretTypes, request);\n}\nexports.API = API;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api_gen = require(\"./api.gen.cjs\");\nconst validationRules_gen = require(\"./validation-rules.gen.cjs\");\nexports.API = api_gen.API;\nexports.ValidationRules = validationRules_gen;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst json = require(\"../../../helpers/json.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst unmarshalEphemeralProperties = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'EphemeralProperties' failed as data isn't a dictionary.`\n );\n }\n return {\n action: data.action,\n expiresAt: marshalling.unmarshalDate(data.expires_at),\n expiresOnceAccessed: data.expires_once_accessed\n };\n};\nconst unmarshalSecretVersion = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SecretVersion' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n description: data.description,\n ephemeralProperties: data.ephemeral_properties ? unmarshalEphemeralProperties(data.ephemeral_properties) : void 0,\n latest: data.latest,\n revision: data.revision,\n secretId: data.secret_id,\n status: data.status,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalEphemeralPolicy = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'EphemeralPolicy' failed as data isn't a dictionary.`\n );\n }\n return {\n action: data.action,\n expiresOnceAccessed: data.expires_once_accessed,\n timeToLive: data.time_to_live\n };\n};\nconst unmarshalSecret = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Secret' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n description: data.description,\n ephemeralPolicy: data.ephemeral_policy ? unmarshalEphemeralPolicy(data.ephemeral_policy) : void 0,\n id: data.id,\n managed: data.managed,\n name: data.name,\n path: data.path,\n projectId: data.project_id,\n protected: data.protected,\n region: data.region,\n status: data.status,\n tags: data.tags,\n type: data.type,\n updatedAt: marshalling.unmarshalDate(data.updated_at),\n usedBy: data.used_by,\n versionCount: data.version_count\n };\n};\nconst unmarshalAccessSecretVersionResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'AccessSecretVersionResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n data: data.data,\n dataCrc32: data.data_crc32,\n revision: data.revision,\n secretId: data.secret_id,\n type: data.type\n };\n};\nconst unmarshalBrowseSecretsResponseItemFolderDetails = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'BrowseSecretsResponseItemFolderDetails' failed as data isn't a dictionary.`\n );\n }\n return {};\n};\nconst unmarshalBrowseSecretsResponseItemSecretDetails = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'BrowseSecretsResponseItemSecretDetails' failed as data isn't a dictionary.`\n );\n }\n return {\n ephemeralPolicy: data.ephemeral_policy ? unmarshalEphemeralPolicy(data.ephemeral_policy) : void 0,\n id: data.id,\n protected: data.protected,\n tags: data.tags,\n type: data.type,\n versionCount: data.version_count\n };\n};\nconst unmarshalBrowseSecretsResponseItem = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'BrowseSecretsResponseItem' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n folder: data.folder ? unmarshalBrowseSecretsResponseItemFolderDetails(data.folder) : void 0,\n name: data.name,\n secret: data.secret ? unmarshalBrowseSecretsResponseItemSecretDetails(data.secret) : void 0,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalBrowseSecretsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'BrowseSecretsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n currentPath: data.current_path,\n items: marshalling.unmarshalArrayOfObject(\n data.items,\n unmarshalBrowseSecretsResponseItem\n ),\n totalCount: data.total_count\n };\n};\nconst unmarshalListSecretTypesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListSecretTypesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n totalCount: data.total_count,\n types: data.types\n };\n};\nconst unmarshalListSecretVersionsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListSecretVersionsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n totalCount: data.total_count,\n versions: marshalling.unmarshalArrayOfObject(data.versions, unmarshalSecretVersion)\n };\n};\nconst unmarshalListSecretsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListSecretsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n secrets: marshalling.unmarshalArrayOfObject(data.secrets, unmarshalSecret),\n totalCount: data.total_count\n };\n};\nconst unmarshalListTagsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListTagsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n tags: data.tags,\n totalCount: data.total_count\n };\n};\nconst marshalAddSecretOwnerRequest = (request, defaults) => ({\n product: request.product\n});\nconst marshalEphemeralPolicy = (request, defaults) => ({\n action: request.action,\n expires_once_accessed: request.expiresOnceAccessed,\n time_to_live: request.timeToLive\n});\nconst marshalCreateSecretRequest = (request, defaults) => ({\n description: request.description,\n ephemeral_policy: request.ephemeralPolicy !== void 0 ? marshalEphemeralPolicy(request.ephemeralPolicy) : void 0,\n name: request.name,\n path: request.path,\n project_id: request.projectId ?? defaults.defaultProjectId,\n protected: request.protected,\n tags: request.tags,\n type: request.type\n});\nconst marshalCreateSecretVersionRequest = (request, defaults) => ({\n data: request.data,\n data_crc32: request.dataCrc32,\n description: request.description,\n disable_previous: request.disablePrevious\n});\nconst marshalUpdateSecretRequest = (request, defaults) => ({\n description: request.description,\n ephemeral_policy: request.ephemeralPolicy !== void 0 ? marshalEphemeralPolicy(request.ephemeralPolicy) : void 0,\n name: request.name,\n path: request.path,\n tags: request.tags\n});\nconst marshalEphemeralProperties = (request, defaults) => ({\n action: request.action,\n expires_at: request.expiresAt,\n expires_once_accessed: request.expiresOnceAccessed\n});\nconst marshalUpdateSecretVersionRequest = (request, defaults) => ({\n description: request.description,\n ephemeral_properties: request.ephemeralProperties !== void 0 ? marshalEphemeralProperties(request.ephemeralProperties) : void 0\n});\nexports.marshalAddSecretOwnerRequest = marshalAddSecretOwnerRequest;\nexports.marshalCreateSecretRequest = marshalCreateSecretRequest;\nexports.marshalCreateSecretVersionRequest = marshalCreateSecretVersionRequest;\nexports.marshalUpdateSecretRequest = marshalUpdateSecretRequest;\nexports.marshalUpdateSecretVersionRequest = marshalUpdateSecretVersionRequest;\nexports.unmarshalAccessSecretVersionResponse = unmarshalAccessSecretVersionResponse;\nexports.unmarshalBrowseSecretsResponse = unmarshalBrowseSecretsResponse;\nexports.unmarshalListSecretTypesResponse = unmarshalListSecretTypesResponse;\nexports.unmarshalListSecretVersionsResponse = unmarshalListSecretVersionsResponse;\nexports.unmarshalListSecretsResponse = unmarshalListSecretsResponse;\nexports.unmarshalListTagsResponse = unmarshalListTagsResponse;\nexports.unmarshalSecret = unmarshalSecret;\nexports.unmarshalSecretVersion = unmarshalSecretVersion;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst DatabaseCredentials = {\n port: {\n pattern: /^[0-9]+$/\n }\n};\nexports.DatabaseCredentials = DatabaseCredentials;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst index_gen = require(\"./v1alpha1/index.gen.cjs\");\nexports.v1alpha1 = index_gen;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst intervalRetrier = require(\"../../../internal/async/interval-retrier.cjs\");\nconst api = require(\"../../../scw/api.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst resourcePaginator = require(\"../../../scw/fetch/resource-paginator.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nconst marshalling_gen = require(\"./marshalling.gen.cjs\");\nconst jsonContentHeaders = {\n \"Content-Type\": \"application/json; charset=utf-8\"\n};\nclass API extends api.API {\n /** Lists the available regions of the API. */\n static LOCALITIES = [\"fr-par\"];\n /**\n * Create a new Serverless SQL Database. You must provide the following\n * parameters: `organization_id`, `project_id`, `name`, `cpu_min`, `cpu_max`.\n * You can also provide `from_backup_id` to create a database from a backup.\n *\n * @param request - The request {@link CreateDatabaseRequest}\n * @returns A Promise of Database\n */\n createDatabase = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateDatabaseRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/serverless-sqldb/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/databases`\n },\n marshalling_gen.unmarshalDatabase\n );\n /**\n * Get a database information. Retrieve information about your Serverless SQL\n * Database. You must provide the `database_id` parameter.\n *\n * @param request - The request {@link GetDatabaseRequest}\n * @returns A Promise of Database\n */\n getDatabase = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/serverless-sqldb/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/databases/${marshalling.validatePathParam(\"databaseId\", request.databaseId)}`\n },\n marshalling_gen.unmarshalDatabase\n );\n /**\n * Waits for {@link Database} to be in a final state.\n *\n * @param request - The request {@link GetDatabaseRequest}\n * @param options - The waiting options\n * @returns A Promise of Database\n */\n waitForDatabase = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(!content_gen.DATABASE_TRANSIENT_STATUSES.includes(res.status))),\n this.getDatabase,\n request,\n options\n );\n /**\n * Delete a database. Deletes a database. You must provide the `database_id`\n * parameter. All data stored in the database will be permanently deleted.\n *\n * @param request - The request {@link DeleteDatabaseRequest}\n * @returns A Promise of Database\n */\n deleteDatabase = (request) => this.client.fetch(\n {\n method: \"DELETE\",\n path: `/serverless-sqldb/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/databases/${marshalling.validatePathParam(\"databaseId\", request.databaseId)}`\n },\n marshalling_gen.unmarshalDatabase\n );\n pageOfListDatabases = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/serverless-sqldb/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/databases`,\n urlParams: marshalling.urlParams(\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\"page_size\", request.pageSize],\n [\n \"project_id\",\n request.projectId ?? this.client.settings.defaultProjectId\n ]\n )\n },\n marshalling_gen.unmarshalListDatabasesResponse\n );\n /**\n * List your Serverless SQL Databases. List all Serverless SQL Databases for a\n * given Scaleway Organization or Scaleway Project. By default, the databases\n * returned in the list are ordered by creation date in ascending order,\n * though this can be modified via the order_by field. For the `name`\n * parameter, the value you include will be checked against the whole name\n * string to see if it includes the string you put in the parameter.\n *\n * @param request - The request {@link ListDatabasesRequest}\n * @returns A Promise of ListDatabasesResponse\n */\n listDatabases = (request = {}) => resourcePaginator.enrichForPagination(\"databases\", this.pageOfListDatabases, request);\n /**\n * Update database information. Update CPU limits of your Serverless SQL\n * Database. You must provide the `database_id` parameter.\n *\n * @param request - The request {@link UpdateDatabaseRequest}\n * @returns A Promise of Database\n */\n updateDatabase = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateDatabaseRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/serverless-sqldb/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/databases/${marshalling.validatePathParam(\"databaseId\", request.databaseId)}`\n },\n marshalling_gen.unmarshalDatabase\n );\n /**\n * Restore a database from a backup. Restore a database from a backup. You\n * must provide the `backup_id` parameter.\n *\n * @param request - The request {@link RestoreDatabaseFromBackupRequest}\n * @returns A Promise of Database\n */\n restoreDatabaseFromBackup = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalRestoreDatabaseFromBackupRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/serverless-sqldb/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/databases/${marshalling.validatePathParam(\"databaseId\", request.databaseId)}/restore`\n },\n marshalling_gen.unmarshalDatabase\n );\n /**\n * Get a database backup information. Retrieve information about your\n * Serverless SQL Database backup. You must provide the `backup_id`\n * parameter.\n *\n * @param request - The request {@link GetDatabaseBackupRequest}\n * @returns A Promise of DatabaseBackup\n */\n getDatabaseBackup = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/serverless-sqldb/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/backups/${marshalling.validatePathParam(\"backupId\", request.backupId)}`\n },\n marshalling_gen.unmarshalDatabaseBackup\n );\n pageOfListDatabaseBackups = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/serverless-sqldb/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/backups`,\n urlParams: marshalling.urlParams(\n [\"database_id\", request.databaseId],\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\"page_size\", request.pageSize],\n [\"project_id\", request.projectId]\n )\n },\n marshalling_gen.unmarshalListDatabaseBackupsResponse\n );\n /**\n * List your Serverless SQL Database backups. List all Serverless SQL Database\n * backups for a given Scaleway Project or Database. By default, the backups\n * returned in the list are ordered by creation date in descending order,\n * though this can be modified via the order_by field.\n *\n * @param request - The request {@link ListDatabaseBackupsRequest}\n * @returns A Promise of ListDatabaseBackupsResponse\n */\n listDatabaseBackups = (request) => resourcePaginator.enrichForPagination(\"backups\", this.pageOfListDatabaseBackups, request);\n /**\n * Export a database backup. Export a database backup providing a download\n * link once the export process is completed. You must provide the `backup_id`\n * parameter.\n *\n * @param request - The request {@link ExportDatabaseBackupRequest}\n * @returns A Promise of DatabaseBackup\n */\n exportDatabaseBackup = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/serverless-sqldb/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/backups/${marshalling.validatePathParam(\"backupId\", request.backupId)}/export`\n },\n marshalling_gen.unmarshalDatabaseBackup\n );\n}\nexports.API = API;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst DATABASE_TRANSIENT_STATUSES = [\n \"creating\",\n \"deleting\",\n \"restoring\"\n];\nexports.DATABASE_TRANSIENT_STATUSES = DATABASE_TRANSIENT_STATUSES;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api_gen = require(\"./api.gen.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nconst validationRules_gen = require(\"./validation-rules.gen.cjs\");\nexports.API = api_gen.API;\nexports.DATABASE_TRANSIENT_STATUSES = content_gen.DATABASE_TRANSIENT_STATUSES;\nexports.ValidationRules = validationRules_gen;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst json = require(\"../../../helpers/json.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst unmarshalDatabaseBackup = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DatabaseBackup' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n databaseId: data.database_id,\n dbSize: data.db_size,\n downloadUrl: data.download_url,\n downloadUrlExpiresAt: marshalling.unmarshalDate(data.download_url_expires_at),\n expiresAt: marshalling.unmarshalDate(data.expires_at),\n id: data.id,\n organizationId: data.organization_id,\n projectId: data.project_id,\n region: data.region,\n size: data.size,\n status: data.status\n };\n};\nconst unmarshalDatabase = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Database' failed as data isn't a dictionary.`\n );\n }\n return {\n cpuCurrent: data.cpu_current,\n cpuMax: data.cpu_max,\n cpuMin: data.cpu_min,\n createdAt: marshalling.unmarshalDate(data.created_at),\n endpoint: data.endpoint,\n engineMajorVersion: data.engine_major_version,\n id: data.id,\n name: data.name,\n organizationId: data.organization_id,\n projectId: data.project_id,\n region: data.region,\n started: data.started,\n status: data.status\n };\n};\nconst unmarshalListDatabaseBackupsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListDatabaseBackupsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n backups: marshalling.unmarshalArrayOfObject(data.backups, unmarshalDatabaseBackup),\n totalCount: data.total_count\n };\n};\nconst unmarshalListDatabasesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListDatabasesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n databases: marshalling.unmarshalArrayOfObject(data.databases, unmarshalDatabase),\n totalCount: data.total_count\n };\n};\nconst marshalCreateDatabaseRequest = (request, defaults) => ({\n cpu_max: request.cpuMax,\n cpu_min: request.cpuMin,\n from_backup_id: request.fromBackupId,\n name: request.name,\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalRestoreDatabaseFromBackupRequest = (request, defaults) => ({\n backup_id: request.backupId\n});\nconst marshalUpdateDatabaseRequest = (request, defaults) => ({\n cpu_max: request.cpuMax,\n cpu_min: request.cpuMin\n});\nexports.marshalCreateDatabaseRequest = marshalCreateDatabaseRequest;\nexports.marshalRestoreDatabaseFromBackupRequest = marshalRestoreDatabaseFromBackupRequest;\nexports.marshalUpdateDatabaseRequest = marshalUpdateDatabaseRequest;\nexports.unmarshalDatabase = unmarshalDatabase;\nexports.unmarshalDatabaseBackup = unmarshalDatabaseBackup;\nexports.unmarshalListDatabaseBackupsResponse = unmarshalListDatabaseBackupsResponse;\nexports.unmarshalListDatabasesResponse = unmarshalListDatabasesResponse;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst CreateDatabaseRequest = {\n cpuMax: {\n greaterThanOrEqual: 1,\n lessThanOrEqual: 15\n },\n cpuMin: {\n lessThanOrEqual: 15\n },\n fromBackupId: {\n ignoreEmpty: true\n },\n name: {\n maxLength: 63,\n minLength: 1\n }\n};\nconst Database = {\n cpuCurrent: {\n lessThanOrEqual: 15\n },\n cpuMax: {\n greaterThanOrEqual: 1,\n lessThanOrEqual: 15\n },\n cpuMin: {\n lessThanOrEqual: 15\n }\n};\nconst ListDatabaseBackupsRequest = {\n page: {\n greaterThanOrEqual: 1\n },\n pageSize: {\n greaterThanOrEqual: 1,\n lessThanOrEqual: 1e3\n }\n};\nconst ListDatabasesRequest = {\n page: {\n greaterThanOrEqual: 1\n },\n pageSize: {\n greaterThanOrEqual: 1,\n lessThanOrEqual: 1e3\n }\n};\nconst UpdateDatabaseRequest = {\n cpuMax: {\n greaterThanOrEqual: 1,\n lessThanOrEqual: 15\n },\n cpuMin: {\n lessThanOrEqual: 15\n }\n};\nexports.CreateDatabaseRequest = CreateDatabaseRequest;\nexports.Database = Database;\nexports.ListDatabaseBackupsRequest = ListDatabaseBackupsRequest;\nexports.ListDatabasesRequest = ListDatabasesRequest;\nexports.UpdateDatabaseRequest = UpdateDatabaseRequest;\n","\"use strict\";\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst index_gen = require(\"./v1alpha1/index.gen.cjs\");\nexports.v1alpha1 = index_gen;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst intervalRetrier = require(\"../../../internal/async/interval-retrier.cjs\");\nconst api = require(\"../../../scw/api.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst resourcePaginator = require(\"../../../scw/fetch/resource-paginator.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nconst marshalling_gen = require(\"./marshalling.gen.cjs\");\nconst jsonContentHeaders = {\n \"Content-Type\": \"application/json; charset=utf-8\"\n};\nclass API extends api.API {\n /** Lists the available regions of the API. */\n static LOCALITIES = [\"fr-par\"];\n /**\n * Send an email. You must specify the `region`, the sender and the\n * recipient's information and the `project_id` to send an email from a\n * checked domain. The subject of the email must contain at least 6\n * characters.\n *\n * @param request - The request {@link CreateEmailRequest}\n * @returns A Promise of CreateEmailResponse\n */\n createEmail = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateEmailRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/transactional-email/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/emails`\n },\n marshalling_gen.unmarshalCreateEmailResponse\n );\n /**\n * Get an email. Retrieve information about a specific email using the\n * `email_id` and `region` parameters.\n *\n * @param request - The request {@link GetEmailRequest}\n * @returns A Promise of Email\n */\n getEmail = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/transactional-email/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/emails/${marshalling.validatePathParam(\"emailId\", request.emailId)}`\n },\n marshalling_gen.unmarshalEmail\n );\n /**\n * Waits for {@link Email} to be in a final state.\n *\n * @param request - The request {@link GetEmailRequest}\n * @param options - The waiting options\n * @returns A Promise of Email\n */\n waitForEmail = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(!content_gen.EMAIL_TRANSIENT_STATUSES.includes(res.status))),\n this.getEmail,\n request,\n options\n );\n pageOfListEmails = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/transactional-email/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/emails`,\n urlParams: marshalling.urlParams(\n [\"domain_id\", request.domainId],\n [\"flags\", request.flags],\n [\"mail_from\", request.mailFrom],\n [\"mail_rcpt\", request.mailRcpt],\n [\"mail_to\", request.mailTo],\n [\"message_id\", request.messageId],\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId],\n [\"search\", request.search],\n [\"since\", request.since],\n [\"statuses\", request.statuses],\n [\"subject\", request.subject],\n [\"until\", request.until]\n )\n },\n marshalling_gen.unmarshalListEmailsResponse\n );\n /**\n * List emails. Retrieve the list of emails sent from a specific domain or for\n * a specific Project or Organization. You must specify the `region`.\n *\n * @param request - The request {@link ListEmailsRequest}\n * @returns A Promise of ListEmailsResponse\n */\n listEmails = (request = {}) => resourcePaginator.enrichForPagination(\"emails\", this.pageOfListEmails, request);\n /**\n * Email statuses. Get information on your emails' statuses.\n *\n * @param request - The request {@link GetStatisticsRequest}\n * @returns A Promise of Statistics\n */\n getStatistics = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/transactional-email/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/statistics`,\n urlParams: marshalling.urlParams(\n [\"domain_id\", request.domainId],\n [\"mail_from\", request.mailFrom],\n [\"project_id\", request.projectId],\n [\"since\", request.since],\n [\"until\", request.until]\n )\n },\n marshalling_gen.unmarshalStatistics\n );\n /**\n * Cancel an email. You can cancel the sending of an email if it has not been\n * sent yet. You must specify the `region` and the `email_id` of the email you\n * want to cancel.\n *\n * @param request - The request {@link CancelEmailRequest}\n * @returns A Promise of Email\n */\n cancelEmail = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/transactional-email/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/emails/${marshalling.validatePathParam(\"emailId\", request.emailId)}/cancel`\n },\n marshalling_gen.unmarshalEmail\n );\n /**\n * Register a domain in a project. You must specify the `region`, `project_id`\n * and `domain_name` to register a domain in a specific Project.\n *\n * @param request - The request {@link CreateDomainRequest}\n * @returns A Promise of Domain\n */\n createDomain = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateDomainRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/transactional-email/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/domains`\n },\n marshalling_gen.unmarshalDomain\n );\n /**\n * Get information about a domain. Retrieve information about a specific\n * domain using the `region` and `domain_id` parameters. Monitor your domain's\n * reputation and improve **average** and **bad** reputation statuses, using\n * your domain's **Email activity** tab on the [Scaleway\n * console](https://console.scaleway.com/transactional-email/domains) to get a\n * more detailed report. Check out our [dedicated\n * documentation](https://www.scaleway.com/en/docs/managed-services/transactional-email/reference-content/understanding-tem-reputation-score/)\n * to improve your domain's reputation.\n *\n * @param request - The request {@link GetDomainRequest}\n * @returns A Promise of Domain\n */\n getDomain = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/transactional-email/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/domains/${marshalling.validatePathParam(\"domainId\", request.domainId)}`\n },\n marshalling_gen.unmarshalDomain\n );\n /**\n * Waits for {@link Domain} to be in a final state.\n *\n * @param request - The request {@link GetDomainRequest}\n * @param options - The waiting options\n * @returns A Promise of Domain\n */\n waitForDomain = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(!content_gen.DOMAIN_TRANSIENT_STATUSES.includes(res.status))),\n this.getDomain,\n request,\n options\n );\n pageOfListDomains = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/transactional-email/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/domains`,\n urlParams: marshalling.urlParams(\n [\"name\", request.name],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId],\n [\"status\", request.status]\n )\n },\n marshalling_gen.unmarshalListDomainsResponse\n );\n /**\n * List domains. Retrieve domains in a specific Project or in a specific\n * Organization using the `region` parameter.\n *\n * @param request - The request {@link ListDomainsRequest}\n * @returns A Promise of ListDomainsResponse\n */\n listDomains = (request = {}) => resourcePaginator.enrichForPagination(\"domains\", this.pageOfListDomains, request);\n /**\n * Delete a domain. You must specify the domain you want to delete by the\n * `region` and `domain_id`. Deleting a domain is permanent and cannot be\n * undone.\n *\n * @param request - The request {@link RevokeDomainRequest}\n * @returns A Promise of Domain\n */\n revokeDomain = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/transactional-email/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/domains/${marshalling.validatePathParam(\"domainId\", request.domainId)}/revoke`\n },\n marshalling_gen.unmarshalDomain\n );\n /**\n * Domain DNS check. Perform an immediate DNS check of a domain using the\n * `region` and `domain_id` parameters.\n *\n * @param request - The request {@link CheckDomainRequest}\n * @returns A Promise of Domain\n */\n checkDomain = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/transactional-email/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/domains/${marshalling.validatePathParam(\"domainId\", request.domainId)}/check`\n },\n marshalling_gen.unmarshalDomain\n );\n /**\n * Display SPF and DKIM records status and potential errors. Display SPF and\n * DKIM records status and potential errors, including the found records to\n * make debugging easier.\n *\n * @param request - The request {@link GetDomainLastStatusRequest}\n * @returns A Promise of DomainLastStatus\n */\n getDomainLastStatus = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/transactional-email/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/domains/${marshalling.validatePathParam(\"domainId\", request.domainId)}/verification`\n },\n marshalling_gen.unmarshalDomainLastStatus\n );\n /**\n * Update a domain. Update a domain auto-configuration.\n *\n * @param request - The request {@link UpdateDomainRequest}\n * @returns A Promise of Domain\n */\n updateDomain = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateDomainRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/transactional-email/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/domains/${marshalling.validatePathParam(\"domainId\", request.domainId)}`\n },\n marshalling_gen.unmarshalDomain\n );\n /**\n * Create a Webhook. Create a new Webhook triggered by a list of event types\n * and pushed to a Scaleway SNS ARN.\n *\n * @param request - The request {@link CreateWebhookRequest}\n * @returns A Promise of Webhook\n */\n createWebhook = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateWebhookRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/transactional-email/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/webhooks`\n },\n marshalling_gen.unmarshalWebhook\n );\n pageOfListWebhooks = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/transactional-email/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/webhooks`,\n urlParams: marshalling.urlParams(\n [\"domain_id\", request.domainId],\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId]\n )\n },\n marshalling_gen.unmarshalListWebhooksResponse\n );\n /**\n * List Webhooks. Retrieve Webhooks in a specific Project or in a specific\n * Organization using the `region` parameter.\n *\n * @param request - The request {@link ListWebhooksRequest}\n * @returns A Promise of ListWebhooksResponse\n */\n listWebhooks = (request = {}) => resourcePaginator.enrichForPagination(\"webhooks\", this.pageOfListWebhooks, request);\n /**\n * Get information about a Webhook. Retrieve information about a specific\n * Webhook using the `webhook_id` and `region` parameters.\n *\n * @param request - The request {@link GetWebhookRequest}\n * @returns A Promise of Webhook\n */\n getWebhook = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/transactional-email/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/webhooks/${marshalling.validatePathParam(\"webhookId\", request.webhookId)}`\n },\n marshalling_gen.unmarshalWebhook\n );\n /**\n * Update a Webhook. Update a Webhook events type, SNS ARN or name.\n *\n * @param request - The request {@link UpdateWebhookRequest}\n * @returns A Promise of Webhook\n */\n updateWebhook = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateWebhookRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/transactional-email/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/webhooks/${marshalling.validatePathParam(\"webhookId\", request.webhookId)}`\n },\n marshalling_gen.unmarshalWebhook\n );\n /**\n * Delete a Webhook. You must specify the Webhook you want to delete by the\n * `region` and `webhook_id`. Deleting a Webhook is permanent and cannot be\n * undone.\n *\n * @param request - The request {@link DeleteWebhookRequest}\n */\n deleteWebhook = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/transactional-email/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/webhooks/${marshalling.validatePathParam(\"webhookId\", request.webhookId)}`\n });\n pageOfListWebhookEvents = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/transactional-email/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/webhooks/${marshalling.validatePathParam(\"webhookId\", request.webhookId)}/events`,\n urlParams: marshalling.urlParams(\n [\"domain_id\", request.domainId],\n [\"email_id\", request.emailId],\n [\"event_types\", request.eventTypes],\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId],\n [\"statuses\", request.statuses]\n )\n },\n marshalling_gen.unmarshalListWebhookEventsResponse\n );\n /**\n * List Webhook triggered events. Retrieve the list of Webhook events\n * triggered from a specific Webhook or for a specific Project or\n * Organization. You must specify the `region`.\n *\n * @param request - The request {@link ListWebhookEventsRequest}\n * @returns A Promise of ListWebhookEventsResponse\n */\n listWebhookEvents = (request) => resourcePaginator.enrichForPagination(\"webhookEvents\", this.pageOfListWebhookEvents, request);\n /**\n * List project settings. Retrieve the project settings including periodic\n * reports.\n *\n * @param request - The request {@link GetProjectSettingsRequest}\n * @returns A Promise of ProjectSettings\n */\n getProjectSettings = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/transactional-email/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/project/${marshalling.validatePathParam(\"projectId\", request.projectId ?? this.client.settings.defaultProjectId)}/settings`\n },\n marshalling_gen.unmarshalProjectSettings\n );\n /**\n * Update project settings. Update the project settings including periodic\n * reports.\n *\n * @param request - The request {@link UpdateProjectSettingsRequest}\n * @returns A Promise of ProjectSettings\n */\n updateProjectSettings = (request = {}) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateProjectSettingsRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/transactional-email/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/project/${marshalling.validatePathParam(\"projectId\", request.projectId ?? this.client.settings.defaultProjectId)}/settings`\n },\n marshalling_gen.unmarshalProjectSettings\n );\n}\nexports.API = API;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst DOMAIN_TRANSIENT_STATUSES = [\n \"pending\",\n \"autoconfiguring\"\n];\nconst EMAIL_TRANSIENT_STATUSES = [\"new\", \"sending\"];\nexports.DOMAIN_TRANSIENT_STATUSES = DOMAIN_TRANSIENT_STATUSES;\nexports.EMAIL_TRANSIENT_STATUSES = EMAIL_TRANSIENT_STATUSES;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api_gen = require(\"./api.gen.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nconst validationRules_gen = require(\"./validation-rules.gen.cjs\");\nexports.API = api_gen.API;\nexports.DOMAIN_TRANSIENT_STATUSES = content_gen.DOMAIN_TRANSIENT_STATUSES;\nexports.EMAIL_TRANSIENT_STATUSES = content_gen.EMAIL_TRANSIENT_STATUSES;\nexports.ValidationRules = validationRules_gen;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst json = require(\"../../../helpers/json.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst unmarshalEmailTry = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'EmailTry' failed as data isn't a dictionary.`\n );\n }\n return {\n code: data.code,\n message: data.message,\n rank: data.rank,\n triedAt: marshalling.unmarshalDate(data.tried_at)\n };\n};\nconst unmarshalEmail = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Email' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n flags: data.flags,\n id: data.id,\n lastTries: marshalling.unmarshalArrayOfObject(data.last_tries, unmarshalEmailTry),\n mailFrom: data.mail_from,\n mailRcpt: data.mail_rcpt,\n messageId: data.message_id,\n projectId: data.project_id,\n rcptTo: data.rcpt_to,\n rcptType: data.rcpt_type,\n status: data.status,\n statusDetails: data.status_details,\n subject: data.subject,\n tryCount: data.try_count,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalDomainRecordsDMARC = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DomainRecordsDMARC' failed as data isn't a dictionary.`\n );\n }\n return {\n name: data.name,\n value: data.value\n };\n};\nconst unmarshalDomainRecords = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DomainRecords' failed as data isn't a dictionary.`\n );\n }\n return {\n dmarc: data.dmarc ? unmarshalDomainRecordsDMARC(data.dmarc) : void 0\n };\n};\nconst unmarshalDomainReputation = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DomainReputation' failed as data isn't a dictionary.`\n );\n }\n return {\n previousScore: data.previous_score,\n previousScoredAt: marshalling.unmarshalDate(data.previous_scored_at),\n score: data.score,\n scoredAt: marshalling.unmarshalDate(data.scored_at),\n status: data.status\n };\n};\nconst unmarshalDomainStatistics = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DomainStatistics' failed as data isn't a dictionary.`\n );\n }\n return {\n canceledCount: data.canceled_count,\n failedCount: data.failed_count,\n sentCount: data.sent_count,\n totalCount: data.total_count\n };\n};\nconst unmarshalDomain = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Domain' failed as data isn't a dictionary.`\n );\n }\n return {\n autoconfig: data.autoconfig,\n createdAt: marshalling.unmarshalDate(data.created_at),\n dkimConfig: data.dkim_config,\n id: data.id,\n lastError: data.last_error,\n lastValidAt: marshalling.unmarshalDate(data.last_valid_at),\n name: data.name,\n nextCheckAt: marshalling.unmarshalDate(data.next_check_at),\n organizationId: data.organization_id,\n projectId: data.project_id,\n records: data.records ? unmarshalDomainRecords(data.records) : void 0,\n region: data.region,\n reputation: data.reputation ? unmarshalDomainReputation(data.reputation) : void 0,\n revokedAt: marshalling.unmarshalDate(data.revoked_at),\n spfConfig: data.spf_config,\n statistics: data.statistics ? unmarshalDomainStatistics(data.statistics) : void 0,\n status: data.status\n };\n};\nconst unmarshalWebhook = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Webhook' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n domainId: data.domain_id,\n eventTypes: data.event_types,\n id: data.id,\n name: data.name,\n organizationId: data.organization_id,\n projectId: data.project_id,\n snsArn: data.sns_arn,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalCreateEmailResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'CreateEmailResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n emails: marshalling.unmarshalArrayOfObject(data.emails, unmarshalEmail)\n };\n};\nconst unmarshalDomainLastStatusDkimRecord = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DomainLastStatusDkimRecord' failed as data isn't a dictionary.`\n );\n }\n return {\n error: data.error,\n lastValidAt: marshalling.unmarshalDate(data.last_valid_at),\n status: data.status\n };\n};\nconst unmarshalDomainLastStatusDmarcRecord = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DomainLastStatusDmarcRecord' failed as data isn't a dictionary.`\n );\n }\n return {\n error: data.error,\n lastValidAt: marshalling.unmarshalDate(data.last_valid_at),\n status: data.status\n };\n};\nconst unmarshalDomainLastStatusSpfRecord = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DomainLastStatusSpfRecord' failed as data isn't a dictionary.`\n );\n }\n return {\n error: data.error,\n lastValidAt: marshalling.unmarshalDate(data.last_valid_at),\n status: data.status\n };\n};\nconst unmarshalDomainLastStatus = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DomainLastStatus' failed as data isn't a dictionary.`\n );\n }\n return {\n dkimRecord: data.dkim_record ? unmarshalDomainLastStatusDkimRecord(data.dkim_record) : void 0,\n dmarcRecord: data.dmarc_record ? unmarshalDomainLastStatusDmarcRecord(data.dmarc_record) : void 0,\n domainId: data.domain_id,\n domainName: data.domain_name,\n spfRecord: data.spf_record ? unmarshalDomainLastStatusSpfRecord(data.spf_record) : void 0\n };\n};\nconst unmarshalListDomainsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListDomainsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n domains: marshalling.unmarshalArrayOfObject(data.domains, unmarshalDomain),\n totalCount: data.total_count\n };\n};\nconst unmarshalListEmailsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListEmailsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n emails: marshalling.unmarshalArrayOfObject(data.emails, unmarshalEmail),\n totalCount: data.total_count\n };\n};\nconst unmarshalWebhookEvent = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'WebhookEvent' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n data: data.data,\n domainId: data.domain_id,\n emailId: data.email_id,\n id: data.id,\n organizationId: data.organization_id,\n projectId: data.project_id,\n status: data.status,\n type: data.type,\n updatedAt: marshalling.unmarshalDate(data.updated_at),\n webhookId: data.webhook_id\n };\n};\nconst unmarshalListWebhookEventsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListWebhookEventsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n totalCount: data.total_count,\n webhookEvents: marshalling.unmarshalArrayOfObject(\n data.webhook_events,\n unmarshalWebhookEvent\n )\n };\n};\nconst unmarshalListWebhooksResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListWebhooksResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n totalCount: data.total_count,\n webhooks: marshalling.unmarshalArrayOfObject(data.webhooks, unmarshalWebhook)\n };\n};\nconst unmarshalProjectSettingsPeriodicReport = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ProjectSettingsPeriodicReport' failed as data isn't a dictionary.`\n );\n }\n return {\n enabled: data.enabled,\n frequency: data.frequency,\n sendingDay: data.sending_day,\n sendingHour: data.sending_hour\n };\n};\nconst unmarshalProjectSettings = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ProjectSettings' failed as data isn't a dictionary.`\n );\n }\n return {\n periodicReport: data.periodic_report ? unmarshalProjectSettingsPeriodicReport(data.periodic_report) : void 0\n };\n};\nconst unmarshalStatistics = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Statistics' failed as data isn't a dictionary.`\n );\n }\n return {\n canceledCount: data.canceled_count,\n failedCount: data.failed_count,\n newCount: data.new_count,\n sendingCount: data.sending_count,\n sentCount: data.sent_count,\n totalCount: data.total_count\n };\n};\nconst marshalCreateDomainRequest = (request, defaults) => ({\n accept_tos: request.acceptTos,\n autoconfig: request.autoconfig,\n domain_name: request.domainName,\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalCreateEmailRequestAddress = (request, defaults) => ({\n email: request.email,\n name: request.name\n});\nconst marshalCreateEmailRequestAttachment = (request, defaults) => ({\n content: request.content,\n name: request.name,\n type: request.type\n});\nconst marshalCreateEmailRequestHeader = (request, defaults) => ({\n key: request.key,\n value: request.value\n});\nconst marshalCreateEmailRequest = (request, defaults) => ({\n additional_headers: request.additionalHeaders !== void 0 ? request.additionalHeaders.map(\n (elt) => marshalCreateEmailRequestHeader(elt)\n ) : void 0,\n attachments: request.attachments !== void 0 ? request.attachments.map(\n (elt) => marshalCreateEmailRequestAttachment(elt)\n ) : void 0,\n bcc: request.bcc !== void 0 ? request.bcc.map((elt) => marshalCreateEmailRequestAddress(elt)) : void 0,\n cc: request.cc !== void 0 ? request.cc.map((elt) => marshalCreateEmailRequestAddress(elt)) : void 0,\n from: marshalCreateEmailRequestAddress(request.from),\n html: request.html,\n project_id: request.projectId ?? defaults.defaultProjectId,\n send_before: request.sendBefore,\n subject: request.subject,\n text: request.text,\n to: request.to !== void 0 ? request.to.map((elt) => marshalCreateEmailRequestAddress(elt)) : void 0\n});\nconst marshalCreateWebhookRequest = (request, defaults) => ({\n domain_id: request.domainId,\n event_types: request.eventTypes !== void 0 ? request.eventTypes : void 0,\n name: request.name,\n project_id: request.projectId ?? defaults.defaultProjectId,\n sns_arn: request.snsArn\n});\nconst marshalUpdateDomainRequest = (request, defaults) => ({\n autoconfig: request.autoconfig\n});\nconst marshalUpdateProjectSettingsRequestUpdatePeriodicReport = (request, defaults) => ({\n enabled: request.enabled,\n frequency: request.frequency,\n sending_day: request.sendingDay,\n sending_hour: request.sendingHour\n});\nconst marshalUpdateProjectSettingsRequest = (request, defaults) => ({\n periodic_report: request.periodicReport !== void 0 ? marshalUpdateProjectSettingsRequestUpdatePeriodicReport(\n request.periodicReport\n ) : void 0\n});\nconst marshalUpdateWebhookRequest = (request, defaults) => ({\n event_types: request.eventTypes !== void 0 ? request.eventTypes : void 0,\n name: request.name,\n sns_arn: request.snsArn\n});\nexports.marshalCreateDomainRequest = marshalCreateDomainRequest;\nexports.marshalCreateEmailRequest = marshalCreateEmailRequest;\nexports.marshalCreateWebhookRequest = marshalCreateWebhookRequest;\nexports.marshalUpdateDomainRequest = marshalUpdateDomainRequest;\nexports.marshalUpdateProjectSettingsRequest = marshalUpdateProjectSettingsRequest;\nexports.marshalUpdateWebhookRequest = marshalUpdateWebhookRequest;\nexports.unmarshalCreateEmailResponse = unmarshalCreateEmailResponse;\nexports.unmarshalDomain = unmarshalDomain;\nexports.unmarshalDomainLastStatus = unmarshalDomainLastStatus;\nexports.unmarshalEmail = unmarshalEmail;\nexports.unmarshalListDomainsResponse = unmarshalListDomainsResponse;\nexports.unmarshalListEmailsResponse = unmarshalListEmailsResponse;\nexports.unmarshalListWebhookEventsResponse = unmarshalListWebhookEventsResponse;\nexports.unmarshalListWebhooksResponse = unmarshalListWebhooksResponse;\nexports.unmarshalProjectSettings = unmarshalProjectSettings;\nexports.unmarshalStatistics = unmarshalStatistics;\nexports.unmarshalWebhook = unmarshalWebhook;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst CreateDomainRequest = {\n domainName: {\n maxLength: 255,\n minLength: 1\n }\n};\nconst CreateEmailRequest = {\n subject: {\n minLength: 6\n }\n};\nconst CreateEmailRequestAddress = {\n email: {\n minLength: 1\n }\n};\nconst CreateEmailRequestAttachment = {\n name: {\n minLength: 1\n },\n type: {\n minLength: 1\n }\n};\nconst CreateEmailRequestHeader = {\n key: {\n minLength: 1\n },\n value: {\n minLength: 1\n }\n};\nconst CreateWebhookRequest = {\n name: {\n maxLength: 127,\n minLength: 3\n },\n snsArn: {\n maxLength: 127,\n minLength: 3\n }\n};\nconst ListDomainsRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThanOrEqual: 1,\n lessThanOrEqual: 1e3\n }\n};\nconst ListEmailsRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThanOrEqual: 1,\n lessThanOrEqual: 1e3\n },\n search: {\n maxLength: 100,\n minLength: 3\n },\n subject: {\n minLength: 6\n }\n};\nconst ListWebhookEventsRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThanOrEqual: 1,\n lessThanOrEqual: 100\n }\n};\nconst ListWebhooksRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThanOrEqual: 1,\n lessThanOrEqual: 100\n }\n};\nconst UpdateProjectSettingsRequestUpdatePeriodicReport = {\n sendingDay: {\n greaterThanOrEqual: 1,\n lessThanOrEqual: 28\n },\n sendingHour: {\n greaterThanOrEqual: 0,\n lessThanOrEqual: 23\n }\n};\nconst UpdateWebhookRequest = {\n name: {\n maxLength: 127,\n minLength: 3\n },\n snsArn: {\n maxLength: 127,\n minLength: 3\n }\n};\nexports.CreateDomainRequest = CreateDomainRequest;\nexports.CreateEmailRequest = CreateEmailRequest;\nexports.CreateEmailRequestAddress = CreateEmailRequestAddress;\nexports.CreateEmailRequestAttachment = CreateEmailRequestAttachment;\nexports.CreateEmailRequestHeader = CreateEmailRequestHeader;\nexports.CreateWebhookRequest = CreateWebhookRequest;\nexports.ListDomainsRequest = ListDomainsRequest;\nexports.ListEmailsRequest = ListEmailsRequest;\nexports.ListWebhookEventsRequest = ListWebhookEventsRequest;\nexports.ListWebhooksRequest = ListWebhooksRequest;\nexports.UpdateProjectSettingsRequestUpdatePeriodicReport = UpdateProjectSettingsRequestUpdatePeriodicReport;\nexports.UpdateWebhookRequest = UpdateWebhookRequest;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst index_gen = require(\"./v1/index.gen.cjs\");\nexports.v1 = index_gen;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst intervalRetrier = require(\"../../../internal/async/interval-retrier.cjs\");\nconst api = require(\"../../../scw/api.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst resourcePaginator = require(\"../../../scw/fetch/resource-paginator.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nconst marshalling_gen = require(\"./marshalling.gen.cjs\");\nconst jsonContentHeaders = {\n \"Content-Type\": \"application/json; charset=utf-8\"\n};\nclass API extends api.API {\n /**\n * Register a user. Register a human and return a access-key and a secret-key\n * that must be used in all other commands.\n *\n * Hint: you can use other test commands by setting the SCW_SECRET_KEY env\n * variable.\n *\n * @param request - The request {@link RegisterRequest}\n * @returns A Promise of RegisterResponse\n */\n register = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalRegisterRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/test/v1/register`\n },\n marshalling_gen.unmarshalRegisterResponse\n );\n pageOfListHumans = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/test/v1/humans`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId]\n )\n },\n marshalling_gen.unmarshalListHumansResponse\n );\n /**\n * List all your humans.\n *\n * @param request - The request {@link ListHumansRequest}\n * @returns A Promise of ListHumansResponse\n */\n listHumans = (request = {}) => resourcePaginator.enrichForPagination(\"humans\", this.pageOfListHumans, request);\n /**\n * Get human details. Get the human details associated with the given id.\n *\n * @param request - The request {@link GetHumanRequest}\n * @returns A Promise of Human\n */\n getHuman = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/test/v1/humans/${marshalling.validatePathParam(\"humanId\", request.humanId)}`\n },\n marshalling_gen.unmarshalHuman\n );\n /**\n * Waits for {@link Human} to be in a final state.\n *\n * @param request - The request {@link GetHumanRequest}\n * @param options - The waiting options\n * @returns A Promise of Human\n */\n waitForHuman = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(!content_gen.HUMAN_TRANSIENT_STATUSES.includes(res.status))),\n this.getHuman,\n request,\n options\n );\n /**\n * Create a new human.\n *\n * @param request - The request {@link CreateHumanRequest}\n * @returns A Promise of Human\n */\n createHuman = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateHumanRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/test/v1/humans`\n },\n marshalling_gen.unmarshalHuman\n );\n /**\n * Update an existing human. Update the human associated with the given id.\n *\n * @param request - The request {@link UpdateHumanRequest}\n * @returns A Promise of Human\n */\n updateHuman = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateHumanRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/test/v1/humans/${marshalling.validatePathParam(\"humanId\", request.humanId)}`\n },\n marshalling_gen.unmarshalHuman\n );\n /**\n * Delete an existing human. Delete the human associated with the given id.\n *\n * @param request - The request {@link DeleteHumanRequest}\n * @returns A Promise of Human\n */\n deleteHuman = (request) => this.client.fetch(\n {\n method: \"DELETE\",\n path: `/test/v1/humans/${marshalling.validatePathParam(\"humanId\", request.humanId)}`\n },\n marshalling_gen.unmarshalHuman\n );\n /**\n * Start a 1h running for the given human. Start a one hour running for the\n * given human.\n *\n * @param request - The request {@link RunHumanRequest}\n * @returns A Promise of Human\n */\n runHuman = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/test/v1/humans/${marshalling.validatePathParam(\"humanId\", request.humanId)}/run`\n },\n marshalling_gen.unmarshalHuman\n );\n /**\n * Make a human smoke.\n *\n * @deprecated\n * @param request - The request {@link SmokeHumanRequest}\n * @returns A Promise of Human\n */\n smokeHuman = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/test/v1/humans/${marshalling.validatePathParam(\"humanId\", request.humanId)}/smoke`\n },\n marshalling_gen.unmarshalHuman\n );\n}\nexports.API = API;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst HUMAN_TRANSIENT_STATUSES = [\"running\"];\nexports.HUMAN_TRANSIENT_STATUSES = HUMAN_TRANSIENT_STATUSES;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api_gen = require(\"./api.gen.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nexports.API = api_gen.API;\nexports.HUMAN_TRANSIENT_STATUSES = content_gen.HUMAN_TRANSIENT_STATUSES;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst json = require(\"../../../helpers/json.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst unmarshalHuman = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Human' failed as data isn't a dictionary.`\n );\n }\n return {\n altitudeInMeter: data.altitude_in_meter,\n altitudeInMillimeter: data.altitude_in_millimeter,\n createdAt: marshalling.unmarshalDate(data.created_at),\n eyesColor: data.eyes_color,\n fingersCount: data.fingers_count,\n hairCount: data.hair_count,\n height: data.height,\n id: data.id,\n isHappy: data.is_happy,\n name: data.name,\n organizationId: data.organization_id,\n projectId: data.project_id,\n shoeSize: data.shoe_size,\n status: data.status,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalListHumansResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListHumansResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n humans: marshalling.unmarshalArrayOfObject(data.humans, unmarshalHuman),\n totalCount: data.total_count\n };\n};\nconst unmarshalRegisterResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'RegisterResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n accessKey: data.access_key,\n secretKey: data.secret_key\n };\n};\nconst marshalCreateHumanRequest = (request, defaults) => ({\n altitude_in_meter: request.altitudeInMeter,\n altitude_in_millimeter: request.altitudeInMillimeter,\n eyes_color: request.eyesColor,\n fingers_count: request.fingersCount,\n hair_count: request.hairCount,\n height: request.height,\n is_happy: request.isHappy,\n name: request.name,\n shoe_size: request.shoeSize,\n ...marshalling.resolveOneOf([\n {\n default: defaults.defaultProjectId,\n param: \"project_id\",\n value: request.projectId\n },\n {\n default: defaults.defaultOrganizationId,\n param: \"organization_id\",\n value: request.organizationId\n }\n ])\n});\nconst marshalRegisterRequest = (request, defaults) => ({\n username: request.username\n});\nconst marshalUpdateHumanRequest = (request, defaults) => ({\n altitude_in_meter: request.altitudeInMeter,\n altitude_in_millimeter: request.altitudeInMillimeter,\n eyes_color: request.eyesColor,\n fingers_count: request.fingersCount,\n hair_count: request.hairCount,\n height: request.height,\n is_happy: request.isHappy,\n name: request.name,\n shoe_size: request.shoeSize\n});\nexports.marshalCreateHumanRequest = marshalCreateHumanRequest;\nexports.marshalRegisterRequest = marshalRegisterRequest;\nexports.marshalUpdateHumanRequest = marshalUpdateHumanRequest;\nexports.unmarshalHuman = unmarshalHuman;\nexports.unmarshalListHumansResponse = unmarshalListHumansResponse;\nexports.unmarshalRegisterResponse = unmarshalRegisterResponse;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst index_gen = require(\"./v1/index.gen.cjs\");\nconst index_gen$1 = require(\"./v2/index.gen.cjs\");\nexports.v1 = index_gen;\nexports.v2 = index_gen$1;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api = require(\"../../../scw/api.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst resourcePaginator = require(\"../../../scw/fetch/resource-paginator.cjs\");\nconst marshalling_gen = require(\"./marshalling.gen.cjs\");\nconst jsonContentHeaders = {\n \"Content-Type\": \"application/json; charset=utf-8\"\n};\nclass API extends api.API {\n /** Lists the available zones of the API. */\n static LOCALITIES = [\n \"fr-par-1\",\n \"fr-par-2\",\n \"fr-par-3\",\n \"nl-ams-1\",\n \"nl-ams-2\",\n \"nl-ams-3\",\n \"pl-waw-1\",\n \"pl-waw-2\"\n ];\n pageOfListPrivateNetworks = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/vpc/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/private-networks`,\n urlParams: marshalling.urlParams(\n [\"include_regional\", request.includeRegional],\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"private_network_ids\", request.privateNetworkIds],\n [\"project_id\", request.projectId],\n [\"tags\", request.tags]\n )\n },\n marshalling_gen.unmarshalListPrivateNetworksResponse\n );\n /**\n * List Private Networks. List existing Private Networks in a specified\n * Availability Zone. By default, the Private Networks returned in the list\n * are ordered by creation date in ascending order, though this can be\n * modified via the order_by field.\n *\n * @param request - The request {@link ListPrivateNetworksRequest}\n * @returns A Promise of ListPrivateNetworksResponse\n */\n listPrivateNetworks = (request = {}) => resourcePaginator.enrichForPagination(\n \"privateNetworks\",\n this.pageOfListPrivateNetworks,\n request\n );\n /**\n * Create a Private Network. Create a new Private Network. Once created, you\n * can attach Scaleway resources in the same Availability Zone.\n *\n * @param request - The request {@link CreatePrivateNetworkRequest}\n * @returns A Promise of PrivateNetwork\n */\n createPrivateNetwork = (request = {}) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreatePrivateNetworkRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/vpc/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/private-networks`\n },\n marshalling_gen.unmarshalPrivateNetwork\n );\n /**\n * Get a Private Network. Retrieve information about an existing Private\n * Network, specified by its Private Network ID. Its full details are returned\n * in the response object.\n *\n * @param request - The request {@link GetPrivateNetworkRequest}\n * @returns A Promise of PrivateNetwork\n */\n getPrivateNetwork = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/vpc/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/private-networks/${marshalling.validatePathParam(\"privateNetworkId\", request.privateNetworkId)}`\n },\n marshalling_gen.unmarshalPrivateNetwork\n );\n /**\n * Update Private Network. Update parameters (such as name or tags) of an\n * existing Private Network, specified by its Private Network ID.\n *\n * @param request - The request {@link UpdatePrivateNetworkRequest}\n * @returns A Promise of PrivateNetwork\n */\n updatePrivateNetwork = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdatePrivateNetworkRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/vpc/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/private-networks/${marshalling.validatePathParam(\"privateNetworkId\", request.privateNetworkId)}`\n },\n marshalling_gen.unmarshalPrivateNetwork\n );\n /**\n * Delete a Private Network. Delete an existing Private Network. Note that you\n * must first detach all resources from the network, in order to delete it.\n *\n * @param request - The request {@link DeletePrivateNetworkRequest}\n */\n deletePrivateNetwork = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/vpc/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/private-networks/${marshalling.validatePathParam(\"privateNetworkId\", request.privateNetworkId)}`\n });\n}\nexports.API = API;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api_gen = require(\"./api.gen.cjs\");\nexports.API = api_gen.API;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst randomName = require(\"@scaleway/random-name\");\nconst json = require(\"../../../helpers/json.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst unmarshalPrivateNetwork = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'PrivateNetwork' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n id: data.id,\n name: data.name,\n organizationId: data.organization_id,\n projectId: data.project_id,\n subnets: data.subnets,\n tags: data.tags,\n updatedAt: marshalling.unmarshalDate(data.updated_at),\n zone: data.zone\n };\n};\nconst unmarshalListPrivateNetworksResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListPrivateNetworksResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n privateNetworks: marshalling.unmarshalArrayOfObject(\n data.private_networks,\n unmarshalPrivateNetwork\n ),\n totalCount: data.total_count\n };\n};\nconst marshalCreatePrivateNetworkRequest = (request, defaults) => ({\n name: request.name || randomName(\"pn\"),\n project_id: request.projectId ?? defaults.defaultProjectId,\n subnets: request.subnets,\n tags: request.tags\n});\nconst marshalUpdatePrivateNetworkRequest = (request, defaults) => ({\n name: request.name,\n subnets: request.subnets,\n tags: request.tags\n});\nexports.marshalCreatePrivateNetworkRequest = marshalCreatePrivateNetworkRequest;\nexports.marshalUpdatePrivateNetworkRequest = marshalUpdatePrivateNetworkRequest;\nexports.unmarshalListPrivateNetworksResponse = unmarshalListPrivateNetworksResponse;\nexports.unmarshalPrivateNetwork = unmarshalPrivateNetwork;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api = require(\"../../../scw/api.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst resourcePaginator = require(\"../../../scw/fetch/resource-paginator.cjs\");\nconst marshalling_gen = require(\"./marshalling.gen.cjs\");\nconst jsonContentHeaders = {\n \"Content-Type\": \"application/json; charset=utf-8\"\n};\nclass API extends api.API {\n /** Lists the available regions of the API. */\n static LOCALITIES = [\"fr-par\", \"nl-ams\", \"pl-waw\"];\n pageOfListVPCs = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/vpc/v2/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/vpcs`,\n urlParams: marshalling.urlParams(\n [\"is_default\", request.isDefault],\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId],\n [\"routing_enabled\", request.routingEnabled],\n [\"tags\", request.tags]\n )\n },\n marshalling_gen.unmarshalListVPCsResponse\n );\n /**\n * List VPCs. List existing VPCs in the specified region.\n *\n * @param request - The request {@link ListVPCsRequest}\n * @returns A Promise of ListVPCsResponse\n */\n listVPCs = (request = {}) => resourcePaginator.enrichForPagination(\"vpcs\", this.pageOfListVPCs, request);\n /**\n * Create a VPC. Create a new VPC in the specified region.\n *\n * @param request - The request {@link CreateVPCRequest}\n * @returns A Promise of VPC\n */\n createVPC = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateVPCRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/vpc/v2/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/vpcs`\n },\n marshalling_gen.unmarshalVPC\n );\n /**\n * Get a VPC. Retrieve details of an existing VPC, specified by its VPC ID.\n *\n * @param request - The request {@link GetVPCRequest}\n * @returns A Promise of VPC\n */\n getVPC = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/vpc/v2/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/vpcs/${marshalling.validatePathParam(\"vpcId\", request.vpcId)}`\n },\n marshalling_gen.unmarshalVPC\n );\n /**\n * Update VPC. Update parameters including name and tags of the specified VPC.\n *\n * @param request - The request {@link UpdateVPCRequest}\n * @returns A Promise of VPC\n */\n updateVPC = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateVPCRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/vpc/v2/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/vpcs/${marshalling.validatePathParam(\"vpcId\", request.vpcId)}`\n },\n marshalling_gen.unmarshalVPC\n );\n /**\n * Delete a VPC. Delete a VPC specified by its VPC ID.\n *\n * @param request - The request {@link DeleteVPCRequest}\n */\n deleteVPC = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/vpc/v2/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/vpcs/${marshalling.validatePathParam(\"vpcId\", request.vpcId)}`\n });\n pageOfListPrivateNetworks = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/vpc/v2/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/private-networks`,\n urlParams: marshalling.urlParams(\n [\"dhcp_enabled\", request.dhcpEnabled],\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"private_network_ids\", request.privateNetworkIds],\n [\"project_id\", request.projectId],\n [\"tags\", request.tags],\n [\"vpc_id\", request.vpcId]\n )\n },\n marshalling_gen.unmarshalListPrivateNetworksResponse\n );\n /**\n * List Private Networks. List existing Private Networks in the specified\n * region. By default, the Private Networks returned in the list are ordered\n * by creation date in ascending order, though this can be modified via the\n * order_by field.\n *\n * @param request - The request {@link ListPrivateNetworksRequest}\n * @returns A Promise of ListPrivateNetworksResponse\n */\n listPrivateNetworks = (request = {}) => resourcePaginator.enrichForPagination(\n \"privateNetworks\",\n this.pageOfListPrivateNetworks,\n request\n );\n /**\n * Create a Private Network. Create a new Private Network. Once created, you\n * can attach Scaleway resources which are in the same region.\n *\n * @param request - The request {@link CreatePrivateNetworkRequest}\n * @returns A Promise of PrivateNetwork\n */\n createPrivateNetwork = (request = {}) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreatePrivateNetworkRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/vpc/v2/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/private-networks`\n },\n marshalling_gen.unmarshalPrivateNetwork\n );\n /**\n * Get a Private Network. Retrieve information about an existing Private\n * Network, specified by its Private Network ID. Its full details are returned\n * in the response object.\n *\n * @param request - The request {@link GetPrivateNetworkRequest}\n * @returns A Promise of PrivateNetwork\n */\n getPrivateNetwork = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/vpc/v2/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/private-networks/${marshalling.validatePathParam(\"privateNetworkId\", request.privateNetworkId)}`\n },\n marshalling_gen.unmarshalPrivateNetwork\n );\n /**\n * Update Private Network. Update parameters (such as name or tags) of an\n * existing Private Network, specified by its Private Network ID.\n *\n * @param request - The request {@link UpdatePrivateNetworkRequest}\n * @returns A Promise of PrivateNetwork\n */\n updatePrivateNetwork = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdatePrivateNetworkRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/vpc/v2/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/private-networks/${marshalling.validatePathParam(\"privateNetworkId\", request.privateNetworkId)}`\n },\n marshalling_gen.unmarshalPrivateNetwork\n );\n /**\n * Delete a Private Network. Delete an existing Private Network. Note that you\n * must first detach all resources from the network, in order to delete it.\n *\n * @param request - The request {@link DeletePrivateNetworkRequest}\n */\n deletePrivateNetwork = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/vpc/v2/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/private-networks/${marshalling.validatePathParam(\"privateNetworkId\", request.privateNetworkId)}`\n });\n /**\n * Migrate Private Networks from zoned to regional. Transform multiple\n * existing zoned Private Networks (scoped to a single Availability Zone) into\n * regional Private Networks, scoped to an entire region. You can transform\n * one or many Private Networks (specified by their Private Network IDs)\n * within a single Scaleway Organization or Project, with the same call.\n *\n * @param request - The request {@link MigrateZonalPrivateNetworksRequest}\n */\n migrateZonalPrivateNetworks = (request = {}) => this.client.fetch({\n body: JSON.stringify(\n marshalling_gen.marshalMigrateZonalPrivateNetworksRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/vpc/v2/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/private-networks/migrate-zonal`\n });\n /**\n * Enable DHCP on a Private Network. Enable DHCP managed on an existing\n * Private Network. Note that you will not be able to deactivate it\n * afterwards.\n *\n * @param request - The request {@link EnableDHCPRequest}\n * @returns A Promise of PrivateNetwork\n */\n enableDHCP = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/vpc/v2/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/private-networks/${marshalling.validatePathParam(\"privateNetworkId\", request.privateNetworkId)}/enable-dhcp`\n },\n marshalling_gen.unmarshalPrivateNetwork\n );\n /**\n * Enable routing on a VPC. Enable routing on an existing VPC. Note that you\n * will not be able to deactivate it afterwards.\n *\n * @param request - The request {@link EnableRoutingRequest}\n * @returns A Promise of VPC\n */\n enableRouting = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/vpc/v2/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/vpcs/${marshalling.validatePathParam(\"vpcId\", request.vpcId)}/enable-routing`\n },\n marshalling_gen.unmarshalVPC\n );\n pageOfListSubnets = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/vpc/v2/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/subnets`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId],\n [\"subnet_ids\", request.subnetIds],\n [\"vpc_id\", request.vpcId]\n )\n },\n marshalling_gen.unmarshalListSubnetsResponse\n );\n /**\n * List subnets. List any Private Network's subnets. See ListPrivateNetworks\n * to list a specific Private Network's subnets.\n *\n * @param request - The request {@link ListSubnetsRequest}\n * @returns A Promise of ListSubnetsResponse\n */\n listSubnets = (request = {}) => resourcePaginator.enrichForPagination(\"subnets\", this.pageOfListSubnets, request);\n /**\n * Set a Private Network's subnets. Set subnets for an existing Private\n * Network. Note that the method is PUT and not PATCH. Any existing subnets\n * will be removed in favor of the new specified set of subnets.\n *\n * @param request - The request {@link SetSubnetsRequest}\n * @returns A Promise of SetSubnetsResponse\n */\n setSubnets = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalSetSubnetsRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PUT\",\n path: `/vpc/v2/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/private-networks/${marshalling.validatePathParam(\"privateNetworkId\", request.privateNetworkId)}/subnets`\n },\n marshalling_gen.unmarshalSetSubnetsResponse\n );\n /**\n * Add subnets to a Private Network. Add new subnets to an existing Private\n * Network.\n *\n * @param request - The request {@link AddSubnetsRequest}\n * @returns A Promise of AddSubnetsResponse\n */\n addSubnets = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalAddSubnetsRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/vpc/v2/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/private-networks/${marshalling.validatePathParam(\"privateNetworkId\", request.privateNetworkId)}/subnets`\n },\n marshalling_gen.unmarshalAddSubnetsResponse\n );\n /**\n * Delete subnets from a Private Network. Delete the specified subnets from a\n * Private Network.\n *\n * @param request - The request {@link DeleteSubnetsRequest}\n * @returns A Promise of DeleteSubnetsResponse\n */\n deleteSubnets = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalDeleteSubnetsRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"DELETE\",\n path: `/vpc/v2/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/private-networks/${marshalling.validatePathParam(\"privateNetworkId\", request.privateNetworkId)}/subnets`\n },\n marshalling_gen.unmarshalDeleteSubnetsResponse\n );\n /**\n * Create a Route. Create a new custom Route.\n *\n * @param request - The request {@link CreateRouteRequest}\n * @returns A Promise of Route\n */\n createRoute = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateRouteRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/vpc/v2/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/routes`\n },\n marshalling_gen.unmarshalRoute\n );\n /**\n * Get a Route. Retrieve details of an existing Route, specified by its Route\n * ID.\n *\n * @param request - The request {@link GetRouteRequest}\n * @returns A Promise of Route\n */\n getRoute = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/vpc/v2/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/routes/${marshalling.validatePathParam(\"routeId\", request.routeId)}`\n },\n marshalling_gen.unmarshalRoute\n );\n /**\n * Update Route. Update parameters of the specified Route.\n *\n * @param request - The request {@link UpdateRouteRequest}\n * @returns A Promise of Route\n */\n updateRoute = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateRouteRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/vpc/v2/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/routes/${marshalling.validatePathParam(\"routeId\", request.routeId)}`\n },\n marshalling_gen.unmarshalRoute\n );\n /**\n * Delete a Route. Delete a Route specified by its Route ID.\n *\n * @param request - The request {@link DeleteRouteRequest}\n */\n deleteRoute = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/vpc/v2/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/routes/${marshalling.validatePathParam(\"routeId\", request.routeId)}`\n });\n}\nexports.API = API;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api_gen = require(\"./api.gen.cjs\");\nconst validationRules_gen = require(\"./validation-rules.gen.cjs\");\nexports.API = api_gen.API;\nexports.ValidationRules = validationRules_gen;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst randomName = require(\"@scaleway/random-name\");\nconst json = require(\"../../../helpers/json.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst unmarshalSubnet = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Subnet' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n id: data.id,\n privateNetworkId: data.private_network_id,\n projectId: data.project_id,\n subnet: data.subnet,\n updatedAt: marshalling.unmarshalDate(data.updated_at),\n vpcId: data.vpc_id\n };\n};\nconst unmarshalPrivateNetwork = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'PrivateNetwork' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n dhcpEnabled: data.dhcp_enabled,\n id: data.id,\n name: data.name,\n organizationId: data.organization_id,\n projectId: data.project_id,\n region: data.region,\n subnets: marshalling.unmarshalArrayOfObject(data.subnets, unmarshalSubnet),\n tags: data.tags,\n updatedAt: marshalling.unmarshalDate(data.updated_at),\n vpcId: data.vpc_id\n };\n};\nconst unmarshalRoute = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Route' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n description: data.description,\n destination: data.destination,\n id: data.id,\n isReadOnly: data.is_read_only,\n nexthopPrivateNetworkId: data.nexthop_private_network_id,\n nexthopResourceId: data.nexthop_resource_id,\n region: data.region,\n tags: data.tags,\n updatedAt: marshalling.unmarshalDate(data.updated_at),\n vpcId: data.vpc_id\n };\n};\nconst unmarshalVPC = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'VPC' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n id: data.id,\n isDefault: data.is_default,\n name: data.name,\n organizationId: data.organization_id,\n privateNetworkCount: data.private_network_count,\n projectId: data.project_id,\n region: data.region,\n routingEnabled: data.routing_enabled,\n tags: data.tags,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalAddSubnetsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'AddSubnetsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n subnets: data.subnets\n };\n};\nconst unmarshalDeleteSubnetsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DeleteSubnetsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n subnets: data.subnets\n };\n};\nconst unmarshalListPrivateNetworksResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListPrivateNetworksResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n privateNetworks: marshalling.unmarshalArrayOfObject(\n data.private_networks,\n unmarshalPrivateNetwork\n ),\n totalCount: data.total_count\n };\n};\nconst unmarshalListSubnetsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListSubnetsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n subnets: marshalling.unmarshalArrayOfObject(data.subnets, unmarshalSubnet),\n totalCount: data.total_count\n };\n};\nconst unmarshalListVPCsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListVPCsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n totalCount: data.total_count,\n vpcs: marshalling.unmarshalArrayOfObject(data.vpcs, unmarshalVPC)\n };\n};\nconst unmarshalSetSubnetsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SetSubnetsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n subnets: data.subnets\n };\n};\nconst marshalAddSubnetsRequest = (request, defaults) => ({\n subnets: request.subnets\n});\nconst marshalCreatePrivateNetworkRequest = (request, defaults) => ({\n name: request.name || randomName(\"pn\"),\n project_id: request.projectId ?? defaults.defaultProjectId,\n subnets: request.subnets,\n tags: request.tags,\n vpc_id: request.vpcId\n});\nconst marshalCreateRouteRequest = (request, defaults) => ({\n description: request.description,\n destination: request.destination,\n nexthop_private_network_id: request.nexthopPrivateNetworkId,\n nexthop_resource_id: request.nexthopResourceId,\n tags: request.tags,\n vpc_id: request.vpcId\n});\nconst marshalCreateVPCRequest = (request, defaults) => ({\n enable_routing: request.enableRouting,\n name: request.name || randomName(\"vpc\"),\n project_id: request.projectId ?? defaults.defaultProjectId,\n tags: request.tags\n});\nconst marshalDeleteSubnetsRequest = (request, defaults) => ({\n subnets: request.subnets\n});\nconst marshalMigrateZonalPrivateNetworksRequest = (request, defaults) => ({\n private_network_ids: request.privateNetworkIds,\n ...marshalling.resolveOneOf([\n {\n default: defaults.defaultOrganizationId,\n param: \"organization_id\",\n value: request.organizationId\n },\n {\n default: defaults.defaultProjectId,\n param: \"project_id\",\n value: request.projectId\n }\n ])\n});\nconst marshalSetSubnetsRequest = (request, defaults) => ({\n subnets: request.subnets\n});\nconst marshalUpdatePrivateNetworkRequest = (request, defaults) => ({\n name: request.name,\n tags: request.tags\n});\nconst marshalUpdateRouteRequest = (request, defaults) => ({\n description: request.description,\n destination: request.destination,\n nexthop_private_network_id: request.nexthopPrivateNetworkId,\n nexthop_resource_id: request.nexthopResourceId,\n tags: request.tags\n});\nconst marshalUpdateVPCRequest = (request, defaults) => ({\n name: request.name,\n tags: request.tags\n});\nexports.marshalAddSubnetsRequest = marshalAddSubnetsRequest;\nexports.marshalCreatePrivateNetworkRequest = marshalCreatePrivateNetworkRequest;\nexports.marshalCreateRouteRequest = marshalCreateRouteRequest;\nexports.marshalCreateVPCRequest = marshalCreateVPCRequest;\nexports.marshalDeleteSubnetsRequest = marshalDeleteSubnetsRequest;\nexports.marshalMigrateZonalPrivateNetworksRequest = marshalMigrateZonalPrivateNetworksRequest;\nexports.marshalSetSubnetsRequest = marshalSetSubnetsRequest;\nexports.marshalUpdatePrivateNetworkRequest = marshalUpdatePrivateNetworkRequest;\nexports.marshalUpdateRouteRequest = marshalUpdateRouteRequest;\nexports.marshalUpdateVPCRequest = marshalUpdateVPCRequest;\nexports.unmarshalAddSubnetsResponse = unmarshalAddSubnetsResponse;\nexports.unmarshalDeleteSubnetsResponse = unmarshalDeleteSubnetsResponse;\nexports.unmarshalListPrivateNetworksResponse = unmarshalListPrivateNetworksResponse;\nexports.unmarshalListSubnetsResponse = unmarshalListSubnetsResponse;\nexports.unmarshalListVPCsResponse = unmarshalListVPCsResponse;\nexports.unmarshalPrivateNetwork = unmarshalPrivateNetwork;\nexports.unmarshalRoute = unmarshalRoute;\nexports.unmarshalSetSubnetsResponse = unmarshalSetSubnetsResponse;\nexports.unmarshalVPC = unmarshalVPC;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst Route = {\n description: {\n maxLength: 200\n }\n};\nexports.Route = Route;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst index_gen = require(\"./v1/index.gen.cjs\");\nexports.v1 = index_gen;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst intervalRetrier = require(\"../../../internal/async/interval-retrier.cjs\");\nconst api = require(\"../../../scw/api.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst resourcePaginator = require(\"../../../scw/fetch/resource-paginator.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nconst marshalling_gen = require(\"./marshalling.gen.cjs\");\nconst jsonContentHeaders = {\n \"Content-Type\": \"application/json; charset=utf-8\"\n};\nclass API extends api.API {\n /** Lists the available zones of the API. */\n static LOCALITIES = [\n \"fr-par-1\",\n \"fr-par-2\",\n \"nl-ams-1\",\n \"nl-ams-2\",\n \"nl-ams-3\",\n \"pl-waw-1\",\n \"pl-waw-2\",\n \"pl-waw-3\"\n ];\n pageOfListGateways = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/vpc-gw/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/gateways`,\n urlParams: marshalling.urlParams(\n [\"name\", request.name],\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"private_network_id\", request.privateNetworkId],\n [\"project_id\", request.projectId],\n [\"status\", request.status],\n [\"tags\", request.tags],\n [\"type\", request.type]\n )\n },\n marshalling_gen.unmarshalListGatewaysResponse\n );\n /**\n * List Public Gateways. List Public Gateways in a given Scaleway Organization\n * or Project. By default, results are displayed in ascending order of\n * creation date.\n *\n * @param request - The request {@link ListGatewaysRequest}\n * @returns A Promise of ListGatewaysResponse\n */\n listGateways = (request = {}) => resourcePaginator.enrichForPagination(\"gateways\", this.pageOfListGateways, request);\n /**\n * Get a Public Gateway. Get details of a Public Gateway, specified by its\n * gateway ID. The response object contains full details of the gateway,\n * including its **name**, **type**, **status** and more.\n *\n * @param request - The request {@link GetGatewayRequest}\n * @returns A Promise of Gateway\n */\n getGateway = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/vpc-gw/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/gateways/${marshalling.validatePathParam(\"gatewayId\", request.gatewayId)}`\n },\n marshalling_gen.unmarshalGateway\n );\n /**\n * Waits for {@link Gateway} to be in a final state.\n *\n * @param request - The request {@link GetGatewayRequest}\n * @param options - The waiting options\n * @returns A Promise of Gateway\n */\n waitForGateway = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(!content_gen.GATEWAY_TRANSIENT_STATUSES.includes(res.status))),\n this.getGateway,\n request,\n options\n );\n /**\n * Create a Public Gateway. Create a new Public Gateway in the specified\n * Scaleway Project, defining its **name**, **type** and other configuration\n * details such as whether to enable SSH bastion.\n *\n * @param request - The request {@link CreateGatewayRequest}\n * @returns A Promise of Gateway\n */\n createGateway = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateGatewayRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/vpc-gw/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/gateways`\n },\n marshalling_gen.unmarshalGateway\n );\n /**\n * Update a Public Gateway. Update the parameters of an existing Public\n * Gateway, for example, its **name**, **tags**, **SSH bastion\n * configuration**, and **DNS servers**.\n *\n * @param request - The request {@link UpdateGatewayRequest}\n * @returns A Promise of Gateway\n */\n updateGateway = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateGatewayRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/vpc-gw/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/gateways/${marshalling.validatePathParam(\"gatewayId\", request.gatewayId)}`\n },\n marshalling_gen.unmarshalGateway\n );\n /**\n * Delete a Public Gateway. Delete an existing Public Gateway, specified by\n * its gateway ID. This action is irreversible.\n *\n * @param request - The request {@link DeleteGatewayRequest}\n */\n deleteGateway = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/vpc-gw/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/gateways/${marshalling.validatePathParam(\"gatewayId\", request.gatewayId)}`,\n urlParams: marshalling.urlParams([\"cleanup_dhcp\", request.cleanupDhcp])\n });\n /**\n * Upgrade a Public Gateway to the latest version and/or to a different\n * commercial offer type. Upgrade a given Public Gateway to the newest\n * software version or to a different commercial offer type. This applies the\n * latest bugfixes and features to your Public Gateway. Note that gateway\n * service will be interrupted during the update.\n *\n * @param request - The request {@link UpgradeGatewayRequest}\n * @returns A Promise of Gateway\n */\n upgradeGateway = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpgradeGatewayRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/vpc-gw/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/gateways/${marshalling.validatePathParam(\"gatewayId\", request.gatewayId)}/upgrade`\n },\n marshalling_gen.unmarshalGateway\n );\n /**\n * Upgrade a Public Gateway to IP mobility. Upgrade a Public Gateway to IP\n * mobility (move from NAT IP to routed IP). This is idempotent: repeated\n * calls after the first will return no error but have no effect.\n *\n * @param request - The request {@link EnableIPMobilityRequest}\n */\n enableIPMobility = (request) => this.client.fetch({\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/vpc-gw/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/gateways/${marshalling.validatePathParam(\"gatewayId\", request.gatewayId)}/enable-ip-mobility`\n });\n pageOfListGatewayNetworks = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/vpc-gw/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/gateway-networks`,\n urlParams: marshalling.urlParams(\n [\"dhcp_id\", request.dhcpId],\n [\"enable_masquerade\", request.enableMasquerade],\n [\"gateway_id\", request.gatewayId],\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"private_network_id\", request.privateNetworkId],\n [\"status\", request.status]\n )\n },\n marshalling_gen.unmarshalListGatewayNetworksResponse\n );\n /**\n * List Public Gateway connections to Private Networks. List the connections\n * between Public Gateways and Private Networks (a connection = a\n * GatewayNetwork). You can choose to filter by `gateway-id` to list all\n * Private Networks attached to the specified Public Gateway, or by\n * `private_network_id` to list all Public Gateways attached to the specified\n * Private Network. Other query parameters are also available. The result is\n * an array of GatewayNetwork objects, each giving details of the connection\n * between a given Public Gateway and a given Private Network.\n *\n * @param request - The request {@link ListGatewayNetworksRequest}\n * @returns A Promise of ListGatewayNetworksResponse\n */\n listGatewayNetworks = (request = {}) => resourcePaginator.enrichForPagination(\n \"gatewayNetworks\",\n this.pageOfListGatewayNetworks,\n request\n );\n /**\n * Get a Public Gateway connection to a Private Network. Get details of a\n * given connection between a Public Gateway and a Private Network (this\n * connection = a GatewayNetwork), specified by its `gateway_network_id`. The\n * response object contains details of the connection including the IDs of the\n * Public Gateway and Private Network, the dates the connection was\n * created/updated and its configuration settings.\n *\n * @param request - The request {@link GetGatewayNetworkRequest}\n * @returns A Promise of GatewayNetwork\n */\n getGatewayNetwork = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/vpc-gw/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/gateway-networks/${marshalling.validatePathParam(\"gatewayNetworkId\", request.gatewayNetworkId)}`\n },\n marshalling_gen.unmarshalGatewayNetwork\n );\n /**\n * Waits for {@link GatewayNetwork} to be in a final state.\n *\n * @param request - The request {@link GetGatewayNetworkRequest}\n * @param options - The waiting options\n * @returns A Promise of GatewayNetwork\n */\n waitForGatewayNetwork = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(\n !content_gen.GATEWAY_NETWORK_TRANSIENT_STATUSES.includes(res.status)\n )),\n this.getGatewayNetwork,\n request,\n options\n );\n /**\n * Attach a Public Gateway to a Private Network. Attach a specific Public\n * Gateway to a specific Private Network (create a GatewayNetwork). You can\n * configure parameters for the connection including DHCP settings, whether to\n * enable masquerade (dynamic NAT), and more.\n *\n * @param request - The request {@link CreateGatewayNetworkRequest}\n * @returns A Promise of GatewayNetwork\n */\n createGatewayNetwork = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateGatewayNetworkRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/vpc-gw/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/gateway-networks`\n },\n marshalling_gen.unmarshalGatewayNetwork\n );\n /**\n * Update a Public Gateway's connection to a Private Network. Update the\n * configuration parameters of a connection between a given Public Gateway and\n * Private Network (the connection = a GatewayNetwork). Updatable parameters\n * include DHCP settings and whether to enable traffic masquerade (dynamic\n * NAT).\n *\n * @param request - The request {@link UpdateGatewayNetworkRequest}\n * @returns A Promise of GatewayNetwork\n */\n updateGatewayNetwork = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateGatewayNetworkRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/vpc-gw/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/gateway-networks/${marshalling.validatePathParam(\"gatewayNetworkId\", request.gatewayNetworkId)}`\n },\n marshalling_gen.unmarshalGatewayNetwork\n );\n /**\n * Detach a Public Gateway from a Private Network. Detach a given Public\n * Gateway from a given Private Network, i.e. delete a GatewayNetwork\n * specified by a gateway_network_id.\n *\n * @param request - The request {@link DeleteGatewayNetworkRequest}\n */\n deleteGatewayNetwork = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/vpc-gw/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/gateway-networks/${marshalling.validatePathParam(\"gatewayNetworkId\", request.gatewayNetworkId)}`,\n urlParams: marshalling.urlParams([\"cleanup_dhcp\", request.cleanupDhcp])\n });\n pageOfListDHCPs = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/vpc-gw/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/dhcps`,\n urlParams: marshalling.urlParams(\n [\"address\", request.address],\n [\"has_address\", request.hasAddress],\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId]\n )\n },\n marshalling_gen.unmarshalListDHCPsResponse\n );\n /**\n * List DHCP configurations. List DHCP configurations, optionally filtering by\n * Organization, Project, Public Gateway IP address or more. The response is\n * an array of DHCP configuration objects, each identified by a DHCP ID and\n * containing configuration settings for the assignment of IP addresses to\n * devices on a Private Network attached to a Public Gateway. Note that the\n * response does not contain the IDs of any Private Network / Public Gateway\n * the configuration is attached to. Use the `List Public Gateway connections\n * to Private Networks` method for that purpose, filtering on DHCP ID.\n *\n * @param request - The request {@link ListDHCPsRequest}\n * @returns A Promise of ListDHCPsResponse\n */\n listDHCPs = (request = {}) => resourcePaginator.enrichForPagination(\"dhcps\", this.pageOfListDHCPs, request);\n /**\n * Get a DHCP configuration. Get a DHCP configuration object, identified by\n * its DHCP ID. The response object contains configuration settings for the\n * assignment of IP addresses to devices on a Private Network attached to a\n * Public Gateway. Note that the response does not contain the IDs of any\n * Private Network / Public Gateway the configuration is attached to. Use the\n * `List Public Gateway connections to Private Networks` method for that\n * purpose, filtering on DHCP ID.\n *\n * @param request - The request {@link GetDHCPRequest}\n * @returns A Promise of DHCP\n */\n getDHCP = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/vpc-gw/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/dhcps/${marshalling.validatePathParam(\"dhcpId\", request.dhcpId)}`\n },\n marshalling_gen.unmarshalDHCP\n );\n /**\n * Create a DHCP configuration. Create a new DHCP configuration object,\n * containing settings for the assignment of IP addresses to devices on a\n * Private Network attached to a Public Gateway. The response object includes\n * the ID of the DHCP configuration object. You can use this ID as part of a\n * call to `Create a Public Gateway connection to a Private Network` or\n * `Update a Public Gateway connection to a Private Network` to directly apply\n * this DHCP configuration.\n *\n * @param request - The request {@link CreateDHCPRequest}\n * @returns A Promise of DHCP\n */\n createDHCP = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateDHCPRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/vpc-gw/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/dhcps`\n },\n marshalling_gen.unmarshalDHCP\n );\n /**\n * Update a DHCP configuration. Update a DHCP configuration object, identified\n * by its DHCP ID.\n *\n * @param request - The request {@link UpdateDHCPRequest}\n * @returns A Promise of DHCP\n */\n updateDHCP = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateDHCPRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/vpc-gw/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/dhcps/${marshalling.validatePathParam(\"dhcpId\", request.dhcpId)}`\n },\n marshalling_gen.unmarshalDHCP\n );\n /**\n * Delete a DHCP configuration. Delete a DHCP configuration object, identified\n * by its DHCP ID. Note that you cannot delete a DHCP configuration object\n * that is currently being used by a Gateway Network.\n *\n * @param request - The request {@link DeleteDHCPRequest}\n */\n deleteDHCP = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/vpc-gw/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/dhcps/${marshalling.validatePathParam(\"dhcpId\", request.dhcpId)}`\n });\n pageOfListDHCPEntries = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/vpc-gw/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/dhcp-entries`,\n urlParams: marshalling.urlParams(\n [\"gateway_network_id\", request.gatewayNetworkId],\n [\"hostname\", request.hostname],\n [\"ip_address\", request.ipAddress],\n [\"mac_address\", request.macAddress],\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"type\", request.type]\n )\n },\n marshalling_gen.unmarshalListDHCPEntriesResponse\n );\n /**\n * List DHCP entries. List DHCP entries, whether dynamically assigned and/or\n * statically reserved. DHCP entries can be filtered by the Gateway Network\n * they are on, their MAC address, IP address, type or hostname.\n *\n * @param request - The request {@link ListDHCPEntriesRequest}\n * @returns A Promise of ListDHCPEntriesResponse\n */\n listDHCPEntries = (request = {}) => resourcePaginator.enrichForPagination(\"dhcpEntries\", this.pageOfListDHCPEntries, request);\n /**\n * Get a DHCP entry. Get a DHCP entry, specified by its DHCP entry ID.\n *\n * @param request - The request {@link GetDHCPEntryRequest}\n * @returns A Promise of DHCPEntry\n */\n getDHCPEntry = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/vpc-gw/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/dhcp-entries/${marshalling.validatePathParam(\"dhcpEntryId\", request.dhcpEntryId)}`\n },\n marshalling_gen.unmarshalDHCPEntry\n );\n /**\n * Create a DHCP entry. Create a static DHCP reservation, specifying the\n * Gateway Network for the reservation, the MAC address of the target device\n * and the IP address to assign this device. The response is a DHCP entry\n * object, confirming the ID and configuration details of the static DHCP\n * reservation.\n *\n * @param request - The request {@link CreateDHCPEntryRequest}\n * @returns A Promise of DHCPEntry\n */\n createDHCPEntry = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateDHCPEntryRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/vpc-gw/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/dhcp-entries`\n },\n marshalling_gen.unmarshalDHCPEntry\n );\n /**\n * Update a DHCP entry. Update the IP address for a DHCP entry, specified by\n * its DHCP entry ID. You can update an existing DHCP entry of any type\n * (`reservation` (static), `lease` (dynamic) or `unknown`), but in manually\n * updating the IP address the entry will necessarily be of type `reservation`\n * after the update.\n *\n * @param request - The request {@link UpdateDHCPEntryRequest}\n * @returns A Promise of DHCPEntry\n */\n updateDHCPEntry = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateDHCPEntryRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/vpc-gw/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/dhcp-entries/${marshalling.validatePathParam(\"dhcpEntryId\", request.dhcpEntryId)}`\n },\n marshalling_gen.unmarshalDHCPEntry\n );\n /**\n * Set all DHCP reservations on a Gateway Network. Set the list of DHCP\n * reservations attached to a Gateway Network. Reservations are identified by\n * their MAC address, and will sync the current DHCP entry list to the given\n * list, creating, updating or deleting DHCP entries accordingly.\n *\n * @param request - The request {@link SetDHCPEntriesRequest}\n * @returns A Promise of SetDHCPEntriesResponse\n */\n setDHCPEntries = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalSetDHCPEntriesRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PUT\",\n path: `/vpc-gw/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/dhcp-entries`\n },\n marshalling_gen.unmarshalSetDHCPEntriesResponse\n );\n /**\n * Delete a DHCP entry. Delete a static DHCP reservation, identified by its\n * DHCP entry ID. Note that you cannot delete DHCP entries of type `lease`,\n * these are deleted automatically when their time-to-live expires.\n *\n * @param request - The request {@link DeleteDHCPEntryRequest}\n */\n deleteDHCPEntry = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/vpc-gw/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/dhcp-entries/${marshalling.validatePathParam(\"dhcpEntryId\", request.dhcpEntryId)}`\n });\n pageOfListPATRules = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/vpc-gw/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/pat-rules`,\n urlParams: marshalling.urlParams(\n [\"gateway_id\", request.gatewayId],\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"private_ip\", request.privateIp],\n [\"protocol\", request.protocol]\n )\n },\n marshalling_gen.unmarshalListPATRulesResponse\n );\n /**\n * List PAT rules. List PAT rules. You can filter by gateway ID to list all\n * PAT rules for a particular gateway, or filter for PAT rules targeting a\n * specific IP address or using a specific protocol.\n *\n * @param request - The request {@link ListPATRulesRequest}\n * @returns A Promise of ListPATRulesResponse\n */\n listPATRules = (request = {}) => resourcePaginator.enrichForPagination(\"patRules\", this.pageOfListPATRules, request);\n /**\n * Get a PAT rule. Get a PAT rule, specified by its PAT rule ID. The response\n * object gives full details of the PAT rule, including the Public Gateway it\n * belongs to and the configuration settings in terms of public / private\n * ports, private IP and protocol.\n *\n * @param request - The request {@link GetPATRuleRequest}\n * @returns A Promise of PATRule\n */\n getPATRule = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/vpc-gw/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/pat-rules/${marshalling.validatePathParam(\"patRuleId\", request.patRuleId)}`\n },\n marshalling_gen.unmarshalPATRule\n );\n /**\n * Create a PAT rule. Create a new PAT rule on a specified Public Gateway,\n * defining the protocol to use, public port to listen on, and private port /\n * IP address to map to.\n *\n * @param request - The request {@link CreatePATRuleRequest}\n * @returns A Promise of PATRule\n */\n createPATRule = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreatePATRuleRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/vpc-gw/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/pat-rules`\n },\n marshalling_gen.unmarshalPATRule\n );\n /**\n * Update a PAT rule. Update a PAT rule, specified by its PAT rule ID.\n * Configuration settings including private/public port, private IP address\n * and protocol can all be updated.\n *\n * @param request - The request {@link UpdatePATRuleRequest}\n * @returns A Promise of PATRule\n */\n updatePATRule = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdatePATRuleRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/vpc-gw/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/pat-rules/${marshalling.validatePathParam(\"patRuleId\", request.patRuleId)}`\n },\n marshalling_gen.unmarshalPATRule\n );\n /**\n * Set all PAT rules. Set a definitive list of PAT rules attached to a Public\n * Gateway. Each rule is identified by its public port and protocol. This will\n * sync the current PAT rule list on the gateway with the new list, creating,\n * updating or deleting PAT rules accordingly.\n *\n * @param request - The request {@link SetPATRulesRequest}\n * @returns A Promise of SetPATRulesResponse\n */\n setPATRules = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalSetPATRulesRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PUT\",\n path: `/vpc-gw/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/pat-rules`\n },\n marshalling_gen.unmarshalSetPATRulesResponse\n );\n /**\n * Delete a PAT rule. Delete a PAT rule, identified by its PAT rule ID. This\n * action is irreversible.\n *\n * @param request - The request {@link DeletePATRuleRequest}\n */\n deletePATRule = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/vpc-gw/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/pat-rules/${marshalling.validatePathParam(\"patRuleId\", request.patRuleId)}`\n });\n /**\n * List Public Gateway types. List the different Public Gateway commercial\n * offer types available at Scaleway. The response is an array of objects\n * describing the name and technical details of each available gateway type.\n *\n * @param request - The request {@link ListGatewayTypesRequest}\n * @returns A Promise of ListGatewayTypesResponse\n */\n listGatewayTypes = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/vpc-gw/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/gateway-types`\n },\n marshalling_gen.unmarshalListGatewayTypesResponse\n );\n pageOfListIPs = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/vpc-gw/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/ips`,\n urlParams: marshalling.urlParams(\n [\"is_free\", request.isFree],\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId],\n [\"reverse\", request.reverse],\n [\"tags\", request.tags]\n )\n },\n marshalling_gen.unmarshalListIPsResponse\n );\n /**\n * List IPs. List Public Gateway flexible IP addresses. A number of filter\n * options are available for limiting results in the response.\n *\n * @param request - The request {@link ListIPsRequest}\n * @returns A Promise of ListIPsResponse\n */\n listIPs = (request = {}) => resourcePaginator.enrichForPagination(\"ips\", this.pageOfListIPs, request);\n /**\n * Get an IP. Get details of a Public Gateway flexible IP address, identified\n * by its IP ID. The response object contains information including which (if\n * any) Public Gateway using this IP address, the reverse and various other\n * metadata.\n *\n * @param request - The request {@link GetIPRequest}\n * @returns A Promise of IP\n */\n getIP = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/vpc-gw/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/ips/${marshalling.validatePathParam(\"ipId\", request.ipId)}`\n },\n marshalling_gen.unmarshalIP\n );\n /**\n * Reserve an IP. Create (reserve) a new flexible IP address that can be used\n * for a Public Gateway in a specified Scaleway Project.\n *\n * @param request - The request {@link CreateIPRequest}\n * @returns A Promise of IP\n */\n createIP = (request = {}) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateIPRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/vpc-gw/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/ips`\n },\n marshalling_gen.unmarshalIP\n );\n /**\n * Update an IP. Update details of an existing flexible IP address, including\n * its tags, reverse and the Public Gateway it is assigned to.\n *\n * @param request - The request {@link UpdateIPRequest}\n * @returns A Promise of IP\n */\n updateIP = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateIPRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/vpc-gw/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/ips/${marshalling.validatePathParam(\"ipId\", request.ipId)}`\n },\n marshalling_gen.unmarshalIP\n );\n /**\n * Delete an IP. Delete a flexible IP address from your account. This action\n * is irreversible.\n *\n * @param request - The request {@link DeleteIPRequest}\n */\n deleteIP = (request) => this.client.fetch({\n method: \"DELETE\",\n path: `/vpc-gw/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/ips/${marshalling.validatePathParam(\"ipId\", request.ipId)}`\n });\n /**\n * Refresh a Public Gateway's SSH keys. Refresh the SSH keys of a given Public\n * Gateway, specified by its gateway ID. This adds any new SSH keys in the\n * gateway's Scaleway Project to the gateway itself.\n *\n * @param request - The request {@link RefreshSSHKeysRequest}\n * @returns A Promise of Gateway\n */\n refreshSSHKeys = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/vpc-gw/v1/zones/${marshalling.validatePathParam(\"zone\", request.zone ?? this.client.settings.defaultZone)}/gateways/${marshalling.validatePathParam(\"gatewayId\", request.gatewayId)}/refresh-ssh-keys`\n },\n marshalling_gen.unmarshalGateway\n );\n}\nexports.API = API;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst GATEWAY_NETWORK_TRANSIENT_STATUSES = [\n \"attaching\",\n \"configuring\",\n \"detaching\"\n];\nconst GATEWAY_TRANSIENT_STATUSES = [\n \"allocating\",\n \"configuring\",\n \"stopping\",\n \"deleting\"\n];\nexports.GATEWAY_NETWORK_TRANSIENT_STATUSES = GATEWAY_NETWORK_TRANSIENT_STATUSES;\nexports.GATEWAY_TRANSIENT_STATUSES = GATEWAY_TRANSIENT_STATUSES;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api_gen = require(\"./api.gen.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nexports.API = api_gen.API;\nexports.GATEWAY_NETWORK_TRANSIENT_STATUSES = content_gen.GATEWAY_NETWORK_TRANSIENT_STATUSES;\nexports.GATEWAY_TRANSIENT_STATUSES = content_gen.GATEWAY_TRANSIENT_STATUSES;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst randomName = require(\"@scaleway/random-name\");\nconst json = require(\"../../../helpers/json.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst unmarshalDHCP = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DHCP' failed as data isn't a dictionary.`\n );\n }\n return {\n address: data.address,\n createdAt: marshalling.unmarshalDate(data.created_at),\n dnsLocalName: data.dns_local_name,\n dnsSearch: data.dns_search,\n dnsServersOverride: data.dns_servers_override,\n enableDynamic: data.enable_dynamic,\n id: data.id,\n organizationId: data.organization_id,\n poolHigh: data.pool_high,\n poolLow: data.pool_low,\n projectId: data.project_id,\n pushDefaultRoute: data.push_default_route,\n pushDnsServer: data.push_dns_server,\n rebindTimer: data.rebind_timer,\n renewTimer: data.renew_timer,\n subnet: data.subnet,\n updatedAt: marshalling.unmarshalDate(data.updated_at),\n validLifetime: data.valid_lifetime,\n zone: data.zone\n };\n};\nconst unmarshalIpamConfig = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'IpamConfig' failed as data isn't a dictionary.`\n );\n }\n return {\n ipamIpId: data.ipam_ip_id,\n pushDefaultRoute: data.push_default_route\n };\n};\nconst unmarshalGatewayNetwork = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'GatewayNetwork' failed as data isn't a dictionary.`\n );\n }\n return {\n address: data.address,\n createdAt: marshalling.unmarshalDate(data.created_at),\n dhcp: data.dhcp ? unmarshalDHCP(data.dhcp) : void 0,\n enableDhcp: data.enable_dhcp,\n enableMasquerade: data.enable_masquerade,\n gatewayId: data.gateway_id,\n id: data.id,\n ipamConfig: data.ipam_config ? unmarshalIpamConfig(data.ipam_config) : void 0,\n macAddress: data.mac_address,\n privateNetworkId: data.private_network_id,\n status: data.status,\n updatedAt: marshalling.unmarshalDate(data.updated_at),\n zone: data.zone\n };\n};\nconst unmarshalIP = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'IP' failed as data isn't a dictionary.`\n );\n }\n return {\n address: data.address,\n createdAt: marshalling.unmarshalDate(data.created_at),\n gatewayId: data.gateway_id,\n id: data.id,\n organizationId: data.organization_id,\n projectId: data.project_id,\n reverse: data.reverse,\n tags: data.tags,\n updatedAt: marshalling.unmarshalDate(data.updated_at),\n zone: data.zone\n };\n};\nconst unmarshalDHCPEntry = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DHCPEntry' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n gatewayNetworkId: data.gateway_network_id,\n hostname: data.hostname,\n id: data.id,\n ipAddress: data.ip_address,\n macAddress: data.mac_address,\n type: data.type,\n updatedAt: marshalling.unmarshalDate(data.updated_at),\n zone: data.zone\n };\n};\nconst unmarshalGatewayType = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'GatewayType' failed as data isn't a dictionary.`\n );\n }\n return {\n bandwidth: data.bandwidth,\n name: data.name,\n zone: data.zone\n };\n};\nconst unmarshalGateway = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Gateway' failed as data isn't a dictionary.`\n );\n }\n return {\n bastionEnabled: data.bastion_enabled,\n bastionPort: data.bastion_port,\n canUpgradeTo: data.can_upgrade_to,\n createdAt: marshalling.unmarshalDate(data.created_at),\n gatewayNetworks: marshalling.unmarshalArrayOfObject(\n data.gateway_networks,\n unmarshalGatewayNetwork\n ),\n id: data.id,\n ip: data.ip ? unmarshalIP(data.ip) : void 0,\n ipMobilityEnabled: data.ip_mobility_enabled,\n isLegacy: data.is_legacy,\n name: data.name,\n organizationId: data.organization_id,\n projectId: data.project_id,\n smtpEnabled: data.smtp_enabled,\n status: data.status,\n tags: data.tags,\n type: data.type ? unmarshalGatewayType(data.type) : void 0,\n updatedAt: marshalling.unmarshalDate(data.updated_at),\n upstreamDnsServers: data.upstream_dns_servers,\n version: data.version,\n zone: data.zone\n };\n};\nconst unmarshalPATRule = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'PATRule' failed as data isn't a dictionary.`\n );\n }\n return {\n createdAt: marshalling.unmarshalDate(data.created_at),\n gatewayId: data.gateway_id,\n id: data.id,\n privateIp: data.private_ip,\n privatePort: data.private_port,\n protocol: data.protocol,\n publicPort: data.public_port,\n updatedAt: marshalling.unmarshalDate(data.updated_at),\n zone: data.zone\n };\n};\nconst unmarshalListDHCPEntriesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListDHCPEntriesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n dhcpEntries: marshalling.unmarshalArrayOfObject(data.dhcp_entries, unmarshalDHCPEntry),\n totalCount: data.total_count\n };\n};\nconst unmarshalListDHCPsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListDHCPsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n dhcps: marshalling.unmarshalArrayOfObject(data.dhcps, unmarshalDHCP),\n totalCount: data.total_count\n };\n};\nconst unmarshalListGatewayNetworksResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListGatewayNetworksResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n gatewayNetworks: marshalling.unmarshalArrayOfObject(\n data.gateway_networks,\n unmarshalGatewayNetwork\n ),\n totalCount: data.total_count\n };\n};\nconst unmarshalListGatewayTypesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListGatewayTypesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n types: marshalling.unmarshalArrayOfObject(data.types, unmarshalGatewayType)\n };\n};\nconst unmarshalListGatewaysResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListGatewaysResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n gateways: marshalling.unmarshalArrayOfObject(data.gateways, unmarshalGateway),\n totalCount: data.total_count\n };\n};\nconst unmarshalListIPsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListIPsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n ips: marshalling.unmarshalArrayOfObject(data.ips, unmarshalIP),\n totalCount: data.total_count\n };\n};\nconst unmarshalListPATRulesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListPATRulesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n patRules: marshalling.unmarshalArrayOfObject(data.pat_rules, unmarshalPATRule),\n totalCount: data.total_count\n };\n};\nconst unmarshalSetDHCPEntriesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SetDHCPEntriesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n dhcpEntries: marshalling.unmarshalArrayOfObject(data.dhcp_entries, unmarshalDHCPEntry)\n };\n};\nconst unmarshalSetPATRulesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'SetPATRulesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n patRules: marshalling.unmarshalArrayOfObject(data.pat_rules, unmarshalPATRule)\n };\n};\nconst marshalCreateDHCPRequest = (request, defaults) => ({\n address: request.address,\n dns_local_name: request.dnsLocalName,\n dns_search: request.dnsSearch,\n dns_servers_override: request.dnsServersOverride,\n enable_dynamic: request.enableDynamic,\n pool_high: request.poolHigh,\n pool_low: request.poolLow,\n project_id: request.projectId ?? defaults.defaultProjectId,\n push_default_route: request.pushDefaultRoute,\n push_dns_server: request.pushDnsServer,\n rebind_timer: request.rebindTimer,\n renew_timer: request.renewTimer,\n subnet: request.subnet,\n valid_lifetime: request.validLifetime\n});\nconst marshalCreateDHCPEntryRequest = (request, defaults) => ({\n gateway_network_id: request.gatewayNetworkId,\n ip_address: request.ipAddress,\n mac_address: request.macAddress\n});\nconst marshalCreateGatewayNetworkRequestIpamConfig = (request, defaults) => ({\n ipam_ip_id: request.ipamIpId,\n push_default_route: request.pushDefaultRoute\n});\nconst marshalCreateGatewayNetworkRequest = (request, defaults) => ({\n enable_dhcp: request.enableDhcp,\n enable_masquerade: request.enableMasquerade,\n gateway_id: request.gatewayId,\n private_network_id: request.privateNetworkId,\n ...marshalling.resolveOneOf([\n { param: \"dhcp_id\", value: request.dhcpId },\n {\n param: \"dhcp\",\n value: request.dhcp !== void 0 ? marshalCreateDHCPRequest(request.dhcp, defaults) : void 0\n },\n { param: \"address\", value: request.address },\n {\n param: \"ipam_config\",\n value: request.ipamConfig !== void 0 ? marshalCreateGatewayNetworkRequestIpamConfig(\n request.ipamConfig\n ) : void 0\n }\n ])\n});\nconst marshalCreateGatewayRequest = (request, defaults) => ({\n bastion_port: request.bastionPort,\n enable_bastion: request.enableBastion,\n enable_smtp: request.enableSmtp,\n ip_id: request.ipId,\n name: request.name || randomName(\"gw\"),\n project_id: request.projectId ?? defaults.defaultProjectId,\n tags: request.tags,\n type: request.type,\n upstream_dns_servers: request.upstreamDnsServers\n});\nconst marshalCreateIPRequest = (request, defaults) => ({\n project_id: request.projectId ?? defaults.defaultProjectId,\n tags: request.tags\n});\nconst marshalCreatePATRuleRequest = (request, defaults) => ({\n gateway_id: request.gatewayId,\n private_ip: request.privateIp,\n private_port: request.privatePort,\n protocol: request.protocol,\n public_port: request.publicPort\n});\nconst marshalSetDHCPEntriesRequestEntry = (request, defaults) => ({\n ip_address: request.ipAddress,\n mac_address: request.macAddress\n});\nconst marshalSetDHCPEntriesRequest = (request, defaults) => ({\n dhcp_entries: request.dhcpEntries !== void 0 ? request.dhcpEntries.map(\n (elt) => marshalSetDHCPEntriesRequestEntry(elt)\n ) : void 0,\n gateway_network_id: request.gatewayNetworkId\n});\nconst marshalSetPATRulesRequestRule = (request, defaults) => ({\n private_ip: request.privateIp,\n private_port: request.privatePort,\n protocol: request.protocol,\n public_port: request.publicPort\n});\nconst marshalSetPATRulesRequest = (request, defaults) => ({\n gateway_id: request.gatewayId,\n pat_rules: request.patRules.map(\n (elt) => marshalSetPATRulesRequestRule(elt)\n )\n});\nconst marshalUpdateDHCPEntryRequest = (request, defaults) => ({\n ip_address: request.ipAddress\n});\nconst marshalUpdateDHCPRequest = (request, defaults) => ({\n address: request.address,\n dns_local_name: request.dnsLocalName,\n dns_search: request.dnsSearch,\n dns_servers_override: request.dnsServersOverride,\n enable_dynamic: request.enableDynamic,\n pool_high: request.poolHigh,\n pool_low: request.poolLow,\n push_default_route: request.pushDefaultRoute,\n push_dns_server: request.pushDnsServer,\n rebind_timer: request.rebindTimer,\n renew_timer: request.renewTimer,\n subnet: request.subnet,\n valid_lifetime: request.validLifetime\n});\nconst marshalUpdateGatewayNetworkRequestIpamConfig = (request, defaults) => ({\n ipam_ip_id: request.ipamIpId,\n push_default_route: request.pushDefaultRoute\n});\nconst marshalUpdateGatewayNetworkRequest = (request, defaults) => ({\n enable_dhcp: request.enableDhcp,\n enable_masquerade: request.enableMasquerade,\n ...marshalling.resolveOneOf([\n { param: \"dhcp_id\", value: request.dhcpId },\n { param: \"address\", value: request.address },\n {\n param: \"ipam_config\",\n value: request.ipamConfig !== void 0 ? marshalUpdateGatewayNetworkRequestIpamConfig(\n request.ipamConfig\n ) : void 0\n }\n ])\n});\nconst marshalUpdateGatewayRequest = (request, defaults) => ({\n bastion_port: request.bastionPort,\n enable_bastion: request.enableBastion,\n enable_smtp: request.enableSmtp,\n name: request.name,\n tags: request.tags,\n upstream_dns_servers: request.upstreamDnsServers\n});\nconst marshalUpdateIPRequest = (request, defaults) => ({\n gateway_id: request.gatewayId,\n reverse: request.reverse,\n tags: request.tags\n});\nconst marshalUpdatePATRuleRequest = (request, defaults) => ({\n private_ip: request.privateIp,\n private_port: request.privatePort,\n protocol: request.protocol,\n public_port: request.publicPort\n});\nconst marshalUpgradeGatewayRequest = (request, defaults) => ({\n type: request.type\n});\nexports.marshalCreateDHCPEntryRequest = marshalCreateDHCPEntryRequest;\nexports.marshalCreateDHCPRequest = marshalCreateDHCPRequest;\nexports.marshalCreateGatewayNetworkRequest = marshalCreateGatewayNetworkRequest;\nexports.marshalCreateGatewayRequest = marshalCreateGatewayRequest;\nexports.marshalCreateIPRequest = marshalCreateIPRequest;\nexports.marshalCreatePATRuleRequest = marshalCreatePATRuleRequest;\nexports.marshalSetDHCPEntriesRequest = marshalSetDHCPEntriesRequest;\nexports.marshalSetPATRulesRequest = marshalSetPATRulesRequest;\nexports.marshalUpdateDHCPEntryRequest = marshalUpdateDHCPEntryRequest;\nexports.marshalUpdateDHCPRequest = marshalUpdateDHCPRequest;\nexports.marshalUpdateGatewayNetworkRequest = marshalUpdateGatewayNetworkRequest;\nexports.marshalUpdateGatewayRequest = marshalUpdateGatewayRequest;\nexports.marshalUpdateIPRequest = marshalUpdateIPRequest;\nexports.marshalUpdatePATRuleRequest = marshalUpdatePATRuleRequest;\nexports.marshalUpgradeGatewayRequest = marshalUpgradeGatewayRequest;\nexports.unmarshalDHCP = unmarshalDHCP;\nexports.unmarshalDHCPEntry = unmarshalDHCPEntry;\nexports.unmarshalGateway = unmarshalGateway;\nexports.unmarshalGatewayNetwork = unmarshalGatewayNetwork;\nexports.unmarshalIP = unmarshalIP;\nexports.unmarshalListDHCPEntriesResponse = unmarshalListDHCPEntriesResponse;\nexports.unmarshalListDHCPsResponse = unmarshalListDHCPsResponse;\nexports.unmarshalListGatewayNetworksResponse = unmarshalListGatewayNetworksResponse;\nexports.unmarshalListGatewayTypesResponse = unmarshalListGatewayTypesResponse;\nexports.unmarshalListGatewaysResponse = unmarshalListGatewaysResponse;\nexports.unmarshalListIPsResponse = unmarshalListIPsResponse;\nexports.unmarshalListPATRulesResponse = unmarshalListPATRulesResponse;\nexports.unmarshalPATRule = unmarshalPATRule;\nexports.unmarshalSetDHCPEntriesResponse = unmarshalSetDHCPEntriesResponse;\nexports.unmarshalSetPATRulesResponse = unmarshalSetPATRulesResponse;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst index_gen = require(\"./v1/index.gen.cjs\");\nconst index_gen$1 = require(\"./v1alpha1/index.gen.cjs\");\nexports.v1 = index_gen;\nexports.v1alpha1 = index_gen$1;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst intervalRetrier = require(\"../../../internal/async/interval-retrier.cjs\");\nconst api = require(\"../../../scw/api.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst resourcePaginator = require(\"../../../scw/fetch/resource-paginator.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nconst marshalling_gen = require(\"./marshalling.gen.cjs\");\nconst jsonContentHeaders = {\n \"Content-Type\": \"application/json; charset=utf-8\"\n};\nclass ControlPanelAPI extends api.API {\n /** Lists the available regions of the API. */\n static LOCALITIES = [\"fr-par\", \"nl-ams\"];\n pageOfListControlPanels = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/webhosting/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/control-panels`,\n urlParams: marshalling.urlParams(\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListControlPanelsResponse\n );\n /**\n * \"List the control panels type: cpanel or plesk.\".\n *\n * @param request - The request {@link ControlPanelApiListControlPanelsRequest}\n * @returns A Promise of ListControlPanelsResponse\n */\n listControlPanels = (request = {}) => resourcePaginator.enrichForPagination(\"controlPanels\", this.pageOfListControlPanels, request);\n}\nclass DatabaseAPI extends api.API {\n /** Lists the available regions of the API. */\n static LOCALITIES = [\"fr-par\", \"nl-ams\", \"pl-waw\"];\n /**\n * \"Create a new database within your hosting plan\".\n *\n * @param request - The request {@link DatabaseApiCreateDatabaseRequest}\n * @returns A Promise of Database\n */\n createDatabase = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalDatabaseApiCreateDatabaseRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/webhosting/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam(\"hostingId\", request.hostingId)}/databases`\n },\n marshalling_gen.unmarshalDatabase\n );\n pageOfListDatabases = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/webhosting/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam(\"hostingId\", request.hostingId)}/databases`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListDatabasesResponse\n );\n /**\n * \"List all databases within your hosting plan\".\n *\n * @param request - The request {@link DatabaseApiListDatabasesRequest}\n * @returns A Promise of ListDatabasesResponse\n */\n listDatabases = (request) => resourcePaginator.enrichForPagination(\"databases\", this.pageOfListDatabases, request);\n /**\n * \"Get details of a database within your hosting plan\".\n *\n * @param request - The request {@link DatabaseApiGetDatabaseRequest}\n * @returns A Promise of Database\n */\n getDatabase = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/webhosting/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam(\"hostingId\", request.hostingId)}/databases/${marshalling.validatePathParam(\"databaseName\", request.databaseName)}`\n },\n marshalling_gen.unmarshalDatabase\n );\n /**\n * \"Delete a database within your hosting plan\".\n *\n * @param request - The request {@link DatabaseApiDeleteDatabaseRequest}\n * @returns A Promise of Database\n */\n deleteDatabase = (request) => this.client.fetch(\n {\n method: \"DELETE\",\n path: `/webhosting/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam(\"hostingId\", request.hostingId)}/databases/${marshalling.validatePathParam(\"databaseName\", request.databaseName)}`\n },\n marshalling_gen.unmarshalDatabase\n );\n /**\n * \"Create a new database user\".\n *\n * @param request - The request {@link DatabaseApiCreateDatabaseUserRequest}\n * @returns A Promise of DatabaseUser\n */\n createDatabaseUser = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalDatabaseApiCreateDatabaseUserRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/webhosting/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam(\"hostingId\", request.hostingId)}/databases-users`\n },\n marshalling_gen.unmarshalDatabaseUser\n );\n pageOfListDatabaseUsers = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/webhosting/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam(\"hostingId\", request.hostingId)}/database-users`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListDatabaseUsersResponse\n );\n /**\n * \"List all database users\".\n *\n * @param request - The request {@link DatabaseApiListDatabaseUsersRequest}\n * @returns A Promise of ListDatabaseUsersResponse\n */\n listDatabaseUsers = (request) => resourcePaginator.enrichForPagination(\"users\", this.pageOfListDatabaseUsers, request);\n /**\n * \"Get details of a database user\".\n *\n * @param request - The request {@link DatabaseApiGetDatabaseUserRequest}\n * @returns A Promise of DatabaseUser\n */\n getDatabaseUser = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/webhosting/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam(\"hostingId\", request.hostingId)}/databases-users/${marshalling.validatePathParam(\"username\", request.username)}`\n },\n marshalling_gen.unmarshalDatabaseUser\n );\n /**\n * \"Delete a database user\".\n *\n * @param request - The request {@link DatabaseApiDeleteDatabaseUserRequest}\n * @returns A Promise of DatabaseUser\n */\n deleteDatabaseUser = (request) => this.client.fetch(\n {\n method: \"DELETE\",\n path: `/webhosting/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam(\"hostingId\", request.hostingId)}/database-users/${marshalling.validatePathParam(\"username\", request.username)}`\n },\n marshalling_gen.unmarshalDatabaseUser\n );\n /**\n * \"Change the password of a database user\".\n *\n * @param request - The request\n * {@link DatabaseApiChangeDatabaseUserPasswordRequest}\n * @returns A Promise of DatabaseUser\n */\n changeDatabaseUserPassword = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalDatabaseApiChangeDatabaseUserPasswordRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/webhosting/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam(\"hostingId\", request.hostingId)}/databases-users/${marshalling.validatePathParam(\"username\", request.username)}/change-password`\n },\n marshalling_gen.unmarshalDatabaseUser\n );\n /**\n * \"Assign a database user to a database\".\n *\n * @param request - The request {@link DatabaseApiAssignDatabaseUserRequest}\n * @returns A Promise of DatabaseUser\n */\n assignDatabaseUser = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalDatabaseApiAssignDatabaseUserRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/webhosting/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam(\"hostingId\", request.hostingId)}/databases/${marshalling.validatePathParam(\"databaseName\", request.databaseName)}/assign-user`\n },\n marshalling_gen.unmarshalDatabaseUser\n );\n /**\n * \"Unassign a database user from a database\".\n *\n * @param request - The request {@link DatabaseApiUnassignDatabaseUserRequest}\n * @returns A Promise of DatabaseUser\n */\n unassignDatabaseUser = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalDatabaseApiUnassignDatabaseUserRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/webhosting/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam(\"hostingId\", request.hostingId)}/databases/${marshalling.validatePathParam(\"databaseName\", request.databaseName)}/unassign-user`\n },\n marshalling_gen.unmarshalDatabaseUser\n );\n}\nclass OfferAPI extends api.API {\n /** Lists the available regions of the API. */\n static LOCALITIES = [\"fr-par\", \"nl-ams\", \"pl-waw\"];\n pageOfListOffers = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/webhosting/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/offers`,\n urlParams: marshalling.urlParams(\n [\"control_panels\", request.controlPanels],\n [\"hosting_id\", request.hostingId],\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListOffersResponse\n );\n /**\n * List all available hosting offers along with their specific options.. List\n * all available hosting offers along with their specific options.\n *\n * @param request - The request {@link OfferApiListOffersRequest}\n * @returns A Promise of ListOffersResponse\n */\n listOffers = (request = {}) => resourcePaginator.enrichForPagination(\"offers\", this.pageOfListOffers, request);\n}\nclass HostingAPI extends api.API {\n /** Lists the available regions of the API. */\n static LOCALITIES = [\"fr-par\", \"nl-ams\"];\n /**\n * Order a Web Hosting plan. Order a Web Hosting plan, specifying the offer\n * type required via the `offer_id` parameter.\n *\n * @param request - The request {@link HostingApiCreateHostingRequest}\n * @returns A Promise of Hosting\n */\n createHosting = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalHostingApiCreateHostingRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/webhosting/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/hostings`\n },\n marshalling_gen.unmarshalHosting\n );\n pageOfListHostings = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/webhosting/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/hostings`,\n urlParams: marshalling.urlParams(\n [\"control_panels\", request.controlPanels],\n [\"domain\", request.domain],\n [\"order_by\", request.orderBy],\n [\n \"organization_id\",\n request.organizationId ?? this.client.settings.defaultOrganizationId\n ],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\n \"project_id\",\n request.projectId ?? this.client.settings.defaultProjectId\n ],\n [\"statuses\", request.statuses],\n [\"tags\", request.tags]\n )\n },\n marshalling_gen.unmarshalListHostingsResponse\n );\n /**\n * List all Web Hosting plans. List all of your existing Web Hosting plans.\n * Various filters are available to limit the results, including filtering by\n * domain, status, tag and Project ID.\n *\n * @param request - The request {@link HostingApiListHostingsRequest}\n * @returns A Promise of ListHostingsResponse\n */\n listHostings = (request = {}) => resourcePaginator.enrichForPagination(\"hostings\", this.pageOfListHostings, request);\n /**\n * Get a Web Hosting plan. Get the details of one of your existing Web Hosting\n * plans, specified by its `hosting_id`.\n *\n * @param request - The request {@link HostingApiGetHostingRequest}\n * @returns A Promise of Hosting\n */\n getHosting = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/webhosting/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam(\"hostingId\", request.hostingId)}`\n },\n marshalling_gen.unmarshalHosting\n );\n /**\n * Waits for {@link Hosting} to be in a final state.\n *\n * @param request - The request {@link HostingApiGetHostingRequest}\n * @param options - The waiting options\n * @returns A Promise of Hosting\n */\n waitForHosting = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(!content_gen.HOSTING_TRANSIENT_STATUSES.includes(res.status))),\n this.getHosting,\n request,\n options\n );\n /**\n * Update a Web Hosting plan. Update the details of one of your existing Web\n * Hosting plans, specified by its `hosting_id`. You can update parameters\n * including the contact email address, tags, options and offer.\n *\n * @param request - The request {@link HostingApiUpdateHostingRequest}\n * @returns A Promise of Hosting\n */\n updateHosting = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalHostingApiUpdateHostingRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/webhosting/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam(\"hostingId\", request.hostingId)}`\n },\n marshalling_gen.unmarshalHosting\n );\n /**\n * Delete a Web Hosting plan. Delete a Web Hosting plan, specified by its\n * `hosting_id`. Note that deletion is not immediate: it will take place at\n * the end of the calendar month, after which time your Web Hosting plan and\n * all its data (files and emails) will be irreversibly lost.\n *\n * @param request - The request {@link HostingApiDeleteHostingRequest}\n * @returns A Promise of Hosting\n */\n deleteHosting = (request) => this.client.fetch(\n {\n method: \"DELETE\",\n path: `/webhosting/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam(\"hostingId\", request.hostingId)}`\n },\n marshalling_gen.unmarshalHosting\n );\n /**\n * Create a user session.\n *\n * @param request - The request {@link HostingApiCreateSessionRequest}\n * @returns A Promise of Session\n */\n createSession = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/webhosting/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam(\"hostingId\", request.hostingId)}/sessions`\n },\n marshalling_gen.unmarshalSession\n );\n /**\n * Reset a Web Hosting plan password.\n *\n * @param request - The request {@link HostingApiResetHostingPasswordRequest}\n * @returns A Promise of ResetHostingPasswordResponse\n */\n resetHostingPassword = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/webhosting/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam(\"hostingId\", request.hostingId)}/reset-password`\n },\n marshalling_gen.unmarshalResetHostingPasswordResponse\n );\n}\nclass FtpAccountAPI extends api.API {\n /** Lists the available regions of the API. */\n static LOCALITIES = [\"fr-par\", \"nl-ams\", \"pl-waw\"];\n /**\n * Create a new FTP account within your hosting plan.. Create a new FTP\n * account within your hosting plan.\n *\n * @param request - The request {@link FtpAccountApiCreateFtpAccountRequest}\n * @returns A Promise of FtpAccount\n */\n createFtpAccount = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalFtpAccountApiCreateFtpAccountRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/webhosting/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam(\"hostingId\", request.hostingId)}/ftp-accounts`\n },\n marshalling_gen.unmarshalFtpAccount\n );\n pageOfListFtpAccounts = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/webhosting/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam(\"hostingId\", request.hostingId)}/ftp-accounts`,\n urlParams: marshalling.urlParams(\n [\"domain\", request.domain],\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListFtpAccountsResponse\n );\n /**\n * List all FTP accounts within your hosting plan.. List all FTP accounts\n * within your hosting plan.\n *\n * @param request - The request {@link FtpAccountApiListFtpAccountsRequest}\n * @returns A Promise of ListFtpAccountsResponse\n */\n listFtpAccounts = (request) => resourcePaginator.enrichForPagination(\"ftpAccounts\", this.pageOfListFtpAccounts, request);\n /**\n * Delete a specific FTP account within your hosting plan.. Delete a specific\n * FTP account within your hosting plan.\n *\n * @param request - The request {@link FtpAccountApiRemoveFtpAccountRequest}\n * @returns A Promise of FtpAccount\n */\n removeFtpAccount = (request) => this.client.fetch(\n {\n method: \"DELETE\",\n path: `/webhosting/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam(\"hostingId\", request.hostingId)}/ftp-accounts/${marshalling.validatePathParam(\"username\", request.username)}`\n },\n marshalling_gen.unmarshalFtpAccount\n );\n changeFtpAccountPassword = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalFtpAccountApiChangeFtpAccountPasswordRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/webhosting/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam(\"hostingId\", request.hostingId)}/ftp-accounts/${marshalling.validatePathParam(\"username\", request.username)}/change-password`\n },\n marshalling_gen.unmarshalFtpAccount\n );\n}\nclass MailAccountAPI extends api.API {\n /** Lists the available regions of the API. */\n static LOCALITIES = [\"fr-par\", \"nl-ams\", \"pl-waw\"];\n /**\n * Create a new mail account within your hosting plan.. Create a new mail\n * account within your hosting plan.\n *\n * @param request - The request {@link MailAccountApiCreateMailAccountRequest}\n * @returns A Promise of MailAccount\n */\n createMailAccount = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalMailAccountApiCreateMailAccountRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/webhosting/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam(\"hostingId\", request.hostingId)}/mail-accounts`\n },\n marshalling_gen.unmarshalMailAccount\n );\n pageOfListMailAccounts = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/webhosting/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam(\"hostingId\", request.hostingId)}/mail-accounts`,\n urlParams: marshalling.urlParams(\n [\"domain\", request.domain],\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListMailAccountsResponse\n );\n /**\n * List all mail accounts within your hosting plan.. List all mail accounts\n * within your hosting plan.\n *\n * @param request - The request {@link MailAccountApiListMailAccountsRequest}\n * @returns A Promise of ListMailAccountsResponse\n */\n listMailAccounts = (request) => resourcePaginator.enrichForPagination(\"mailAccounts\", this.pageOfListMailAccounts, request);\n /**\n * Delete a mail account within your hosting plan.. Delete a mail account\n * within your hosting plan.\n *\n * @param request - The request {@link MailAccountApiRemoveMailAccountRequest}\n * @returns A Promise of MailAccount\n */\n removeMailAccount = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalMailAccountApiRemoveMailAccountRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/webhosting/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam(\"hostingId\", request.hostingId)}/remove-mail-account`\n },\n marshalling_gen.unmarshalMailAccount\n );\n /**\n * Update the password of a mail account within your hosting plan.. Update the\n * password of a mail account within your hosting plan.\n *\n * @param request - The request\n * {@link MailAccountApiChangeMailAccountPasswordRequest}\n * @returns A Promise of MailAccount\n */\n changeMailAccountPassword = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalMailAccountApiChangeMailAccountPasswordRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/webhosting/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam(\"hostingId\", request.hostingId)}/change-mail-password`\n },\n marshalling_gen.unmarshalMailAccount\n );\n}\nclass WebsiteAPI extends api.API {\n /** Lists the available regions of the API. */\n static LOCALITIES = [\"fr-par\", \"nl-ams\", \"pl-waw\"];\n pageOfListWebsites = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/webhosting/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam(\"hostingId\", request.hostingId)}/websites`,\n urlParams: marshalling.urlParams(\n [\"order_by\", request.orderBy],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListWebsitesResponse\n );\n /**\n * List all websites for a specific hosting.. List all websites for a specific\n * hosting.\n *\n * @param request - The request {@link WebsiteApiListWebsitesRequest}\n * @returns A Promise of ListWebsitesResponse\n */\n listWebsites = (request) => resourcePaginator.enrichForPagination(\"websites\", this.pageOfListWebsites, request);\n}\nexports.ControlPanelAPI = ControlPanelAPI;\nexports.DatabaseAPI = DatabaseAPI;\nexports.FtpAccountAPI = FtpAccountAPI;\nexports.HostingAPI = HostingAPI;\nexports.MailAccountAPI = MailAccountAPI;\nexports.OfferAPI = OfferAPI;\nexports.WebsiteAPI = WebsiteAPI;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst HOSTING_TRANSIENT_STATUSES = [\n \"delivering\",\n \"deleting\",\n \"migrating\"\n];\nconst HOSTING_SUMMARY_TRANSIENT_STATUSES = [\n \"delivering\",\n \"deleting\",\n \"migrating\"\n];\nexports.HOSTING_SUMMARY_TRANSIENT_STATUSES = HOSTING_SUMMARY_TRANSIENT_STATUSES;\nexports.HOSTING_TRANSIENT_STATUSES = HOSTING_TRANSIENT_STATUSES;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api_gen = require(\"./api.gen.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nconst validationRules_gen = require(\"./validation-rules.gen.cjs\");\nexports.ControlPanelAPI = api_gen.ControlPanelAPI;\nexports.DatabaseAPI = api_gen.DatabaseAPI;\nexports.FtpAccountAPI = api_gen.FtpAccountAPI;\nexports.HostingAPI = api_gen.HostingAPI;\nexports.MailAccountAPI = api_gen.MailAccountAPI;\nexports.OfferAPI = api_gen.OfferAPI;\nexports.WebsiteAPI = api_gen.WebsiteAPI;\nexports.HOSTING_SUMMARY_TRANSIENT_STATUSES = content_gen.HOSTING_SUMMARY_TRANSIENT_STATUSES;\nexports.HOSTING_TRANSIENT_STATUSES = content_gen.HOSTING_TRANSIENT_STATUSES;\nexports.ValidationRules = validationRules_gen;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst json = require(\"../../../helpers/json.cjs\");\nconst customMarshalling = require(\"../../../scw/custom-marshalling.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nconst unmarshalDatabaseUser = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DatabaseUser' failed as data isn't a dictionary.`\n );\n }\n return {\n databases: data.databases,\n username: data.username\n };\n};\nconst unmarshalDatabase = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Database' failed as data isn't a dictionary.`\n );\n }\n return {\n databaseName: data.database_name,\n users: data.users\n };\n};\nconst unmarshalFtpAccount = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'FtpAccount' failed as data isn't a dictionary.`\n );\n }\n return {\n path: data.path,\n username: data.username\n };\n};\nconst unmarshalMailAccount = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'MailAccount' failed as data isn't a dictionary.`\n );\n }\n return {\n domain: data.domain,\n username: data.username\n };\n};\nconst unmarshalHostingCpanelUrls = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'HostingCpanelUrls' failed as data isn't a dictionary.`\n );\n }\n return {\n dashboard: data.dashboard,\n webmail: data.webmail\n };\n};\nconst unmarshalHostingOption = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'HostingOption' failed as data isn't a dictionary.`\n );\n }\n return {\n id: data.id,\n name: data.name,\n quantity: data.quantity\n };\n};\nconst unmarshalHosting = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Hosting' failed as data isn't a dictionary.`\n );\n }\n return {\n contactEmail: data.contact_email,\n controlPanelName: data.control_panel_name,\n cpanelUrls: data.cpanel_urls ? unmarshalHostingCpanelUrls(data.cpanel_urls) : void 0,\n createdAt: marshalling.unmarshalDate(data.created_at),\n dnsStatus: data.dns_status,\n domain: data.domain,\n id: data.id,\n ipv4: data.ipv4,\n ipv6: data.ipv6,\n offerEndOfLife: data.offer_end_of_life,\n offerId: data.offer_id,\n offerName: data.offer_name,\n oneTimePassword: data.one_time_password,\n options: marshalling.unmarshalArrayOfObject(data.options, unmarshalHostingOption),\n platformGroup: data.platform_group,\n platformHostname: data.platform_hostname,\n platformNumber: data.platform_number,\n projectId: data.project_id,\n protected: data.protected,\n region: data.region,\n status: data.status,\n tags: data.tags,\n updatedAt: marshalling.unmarshalDate(data.updated_at),\n username: data.username\n };\n};\nconst unmarshalControlPanel = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ControlPanel' failed as data isn't a dictionary.`\n );\n }\n return {\n available: data.available,\n availableLanguages: data.available_languages,\n logoUrl: data.logo_url,\n name: data.name\n };\n};\nconst unmarshalListControlPanelsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListControlPanelsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n controlPanels: marshalling.unmarshalArrayOfObject(\n data.control_panels,\n unmarshalControlPanel\n ),\n totalCount: data.total_count\n };\n};\nconst unmarshalListDatabaseUsersResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListDatabaseUsersResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n totalCount: data.total_count,\n users: marshalling.unmarshalArrayOfObject(data.users, unmarshalDatabaseUser)\n };\n};\nconst unmarshalListDatabasesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListDatabasesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n databases: marshalling.unmarshalArrayOfObject(data.databases, unmarshalDatabase),\n totalCount: data.total_count\n };\n};\nconst unmarshalListFtpAccountsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListFtpAccountsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n ftpAccounts: marshalling.unmarshalArrayOfObject(data.ftp_accounts, unmarshalFtpAccount),\n totalCount: data.total_count\n };\n};\nconst unmarshalHostingSummary = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'HostingSummary' failed as data isn't a dictionary.`\n );\n }\n return {\n domain: data.domain,\n id: data.id,\n projectId: data.project_id,\n protected: data.protected,\n region: data.region,\n status: data.status,\n updatedAt: marshalling.unmarshalDate(data.updated_at)\n };\n};\nconst unmarshalListHostingsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListHostingsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n hostings: marshalling.unmarshalArrayOfObject(data.hostings, unmarshalHostingSummary),\n totalCount: data.total_count\n };\n};\nconst unmarshalListMailAccountsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListMailAccountsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n mailAccounts: marshalling.unmarshalArrayOfObject(\n data.mail_accounts,\n unmarshalMailAccount\n ),\n totalCount: data.total_count\n };\n};\nconst unmarshalOfferOption = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'OfferOption' failed as data isn't a dictionary.`\n );\n }\n return {\n billingOperationPath: data.billing_operation_path,\n currentValue: data.current_value,\n id: data.id,\n maxValue: data.max_value,\n minValue: data.min_value,\n name: data.name,\n quotaWarning: data.quota_warning\n };\n};\nconst unmarshalOffer = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Offer' failed as data isn't a dictionary.`\n );\n }\n return {\n available: data.available,\n billingOperationPath: data.billing_operation_path,\n controlPanelName: data.control_panel_name,\n endOfLife: data.end_of_life,\n id: data.id,\n options: marshalling.unmarshalArrayOfObject(data.options, unmarshalOfferOption),\n price: data.price ? customMarshalling.unmarshalMoney(data.price) : void 0\n };\n};\nconst unmarshalListOffersResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListOffersResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n offers: marshalling.unmarshalArrayOfObject(data.offers, unmarshalOffer),\n totalCount: data.total_count\n };\n};\nconst unmarshalWebsite = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Website' failed as data isn't a dictionary.`\n );\n }\n return {\n domain: data.domain,\n path: data.path,\n sslStatus: data.ssl_status\n };\n};\nconst unmarshalListWebsitesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListWebsitesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n totalCount: data.total_count,\n websites: marshalling.unmarshalArrayOfObject(data.websites, unmarshalWebsite)\n };\n};\nconst unmarshalResetHostingPasswordResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ResetHostingPasswordResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n oneTimePassword: data.one_time_password\n };\n};\nconst unmarshalSession = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Session' failed as data isn't a dictionary.`\n );\n }\n return {\n url: data.url\n };\n};\nconst marshalDatabaseApiAssignDatabaseUserRequest = (request, defaults) => ({\n username: request.username\n});\nconst marshalDatabaseApiChangeDatabaseUserPasswordRequest = (request, defaults) => ({\n password: request.password\n});\nconst marshalDatabaseApiCreateDatabaseRequest = (request, defaults) => ({\n database_name: request.databaseName\n});\nconst marshalDatabaseApiCreateDatabaseUserRequest = (request, defaults) => ({\n password: request.password,\n username: request.username\n});\nconst marshalDatabaseApiUnassignDatabaseUserRequest = (request, defaults) => ({\n username: request.username\n});\nconst marshalFtpAccountApiChangeFtpAccountPasswordRequest = (request, defaults) => ({\n password: request.password\n});\nconst marshalFtpAccountApiCreateFtpAccountRequest = (request, defaults) => ({\n password: request.password,\n path: request.path,\n username: request.username\n});\nconst marshalCreateHostingRequestDomainConfiguration = (request, defaults) => ({\n update_all_records: request.updateAllRecords,\n update_mail_record: request.updateMailRecord,\n update_nameservers: request.updateNameservers,\n update_web_record: request.updateWebRecord\n});\nconst marshalOfferOptionRequest = (request, defaults) => ({\n id: request.id,\n quantity: request.quantity\n});\nconst marshalHostingApiCreateHostingRequest = (request, defaults) => ({\n domain: request.domain,\n domain_configuration: request.domainConfiguration !== void 0 ? marshalCreateHostingRequestDomainConfiguration(\n request.domainConfiguration\n ) : void 0,\n email: request.email,\n language: request.language,\n offer_id: request.offerId,\n offer_options: request.offerOptions !== void 0 ? request.offerOptions.map(\n (elt) => marshalOfferOptionRequest(elt)\n ) : void 0,\n project_id: request.projectId ?? defaults.defaultProjectId,\n skip_welcome_email: request.skipWelcomeEmail,\n tags: request.tags\n});\nconst marshalHostingApiUpdateHostingRequest = (request, defaults) => ({\n email: request.email,\n offer_id: request.offerId,\n offer_options: request.offerOptions !== void 0 ? request.offerOptions.map(\n (elt) => marshalOfferOptionRequest(elt)\n ) : void 0,\n protected: request.protected,\n tags: request.tags\n});\nconst marshalMailAccountApiChangeMailAccountPasswordRequest = (request, defaults) => ({\n domain: request.domain,\n password: request.password,\n username: request.username\n});\nconst marshalMailAccountApiCreateMailAccountRequest = (request, defaults) => ({\n domain: request.domain,\n password: request.password,\n username: request.username\n});\nconst marshalMailAccountApiRemoveMailAccountRequest = (request, defaults) => ({\n domain: request.domain,\n username: request.username\n});\nexports.marshalDatabaseApiAssignDatabaseUserRequest = marshalDatabaseApiAssignDatabaseUserRequest;\nexports.marshalDatabaseApiChangeDatabaseUserPasswordRequest = marshalDatabaseApiChangeDatabaseUserPasswordRequest;\nexports.marshalDatabaseApiCreateDatabaseRequest = marshalDatabaseApiCreateDatabaseRequest;\nexports.marshalDatabaseApiCreateDatabaseUserRequest = marshalDatabaseApiCreateDatabaseUserRequest;\nexports.marshalDatabaseApiUnassignDatabaseUserRequest = marshalDatabaseApiUnassignDatabaseUserRequest;\nexports.marshalFtpAccountApiChangeFtpAccountPasswordRequest = marshalFtpAccountApiChangeFtpAccountPasswordRequest;\nexports.marshalFtpAccountApiCreateFtpAccountRequest = marshalFtpAccountApiCreateFtpAccountRequest;\nexports.marshalHostingApiCreateHostingRequest = marshalHostingApiCreateHostingRequest;\nexports.marshalHostingApiUpdateHostingRequest = marshalHostingApiUpdateHostingRequest;\nexports.marshalMailAccountApiChangeMailAccountPasswordRequest = marshalMailAccountApiChangeMailAccountPasswordRequest;\nexports.marshalMailAccountApiCreateMailAccountRequest = marshalMailAccountApiCreateMailAccountRequest;\nexports.marshalMailAccountApiRemoveMailAccountRequest = marshalMailAccountApiRemoveMailAccountRequest;\nexports.unmarshalDatabase = unmarshalDatabase;\nexports.unmarshalDatabaseUser = unmarshalDatabaseUser;\nexports.unmarshalFtpAccount = unmarshalFtpAccount;\nexports.unmarshalHosting = unmarshalHosting;\nexports.unmarshalListControlPanelsResponse = unmarshalListControlPanelsResponse;\nexports.unmarshalListDatabaseUsersResponse = unmarshalListDatabaseUsersResponse;\nexports.unmarshalListDatabasesResponse = unmarshalListDatabasesResponse;\nexports.unmarshalListFtpAccountsResponse = unmarshalListFtpAccountsResponse;\nexports.unmarshalListHostingsResponse = unmarshalListHostingsResponse;\nexports.unmarshalListMailAccountsResponse = unmarshalListMailAccountsResponse;\nexports.unmarshalListOffersResponse = unmarshalListOffersResponse;\nexports.unmarshalListWebsitesResponse = unmarshalListWebsitesResponse;\nexports.unmarshalMailAccount = unmarshalMailAccount;\nexports.unmarshalResetHostingPasswordResponse = unmarshalResetHostingPasswordResponse;\nexports.unmarshalSession = unmarshalSession;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst ControlPanelApiListControlPanelsRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nconst DatabaseApiListDatabaseUsersRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nconst DatabaseApiListDatabasesRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nconst FtpAccountApiListFtpAccountsRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nconst HostingApiListHostingsRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nconst MailAccountApiListMailAccountsRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nconst OfferApiListOffersRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nconst WebsiteApiListWebsitesRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nexports.ControlPanelApiListControlPanelsRequest = ControlPanelApiListControlPanelsRequest;\nexports.DatabaseApiListDatabaseUsersRequest = DatabaseApiListDatabaseUsersRequest;\nexports.DatabaseApiListDatabasesRequest = DatabaseApiListDatabasesRequest;\nexports.FtpAccountApiListFtpAccountsRequest = FtpAccountApiListFtpAccountsRequest;\nexports.HostingApiListHostingsRequest = HostingApiListHostingsRequest;\nexports.MailAccountApiListMailAccountsRequest = MailAccountApiListMailAccountsRequest;\nexports.OfferApiListOffersRequest = OfferApiListOffersRequest;\nexports.WebsiteApiListWebsitesRequest = WebsiteApiListWebsitesRequest;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst intervalRetrier = require(\"../../../internal/async/interval-retrier.cjs\");\nconst api = require(\"../../../scw/api.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nrequire(\"../../../vendor/base64/index.cjs\");\nconst resourcePaginator = require(\"../../../scw/fetch/resource-paginator.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nconst marshalling_gen = require(\"./marshalling.gen.cjs\");\nconst jsonContentHeaders = {\n \"Content-Type\": \"application/json; charset=utf-8\"\n};\nclass API extends api.API {\n /** Lists the available regions of the API. */\n static LOCALITIES = [\"fr-par\", \"nl-ams\"];\n /**\n * Order a Web Hosting plan. Order a Web Hosting plan, specifying the offer\n * type required via the `offer_id` parameter.\n *\n * @param request - The request {@link CreateHostingRequest}\n * @returns A Promise of Hosting\n */\n createHosting = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCreateHostingRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/webhosting/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/hostings`\n },\n marshalling_gen.unmarshalHosting\n );\n pageOfListHostings = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/webhosting/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/hostings`,\n urlParams: marshalling.urlParams(\n [\"control_panels\", request.controlPanels],\n [\"domain\", request.domain],\n [\"order_by\", request.orderBy],\n [\"organization_id\", request.organizationId],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ],\n [\"project_id\", request.projectId],\n [\"statuses\", request.statuses],\n [\"tags\", request.tags]\n )\n },\n marshalling_gen.unmarshalListHostingsResponse\n );\n /**\n * List all Web Hosting plans. List all of your existing Web Hosting plans.\n * Various filters are available to limit the results, including filtering by\n * domain, status, tag and Project ID.\n *\n * @param request - The request {@link ListHostingsRequest}\n * @returns A Promise of ListHostingsResponse\n */\n listHostings = (request = {}) => resourcePaginator.enrichForPagination(\"hostings\", this.pageOfListHostings, request);\n /**\n * Get a Web Hosting plan. Get the details of one of your existing Web Hosting\n * plans, specified by its `hosting_id`.\n *\n * @param request - The request {@link GetHostingRequest}\n * @returns A Promise of Hosting\n */\n getHosting = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/webhosting/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam(\"hostingId\", request.hostingId)}`\n },\n marshalling_gen.unmarshalHosting\n );\n /**\n * Waits for {@link Hosting} to be in a final state.\n *\n * @param request - The request {@link GetHostingRequest}\n * @param options - The waiting options\n * @returns A Promise of Hosting\n */\n waitForHosting = (request, options) => intervalRetrier.waitForResource(\n options?.stop ?? ((res) => Promise.resolve(!content_gen.HOSTING_TRANSIENT_STATUSES.includes(res.status))),\n this.getHosting,\n request,\n options\n );\n /**\n * Update a Web Hosting plan. Update the details of one of your existing Web\n * Hosting plans, specified by its `hosting_id`. You can update parameters\n * including the contact email address, tags, options and offer.\n *\n * @param request - The request {@link UpdateHostingRequest}\n * @returns A Promise of Hosting\n */\n updateHosting = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalUpdateHostingRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/webhosting/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam(\"hostingId\", request.hostingId)}`\n },\n marshalling_gen.unmarshalHosting\n );\n /**\n * Delete a Web Hosting plan. Delete a Web Hosting plan, specified by its\n * `hosting_id`. Note that deletion is not immediate: it will take place at\n * the end of the calendar month, after which time your Web Hosting plan and\n * all its data (files and emails) will be irreversibly lost.\n *\n * @param request - The request {@link DeleteHostingRequest}\n * @returns A Promise of Hosting\n */\n deleteHosting = (request) => this.client.fetch(\n {\n method: \"DELETE\",\n path: `/webhosting/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam(\"hostingId\", request.hostingId)}`\n },\n marshalling_gen.unmarshalHosting\n );\n /**\n * Restore a Web Hosting plan. When you [delete a Web Hosting\n * plan](#path-hostings-delete-a-hosting), definitive deletion does not take\n * place until the end of the calendar month. In the time between initiating\n * the deletion, and definitive deletion at the end of the month, you can\n * choose to **restore** the Web Hosting plan, using this endpoint and\n * specifying its `hosting_id`.\n *\n * @param request - The request {@link RestoreHostingRequest}\n * @returns A Promise of Hosting\n */\n restoreHosting = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/webhosting/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam(\"hostingId\", request.hostingId)}/restore`\n },\n marshalling_gen.unmarshalHosting\n );\n /**\n * Get DNS records. Get the set of DNS records of a specified domain\n * associated with a Web Hosting plan.\n *\n * @param request - The request {@link GetDomainDnsRecordsRequest}\n * @returns A Promise of DnsRecords\n */\n getDomainDnsRecords = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/webhosting/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/domains/${marshalling.validatePathParam(\"domain\", request.domain)}/dns-records`\n },\n marshalling_gen.unmarshalDnsRecords\n );\n /**\n * \"Check whether you own this domain or not.\".\n *\n * @param request - The request {@link CheckUserOwnsDomainRequest}\n * @returns A Promise of CheckUserOwnsDomainResponse\n */\n checkUserOwnsDomain = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalCheckUserOwnsDomainRequest(request, this.client.settings)\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/webhosting/v1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/domains/${marshalling.validatePathParam(\"domain\", request.domain)}/check-ownership`\n },\n marshalling_gen.unmarshalCheckUserOwnsDomainResponse\n );\n /**\n * List all offers. List the different Web Hosting offers, and their options,\n * available to order from Scaleway.\n *\n * @param request - The request {@link ListOffersRequest}\n * @returns A Promise of ListOffersResponse\n */\n listOffers = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/webhosting/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/offers`,\n urlParams: marshalling.urlParams(\n [\"control_panels\", request.controlPanels],\n [\"hosting_id\", request.hostingId],\n [\"only_options\", request.onlyOptions],\n [\"order_by\", request.orderBy],\n [\"without_options\", request.withoutOptions]\n )\n },\n marshalling_gen.unmarshalListOffersResponse\n );\n pageOfListControlPanels = (request = {}) => this.client.fetch(\n {\n method: \"GET\",\n path: `/webhosting/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/control-panels`,\n urlParams: marshalling.urlParams(\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListControlPanelsResponse\n );\n /**\n * \"List the control panels type: cpanel or plesk.\".\n *\n * @param request - The request {@link ListControlPanelsRequest}\n * @returns A Promise of ListControlPanelsResponse\n */\n listControlPanels = (request = {}) => resourcePaginator.enrichForPagination(\"controlPanels\", this.pageOfListControlPanels, request);\n /**\n * Create a user session.\n *\n * @param request - The request {@link CreateSessionRequest}\n * @returns A Promise of Session\n */\n createSession = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/webhosting/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam(\"hostingId\", request.hostingId)}/sessions`\n },\n marshalling_gen.unmarshalSession\n );\n resetHostingPassword = (request) => this.client.fetch(\n {\n body: \"{}\",\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/webhosting/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/hostings/${marshalling.validatePathParam(\"hostingId\", request.hostingId)}/reset-password`\n },\n marshalling_gen.unmarshalResetHostingPasswordResponse\n );\n}\nclass ClassicMailAPI extends api.API {\n /** Lists the available regions of the API. */\n static LOCALITIES = [\"fr-par\", \"nl-ams\", \"pl-waw\"];\n /**\n * Create a new mailbox within your hosting plan.. Create a new mailbox within\n * your hosting plan.\n *\n * @param request - The request {@link ClassicMailApiCreateMailboxRequest}\n * @returns A Promise of Mailbox\n */\n createMailbox = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalClassicMailApiCreateMailboxRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"POST\",\n path: `/webhosting/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/classic-hostings/${marshalling.validatePathParam(\"onlineId\", request.onlineId)}/mailboxes`\n },\n marshalling_gen.unmarshalMailbox\n );\n /**\n * Get a mailbox by id within your hosting plan.. Get a mailbox by id within\n * your hosting plan.\n *\n * @param request - The request {@link ClassicMailApiGetMailboxRequest}\n * @returns A Promise of Mailbox\n */\n getMailbox = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/webhosting/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/classic-hostings/${marshalling.validatePathParam(\"onlineId\", request.onlineId)}/mailboxes/${marshalling.validatePathParam(\"mailboxId\", request.mailboxId)}`\n },\n marshalling_gen.unmarshalMailbox\n );\n pageOfListMailboxes = (request) => this.client.fetch(\n {\n method: \"GET\",\n path: `/webhosting/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/classic-hostings/${marshalling.validatePathParam(\"onlineId\", request.onlineId)}/mailboxes`,\n urlParams: marshalling.urlParams(\n [\"domain\", request.domain],\n [\"page\", request.page],\n [\n \"page_size\",\n request.pageSize ?? this.client.settings.defaultPageSize\n ]\n )\n },\n marshalling_gen.unmarshalListMailboxesResponse\n );\n /**\n * List all mailboxes within your hosting plan.. List all mailboxes within\n * your hosting plan.\n *\n * @param request - The request {@link ClassicMailApiListMailboxesRequest}\n * @returns A Promise of ListMailboxesResponse\n */\n listMailboxes = (request) => resourcePaginator.enrichForPagination(\"mailboxes\", this.pageOfListMailboxes, request);\n deleteMailbox = (request) => this.client.fetch(\n {\n method: \"DELETE\",\n path: `/webhosting/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/classic-hostings/${marshalling.validatePathParam(\"onlineId\", request.onlineId)}/mailboxes/${marshalling.validatePathParam(\"mailboxId\", request.mailboxId)}`\n },\n marshalling_gen.unmarshalMailbox\n );\n /**\n * Update the mailbox within your hosting plan.. Update the mailbox within\n * your hosting plan.\n *\n * @param request - The request {@link ClassicMailApiUpdateMailboxRequest}\n * @returns A Promise of Mailbox\n */\n updateMailbox = (request) => this.client.fetch(\n {\n body: JSON.stringify(\n marshalling_gen.marshalClassicMailApiUpdateMailboxRequest(\n request,\n this.client.settings\n )\n ),\n headers: jsonContentHeaders,\n method: \"PATCH\",\n path: `/webhosting/v1alpha1/regions/${marshalling.validatePathParam(\"region\", request.region ?? this.client.settings.defaultRegion)}/classic-hostings/${marshalling.validatePathParam(\"onlineId\", request.onlineId)}/mailboxes/${marshalling.validatePathParam(\"mailboxId\", request.mailboxId)}`\n },\n marshalling_gen.unmarshalMailbox\n );\n}\nexports.API = API;\nexports.ClassicMailAPI = ClassicMailAPI;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst HOSTING_TRANSIENT_STATUSES = [\n \"delivering\",\n \"deleting\",\n \"migrating\"\n];\nexports.HOSTING_TRANSIENT_STATUSES = HOSTING_TRANSIENT_STATUSES;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst api_gen = require(\"./api.gen.cjs\");\nconst content_gen = require(\"./content.gen.cjs\");\nconst validationRules_gen = require(\"./validation-rules.gen.cjs\");\nexports.API = api_gen.API;\nexports.ClassicMailAPI = api_gen.ClassicMailAPI;\nexports.HOSTING_TRANSIENT_STATUSES = content_gen.HOSTING_TRANSIENT_STATUSES;\nexports.ValidationRules = validationRules_gen;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst json = require(\"../../../helpers/json.cjs\");\nconst customMarshalling = require(\"../../../scw/custom-marshalling.cjs\");\nconst marshalling = require(\"../../../helpers/marshalling.cjs\");\nconst unmarshalHostingCpanelUrls = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'HostingCpanelUrls' failed as data isn't a dictionary.`\n );\n }\n return {\n dashboard: data.dashboard,\n webmail: data.webmail\n };\n};\nconst unmarshalHostingOption = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'HostingOption' failed as data isn't a dictionary.`\n );\n }\n return {\n id: data.id,\n name: data.name\n };\n};\nconst unmarshalHosting = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Hosting' failed as data isn't a dictionary.`\n );\n }\n return {\n controlPanelName: data.control_panel_name,\n cpanelUrls: data.cpanel_urls ? unmarshalHostingCpanelUrls(data.cpanel_urls) : void 0,\n createdAt: marshalling.unmarshalDate(data.created_at),\n dnsStatus: data.dns_status,\n domain: data.domain,\n id: data.id,\n ipv4: data.ipv4,\n ipv6: data.ipv6,\n offerEndOfLife: data.offer_end_of_life,\n offerId: data.offer_id,\n offerName: data.offer_name,\n oneTimePassword: data.one_time_password,\n options: marshalling.unmarshalArrayOfObject(data.options, unmarshalHostingOption),\n organizationId: data.organization_id,\n platformGroup: data.platform_group,\n platformHostname: data.platform_hostname,\n platformNumber: data.platform_number,\n projectId: data.project_id,\n protected: data.protected,\n region: data.region,\n status: data.status,\n tags: data.tags,\n updatedAt: marshalling.unmarshalDate(data.updated_at),\n username: data.username\n };\n};\nconst unmarshalEmailAddress = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'EmailAddress' failed as data isn't a dictionary.`\n );\n }\n return {\n domain: data.domain,\n login: data.login\n };\n};\nconst unmarshalMailbox = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Mailbox' failed as data isn't a dictionary.`\n );\n }\n return {\n email: data.email ? unmarshalEmailAddress(data.email) : void 0,\n mailboxId: data.mailbox_id\n };\n};\nconst unmarshalCheckUserOwnsDomainResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'CheckUserOwnsDomainResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n ownsDomain: data.owns_domain\n };\n};\nconst unmarshalDnsRecord = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DnsRecord' failed as data isn't a dictionary.`\n );\n }\n return {\n name: data.name,\n priority: data.priority,\n status: data.status,\n ttl: data.ttl,\n type: data.type,\n value: data.value\n };\n};\nconst unmarshalNameserver = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Nameserver' failed as data isn't a dictionary.`\n );\n }\n return {\n hostname: data.hostname,\n isDefault: data.is_default,\n status: data.status\n };\n};\nconst unmarshalDnsRecords = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'DnsRecords' failed as data isn't a dictionary.`\n );\n }\n return {\n nameServers: marshalling.unmarshalArrayOfObject(data.name_servers, unmarshalNameserver),\n records: marshalling.unmarshalArrayOfObject(data.records, unmarshalDnsRecord),\n status: data.status\n };\n};\nconst unmarshalControlPanel = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ControlPanel' failed as data isn't a dictionary.`\n );\n }\n return {\n available: data.available,\n availableLanguages: data.available_languages,\n logoUrl: data.logo_url,\n name: data.name\n };\n};\nconst unmarshalListControlPanelsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListControlPanelsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n controlPanels: marshalling.unmarshalArrayOfObject(\n data.control_panels,\n unmarshalControlPanel\n ),\n totalCount: data.total_count\n };\n};\nconst unmarshalListHostingsResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListHostingsResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n hostings: marshalling.unmarshalArrayOfObject(data.hostings, unmarshalHosting),\n totalCount: data.total_count\n };\n};\nconst unmarshalListMailboxesResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListMailboxesResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n mailboxes: marshalling.unmarshalArrayOfObject(data.mailboxes, unmarshalMailbox),\n totalCount: data.total_count\n };\n};\nconst unmarshalOfferProduct = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'OfferProduct' failed as data isn't a dictionary.`\n );\n }\n return {\n databasesQuota: data.databases_quota,\n emailAccountsQuota: data.email_accounts_quota,\n emailStorageQuota: data.email_storage_quota,\n hostingStorageQuota: data.hosting_storage_quota,\n maxAddonDomains: data.max_addon_domains,\n name: data.name,\n option: data.option,\n ram: data.ram,\n supportIncluded: data.support_included,\n vCpu: data.v_cpu\n };\n};\nconst unmarshalOffer = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Offer' failed as data isn't a dictionary.`\n );\n }\n return {\n available: data.available,\n billingOperationPath: data.billing_operation_path,\n controlPanelName: data.control_panel_name,\n endOfLife: data.end_of_life,\n id: data.id,\n price: data.price ? customMarshalling.unmarshalMoney(data.price) : void 0,\n product: data.product ? unmarshalOfferProduct(data.product) : void 0,\n quotaWarnings: data.quota_warnings\n };\n};\nconst unmarshalListOffersResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ListOffersResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n offers: marshalling.unmarshalArrayOfObject(data.offers, unmarshalOffer)\n };\n};\nconst unmarshalResetHostingPasswordResponse = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ResetHostingPasswordResponse' failed as data isn't a dictionary.`\n );\n }\n return {\n password: data.password\n };\n};\nconst unmarshalSession = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Session' failed as data isn't a dictionary.`\n );\n }\n return {\n url: data.url\n };\n};\nconst marshalCheckUserOwnsDomainRequest = (request, defaults) => ({\n project_id: request.projectId ?? defaults.defaultProjectId\n});\nconst marshalEmailAddress = (request, defaults) => ({\n domain: request.domain,\n login: request.login\n});\nconst marshalClassicMailApiCreateMailboxRequest = (request, defaults) => ({\n email: request.email !== void 0 ? marshalEmailAddress(request.email) : void 0,\n password: request.password\n});\nconst marshalClassicMailApiUpdateMailboxRequest = (request, defaults) => ({\n password: request.password\n});\nconst marshalCreateHostingRequestDomainConfiguration = (request, defaults) => ({\n update_all_records: request.updateAllRecords,\n update_mail_record: request.updateMailRecord,\n update_nameservers: request.updateNameservers,\n update_web_record: request.updateWebRecord\n});\nconst marshalCreateHostingRequest = (request, defaults) => ({\n domain: request.domain,\n domain_configuration: request.domainConfiguration !== void 0 ? marshalCreateHostingRequestDomainConfiguration(\n request.domainConfiguration\n ) : void 0,\n email: request.email,\n language: request.language,\n offer_id: request.offerId,\n option_ids: request.optionIds,\n project_id: request.projectId ?? defaults.defaultProjectId,\n tags: request.tags\n});\nconst marshalUpdateHostingRequest = (request, defaults) => ({\n email: request.email,\n offer_id: request.offerId,\n option_ids: request.optionIds,\n protected: request.protected,\n tags: request.tags\n});\nexports.marshalCheckUserOwnsDomainRequest = marshalCheckUserOwnsDomainRequest;\nexports.marshalClassicMailApiCreateMailboxRequest = marshalClassicMailApiCreateMailboxRequest;\nexports.marshalClassicMailApiUpdateMailboxRequest = marshalClassicMailApiUpdateMailboxRequest;\nexports.marshalCreateHostingRequest = marshalCreateHostingRequest;\nexports.marshalUpdateHostingRequest = marshalUpdateHostingRequest;\nexports.unmarshalCheckUserOwnsDomainResponse = unmarshalCheckUserOwnsDomainResponse;\nexports.unmarshalDnsRecords = unmarshalDnsRecords;\nexports.unmarshalHosting = unmarshalHosting;\nexports.unmarshalListControlPanelsResponse = unmarshalListControlPanelsResponse;\nexports.unmarshalListHostingsResponse = unmarshalListHostingsResponse;\nexports.unmarshalListMailboxesResponse = unmarshalListMailboxesResponse;\nexports.unmarshalListOffersResponse = unmarshalListOffersResponse;\nexports.unmarshalMailbox = unmarshalMailbox;\nexports.unmarshalResetHostingPasswordResponse = unmarshalResetHostingPasswordResponse;\nexports.unmarshalSession = unmarshalSession;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst ClassicMailApiListMailboxesRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nconst ListControlPanelsRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nconst ListHostingsRequest = {\n page: {\n greaterThan: 0\n },\n pageSize: {\n greaterThan: 0,\n lessThanOrEqual: 100\n }\n};\nexports.ClassicMailApiListMailboxesRequest = ClassicMailApiListMailboxesRequest;\nexports.ListControlPanelsRequest = ListControlPanelsRequest;\nexports.ListHostingsRequest = ListHostingsRequest;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst isBrowser = () => (\n // eslint-disable-next-line @typescript-eslint/prefer-optional-chain\n typeof window !== \"undefined\" && typeof window.document !== \"undefined\"\n);\nexports.isBrowser = isBrowser;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst isResponse = (obj) => obj !== null && obj !== void 0 && typeof obj === \"object\" && \"status\" in obj && typeof obj.status === \"number\" && \"statusText\" in obj && typeof obj.statusText === \"string\" && \"headers\" in obj && typeof obj.headers === \"object\" && \"body\" in obj && typeof obj.body !== \"undefined\";\nexports.isResponse = isResponse;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst isJSONObject = (obj) => {\n const objT = typeof obj;\n return obj !== void 0 && obj !== null && objT !== \"string\" && objT !== \"number\" && objT !== \"boolean\" && !Array.isArray(obj) && objT === \"object\";\n};\nexports.isJSONObject = isJSONObject;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nfunction validatePathParam(name, param) {\n if (typeof param === \"string\" && param.length > 0) return param;\n if (typeof param === \"number\") return param.toString();\n throw new TypeError(`param ${name} cannot be empty in request`);\n}\nconst resolveOneOf = (list, isRequired = false) => {\n const elt = list.find((obj) => obj.value !== void 0) ?? list.find((obj) => obj.default !== void 0);\n const value = elt?.value ?? elt?.default;\n if (elt && value !== void 0) {\n return { [elt.param]: value };\n }\n if (isRequired) {\n const keyList = list.map((obj) => obj.param).join(\" or \");\n throw new TypeError(`one of ${keyList} must be indicated in the request`);\n }\n return {};\n};\nconst urlParams = (...paramTuples) => {\n const params = new URLSearchParams();\n for (const [key, value] of paramTuples) {\n if (typeof key === \"string\" && value != null) {\n if (Array.isArray(value)) {\n for (const innerValue of value) {\n if (innerValue !== null) {\n params.append(\n key,\n innerValue instanceof Date ? innerValue.toISOString() : innerValue.toString()\n );\n }\n }\n } else {\n params.append(\n key,\n value instanceof Date ? value.toISOString() : value.toString()\n );\n }\n }\n }\n return params;\n};\nconst unmarshalDate = (data) => {\n if (typeof data !== \"string\") {\n return void 0;\n }\n const date = new Date(data);\n if (Number.isNaN(date.getTime())) {\n return void 0;\n }\n return date;\n};\nconst unmarshalArrayOfObject = (data, unmarshaller, emptyFallback = true) => {\n if (!Array.isArray(data)) {\n return emptyFallback ? [] : void 0;\n }\n return data.map((elt) => unmarshaller(elt));\n};\nconst unmarshalMapOfObject = (data, unmarshaller, emptyFallback = true) => {\n if (!data || typeof data !== \"object\" || !(data instanceof Object) || Array.isArray(data)) {\n return emptyFallback ? {} : void 0;\n }\n return Object.entries(data).reduce(\n (acc, [key, value]) => ({\n ...acc,\n [key]: unmarshaller(value)\n }),\n {}\n );\n};\nexports.resolveOneOf = resolveOneOf;\nexports.unmarshalArrayOfObject = unmarshalArrayOfObject;\nexports.unmarshalDate = unmarshalDate;\nexports.unmarshalMapOfObject = unmarshalMapOfObject;\nexports.urlParams = urlParams;\nexports.validatePathParam = validatePathParam;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst index = require(\"./internal/logger/index.cjs\");\nconst client = require(\"./scw/client.cjs\");\nconst clientIniFactory = require(\"./scw/client-ini-factory.cjs\");\nconst customTypes = require(\"./scw/custom-types.cjs\");\nconst index$1 = require(\"./scw/errors/standard/index.cjs\");\nconst json = require(\"./helpers/json.cjs\");\nconst intervalRetrier = require(\"./internal/async/interval-retrier.cjs\");\nconst helpers = require(\"./internal/interceptors/helpers.cjs\");\nconst api = require(\"./scw/api.cjs\");\nconst auth = require(\"./scw/auth.cjs\");\nconst customMarshalling = require(\"./scw/custom-marshalling.cjs\");\nconst marshalling = require(\"./helpers/marshalling.cjs\");\nconst resourcePaginator = require(\"./scw/fetch/resource-paginator.cjs\");\nconst index_gen$g = require(\"./api/account/index.gen.cjs\");\nconst index_gen = require(\"./api/applesilicon/index.gen.cjs\");\nconst index_gen$1 = require(\"./api/baremetal/index.gen.cjs\");\nconst index_gen$h = require(\"./api/billing/index.gen.cjs\");\nconst index_gen$i = require(\"./api/block/index.gen.cjs\");\nconst index_gen$j = require(\"./api/cockpit/index.gen.cjs\");\nconst index_gen$k = require(\"./api/container/index.gen.cjs\");\nconst index_gen$l = require(\"./api/dedibox/index.gen.cjs\");\nconst index_gen$2 = require(\"./api/document_db/index.gen.cjs\");\nconst index_gen$m = require(\"./api/domain/index.gen.cjs\");\nconst index_gen$n = require(\"./api/edge_services/index.gen.cjs\");\nconst index_gen$3 = require(\"./api/flexibleip/index.gen.cjs\");\nconst index_gen$o = require(\"./api/function/index.gen.cjs\");\nconst index_gen$4 = require(\"./api/iam/index.gen.cjs\");\nconst index_gen$p = require(\"./api/inference/index.gen.cjs\");\nconst index_gen$q = require(\"./api/instance/index.gen.cjs\");\nconst index_gen$5 = require(\"./api/iot/index.gen.cjs\");\nconst index_gen$6 = require(\"./api/ipam/index.gen.cjs\");\nconst index_gen$7 = require(\"./api/ipfs/index.gen.cjs\");\nconst index_gen$r = require(\"./api/jobs/index.gen.cjs\");\nconst index_gen$s = require(\"./api/k8s/index.gen.cjs\");\nconst index_gen$t = require(\"./api/key_manager/index.gen.cjs\");\nconst index_gen$8 = require(\"./api/lb/index.gen.cjs\");\nconst index_gen$9 = require(\"./api/llm_inference/index.gen.cjs\");\nconst index_gen$u = require(\"./api/marketplace/index.gen.cjs\");\nconst index_gen$a = require(\"./api/mnq/index.gen.cjs\");\nconst index_gen$v = require(\"./api/qaas/index.gen.cjs\");\nconst index_gen$b = require(\"./api/rdb/index.gen.cjs\");\nconst index_gen$w = require(\"./api/redis/index.gen.cjs\");\nconst index_gen$x = require(\"./api/registry/index.gen.cjs\");\nconst index_gen$y = require(\"./api/secret/index.gen.cjs\");\nconst index_gen$c = require(\"./api/serverless_sqldb/index.gen.cjs\");\nconst index_gen$z = require(\"./api/std/index.gen.cjs\");\nconst index_gen$d = require(\"./api/tem/index.gen.cjs\");\nconst index_gen$A = require(\"./api/test/index.gen.cjs\");\nconst index_gen$e = require(\"./api/vpc/index.gen.cjs\");\nconst index_gen$f = require(\"./api/vpcgw/index.gen.cjs\");\nconst index_gen$B = require(\"./api/webhosting/index.gen.cjs\");\nexports.enableConsoleLogger = index.enableConsoleLogger;\nexports.setLogger = index.setLogger;\nexports.createAdvancedClient = client.createAdvancedClient;\nexports.createClient = client.createClient;\nexports.withAdditionalInterceptors = clientIniFactory.withAdditionalInterceptors;\nexports.withDefaultPageSize = clientIniFactory.withDefaultPageSize;\nexports.withHTTPClient = clientIniFactory.withHTTPClient;\nexports.withProfile = clientIniFactory.withProfile;\nexports.withUserAgent = clientIniFactory.withUserAgent;\nexports.withUserAgentSuffix = clientIniFactory.withUserAgentSuffix;\nexports.Decimal = customTypes.Decimal;\nexports.Errors = index$1;\nexports.isJSONObject = json.isJSONObject;\nexports.createExponentialBackoffStrategy = intervalRetrier.createExponentialBackoffStrategy;\nexports.tryAtIntervals = intervalRetrier.tryAtIntervals;\nexports.waitForResource = intervalRetrier.waitForResource;\nexports.addAsyncHeaderInterceptor = helpers.addAsyncHeaderInterceptor;\nexports.API = api.API;\nexports.authenticateWithSessionToken = auth.authenticateWithSessionToken;\nexports.marshalBlobToScwFile = customMarshalling.marshalBlobToScwFile;\nexports.marshalDecimal = customMarshalling.marshalDecimal;\nexports.marshalMoney = customMarshalling.marshalMoney;\nexports.marshalScwFile = customMarshalling.marshalScwFile;\nexports.marshalTimeSeries = customMarshalling.marshalTimeSeries;\nexports.unmarshalDecimal = customMarshalling.unmarshalDecimal;\nexports.unmarshalMoney = customMarshalling.unmarshalMoney;\nexports.unmarshalScwFile = customMarshalling.unmarshalScwFile;\nexports.unmarshalServiceInfo = customMarshalling.unmarshalServiceInfo;\nexports.unmarshalTimeSeries = customMarshalling.unmarshalTimeSeries;\nexports.unmarshalTimeSeriesPoint = customMarshalling.unmarshalTimeSeriesPoint;\nexports.resolveOneOf = marshalling.resolveOneOf;\nexports.unmarshalArrayOfObject = marshalling.unmarshalArrayOfObject;\nexports.unmarshalDate = marshalling.unmarshalDate;\nexports.unmarshalMapOfObject = marshalling.unmarshalMapOfObject;\nexports.urlParams = marshalling.urlParams;\nexports.validatePathParam = marshalling.validatePathParam;\nexports.enrichForPagination = resourcePaginator.enrichForPagination;\nexports.Account = index_gen$g;\nexports.AppleSilicon = index_gen;\nexports.Applesilicon = index_gen;\nexports.BareMetal = index_gen$1;\nexports.Baremetal = index_gen$1;\nexports.Billing = index_gen$h;\nexports.Block = index_gen$i;\nexports.Cockpit = index_gen$j;\nexports.Container = index_gen$k;\nexports.Dedibox = index_gen$l;\nexports.DocumentDB = index_gen$2;\nexports.DocumentDb = index_gen$2;\nexports.Domain = index_gen$m;\nexports.EdgeServices = index_gen$n;\nexports.FlexibleIP = index_gen$3;\nexports.Flexibleip = index_gen$3;\nexports.Function = index_gen$o;\nexports.IAM = index_gen$4;\nexports.Iam = index_gen$4;\nexports.Inference = index_gen$p;\nexports.Instance = index_gen$q;\nexports.IOT = index_gen$5;\nexports.Iot = index_gen$5;\nexports.IPAM = index_gen$6;\nexports.Ipam = index_gen$6;\nexports.IPFS = index_gen$7;\nexports.Ipfs = index_gen$7;\nexports.Jobs = index_gen$r;\nexports.K8s = index_gen$s;\nexports.KeyManager = index_gen$t;\nexports.LB = index_gen$8;\nexports.Lb = index_gen$8;\nexports.LLMInference = index_gen$9;\nexports.LlmInference = index_gen$9;\nexports.Marketplace = index_gen$u;\nexports.MNQ = index_gen$a;\nexports.Mnq = index_gen$a;\nexports.Qaas = index_gen$v;\nexports.RDB = index_gen$b;\nexports.Rdb = index_gen$b;\nexports.Redis = index_gen$w;\nexports.Registry = index_gen$x;\nexports.Secret = index_gen$y;\nexports.ServerlessSQLDB = index_gen$c;\nexports.ServerlessSqldb = index_gen$c;\nexports.Std = index_gen$z;\nexports.Tem = index_gen$d;\nexports.TransactionalEmail = index_gen$d;\nexports.Test = index_gen$A;\nexports.VPC = index_gen$e;\nexports.Vpc = index_gen$e;\nexports.VPCGW = index_gen$f;\nexports.Vpcgw = index_gen$f;\nexports.Webhosting = index_gen$B;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst sleep = require(\"./sleep.cjs\");\nconst DEFAULT_TIMEOUT_SECONDS = 300;\nconst DEFAULT_MIN_DELAY_SECONDS = 1;\nconst DEFAULT_MAX_DELAY_SECONDS = 30;\nfunction* createExponentialBackoffStrategy(minDelay, maxDelay) {\n if (minDelay < 1 || maxDelay < 1 || minDelay > maxDelay) {\n throw new Error(\n \"Waiter: minDelay must be >= 1 and maxDelay must be >= minDelay\"\n );\n }\n let attempt = 1;\n const ceiling = Math.log(maxDelay / minDelay) / Math.log(2) + 1;\n const randomInRange = (min, max) => min + Math.random() * (max - min);\n while (true) {\n if (attempt > ceiling) {\n yield maxDelay;\n } else {\n yield randomInRange(minDelay, minDelay * 2 ** (attempt - 1));\n }\n attempt += 1;\n }\n}\nconst tryAtIntervals = async (retry, strategy, timeout = DEFAULT_TIMEOUT_SECONDS) => {\n const timeoutTimestamp = Date.now() + timeout * 1e3;\n let retryCount = 0;\n while (Date.now() <= timeoutTimestamp) {\n const delay = strategy.next(retryCount += 1).value * 1e3;\n if (timeoutTimestamp <= Date.now() + delay) break;\n await sleep.sleep(delay);\n const { value, done } = await retry();\n if (done) return value;\n }\n throw new Error(`Timeout after ${timeout}s`);\n};\nconst waitForResource = (stop, fetcher, request, options, strategy = createExponentialBackoffStrategy(\n options?.minDelay ?? DEFAULT_MIN_DELAY_SECONDS,\n options?.maxDelay ?? DEFAULT_MAX_DELAY_SECONDS\n)) => tryAtIntervals(\n async () => {\n const value = await fetcher(request);\n return {\n done: await stop(value),\n value\n };\n },\n strategy,\n options?.timeout\n);\nexports.createExponentialBackoffStrategy = createExponentialBackoffStrategy;\nexports.tryAtIntervals = tryAtIntervals;\nexports.waitForResource = waitForResource;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst sleep = (ms) => new Promise((resolve) => {\n setTimeout(resolve, ms);\n});\nexports.sleep = sleep;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst composeRequestInterceptors = (interceptors) => async (request) => interceptors.reduce(\n async (asyncResult, interceptor) => interceptor({ request: await asyncResult }),\n Promise.resolve(request)\n);\nconst composeResponseInterceptors = (interceptors) => async (response) => interceptors.reduce(\n async (asyncResult, interceptor) => interceptor({ response: await asyncResult }),\n Promise.resolve(response)\n);\nconst composeResponseErrorInterceptors = (interceptors) => async (request, error) => {\n let prevError = error;\n for (const interceptor of interceptors) {\n try {\n const res = await interceptor({ request, error: prevError });\n return res;\n } catch (err) {\n prevError = err;\n }\n }\n throw prevError;\n};\nexports.composeRequestInterceptors = composeRequestInterceptors;\nexports.composeResponseErrorInterceptors = composeResponseErrorInterceptors;\nexports.composeResponseInterceptors = composeResponseInterceptors;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst addHeaderInterceptor = (key, value) => ({ request }) => {\n const clone = request.clone();\n if (value !== void 0) {\n clone.headers.append(key, value);\n }\n return clone;\n};\nconst addAsyncHeaderInterceptor = (key, getter) => async (request) => addHeaderInterceptor(key, await getter())(request);\nexports.addAsyncHeaderInterceptor = addAsyncHeaderInterceptor;\nexports.addHeaderInterceptor = addHeaderInterceptor;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst levelResolver = require(\"./level-resolver.cjs\");\nclass ConsoleLogger {\n constructor(logLevel, prefix = \"\", output = console) {\n this.logLevel = logLevel;\n this.prefix = prefix;\n this.output = output;\n this.level = levelResolver.LevelResolver[this.logLevel];\n }\n level;\n makeMethod(method) {\n return (message) => {\n if (levelResolver.shouldLog(this.level, method)) {\n this.output[method](this.prefix ? `${this.prefix} ${message}` : message);\n }\n };\n }\n debug = this.makeMethod(\"debug\");\n error = this.makeMethod(\"error\");\n info = this.makeMethod(\"info\");\n warn = this.makeMethod(\"warn\");\n}\nexports.ConsoleLogger = ConsoleLogger;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst consoleLogger = require(\"./console-logger.cjs\");\nlet sdkLogger = new consoleLogger.ConsoleLogger(\"silent\");\nconst setLogger = (logger) => {\n sdkLogger = logger;\n};\nconst enableConsoleLogger = (logLevel = \"warn\", prefix = \"scaleway-sdk-js:\") => setLogger(new consoleLogger.ConsoleLogger(logLevel, prefix));\nconst getLogger = () => sdkLogger;\nexports.enableConsoleLogger = enableConsoleLogger;\nexports.getLogger = getLogger;\nexports.setLogger = setLogger;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nvar LevelResolver = /* @__PURE__ */ ((LevelResolver2) => {\n LevelResolver2[LevelResolver2[\"silent\"] = 0] = \"silent\";\n LevelResolver2[LevelResolver2[\"error\"] = 1] = \"error\";\n LevelResolver2[LevelResolver2[\"warn\"] = 2] = \"warn\";\n LevelResolver2[LevelResolver2[\"info\"] = 3] = \"info\";\n LevelResolver2[LevelResolver2[\"debug\"] = 4] = \"debug\";\n return LevelResolver2;\n})(LevelResolver || {});\nconst shouldLog = (currentLevel, level) => LevelResolver[level] <= currentLevel;\nexports.LevelResolver = LevelResolver;\nexports.shouldLog = shouldLog;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst isAccessKeyRegex = /^SCW[A-Z0-9]{17}$/i;\nconst isRegionRegex = /^[a-z]{2}-[a-z]{3}$/i;\nconst isUUIDRegex = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/i;\nconst isZoneRegex = /^[a-z]{2}-[a-z]{3}-[1-9]$/i;\nconst isUUID = (str) => isUUIDRegex.test(str);\nconst isAccessKey = (str) => isAccessKeyRegex.test(str);\nconst isSecretKey = (str) => isUUID(str);\nconst isOrganizationId = (str) => isUUID(str);\nconst isProjectId = (str) => isUUID(str);\nconst isRegion = (str) => isRegionRegex.test(str);\nconst isZone = (str) => isZoneRegex.test(str);\nconst isURL = (str) => {\n let url;\n try {\n url = new URL(str);\n } catch {\n return false;\n }\n return url.protocol === \"http:\" || url.protocol === \"https:\";\n};\nexports.isAccessKey = isAccessKey;\nexports.isOrganizationId = isOrganizationId;\nexports.isProjectId = isProjectId;\nexports.isRegion = isRegion;\nexports.isSecretKey = isSecretKey;\nexports.isURL = isURL;\nexports.isUUID = isUUID;\nexports.isZone = isZone;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nlet API$1 = class API {\n constructor(client) {\n this.client = client;\n }\n};\nexports.API = API$1;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst helpers = require(\"../internal/interceptors/helpers.cjs\");\nconst clientIniProfile = require(\"./client-ini-profile.cjs\");\nconst SESSION_HEADER_KEY = \"x-session-token\";\nconst AUTH_HEADER_KEY = \"x-auth-token\";\nconst authenticateWithSessionToken = (getToken) => helpers.addAsyncHeaderInterceptor(SESSION_HEADER_KEY, getToken);\nconst authenticateWithSecrets = (secrets) => {\n clientIniProfile.assertValidAuthenticationSecrets(secrets);\n return helpers.addHeaderInterceptor(AUTH_HEADER_KEY, secrets.secretKey);\n};\nconst obfuscateToken = (key) => `${key.substring(0, 5)}xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`;\nconst obfuscateUUID = (key) => `${key.substring(0, 8)}-xxxx-xxxx-xxxx-xxxxxxxxxxxx`;\nconst obfuscateAuthHeadersEntry = ([\n name,\n value\n]) => {\n if (name === SESSION_HEADER_KEY) return [name, obfuscateToken(value)];\n if (name === AUTH_HEADER_KEY) return [name, obfuscateUUID(value)];\n return [name, value];\n};\nexports.authenticateWithSecrets = authenticateWithSecrets;\nexports.authenticateWithSessionToken = authenticateWithSessionToken;\nexports.obfuscateAuthHeadersEntry = obfuscateAuthHeadersEntry;\nexports.obfuscateToken = obfuscateToken;\nexports.obfuscateUUID = obfuscateUUID;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst auth = require(\"./auth.cjs\");\nconst clientIniProfile = require(\"./client-ini-profile.cjs\");\nconst withProfile = (profile) => (settings) => {\n const newSettings = { ...settings };\n if (profile.apiURL) {\n newSettings.apiURL = profile.apiURL;\n }\n if (profile.defaultOrganizationId) {\n newSettings.defaultOrganizationId = profile.defaultOrganizationId;\n }\n if (profile.defaultProjectId) {\n newSettings.defaultProjectId = profile.defaultProjectId;\n }\n if (profile.defaultRegion) {\n newSettings.defaultRegion = profile.defaultRegion;\n }\n if (profile.defaultZone) {\n newSettings.defaultZone = profile.defaultZone;\n }\n if (clientIniProfile.hasAuthenticationSecrets(profile)) {\n newSettings.interceptors = [\n {\n request: auth.authenticateWithSecrets(profile)\n },\n ...newSettings.interceptors\n ];\n }\n return newSettings;\n};\nconst withHTTPClient = (httpClient) => (settings) => ({ ...settings, httpClient });\nconst withDefaultPageSize = (defaultPageSize) => (settings) => ({ ...settings, defaultPageSize });\nconst withUserAgent = (userAgent) => (settings) => ({ ...settings, userAgent });\nconst withUserAgentSuffix = (userAgent) => (settings) => ({\n ...settings,\n userAgent: settings.userAgent ? `${settings.userAgent} ${userAgent}` : userAgent\n});\nconst withAdditionalInterceptors = (interceptors) => (settings) => ({\n ...settings,\n interceptors: settings.interceptors.concat(interceptors)\n});\nconst withLegacyInterceptors = () => (settings) => {\n if (!settings.requestInterceptors && !settings.responseInterceptors) {\n return settings;\n }\n const allInterceptors = settings.interceptors.concat(\n (settings.requestInterceptors ?? []).map((obj) => ({\n request: obj\n })),\n (settings.responseInterceptors ?? []).map((obj) => ({\n response: obj\n }))\n );\n return {\n ...settings,\n interceptors: allInterceptors\n };\n};\nexports.withAdditionalInterceptors = withAdditionalInterceptors;\nexports.withDefaultPageSize = withDefaultPageSize;\nexports.withHTTPClient = withHTTPClient;\nexports.withLegacyInterceptors = withLegacyInterceptors;\nexports.withProfile = withProfile;\nexports.withUserAgent = withUserAgent;\nexports.withUserAgentSuffix = withUserAgentSuffix;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst stringValidation = require(\"../internal/validations/string-validation.cjs\");\nconst hasAuthenticationSecrets = (obj) => typeof obj.accessKey === \"string\" && obj.accessKey !== \"\" && typeof obj.secretKey === \"string\" && obj.secretKey !== \"\";\nfunction assertValidAuthenticationSecrets(obj) {\n if (!(obj.accessKey && obj.secretKey)) {\n throw new Error(\n `Invalid secrets, accessKey & secretKey must be defined. See https://www.scaleway.com/en/docs/identity-and-access-management/iam/how-to/create-api-keys/`\n );\n }\n if (!stringValidation.isAccessKey(obj.accessKey)) {\n throw new Error(\n `Invalid access key format '${obj.accessKey}', expected SCWXXXXXXXXXXXXXXXXX format. See https://www.scaleway.com/en/docs/identity-and-access-management/iam/how-to/create-api-keys/`\n );\n }\n if (!stringValidation.isSecretKey(obj.secretKey)) {\n throw new Error(\n `Invalid secret key format '${obj.secretKey}', expected a UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. See https://www.scaleway.com/en/docs/identity-and-access-management/iam/how-to/create-api-keys/`\n );\n }\n}\nexports.assertValidAuthenticationSecrets = assertValidAuthenticationSecrets;\nexports.hasAuthenticationSecrets = hasAuthenticationSecrets;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst stringValidation = require(\"../internal/validations/string-validation.cjs\");\nconst assertValidSettings = (obj) => {\n if (obj.defaultOrganizationId !== void 0) {\n if (typeof obj.defaultOrganizationId !== \"string\" || obj.defaultOrganizationId.length === 0) {\n throw new Error(\"Default organization ID cannot be empty\");\n }\n if (!stringValidation.isOrganizationId(obj.defaultOrganizationId)) {\n throw new Error(\n `Invalid organization ID format '${obj.defaultOrganizationId}', expected a UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`\n );\n }\n }\n if (obj.defaultProjectId !== void 0) {\n if (typeof obj.defaultProjectId !== \"string\" || obj.defaultProjectId.length === 0) {\n throw new Error(\"Default project ID cannot be empty\");\n }\n if (!stringValidation.isProjectId(obj.defaultProjectId)) {\n throw new Error(\n `Invalid project ID format '${obj.defaultProjectId}', expected a UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`\n );\n }\n }\n if (obj.defaultRegion && !stringValidation.isRegion(obj.defaultRegion)) {\n throw new Error(`Invalid default region format '${obj.defaultRegion}'`);\n }\n if (obj.defaultZone && !stringValidation.isZone(obj.defaultZone)) {\n throw new Error(`Invalid default zone format '${obj.defaultZone}'`);\n }\n if (!stringValidation.isURL(obj.apiURL)) {\n throw new Error(`Invalid URL ${obj.apiURL}`);\n }\n if (obj.apiURL.endsWith(\"/\")) {\n throw new Error(\n `Invalid URL ${obj.apiURL}: it should not have a trailing slash`\n );\n }\n if (typeof obj.httpClient !== typeof fetch) {\n throw new Error(`Invalid HTTP Client`);\n }\n if (obj.defaultPageSize !== void 0 && (typeof obj.defaultPageSize !== \"number\" || Number.isNaN(obj.defaultPageSize) || obj.defaultPageSize <= 0)) {\n throw new Error(\n `Invalid defaultPageSize ${obj.defaultPageSize}: it should be a number above 0`\n );\n }\n if (typeof obj.userAgent !== \"string\") {\n throw new Error(`Invalid User-Agent`);\n }\n};\nexports.assertValidSettings = assertValidSettings;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst index = require(\"../internal/logger/index.cjs\");\nconst clientIniFactory = require(\"./client-ini-factory.cjs\");\nconst clientSettings = require(\"./client-settings.cjs\");\nconst constants = require(\"./constants.cjs\");\nconst buildFetcher = require(\"./fetch/build-fetcher.cjs\");\nconst DEFAULT_SETTINGS = {\n apiURL: \"https://api.scaleway.com\",\n httpClient: fetch,\n interceptors: [],\n userAgent: constants.userAgent\n};\nconst createAdvancedClient = (...configs) => {\n const settings = configs.concat([clientIniFactory.withLegacyInterceptors()]).reduce(\n (currentSettings, config) => config(currentSettings),\n DEFAULT_SETTINGS\n );\n clientSettings.assertValidSettings(settings);\n index.getLogger().info(`init Scaleway SDK version ${constants.version}`);\n return {\n fetch: buildFetcher.buildFetcher(settings, settings.httpClient),\n settings\n };\n};\nconst createClient = (profile = {}) => createAdvancedClient(clientIniFactory.withProfile(profile));\nexports.createAdvancedClient = createAdvancedClient;\nexports.createClient = createClient;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst version = \"v2.49.0\";\nconst userAgent = `scaleway-sdk-js/${version}`;\nexports.userAgent = userAgent;\nexports.version = version;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst json = require(\"../helpers/json.cjs\");\nconst marshalling = require(\"../helpers/marshalling.cjs\");\nconst index = require(\"../vendor/base64/index.cjs\");\nconst customTypes = require(\"./custom-types.cjs\");\nconst unmarshalMoney = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'Money' failed as data isn't a dictionary.`\n );\n }\n return {\n currencyCode: data.currency_code,\n nanos: data.nanos,\n units: data.units\n };\n};\nconst unmarshalServiceInfo = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ServiceInfo' failed as data isn't a dictionary.`\n );\n }\n return {\n description: data.description,\n documentationUrl: data.documentation_url,\n name: data.name,\n version: data.version\n };\n};\nconst unmarshalScwFile = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'ScwFile' failed as data isn't a dictionary.`\n );\n }\n return {\n content: data.content,\n contentType: data.content_type,\n name: data.name\n };\n};\nconst unmarshalTimeSeriesPoint = (data) => {\n if (!Array.isArray(data)) {\n throw new TypeError(\n `Unmarshalling the type 'TimeSeriesPoint' failed as data isn't an array.`\n );\n }\n return {\n timestamp: marshalling.unmarshalDate(data[0]),\n value: data[1]\n };\n};\nconst unmarshalTimeSeries = (data) => {\n if (!json.isJSONObject(data)) {\n throw new TypeError(\n `Unmarshalling the type 'TimeSeries' failed as data isn't a dictionary.`\n );\n }\n return {\n metadata: data.metadata,\n name: data.name,\n points: marshalling.unmarshalArrayOfObject(data.points, unmarshalTimeSeriesPoint)\n };\n};\nconst unmarshalDecimal = (data) => {\n if (!(typeof data === \"object\")) {\n throw new TypeError(\n `Unmarshalling the type 'Decimal' failed as data isn't an object.`\n );\n }\n if (data === null) {\n return null;\n }\n if (!(\"value\" in data)) {\n throw new TypeError(\n `Unmarshalling the type 'Decimal' failed as data object does not have a 'value' key.`\n );\n }\n if (!(typeof data.value === \"string\")) {\n throw new TypeError(\n `Unmarshalling the type 'Decimal' failed as 'value' is not a string.`\n );\n }\n return new customTypes.Decimal(data.value);\n};\nconst marshalScwFile = (obj) => ({\n content: obj.content,\n content_type: obj.contentType,\n name: obj.name\n});\nconst marshalBlobToScwFile = async (blob) => ({\n content: index.fromByteArray(new Uint8Array(await blob.arrayBuffer())),\n content_type: blob.type,\n name: \"file\"\n});\nconst marshalMoney = (obj) => ({\n currency_code: obj.currencyCode,\n nanos: obj.nanos,\n units: obj.units\n});\nconst marshalTimeSeriesPoint = (obj) => ({\n timestamp: obj.timestamp?.toISOString(),\n value: obj.value\n});\nconst marshalTimeSeries = (obj) => ({\n metadata: obj.metadata,\n name: obj.name,\n points: obj.points.map((elt) => marshalTimeSeriesPoint(elt))\n});\nconst marshalDecimal = (obj) => ({\n value: obj.toString()\n});\nexports.marshalBlobToScwFile = marshalBlobToScwFile;\nexports.marshalDecimal = marshalDecimal;\nexports.marshalMoney = marshalMoney;\nexports.marshalScwFile = marshalScwFile;\nexports.marshalTimeSeries = marshalTimeSeries;\nexports.marshalTimeSeriesPoint = marshalTimeSeriesPoint;\nexports.unmarshalDecimal = unmarshalDecimal;\nexports.unmarshalMoney = unmarshalMoney;\nexports.unmarshalScwFile = unmarshalScwFile;\nexports.unmarshalServiceInfo = unmarshalServiceInfo;\nexports.unmarshalTimeSeries = unmarshalTimeSeries;\nexports.unmarshalTimeSeriesPoint = unmarshalTimeSeriesPoint;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nclass Decimal {\n str;\n constructor(v) {\n this.str = v;\n }\n toString = () => this.str;\n marshal = () => ({ value: this.str });\n}\nexports.Decimal = Decimal;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst invalidRequestMapper = require(\"./non-standard/invalid-request-mapper.cjs\");\nconst unknownResourceMapper = require(\"./non-standard/unknown-resource-mapper.cjs\");\nconst scwError = require(\"./scw-error.cjs\");\nconst alreadyExistsError = require(\"./standard/already-exists-error.cjs\");\nconst deniedAuthenticationError = require(\"./standard/denied-authentication-error.cjs\");\nconst invalidArgumentsError = require(\"./standard/invalid-arguments-error.cjs\");\nconst outOfStockError = require(\"./standard/out-of-stock-error.cjs\");\nconst permissionsDeniedError = require(\"./standard/permissions-denied-error.cjs\");\nconst preconditionFailedError = require(\"./standard/precondition-failed-error.cjs\");\nconst quotasExceededError = require(\"./standard/quotas-exceeded-error.cjs\");\nconst resourceExpiredError = require(\"./standard/resource-expired-error.cjs\");\nconst resourceLockedError = require(\"./standard/resource-locked-error.cjs\");\nconst resourceNotFoundError = require(\"./standard/resource-not-found-error.cjs\");\nconst tooManyRequestsError = require(\"./standard/too-many-requests-error.cjs\");\nconst transientStateError = require(\"./standard/transient-state-error.cjs\");\nconst unmarshalStandardError = (type, status, body) => {\n let error;\n switch (type) {\n case \"denied_authentication\":\n error = deniedAuthenticationError.DeniedAuthenticationError;\n break;\n case \"invalid_arguments\":\n error = invalidArgumentsError.InvalidArgumentsError;\n break;\n case \"out_of_stock\":\n error = outOfStockError.OutOfStockError;\n break;\n case \"permissions_denied\":\n error = permissionsDeniedError.PermissionsDeniedError;\n break;\n case \"precondition_failed\":\n error = preconditionFailedError.PreconditionFailedError;\n break;\n case \"quotas_exceeded\":\n error = quotasExceededError.QuotasExceededError;\n break;\n case \"expired\":\n error = resourceExpiredError.ResourceExpiredError;\n break;\n case \"not_found\":\n error = resourceNotFoundError.ResourceNotFoundError;\n break;\n case \"locked\":\n error = resourceLockedError.ResourceLockedError;\n break;\n case \"transient_state\":\n error = transientStateError.TransientStateError;\n break;\n case \"already_exists\":\n error = alreadyExistsError.AlreadyExistsError;\n break;\n case \"too_many_requests\":\n error = tooManyRequestsError.TooManyRequestsError;\n break;\n default:\n return null;\n }\n return error.fromJSON(status, body);\n};\nconst unmarshalNonStandardError = (type, status, body) => {\n switch (type) {\n case \"unknown_resource\":\n return unknownResourceMapper.UnknownResourceMapper.fromJSON(status, body);\n case \"invalid_request_error\":\n return invalidRequestMapper.InvalidRequestMapper.fromJSON(status, body);\n default:\n return null;\n }\n};\nconst parseScalewayError = (status, body) => {\n const parsableError = typeof body.type === \"string\" && (unmarshalStandardError(body.type, status, body) ?? unmarshalNonStandardError(body.type, status, body));\n return parsableError || new scwError.ScalewayError(status, body);\n};\nexports.parseScalewayError = parseScalewayError;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst scwError = require(\"../scw-error.cjs\");\nconst invalidArgumentsError = require(\"../standard/invalid-arguments-error.cjs\");\nconst quotasExceededError = require(\"../standard/quotas-exceeded-error.cjs\");\nconst types = require(\"../types.cjs\");\nclass InvalidRequestMapper {\n static fromJSON(status, obj) {\n if (typeof obj.message === \"string\" && obj.message.toLowerCase().includes(\"quota exceeded for this resource\")) {\n return new quotasExceededError.QuotasExceededError(status, obj, [\n {\n current: 0,\n quota: 0,\n resource: typeof obj.resource === \"string\" ? obj.resource : \"\"\n }\n ]);\n }\n const fields = obj.fields && types.isRecordOfStringArray(obj.fields) ? obj.fields : {};\n const fieldsMessages = Object.entries(fields);\n if (fieldsMessages.length) {\n return new invalidArgumentsError.InvalidArgumentsError(\n status,\n obj,\n fieldsMessages.map(\n ([argumentName, messages]) => messages.map((helpMessage) => ({\n argumentName,\n helpMessage,\n reason: \"constraint\"\n }))\n ).flat()\n );\n }\n return new scwError.ScalewayError(status, obj);\n }\n}\nexports.InvalidRequestMapper = InvalidRequestMapper;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst stringValidation = require(\"../../../internal/validations/string-validation.cjs\");\nconst scwError = require(\"../scw-error.cjs\");\nconst resourceNotFoundError = require(\"../standard/resource-not-found-error.cjs\");\nclass UnknownResourceMapper {\n static fromJSON(status, obj) {\n const messageParts = typeof obj.message === \"string\" ? obj.message.split(/\"|'/) : [];\n if (messageParts.length === 3 && stringValidation.isUUID(messageParts[1])) {\n return new resourceNotFoundError.ResourceNotFoundError(\n status,\n obj,\n // transform `Security group ` to `security_group`\n // `.replaceAll()` may be too recent to use yet.\n // that's why we're using `.split(' ').join('_')` for now.\n messageParts[0].trim().toLowerCase().split(\" \").join(\"_\"),\n messageParts[1]\n );\n }\n return new scwError.ScalewayError(status, obj);\n }\n}\nexports.UnknownResourceMapper = UnknownResourceMapper;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst json = require(\"../../helpers/json.cjs\");\nconst types = require(\"./types.cjs\");\nconst buildDefaultMessage = (status, body) => {\n const message = [`http error ${status}`];\n if (typeof body === \"string\") {\n message.push(body);\n } else if (json.isJSONObject(body)) {\n if (typeof body.resource === \"string\") {\n message.push(`resource ${body.resource}`);\n }\n if (typeof body.message === \"string\") {\n message.push(body.message);\n }\n if (body.fields && types.isRecordOfStringArray(body.fields)) {\n message.push(\n Object.entries(body.fields).map(([name, list]) => `${name} (${list.join(\", \")})`).join(\", \")\n );\n }\n }\n return message.join(\": \");\n};\nclass ScalewayError extends Error {\n constructor(status, body, message = buildDefaultMessage(status, body)) {\n super(message);\n this.status = status;\n this.body = body;\n this.message = message;\n this.name = \"ScalewayError\";\n this.rawMessage = typeof body === \"object\" && typeof body.message === \"string\" ? body.message : void 0;\n Object.setPrototypeOf(this, new.target.prototype);\n }\n /** The message originating from the payload. */\n rawMessage;\n static fromJSON(status, obj) {\n return new ScalewayError(status, obj);\n }\n toString() {\n return `${this.name}: ${this.message}`;\n }\n}\nexports.ScalewayError = ScalewayError;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst scwError = require(\"../scw-error.cjs\");\nclass AlreadyExistsError extends scwError.ScalewayError {\n constructor(status, body, resource, resourceId, helpMessage) {\n super(\n status,\n body,\n `resource ${resource} with ID ${resourceId} already exists: ${helpMessage}`\n );\n this.status = status;\n this.body = body;\n this.resource = resource;\n this.resourceId = resourceId;\n this.helpMessage = helpMessage;\n this.name = \"AlreadyExistsError\";\n }\n static fromJSON(status, obj) {\n if (typeof obj.resource !== \"string\" || typeof obj.resource_id !== \"string\" || typeof obj.help_message !== \"string\") {\n return null;\n }\n return new AlreadyExistsError(\n status,\n obj,\n obj.resource,\n obj.resource_id,\n obj.help_message\n );\n }\n}\nexports.AlreadyExistsError = AlreadyExistsError;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst scwError = require(\"../scw-error.cjs\");\nconst buildMessage = (method, reason) => {\n let reasonDesc;\n switch (reason) {\n case \"invalid_argument\":\n reasonDesc = `invalid ${method} format or empty value`;\n break;\n case \"not_found\":\n reasonDesc = `${method} does not exist`;\n break;\n case \"expired\":\n reasonDesc = `${method} is expired`;\n break;\n default:\n reasonDesc = `unknown reason for ${method}`;\n }\n return `denied authentication: ${reasonDesc}`;\n};\nclass DeniedAuthenticationError extends scwError.ScalewayError {\n constructor(status, body, method, reason) {\n super(status, body, buildMessage(method, reason));\n this.status = status;\n this.body = body;\n this.method = method;\n this.reason = reason;\n this.name = \"DeniedAuthenticationError\";\n }\n static fromJSON(status, obj) {\n if (typeof obj.method !== \"string\" || typeof obj.reason !== \"string\") {\n return null;\n }\n return new DeniedAuthenticationError(status, obj, obj.method, obj.reason);\n }\n}\nexports.DeniedAuthenticationError = DeniedAuthenticationError;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst scwError = require(\"../scw-error.cjs\");\nconst alreadyExistsError = require(\"./already-exists-error.cjs\");\nconst deniedAuthenticationError = require(\"./denied-authentication-error.cjs\");\nconst invalidArgumentsError = require(\"./invalid-arguments-error.cjs\");\nconst outOfStockError = require(\"./out-of-stock-error.cjs\");\nconst permissionsDeniedError = require(\"./permissions-denied-error.cjs\");\nconst preconditionFailedError = require(\"./precondition-failed-error.cjs\");\nconst quotasExceededError = require(\"./quotas-exceeded-error.cjs\");\nconst resourceExpiredError = require(\"./resource-expired-error.cjs\");\nconst resourceLockedError = require(\"./resource-locked-error.cjs\");\nconst resourceNotFoundError = require(\"./resource-not-found-error.cjs\");\nconst tooManyRequestsError = require(\"./too-many-requests-error.cjs\");\nconst transientStateError = require(\"./transient-state-error.cjs\");\nexports.ScalewayError = scwError.ScalewayError;\nexports.AlreadyExistsError = alreadyExistsError.AlreadyExistsError;\nexports.DeniedAuthenticationError = deniedAuthenticationError.DeniedAuthenticationError;\nexports.InvalidArgumentsError = invalidArgumentsError.InvalidArgumentsError;\nexports.OutOfStockError = outOfStockError.OutOfStockError;\nexports.PermissionsDeniedError = permissionsDeniedError.PermissionsDeniedError;\nexports.PreconditionFailedError = preconditionFailedError.PreconditionFailedError;\nexports.QuotasExceededError = quotasExceededError.QuotasExceededError;\nexports.ResourceExpiredError = resourceExpiredError.ResourceExpiredError;\nexports.ResourceLockedError = resourceLockedError.ResourceLockedError;\nexports.ResourceNotFoundError = resourceNotFoundError.ResourceNotFoundError;\nexports.TooManyRequestsError = tooManyRequestsError.TooManyRequestsError;\nexports.TransientStateError = transientStateError.TransientStateError;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst json = require(\"../../../helpers/json.cjs\");\nconst scwError = require(\"../scw-error.cjs\");\nconst buildMessage = (list) => {\n const invalidArgs = list.reduce((acc, details) => {\n let readableReason = \"\";\n switch (details.reason) {\n case \"required\":\n readableReason = `is required`;\n break;\n case \"format\":\n readableReason = `is wrongly formatted`;\n break;\n case \"constraint\":\n readableReason = `does not respect constraint`;\n break;\n default:\n readableReason = `is invalid for unexpected reason`;\n break;\n }\n if (details.helpMessage && details.helpMessage.length > 0) {\n readableReason = readableReason.concat(`, `, details.helpMessage);\n }\n acc.push(`${details.argumentName} ${readableReason}`);\n return acc;\n }, []);\n return `invalid argument(s): ${invalidArgs.join(\"; \")}`;\n};\nclass InvalidArgumentsError extends scwError.ScalewayError {\n constructor(status, body, details) {\n super(status, body, buildMessage(details));\n this.status = status;\n this.body = body;\n this.details = details;\n this.name = \"InvalidArgumentsError\";\n }\n static fromJSON(status, obj) {\n if (!Array.isArray(obj.details)) return null;\n return new InvalidArgumentsError(\n status,\n obj,\n obj.details.reduce(\n (list, detail) => json.isJSONObject(detail) && typeof detail.argument_name === \"string\" && typeof detail.reason === \"string\" ? list.concat({\n argumentName: detail.argument_name,\n helpMessage: typeof detail.help_message === \"string\" ? detail.help_message : void 0,\n reason: detail.reason\n }) : list,\n []\n )\n );\n }\n}\nexports.InvalidArgumentsError = InvalidArgumentsError;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst scwError = require(\"../scw-error.cjs\");\nclass OutOfStockError extends scwError.ScalewayError {\n constructor(status, body, resource) {\n super(status, body, `resource ${resource} is out of stock`);\n this.status = status;\n this.body = body;\n this.resource = resource;\n this.name = \"OutOfStockError\";\n }\n static fromJSON(status, obj) {\n if (typeof obj.resource !== \"string\") return null;\n return new OutOfStockError(status, obj, obj.resource);\n }\n}\nexports.OutOfStockError = OutOfStockError;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst json = require(\"../../../helpers/json.cjs\");\nconst scwError = require(\"../scw-error.cjs\");\nconst buildMessage = (list) => `insufficient permissions: ${list.map(({ action, resource }) => `${action} ${resource}`).join(\"; \")}`;\nclass PermissionsDeniedError extends scwError.ScalewayError {\n constructor(status, body, list) {\n super(status, body, buildMessage(list));\n this.status = status;\n this.body = body;\n this.list = list;\n this.name = \"PermissionsDeniedError\";\n }\n static fromJSON(status, obj) {\n if (!Array.isArray(obj.details)) return null;\n return new PermissionsDeniedError(\n status,\n obj,\n obj.details.reduce(\n (list, detail) => json.isJSONObject(detail) && typeof detail.resource === \"string\" && typeof detail.action === \"string\" ? list.concat({\n action: detail.action,\n resource: detail.resource\n }) : list,\n []\n )\n );\n }\n}\nexports.PermissionsDeniedError = PermissionsDeniedError;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst scwError = require(\"../scw-error.cjs\");\nconst buildMessage = (precondition, helpMessage) => {\n let message = `precondition failed: ${precondition}`;\n if (typeof helpMessage === \"string\" && helpMessage.length > 0) {\n message = message.concat(\", \", helpMessage);\n }\n return message;\n};\nclass PreconditionFailedError extends scwError.ScalewayError {\n constructor(status, body, precondition, helpMessage) {\n super(status, body, buildMessage(precondition, helpMessage));\n this.status = status;\n this.body = body;\n this.precondition = precondition;\n this.helpMessage = helpMessage;\n this.name = \"PreconditionFailedError\";\n }\n static fromJSON(status, obj) {\n if (typeof obj.precondition !== \"string\" || typeof obj.help_message !== \"string\") {\n return null;\n }\n return new PreconditionFailedError(\n status,\n obj,\n obj.precondition,\n obj.help_message\n );\n }\n}\nexports.PreconditionFailedError = PreconditionFailedError;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst json = require(\"../../../helpers/json.cjs\");\nconst scwError = require(\"../scw-error.cjs\");\nconst buildMessage = (list) => `quota(s) exceeded: ${list.map((details) => {\n const message = `${details.resource} has reached its quota (${details.current}/${details.quota})`;\n return details.scope ? `${message} for ${details.scope.kind} '${details.scope.id}'` : message;\n}).join(\"; \")}`;\nconst buildScope = (detail) => {\n if (typeof detail.organization_id === \"string\" && detail.organization_id.length) {\n return { id: detail.organization_id, kind: \"organization\" };\n }\n if (typeof detail.project_id === \"string\" && detail.project_id.length) {\n return { id: detail.project_id, kind: \"project\" };\n }\n return void 0;\n};\nclass QuotasExceededError extends scwError.ScalewayError {\n constructor(status, body, list) {\n super(status, body, buildMessage(list));\n this.status = status;\n this.body = body;\n this.list = list;\n this.name = \"QuotasExceededError\";\n }\n static fromJSON(status, obj) {\n if (!Array.isArray(obj.details)) return null;\n return new QuotasExceededError(\n status,\n obj,\n obj.details.reduce(\n (list, detail) => json.isJSONObject(detail) && typeof detail.resource === \"string\" && typeof detail.quota === \"number\" && typeof detail.current === \"number\" ? list.concat({\n current: detail.current,\n quota: detail.quota,\n resource: detail.resource,\n scope: buildScope(detail)\n }) : list,\n []\n )\n );\n }\n}\nexports.QuotasExceededError = QuotasExceededError;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst scwError = require(\"../scw-error.cjs\");\nclass ResourceExpiredError extends scwError.ScalewayError {\n constructor(status, body, resource, resourceId, expiredSince) {\n super(\n status,\n body,\n `resource ${resource} with ID ${resourceId} expired since ${expiredSince.toISOString()}`\n );\n this.status = status;\n this.body = body;\n this.resource = resource;\n this.resourceId = resourceId;\n this.expiredSince = expiredSince;\n this.name = \"ResourceExpiredError\";\n }\n static fromJSON(status, obj) {\n if (typeof obj.resource !== \"string\" || typeof obj.resource_id !== \"string\" || typeof obj.expired_since !== \"string\") {\n return null;\n }\n return new ResourceExpiredError(\n status,\n obj,\n obj.resource,\n obj.resource_id,\n new Date(obj.expired_since)\n );\n }\n}\nexports.ResourceExpiredError = ResourceExpiredError;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst scwError = require(\"../scw-error.cjs\");\nclass ResourceLockedError extends scwError.ScalewayError {\n constructor(status, body, resource, resourceId) {\n super(status, body, `resource ${resource} with ID ${resourceId} is locked`);\n this.status = status;\n this.body = body;\n this.resource = resource;\n this.resourceId = resourceId;\n this.name = \"ResourceLockedError\";\n }\n static fromJSON(status, obj) {\n if (typeof obj.resource !== \"string\" || typeof obj.resource_id !== \"string\") {\n return null;\n }\n return new ResourceLockedError(status, obj, obj.resource, obj.resource_id);\n }\n}\nexports.ResourceLockedError = ResourceLockedError;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst scwError = require(\"../scw-error.cjs\");\nclass ResourceNotFoundError extends scwError.ScalewayError {\n constructor(status, body, resource, resourceId) {\n super(\n status,\n body,\n `resource ${resource} with ID ${resourceId} is not found`\n );\n this.status = status;\n this.body = body;\n this.resource = resource;\n this.resourceId = resourceId;\n this.name = \"ResourceNotFoundError\";\n }\n static fromJSON(status, obj) {\n if (typeof obj.resource !== \"string\" || typeof obj.resource_id !== \"string\") {\n return null;\n }\n return new ResourceNotFoundError(status, obj, obj.resource, obj.resource_id);\n }\n}\nexports.ResourceNotFoundError = ResourceNotFoundError;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst json = require(\"../../../helpers/json.cjs\");\nconst scwError = require(\"../scw-error.cjs\");\nconst buildMessage = (helpMessage, limit, resetSeconds, resetAt) => {\n const details = [];\n if (limit) {\n if (limit.windowSeconds) {\n details.push(`quota is ${limit.quota} for ${limit.windowSeconds}s`);\n } else {\n details.push(`quota is ${limit.quota}`);\n }\n }\n if (resetSeconds) {\n details.push(`resets in ${resetSeconds}s`);\n } else if (resetAt) {\n details.push(`resets at ${resetAt.toISOString()}`);\n }\n let output = `too many requests`;\n if (details.length > 0) {\n output += ` (${details.join(\", \")})`;\n }\n if (helpMessage.length > 0) {\n output += `: ${helpMessage}`;\n }\n return output;\n};\nclass TooManyRequestsError extends scwError.ScalewayError {\n constructor(status, body, helpMessage, limit, resetSeconds, resetAt) {\n super(status, body, buildMessage(helpMessage, limit, resetSeconds, resetAt));\n this.status = status;\n this.body = body;\n this.helpMessage = helpMessage;\n this.limit = limit;\n this.resetSeconds = resetSeconds;\n this.resetAt = resetAt;\n this.name = \"TooManyRequestsError\";\n }\n static fromJSON(status, obj) {\n if (typeof obj.help_message !== \"string\") return null;\n let limit;\n if (json.isJSONObject(obj.limit) && typeof obj.limit.quota === \"number\") {\n limit = {\n quota: obj.limit.quota,\n windowSeconds: typeof obj.limit.window_seconds === \"number\" ? obj.limit.window_seconds : void 0\n };\n }\n return new TooManyRequestsError(\n status,\n obj,\n obj.help_message,\n limit,\n typeof obj.reset_seconds === \"number\" ? obj.reset_seconds : void 0,\n typeof obj.reset_at === \"string\" ? new Date(obj.reset_at) : void 0\n );\n }\n}\nexports.TooManyRequestsError = TooManyRequestsError;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst scwError = require(\"../scw-error.cjs\");\nclass TransientStateError extends scwError.ScalewayError {\n constructor(status, body, resource, resourceId, currentState) {\n super(\n status,\n body,\n `resource ${resource} with ID ${resourceId} is in a transient state: ${currentState}`\n );\n this.status = status;\n this.body = body;\n this.resource = resource;\n this.resourceId = resourceId;\n this.currentState = currentState;\n this.name = \"TransientStateError\";\n }\n static fromJSON(status, obj) {\n if (typeof obj.resource !== \"string\" || typeof obj.resource_id !== \"string\" || typeof obj.current_state !== \"string\") {\n return null;\n }\n return new TransientStateError(\n status,\n obj,\n obj.resource,\n obj.resource_id,\n obj.current_state\n );\n }\n}\nexports.TransientStateError = TransientStateError;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst json = require(\"../../helpers/json.cjs\");\nconst isRecordOfStringArray = (obj) => {\n if (!json.isJSONObject(obj)) {\n return false;\n }\n for (const elt of Object.values(obj)) {\n if (!Array.isArray(elt) || Object.values(elt).find((x) => typeof x !== \"string\") !== void 0) {\n return false;\n }\n }\n return true;\n};\nexports.isRecordOfStringArray = isRecordOfStringArray;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst isBrowser = require(\"../../helpers/is-browser.cjs\");\nconst composer = require(\"../../internal/interceptors/composer.cjs\");\nconst auth = require(\"../auth.cjs\");\nconst httpInterceptors = require(\"./http-interceptors.cjs\");\nconst responseParser = require(\"./response-parser.cjs\");\nconst buildRequest = (request, settings) => {\n let { path } = request;\n if (request.urlParams instanceof URLSearchParams) {\n path = path.concat(`?${request.urlParams.toString()}`);\n }\n return new Request(`${settings.apiURL}${path}`, {\n body: request.body,\n headers: {\n Accept: \"application/json\",\n .../* istanbul ignore next */\n !isBrowser.isBrowser() ? { \"User-Agent\": settings.userAgent } : {},\n ...request.headers\n },\n method: request.method\n });\n};\nconst asIs = (response) => response;\nconst buildFetcher = (settings, httpClient) => {\n let requestNumber = 0;\n const prepareRequest = (requestId) => composer.composeRequestInterceptors([\n ...settings.interceptors.map((obj) => obj.request).filter((obj) => obj),\n httpInterceptors.logRequest(requestId, httpInterceptors.obfuscateInterceptor(auth.obfuscateAuthHeadersEntry))\n ]);\n const prepareResponse = (requestId) => composer.composeResponseInterceptors([\n ...settings.interceptors.map((obj) => obj.response).filter((obj) => obj),\n httpInterceptors.logResponse(requestId)\n ]);\n const prepareResponseErrors = () => composer.composeResponseErrorInterceptors(\n settings.interceptors.map((obj) => obj.responseError).filter((obj) => obj)\n );\n return async (request, unwrapper = asIs) => {\n const requestId = `${requestNumber += 1}`;\n const reqInterceptors = prepareRequest(requestId);\n const finalRequest = await reqInterceptors(buildRequest(request, settings));\n try {\n const response = await httpClient(finalRequest);\n const resInterceptors = prepareResponse(requestId);\n const finalResponse = await resInterceptors(response);\n const resUnmarshaller = responseParser.responseParser(\n unwrapper,\n request.responseType ?? \"json\"\n );\n const unmarshaledResponse = await resUnmarshaller(finalResponse);\n return unmarshaledResponse;\n } catch (err) {\n const resErrorInterceptors = prepareResponseErrors();\n const handledError = await resErrorInterceptors(finalRequest, err);\n return unwrapper(handledError);\n }\n };\n};\nexports.buildFetcher = buildFetcher;\nexports.buildRequest = buildRequest;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst toPascalCase = (str) => str.replace(\n /\\w+/g,\n (word) => `${word[0].toUpperCase()}${word.slice(1).toLowerCase()}`\n);\nconst serializeHeadersEntry = ([name, value]) => `${toPascalCase(name)}: ${value}`;\nconst serializeHeaders = (headers) => Array.from(headers.entries(), serializeHeadersEntry);\nconst dumpRequest = async (request) => [\n `${request.method.toUpperCase()}: ${request.url}`,\n ...serializeHeaders(request.headers),\n await request.clone().text()\n].join(\"\\r\\n\");\nconst dumpResponse = async (response) => [\n `HTTP ${response.status} ${response.ok ? \"OK\" : \"NOK\"}`,\n ...serializeHeaders(response.headers),\n await response.clone().text()\n].join(\"\\r\\n\");\nexports.dumpRequest = dumpRequest;\nexports.dumpResponse = dumpResponse;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst index = require(\"../../internal/logger/index.cjs\");\nconst levelResolver = require(\"../../internal/logger/level-resolver.cjs\");\nconst httpDumper = require(\"./http-dumper.cjs\");\nclass ObfuscatedRequest extends Request {\n constructor(request, obfuscate) {\n super(request);\n this.request = request;\n this.obfuscate = obfuscate;\n }\n get headers() {\n return new Headers(Array.from(this.request.headers, this.obfuscate));\n }\n clone() {\n return new ObfuscatedRequest(this.request, this.obfuscate);\n }\n}\nconst obfuscateInterceptor = (obfuscate) => ({ request }) => new ObfuscatedRequest(request, obfuscate);\nconst identity = ({ request }) => request;\nconst logRequest = (identifier, obfuscate = identity) => async ({ request }) => {\n if (levelResolver.shouldLog(levelResolver.LevelResolver[index.getLogger().logLevel], \"debug\")) {\n index.getLogger().debug(\n `--------------- Scaleway SDK REQUEST ${identifier} ---------------\n${await httpDumper.dumpRequest(await obfuscate({ request }))}\n---------------------------------------------------------`\n );\n }\n return request;\n};\nconst logResponse = (identifier) => async ({ response }) => {\n if (levelResolver.shouldLog(levelResolver.LevelResolver[index.getLogger().logLevel], \"debug\")) {\n index.getLogger().debug(\n `--------------- Scaleway SDK RESPONSE ${identifier} ---------------\n${await httpDumper.dumpResponse(response)}\n---------------------------------------------------------`\n );\n }\n return response;\n};\nexports.logRequest = logRequest;\nexports.logResponse = logResponse;\nexports.obfuscateInterceptor = obfuscateInterceptor;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst extract = (key) => (result) => result[key];\nfunction* pages(key, fetcher, request, firstPage) {\n if (!Array.isArray(firstPage[key])) {\n throw new Error(`Property ${key} is not a list in paginated result`);\n }\n const getList = extract(key);\n let page = request.page || 1;\n if (page === 1) {\n yield Promise.resolve(getList(firstPage));\n page += 1;\n }\n const { length } = firstPage[key];\n if (!length) return;\n const { totalCount } = firstPage;\n while (page <= Math.floor((totalCount + length - 1) / length)) {\n yield fetcher({ ...request, page }).then(getList);\n page += 1;\n }\n}\nasync function* fetchPaginated(key, fetcher, request, initial = fetcher(request)) {\n yield* pages(key, fetcher, request, await initial);\n}\nconst fetchAll = async (key, fetcher, request, initial = fetcher(request)) => (await Promise.all(Array.from(pages(key, fetcher, request, await initial)))).flat();\nconst enrichForPagination = (key, fetcher, request) => {\n const firstPage = fetcher(request);\n return Object.assign(firstPage, {\n all: () => fetchAll(key, fetcher, request, firstPage),\n [Symbol.asyncIterator]: () => fetchPaginated(key, fetcher, request, firstPage)\n });\n};\nexports.enrichForPagination = enrichForPagination;\nexports.extract = extract;\nexports.fetchAll = fetchAll;\nexports.fetchPaginated = fetchPaginated;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nconst isResponse = require(\"../../helpers/is-response.cjs\");\nconst json = require(\"../../helpers/json.cjs\");\nconst errorParser = require(\"../errors/error-parser.cjs\");\nconst scwError = require(\"../errors/scw-error.cjs\");\nconst X_TOTAL_COUNT_HEADER_KEY = \"x-total-count\";\nconst TOTAL_COUNT_RES_KEY = \"total_count\";\nconst fixLegacyTotalCount = (obj, headers) => {\n const headerVal = headers.get(X_TOTAL_COUNT_HEADER_KEY);\n if (!headerVal) {\n return obj;\n }\n const totalCount = parseInt(headerVal, 10);\n if (Number.isNaN(totalCount)) {\n return obj;\n }\n if (json.isJSONObject(obj) && !(TOTAL_COUNT_RES_KEY in obj)) {\n return Object.assign(obj, { [TOTAL_COUNT_RES_KEY]: totalCount });\n }\n return obj;\n};\nconst responseParser = (unmarshaller, responseType) => async (response) => {\n if (!isResponse.isResponse(response)) {\n throw new TypeError(\"Invalid response object\");\n }\n if (response.ok) {\n if (response.status === 204) return unmarshaller(void 0);\n const contentType = response.headers.get(\"Content-Type\");\n try {\n if (responseType === \"json\" && contentType === \"application/json\") {\n return unmarshaller(\n fixLegacyTotalCount(await response.json(), response.headers)\n );\n }\n if (responseType === \"blob\") {\n return unmarshaller(await response.blob());\n }\n return unmarshaller(await response.text());\n } catch (err) {\n throw new scwError.ScalewayError(\n response.status,\n `could not parse '${contentType ?? \"\"}' response${err instanceof Error ? `: ${err.message}` : \"\"}`\n );\n }\n }\n const error = await response.clone().json().catch(() => response.text());\n if (json.isJSONObject(error)) throw errorParser.parseScalewayError(response.status, error);\n throw new scwError.ScalewayError(\n response.status,\n typeof error === \"string\" ? error : \"cannot read error response body\"\n );\n};\nexports.fixLegacyTotalCount = fixLegacyTotalCount;\nexports.responseParser = responseParser;\n","\"use strict\";\nObject.defineProperty(exports, Symbol.toStringTag, { value: \"Module\" });\nvar lookup = [];\nvar code = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i];\n}\nfunction tripletToBase64(num) {\n return lookup[num >> 18 & 63] + lookup[num >> 12 & 63] + lookup[num >> 6 & 63] + lookup[num & 63];\n}\nfunction encodeChunk(uint8, start, end) {\n var tmp;\n var output = [];\n for (var i = start; i < end; i += 3) {\n tmp = (uint8[i] << 16 & 16711680) + (uint8[i + 1] << 8 & 65280) + (uint8[i + 2] & 255);\n output.push(tripletToBase64(tmp));\n }\n return output.join(\"\");\n}\nfunction fromByteArray(uint8) {\n var tmp;\n var len = uint8.length;\n var extraBytes = len % 3;\n var parts = [];\n var maxChunkLength = 16383;\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, i + maxChunkLength > len2 ? len2 : i + maxChunkLength));\n }\n if (extraBytes === 1) {\n tmp = uint8[len - 1];\n parts.push(\n lookup[tmp >> 2] + lookup[tmp << 4 & 63] + \"==\"\n );\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1];\n parts.push(\n lookup[tmp >> 10] + lookup[tmp >> 4 & 63] + lookup[tmp << 2 & 63] + \"=\"\n );\n }\n return parts.join(\"\");\n}\nexports.fromByteArray = fromByteArray;\n","\"use strict\";\nconst ADJECTIVES = [\n \"admiring\",\n \"adoring\",\n \"affectionate\",\n \"agitated\",\n \"amazing\",\n \"angry\",\n \"awesome\",\n \"beautiful\",\n \"blissful\",\n \"bold\",\n \"boring\",\n \"brave\",\n \"busy\",\n \"charming\",\n \"clever\",\n \"cool\",\n \"compassionate\",\n \"competent\",\n \"condescending\",\n \"confident\",\n \"cranky\",\n \"crazy\",\n \"dazzling\",\n \"determined\",\n \"distracted\",\n \"dreamy\",\n \"eager\",\n \"ecstatic\",\n \"elastic\",\n \"elated\",\n \"elegant\",\n \"eloquent\",\n \"epic\",\n \"exciting\",\n \"fervent\",\n \"festive\",\n \"flamboyant\",\n \"focused\",\n \"friendly\",\n \"frosty\",\n \"funny\",\n \"gallant\",\n \"gifted\",\n \"goofy\",\n \"gracious\",\n \"great\",\n \"happy\",\n \"hardcore\",\n \"heuristic\",\n \"hopeful\",\n \"hungry\",\n \"infallible\",\n \"inspiring\",\n \"interesting\",\n \"intelligent\",\n \"jolly\",\n \"jovial\",\n \"keen\",\n \"kind\",\n \"laughing\",\n \"loving\",\n \"lucid\",\n \"magical\",\n \"mystifying\",\n \"modest\",\n \"musing\",\n \"naughty\",\n \"nervous\",\n \"nice\",\n \"nifty\",\n \"nostalgic\",\n \"objective\",\n \"optimistic\",\n \"peaceful\",\n \"pedantic\",\n \"pensive\",\n \"practical\",\n \"priceless\",\n \"quirky\",\n \"quizzical\",\n \"recursing\",\n \"relaxed\",\n \"reverent\",\n \"romantic\",\n \"sad\",\n \"serene\",\n \"sharp\",\n \"silly\",\n \"sleepy\",\n \"stoic\",\n \"strange\",\n \"stupefied\",\n \"suspicious\",\n \"sweet\",\n \"tender\",\n \"thirsty\",\n \"trusting\",\n \"unruffled\",\n \"upbeat\",\n \"vibrant\",\n \"vigilant\",\n \"vigorous\",\n \"wizardly\",\n \"wonderful\",\n \"xenodochial\",\n \"youthful\",\n \"zealous\",\n \"zen\"\n];\nconst NAMES = [\n // Muhammad ibn Jābir al-Ḥarrānī al-Battānī was a founding father of astronomy. https://en.wikipedia.org/wiki/Mu%E1%B8%A5ammad_ibn_J%C4%81bir_al-%E1%B8%A4arr%C4%81n%C4%AB_al-Batt%C4%81n%C4%AB\n \"albattani\",\n // Frances E. Allen, became the first female IBM Fellow in 1989. In 2006, she became the first female recipient of the ACM's Turing Award. https://en.wikipedia.org/wiki/Frances_E._Allen\n \"allen\",\n // June Almeida - Scottish virologist who took the first pictures of the rubella virus - https://en.wikipedia.org/wiki/June_Almeida\n \"almeida\",\n // Kathleen Antonelli, American computer programmer and one of the six original programmers of the ENIAC - https://en.wikipedia.org/wiki/Kathleen_Antonelli\n \"antonelli\",\n // Maria Gaetana Agnesi - Italian mathematician, philosopher, theologian and humanitarian. She was the first woman to write a mathematics handbook and the first woman appointed as a Mathematics Professor at a University. https://en.wikipedia.org/wiki/Maria_Gaetana_Agnesi\n \"agnesi\",\n // Archimedes was a physicist, engineer and mathematician who invented too many things to list them here. https://en.wikipedia.org/wiki/Archimedes\n \"archimedes\",\n // Maria Ardinghelli - Italian translator, mathematician and physicist - https://en.wikipedia.org/wiki/Maria_Ardinghelli\n \"ardinghelli\",\n // Aryabhata - Ancient Indian mathematician-astronomer during 476-550 CE https://en.wikipedia.org/wiki/Aryabhata\n \"aryabhata\",\n // Wanda Austin - Wanda Austin is the President and CEO of The Aerospace Corporation, a leading architect for the US security space programs. https://en.wikipedia.org/wiki/Wanda_Austin\n \"austin\",\n // Charles Babbage invented the concept of a programmable computer. https://en.wikipedia.org/wiki/Charles_Babbage.\n \"babbage\",\n // Stefan Banach - Polish mathematician, was one of the founders of modern functional analysis. https://en.wikipedia.org/wiki/Stefan_Banach\n \"banach\",\n // Buckaroo Banzai and his mentor Dr. Hikita perfected the \"oscillation overthruster\", a device that allows one to pass through solid matter. - https://en.wikipedia.org/wiki/The_Adventures_of_Buckaroo_Banzai_Across_the_8th_Dimension\n \"banzai\",\n // John Bardeen co-invented the transistor - https://en.wikipedia.org/wiki/John_Bardeen\n \"bardeen\",\n // Jean Bartik, born Betty Jean Jennings, was one of the original programmers for the ENIAC computer. https://en.wikipedia.org/wiki/Jean_Bartik\n \"bartik\",\n // Laura Bassi, the world's first female professor https://en.wikipedia.org/wiki/Laura_Bassi\n \"bassi\",\n // Hugh Beaver, British engineer, founder of the Guinness Book of World Records https://en.wikipedia.org/wiki/Hugh_Beaver\n \"beaver\",\n // Alexander Graham Bell - an eminent Scottish-born scientist, inventor, engineer and innovator who is credited with inventing the first practical telephone - https://en.wikipedia.org/wiki/Alexander_Graham_Bell\n \"bell\",\n // Karl Friedrich Benz - a German automobile engineer. Inventor of the first practical motorcar. https://en.wikipedia.org/wiki/Karl_Benz\n \"benz\",\n // Homi J Bhabha - was an Indian nuclear physicist, founding director, and professor of physics at the Tata Institute of Fundamental Research. Colloquially known as \"father of Indian nuclear programme\"- https://en.wikipedia.org/wiki/Homi_J._Bhabha\n \"bhabha\",\n // Bhaskara II - Ancient Indian mathematician-astronomer whose work on calculus predates Newton and Leibniz by over half a millennium - https://en.wikipedia.org/wiki/Bh%C4%81skara_II#Calculus\n \"bhaskara\",\n // Sue Black - British computer scientist and campaigner. She has been instrumental in saving Bletchley Park, the site of World War II codebreaking - https://en.wikipedia.org/wiki/Sue_Black_(computer_scientist)\n \"black\",\n // Elizabeth Helen Blackburn - Australian-American Nobel laureate; best known for co-discovering telomerase. https://en.wikipedia.org/wiki/Elizabeth_Blackburn\n \"blackburn\",\n // Elizabeth Blackwell - American doctor and first American woman to receive a medical degree - https://en.wikipedia.org/wiki/Elizabeth_Blackwell\n \"blackwell\",\n // Niels Bohr is the father of quantum theory. https://en.wikipedia.org/wiki/Niels_Bohr.\n \"bohr\",\n // Kathleen Booth, she's credited with writing the first assembly language. https://en.wikipedia.org/wiki/Kathleen_Booth\n \"booth\",\n // Anita Borg - Anita Borg was the founding director of the Institute for Women and Technology (IWT). https://en.wikipedia.org/wiki/Anita_Borg\n \"borg\",\n // Satyendra Nath Bose - He provided the foundation for Bose–Einstein statistics and the theory of the Bose–Einstein condensate. - https://en.wikipedia.org/wiki/Satyendra_Nath_Bose\n \"bose\",\n // Katherine Louise Bouman is an imaging scientist and Assistant Professor of Computer Science at the California Institute of Technology. She researches computational methods for imaging, and developed an algorithm that made possible the picture first visualization of a black hole using the Event Horizon Telescope. - https://en.wikipedia.org/wiki/Katie_Bouman\n \"bouman\",\n // Evelyn Boyd Granville - She was one of the first African-American woman to receive a Ph.D. in mathematics; she earned it in 1949 from Yale University. https://en.wikipedia.org/wiki/Evelyn_Boyd_Granville\n \"boyd\",\n // Brahmagupta - Ancient Indian mathematician during 598-670 CE who gave rules to compute with zero - https://en.wikipedia.org/wiki/Brahmagupta#Zero\n \"brahmagupta\",\n // Walter Houser Brattain co-invented the transistor - https://en.wikipedia.org/wiki/Walter_Houser_Brattain\n \"brattain\",\n // Emmett Brown invented time travel. https://en.wikipedia.org/wiki/Emmett_Brown (thanks Brian Goff)\n \"brown\",\n // Linda Brown Buck - American biologist and Nobel laureate best known for her genetic and molecular analyses of the mechanisms of smell. https://en.wikipedia.org/wiki/Linda_B._Buck\n \"buck\",\n // Dame Susan Jocelyn Bell Burnell - Northern Irish astrophysicist who discovered radio pulsars and was the first to analyse them. https://en.wikipedia.org/wiki/Jocelyn_Bell_Burnell\n \"burnell\",\n // Annie Jump Cannon - pioneering female astronomer who classified hundreds of thousands of stars and created the system we use to understand stars today. https://en.wikipedia.org/wiki/Annie_Jump_Cannon\n \"cannon\",\n // Rachel Carson - American marine biologist and conservationist, her book Silent Spring and other writings are credited with advancing the global environmental movement. https://en.wikipedia.org/wiki/Rachel_Carson\n \"carson\",\n // Dame Mary Lucy Cartwright - British mathematician who was one of the first to study what is now known as chaos theory. Also known for Cartwright's theorem which finds applications in signal processing. https://en.wikipedia.org/wiki/Mary_Cartwright\n \"cartwright\",\n // George Washington Carver - American agricultural scientist and inventor. He was the most prominent black scientist of the early 20th century. https://en.wikipedia.org/wiki/George_Washington_Carver\n \"carver\",\n // Vinton Gray Cerf - American Internet pioneer, recognised as one of \"the fathers of the Internet\". With Robert Elliot Kahn, he designed TCP and IP, the primary data communication protocols of the Internet and other computer networks. https://en.wikipedia.org/wiki/Vint_Cerf\n \"cerf\",\n // Subrahmanyan Chandrasekhar - Astrophysicist known for his mathematical theory on different stages and evolution in structures of the stars. He has won nobel prize for physics - https://en.wikipedia.org/wiki/Subrahmanyan_Chandrasekhar\n \"chandrasekhar\",\n // Sergey Alexeyevich Chaplygin (Russian: Серге́й Алексе́евич Чаплы́гин; April 5, 1869 – October 8, 1942) was a Russian and Soviet physicist, mathematician, and mechanical engineer. He is known for mathematical formulas such as Chaplygin's equation and for a hypothetical substance in cosmology called Chaplygin gas, named after him. https://en.wikipedia.org/wiki/Sergey_Chaplygin\n \"chaplygin\",\n // Émilie du Châtelet - French natural philosopher, mathematician, physicist, and author during the early 1730s, known for her translation of and commentary on Isaac Newton's book Principia containing basic laws of physics. https://en.wikipedia.org/wiki/%C3%89milie_du_Ch%C3%A2telet\n \"chatelet\",\n // Asima Chatterjee was an Indian organic chemist noted for her research on vinca alkaloids, development of drugs for treatment of epilepsy and malaria - https://en.wikipedia.org/wiki/Asima_Chatterjee\n \"chatterjee\",\n // Pafnuty Chebyshev - Russian mathematician. He is known fo his works on probability, statistics, mechanics, analytical geometry and number theory https://en.wikipedia.org/wiki/Pafnuty_Chebyshev\n \"chebyshev\",\n // Bram Cohen - American computer programmer and author of the BitTorrent peer-to-peer protocol. https://en.wikipedia.org/wiki/Bram_Cohen\n \"cohen\",\n // David Lee Chaum - American computer scientist and cryptographer. Known for his seminal contributions in the field of anonymous communication. https://en.wikipedia.org/wiki/David_Chaum\n \"chaum\",\n // Joan Clarke - Bletchley Park code breaker during the Second World War who pioneered techniques that remained top secret for decades. Also an accomplished numismatist https://en.wikipedia.org/wiki/Joan_Clarke\n \"clarke\",\n // Jane Colden - American botanist widely considered the first female American botanist - https://en.wikipedia.org/wiki/Jane_Colden\n \"colden\",\n // Gerty Theresa Cori - American biochemist who became the third woman—and first American woman—to win a Nobel Prize in science, and the first woman to be awarded the Nobel Prize in Physiology or Medicine. Cori was born in Prague. https://en.wikipedia.org/wiki/Gerty_Cori\n \"cori\",\n // Seymour Roger Cray was an American electrical engineer and supercomputer architect who designed a series of computers that were the fastest in the world for decades. https://en.wikipedia.org/wiki/Seymour_Cray\n \"cray\",\n // This entry reflects a husband and wife team who worked together:\n // Joan Curran was a Welsh scientist who developed radar and invented chaff, a radar countermeasure. https://en.wikipedia.org/wiki/Joan_Curran\n // Samuel Curran was an Irish physicist who worked alongside his wife during WWII and invented the proximity fuse. https://en.wikipedia.org/wiki/Samuel_Curran\n \"curran\",\n // Marie Curie discovered radioactivity. https://en.wikipedia.org/wiki/Marie_Curie.\n \"curie\",\n // Charles Darwin established the principles of natural evolution. https://en.wikipedia.org/wiki/Charles_Darwin.\n \"darwin\",\n // Leonardo Da Vinci invented too many things to list here. https://en.wikipedia.org/wiki/Leonardo_da_Vinci.\n \"davinci\",\n // A. K. (Alexander Keewatin) Dewdney, Canadian mathematician, computer scientist, author and filmmaker. Contributor to Scientific American's \"Computer Recreations\" from 1984 to 1991. Author of Core War (program), The Planiverse, The Armchair Universe, The Magic Machine, The New Turing Omnibus, and more. https://en.wikipedia.org/wiki/Alexander_Dewdney\n \"dewdney\",\n // Satish Dhawan - Indian mathematician and aerospace engineer, known for leading the successful and indigenous development of the Indian space programme. https://en.wikipedia.org/wiki/Satish_Dhawan\n \"dhawan\",\n // Bailey Whitfield Diffie - American cryptographer and one of the pioneers of public-key cryptography. https://en.wikipedia.org/wiki/Whitfield_Diffie\n \"diffie\",\n // Edsger Wybe Dijkstra was a Dutch computer scientist and mathematical scientist. https://en.wikipedia.org/wiki/Edsger_W._Dijkstra.\n \"dijkstra\",\n // Paul Adrien Maurice Dirac - English theoretical physicist who made fundamental contributions to the early development of both quantum mechanics and quantum electrodynamics. https://en.wikipedia.org/wiki/Paul_Dirac\n \"dirac\",\n // Agnes Meyer Driscoll - American cryptanalyst during World Wars I and II who successfully cryptanalysed a number of Japanese ciphers. She was also the co-developer of one of the cipher machines of the US Navy, the CM. https://en.wikipedia.org/wiki/Agnes_Meyer_Driscoll\n \"driscoll\",\n // Donna Dubinsky - played an integral role in the development of personal digital assistants (PDAs) serving as CEO of Palm, Inc. and co-founding Handspring. https://en.wikipedia.org/wiki/Donna_Dubinsky\n \"dubinsky\",\n // Annie Easley - She was a leading member of the team which developed software for the Centaur rocket stage and one of the first African-Americans in her field. https://en.wikipedia.org/wiki/Annie_Easley\n \"easley\",\n // Thomas Alva Edison, prolific inventor https://en.wikipedia.org/wiki/Thomas_Edison\n \"edison\",\n // Albert Einstein invented the general theory of relativity. https://en.wikipedia.org/wiki/Albert_Einstein\n \"einstein\",\n // Alexandra Asanovna Elbakyan (Russian: Алекса́ндра Аса́новна Элбакя́н) is a Kazakhstani graduate student, computer programmer, internet pirate in hiding, and the creator of the site Sci-Hub. Nature has listed her in 2016 in the top ten people that mattered in science, and Ars Technica has compared her to Aaron Swartz. - https://en.wikipedia.org/wiki/Alexandra_Elbakyan\n \"elbakyan\",\n // Taher A. ElGamal - Egyptian cryptographer best known for the ElGamal discrete log cryptosystem and the ElGamal digital signature scheme. https://en.wikipedia.org/wiki/Taher_Elgamal\n \"elgamal\",\n // Gertrude Elion - American biochemist, pharmacologist and the 1988 recipient of the Nobel Prize in Medicine - https://en.wikipedia.org/wiki/Gertrude_Elion\n \"elion\",\n // James Henry Ellis - British engineer and cryptographer employed by the GCHQ. Best known for conceiving for the first time, the idea of public-key cryptography. https://en.wikipedia.org/wiki/James_H._Ellis\n \"ellis\",\n // Douglas Engelbart gave the mother of all demos: https://en.wikipedia.org/wiki/Douglas_Engelbart\n \"engelbart\",\n // Euclid invented geometry. https://en.wikipedia.org/wiki/Euclid\n \"euclid\",\n // Leonhard Euler invented large parts of modern mathematics. https://de.wikipedia.org/wiki/Leonhard_Euler\n \"euler\",\n // Michael Faraday - British scientist who contributed to the study of electromagnetism and electrochemistry. https://en.wikipedia.org/wiki/Michael_Faraday\n \"faraday\",\n // Horst Feistel - German-born American cryptographer who was one of the earliest non-government researchers to study the design and theory of block ciphers. Co-developer of DES and Lucifer. Feistel networks, a symmetric structure used in the construction of block ciphers are named after him. https://en.wikipedia.org/wiki/Horst_Feistel\n \"feistel\",\n // Pierre de Fermat pioneered several aspects of modern mathematics. https://en.wikipedia.org/wiki/Pierre_de_Fermat\n \"fermat\",\n // Enrico Fermi invented the first nuclear reactor. https://en.wikipedia.org/wiki/Enrico_Fermi.\n \"fermi\",\n // Richard Feynman was a key contributor to quantum mechanics and particle physics. https://en.wikipedia.org/wiki/Richard_Feynman\n \"feynman\",\n // Benjamin Franklin is famous for his experiments in electricity and the invention of the lightning rod.\n \"franklin\",\n // Yuri Alekseyevich Gagarin - Soviet pilot and cosmonaut, best known as the first human to journey into outer space. https://en.wikipedia.org/wiki/Yuri_Gagarin\n \"gagarin\",\n // Galileo was a founding father of modern astronomy, and faced politics and obscurantism to establish scientific truth. https://en.wikipedia.org/wiki/Galileo_Galilei\n \"galileo\",\n // Évariste Galois - French mathematician whose work laid the foundations of Galois theory and group theory, two major branches of abstract algebra, and the subfield of Galois connections, all while still in his late teens. https://en.wikipedia.org/wiki/%C3%89variste_Galois\n \"galois\",\n // Kadambini Ganguly - Indian physician, known for being the first South Asian female physician, trained in western medicine, to graduate in South Asia. https://en.wikipedia.org/wiki/Kadambini_Ganguly\n \"ganguly\",\n // William Henry \"Bill\" Gates III is an American business magnate, philanthropist, investor, computer programmer, and inventor. https://en.wikipedia.org/wiki/Bill_Gates\n \"gates\",\n // Johann Carl Friedrich Gauss - German mathematician who made significant contributions to many fields, including number theory, algebra, statistics, analysis, differential geometry, geodesy, geophysics, mechanics, electrostatics, magnetic fields, astronomy, matrix theory, and optics. https://en.wikipedia.org/wiki/Carl_Friedrich_Gauss\n \"gauss\",\n // Marie-Sophie Germain - French mathematician, physicist and philosopher. Known for her work on elasticity theory, number theory and philosophy. https://en.wikipedia.org/wiki/Sophie_Germain\n \"germain\",\n // Adele Goldberg, was one of the designers and developers of the Smalltalk language. https://en.wikipedia.org/wiki/Adele_Goldberg_(computer_scientist)\n \"goldberg\",\n // Adele Goldstine, born Adele Katz, wrote the complete technical description for the first electronic digital computer, ENIAC. https://en.wikipedia.org/wiki/Adele_Goldstine\n \"goldstine\",\n // Shafi Goldwasser is a computer scientist known for creating theoretical foundations of modern cryptography. Winner of 2012 ACM Turing Award. https://en.wikipedia.org/wiki/Shafi_Goldwasser\n \"goldwasser\",\n // James Golick, all around gangster.\n \"golick\",\n // Jane Goodall - British primatologist, ethologist, and anthropologist who is considered to be the world's foremost expert on chimpanzees - https://en.wikipedia.org/wiki/Jane_Goodall\n \"goodall\",\n // Stephen Jay Gould was was an American paleontologist, evolutionary biologist, and historian of science. He is most famous for the theory of punctuated equilibrium - https://en.wikipedia.org/wiki/Stephen_Jay_Gould\n \"gould\",\n // Carolyn Widney Greider - American molecular biologist and joint winner of the 2009 Nobel Prize for Physiology or Medicine for the discovery of telomerase. https://en.wikipedia.org/wiki/Carol_W._Greider\n \"greider\",\n // Alexander Grothendieck - German-born French mathematician who became a leading figure in the creation of modern algebraic geometry. https://en.wikipedia.org/wiki/Alexander_Grothendieck\n \"grothendieck\",\n // Lois Haibt - American computer scientist, part of the team at IBM that developed FORTRAN - https://en.wikipedia.org/wiki/Lois_Haibt\n \"haibt\",\n // Margaret Hamilton - Director of the Software Engineering Division of the MIT Instrumentation Laboratory, which developed on-board flight software for the Apollo space program. https://en.wikipedia.org/wiki/Margaret_Hamilton_(scientist)\n \"hamilton\",\n // Caroline Harriet Haslett - English electrical engineer, electricity industry administrator and champion of women's rights. Co-author of British Standard 1363 that specifies AC power plugs and sockets used across the United Kingdom (which is widely considered as one of the safest designs). https://en.wikipedia.org/wiki/Caroline_Haslett\n \"haslett\",\n // Stephen Hawking pioneered the field of cosmology by combining general relativity and quantum mechanics. https://en.wikipedia.org/wiki/Stephen_Hawking\n \"hawking\",\n // Martin Edward Hellman - American cryptologist, best known for his invention of public-key cryptography in co-operation with Whitfield Diffie and Ralph Merkle. https://en.wikipedia.org/wiki/Martin_Hellman\n \"hellman\",\n // Werner Heisenberg was a founding father of quantum mechanics. https://en.wikipedia.org/wiki/Werner_Heisenberg\n \"heisenberg\",\n // Grete Hermann was a German philosopher noted for her philosophical work on the foundations of quantum mechanics. https://en.wikipedia.org/wiki/Grete_Hermann\n \"hermann\",\n // Caroline Lucretia Herschel - German astronomer and discoverer of several comets. https://en.wikipedia.org/wiki/Caroline_Herschel\n \"herschel\",\n // Heinrich Rudolf Hertz - German physicist who first conclusively proved the existence of the electromagnetic waves. https://en.wikipedia.org/wiki/Heinrich_Hertz\n \"hertz\",\n // Jaroslav Heyrovský was the inventor of the polarographic method, father of the electroanalytical method, and recipient of the Nobel Prize in 1959. His main field of work was polarography. https://en.wikipedia.org/wiki/Jaroslav_Heyrovsk%C3%BD\n \"heyrovsky\",\n // Dorothy Hodgkin was a British biochemist, credited with the development of protein crystallography. She was awarded the Nobel Prize in Chemistry in 1964. https://en.wikipedia.org/wiki/Dorothy_Hodgkin\n \"hodgkin\",\n // Douglas R. Hofstadter is an American professor of cognitive science and author of the Pulitzer Prize and American Book Award-winning work Goedel, Escher, Bach: An Eternal Golden Braid in 1979. A mind-bending work which coined Hofstadter's Law: \"It always takes longer than you expect, even when you take into account Hofstadter's Law.\" https://en.wikipedia.org/wiki/Douglas_Hofstadter\n \"hofstadter\",\n // Erna Schneider Hoover revolutionized modern communication by inventing a computerized telephone switching method. https://en.wikipedia.org/wiki/Erna_Schneider_Hoover\n \"hoover\",\n // Grace Hopper developed the first compiler for a computer programming language and is credited with popularizing the term \"debugging\" for fixing computer glitches. https://en.wikipedia.org/wiki/Grace_Hopper\n \"hopper\",\n // Frances Hugle, she was an American scientist, engineer, and inventor who contributed to the understanding of semiconductors, integrated circuitry, and the unique electrical principles of microscopic materials. https://en.wikipedia.org/wiki/Frances_Hugle\n \"hugle\",\n // Hypatia - Greek Alexandrine Neoplatonist philosopher in Egypt who was one of the earliest mothers of mathematics - https://en.wikipedia.org/wiki/Hypatia\n \"hypatia\",\n // Teruko Ishizaka - Japanese scientist and immunologist who co-discovered the antibody class Immunoglobulin E. https://en.wikipedia.org/wiki/Teruko_Ishizaka\n \"ishizaka\",\n // Mary Jackson, American mathematician and aerospace engineer who earned the highest title within NASA's engineering department - https://en.wikipedia.org/wiki/Mary_Jackson_(engineer)\n \"jackson\",\n // Yeong-Sil Jang was a Korean scientist and astronomer during the Joseon Dynasty; he invented the first metal printing press and water gauge. https://en.wikipedia.org/wiki/Jang_Yeong-sil\n \"jang\",\n // Mae Carol Jemison - is an American engineer, physician, and former NASA astronaut. She became the first black woman to travel in space when she served as a mission specialist aboard the Space Shuttle Endeavour - https://en.wikipedia.org/wiki/Mae_Jemison\n \"jemison\",\n // Betty Jennings - one of the original programmers of the ENIAC. https://en.wikipedia.org/wiki/ENIAC - https://en.wikipedia.org/wiki/Jean_Bartik\n \"jennings\",\n // Mary Lou Jepsen, was the founder and chief technology officer of One Laptop Per Child (OLPC), and the founder of Pixel Qi. https://en.wikipedia.org/wiki/Mary_Lou_Jepsen\n \"jepsen\",\n // Katherine Coleman Goble Johnson - American physicist and mathematician contributed to the NASA. https://en.wikipedia.org/wiki/Katherine_Johnson\n \"johnson\",\n // Irène Joliot-Curie - French scientist who was awarded the Nobel Prize for Chemistry in 1935. Daughter of Marie and Pierre Curie. https://en.wikipedia.org/wiki/Ir%C3%A8ne_Joliot-Curie\n \"joliot\",\n // Karen Spärck Jones came up with the concept of inverse document frequency, which is used in most search engines today. https://en.wikipedia.org/wiki/Karen_Sp%C3%A4rck_Jones\n \"jones\",\n // A. P. J. Abdul Kalam - is an Indian scientist aka Missile Man of India for his work on the development of ballistic missile and launch vehicle technology - https://en.wikipedia.org/wiki/A._P._J._Abdul_Kalam\n \"kalam\",\n // Sergey Petrovich Kapitsa (Russian: Серге́й Петро́вич Капи́ца; 14 February 1928 – 14 August 2012) was a Russian physicist and demographer. He was best known as host of the popular and long-running Russian scientific TV show, Evident, but Incredible. His father was the Nobel laureate Soviet-era physicist Pyotr Kapitsa, and his brother was the geographer and Antarctic explorer Andrey Kapitsa. - https://en.wikipedia.org/wiki/Sergey_Kapitsa\n \"kapitsa\",\n // Susan Kare, created the icons and many of the interface elements for the original Apple Macintosh in the 1980s, and was an original employee of NeXT, working as the Creative Director. https://en.wikipedia.org/wiki/Susan_Kare\n \"kare\",\n // Mstislav Keldysh - a Soviet scientist in the field of mathematics and mechanics, academician of the USSR Academy of Sciences (1946), President of the USSR Academy of Sciences (1961–1975), three times Hero of Socialist Labor (1956, 1961, 1971), fellow of the Royal Society of Edinburgh (1968). https://en.wikipedia.org/wiki/Mstislav_Keldysh\n \"keldysh\",\n // Mary Kenneth Keller, Sister Mary Kenneth Keller became the first American woman to earn a PhD in Computer Science in 1965. https://en.wikipedia.org/wiki/Mary_Kenneth_Keller\n \"keller\",\n // Johannes Kepler, German astronomer known for his three laws of planetary motion - https://en.wikipedia.org/wiki/Johannes_Kepler\n \"kepler\",\n // Omar Khayyam - Persian mathematician, astronomer and poet. Known for his work on the classification and solution of cubic equations, for his contribution to the understanding of Euclid's fifth postulate and for computing the length of a year very accurately. https://en.wikipedia.org/wiki/Omar_Khayyam\n \"khayyam\",\n // Har Gobind Khorana - Indian-American biochemist who shared the 1968 Nobel Prize for Physiology - https://en.wikipedia.org/wiki/Har_Gobind_Khorana\n \"khorana\",\n // Jack Kilby invented silicon integrated circuits and gave Silicon Valley its name. - https://en.wikipedia.org/wiki/Jack_Kilby\n \"kilby\",\n // Maria Kirch - German astronomer and first woman to discover a comet - https://en.wikipedia.org/wiki/Maria_Margarethe_Kirch\n \"kirch\",\n // Donald Knuth - American computer scientist, author of \"The Art of Computer Programming\" and creator of the TeX typesetting system. https://en.wikipedia.org/wiki/Donald_Knuth\n \"knuth\",\n // Sophie Kowalevski - Russian mathematician responsible for important original contributions to analysis, differential equations and mechanics - https://en.wikipedia.org/wiki/Sofia_Kovalevskaya\n \"kowalevski\",\n // Marie-Jeanne de Lalande - French astronomer, mathematician and cataloguer of stars - https://en.wikipedia.org/wiki/Marie-Jeanne_de_Lalande\n \"lalande\",\n // Hedy Lamarr - Actress and inventor. The principles of her work are now incorporated into modern Wi-Fi, CDMA and Bluetooth technology. https://en.wikipedia.org/wiki/Hedy_Lamarr\n \"lamarr\",\n // Leslie B. Lamport - American computer scientist. Lamport is best known for his seminal work in distributed systems and was the winner of the 2013 Turing Award. https://en.wikipedia.org/wiki/Leslie_Lamport\n \"lamport\",\n // Mary Leakey - British paleoanthropologist who discovered the first fossilized Proconsul skull - https://en.wikipedia.org/wiki/Mary_Leakey\n \"leakey\",\n // Henrietta Swan Leavitt - she was an American astronomer who discovered the relation between the luminosity and the period of Cepheid variable stars. https://en.wikipedia.org/wiki/Henrietta_Swan_Leavitt\n \"leavitt\",\n // Esther Miriam Zimmer Lederberg - American microbiologist and a pioneer of bacterial genetics. https://en.wikipedia.org/wiki/Esther_Lederberg\n \"lederberg\",\n // Inge Lehmann - Danish seismologist and geophysicist. Known for discovering in 1936 that the Earth has a solid inner core inside a molten outer core. https://en.wikipedia.org/wiki/Inge_Lehmann\n \"lehmann\",\n // Daniel Lewin - Mathematician, Akamai co-founder, soldier, 9/11 victim-- Developed optimization techniques for routing traffic on the internet. Died attempting to stop the 9-11 hijackers. https://en.wikipedia.org/wiki/Daniel_Lewin\n \"lewin\",\n // Ruth Lichterman - one of the original programmers of the ENIAC. https://en.wikipedia.org/wiki/ENIAC - https://en.wikipedia.org/wiki/Ruth_Teitelbaum\n \"lichterman\",\n // Barbara Liskov - co-developed the Liskov substitution principle. Liskov was also the winner of the Turing Prize in 2008. - https://en.wikipedia.org/wiki/Barbara_Liskov\n \"liskov\",\n // Ada Lovelace invented the first algorithm. https://en.wikipedia.org/wiki/Ada_Lovelace (thanks James Turnbull)\n \"lovelace\",\n // Auguste and Louis Lumière - the first filmmakers in history - https://en.wikipedia.org/wiki/Auguste_and_Louis_Lumi%C3%A8re\n \"lumiere\",\n // Mahavira - Ancient Indian mathematician during 9th century AD who discovered basic algebraic identities - https://en.wikipedia.org/wiki/Mah%C4%81v%C4%ABra_(mathematician)\n \"mahavira\",\n // Lynn Margulis (b. Lynn Petra Alexander) - an American evolutionary theorist and biologist, science author, educator, and popularizer, and was the primary modern proponent for the significance of symbiosis in evolution. - https://en.wikipedia.org/wiki/Lynn_Margulis\n \"margulis\",\n // Yukihiro Matsumoto - Japanese computer scientist and software programmer best known as the chief designer of the Ruby programming language. https://en.wikipedia.org/wiki/Yukihiro_Matsumoto\n \"matsumoto\",\n // James Clerk Maxwell - Scottish physicist, best known for his formulation of electromagnetic theory. https://en.wikipedia.org/wiki/James_Clerk_Maxwell\n \"maxwell\",\n // Maria Mayer - American theoretical physicist and Nobel laureate in Physics for proposing the nuclear shell model of the atomic nucleus - https://en.wikipedia.org/wiki/Maria_Mayer\n \"mayer\",\n // John McCarthy invented LISP: https://en.wikipedia.org/wiki/John_McCarthy_(computer_scientist)\n \"mccarthy\",\n // Barbara McClintock - a distinguished American cytogeneticist, 1983 Nobel Laureate in Physiology or Medicine for discovering transposons. https://en.wikipedia.org/wiki/Barbara_McClintock\n \"mcclintock\",\n // Anne Laura Dorinthea McLaren - British developmental biologist whose work helped lead to human in-vitro fertilisation. https://en.wikipedia.org/wiki/Anne_McLaren\n \"mclaren\",\n // Malcolm McLean invented the modern shipping container: https://en.wikipedia.org/wiki/Malcom_McLean\n \"mclean\",\n // Kay McNulty - one of the original programmers of the ENIAC. https://en.wikipedia.org/wiki/ENIAC - https://en.wikipedia.org/wiki/Kathleen_Antonelli\n \"mcnulty\",\n // Gregor Johann Mendel - Czech scientist and founder of genetics. https://en.wikipedia.org/wiki/Gregor_Mendel\n \"mendel\",\n // Dmitri Mendeleev - a chemist and inventor. He formulated the Periodic Law, created a farsighted version of the periodic table of elements, and used it to correct the properties of some already discovered elements and also to predict the properties of eight elements yet to be discovered. https://en.wikipedia.org/wiki/Dmitri_Mendeleev\n \"mendeleev\",\n // Lise Meitner - Austrian/Swedish physicist who was involved in the discovery of nuclear fission. The element meitnerium is named after her - https://en.wikipedia.org/wiki/Lise_Meitner\n \"meitner\",\n // Carla Meninsky, was the game designer and programmer for Atari 2600 games Dodge 'Em and Warlords. https://en.wikipedia.org/wiki/Carla_Meninsky\n \"meninsky\",\n // Ralph C. Merkle - American computer scientist, known for devising Merkle's puzzles - one of the very first schemes for public-key cryptography. Also, inventor of Merkle trees and co-inventor of the Merkle-Damgård construction for building collision-resistant cryptographic hash functions and the Merkle-Hellman knapsack cryptosystem. https://en.wikipedia.org/wiki/Ralph_Merkle\n \"merkle\",\n // Johanna Mestorf - German prehistoric archaeologist and first female museum director in Germany - https://en.wikipedia.org/wiki/Johanna_Mestorf\n \"mestorf\",\n // Maryam Mirzakhani - an Iranian mathematician and the first woman to win the Fields Medal. https://en.wikipedia.org/wiki/Maryam_Mirzakhani\n \"mirzakhani\",\n // Rita Levi-Montalcini - Won Nobel Prize in Physiology or Medicine jointly with colleague Stanley Cohen for the discovery of nerve growth factor (https://en.wikipedia.org/wiki/Rita_Levi-Montalcini)\n \"montalcini\",\n // Gordon Earle Moore - American engineer, Silicon Valley founding father, author of Moore's law. https://en.wikipedia.org/wiki/Gordon_Moore\n \"moore\",\n // Samuel Morse - contributed to the invention of a single-wire telegraph system based on European telegraphs and was a co-developer of the Morse code - https://en.wikipedia.org/wiki/Samuel_Morse\n \"morse\",\n // Ian Murdock - founder of the Debian project - https://en.wikipedia.org/wiki/Ian_Murdock\n \"murdock\",\n // May-Britt Moser - Nobel prize winner neuroscientist who contributed to the discovery of grid cells in the brain. https://en.wikipedia.org/wiki/May-Britt_Moser\n \"moser\",\n // John Napier of Merchiston - Scottish landowner known as an astronomer, mathematician and physicist. Best known for his discovery of logarithms. https://en.wikipedia.org/wiki/John_Napier\n \"napier\",\n // John Forbes Nash, Jr. - American mathematician who made fundamental contributions to game theory, differential geometry, and the study of partial differential equations. https://en.wikipedia.org/wiki/John_Forbes_Nash_Jr.\n \"nash\",\n // John von Neumann - todays computer architectures are based on the von Neumann architecture. https://en.wikipedia.org/wiki/Von_Neumann_architecture\n \"neumann\",\n // Isaac Newton invented classic mechanics and modern optics. https://en.wikipedia.org/wiki/Isaac_Newton\n \"newton\",\n // Xavier Niel - ;) https://en.wikipedia.org/wiki/Xavier_Niel\n \"niel\",\n // Florence Nightingale, more prominently known as a nurse, was also the first female member of the Royal Statistical Society and a pioneer in statistical graphics https://en.wikipedia.org/wiki/Florence_Nightingale#Statistics_and_sanitary_reform\n \"nightingale\",\n // Alfred Nobel - a Swedish chemist, engineer, innovator, and armaments manufacturer (inventor of dynamite) - https://en.wikipedia.org/wiki/Alfred_Nobel\n \"nobel\",\n // Emmy Noether, German mathematician. Noether's Theorem is named after her. https://en.wikipedia.org/wiki/Emmy_Noether\n \"noether\",\n // Poppy Northcutt. Poppy Northcutt was the first woman to work as part of NASA’s Mission Control. http://www.businessinsider.com/poppy-northcutt-helped-apollo-astronauts-2014-12?op=1\n \"northcutt\",\n // Robert Noyce invented silicon integrated circuits and gave Silicon Valley its name. - https://en.wikipedia.org/wiki/Robert_Noyce\n \"noyce\",\n // Panini - Ancient Indian linguist and grammarian from 4th century CE who worked on the world's first formal system - https://en.wikipedia.org/wiki/P%C4%81%E1%B9%87ini#Comparison_with_modern_formal_systems\n \"panini\",\n // Ambroise Pare invented modern surgery. https://en.wikipedia.org/wiki/Ambroise_Par%C3%A9\n \"pare\",\n // Blaise Pascal, French mathematician, physicist, and inventor - https://en.wikipedia.org/wiki/Blaise_Pascal\n \"pascal\",\n // Louis Pasteur discovered vaccination, fermentation and pasteurization. https://en.wikipedia.org/wiki/Louis_Pasteur.\n \"pasteur\",\n // Cecilia Payne-Gaposchkin was an astronomer and astrophysicist who, in 1925, proposed in her Ph.D. thesis an explanation for the composition of stars in terms of the relative abundances of hydrogen and helium. https://en.wikipedia.org/wiki/Cecilia_Payne-Gaposchkin\n \"payne\",\n // Radia Perlman is a software designer and network engineer and most famous for her invention of the spanning-tree protocol (STP). https://en.wikipedia.org/wiki/Radia_Perlman\n \"perlman\",\n // Rob Pike was a key contributor to Unix, Plan 9, the X graphic system, utf-8, and the Go programming language. https://en.wikipedia.org/wiki/Rob_Pike\n \"pike\",\n // Henri Poincaré made fundamental contributions in several fields of mathematics. https://en.wikipedia.org/wiki/Henri_Poincar%C3%A9\n \"poincare\",\n // Laura Poitras is a director and producer whose work, made possible by open source crypto tools, advances the causes of truth and freedom of information by reporting disclosures by whistleblowers such as Edward Snowden. https://en.wikipedia.org/wiki/Laura_Poitras\n \"poitras\",\n // Tat’yana Avenirovna Proskuriakova (Russian: Татья́на Авени́ровна Проскуряко́ва) (January 23 [O.S. January 10] 1909 – August 30, 1985) was a Russian-American Mayanist scholar and archaeologist who contributed significantly to the deciphering of Maya hieroglyphs, the writing system of the pre-Columbian Maya civilization of Mesoamerica. https://en.wikipedia.org/wiki/Tatiana_Proskouriakoff\n \"proskuriakova\",\n // Claudius Ptolemy - a Greco-Egyptian writer of Alexandria, known as a mathematician, astronomer, geographer, astrologer, and poet of a single epigram in the Greek Anthology - https://en.wikipedia.org/wiki/Ptolemy\n \"ptolemy\",\n // C. V. Raman - Indian physicist who won the Nobel Prize in 1930 for proposing the Raman effect. - https://en.wikipedia.org/wiki/C._V._Raman\n \"raman\",\n // Srinivasa Ramanujan - Indian mathematician and autodidact who made extraordinary contributions to mathematical analysis, number theory, infinite series, and continued fractions. - https://en.wikipedia.org/wiki/Srinivasa_Ramanujan\n \"ramanujan\",\n // Sally Kristen Ride was an American physicist and astronaut. She was the first American woman in space, and the youngest American astronaut. https://en.wikipedia.org/wiki/Sally_Ride\n \"ride\",\n // Dennis Ritchie - co-creator of UNIX and the C programming language. - https://en.wikipedia.org/wiki/Dennis_Ritchie\n \"ritchie\",\n // Ida Rhodes - American pioneer in computer programming, designed the first computer used for Social Security. https://en.wikipedia.org/wiki/Ida_Rhodes\n \"rhodes\",\n // Julia Hall Bowman Robinson - American mathematician renowned for her contributions to the fields of computability theory and computational complexity theory. https://en.wikipedia.org/wiki/Julia_Robinson\n \"robinson\",\n // Wilhelm Conrad Röntgen - German physicist who was awarded the first Nobel Prize in Physics in 1901 for the discovery of X-rays (Röntgen rays). https://en.wikipedia.org/wiki/Wilhelm_R%C3%B6ntgen\n \"roentgen\",\n // Rosalind Franklin - British biophysicist and X-ray crystallographer whose research was critical to the understanding of DNA - https://en.wikipedia.org/wiki/Rosalind_Franklin\n \"rosalind\",\n // Vera Rubin - American astronomer who pioneered work on galaxy rotation rates. https://en.wikipedia.org/wiki/Vera_Rubin\n \"rubin\",\n // Meghnad Saha - Indian astrophysicist best known for his development of the Saha equation, used to describe chemical and physical conditions in stars - https://en.wikipedia.org/wiki/Meghnad_Saha\n \"saha\",\n // Jean E. Sammet developed FORMAC, the first widely used computer language for symbolic manipulation of mathematical formulas. https://en.wikipedia.org/wiki/Jean_E._Sammet\n \"sammet\",\n // Mildred Sanderson - American mathematician best known for Sanderson's theorem concerning modular invariants. https://en.wikipedia.org/wiki/Mildred_Sanderson\n \"sanderson\",\n // Satoshi Nakamoto is the name used by the unknown person or group of people who developed bitcoin, authored the bitcoin white paper, and created and deployed bitcoin's original reference implementation. https://en.wikipedia.org/wiki/Satoshi_Nakamoto\n \"satoshi\",\n // Adi Shamir - Israeli cryptographer whose numerous inventions and contributions to cryptography include the Ferge Fiat Shamir identification scheme, the Rivest Shamir Adleman (RSA) public-key cryptosystem, the Shamir's secret sharing scheme, the breaking of the Merkle-Hellman cryptosystem, the TWINKLE and TWIRL factoring devices and the discovery of differential cryptanalysis (with Eli Biham). https://en.wikipedia.org/wiki/Adi_Shamir\n \"shamir\",\n // Claude Shannon - The father of information theory and founder of digital circuit design theory. (https://en.wikipedia.org/wiki/Claude_Shannon)\n \"shannon\",\n // Carol Shaw - Originally an Atari employee, Carol Shaw is said to be the first female video game designer. https://en.wikipedia.org/wiki/Carol_Shaw_(video_game_designer)\n \"shaw\",\n // Dame Stephanie \"Steve\" Shirley - Founded a software company in 1962 employing women working from home. https://en.wikipedia.org/wiki/Steve_Shirley\n \"shirley\",\n // William Shockley co-invented the transistor - https://en.wikipedia.org/wiki/William_Shockley\n \"shockley\",\n // Lina Solomonovna Stern (or Shtern; Russian: Лина Соломоновна Штерн; 26 August 1878 – 7 March 1968) was a Soviet biochemist, physiologist and humanist whose medical discoveries saved thousands of lives at the fronts of World War II. She is best known for her pioneering work on blood–brain barrier, which she described as hemato-encephalic barrier in 1921. https://en.wikipedia.org/wiki/Lina_Stern\n \"shtern\",\n // Françoise Barré-Sinoussi - French virologist and Nobel Prize Laureate in Physiology or Medicine; her work was fundamental in identifying HIV as the cause of AIDS. https://en.wikipedia.org/wiki/Fran%C3%A7oise_Barr%C3%A9-Sinoussi\n \"sinoussi\",\n // Betty Snyder - one of the original programmers of the ENIAC. https://en.wikipedia.org/wiki/ENIAC - https://en.wikipedia.org/wiki/Betty_Holberton\n \"snyder\",\n // Cynthia Solomon - Pioneer in the fields of artificial intelligence, computer science and educational computing. Known for creation of Logo, an educational programming language. https://en.wikipedia.org/wiki/Cynthia_Solomon\n \"solomon\",\n // Frances Spence - one of the original programmers of the ENIAC. https://en.wikipedia.org/wiki/ENIAC - https://en.wikipedia.org/wiki/Frances_Spence\n \"spence\",\n // Michael Stonebraker is a database research pioneer and architect of Ingres, Postgres, VoltDB and SciDB. Winner of 2014 ACM Turing Award. https://en.wikipedia.org/wiki/Michael_Stonebraker\n \"stonebraker\",\n // Ivan Edward Sutherland - American computer scientist and Internet pioneer, widely regarded as the father of computer graphics. https://en.wikipedia.org/wiki/Ivan_Sutherland\n \"sutherland\",\n // Janese Swanson (with others) developed the first of the Carmen Sandiego games. She went on to found Girl Tech. https://en.wikipedia.org/wiki/Janese_Swanson\n \"swanson\",\n // Aaron Swartz was influential in creating RSS, Markdown, Creative Commons, Reddit, and much of the internet as we know it today. He was devoted to freedom of information on the web. https://en.wikiquote.org/wiki/Aaron_Swartz\n \"swartz\",\n // Bertha Swirles was a theoretical physicist who made a number of contributions to early quantum theory. https://en.wikipedia.org/wiki/Bertha_Swirles\n \"swirles\",\n // Helen Brooke Taussig - American cardiologist and founder of the field of paediatric cardiology. https://en.wikipedia.org/wiki/Helen_B._Taussig\n \"taussig\",\n // Valentina Tereshkova is a Russian engineer, cosmonaut and politician. She was the first woman to fly to space in 1963. In 2013, at the age of 76, she offered to go on a one-way mission to Mars. https://en.wikipedia.org/wiki/Valentina_Tereshkova\n \"tereshkova\",\n // Nikola Tesla invented the AC electric system and every gadget ever used by a James Bond villain. https://en.wikipedia.org/wiki/Nikola_Tesla\n \"tesla\",\n // Marie Tharp - American geologist and oceanic cartographer who co-created the first scientific map of the Atlantic Ocean floor. Her work led to the acceptance of the theories of plate tectonics and continental drift. https://en.wikipedia.org/wiki/Marie_Tharp\n \"tharp\",\n // Ken Thompson - co-creator of UNIX and the C programming language - https://en.wikipedia.org/wiki/Ken_Thompson\n \"thompson\",\n // Linus Torvalds invented Linux and Git. https://en.wikipedia.org/wiki/Linus_Torvalds\n \"torvalds\",\n // Youyou Tu - Chinese pharmaceutical chemist and educator known for discovering artemisinin and dihydroartemisinin, used to treat malaria, which has saved millions of lives. Joint winner of the 2015 Nobel Prize in Physiology or Medicine. https://en.wikipedia.org/wiki/Tu_Youyou\n \"tu\",\n // Alan Turing was a founding father of computer science. https://en.wikipedia.org/wiki/Alan_Turing.\n \"turing\",\n // Varahamihira - Ancient Indian mathematician who discovered trigonometric formulae during 505-587 CE - https://en.wikipedia.org/wiki/Var%C4%81hamihira#Contributions\n \"varahamihira\",\n // Dorothy Vaughan was a NASA mathematician and computer programmer on the SCOUT launch vehicle program that put America's first satellites into space - https://en.wikipedia.org/wiki/Dorothy_Vaughan\n \"vaughan\",\n // Sir Mokshagundam Visvesvaraya - is a notable Indian engineer. He is a recipient of the Indian Republic's highest honour, the Bharat Ratna, in 1955. On his birthday, 15 September is celebrated as Engineer's Day in India in his memory - https://en.wikipedia.org/wiki/Visvesvaraya\n \"visvesvaraya\",\n // Christiane Nüsslein-Volhard - German biologist, won Nobel Prize in Physiology or Medicine in 1995 for research on the genetic control of embryonic development. https://en.wikipedia.org/wiki/Christiane_N%C3%BCsslein-Volhard\n \"volhard\",\n // Cédric Villani - French mathematician, won Fields Medal, Fermat Prize and Poincaré Price for his work in differential geometry and statistical mechanics. https://en.wikipedia.org/wiki/C%C3%A9dric_Villani\n \"villani\",\n // Marlyn Wescoff - one of the original programmers of the ENIAC. https://en.wikipedia.org/wiki/ENIAC - https://en.wikipedia.org/wiki/Marlyn_Meltzer\n \"wescoff\",\n // Sylvia B. Wilbur - British computer scientist who helped develop the ARPANET, was one of the first to exchange email in the UK and a leading researcher in computer-supported collaborative work. https://en.wikipedia.org/wiki/Sylvia_Wilbur\n \"wilbur\",\n // Andrew Wiles - Notable British mathematician who proved the enigmatic Fermat's Last Theorem - https://en.wikipedia.org/wiki/Andrew_Wiles\n \"wiles\",\n // Roberta Williams, did pioneering work in graphical adventure games for personal computers, particularly the King's Quest series. https://en.wikipedia.org/wiki/Roberta_Williams\n \"williams\",\n // Malcolm John Williamson - British mathematician and cryptographer employed by the GCHQ. Developed in 1974 what is now known as Diffie-Hellman key exchange (Diffie and Hellman first published the scheme in 1976). https://en.wikipedia.org/wiki/Malcolm_J._Williamson\n \"williamson\",\n // Sophie Wilson designed the first Acorn Micro-Computer and the instruction set for ARM processors. https://en.wikipedia.org/wiki/Sophie_Wilson\n \"wilson\",\n // Jeannette Wing - co-developed the Liskov substitution principle. - https://en.wikipedia.org/wiki/Jeannette_Wing\n \"wing\",\n // Steve Wozniak invented the Apple I and Apple II. https://en.wikipedia.org/wiki/Steve_Wozniak\n \"wozniak\",\n // The Wright brothers, Orville and Wilbur - credited with inventing and building the world's first successful airplane and making the first controlled, powered and sustained heavier-than-air human flight - https://en.wikipedia.org/wiki/Wright_brothers\n \"wright\",\n // Chien-Shiung Wu - Chinese-American experimental physicist who made significant contributions to nuclear physics. https://en.wikipedia.org/wiki/Chien-Shiung_Wu\n \"wu\",\n // Rosalyn Sussman Yalow - Rosalyn Sussman Yalow was an American medical physicist, and a co-winner of the 1977 Nobel Prize in Physiology or Medicine for development of the radioimmunoassay technique. https://en.wikipedia.org/wiki/Rosalyn_Sussman_Yalow\n \"yalow\",\n // Ada Yonath - an Israeli crystallographer, the first woman from the Middle East to win a Nobel prize in the sciences. https://en.wikipedia.org/wiki/Ada_Yonath\n \"yonath\",\n // Nikolay Yegorovich Zhukovsky (Russian: Никола́й Его́рович Жуко́вский, January 17 1847 – March 17, 1921) was a Russian scientist, mathematician and engineer, and a founding father of modern aero- and hydrodynamics. Whereas contemporary scientists scoffed at the idea of human flight, Zhukovsky was the first to undertake the study of airflow. He is often called the Father of Russian Aviation. https://en.wikipedia.org/wiki/Nikolay_Yegorovich_Zhukovsky\n \"zhukovsky\"\n];\nconst randomName = (prefix = \"\", separator = \"-\") => {\n const name = `${ADJECTIVES[Math.floor(Math.random() * ADJECTIVES.length)] ?? \"\"}${separator}${NAMES[Math.floor(Math.random() * NAMES.length)] ?? \"\"}`;\n if (name === `boring${separator}wozniak`) {\n return randomName(prefix, separator);\n }\n return prefix.length > 0 ? `${prefix}${separator}${name}` : name;\n};\nmodule.exports = randomName;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\tvar threw = true;\n\ttry {\n\t\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\t\tthrew = false;\n\t} finally {\n\t\tif(threw) delete __webpack_module_cache__[moduleId];\n\t}\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","\nif (typeof __webpack_require__ !== 'undefined') __webpack_require__.ab = __dirname + \"/\";","","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(137);\n",""],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/dist/licenses.txt b/dist/licenses.txt index 718897f..385baa7 100644 --- a/dist/licenses.txt +++ b/dist/licenses.txt @@ -59,6 +59,31 @@ The above copyright notice and this permission notice shall be included in all c THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +@scaleway/random-name +MIT +MIT License + +Copyright (c) 2021 Scaleway + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + @scaleway/sdk Apache-2.0