@azure/eventgrid-system-events
Version:
An isomorphic client library for the Azure Event Grid service.
29 lines • 1.5 kB
JavaScript
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { getClient } from "@azure-rest/core-client";
import { logger } from "../logger.js";
/**
* Initialize a new instance of `SystemEventsContext`
* @param endpointParam - The parameter endpointParam
* @param options - the parameter for all optional parameters
*/
export default function createClient(endpointParam, options = {}) {
var _a, _b, _c, _d;
const endpointUrl = (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUrl) !== null && _b !== void 0 ? _b : `${endpointParam}`;
const userAgentInfo = `azsdk-js-eventgrid-system-events/1.0.0-beta.5`;
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`
: `${userAgentInfo}`;
options = Object.assign(Object.assign({}, options), { userAgentOptions: {
userAgentPrefix,
}, loggingOptions: {
logger: (_d = (_c = options.loggingOptions) === null || _c === void 0 ? void 0 : _c.logger) !== null && _d !== void 0 ? _d : logger.info,
} });
const client = getClient(endpointUrl, options);
client.pipeline.removePolicy({ name: "ApiVersionPolicy" });
if (options.apiVersion) {
logger.warning("This client does not support client api-version, please change it at the operation level");
}
return client;
}
//# sourceMappingURL=systemEventsClient.js.map