@eddye68/studio-client
Version:
The AWS service Studio client
60 lines (59 loc) • 1.47 kB
JavaScript
// 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;
}
};
export {
ClientOptions
};
//# sourceMappingURL=client-options.mjs.map