UNPKG

@autorest/openapi-to-typespec

Version:

Autorest plugin to scaffold a Typespec definition from an OpenAPI document

35 lines 1.36 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getUserSetArmCommonTypeVersion = exports.getArmCommonTypeVersion = exports.setArmCommonTypeVersion = exports.getSession = exports.setSession = void 0; let _session; let _armCommonTypeVersion; let _userSetArmCommonTypeVersion; function setSession(session) { _session = session; } exports.setSession = setSession; function getSession() { return _session; } exports.getSession = getSession; function setArmCommonTypeVersion(version) { _userSetArmCommonTypeVersion = version; } exports.setArmCommonTypeVersion = setArmCommonTypeVersion; function getArmCommonTypeVersion() { if (!_armCommonTypeVersion) { if (["v3", "v4", "v5", "v6"].includes(_userSetArmCommonTypeVersion)) { _armCommonTypeVersion = _userSetArmCommonTypeVersion; } else { _armCommonTypeVersion = "v3"; // We hardcode the common type version to v3 if it's not set or the value is not valid, otherwise no model can extend a resource model. } } return _armCommonTypeVersion; } exports.getArmCommonTypeVersion = getArmCommonTypeVersion; function getUserSetArmCommonTypeVersion() { return _userSetArmCommonTypeVersion; } exports.getUserSetArmCommonTypeVersion = getUserSetArmCommonTypeVersion; //# sourceMappingURL=autorest-session.js.map