UNPKG

@eddye68/studio-client

Version:

The AWS service Studio client

87 lines (84 loc) 2.54 kB
"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // src/client/client-options.ts var client_options_exports = {}; __export(client_options_exports, { ClientOptions: () => ClientOptions }); module.exports = __toCommonJS(client_options_exports); // src/client/client-option-error.ts var ClientOptionError = class _ClientOptionError extends Error { constructor(message, optionName, error) { super(_ClientOptionError.buildMessage(message, optionName, error)); this.optionName = optionName; this.name = "ClientOptionError"; } static buildMessage(message, optionName, error) { return `${message} (Option '${optionName}')`; } }; // src/client/client-options.ts var ClientOptions = class { constructor() { // -------------------- baseUrl -------------------- this._baseUrl = null; // -------------------- apiKey -------------------- this._apiKey = null; } /** * * @throws QqAwsServiceStudioClientClientError When the baseurl is not set */ get baseUrl() { if (this._baseUrl === null) { throw new ClientOptionError("Option not set", "baseUrl"); } ; return this._baseUrl; } setBaseUrl(value) { this._baseUrl = value.replace(/\/$/, ""); return this; } /** * @returns The apiKey * @throws QqAwsServiceStudioClientClientError When the apiKey is not set */ get apiKey() { if (this._apiKey === null) { throw new ClientOptionError("Option not set", "apiKey"); } ; return this._apiKey; } /** * * @param value The API key * @returns */ setApiKey(value) { this._apiKey = value; return this; } }; // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { ClientOptions }); //# sourceMappingURL=client-options.js.map