@azure/web-pubsub
Version:
Azure client library for Azure Web PubSub
46 lines • 1.93 kB
JavaScript
;
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.GeneratedClientContext = void 0;
const tslib_1 = require("tslib");
const coreClient = tslib_1.__importStar(require("@azure/core-client"));
/** @internal */
class GeneratedClientContext extends coreClient.ServiceClient {
/**
* Initializes a new instance of the GeneratedClientContext class.
* @param endpoint HTTP or HTTPS endpoint for the Web PubSub service instance.
* @param options The parameter options
*/
constructor(endpoint, options) {
if (endpoint === undefined) {
throw new Error("'endpoint' cannot be null");
}
// Initializing default values for options
if (!options) {
options = {};
}
const defaults = {
requestContentType: "application/json; charset=utf-8"
};
const packageDetails = `azsdk-js-web-pubsub/1.1.4`;
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
: `${packageDetails}`;
const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
userAgentPrefix
}, baseUri: options.endpoint || "{Endpoint}" });
super(optionsWithDefaults);
// Parameter assignments
this.endpoint = endpoint;
// Assigning values to Constant parameters
this.apiVersion = options.apiVersion || "2021-10-01";
}
}
exports.GeneratedClientContext = GeneratedClientContext;
//# sourceMappingURL=generatedClientContext.js.map