diff --git a/core b/core index e637e63d95..e6cf27481b 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit e637e63d95a6c2149f4e0723c341ce3e47b7614c +Subproject commit e6cf27481b40f7b09e83c249cf3607bd6e1e3b99 diff --git a/typespec-extension/changelog.md b/typespec-extension/changelog.md index 97f9274fac..253dbc1012 100644 --- a/typespec-extension/changelog.md +++ b/typespec-extension/changelog.md @@ -1,5 +1,11 @@ # Release History +## 0.38.0 (2026-01-08) + +Compatible with compiler 1.7.1. + +- Supported merging of multiple services into a single root client. + ## 0.37.4 (2025-12-18) Compatible with compiler 1.7.1. diff --git a/typespec-extension/package-lock.json b/typespec-extension/package-lock.json index c33ca8852e..86c10ae688 100644 --- a/typespec-extension/package-lock.json +++ b/typespec-extension/package-lock.json @@ -1,12 +1,12 @@ { "name": "@azure-tools/typespec-java", - "version": "0.37.4", + "version": "0.38.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@azure-tools/typespec-java", - "version": "0.37.4", + "version": "0.38.0", "license": "MIT", "dependencies": { "@autorest/codemodel": "~4.20.1", @@ -15,7 +15,7 @@ }, "devDependencies": { "@azure-tools/typespec-autorest": "0.63.1", - "@azure-tools/typespec-azure-core": "0.63.0", + "@azure-tools/typespec-azure-core": "0.63.1", "@azure-tools/typespec-azure-resource-manager": "0.63.0", "@azure-tools/typespec-azure-rulesets": "0.63.0", "@azure-tools/typespec-client-generator-core": "0.63.3", @@ -24,8 +24,8 @@ "@types/js-yaml": "~4.0.9", "@types/lodash": "~4.17.21", "@types/node": "~25.0.3", - "@typescript-eslint/eslint-plugin": "~8.51.0", - "@typescript-eslint/parser": "~8.51.0", + "@typescript-eslint/eslint-plugin": "~8.52.0", + "@typescript-eslint/parser": "~8.52.0", "@typespec/compiler": "1.7.1", "@typespec/events": "0.77.0", "@typespec/http": "1.7.0", @@ -46,7 +46,7 @@ "prettier": "~3.7.4", "rimraf": "~6.1.2", "typescript": "~5.9.3", - "typescript-eslint": "^8.51.0", + "typescript-eslint": "^8.52.0", "vitest": "^4.0.16" }, "engines": { @@ -54,7 +54,7 @@ }, "peerDependencies": { "@azure-tools/typespec-autorest": ">=0.63.1 <1.0.0", - "@azure-tools/typespec-azure-core": ">=0.63.0 <1.0.0", + "@azure-tools/typespec-azure-core": ">=0.63.1 <1.0.0", "@azure-tools/typespec-azure-resource-manager": ">=0.63.0 <1.0.0", "@azure-tools/typespec-azure-rulesets": ">=0.63.0 <1.0.0", "@azure-tools/typespec-client-generator-core": ">=0.63.3 <1.0.0", @@ -180,9 +180,9 @@ } }, "node_modules/@azure-tools/typespec-azure-core": { - "version": "0.63.0", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-core/-/typespec-azure-core-0.63.0.tgz", - "integrity": "sha512-FbEmpZSQENzBt/Y8qSF1b98T8CqT3bV7IRV8AGGm/73NQZiWQCm2LvQzR0/lbqGntS2EnSBrt394Kt69wM4ifA==", + "version": "0.63.1", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-core/-/typespec-azure-core-0.63.1.tgz", + "integrity": "sha512-r5bJLDNUYAoP3i6topz3P7Y7vFMig92pO/zUuTgo4Q5hTbFoUgKPBBBmamVSwBh5MO4lMSLekZC3QoEYnsVUDg==", "dev": true, "license": "MIT", "engines": { @@ -794,9 +794,9 @@ } }, "node_modules/@eslint-community/eslint-utils": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.7.0.tgz", - "integrity": "sha512-dyybb3AcajC7uha6CvhdVRJqaKyn7w2YKqKyAN37NKYgZT36w+iRb0Dymmc5qEJ549c/S31cMMSFd75bteCpCw==", + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz", + "integrity": "sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==", "dev": true, "license": "MIT", "dependencies": { @@ -2437,20 +2437,20 @@ "license": "MIT" }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.51.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.51.0.tgz", - "integrity": "sha512-XtssGWJvypyM2ytBnSnKtHYOGT+4ZwTnBVl36TA4nRO2f4PRNGz5/1OszHzcZCvcBMh+qb7I06uoCmLTRdR9og==", + "version": "8.52.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.52.0.tgz", + "integrity": "sha512-okqtOgqu2qmZJ5iN4TWlgfF171dZmx2FzdOv2K/ixL2LZWDStL8+JgQerI2sa8eAEfoydG9+0V96m7V+P8yE1Q==", "dev": true, "license": "MIT", "dependencies": { - "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.51.0", - "@typescript-eslint/type-utils": "8.51.0", - "@typescript-eslint/utils": "8.51.0", - "@typescript-eslint/visitor-keys": "8.51.0", - "ignore": "^7.0.0", + "@eslint-community/regexpp": "^4.12.2", + "@typescript-eslint/scope-manager": "8.52.0", + "@typescript-eslint/type-utils": "8.52.0", + "@typescript-eslint/utils": "8.52.0", + "@typescript-eslint/visitor-keys": "8.52.0", + "ignore": "^7.0.5", "natural-compare": "^1.4.0", - "ts-api-utils": "^2.2.0" + "ts-api-utils": "^2.4.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2460,15 +2460,15 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.51.0", + "@typescript-eslint/parser": "^8.52.0", "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.4.tgz", - "integrity": "sha512-gJzzk+PQNznz8ysRrC0aOkBNVRBDtE1n53IqyqEf3PXrYwomFs5q4pGMizBMJF+ykh03insJ27hB8gSrD2Hn8A==", + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz", + "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==", "dev": true, "license": "MIT", "engines": { @@ -2489,17 +2489,17 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "8.51.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.51.0.tgz", - "integrity": "sha512-3xP4XzzDNQOIqBMWogftkwxhg5oMKApqY0BAflmLZiFYHqyhSOxv/cd/zPQLTcCXr4AkaKb25joocY0BD1WC6A==", + "version": "8.52.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.52.0.tgz", + "integrity": "sha512-iIACsx8pxRnguSYhHiMn2PvhvfpopO9FXHyn1mG5txZIsAaB6F0KwbFnUQN3KCiG3Jcuad/Cao2FAs1Wp7vAyg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/scope-manager": "8.51.0", - "@typescript-eslint/types": "8.51.0", - "@typescript-eslint/typescript-estree": "8.51.0", - "@typescript-eslint/visitor-keys": "8.51.0", - "debug": "^4.3.4" + "@typescript-eslint/scope-manager": "8.52.0", + "@typescript-eslint/types": "8.52.0", + "@typescript-eslint/typescript-estree": "8.52.0", + "@typescript-eslint/visitor-keys": "8.52.0", + "debug": "^4.4.3" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2514,15 +2514,15 @@ } }, "node_modules/@typescript-eslint/project-service": { - "version": "8.51.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.51.0.tgz", - "integrity": "sha512-Luv/GafO07Z7HpiI7qeEW5NW8HUtZI/fo/kE0YbtQEFpJRUuR0ajcWfCE5bnMvL7QQFrmT/odMe8QZww8X2nfQ==", + "version": "8.52.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.52.0.tgz", + "integrity": "sha512-xD0MfdSdEmeFa3OmVqonHi+Cciab96ls1UhIF/qX/O/gPu5KXD0bY9lu33jj04fjzrXHcuvjBcBC+D3SNSadaw==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.51.0", - "@typescript-eslint/types": "^8.51.0", - "debug": "^4.3.4" + "@typescript-eslint/tsconfig-utils": "^8.52.0", + "@typescript-eslint/types": "^8.52.0", + "debug": "^4.4.3" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2536,14 +2536,14 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.51.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.51.0.tgz", - "integrity": "sha512-JhhJDVwsSx4hiOEQPeajGhCWgBMBwVkxC/Pet53EpBVs7zHHtayKefw1jtPaNRXpI9RA2uocdmpdfE7T+NrizA==", + "version": "8.52.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.52.0.tgz", + "integrity": "sha512-ixxqmmCcc1Nf8S0mS0TkJ/3LKcC8mruYJPOU6Ia2F/zUUR4pApW7LzrpU3JmtePbRUTes9bEqRc1Gg4iyRnDzA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.51.0", - "@typescript-eslint/visitor-keys": "8.51.0" + "@typescript-eslint/types": "8.52.0", + "@typescript-eslint/visitor-keys": "8.52.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2554,9 +2554,9 @@ } }, "node_modules/@typescript-eslint/tsconfig-utils": { - "version": "8.51.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.51.0.tgz", - "integrity": "sha512-Qi5bSy/vuHeWyir2C8u/uqGMIlIDu8fuiYWv48ZGlZ/k+PRPHtaAu7erpc7p5bzw2WNNSniuxoMSO4Ar6V9OXw==", + "version": "8.52.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.52.0.tgz", + "integrity": "sha512-jl+8fzr/SdzdxWJznq5nvoI7qn2tNYV/ZBAEcaFMVXf+K6jmXvAFrgo/+5rxgnL152f//pDEAYAhhBAZGrVfwg==", "dev": true, "license": "MIT", "engines": { @@ -2571,17 +2571,17 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.51.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.51.0.tgz", - "integrity": "sha512-0XVtYzxnobc9K0VU7wRWg1yiUrw4oQzexCG2V2IDxxCxhqBMSMbjB+6o91A+Uc0GWtgjCa3Y8bi7hwI0Tu4n5Q==", + "version": "8.52.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.52.0.tgz", + "integrity": "sha512-JD3wKBRWglYRQkAtsyGz1AewDu3mTc7NtRjR/ceTyGoPqmdS5oCdx/oZMWD5Zuqmo6/MpsYs0wp6axNt88/2EQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.51.0", - "@typescript-eslint/typescript-estree": "8.51.0", - "@typescript-eslint/utils": "8.51.0", - "debug": "^4.3.4", - "ts-api-utils": "^2.2.0" + "@typescript-eslint/types": "8.52.0", + "@typescript-eslint/typescript-estree": "8.52.0", + "@typescript-eslint/utils": "8.52.0", + "debug": "^4.4.3", + "ts-api-utils": "^2.4.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2609,9 +2609,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "8.51.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.51.0.tgz", - "integrity": "sha512-TizAvWYFM6sSscmEakjY3sPqGwxZRSywSsPEiuZF6d5GmGD9Gvlsv0f6N8FvAAA0CD06l3rIcWNbsN1e5F/9Ag==", + "version": "8.52.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.52.0.tgz", + "integrity": "sha512-LWQV1V4q9V4cT4H5JCIx3481iIFxH1UkVk+ZkGGAV1ZGcjGI9IoFOfg3O6ywz8QqCDEp7Inlg6kovMofsNRaGg==", "dev": true, "license": "MIT", "engines": { @@ -2623,21 +2623,21 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.51.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.51.0.tgz", - "integrity": "sha512-1qNjGqFRmlq0VW5iVlcyHBbCjPB7y6SxpBkrbhNWMy/65ZoncXCEPJxkRZL8McrseNH6lFhaxCIaX+vBuFnRng==", + "version": "8.52.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.52.0.tgz", + "integrity": "sha512-XP3LClsCc0FsTK5/frGjolyADTh3QmsLp6nKd476xNI9CsSsLnmn4f0jrzNoAulmxlmNIpeXuHYeEQv61Q6qeQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/project-service": "8.51.0", - "@typescript-eslint/tsconfig-utils": "8.51.0", - "@typescript-eslint/types": "8.51.0", - "@typescript-eslint/visitor-keys": "8.51.0", - "debug": "^4.3.4", - "minimatch": "^9.0.4", - "semver": "^7.6.0", + "@typescript-eslint/project-service": "8.52.0", + "@typescript-eslint/tsconfig-utils": "8.52.0", + "@typescript-eslint/types": "8.52.0", + "@typescript-eslint/visitor-keys": "8.52.0", + "debug": "^4.4.3", + "minimatch": "^9.0.5", + "semver": "^7.7.3", "tinyglobby": "^0.2.15", - "ts-api-utils": "^2.2.0" + "ts-api-utils": "^2.4.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2664,16 +2664,16 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.51.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.51.0.tgz", - "integrity": "sha512-11rZYxSe0zabiKaCP2QAwRf/dnmgFgvTmeDTtZvUvXG3UuAdg/GU02NExmmIXzz3vLGgMdtrIosI84jITQOxUA==", + "version": "8.52.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.52.0.tgz", + "integrity": "sha512-wYndVMWkweqHpEpwPhwqE2lnD2DxC6WVLupU/DOt/0/v+/+iQbbzO3jOHjmBMnhu0DgLULvOaU4h4pwHYi2oRQ==", "dev": true, "license": "MIT", "dependencies": { - "@eslint-community/eslint-utils": "^4.7.0", - "@typescript-eslint/scope-manager": "8.51.0", - "@typescript-eslint/types": "8.51.0", - "@typescript-eslint/typescript-estree": "8.51.0" + "@eslint-community/eslint-utils": "^4.9.1", + "@typescript-eslint/scope-manager": "8.52.0", + "@typescript-eslint/types": "8.52.0", + "@typescript-eslint/typescript-estree": "8.52.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2688,13 +2688,13 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.51.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.51.0.tgz", - "integrity": "sha512-mM/JRQOzhVN1ykejrvwnBRV3+7yTKK8tVANVN3o1O0t0v7o+jqdVu9crPy5Y9dov15TJk/FTIgoUGHrTOVL3Zg==", + "version": "8.52.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.52.0.tgz", + "integrity": "sha512-ink3/Zofus34nmBsPjow63FP5M7IGff0RKAgqR6+CFpdk22M7aLwC9gOcLGYqr7MczLPzZVERW9hRog3O4n1sQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.51.0", + "@typescript-eslint/types": "8.52.0", "eslint-visitor-keys": "^4.2.1" }, "engines": { @@ -8099,16 +8099,16 @@ } }, "node_modules/typescript-eslint": { - "version": "8.51.0", - "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.51.0.tgz", - "integrity": "sha512-jh8ZuM5oEh2PSdyQG9YAEM1TCGuWenLSuSUhf/irbVUNW9O5FhbFVONviN2TgMTBnUmyHv7E56rYnfLZK6TkiA==", + "version": "8.52.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.52.0.tgz", + "integrity": "sha512-atlQQJ2YkO4pfTVQmQ+wvYQwexPDOIgo+RaVcD7gHgzy/IQA+XTyuxNM9M9TVXvttkF7koBHmcwisKdOAf2EcA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/eslint-plugin": "8.51.0", - "@typescript-eslint/parser": "8.51.0", - "@typescript-eslint/typescript-estree": "8.51.0", - "@typescript-eslint/utils": "8.51.0" + "@typescript-eslint/eslint-plugin": "8.52.0", + "@typescript-eslint/parser": "8.52.0", + "@typescript-eslint/typescript-estree": "8.52.0", + "@typescript-eslint/utils": "8.52.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" diff --git a/typespec-extension/package.json b/typespec-extension/package.json index 422da42e59..67fd1cdc67 100644 --- a/typespec-extension/package.json +++ b/typespec-extension/package.json @@ -1,6 +1,6 @@ { "name": "@azure-tools/typespec-java", - "version": "0.37.4", + "version": "0.38.0", "description": "TypeSpec library for emitting Java client from the TypeSpec REST protocol binding", "keywords": [ "TypeSpec" @@ -48,7 +48,7 @@ ], "peerDependencies": { "@azure-tools/typespec-autorest": ">=0.63.1 <1.0.0", - "@azure-tools/typespec-azure-core": ">=0.63.0 <1.0.0", + "@azure-tools/typespec-azure-core": ">=0.63.1 <1.0.0", "@azure-tools/typespec-azure-resource-manager": ">=0.63.0 <1.0.0", "@azure-tools/typespec-azure-rulesets": ">=0.63.0 <1.0.0", "@azure-tools/typespec-client-generator-core": ">=0.63.3 <1.0.0", @@ -67,7 +67,7 @@ }, "devDependencies": { "@azure-tools/typespec-autorest": "0.63.1", - "@azure-tools/typespec-azure-core": "0.63.0", + "@azure-tools/typespec-azure-core": "0.63.1", "@azure-tools/typespec-azure-resource-manager": "0.63.0", "@azure-tools/typespec-azure-rulesets": "0.63.0", "@azure-tools/typespec-client-generator-core": "0.63.3", @@ -76,8 +76,8 @@ "@types/js-yaml": "~4.0.9", "@types/lodash": "~4.17.21", "@types/node": "~25.0.3", - "@typescript-eslint/eslint-plugin": "~8.51.0", - "@typescript-eslint/parser": "~8.51.0", + "@typescript-eslint/eslint-plugin": "~8.52.0", + "@typescript-eslint/parser": "~8.52.0", "@typespec/compiler": "1.7.1", "@typespec/events": "0.77.0", "@typespec/http": "1.7.0", @@ -98,12 +98,12 @@ "prettier": "~3.7.4", "rimraf": "~6.1.2", "typescript": "~5.9.3", - "typescript-eslint": "^8.51.0", + "typescript-eslint": "^8.52.0", "vitest": "^4.0.16" }, "overrides": { "eslint": "~9.39.2", - "@typescript-eslint/eslint-plugin": "~8.51.0", - "@typescript-eslint/parser": "~8.51.0" + "@typescript-eslint/eslint-plugin": "~8.52.0", + "@typescript-eslint/parser": "~8.52.0" } } diff --git a/typespec-tests/package.json b/typespec-tests/package.json index 9735643d43..29b0ed3f4d 100644 --- a/typespec-tests/package.json +++ b/typespec-tests/package.json @@ -13,7 +13,7 @@ "@typespec/spector": "0.1.0-alpha.21", "@typespec/http-specs": "0.1.0-alpha.29", "@azure-tools/azure-http-specs": "0.1.0-alpha.34", - "@azure-tools/typespec-java": "file:/../typespec-extension/azure-tools-typespec-java-0.37.4.tgz" + "@azure-tools/typespec-java": "file:/../typespec-extension/azure-tools-typespec-java-0.38.0.tgz" }, "devDependencies": { "@typespec/prettier-plugin-typespec": "^1.7.0", @@ -30,7 +30,7 @@ "@typespec/events": "0.77.0", "@typespec/sse": "0.77.0", "@typespec/streams": "0.77.0", - "@azure-tools/typespec-azure-core": "0.63.0", + "@azure-tools/typespec-azure-core": "0.63.1", "@azure-tools/typespec-client-generator-core": "0.63.3", "@azure-tools/typespec-azure-resource-manager": "0.63.0", "@azure-tools/typespec-autorest": "0.63.1", diff --git a/typespec-tests/src/main/java/azure/resourcemanager/multiservice/combined/fluent/Combined.java b/typespec-tests/src/main/java/azure/resourcemanager/multiservice/combined/fluent/Combined.java index 34d52fe5aa..2cca6a21a4 100644 --- a/typespec-tests/src/main/java/azure/resourcemanager/multiservice/combined/fluent/Combined.java +++ b/typespec-tests/src/main/java/azure/resourcemanager/multiservice/combined/fluent/Combined.java @@ -18,13 +18,6 @@ public interface Combined { */ String getEndpoint(); - /** - * Gets Version parameter. - * - * @return the apiVersion value. - */ - String getApiVersion(); - /** * Gets The ID of the target subscription. The value must be an UUID. * diff --git a/typespec-tests/src/main/java/azure/resourcemanager/multiservice/combined/implementation/CombinedImpl.java b/typespec-tests/src/main/java/azure/resourcemanager/multiservice/combined/implementation/CombinedImpl.java index 4e1282d491..3082d51ed3 100644 --- a/typespec-tests/src/main/java/azure/resourcemanager/multiservice/combined/implementation/CombinedImpl.java +++ b/typespec-tests/src/main/java/azure/resourcemanager/multiservice/combined/implementation/CombinedImpl.java @@ -57,20 +57,6 @@ public String getEndpoint() { return this.endpoint; } - /** - * Version parameter. - */ - private final String apiVersion; - - /** - * Gets Version parameter. - * - * @return the apiVersion value. - */ - public String getApiVersion() { - return this.apiVersion; - } - /** * The ID of the target subscription. The value must be an UUID. */ @@ -172,7 +158,6 @@ public DisksClient getDisks() { this.defaultPollInterval = defaultPollInterval; this.endpoint = endpoint; this.subscriptionId = subscriptionId; - this.apiVersion = "2025-04-01"; this.virtualMachines = new VirtualMachinesClientImpl(this); this.disks = new DisksClientImpl(this); } diff --git a/typespec-tests/src/main/java/azure/resourcemanager/multiservice/combined/implementation/DisksClientImpl.java b/typespec-tests/src/main/java/azure/resourcemanager/multiservice/combined/implementation/DisksClientImpl.java index d46361c0be..163e986aa1 100644 --- a/typespec-tests/src/main/java/azure/resourcemanager/multiservice/combined/implementation/DisksClientImpl.java +++ b/typespec-tests/src/main/java/azure/resourcemanager/multiservice/combined/implementation/DisksClientImpl.java @@ -112,9 +112,10 @@ Response createOrUpdateSync(@HostParam("endpoint") String endpoint, */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String diskName) { + final String apiVersion = "2025-01-02"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, diskName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -149,9 +150,10 @@ private Mono getByResourceGroupAsync(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse(String resourceGroupName, String diskName, Context context) { + final String apiVersion = "2025-01-02"; final String accept = "application/json"; - return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, diskName, accept, context); + return service.getByResourceGroupSync(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, diskName, accept, context); } /** @@ -183,10 +185,11 @@ public DiskInner getByResourceGroup(String resourceGroupName, String diskName) { @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String diskName, DiskInner resource) { + final String apiVersion = "2025-01-02"; final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, diskName, contentType, accept, resource, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -205,10 +208,11 @@ private Mono>> createOrUpdateWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrUpdateWithResponse(String resourceGroupName, String diskName, DiskInner resource) { + final String apiVersion = "2025-01-02"; final String contentType = "application/json"; final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, diskName, contentType, accept, resource, Context.NONE); + return service.createOrUpdateSync(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, diskName, contentType, accept, resource, Context.NONE); } /** @@ -226,10 +230,11 @@ private Response createOrUpdateWithResponse(String resourceGroupName @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrUpdateWithResponse(String resourceGroupName, String diskName, DiskInner resource, Context context) { + final String apiVersion = "2025-01-02"; final String contentType = "application/json"; final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, diskName, contentType, accept, resource, context); + return service.createOrUpdateSync(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, diskName, contentType, accept, resource, context); } /** diff --git a/typespec-tests/src/main/java/azure/resourcemanager/multiservice/combined/implementation/VirtualMachinesClientImpl.java b/typespec-tests/src/main/java/azure/resourcemanager/multiservice/combined/implementation/VirtualMachinesClientImpl.java index 2553053f80..46c32f950a 100644 --- a/typespec-tests/src/main/java/azure/resourcemanager/multiservice/combined/implementation/VirtualMachinesClientImpl.java +++ b/typespec-tests/src/main/java/azure/resourcemanager/multiservice/combined/implementation/VirtualMachinesClientImpl.java @@ -115,9 +115,10 @@ Response createOrUpdateSync(@HostParam("endpoint") String endpoint, @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String vmName) { + final String apiVersion = "2025-04-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, vmName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -152,9 +153,10 @@ private Mono getByResourceGroupAsync(String resourceGroupNa @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse(String resourceGroupName, String vmName, Context context) { + final String apiVersion = "2025-04-01"; final String accept = "application/json"; - return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vmName, accept, context); + return service.getByResourceGroupSync(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, vmName, accept, context); } /** @@ -187,10 +189,11 @@ public VirtualMachineInner getByResourceGroup(String resourceGroupName, String v @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String vmName, VirtualMachineInner resource) { + final String apiVersion = "2025-04-01"; final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, vmName, contentType, accept, resource, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -210,10 +213,11 @@ private Mono>> createOrUpdateWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrUpdateWithResponse(String resourceGroupName, String vmName, VirtualMachineInner resource) { + final String apiVersion = "2025-04-01"; final String contentType = "application/json"; final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vmName, contentType, accept, resource, Context.NONE); + return service.createOrUpdateSync(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, vmName, contentType, accept, resource, Context.NONE); } /** @@ -232,10 +236,11 @@ private Response createOrUpdateWithResponse(String resourceGroupName @ServiceMethod(returns = ReturnType.SINGLE) private Response createOrUpdateWithResponse(String resourceGroupName, String vmName, VirtualMachineInner resource, Context context) { + final String apiVersion = "2025-04-01"; final String contentType = "application/json"; final String accept = "application/json"; - return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, vmName, contentType, accept, resource, context); + return service.createOrUpdateSync(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, vmName, contentType, accept, resource, context); } /** diff --git a/typespec-tests/src/main/java/service/multiservice/combined/CombinedBuilder.java b/typespec-tests/src/main/java/service/multiservice/combined/CombinedBuilder.java index cc8acd00b7..b89f4e03a2 100644 --- a/typespec-tests/src/main/java/service/multiservice/combined/CombinedBuilder.java +++ b/typespec-tests/src/main/java/service/multiservice/combined/CombinedBuilder.java @@ -190,24 +190,6 @@ public CombinedBuilder endpoint(String endpoint) { return this; } - /* - * Service version - */ - @Generated - private ServiceAServiceVersion serviceVersion; - - /** - * Sets Service version. - * - * @param serviceVersion the serviceVersion value. - * @return the CombinedBuilder. - */ - @Generated - public CombinedBuilder serviceVersion(ServiceAServiceVersion serviceVersion) { - this.serviceVersion = serviceVersion; - return this; - } - /* * The retry policy that will attempt to retry failed requests, if applicable. */ @@ -236,10 +218,8 @@ private CombinedImpl buildInnerClient() { this.validateClient(); HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; - ServiceAServiceVersion localServiceVersion - = (serviceVersion != null) ? serviceVersion : ServiceAServiceVersion.getLatest(); - CombinedImpl client = new CombinedImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), - localEndpoint, localServiceVersion); + CombinedImpl client + = new CombinedImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint); return client; } diff --git a/typespec-tests/src/main/java/service/multiservice/combined/ServiceAServiceVersion.java b/typespec-tests/src/main/java/service/multiservice/combined/ServiceAServiceVersion.java deleted file mode 100644 index a400682653..0000000000 --- a/typespec-tests/src/main/java/service/multiservice/combined/ServiceAServiceVersion.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package service.multiservice.combined; - -import com.azure.core.util.ServiceVersion; - -/** - * Service version of ServiceAClient. - */ -public enum ServiceAServiceVersion implements ServiceVersion { - /** - * Enum value av1. - */ - VAV1("av1"), - - /** - * Enum value av2. - */ - VAV2("av2"); - - private final String version; - - ServiceAServiceVersion(String version) { - this.version = version; - } - - /** - * {@inheritDoc} - */ - @Override - public String getVersion() { - return this.version; - } - - /** - * Gets the latest service version supported by this client library. - * - * @return The latest {@link ServiceAServiceVersion}. - */ - public static ServiceAServiceVersion getLatest() { - return VAV2; - } -} diff --git a/typespec-tests/src/main/java/service/multiservice/combined/implementation/BarsImpl.java b/typespec-tests/src/main/java/service/multiservice/combined/implementation/BarsImpl.java index 21ae41f7af..c481c89603 100644 --- a/typespec-tests/src/main/java/service/multiservice/combined/implementation/BarsImpl.java +++ b/typespec-tests/src/main/java/service/multiservice/combined/implementation/BarsImpl.java @@ -23,7 +23,6 @@ import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import reactor.core.publisher.Mono; -import service.multiservice.combined.ServiceAServiceVersion; /** * An instance of this class provides access to all the operations defined in Bars. @@ -49,15 +48,6 @@ public final class BarsImpl { this.client = client; } - /** - * Gets Service version. - * - * @return the serviceVersion value. - */ - public ServiceAServiceVersion getServiceVersion() { - return client.getServiceVersion(); - } - /** * The interface defining all the services for CombinedBars to be used by the proxy service to perform REST calls. */ @@ -95,8 +85,9 @@ Response testSync(@HostParam("endpoint") String endpoint, @QueryParam("api */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> testWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.test(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), requestOptions, context)); + final String apiVersion = "bv2"; + return FluxUtil + .withContext(context -> service.test(this.client.getEndpoint(), apiVersion, requestOptions, context)); } /** @@ -111,7 +102,7 @@ public Mono> testWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response testWithResponse(RequestOptions requestOptions) { - return service.testSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), requestOptions, - Context.NONE); + final String apiVersion = "bv2"; + return service.testSync(this.client.getEndpoint(), apiVersion, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/service/multiservice/combined/implementation/CombinedImpl.java b/typespec-tests/src/main/java/service/multiservice/combined/implementation/CombinedImpl.java index 8c18060258..d524e6a1b3 100644 --- a/typespec-tests/src/main/java/service/multiservice/combined/implementation/CombinedImpl.java +++ b/typespec-tests/src/main/java/service/multiservice/combined/implementation/CombinedImpl.java @@ -10,7 +10,6 @@ import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.util.serializer.JacksonAdapter; import com.azure.core.util.serializer.SerializerAdapter; -import service.multiservice.combined.ServiceAServiceVersion; /** * Initializes a new instance of the Combined type. @@ -30,20 +29,6 @@ public String getEndpoint() { return this.endpoint; } - /** - * Service version. - */ - private final ServiceAServiceVersion serviceVersion; - - /** - * Gets Service version. - * - * @return the serviceVersion value. - */ - public ServiceAServiceVersion getServiceVersion() { - return this.serviceVersion; - } - /** * The HTTP pipeline to send requests through. */ @@ -104,11 +89,10 @@ public BarsImpl getBars() { * Initializes an instance of Combined client. * * @param endpoint Service host. - * @param serviceVersion Service version. */ - public CombinedImpl(String endpoint, ServiceAServiceVersion serviceVersion) { + public CombinedImpl(String endpoint) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** @@ -116,10 +100,9 @@ public CombinedImpl(String endpoint, ServiceAServiceVersion serviceVersion) { * * @param httpPipeline The HTTP pipeline to send requests through. * @param endpoint Service host. - * @param serviceVersion Service version. */ - public CombinedImpl(HttpPipeline httpPipeline, String endpoint, ServiceAServiceVersion serviceVersion) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); + public CombinedImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); } /** @@ -128,14 +111,11 @@ public CombinedImpl(HttpPipeline httpPipeline, String endpoint, ServiceAServiceV * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. * @param endpoint Service host. - * @param serviceVersion Service version. */ - public CombinedImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, - ServiceAServiceVersion serviceVersion) { + public CombinedImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.endpoint = endpoint; - this.serviceVersion = serviceVersion; this.foos = new FoosImpl(this); this.bars = new BarsImpl(this); } diff --git a/typespec-tests/src/main/java/service/multiservice/combined/implementation/FoosImpl.java b/typespec-tests/src/main/java/service/multiservice/combined/implementation/FoosImpl.java index 59071060d4..fe46738155 100644 --- a/typespec-tests/src/main/java/service/multiservice/combined/implementation/FoosImpl.java +++ b/typespec-tests/src/main/java/service/multiservice/combined/implementation/FoosImpl.java @@ -23,7 +23,6 @@ import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import reactor.core.publisher.Mono; -import service.multiservice.combined.ServiceAServiceVersion; /** * An instance of this class provides access to all the operations defined in Foos. @@ -49,15 +48,6 @@ public final class FoosImpl { this.client = client; } - /** - * Gets Service version. - * - * @return the serviceVersion value. - */ - public ServiceAServiceVersion getServiceVersion() { - return client.getServiceVersion(); - } - /** * The interface defining all the services for CombinedFoos to be used by the proxy service to perform REST calls. */ @@ -95,8 +85,9 @@ Response testSync(@HostParam("endpoint") String endpoint, @QueryParam("api */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> testWithResponseAsync(RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.test(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), requestOptions, context)); + final String apiVersion = "av2"; + return FluxUtil + .withContext(context -> service.test(this.client.getEndpoint(), apiVersion, requestOptions, context)); } /** @@ -111,7 +102,7 @@ public Mono> testWithResponseAsync(RequestOptions requestOptions) */ @ServiceMethod(returns = ReturnType.SINGLE) public Response testWithResponse(RequestOptions requestOptions) { - return service.testSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), requestOptions, - Context.NONE); + final String apiVersion = "av2"; + return service.testSync(this.client.getEndpoint(), apiVersion, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/test/java/azure/resourcemanager/multiservice/ArmMultipleServiceTests.java b/typespec-tests/src/test/java/azure/resourcemanager/multiservice/ArmMultipleServiceTests.java new file mode 100644 index 0000000000..690005694e --- /dev/null +++ b/typespec-tests/src/test/java/azure/resourcemanager/multiservice/ArmMultipleServiceTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package azure.resourcemanager.multiservice; + +import azure.resourcemanager.multiservice.combined.CombinedManager; +import azure.resourcemanager.multiservice.combined.models.DiskProperties; +import azure.resourcemanager.multiservice.combined.models.VirtualMachineProperties; +import com.azure.core.management.Region; +import org.junit.jupiter.api.Test; +import org.utils.ArmUtils; + +public final class ArmMultipleServiceTests { + + private final CombinedManager manager + = CombinedManager.authenticate(ArmUtils.createTestHttpPipeline(), ArmUtils.getAzureProfile()); + + private static final String RESOURCE_GROUP_NAME = "test-rg"; + private static final Region REGION = Region.US_EAST; + + @Test + public void testCombinedClient() { + manager.disks() + .define("disk1") + .withRegion(REGION) + .withExistingResourceGroup(RESOURCE_GROUP_NAME) + .withProperties(new DiskProperties()) + .create(); + manager.disks().getByResourceGroup(RESOURCE_GROUP_NAME, "disk1"); + + manager.virtualMachines() + .define("vm1") + .withRegion(REGION) + .withExistingResourceGroup(RESOURCE_GROUP_NAME) + .withProperties(new VirtualMachineProperties()) + .create(); + manager.virtualMachines().getByResourceGroup(RESOURCE_GROUP_NAME, "vm1"); + } +} diff --git a/typespec-tests/src/test/java/service/multiservice/MultipleServiceTests.java b/typespec-tests/src/test/java/service/multiservice/MultipleServiceTests.java new file mode 100644 index 0000000000..f80736805a --- /dev/null +++ b/typespec-tests/src/test/java/service/multiservice/MultipleServiceTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package service.multiservice; + +import org.junit.jupiter.api.Test; +import service.multiservice.combined.BarClient; +import service.multiservice.combined.CombinedBuilder; +import service.multiservice.combined.FooClient; + +public final class MultipleServiceTests { + + private final FooClient fooClient = new CombinedBuilder().buildFooClient(); + private final BarClient barClient = new CombinedBuilder().buildBarClient(); + + @Test + public void testCombinedClient() { + fooClient.test(); + barClient.test(); + } +}