@eddye68/studio-client
Version:
The AWS service Studio client
1 lines • 2.66 kB
Source Map (JSON)
{"version":3,"sources":["../../src/client/client-option-error.ts","../../src/client/client-options.ts"],"sourcesContent":["\nexport class ClientOptionError extends Error {\n constructor(message: string, public optionName: string, error?: Error) {\n super(ClientOptionError.buildMessage(message, optionName, error));\n this.name = 'ClientOptionError';\n }\n\n private static buildMessage(message: string, optionName: string, error?: Error) {\n return `${message} (Option '${optionName}')`;\n }\n}","import { ClientOptionError } from \"./client-option-error\";\n\nexport class ClientOptions {\n \n\n constructor() {\n\n }\n\n // -------------------- baseUrl --------------------\n\n private _baseUrl: string | null = null;\n\n /**\n * \n * @throws QqAwsServiceStudioClientClientError When the baseurl is not set\n */\n get baseUrl(): string {\n if (this._baseUrl === null) {\n throw new ClientOptionError(\"Option not set\", 'baseUrl');\n };\n return this._baseUrl;\n }\n\n setBaseUrl(value: string) : ClientOptions {\n // Normalize URL (trailing slash)\n this._baseUrl = value.replace(/\\/$/, \"\");\n return this;\n }\n\n // -------------------- apiKey --------------------\n\n private _apiKey : string | null = null;\n\n /**\n * @returns The apiKey\n * @throws QqAwsServiceStudioClientClientError When the apiKey is not set\n */\n get apiKey(): string {\n if (this._apiKey === null) {\n throw new ClientOptionError(\"Option not set\", 'apiKey');\n };\n return this._apiKey;\n }\n\n /**\n * \n * @param value The API key\n * @returns \n */\n setApiKey(value: string) : ClientOptions {\n this._apiKey = value;\n return this;\n }\n\n}"],"mappings":";AACO,IAAM,oBAAN,MAAM,2BAA0B,MAAM;AAAA,EACzC,YAAY,SAAwB,YAAoB,OAAe;AACnE,UAAM,mBAAkB,aAAa,SAAS,YAAY,KAAK,CAAC;AADhC;AAEhC,SAAK,OAAO;AAAA,EAChB;AAAA,EAEA,OAAe,aAAa,SAAiB,YAAoB,OAAe;AAC5E,WAAO,GAAG,OAAO,aAAa,UAAU;AAAA,EAC5C;AACJ;;;ACRO,IAAM,gBAAN,MAAoB;AAAA,EAGvB,cAAc;AAMd;AAAA,SAAQ,WAA0B;AAqBlC;AAAA,SAAQ,UAA0B;AAAA,EAzBlC;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,IAAI,UAAkB;AAClB,QAAI,KAAK,aAAa,MAAM;AACxB,YAAM,IAAI,kBAAkB,kBAAkB,SAAS;AAAA,IAC3D;AAAC;AACD,WAAO,KAAK;AAAA,EAChB;AAAA,EAEA,WAAW,OAA+B;AAEtC,SAAK,WAAW,MAAM,QAAQ,OAAO,EAAE;AACvC,WAAO;AAAA,EACX;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,IAAI,SAAiB;AACjB,QAAI,KAAK,YAAY,MAAM;AACvB,YAAM,IAAI,kBAAkB,kBAAkB,QAAQ;AAAA,IAC3D;AAAC;AACA,WAAO,KAAK;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,UAAU,OAA+B;AACrC,SAAK,UAAU;AACf,WAAO;AAAA,EACX;AAEJ;","names":[]}