UNPKG

@azure-rest/arm-compute

Version:
34 lines 1.89 kB
"use strict"; // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. Object.defineProperty(exports, "__esModule", { value: true }); exports.default = createClient; const core_client_1 = require("@azure-rest/core-client"); const logger_js_1 = require("./logger.js"); /** * Initialize a new instance of `ComputeManagementClient` * @param credentials - uniquely identify client credential * @param options - the parameter for all optional parameters */ function createClient(credentials, options = {}) { var _a, _b, _c, _d, _e, _f; const endpointUrl = (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUrl) !== null && _b !== void 0 ? _b : `https://management.azure.com`; const userAgentInfo = `azsdk-js-arm-compute-rest/1.0.0-beta.3`; 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_js_1.logger.info, }, credentials: { scopes: (_f = (_e = options.credentials) === null || _e === void 0 ? void 0 : _e.scopes) !== null && _f !== void 0 ? _f : ["https://management.azure.com/.default"], } }); const client = (0, core_client_1.getClient)(endpointUrl, credentials, options); client.pipeline.removePolicy({ name: "ApiVersionPolicy" }); if (options.apiVersion) { logger_js_1.logger.warning("This client does not support client api-version, please change it at the operation level"); } return client; } //# sourceMappingURL=computeManagementClient.js.map