diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 936d0e4ca21a..a257e8a0ab53 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1713,6 +1713,7 @@ sdk/compute/arm-compute-bulkactions/ @qiaozha @MaryGao @JialinHuang803 sdk/containerservice/arm-containerserviceaimanager/ @qiaozha @MaryGao @JialinHuang803 # PRLabel: %Mgmt %mgmt-review-needed +sdk/platformvalidation/arm-platformvalidation/ @qiaozha @MaryGao @JialinHuang803 sdk/redhatopenshifthcp/arm-redhatopenshifthcp/ @qiaozha @MaryGao @JialinHuang803 # PRLabel: %Mgmt %mgmt-review-needed diff --git a/eng/ignore-links.txt b/eng/ignore-links.txt index 61df13af727b..a9228dafead2 100644 --- a/eng/ignore-links.txt +++ b/eng/ignore-links.txt @@ -139,6 +139,8 @@ https://learn.microsoft.com/javascript/api/@azure/arm-compute-bulkactions?view=a https://www.npmjs.com/package/@azure/arm-compute-bulkactions https://learn.microsoft.com/javascript/api/@azure/arm-containerserviceaimanager?view=azure-node-preview https://www.npmjs.com/package/@azure/arm-containerserviceaimanager +https://learn.microsoft.com/javascript/api/@azure/arm-platformvalidation?view=azure-node-preview +https://www.npmjs.com/package/@azure/arm-platformvalidation https://learn.microsoft.com/javascript/api/@azure/arm-redhatopenshifthcp?view=azure-node-preview https://www.npmjs.com/package/@azure/arm-redhatopenshifthcp https://aka.ms/aks/concurrent-node-operations diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7b564cbf28d1..afef8499cacd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -24933,6 +24933,85 @@ importers: specifier: catalog:testing version: 5.0.1(@opentelemetry/api@1.9.1)(@types/node@22.20.4)(@vitest/browser-playwright@5.0.1)(@vitest/coverage-istanbul@5.0.1)(@vitest/ui@5.0.1)(vite@8.3.0(@types/node@22.20.4)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1)) + sdk/platformvalidation/arm-platformvalidation: + dependencies: + '@azure-rest/core-client': + specifier: ^2.7.0 + version: link:../../core/core-client-rest + '@azure/abort-controller': + specifier: ^2.1.2 + version: link:../../core/abort-controller + '@azure/core-auth': + specifier: ^1.9.0 + version: link:../../core/core-auth + '@azure/core-lro': + specifier: ^3.1.0 + version: link:../../core/core-lro + '@azure/core-rest-pipeline': + specifier: link:../../core/core-rest-pipeline + version: link:../../core/core-rest-pipeline + '@azure/core-util': + specifier: ^1.12.0 + version: link:../../core/core-util + '@azure/logger': + specifier: ^1.2.0 + version: link:../../core/logger + tslib: + specifier: 'catalog:' + version: 2.8.1 + devDependencies: + '@azure-tools/test-credential': + specifier: workspace:^ + version: link:../../test-utils/test-credential + '@azure-tools/test-recorder': + specifier: workspace:^ + version: link:../../test-utils/recorder + '@azure-tools/test-utils-vitest': + specifier: workspace:^ + version: link:../../test-utils/test-utils-vitest + '@azure/dev-tool': + specifier: workspace:^ + version: link:../../../common/tools/dev-tool + '@azure/eslint-plugin-azure-sdk': + specifier: workspace:^ + version: link:../../../common/tools/eslint-plugin-azure-sdk + '@azure/identity': + specifier: catalog:internal + version: 4.13.0(supports-color@8.1.1) + '@types/node': + specifier: 'catalog:' + version: 22.20.4 + '@vitest/browser-playwright': + specifier: catalog:testing + version: 5.0.1(playwright@1.63.0)(vite@8.3.0(@types/node@22.20.4)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1))(vitest@5.0.1) + '@vitest/coverage-istanbul': + specifier: catalog:testing + version: 5.0.1(vitest@5.0.1) + cross-env: + specifier: 'catalog:' + version: 10.1.0 + dotenv: + specifier: catalog:testing + version: 16.6.1 + eslint: + specifier: 'catalog:' + version: 10.11.0(supports-color@8.1.1) + playwright: + specifier: catalog:testing + version: 1.63.0 + prettier: + specifier: 'catalog:' + version: 3.9.8 + rimraf: + specifier: 'catalog:' + version: 6.1.3 + typescript: + specifier: 'catalog:' + version: 6.0.3 + vitest: + specifier: catalog:testing + version: 5.0.1(@opentelemetry/api@1.9.1)(@types/node@22.20.4)(@vitest/browser-playwright@5.0.1)(@vitest/coverage-istanbul@5.0.1)(@vitest/ui@5.0.1)(vite@8.3.0(@types/node@22.20.4)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1)) + sdk/playwright/arm-playwright: dependencies: '@azure-rest/core-client': @@ -36189,11 +36268,6 @@ packages: resolution: {integrity: sha512-fQtPOXjYOYv85PIdwotp2TJGVYOycX0PQq+l844fFAxOULtBy8BVF35GyeueX0r4KvDthqPH5xAI1clQPk/2uA==} engines: {node: ^22.18.0 || >=24.11.0} - '@babel/parser@7.29.8': - resolution: {integrity: sha1-llNxai8Qxne5j7xj1L+wAMMCzxc=} - engines: {node: '>=6.0.0'} - hasBin: true - '@babel/parser@7.29.9': resolution: {integrity: sha512-CjXrNHTnvqBVqHgdBysY3vk2T8tpJHb5/RMeHJBTyVa9xgugCB0CJTx/3oO8RV2QRQP391RWpB7D6hLjm8V9uA==} engines: {node: '>=6.0.0'} @@ -36312,7 +36386,7 @@ packages: engines: {node: ^22.18.0 || >=24.11.0} '@blazediff/core@1.10.0': - resolution: {integrity: sha512-AOQff0zgR7cGsZL+4E7hVkmujoPUpm0J9xzWGWZj5wCjd3gmxESXAPfKyuzs93VdpQNFhHlBhfOjrcZ+XTERtQ==} + resolution: {integrity: sha1-ytBmZlXtCoFRflzqaLQBP+jkRFk=} '@braidai/lang@1.1.2': resolution: {integrity: sha1-ZbwrwdttAOFTuVrHAG9Fc+KJ6b4=} @@ -36569,25 +36643,25 @@ packages: resolution: {integrity: sha1-EHPl3ubdVAQQeEmQ63PkrNJcmBM=} '@esbuild/aix-ppc64@0.28.2': - resolution: {integrity: sha512-XExcO+dvLKvVtNTibSTBej1NCAbaGhWn9Ww1ZPx80qsahhPFe/8jgWP0IchNe0F3HwkU7n8ejhH8bjonqht8mQ==} + resolution: {integrity: sha1-v24QMDvPLnxoaXX6Uvk37Cco2Lw=} engines: {node: '>=18'} cpu: [ppc64] os: [aix] '@esbuild/android-arm64@0.28.2': - resolution: {integrity: sha512-5YfKeeI8qWfBZIX+u2xZC3Zlb3Os/gLS2sbEKM+I4ZOcsWmHS2WLysCcQZDAFRslDUU5Oiq44gf6PYN1vGwG5A==} + resolution: {integrity: sha1-DGJGvI0sTRcqrC2z+xGQ1yvWVQQ=} engines: {node: '>=18'} cpu: [arm64] os: [android] '@esbuild/android-arm@0.28.2': - resolution: {integrity: sha512-kXXoiPVVGQcnIYGOeaovwOURpniDBpSq4A03qkQ+BMQqtGG6HYap3xne9C1O1yo4TR3qxlCX5IqqmX6fFo2Lqg==} + resolution: {integrity: sha1-LYTs5qTiaE2SvibuE9QnV9gxw4E=} engines: {node: '>=18'} cpu: [arm] os: [android] '@esbuild/android-x64@0.28.2': - resolution: {integrity: sha512-O387ite7SzUyCcy3JQX4P4bLtEA7bLLkx+esve5JHnyYfNTxcVpXZo9jhdB0lTKN44gztELTdU7nS8Nr16Fs1Q==} + resolution: {integrity: sha1-/DjU1jWNjcHPU/CfdYn+Q262SAE=} engines: {node: '>=18'} cpu: [x64] os: [android] @@ -36605,13 +36679,13 @@ packages: os: [darwin] '@esbuild/freebsd-arm64@0.28.2': - resolution: {integrity: sha512-n+I0BTSRIoy+d6RPKnEVwql5UwBJolytvY4mAOIEJorKlqgPII8ix6slVVrfZ5Tnj7glIZvloylbB/EJPMWEXw==} + resolution: {integrity: sha1-CTuSAOzwsRW6Tl4kinSFycX4vV4=} engines: {node: '>=18'} cpu: [arm64] os: [freebsd] '@esbuild/freebsd-x64@0.28.2': - resolution: {integrity: sha512-78XJTJkvPs0kz2w61301PJjXl4g7q3JqiYMZ/M/yVI73EHBrCRTgkhu9oqG7vPqq+a/yadEW8aD+agKlk5xrmg==} + resolution: {integrity: sha1-C+Irbfkl0hPoQeqHEjr134Cw+vc=} engines: {node: '>=18'} cpu: [x64] os: [freebsd] @@ -36623,43 +36697,43 @@ packages: os: [linux] '@esbuild/linux-arm@0.28.2': - resolution: {integrity: sha512-XlDnu2q5yoqems+xay6wSAcg9DDD7K9RLKZEBOMZm3ckNpJBvOX20tSfby8KfrrhINDyv9V2YVZKY/SpoGJI8w==} + resolution: {integrity: sha1-vrEq1yuE9y0oSIzBuO6ffrFB11M=} engines: {node: '>=18'} cpu: [arm] os: [linux] '@esbuild/linux-ia32@0.28.2': - resolution: {integrity: sha512-CYbnj78HsIeA+DhgUKgFCfvNsTHFhMMrinUrMZpDXJXKN8T3XViTZ/+wtHeVxEWY8ewSzTFN+nRmSwO2tZaLUQ==} + resolution: {integrity: sha1-uB+dVVKbRcIGpGoTghSxqmh5aWs=} engines: {node: '>=18'} cpu: [ia32] os: [linux] '@esbuild/linux-loong64@0.28.2': - resolution: {integrity: sha512-buwkd8nsph4R+ajRvw0qM5Hja/TXQow3ptzWO2EbG/cqcIkHloRrdlBtQlshyYGTNFvfkfJ5tpPLVkY4DtsPfQ==} + resolution: {integrity: sha1-WYZnJBoEyZt27W75QKxQA4xBn5g=} engines: {node: '>=18'} cpu: [loong64] os: [linux] '@esbuild/linux-mips64el@0.28.2': - resolution: {integrity: sha512-ZVykbDyk7519VwiNb9Lcj9m8XM6v5V9uKPvrEMkkEedVewf+0itkhahp4HDpgERXhwLRpWFypsGbG/J8s0QjJA==} + resolution: {integrity: sha1-HFHrnOqQP1PZe1rzsYQdtw9Vlso=} engines: {node: '>=18'} cpu: [mips64el] os: [linux] '@esbuild/linux-ppc64@0.28.2': - resolution: {integrity: sha512-CAXl+Dtd9UUuJd8pKKdwh6MLm3MUMiqMPmhZ3tTSXPqfyQ3vDl6R5hZdZ/kYojK4ofXtdfSv1tFq8XzWx3heNQ==} + resolution: {integrity: sha1-Y91h8XzrMagSJ/QT/qyKcbwsUfI=} engines: {node: '>=18'} cpu: [ppc64] os: [linux] '@esbuild/linux-riscv64@0.28.2': - resolution: {integrity: sha512-GeXCej4IQtU1B+QlDV8W/RRvbzI3O/Stss+/bCXv4lZls5WGRtu2a+3JkA3i4qIUlMXpcHebWpF8AkJhATowuA==} + resolution: {integrity: sha1-N2Owj95c8lqx+suOd1Lt/kX7/Cc=} engines: {node: '>=18'} cpu: [riscv64] os: [linux] '@esbuild/linux-s390x@0.28.2': - resolution: {integrity: sha512-3H1weTYZPxt/WOhByszQZybS9w5lKzUn1FDMsgEChbHWQwHYQQRfBxgCcZvPhjHfKyJjIievvMmEUawJrdY9Dg==} + resolution: {integrity: sha1-GhN/8pOoKQbrMXY4W9fo4OXPt8s=} engines: {node: '>=18'} cpu: [s390x] os: [linux] @@ -36671,37 +36745,37 @@ packages: os: [linux] '@esbuild/netbsd-arm64@0.28.2': - resolution: {integrity: sha512-sSATRjPeDBg3pdgHoQfoYBob11Kk1FGa9lui5RIHZCoCkJa9QKlvl3/vKz2usCmYYjs7ymJR/2Nnsqe+Hjt5nw==} + resolution: {integrity: sha1-Ilca2VHWK7aszILY0frVyMGsC6E=} engines: {node: '>=18'} cpu: [arm64] os: [netbsd] '@esbuild/netbsd-x64@0.28.2': - resolution: {integrity: sha512-lqnzCV+mM0gIADaKihiCg6ifgfU2L3h5E33rNQBN1Y4MaVGnzryzmvvf7UHxprpQdE8hpqLolJ9Rl+SkIRDpyw==} + resolution: {integrity: sha1-QvzFcpfrCgyj9fxHUpH0waP3wN4=} engines: {node: '>=18'} cpu: [x64] os: [netbsd] '@esbuild/openbsd-arm64@0.28.2': - resolution: {integrity: sha512-AL2qJILH7lNjrDmCQDvdxMfAUIv8KMNZOvrwAQ8i8//ntL9FflhOyMJ8OZSMBb8/AWXe3/5v5S20y3zCoZWKoQ==} + resolution: {integrity: sha1-nrMq8QSsPaz07coB9ZZmSqsMc+8=} engines: {node: '>=18'} cpu: [arm64] os: [openbsd] '@esbuild/openbsd-x64@0.28.2': - resolution: {integrity: sha512-QtiuPytchRyC4rwUKhexJdQKvDuZ6hWloi3igqPQNUJCS1/v9EiO3UTOXR6A3FoMo4fnAKbWJdqaIwhOzh8qEw==} + resolution: {integrity: sha1-/r7SQC1giCJekfIPtM4lIq0KTv0=} engines: {node: '>=18'} cpu: [x64] os: [openbsd] '@esbuild/openharmony-arm64@0.28.2': - resolution: {integrity: sha512-WkhYDmpTjLvGlScA1rwjRUmhl4k8oXR3cIbtqWmELgU/dFeHHlEllxDvdWcNJV9rbzCexB5vz8gtNewWLgCT7Q==} + resolution: {integrity: sha1-hWQcPUZkKL+8zqXyHCaDZmP+9c4=} engines: {node: '>=18'} cpu: [arm64] os: [openharmony] '@esbuild/sunos-x64@0.28.2': - resolution: {integrity: sha512-GPMSkTOtMnv2U2F8gxe4Io6qmVs+YKyp832Etqqxr0hFngmXQ3rzwytelm3GIn7T4VviRUlf3sOgBOiTdvaf7g==} + resolution: {integrity: sha1-pzb52JYkgQRfxMPlT1R58iyHD7Q=} engines: {node: '>=18'} cpu: [x64] os: [sunos] @@ -36713,7 +36787,7 @@ packages: os: [win32] '@esbuild/win32-ia32@0.28.2': - resolution: {integrity: sha512-YmJbfTlvU7Sdn9BB+4PRES4oB6pxgS37MAONj+hBr/cpXS1aBPKXxNnDbu+QCWPj0o9dgyxeq79g6c5P8KeuYA==} + resolution: {integrity: sha1-xA0optmaEn2mcR8q/XSxHLY7Bqc=} engines: {node: '>=18'} cpu: [ia32] os: [win32] @@ -38644,11 +38718,6 @@ packages: engines: {node: '>=6.0.0'} hasBin: true - baseline-browser-mapping@2.11.3: - resolution: {integrity: sha1-OrdcfrtqcvuMos1eHuqC4rmwW84=} - engines: {node: '>=6.0.0'} - hasBin: true - bent@7.3.12: resolution: {integrity: sha1-4KJ3XUQl52dMZLeLJCr09J2msDU=} @@ -38683,11 +38752,6 @@ packages: resolution: {integrity: sha1-SQMy9AkZRSJy1VqEgK3AxEE1h4k=} engines: {node: '>=8'} - browserslist@4.28.7: - resolution: {integrity: sha1-QJBGUX/M0uUc3CDwd0VLcUEYQCg=} - engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} - hasBin: true - browserslist@4.29.0: resolution: {integrity: sha512-3GSvyjvDI4Dur1Meg2BekJquu5uF+9R9a1+5M1Mde192eZoXbeXjzgOsgqPS2V8D5wrrip0gR5Hf/GhWQ9ZzaA==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} @@ -38762,9 +38826,6 @@ packages: resolution: {integrity: sha1-uXauuzkw/oiVd7kY8J9MNs3+dfw=} engines: {node: '>=10.13'} - caniuse-lite@1.0.30001806: - resolution: {integrity: sha1-G8jlArcj+jk0Vd++3VzOwMKbt04=} - caniuse-lite@1.0.30001810: resolution: {integrity: sha1-SXC0d96jJ4N03pvEOqj105/DzaI=} @@ -39163,9 +39224,6 @@ packages: ee-first@1.1.1: resolution: {integrity: sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=} - electron-to-chromium@1.5.396: - resolution: {integrity: sha1-SqlkKEhsjRyciusgWy1uBJKMoEY=} - electron-to-chromium@1.5.433: resolution: {integrity: sha512-5lCAbyZBjtmUt/RAGHRqrL2q0oEFRThDAsZHHDn9XHa89Qw7gMYOeSicBTy+AHfvo0r6vwsZvqNJTQIQy1BLzA==} @@ -40773,10 +40831,6 @@ packages: node-int64@0.4.0: resolution: {integrity: sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs=} - node-releases@2.0.51: - resolution: {integrity: sha1-zcCEM1d/WzKtAWlEgXJuIu61Su8=} - engines: {node: '>=18'} - node-releases@2.0.56: resolution: {integrity: sha512-x0InOIyzgdk+eyaWaRJFH5snEtiImgBgblZ2CyPrLmqqcuMQkEvcDPHbzqbD8eDsSeJbVOjn+crzyzHaM4D+/A==} engines: {node: '>=18'} @@ -42094,12 +42148,6 @@ packages: unzipper@0.12.5: resolution: {integrity: sha1-f8a0hi84MiAtH1zDrb7iZ53qr2w=} - update-browserslist-db@1.2.3: - resolution: {integrity: sha1-ZNdttYcTE2rL60xJEUNmzGzC6A0=} - hasBin: true - peerDependencies: - browserslist: '>= 4.21.0' - update-browserslist-db@1.3.3: resolution: {integrity: sha512-pJ2sYawQS0R/WI928Gj5GlPhTGzbMelq0+4INtSYNDV9ErKJcX6xjGWkoG/VnB3dpUm00zALaqkrUD77pO5TDQ==} hasBin: true @@ -43173,7 +43221,7 @@ snapshots: '@babel/helper-compilation-targets': 7.29.7 '@babel/helper-module-transforms': 7.29.7(@babel/core@7.29.7(supports-color@8.1.1))(supports-color@8.1.1) '@babel/helpers': 7.29.7 - '@babel/parser': 7.29.8 + '@babel/parser': 7.29.9 '@babel/template': 7.29.7 '@babel/traverse': 7.29.8(supports-color@8.1.1) '@babel/types': 7.29.8 @@ -43207,7 +43255,7 @@ snapshots: '@babel/generator@7.29.8': dependencies: - '@babel/parser': 7.29.8 + '@babel/parser': 7.29.9 '@babel/types': 7.29.8 '@jridgewell/gen-mapping': 0.3.13 '@jridgewell/trace-mapping': 0.3.31 @@ -43226,7 +43274,7 @@ snapshots: dependencies: '@babel/compat-data': 7.29.7 '@babel/helper-validator-option': 7.29.7 - browserslist: 4.28.7 + browserslist: 4.29.0 lru-cache: 5.1.1 semver: 6.3.1 @@ -43282,10 +43330,6 @@ snapshots: '@babel/template': 8.0.0 '@babel/types': 8.0.6 - '@babel/parser@7.29.8': - dependencies: - '@babel/types': 7.29.8 - '@babel/parser@7.29.9': dependencies: '@babel/types': 7.29.8 @@ -43374,7 +43418,7 @@ snapshots: '@babel/template@7.29.7': dependencies: '@babel/code-frame': 7.29.7 - '@babel/parser': 7.29.8 + '@babel/parser': 7.29.9 '@babel/types': 7.29.8 '@babel/template@8.0.0': @@ -43388,7 +43432,7 @@ snapshots: '@babel/code-frame': 7.29.7 '@babel/generator': 7.29.8 '@babel/helper-globals': 7.29.7 - '@babel/parser': 7.29.8 + '@babel/parser': 7.29.9 '@babel/template': 7.29.7 '@babel/types': 7.29.8 debug: 4.4.3(supports-color@8.1.1) @@ -45884,8 +45928,6 @@ snapshots: baseline-browser-mapping@2.11.25: {} - baseline-browser-mapping@2.11.3: {} - bent@7.3.12: dependencies: bytesish: 0.4.4 @@ -45940,14 +45982,6 @@ snapshots: dependencies: fill-range: 7.1.1 - browserslist@4.28.7: - dependencies: - baseline-browser-mapping: 2.11.3 - caniuse-lite: 1.0.30001806 - electron-to-chromium: 1.5.396 - node-releases: 2.0.51 - update-browserslist-db: 1.2.3(browserslist@4.28.7) - browserslist@4.29.0: dependencies: baseline-browser-mapping: 2.11.25 @@ -46032,8 +46066,6 @@ snapshots: dependencies: path-temp: 2.1.1 - caniuse-lite@1.0.30001806: {} - caniuse-lite@1.0.30001810: {} caseless@0.12.0: {} @@ -46465,8 +46497,6 @@ snapshots: ee-first@1.1.1: {} - electron-to-chromium@1.5.396: {} - electron-to-chromium@1.5.433: {} emoji-regex@10.6.0: {} @@ -48347,8 +48377,6 @@ snapshots: node-int64@0.4.0: {} - node-releases@2.0.51: {} - node-releases@2.0.56: {} noms@0.0.0: @@ -49787,12 +49815,6 @@ snapshots: graceful-fs: 4.2.11 node-int64: 0.4.0 - update-browserslist-db@1.2.3(browserslist@4.28.7): - dependencies: - browserslist: 4.28.7 - escalade: 3.2.0 - picocolors: 1.1.1 - update-browserslist-db@1.3.3(browserslist@4.29.0): dependencies: browserslist: 4.29.0 diff --git a/sdk/platformvalidation/arm-platformvalidation/CHANGELOG.md b/sdk/platformvalidation/arm-platformvalidation/CHANGELOG.md new file mode 100644 index 000000000000..0a2abc562199 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/CHANGELOG.md @@ -0,0 +1,7 @@ +# Release History + +## 1.0.0-beta.1 (2026-09-28) + +### Features Added + +This is the first preview release of the @azure/arm-platformvalidation package. It introduces a new SDK generation with layered APIs, smaller bundles, and improved ergonomics. For more details, see the https://aka.ms/azsdk/js/sdk/quickstart. diff --git a/sdk/platformvalidation/arm-platformvalidation/LICENSE b/sdk/platformvalidation/arm-platformvalidation/LICENSE new file mode 100644 index 000000000000..63447fd8bbbf --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/LICENSE @@ -0,0 +1,21 @@ +Copyright (c) Microsoft Corporation. + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/sdk/platformvalidation/arm-platformvalidation/README.md b/sdk/platformvalidation/arm-platformvalidation/README.md new file mode 100644 index 000000000000..bdad145eed03 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/README.md @@ -0,0 +1,115 @@ +# Azure PlatformValidation client library for JavaScript + +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure PlatformValidation client. + +Microsoft.PlatformValidation Resource Provider management API. + +Key links: + +- [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/platformvalidation/arm-platformvalidation) +- [Package (NPM)](https://www.npmjs.com/package/@azure/arm-platformvalidation) +- [API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-platformvalidation?view=azure-node-preview) +- [Samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/platformvalidation/arm-platformvalidation/samples) + +## Getting started + +### Currently supported environments + +- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) +- Latest versions of Safari, Chrome, Edge and Firefox. + +See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details. + +### Prerequisites + +- An [Azure subscription][azure_sub]. + +### Install the `@azure/arm-platformvalidation` package + +Install the Azure PlatformValidation client library for JavaScript with `npm`: + +```bash +npm install @azure/arm-platformvalidation +``` + +### Create and authenticate a `PlatformValidationClient` + +To create a client object to access the Azure PlatformValidation API, you will need the `endpoint` of your Azure PlatformValidation resource and a `credential`. The Azure PlatformValidation client can use Microsoft Entra credentials to authenticate. +You can find the endpoint for your Azure PlatformValidation resource in the [Azure Portal][azure_portal]. + +You can authenticate with Microsoft Entra ID using a credential from the [@azure/identity][azure_identity] library or [an existing Microsoft Entra token](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). + +To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: + +```bash +npm install @azure/identity +``` + +You will also need to **register a new Microsoft Entra application and grant access to Azure PlatformValidation** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). + +For more information about how to create a Microsoft Entra application check out [this guide](https://learn.microsoft.com/entra/identity-platform/howto-create-service-principal-portal). + +Using Node.js and Node-like environments, you can use the `DefaultAzureCredential` class to authenticate the client. + +```ts snippet:ReadmeSampleCreateClient_Node +import { PlatformValidationClient } from "@azure/arm-platformvalidation"; +import { DefaultAzureCredential } from "@azure/identity"; + +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new PlatformValidationClient(new DefaultAzureCredential(), subscriptionId); +``` + +For browser environments, use the `InteractiveBrowserCredential` from the `@azure/identity` package to authenticate. + +```ts snippet:ReadmeSampleCreateClient_Browser +import { InteractiveBrowserCredential } from "@azure/identity"; +import { PlatformValidationClient } from "@azure/arm-platformvalidation"; + +const credential = new InteractiveBrowserCredential({ + tenantId: "", + clientId: "", +}); +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new PlatformValidationClient(credential, subscriptionId); +``` + + +### JavaScript Bundle +To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). + +## Key concepts + +### PlatformValidationClient + +`PlatformValidationClient` is the primary interface for developers using the Azure PlatformValidation client library. Explore the methods on this client object to understand the different features of the Azure PlatformValidation service that you can access. + +## Troubleshooting + +### Logging + +Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: + +```ts snippet:SetLogLevel +import { setLogLevel } from "@azure/logger"; + +setLogLevel("info"); +``` + +For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger). + +## Next steps + +Please take a look at the [samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/platformvalidation/arm-platformvalidation/samples) directory for detailed examples on how to use this library. + +## Contributing + +If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code. + +## Related projects + +- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) + +[azure_sub]: https://azure.microsoft.com/free/ +[azure_portal]: https://portal.azure.com +[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity +[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential diff --git a/sdk/platformvalidation/arm-platformvalidation/api-extractor.json b/sdk/platformvalidation/arm-platformvalidation/api-extractor.json new file mode 100644 index 000000000000..870d6d399477 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/api-extractor.json @@ -0,0 +1 @@ +{ "extends": "../../../api-extractor-base.json" } diff --git a/sdk/platformvalidation/arm-platformvalidation/config/tsconfig.lint.json b/sdk/platformvalidation/arm-platformvalidation/config/tsconfig.lint.json new file mode 100644 index 000000000000..3a31a03786d2 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/config/tsconfig.lint.json @@ -0,0 +1,4 @@ +{ + "extends": "../../../../tsconfig.json", + "include": ["../src", "../test"] +} diff --git a/sdk/platformvalidation/arm-platformvalidation/config/tsconfig.samples.json b/sdk/platformvalidation/arm-platformvalidation/config/tsconfig.samples.json new file mode 100644 index 000000000000..dfea3f71c0f4 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/config/tsconfig.samples.json @@ -0,0 +1,8 @@ +{ + "extends": "../../../../eng/tsconfigs/samples.json", + "compilerOptions": { + "paths": { + "@azure/arm-platformvalidation": ["../dist/esm"] + } + } +} diff --git a/sdk/platformvalidation/arm-platformvalidation/config/tsconfig.snippets.json b/sdk/platformvalidation/arm-platformvalidation/config/tsconfig.snippets.json new file mode 100644 index 000000000000..a5ba563b0506 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/config/tsconfig.snippets.json @@ -0,0 +1,3 @@ +{ + "extends": "../../../../eng/tsconfigs/snippets.json" +} diff --git a/sdk/platformvalidation/arm-platformvalidation/config/tsconfig.src.browser.json b/sdk/platformvalidation/arm-platformvalidation/config/tsconfig.src.browser.json new file mode 100644 index 000000000000..a02aa4d68616 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/config/tsconfig.src.browser.json @@ -0,0 +1,20 @@ +{ + "extends": "../../../../eng/tsconfigs/src.browser.json", + "compilerOptions": { + "resolveJsonModule": true + }, + "include": [ + "../src/index.ts", + "../src/api/index.ts", + "../src/api/validationTestCategories/index.ts", + "../src/api/validationTestVersions/index.ts", + "../src/api/validationTests/index.ts", + "../src/api/validationTestRuns/index.ts", + "../src/api/executionPlanRuns/index.ts", + "../src/api/validationExecutionPlans/index.ts", + "../src/api/cloudValidations/index.ts", + "../src/api/operations/index.ts", + "../src/api/operationStatus/index.ts", + "../src/models/index.ts" + ] +} diff --git a/sdk/platformvalidation/arm-platformvalidation/config/tsconfig.src.cjs.json b/sdk/platformvalidation/arm-platformvalidation/config/tsconfig.src.cjs.json new file mode 100644 index 000000000000..f36de7af81c9 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/config/tsconfig.src.cjs.json @@ -0,0 +1,20 @@ +{ + "extends": "../../../../eng/tsconfigs/src.cjs.json", + "compilerOptions": { + "resolveJsonModule": true + }, + "include": [ + "../src/index.ts", + "../src/api/index.ts", + "../src/api/validationTestCategories/index.ts", + "../src/api/validationTestVersions/index.ts", + "../src/api/validationTests/index.ts", + "../src/api/validationTestRuns/index.ts", + "../src/api/executionPlanRuns/index.ts", + "../src/api/validationExecutionPlans/index.ts", + "../src/api/cloudValidations/index.ts", + "../src/api/operations/index.ts", + "../src/api/operationStatus/index.ts", + "../src/models/index.ts" + ] +} diff --git a/sdk/platformvalidation/arm-platformvalidation/config/tsconfig.src.esm.json b/sdk/platformvalidation/arm-platformvalidation/config/tsconfig.src.esm.json new file mode 100644 index 000000000000..1fb04dca7b20 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/config/tsconfig.src.esm.json @@ -0,0 +1,20 @@ +{ + "extends": "../../../../eng/tsconfigs/src.esm.json", + "compilerOptions": { + "resolveJsonModule": true + }, + "include": [ + "../src/index.ts", + "../src/api/index.ts", + "../src/api/validationTestCategories/index.ts", + "../src/api/validationTestVersions/index.ts", + "../src/api/validationTests/index.ts", + "../src/api/validationTestRuns/index.ts", + "../src/api/executionPlanRuns/index.ts", + "../src/api/validationExecutionPlans/index.ts", + "../src/api/cloudValidations/index.ts", + "../src/api/operations/index.ts", + "../src/api/operationStatus/index.ts", + "../src/models/index.ts" + ] +} diff --git a/sdk/platformvalidation/arm-platformvalidation/config/tsconfig.test.browser.json b/sdk/platformvalidation/arm-platformvalidation/config/tsconfig.test.browser.json new file mode 100644 index 000000000000..bf505e1c4940 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/config/tsconfig.test.browser.json @@ -0,0 +1,10 @@ +{ + "extends": "../../../../eng/tsconfigs/test.browser.json", + "compilerOptions": { + "paths": { + "@azure/arm-platformvalidation": ["../src/index.ts"], + "@azure/arm-platformvalidation/*": ["../src/*"], + "$internal/*": ["../src/*"] + } + } +} diff --git a/sdk/platformvalidation/arm-platformvalidation/config/tsconfig.test.node.json b/sdk/platformvalidation/arm-platformvalidation/config/tsconfig.test.node.json new file mode 100644 index 000000000000..1675d38949f6 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/config/tsconfig.test.node.json @@ -0,0 +1,10 @@ +{ + "extends": "../../../../eng/tsconfigs/test.node.json", + "compilerOptions": { + "paths": { + "@azure/arm-platformvalidation": ["../src/index.ts"], + "@azure/arm-platformvalidation/*": ["../src/*"], + "$internal/*": ["../src/*"] + } + } +} diff --git a/sdk/platformvalidation/arm-platformvalidation/eslint.config.mjs b/sdk/platformvalidation/arm-platformvalidation/eslint.config.mjs new file mode 100644 index 000000000000..2aab43fac11c --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/eslint.config.mjs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import azsdkEslint from "@azure/eslint-plugin-azure-sdk"; + +export default [ + ...azsdkEslint.config([ + { + rules: { + "@azure/azure-sdk/ts-modules-only-named": "warn", + "@azure/azure-sdk/ts-package-json-types": "warn", + "@azure/azure-sdk/ts-package-json-engine-is-present": "warn", + "@azure/azure-sdk/ts-package-json-files-required": "off", + "@azure/azure-sdk/ts-package-json-main-is-cjs": "off", + "tsdoc/syntax": "warn", + }, + }, + ]), + { + files: ["src/**/*.ts", "src/**/*.mts", "test/**/*.ts"], + languageOptions: { + parserOptions: { + projectService: false, + project: "./config/tsconfig.lint.json", + }, + }, + }, +]; diff --git a/sdk/platformvalidation/arm-platformvalidation/metadata.json b/sdk/platformvalidation/arm-platformvalidation/metadata.json new file mode 100644 index 000000000000..41875562a5c7 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/metadata.json @@ -0,0 +1,94 @@ +{ + "apiVersions": { + "Microsoft.PlatformValidation": "2026-08-01-preview" + }, + "emitterVersion": "0.57.0", + "crossLanguageDefinitions": { + "CrossLanguagePackageId": "Microsoft.PlatformValidation", + "CrossLanguageDefinitionId": { + "@azure/arm-platformvalidation!OperationStatusResult:interface": "Azure.ResourceManager.CommonTypes.OperationStatusResult", + "@azure/arm-platformvalidation!ErrorDetail:interface": "Azure.ResourceManager.CommonTypes.ErrorDetail", + "@azure/arm-platformvalidation!ErrorAdditionalInfo:interface": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", + "@azure/arm-platformvalidation!ErrorResponse:interface": "Azure.ResourceManager.CommonTypes.ErrorResponse", + "@azure/arm-platformvalidation!OperationListResult:interface": "Azure.ResourceManager.CommonTypes.OperationListResult", + "@azure/arm-platformvalidation!Operation:interface": "Azure.ResourceManager.CommonTypes.Operation", + "@azure/arm-platformvalidation!OperationDisplay:interface": "Azure.ResourceManager.CommonTypes.OperationDisplay", + "@azure/arm-platformvalidation!CloudValidation:interface": "Microsoft.PlatformValidation.CloudValidation", + "@azure/arm-platformvalidation!CloudValidationProperties:interface": "Microsoft.PlatformValidation.CloudValidationProperties", + "@azure/arm-platformvalidation!ManagedOnBehalfOfConfiguration:interface": "Azure.ResourceManager.CommonTypes.ManagedOnBehalfOfConfiguration", + "@azure/arm-platformvalidation!MoboBrokerResource:interface": "Azure.ResourceManager.CommonTypes.MoboBrokerResource", + "@azure/arm-platformvalidation!TrackedResource:interface": "Azure.ResourceManager.CommonTypes.TrackedResource", + "@azure/arm-platformvalidation!Resource:interface": "Azure.ResourceManager.CommonTypes.Resource", + "@azure/arm-platformvalidation!SystemData:interface": "Azure.ResourceManager.CommonTypes.SystemData", + "@azure/arm-platformvalidation!ArmOperationStatusResourceProvisioningState:interface": "Azure.ResourceManager.ArmOperationStatus", + "@azure/arm-platformvalidation!CloudValidationUpdate:interface": "Azure.ResourceManager.Foundations.ResourceUpdateModel", + "@azure/arm-platformvalidation!CloudValidationUpdateProperties:interface": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties", + "@azure/arm-platformvalidation!CloudValidationListResult:interface": "Azure.ResourceManager.ResourceListResult", + "@azure/arm-platformvalidation!ValidationExecutionPlan:interface": "Microsoft.PlatformValidation.ValidationExecutionPlan", + "@azure/arm-platformvalidation!ValidationExecutionPlanProperties:interface": "Microsoft.PlatformValidation.ValidationExecutionPlanProperties", + "@azure/arm-platformvalidation!ValidationExecutionPlanUpdate:interface": "Azure.ResourceManager.Foundations.ResourceUpdateModel", + "@azure/arm-platformvalidation!ValidationExecutionPlanUpdateProperties:interface": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties", + "@azure/arm-platformvalidation!ValidationExecutionPlanListResult:interface": "Azure.ResourceManager.ResourceListResult", + "@azure/arm-platformvalidation!ExecutionPlanRun:interface": "Microsoft.PlatformValidation.ExecutionPlanRun", + "@azure/arm-platformvalidation!ExecutionPlanRunProperties:interface": "Microsoft.PlatformValidation.ExecutionPlanRunProperties", + "@azure/arm-platformvalidation!TestRunSummary:interface": "Microsoft.PlatformValidation.TestRunSummary", + "@azure/arm-platformvalidation!ProxyResource:interface": "Azure.ResourceManager.CommonTypes.ProxyResource", + "@azure/arm-platformvalidation!ExecutionPlanRunListResult:interface": "Azure.ResourceManager.ResourceListResult", + "@azure/arm-platformvalidation!ValidationTestRun:interface": "Microsoft.PlatformValidation.ValidationTestRun", + "@azure/arm-platformvalidation!ValidationTestRunProperties:interface": "Microsoft.PlatformValidation.ValidationTestRunProperties", + "@azure/arm-platformvalidation!ValidationTestPassDetails:interface": "Microsoft.PlatformValidation.ValidationTestPassDetails", + "@azure/arm-platformvalidation!ValidationTestFailureDetails:interface": "Microsoft.PlatformValidation.ValidationTestFailureDetails", + "@azure/arm-platformvalidation!ValidationTestRunListResult:interface": "Azure.ResourceManager.ResourceListResult", + "@azure/arm-platformvalidation!ValidationTest:interface": "Microsoft.PlatformValidation.ValidationTest", + "@azure/arm-platformvalidation!ValidationTestProperties:interface": "Microsoft.PlatformValidation.ValidationTestProperties", + "@azure/arm-platformvalidation!ValidationTestInput:interface": "Microsoft.PlatformValidation.ValidationTestInput", + "@azure/arm-platformvalidation!ValidationTestInputDefinition:interface": "Microsoft.PlatformValidation.ValidationTestInputDefinition", + "@azure/arm-platformvalidation!ValidationTestListResult:interface": "Azure.ResourceManager.ResourceListResult", + "@azure/arm-platformvalidation!ValidationTestVersion:interface": "Microsoft.PlatformValidation.ValidationTestVersion", + "@azure/arm-platformvalidation!ValidationTestVersionProperties:interface": "Microsoft.PlatformValidation.ValidationTestVersionProperties", + "@azure/arm-platformvalidation!ValidationTestVersionListResult:interface": "Azure.ResourceManager.ResourceListResult", + "@azure/arm-platformvalidation!ValidationTestCategory:interface": "Microsoft.PlatformValidation.ValidationTestCategory", + "@azure/arm-platformvalidation!ValidationTestCategoryProperties:interface": "Microsoft.PlatformValidation.ValidationTestCategoryProperties", + "@azure/arm-platformvalidation!ValidationTestCategoryListResult:interface": "Azure.ResourceManager.ResourceListResult", + "@azure/arm-platformvalidation!KnownOrigin:enum": "Azure.ResourceManager.CommonTypes.Origin", + "@azure/arm-platformvalidation!KnownActionType:enum": "Azure.ResourceManager.CommonTypes.ActionType", + "@azure/arm-platformvalidation!KnownProvisioningState:enum": "Microsoft.PlatformValidation.ProvisioningState", + "@azure/arm-platformvalidation!KnowncreatedByType:enum": "Azure.ResourceManager.CommonTypes.createdByType", + "@azure/arm-platformvalidation!KnownResourceProvisioningState:enum": "Azure.ResourceManager.ResourceProvisioningState", + "@azure/arm-platformvalidation!KnownValidationExecutionPlanProvisioningState:enum": "Microsoft.PlatformValidation.ValidationExecutionPlanProvisioningState", + "@azure/arm-platformvalidation!KnownExecutionPlanRunStatus:enum": "Microsoft.PlatformValidation.ExecutionPlanRunStatus", + "@azure/arm-platformvalidation!KnownTestRunOverallResult:enum": "Microsoft.PlatformValidation.TestRunOverallResult", + "@azure/arm-platformvalidation!KnownExecutionPlanRunProvisioningState:enum": "Microsoft.PlatformValidation.ExecutionPlanRunProvisioningState", + "@azure/arm-platformvalidation!KnownValidationTestRunStatus:enum": "Microsoft.PlatformValidation.ValidationTestRunStatus", + "@azure/arm-platformvalidation!KnownValidationTestRunProvisioningState:enum": "Microsoft.PlatformValidation.ValidationTestRunProvisioningState", + "@azure/arm-platformvalidation!KnownCatalogAudience:enum": "Microsoft.PlatformValidation.CatalogAudience", + "@azure/arm-platformvalidation!KnownValidationTestInputDataType:enum": "Microsoft.PlatformValidation.ValidationTestInputDataType", + "@azure/arm-platformvalidation!KnownVersions:enum": "Microsoft.PlatformValidation.Versions", + "@azure/arm-platformvalidation!ValidationTestCategoriesOperations#listBySubscription:member": "Microsoft.PlatformValidation.ValidationTestCategories.listBySubscription", + "@azure/arm-platformvalidation!ValidationTestCategoriesOperations#get:member": "Microsoft.PlatformValidation.ValidationTestCategories.get", + "@azure/arm-platformvalidation!ValidationTestVersionsOperations#list:member": "Microsoft.PlatformValidation.ValidationTestVersions.list", + "@azure/arm-platformvalidation!ValidationTestVersionsOperations#get:member": "Microsoft.PlatformValidation.ValidationTestVersions.get", + "@azure/arm-platformvalidation!ValidationTestsOperations#listBySubscription:member": "Microsoft.PlatformValidation.ValidationTests.listBySubscription", + "@azure/arm-platformvalidation!ValidationTestsOperations#get:member": "Microsoft.PlatformValidation.ValidationTests.get", + "@azure/arm-platformvalidation!ValidationTestRunsOperations#listByExecutionPlanRun:member": "Microsoft.PlatformValidation.ValidationTestRuns.listByExecutionPlanRun", + "@azure/arm-platformvalidation!ValidationTestRunsOperations#get:member": "Microsoft.PlatformValidation.ValidationTestRuns.get", + "@azure/arm-platformvalidation!ExecutionPlanRunsOperations#listByExecutionPlan:member": "Microsoft.PlatformValidation.ExecutionPlanRuns.listByExecutionPlan", + "@azure/arm-platformvalidation!ExecutionPlanRunsOperations#delete:member": "Microsoft.PlatformValidation.ExecutionPlanRuns.delete", + "@azure/arm-platformvalidation!ExecutionPlanRunsOperations#createOrUpdate:member": "Microsoft.PlatformValidation.ExecutionPlanRuns.createOrUpdate", + "@azure/arm-platformvalidation!ExecutionPlanRunsOperations#get:member": "Microsoft.PlatformValidation.ExecutionPlanRuns.get", + "@azure/arm-platformvalidation!ValidationExecutionPlansOperations#listByResourceGroup:member": "Microsoft.PlatformValidation.ValidationExecutionPlans.listByResourceGroup", + "@azure/arm-platformvalidation!ValidationExecutionPlansOperations#delete:member": "Microsoft.PlatformValidation.ValidationExecutionPlans.delete", + "@azure/arm-platformvalidation!ValidationExecutionPlansOperations#update:member": "Microsoft.PlatformValidation.ValidationExecutionPlans.update", + "@azure/arm-platformvalidation!ValidationExecutionPlansOperations#createOrUpdate:member": "Microsoft.PlatformValidation.ValidationExecutionPlans.createOrUpdate", + "@azure/arm-platformvalidation!ValidationExecutionPlansOperations#get:member": "Microsoft.PlatformValidation.ValidationExecutionPlans.get", + "@azure/arm-platformvalidation!CloudValidationsOperations#listBySubscription:member": "Microsoft.PlatformValidation.CloudValidations.listBySubscription", + "@azure/arm-platformvalidation!CloudValidationsOperations#listByResourceGroup:member": "Microsoft.PlatformValidation.CloudValidations.listByResourceGroup", + "@azure/arm-platformvalidation!CloudValidationsOperations#delete:member": "Microsoft.PlatformValidation.CloudValidations.delete", + "@azure/arm-platformvalidation!CloudValidationsOperations#update:member": "Microsoft.PlatformValidation.CloudValidations.update", + "@azure/arm-platformvalidation!CloudValidationsOperations#createOrUpdate:member": "Microsoft.PlatformValidation.CloudValidations.createOrUpdate", + "@azure/arm-platformvalidation!CloudValidationsOperations#get:member": "Microsoft.PlatformValidation.CloudValidations.get", + "@azure/arm-platformvalidation!OperationsOperations#list:member": "Azure.ResourceManager.Operations.list", + "@azure/arm-platformvalidation!OperationStatusOperations#get:member": "Microsoft.PlatformValidation.OperationStatus.get" + } + } +} diff --git a/sdk/platformvalidation/arm-platformvalidation/package.json b/sdk/platformvalidation/arm-platformvalidation/package.json new file mode 100644 index 000000000000..1d0d2bc2a134 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/package.json @@ -0,0 +1,268 @@ +{ + "name": "@azure/arm-platformvalidation", + "version": "1.0.0-beta.1", + "description": "A generated SDK for PlatformValidationClient.", + "engines": { + "node": ">=22.0.0" + }, + "sideEffects": false, + "autoPublish": false, + "type": "module", + "main": "./dist/commonjs/index.js", + "module": "./dist/esm/index.js", + "types": "./dist/commonjs/index.d.ts", + "browser": "./dist/browser/index.js", + "exports": { + "./package.json": "./package.json", + ".": { + "browser": { + "types": "./dist/browser/index.d.ts", + "default": "./dist/browser/index.js" + }, + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + }, + "./api": { + "browser": { + "types": "./dist/browser/api/index.d.ts", + "default": "./dist/browser/api/index.js" + }, + "import": { + "types": "./dist/esm/api/index.d.ts", + "default": "./dist/esm/api/index.js" + }, + "require": { + "types": "./dist/commonjs/api/index.d.ts", + "default": "./dist/commonjs/api/index.js" + } + }, + "./api/validationTestCategories": { + "browser": { + "types": "./dist/browser/api/validationTestCategories/index.d.ts", + "default": "./dist/browser/api/validationTestCategories/index.js" + }, + "import": { + "types": "./dist/esm/api/validationTestCategories/index.d.ts", + "default": "./dist/esm/api/validationTestCategories/index.js" + }, + "require": { + "types": "./dist/commonjs/api/validationTestCategories/index.d.ts", + "default": "./dist/commonjs/api/validationTestCategories/index.js" + } + }, + "./api/validationTestVersions": { + "browser": { + "types": "./dist/browser/api/validationTestVersions/index.d.ts", + "default": "./dist/browser/api/validationTestVersions/index.js" + }, + "import": { + "types": "./dist/esm/api/validationTestVersions/index.d.ts", + "default": "./dist/esm/api/validationTestVersions/index.js" + }, + "require": { + "types": "./dist/commonjs/api/validationTestVersions/index.d.ts", + "default": "./dist/commonjs/api/validationTestVersions/index.js" + } + }, + "./api/validationTests": { + "browser": { + "types": "./dist/browser/api/validationTests/index.d.ts", + "default": "./dist/browser/api/validationTests/index.js" + }, + "import": { + "types": "./dist/esm/api/validationTests/index.d.ts", + "default": "./dist/esm/api/validationTests/index.js" + }, + "require": { + "types": "./dist/commonjs/api/validationTests/index.d.ts", + "default": "./dist/commonjs/api/validationTests/index.js" + } + }, + "./api/validationTestRuns": { + "browser": { + "types": "./dist/browser/api/validationTestRuns/index.d.ts", + "default": "./dist/browser/api/validationTestRuns/index.js" + }, + "import": { + "types": "./dist/esm/api/validationTestRuns/index.d.ts", + "default": "./dist/esm/api/validationTestRuns/index.js" + }, + "require": { + "types": "./dist/commonjs/api/validationTestRuns/index.d.ts", + "default": "./dist/commonjs/api/validationTestRuns/index.js" + } + }, + "./api/executionPlanRuns": { + "browser": { + "types": "./dist/browser/api/executionPlanRuns/index.d.ts", + "default": "./dist/browser/api/executionPlanRuns/index.js" + }, + "import": { + "types": "./dist/esm/api/executionPlanRuns/index.d.ts", + "default": "./dist/esm/api/executionPlanRuns/index.js" + }, + "require": { + "types": "./dist/commonjs/api/executionPlanRuns/index.d.ts", + "default": "./dist/commonjs/api/executionPlanRuns/index.js" + } + }, + "./api/validationExecutionPlans": { + "browser": { + "types": "./dist/browser/api/validationExecutionPlans/index.d.ts", + "default": "./dist/browser/api/validationExecutionPlans/index.js" + }, + "import": { + "types": "./dist/esm/api/validationExecutionPlans/index.d.ts", + "default": "./dist/esm/api/validationExecutionPlans/index.js" + }, + "require": { + "types": "./dist/commonjs/api/validationExecutionPlans/index.d.ts", + "default": "./dist/commonjs/api/validationExecutionPlans/index.js" + } + }, + "./api/cloudValidations": { + "browser": { + "types": "./dist/browser/api/cloudValidations/index.d.ts", + "default": "./dist/browser/api/cloudValidations/index.js" + }, + "import": { + "types": "./dist/esm/api/cloudValidations/index.d.ts", + "default": "./dist/esm/api/cloudValidations/index.js" + }, + "require": { + "types": "./dist/commonjs/api/cloudValidations/index.d.ts", + "default": "./dist/commonjs/api/cloudValidations/index.js" + } + }, + "./api/operations": { + "browser": { + "types": "./dist/browser/api/operations/index.d.ts", + "default": "./dist/browser/api/operations/index.js" + }, + "import": { + "types": "./dist/esm/api/operations/index.d.ts", + "default": "./dist/esm/api/operations/index.js" + }, + "require": { + "types": "./dist/commonjs/api/operations/index.d.ts", + "default": "./dist/commonjs/api/operations/index.js" + } + }, + "./api/operationStatus": { + "browser": { + "types": "./dist/browser/api/operationStatus/index.d.ts", + "default": "./dist/browser/api/operationStatus/index.js" + }, + "import": { + "types": "./dist/esm/api/operationStatus/index.d.ts", + "default": "./dist/esm/api/operationStatus/index.js" + }, + "require": { + "types": "./dist/commonjs/api/operationStatus/index.d.ts", + "default": "./dist/commonjs/api/operationStatus/index.js" + } + }, + "./models": { + "browser": { + "types": "./dist/browser/models/index.d.ts", + "default": "./dist/browser/models/index.js" + }, + "import": { + "types": "./dist/esm/models/index.d.ts", + "default": "./dist/esm/models/index.js" + }, + "require": { + "types": "./dist/commonjs/models/index.d.ts", + "default": "./dist/commonjs/models/index.js" + } + } + }, + "keywords": [ + "node", + "azure", + "cloud", + "typescript", + "browser", + "isomorphic" + ], + "author": "Microsoft Corporation", + "license": "MIT", + "files": [ + "dist/", + "!dist/**/*.d.*ts.map", + "README.md", + "LICENSE" + ], + "sdk-type": "mgmt", + "repository": { + "type": "git", + "url": "git+https://github.com/Azure/azure-sdk-for-js", + "directory": "sdk/platformvalidation/arm-platformvalidation" + }, + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/platformvalidation/arm-platformvalidation/README.md", + "prettier": "@azure/eslint-plugin-azure-sdk/prettier.json", + "dependencies": { + "@azure/core-util": "^1.12.0", + "@azure-rest/core-client": "^2.7.0", + "@azure/abort-controller": "^2.1.2", + "@azure/core-auth": "^1.9.0", + "@azure/core-lro": "^3.1.0", + "@azure/core-rest-pipeline": "^1.24.0", + "@azure/logger": "^1.2.0", + "tslib": "catalog:" + }, + "devDependencies": { + "@azure-tools/test-credential": "workspace:^", + "@azure-tools/test-recorder": "workspace:^", + "@azure-tools/test-utils-vitest": "workspace:^", + "@azure/dev-tool": "workspace:^", + "@azure/eslint-plugin-azure-sdk": "workspace:^", + "@azure/identity": "catalog:internal", + "@types/node": "catalog:", + "cross-env": "catalog:", + "eslint": "catalog:", + "prettier": "catalog:", + "rimraf": "catalog:", + "@vitest/browser-playwright": "catalog:testing", + "@vitest/coverage-istanbul": "catalog:testing", + "dotenv": "catalog:testing", + "playwright": "catalog:testing", + "typescript": "catalog:", + "vitest": "catalog:testing" + }, + "scripts": { + "clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "extract-api": "rimraf review && dev-tool run extract-api", + "pack": "pnpm pack 2>&1", + "lint": "echo skipped", + "lint:fix": "echo skipped", + "build:samples": "tsc -p config/tsconfig.samples.json && dev-tool samples publish -f", + "check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" \"samples-dev/*.ts\"", + "execute:samples": "dev-tool samples run samples-dev", + "format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" \"samples-dev/*.ts\"", + "generate:client": "echo skipped", + "test:browser": "dev-tool run test:vitest --browser", + "build": "npm run clean && dev-tool run build-package && dev-tool run extract-api", + "test:node": "dev-tool run test:vitest", + "test": "tsc -b --noEmit && npm run test:node && npm run test:browser", + "update-snippets": "dev-tool run update-snippets", + "customize": "echo skipped" + }, + "//sampleConfiguration": { + "productName": "@azure/arm-platformvalidation", + "productSlugs": [ + "azure" + ], + "disableDocsMs": true, + "apiRefLink": "https://learn.microsoft.com/javascript/api/@azure/arm-platformvalidation?view=azure-node-preview" + } +} diff --git a/sdk/platformvalidation/arm-platformvalidation/review/arm-platformvalidation-node.api.md b/sdk/platformvalidation/arm-platformvalidation/review/arm-platformvalidation-node.api.md new file mode 100644 index 000000000000..af9bfa13dee3 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/review/arm-platformvalidation-node.api.md @@ -0,0 +1,685 @@ +## API Report File for "@azure/arm-platformvalidation" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import type { AbortSignalLike } from '@azure/abort-controller'; +import type { ClientOptions } from '@azure-rest/core-client'; +import { isRestError } from '@azure/core-rest-pipeline'; +import type { OperationOptions } from '@azure-rest/core-client'; +import type { OperationState } from '@azure/core-lro'; +import type { PathUncheckedResponse } from '@azure-rest/core-client'; +import type { Pipeline } from '@azure/core-rest-pipeline'; +import type { PollerLike } from '@azure/core-lro'; +import { RestError } from '@azure/core-rest-pipeline'; +import type { TokenCredential } from '@azure/core-auth'; + +// @public +export type ActionType = string; + +// @public +export enum AzureClouds { + AZURE_CHINA_CLOUD = "AZURE_CHINA_CLOUD", + AZURE_PUBLIC_CLOUD = "AZURE_PUBLIC_CLOUD", + AZURE_US_GOVERNMENT = "AZURE_US_GOVERNMENT" +} + +// @public +export type AzureSupportedClouds = `${AzureClouds}`; + +// @public +export type CatalogAudience = string; + +// @public +export interface CloudValidation extends TrackedResource { + properties?: CloudValidationProperties; +} + +// @public +export interface CloudValidationProperties { + description?: string; + readonly error?: ErrorDetail; + readonly managedOnBehalfOfConfiguration?: ManagedOnBehalfOfConfiguration; + readonly provisioningState?: ProvisioningState; +} + +// @public +export interface CloudValidationsCreateOrUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface CloudValidationsDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface CloudValidationsGetOptionalParams extends OperationOptions { +} + +// @public +export interface CloudValidationsListByResourceGroupOptionalParams extends OperationOptions { + filter?: string; +} + +// @public +export interface CloudValidationsListBySubscriptionOptionalParams extends OperationOptions { + filter?: string; +} + +// @public +export interface CloudValidationsOperations { + createOrUpdate: (resourceGroupName: string, cloudValidationName: string, resource: CloudValidation, options?: CloudValidationsCreateOrUpdateOptionalParams) => PollerLike, CloudValidation>; + delete: (resourceGroupName: string, cloudValidationName: string, options?: CloudValidationsDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, cloudValidationName: string, options?: CloudValidationsGetOptionalParams) => Promise; + listByResourceGroup: (resourceGroupName: string, options?: CloudValidationsListByResourceGroupOptionalParams) => PagedAsyncIterableIterator; + listBySubscription: (options?: CloudValidationsListBySubscriptionOptionalParams) => PagedAsyncIterableIterator; + update: (resourceGroupName: string, cloudValidationName: string, properties: CloudValidationUpdate, options?: CloudValidationsUpdateOptionalParams) => PollerLike, CloudValidation>; +} + +// @public +export interface CloudValidationsUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface CloudValidationUpdate { + properties?: CloudValidationUpdateProperties; + tags?: Record; +} + +// @public +export interface CloudValidationUpdateProperties { + description?: string; +} + +// @public +export type ContinuablePage = TPage & { + continuationToken?: string; +}; + +// @public +export type CreatedByType = string; + +// @public +export interface ErrorAdditionalInfo { + readonly info?: any; + readonly type?: string; +} + +// @public +export interface ErrorDetail { + readonly additionalInfo?: ErrorAdditionalInfo[]; + readonly code?: string; + readonly details?: ErrorDetail[]; + readonly message?: string; + readonly target?: string; +} + +// @public +export interface ErrorResponse { + error?: ErrorDetail; +} + +// @public +export interface ExecutionPlanRun extends ProxyResource { + properties?: ExecutionPlanRunProperties; +} + +// @public +export interface ExecutionPlanRunProperties { + readonly completedAt?: Date; + description?: string; + readonly error?: ErrorDetail; + readonly planConfigurationSnapshot?: string; + readonly provisioningState?: ExecutionPlanRunProvisioningState; + readonly reportedAt?: Date; + readonly startedAt?: Date; + readonly status?: ExecutionPlanRunStatus; + readonly testRunIds?: string[]; + readonly testRunSummary?: TestRunSummary; +} + +// @public +export type ExecutionPlanRunProvisioningState = string; + +// @public +export interface ExecutionPlanRunsCreateOrUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface ExecutionPlanRunsDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface ExecutionPlanRunsGetOptionalParams extends OperationOptions { +} + +// @public +export interface ExecutionPlanRunsListByExecutionPlanOptionalParams extends OperationOptions { + filter?: string; +} + +// @public +export interface ExecutionPlanRunsOperations { + createOrUpdate: (resourceGroupName: string, cloudValidationName: string, validationExecutionPlanName: string, executionPlanRunName: string, resource: ExecutionPlanRun, options?: ExecutionPlanRunsCreateOrUpdateOptionalParams) => PollerLike, ExecutionPlanRun>; + delete: (resourceGroupName: string, cloudValidationName: string, validationExecutionPlanName: string, executionPlanRunName: string, options?: ExecutionPlanRunsDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, cloudValidationName: string, validationExecutionPlanName: string, executionPlanRunName: string, options?: ExecutionPlanRunsGetOptionalParams) => Promise; + listByExecutionPlan: (resourceGroupName: string, cloudValidationName: string, validationExecutionPlanName: string, options?: ExecutionPlanRunsListByExecutionPlanOptionalParams) => PagedAsyncIterableIterator; +} + +// @public +export type ExecutionPlanRunStatus = string; + +export { isRestError } + +// @public +export enum KnownActionType { + Internal = "Internal" +} + +// @public +export enum KnownCatalogAudience { + Internal = "Internal", + Public = "Public" +} + +// @public +export enum KnownCreatedByType { + Application = "Application", + Key = "Key", + ManagedIdentity = "ManagedIdentity", + User = "User" +} + +// @public +export enum KnownExecutionPlanRunProvisioningState { + Canceled = "Canceled", + Creating = "Creating", + Failed = "Failed", + Processing = "Processing", + Running = "Running", + Succeeded = "Succeeded", + Waiting = "Waiting" +} + +// @public +export enum KnownExecutionPlanRunStatus { + Completed = "Completed", + Failed = "Failed", + Queued = "Queued", + Running = "Running", + Succeeded = "Succeeded", + TimedOut = "TimedOut", + Unknown = "Unknown" +} + +// @public +export enum KnownOrigin { + System = "system", + User = "user", + UserSystem = "user,system" +} + +// @public +export enum KnownProvisioningState { + Accepted = "Accepted", + Canceled = "Canceled", + Creating = "Creating", + Deleting = "Deleting", + Disabling = "Disabling", + Failed = "Failed", + Succeeded = "Succeeded", + Updating = "Updating" +} + +// @public +export enum KnownResourceProvisioningState { + Canceled = "Canceled", + Failed = "Failed", + Succeeded = "Succeeded" +} + +// @public +export enum KnownTestRunOverallResult { + Failed = "Failed", + PartiallyPassed = "PartiallyPassed", + Passed = "Passed" +} + +// @public +export enum KnownValidationExecutionPlanProvisioningState { + Canceled = "Canceled", + Creating = "Creating", + Failed = "Failed", + Succeeded = "Succeeded", + Updating = "Updating" +} + +// @public +export enum KnownValidationTestInputDataType { + Array = "Array", + Boolean = "Boolean", + Integer = "Integer", + Number = "Number", + Object = "Object", + String = "String" +} + +// @public +export enum KnownValidationTestRunProvisioningState { + Canceled = "Canceled", + Failed = "Failed", + Running = "Running", + Succeeded = "Succeeded" +} + +// @public +export enum KnownValidationTestRunStatus { + Completed = "Completed", + Error = "Error", + NotRunning = "NotRunning", + Ready = "Ready", + Running = "Running", + Scheduled = "Scheduled", + Stopped = "Stopped" +} + +// @public +export enum KnownVersions { + V20260801Preview = "2026-08-01-preview" +} + +// @public +export interface ManagedOnBehalfOfConfiguration { + readonly moboBrokerResources?: MoboBrokerResource[]; +} + +// @public +export interface MoboBrokerResource { + id?: string; +} + +// @public +export interface Operation { + readonly actionType?: ActionType; + display?: OperationDisplay; + readonly isDataAction?: boolean; + readonly name?: string; + readonly origin?: Origin; +} + +// @public +export interface OperationDisplay { + readonly description?: string; + readonly operation?: string; + readonly provider?: string; + readonly resource?: string; +} + +// @public +export interface OperationsListOptionalParams extends OperationOptions { +} + +// @public +export interface OperationsOperations { + list: (options?: OperationsListOptionalParams) => PagedAsyncIterableIterator; +} + +// @public +export interface OperationStatusGetOptionalParams extends OperationOptions { +} + +// @public +export interface OperationStatusOperations { + get: (location: string, operationId: string, options?: OperationStatusGetOptionalParams) => Promise; +} + +// @public +export interface OperationStatusResult { + endTime?: Date; + error?: ErrorDetail; + id?: string; + name?: string; + operations?: OperationStatusResult[]; + percentComplete?: number; + readonly resourceId?: string; + startTime?: Date; + status: string; +} + +// @public +export type Origin = string; + +// @public +export interface PagedAsyncIterableIterator { + [Symbol.asyncIterator](): PagedAsyncIterableIterator; + byPage: (settings?: TPageSettings) => AsyncIterableIterator>; + next(): Promise>; +} + +// @public +export interface PageSettings { + continuationToken?: string; +} + +// @public (undocumented) +export class PlatformValidationClient { + constructor(credential: TokenCredential, subscriptionId: string, options?: PlatformValidationClientOptionalParams); + readonly cloudValidations: CloudValidationsOperations; + readonly executionPlanRuns: ExecutionPlanRunsOperations; + readonly operations: OperationsOperations; + readonly operationStatus: OperationStatusOperations; + readonly pipeline: Pipeline; + readonly validationExecutionPlans: ValidationExecutionPlansOperations; + readonly validationTestCategories: ValidationTestCategoriesOperations; + readonly validationTestRuns: ValidationTestRunsOperations; + readonly validationTests: ValidationTestsOperations; + readonly validationTestVersions: ValidationTestVersionsOperations; +} + +// @public +export interface PlatformValidationClientOptionalParams extends ClientOptions { + apiVersion?: string; + cloudSetting?: AzureSupportedClouds; +} + +// @public +export type ProvisioningState = string; + +// @public +export interface ProxyResource extends Resource { +} + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly systemData?: SystemData; + readonly type?: string; +} + +// @public +export type ResourceProvisioningState = string; + +export { RestError } + +// @public +export function restorePoller(client: PlatformValidationClient, serializedState: string, sourceOperation: (...args: any[]) => PollerLike, TResult>, options?: RestorePollerOptions): PollerLike, TResult>; + +// @public (undocumented) +export interface RestorePollerOptions extends OperationOptions { + abortSignal?: AbortSignalLike; + processResponseBody?: (result: TResponse) => Promise; + updateIntervalInMs?: number; +} + +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + +// @public +export type TestRunOverallResult = string; + +// @public +export interface TestRunSummary { + failedTests?: number; + message?: string; + overallResult?: TestRunOverallResult; + passedTests?: number; + skippedTests?: number; + totalTests?: number; +} + +// @public +export interface TrackedResource extends Resource { + location: string; + tags?: Record; +} + +// @public +export interface ValidationExecutionPlan extends TrackedResource { + properties?: ValidationExecutionPlanProperties; +} + +// @public +export interface ValidationExecutionPlanProperties { + description?: string; + readonly error?: ErrorDetail; + planConfigurationJson?: string; + planConfigurationUri?: string; + readonly provisioningState?: ValidationExecutionPlanProvisioningState; +} + +// @public +export type ValidationExecutionPlanProvisioningState = string; + +// @public +export interface ValidationExecutionPlansCreateOrUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface ValidationExecutionPlansDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface ValidationExecutionPlansGetOptionalParams extends OperationOptions { +} + +// @public +export interface ValidationExecutionPlansListByResourceGroupOptionalParams extends OperationOptions { + filter?: string; +} + +// @public +export interface ValidationExecutionPlansOperations { + createOrUpdate: (resourceGroupName: string, cloudValidationName: string, validationExecutionPlanName: string, resource: ValidationExecutionPlan, options?: ValidationExecutionPlansCreateOrUpdateOptionalParams) => PollerLike, ValidationExecutionPlan>; + delete: (resourceGroupName: string, cloudValidationName: string, validationExecutionPlanName: string, options?: ValidationExecutionPlansDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, cloudValidationName: string, validationExecutionPlanName: string, options?: ValidationExecutionPlansGetOptionalParams) => Promise; + listByResourceGroup: (resourceGroupName: string, cloudValidationName: string, options?: ValidationExecutionPlansListByResourceGroupOptionalParams) => PagedAsyncIterableIterator; + update: (resourceGroupName: string, cloudValidationName: string, validationExecutionPlanName: string, properties: ValidationExecutionPlanUpdate, options?: ValidationExecutionPlansUpdateOptionalParams) => PollerLike, ValidationExecutionPlan>; +} + +// @public +export interface ValidationExecutionPlansUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface ValidationExecutionPlanUpdate { + properties?: ValidationExecutionPlanUpdateProperties; + tags?: Record; +} + +// @public +export interface ValidationExecutionPlanUpdateProperties { + description?: string; + planConfigurationJson?: string; + planConfigurationUri?: string; +} + +// @public +export interface ValidationTest extends ProxyResource { + properties?: ValidationTestProperties; +} + +// @public +export interface ValidationTestCategoriesGetOptionalParams extends OperationOptions { +} + +// @public +export interface ValidationTestCategoriesListBySubscriptionOptionalParams extends OperationOptions { + filter?: string; +} + +// @public +export interface ValidationTestCategoriesOperations { + get: (validationTestCategoryName: string, options?: ValidationTestCategoriesGetOptionalParams) => Promise; + listBySubscription: (options?: ValidationTestCategoriesListBySubscriptionOptionalParams) => PagedAsyncIterableIterator; +} + +// @public +export interface ValidationTestCategory extends ProxyResource { + properties?: ValidationTestCategoryProperties; +} + +// @public +export interface ValidationTestCategoryProperties { + readonly audience?: CatalogAudience; + readonly description?: string; + readonly displayName?: string; + readonly owners?: string[]; + readonly parentCategoryId?: string; + readonly provisioningState?: ResourceProvisioningState; +} + +// @public +export interface ValidationTestFailureDetails { + readonly details?: string; + readonly diagnosticInfo?: string; + readonly errorCode?: string; + readonly errorMessage?: string; + readonly recommendedActions?: string[]; +} + +// @public +export interface ValidationTestInput { + definition: ValidationTestInputDefinition; + name: string; +} + +// @public +export type ValidationTestInputDataType = string; + +// @public +export interface ValidationTestInputDefinition { + allowedValues?: string[]; + defaultValue?: string; + description?: string; + required?: boolean; + type?: ValidationTestInputDataType; +} + +// @public +export interface ValidationTestPassDetails { + readonly resultCode?: string; + readonly resultDetails?: string; + readonly testName?: string; +} + +// @public +export interface ValidationTestProperties { + readonly audience?: CatalogAudience; + readonly categoryIds?: string[]; + readonly currentVersion?: string; + readonly description?: string; + readonly displayName?: string; + readonly inputs?: ValidationTestInput[]; + readonly lastPublishedAt?: Date; + readonly latestPublishedVersion?: string; + readonly owners?: string[]; + readonly provisioningState?: ResourceProvisioningState; + readonly testStoreUri?: string; +} + +// @public +export interface ValidationTestRun extends ProxyResource { + properties?: ValidationTestRunProperties; +} + +// @public +export interface ValidationTestRunProperties { + readonly completedAt?: Date; + readonly error?: ErrorDetail; + readonly failureDetails?: ValidationTestFailureDetails[]; + readonly inputsJson?: string; + readonly passDetails?: ValidationTestPassDetails[]; + readonly provisioningState?: ValidationTestRunProvisioningState; + readonly reportedAt?: Date; + readonly startedAt?: Date; + readonly status?: ValidationTestRunStatus; + readonly testId?: string; +} + +// @public +export type ValidationTestRunProvisioningState = string; + +// @public +export interface ValidationTestRunsGetOptionalParams extends OperationOptions { +} + +// @public +export interface ValidationTestRunsListByExecutionPlanRunOptionalParams extends OperationOptions { +} + +// @public +export interface ValidationTestRunsOperations { + get: (resourceGroupName: string, cloudValidationName: string, validationExecutionPlanName: string, executionPlanRunName: string, validationTestRunName: string, options?: ValidationTestRunsGetOptionalParams) => Promise; + listByExecutionPlanRun: (resourceGroupName: string, cloudValidationName: string, validationExecutionPlanName: string, executionPlanRunName: string, options?: ValidationTestRunsListByExecutionPlanRunOptionalParams) => PagedAsyncIterableIterator; +} + +// @public +export type ValidationTestRunStatus = string; + +// @public +export interface ValidationTestsGetOptionalParams extends OperationOptions { +} + +// @public +export interface ValidationTestsListBySubscriptionOptionalParams extends OperationOptions { + filter?: string; +} + +// @public +export interface ValidationTestsOperations { + get: (validationTestName: string, options?: ValidationTestsGetOptionalParams) => Promise; + listBySubscription: (options?: ValidationTestsListBySubscriptionOptionalParams) => PagedAsyncIterableIterator; +} + +// @public +export interface ValidationTestVersion extends ProxyResource { + properties?: ValidationTestVersionProperties; +} + +// @public +export interface ValidationTestVersionProperties { + readonly audience?: CatalogAudience; + readonly categoryIds?: string[]; + readonly contentHash?: string; + readonly description?: string; + readonly displayName?: string; + readonly inputs?: ValidationTestInput[]; + readonly owners?: string[]; + readonly provisioningState?: ResourceProvisioningState; + readonly testStoreUri?: string; +} + +// @public +export interface ValidationTestVersionsGetOptionalParams extends OperationOptions { +} + +// @public +export interface ValidationTestVersionsListOptionalParams extends OperationOptions { + filter?: string; +} + +// @public +export interface ValidationTestVersionsOperations { + get: (validationTestName: string, version: string, options?: ValidationTestVersionsGetOptionalParams) => Promise; + list: (validationTestName: string, options?: ValidationTestVersionsListOptionalParams) => PagedAsyncIterableIterator; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/platformvalidation/arm-platformvalidation/sample.env b/sdk/platformvalidation/arm-platformvalidation/sample.env new file mode 100644 index 000000000000..508439fc7d62 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/sample.env @@ -0,0 +1 @@ +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/sdk/platformvalidation/arm-platformvalidation/samples-dev/cloudValidationsCreateOrUpdateSample.ts b/sdk/platformvalidation/arm-platformvalidation/samples-dev/cloudValidationsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..fb971465ade3 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples-dev/cloudValidationsCreateOrUpdateSample.ts @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { PlatformValidationClient } from "@azure/arm-platformvalidation"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to create or update a cloud validation + * + * @summary create or update a cloud validation + * x-ms-original-file: 2026-08-01-preview/CloudValidations_CreateOrUpdate_MaximumSet_Gen.json + */ +async function cloudValidationsCreateOrUpdateMaximumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const result = await client.cloudValidations.createOrUpdate("rgvalidate", "cvtest01", { + properties: { + description: + "Cloud validation that groups platform validation execution plans for the target subscription.", + }, + tags: { environment: "production" }, + location: "southcentralus", + }); + console.log(result); +} + +async function main(): Promise { + await cloudValidationsCreateOrUpdateMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples-dev/cloudValidationsDeleteSample.ts b/sdk/platformvalidation/arm-platformvalidation/samples-dev/cloudValidationsDeleteSample.ts new file mode 100644 index 000000000000..4081dc25d1c1 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples-dev/cloudValidationsDeleteSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { PlatformValidationClient } from "@azure/arm-platformvalidation"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to delete a cloud validation + * + * @summary delete a cloud validation + * x-ms-original-file: 2026-08-01-preview/CloudValidations_Delete_MaximumSet_Gen.json + */ +async function cloudValidationsDeleteMaximumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + await client.cloudValidations.delete("rgvalidate", "cvtest01"); +} + +async function main(): Promise { + await cloudValidationsDeleteMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples-dev/cloudValidationsGetSample.ts b/sdk/platformvalidation/arm-platformvalidation/samples-dev/cloudValidationsGetSample.ts new file mode 100644 index 000000000000..1ddbd3e45b78 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples-dev/cloudValidationsGetSample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { PlatformValidationClient } from "@azure/arm-platformvalidation"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to get a cloud validation + * + * @summary get a cloud validation + * x-ms-original-file: 2026-08-01-preview/CloudValidations_Get_MaximumSet_Gen.json + */ +async function cloudValidationsGetMaximumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const result = await client.cloudValidations.get("rgvalidate", "cvtest01"); + console.log(result); +} + +async function main(): Promise { + await cloudValidationsGetMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples-dev/cloudValidationsListByResourceGroupSample.ts b/sdk/platformvalidation/arm-platformvalidation/samples-dev/cloudValidationsListByResourceGroupSample.ts new file mode 100644 index 000000000000..ca7016962013 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples-dev/cloudValidationsListByResourceGroupSample.ts @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { PlatformValidationClient } from "@azure/arm-platformvalidation"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to list cloud validations by resource group + * + * @summary list cloud validations by resource group + * x-ms-original-file: 2026-08-01-preview/CloudValidations_ListByResourceGroup_MaximumSet_Gen.json + */ +async function cloudValidationsListByResourceGroupMaximumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.cloudValidations.listByResourceGroup("rgvalidate")) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to list cloud validations by resource group + * + * @summary list cloud validations by resource group + * x-ms-original-file: 2026-08-01-preview/CloudValidations_ListByResourceGroup_MinimumSet_Gen.json + */ +async function cloudValidationsListByResourceGroupMinimumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.cloudValidations.listByResourceGroup("rgplatformvalidation")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await cloudValidationsListByResourceGroupMaximumSet(); + await cloudValidationsListByResourceGroupMinimumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples-dev/cloudValidationsListBySubscriptionSample.ts b/sdk/platformvalidation/arm-platformvalidation/samples-dev/cloudValidationsListBySubscriptionSample.ts new file mode 100644 index 000000000000..efbb42605f06 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples-dev/cloudValidationsListBySubscriptionSample.ts @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { PlatformValidationClient } from "@azure/arm-platformvalidation"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to list cloud validations by subscription + * + * @summary list cloud validations by subscription + * x-ms-original-file: 2026-08-01-preview/CloudValidations_ListBySubscription_MaximumSet_Gen.json + */ +async function cloudValidationsListBySubscriptionMaximumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.cloudValidations.listBySubscription()) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to list cloud validations by subscription + * + * @summary list cloud validations by subscription + * x-ms-original-file: 2026-08-01-preview/CloudValidations_ListBySubscription_MinimumSet_Gen.json + */ +async function cloudValidationsListBySubscriptionMinimumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.cloudValidations.listBySubscription()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await cloudValidationsListBySubscriptionMaximumSet(); + await cloudValidationsListBySubscriptionMinimumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples-dev/cloudValidationsUpdateSample.ts b/sdk/platformvalidation/arm-platformvalidation/samples-dev/cloudValidationsUpdateSample.ts new file mode 100644 index 000000000000..f0b82adc81a9 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples-dev/cloudValidationsUpdateSample.ts @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { PlatformValidationClient } from "@azure/arm-platformvalidation"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to update a cloud validation + * + * @summary update a cloud validation + * x-ms-original-file: 2026-08-01-preview/CloudValidations_Update_MaximumSet_Gen.json + */ +async function cloudValidationsUpdateMaximumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const result = await client.cloudValidations.update("rgvalidate", "cvtest01", { + properties: { + description: + "Cloud validation that groups platform validation execution plans for the target subscription.", + }, + tags: { "cost-center": "platform-validation" }, + }); + console.log(result); +} + +async function main(): Promise { + await cloudValidationsUpdateMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples-dev/executionPlanRunsCreateOrUpdateSample.ts b/sdk/platformvalidation/arm-platformvalidation/samples-dev/executionPlanRunsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..ee4a20612d47 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples-dev/executionPlanRunsCreateOrUpdateSample.ts @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { PlatformValidationClient } from "@azure/arm-platformvalidation"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to create or update a validation test execution plan + * + * @summary create or update a validation test execution plan + * x-ms-original-file: 2026-08-01-preview/ExecutionPlanRuns_CreateOrUpdate_MaximumSet_Gen.json + */ +async function executionPlanRunsCreateOrUpdateMaximumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const result = await client.executionPlanRuns.createOrUpdate( + "rgvalidate", + "cvtest01", + "contoso-linux-cert", + "run-001", + { properties: { description: "Run the Contoso Linux image certification plan." } }, + ); + console.log(result); +} + +async function main(): Promise { + await executionPlanRunsCreateOrUpdateMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples-dev/executionPlanRunsDeleteSample.ts b/sdk/platformvalidation/arm-platformvalidation/samples-dev/executionPlanRunsDeleteSample.ts new file mode 100644 index 000000000000..ec0dc8632bc1 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples-dev/executionPlanRunsDeleteSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { PlatformValidationClient } from "@azure/arm-platformvalidation"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to delete a validation test execution plan run resource + * + * @summary delete a validation test execution plan run resource + * x-ms-original-file: 2026-08-01-preview/ExecutionPlanRuns_Delete_MaximumSet_Gen.json + */ +async function executionPlanRunsDeleteMaximumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + await client.executionPlanRuns.delete("rgvalidate", "cvtest01", "veptest01", "veprun01"); +} + +async function main(): Promise { + await executionPlanRunsDeleteMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples-dev/executionPlanRunsGetSample.ts b/sdk/platformvalidation/arm-platformvalidation/samples-dev/executionPlanRunsGetSample.ts new file mode 100644 index 000000000000..7213d89fb7e6 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples-dev/executionPlanRunsGetSample.ts @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { PlatformValidationClient } from "@azure/arm-platformvalidation"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to get a Validation test execution plan run details + * + * @summary get a Validation test execution plan run details + * x-ms-original-file: 2026-08-01-preview/ExecutionPlanRuns_Get_MaximumSet_Gen.json + */ +async function executionPlanRunsGetMaximumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const result = await client.executionPlanRuns.get( + "rgvalidate", + "cvtest01", + "contoso-linux-cert", + "run-001", + ); + console.log(result); +} + +async function main(): Promise { + await executionPlanRunsGetMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples-dev/executionPlanRunsListByExecutionPlanSample.ts b/sdk/platformvalidation/arm-platformvalidation/samples-dev/executionPlanRunsListByExecutionPlanSample.ts new file mode 100644 index 000000000000..f3891e912670 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples-dev/executionPlanRunsListByExecutionPlanSample.ts @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { PlatformValidationClient } from "@azure/arm-platformvalidation"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to list Validation test execution plan runs for an execution plan + * + * @summary list Validation test execution plan runs for an execution plan + * x-ms-original-file: 2026-08-01-preview/ExecutionPlanRuns_ListByExecutionPlan_MaximumSet_Gen.json + */ +async function executionPlanRunsListByExecutionPlanMaximumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.executionPlanRuns.listByExecutionPlan( + "rgvalidate", + "cvtest01", + "contoso-linux-cert", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await executionPlanRunsListByExecutionPlanMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples-dev/operationStatusGetSample.ts b/sdk/platformvalidation/arm-platformvalidation/samples-dev/operationStatusGetSample.ts new file mode 100644 index 000000000000..2b8b37980083 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples-dev/operationStatusGetSample.ts @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { PlatformValidationClient } from "@azure/arm-platformvalidation"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to returns the current status of an async operation. + * + * @summary returns the current status of an async operation. + * x-ms-original-file: 2026-08-01-preview/OperationStatus_Get_MaximumSet_Gen.json + */ +async function operationStatusGetMaximumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const result = await client.operationStatus.get( + "southcentralus", + "11111111-1111-4111-8111-111111111111", + ); + console.log(result); +} + +/** + * This sample demonstrates how to returns the current status of an async operation. + * + * @summary returns the current status of an async operation. + * x-ms-original-file: 2026-08-01-preview/OperationStatus_Get_MinimumSet_Gen.json + */ +async function operationStatusGetMaximumSetGeneratedByMinimumSetRule(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const result = await client.operationStatus.get( + "southcentralus", + "11111111-1111-4111-8111-111111111111", + ); + console.log(result); +} + +async function main(): Promise { + await operationStatusGetMaximumSet(); + await operationStatusGetMaximumSetGeneratedByMinimumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples-dev/operationsListSample.ts b/sdk/platformvalidation/arm-platformvalidation/samples-dev/operationsListSample.ts new file mode 100644 index 000000000000..abc104dc7b35 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples-dev/operationsListSample.ts @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { PlatformValidationClient } from "@azure/arm-platformvalidation"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to list the operations for the provider + * + * @summary list the operations for the provider + * x-ms-original-file: 2026-08-01-preview/Operations_List_MaximumSet_Gen.json + */ +async function operationsListMaximumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.operations.list()) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to list the operations for the provider + * + * @summary list the operations for the provider + * x-ms-original-file: 2026-08-01-preview/Operations_List_MinimumSet_Gen.json + */ +async function operationsListMinimumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.operations.list()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await operationsListMaximumSet(); + await operationsListMinimumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples-dev/validationExecutionPlansCreateOrUpdateSample.ts b/sdk/platformvalidation/arm-platformvalidation/samples-dev/validationExecutionPlansCreateOrUpdateSample.ts new file mode 100644 index 000000000000..4a4d5946cb5b --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples-dev/validationExecutionPlansCreateOrUpdateSample.ts @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { PlatformValidationClient } from "@azure/arm-platformvalidation"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to create or update a validation test execution plan + * + * @summary create or update a validation test execution plan + * x-ms-original-file: 2026-08-01-preview/ValidationExecutionPlans_CreateOrUpdate_MaximumSet_Gen.json + */ +async function validationExecutionPlansCreateOrUpdateMaximumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const result = await client.validationExecutionPlans.createOrUpdate( + "rgvalidate", + "cvtest01", + "contoso-linux-cert", + { + properties: { + description: + "Runs all public Linux-compatible AzCertify catalog tests against the Contoso Linux image.", + planConfigurationJson: + '{"apiVersion":"microsoft.PlatformValidation/validationExecutionPlan.v0","kind":"ValidationExecutionPlan","metadata":{"name":"contoso-linux-cert"},"parameters":{"certificationPackageReference":{"osType":"Linux","vmGenerationType":"V1","architectureType":"X64","recommendedVMSizes":["Standard_D4s_v3"],"storageProfile":{"osDiskImage":{"sourceVhdUri":"https://contoso.blob.core.windows.net/vhds/img.vhd?"},"dataDiskImages":[]},"additionalProperties":{}}},"authoring":{"steps":[{"name":"os-disk-size","type":"test","testRef":"/providers/Microsoft.PlatformValidation/validationTests/os-disk-size/versions/1.0.0"},{"name":"data-disk-size","type":"test","testRef":"/providers/Microsoft.PlatformValidation/validationTests/data-disk-size/versions/1.0.0"},{"name":"malware-defender","type":"test","testRef":"/providers/Microsoft.PlatformValidation/validationTests/malware-defender/versions/1.0.0"},{"name":"malware-esrp","type":"test","testRef":"/providers/Microsoft.PlatformValidation/validationTests/malware-esrp/versions/1.0.0"},{"name":"linux-quality-validation","type":"test","testRef":"/providers/Microsoft.PlatformValidation/validationTests/linux-quality-validation/versions/1.0.0","inputs":{"concurrency":1,"testSuite":[{"testNames":["smoke_test","validate_netvsc_reload"]}]}}]}}', + }, + tags: { "owner-team": "azure-platform-validation" }, + location: "southcentralus", + }, + ); + console.log(result); +} + +async function main(): Promise { + await validationExecutionPlansCreateOrUpdateMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples-dev/validationExecutionPlansDeleteSample.ts b/sdk/platformvalidation/arm-platformvalidation/samples-dev/validationExecutionPlansDeleteSample.ts new file mode 100644 index 000000000000..08ed9cb6f8cb --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples-dev/validationExecutionPlansDeleteSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { PlatformValidationClient } from "@azure/arm-platformvalidation"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to delete a validation test execution plan + * + * @summary delete a validation test execution plan + * x-ms-original-file: 2026-08-01-preview/ValidationExecutionPlans_Delete_MaximumSet_Gen.json + */ +async function validationExecutionPlansDeleteMaximumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + await client.validationExecutionPlans.delete("rgvalidate", "cvtest01", "veptest01"); +} + +async function main(): Promise { + await validationExecutionPlansDeleteMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples-dev/validationExecutionPlansGetSample.ts b/sdk/platformvalidation/arm-platformvalidation/samples-dev/validationExecutionPlansGetSample.ts new file mode 100644 index 000000000000..5111d4ffc1d2 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples-dev/validationExecutionPlansGetSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { PlatformValidationClient } from "@azure/arm-platformvalidation"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to get a validation test execution plan + * + * @summary get a validation test execution plan + * x-ms-original-file: 2026-08-01-preview/ValidationExecutionPlans_Get_MaximumSet_Gen.json + */ +async function validationExecutionPlansGetMaximumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const result = await client.validationExecutionPlans.get( + "rgvalidate", + "cvtest01", + "contoso-linux-cert", + ); + console.log(result); +} + +async function main(): Promise { + await validationExecutionPlansGetMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples-dev/validationExecutionPlansListByResourceGroupSample.ts b/sdk/platformvalidation/arm-platformvalidation/samples-dev/validationExecutionPlansListByResourceGroupSample.ts new file mode 100644 index 000000000000..1ae2dea11bec --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples-dev/validationExecutionPlansListByResourceGroupSample.ts @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { PlatformValidationClient } from "@azure/arm-platformvalidation"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to list validation test execution plans by resource group + * + * @summary list validation test execution plans by resource group + * x-ms-original-file: 2026-08-01-preview/ValidationExecutionPlans_ListByResourceGroup_MaximumSet_Gen.json + */ +async function validationExecutionPlansListByResourceGroupMaximumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.validationExecutionPlans.listByResourceGroup( + "rgvalidate", + "cvtest01", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await validationExecutionPlansListByResourceGroupMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples-dev/validationExecutionPlansUpdateSample.ts b/sdk/platformvalidation/arm-platformvalidation/samples-dev/validationExecutionPlansUpdateSample.ts new file mode 100644 index 000000000000..ba2764712ec1 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples-dev/validationExecutionPlansUpdateSample.ts @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { PlatformValidationClient } from "@azure/arm-platformvalidation"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to update a validation test execution plan + * + * @summary update a validation test execution plan + * x-ms-original-file: 2026-08-01-preview/ValidationExecutionPlans_Update_MaximumSet_Gen.json + */ +async function validationExecutionPlansUpdateMaximumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const result = await client.validationExecutionPlans.update( + "rgvalidate", + "cvtest01", + "veptest01", + { + properties: { + description: + "Validation execution plan that runs the network connectivity checks against the target image.", + planConfigurationJson: + '{"apiVersion":"microsoft.PlatformValidation/validationExecutionPlan.v0","kind":"ValidationExecutionPlan","metadata":{"name":"contoso-linux-cert"},"parameters":{"certificationPackageReference":{"osType":"Linux","vmGenerationType":"V1","architectureType":"X64","recommendedVMSizes":["Standard_D4s_v3"],"storageProfile":{"osDiskImage":{"sourceVhdUri":"https://contoso.blob.core.windows.net/vhds/img.vhd?"},"dataDiskImages":[]},"additionalProperties":{}}},"authoring":{"steps":[{"name":"os-disk-size","type":"test","testRef":"/providers/Microsoft.PlatformValidation/validationTests/os-disk-size/versions/1.0.0"},{"name":"data-disk-size","type":"test","testRef":"/providers/Microsoft.PlatformValidation/validationTests/data-disk-size/versions/1.0.0"},{"name":"malware-defender","type":"test","testRef":"/providers/Microsoft.PlatformValidation/validationTests/malware-defender/versions/1.0.0"},{"name":"malware-esrp","type":"test","testRef":"/providers/Microsoft.PlatformValidation/validationTests/malware-esrp/versions/1.0.0"},{"name":"linux-quality-validation","type":"test","testRef":"/providers/Microsoft.PlatformValidation/validationTests/linux-quality-validation/versions/1.0.0","inputs":{"concurrency":1,"testSuite":[{"testNames":["smoke_test","validate_netvsc_reload"]}]}}]}}', + }, + tags: { environment: "production" }, + }, + ); + console.log(result); +} + +async function main(): Promise { + await validationExecutionPlansUpdateMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples-dev/validationTestCategoriesGetSample.ts b/sdk/platformvalidation/arm-platformvalidation/samples-dev/validationTestCategoriesGetSample.ts new file mode 100644 index 000000000000..83dc411bd06a --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples-dev/validationTestCategoriesGetSample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { PlatformValidationClient } from "@azure/arm-platformvalidation"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to get a validation test category catalog entry + * + * @summary get a validation test category catalog entry + * x-ms-original-file: 2026-08-01-preview/ValidationTestCategories_Get_MaximumSet_Gen.json + */ +async function validationTestCategoriesGetMaximumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const result = await client.validationTestCategories.get("linux-quality-validations"); + console.log(result); +} + +async function main(): Promise { + await validationTestCategoriesGetMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples-dev/validationTestCategoriesListBySubscriptionSample.ts b/sdk/platformvalidation/arm-platformvalidation/samples-dev/validationTestCategoriesListBySubscriptionSample.ts new file mode 100644 index 000000000000..0355a346be7c --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples-dev/validationTestCategoriesListBySubscriptionSample.ts @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { PlatformValidationClient } from "@azure/arm-platformvalidation"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to list validation test category catalog entries for a subscription + * + * @summary list validation test category catalog entries for a subscription + * x-ms-original-file: 2026-08-01-preview/ValidationTestCategories_ListBySubscription_MaximumSet_Gen.json + */ +async function validationTestCategoriesListBySubscriptionMaximumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.validationTestCategories.listBySubscription({ + filter: "audience eq 'Public'", + })) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to list validation test category catalog entries for a subscription + * + * @summary list validation test category catalog entries for a subscription + * x-ms-original-file: 2026-08-01-preview/ValidationTestCategories_ListBySubscription_MinimumSet_Gen.json + */ +async function validationTestCategoriesListBySubscriptionMinimumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.validationTestCategories.listBySubscription()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await validationTestCategoriesListBySubscriptionMaximumSet(); + await validationTestCategoriesListBySubscriptionMinimumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples-dev/validationTestRunsGetSample.ts b/sdk/platformvalidation/arm-platformvalidation/samples-dev/validationTestRunsGetSample.ts new file mode 100644 index 000000000000..ce0edbaa4acb --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples-dev/validationTestRunsGetSample.ts @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { PlatformValidationClient } from "@azure/arm-platformvalidation"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to get a validation test run details + * + * @summary get a validation test run details + * x-ms-original-file: 2026-08-01-preview/ValidationTestRuns_Get_MaximumSet_Gen.json + */ +async function validationTestRunsGetMaximumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const result = await client.validationTestRuns.get( + "rgvalidate", + "cvtest01", + "contoso-linux-cert", + "run-001", + "linux-quality-run", + ); + console.log(result); +} + +async function main(): Promise { + await validationTestRunsGetMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples-dev/validationTestRunsListByExecutionPlanRunSample.ts b/sdk/platformvalidation/arm-platformvalidation/samples-dev/validationTestRunsListByExecutionPlanRunSample.ts new file mode 100644 index 000000000000..d21ba35c9c6e --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples-dev/validationTestRunsListByExecutionPlanRunSample.ts @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { PlatformValidationClient } from "@azure/arm-platformvalidation"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to list validation test runs for an execution plan run + * + * @summary list validation test runs for an execution plan run + * x-ms-original-file: 2026-08-01-preview/ValidationTestRuns_ListByExecutionPlanRun_MaximumSet_Gen.json + */ +async function validationTestRunsListByExecutionPlanRunMaximumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.validationTestRuns.listByExecutionPlanRun( + "rgvalidate", + "cvtest01", + "contoso-linux-cert", + "run-001", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await validationTestRunsListByExecutionPlanRunMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples-dev/validationTestVersionsGetSample.ts b/sdk/platformvalidation/arm-platformvalidation/samples-dev/validationTestVersionsGetSample.ts new file mode 100644 index 000000000000..2a53db5982e0 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples-dev/validationTestVersionsGetSample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { PlatformValidationClient } from "@azure/arm-platformvalidation"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to get a validation test version catalog entry + * + * @summary get a validation test version catalog entry + * x-ms-original-file: 2026-08-01-preview/ValidationTestVersions_Get_MaximumSet_Gen.json + */ +async function validationTestVersionsGetMaximumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const result = await client.validationTestVersions.get("linux-quality-validation", "1.0.0"); + console.log(result); +} + +async function main(): Promise { + await validationTestVersionsGetMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples-dev/validationTestVersionsListSample.ts b/sdk/platformvalidation/arm-platformvalidation/samples-dev/validationTestVersionsListSample.ts new file mode 100644 index 000000000000..4817ac9d944f --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples-dev/validationTestVersionsListSample.ts @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { PlatformValidationClient } from "@azure/arm-platformvalidation"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to list validation test version catalog entries + * + * @summary list validation test version catalog entries + * x-ms-original-file: 2026-08-01-preview/ValidationTestVersions_List_MaximumSet_Gen.json + */ +async function validationTestVersionsListMaximumSetGeneratedByMaximumSetRule(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.validationTestVersions.list("linux-quality-validation", { + filter: "audience eq 'Public'", + })) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await validationTestVersionsListMaximumSetGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples-dev/validationTestsGetSample.ts b/sdk/platformvalidation/arm-platformvalidation/samples-dev/validationTestsGetSample.ts new file mode 100644 index 000000000000..518dc24d0fcf --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples-dev/validationTestsGetSample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { PlatformValidationClient } from "@azure/arm-platformvalidation"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to get a validation test catalog entry + * + * @summary get a validation test catalog entry + * x-ms-original-file: 2026-08-01-preview/ValidationTests_Get_MaximumSet_Gen.json + */ +async function validationTestsGetMaximumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const result = await client.validationTests.get("linux-quality-validation"); + console.log(result); +} + +async function main(): Promise { + await validationTestsGetMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples-dev/validationTestsListBySubscriptionSample.ts b/sdk/platformvalidation/arm-platformvalidation/samples-dev/validationTestsListBySubscriptionSample.ts new file mode 100644 index 000000000000..c50f5dd48b6b --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples-dev/validationTestsListBySubscriptionSample.ts @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { PlatformValidationClient } from "@azure/arm-platformvalidation"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to list validation test catalog entries for a subscription + * + * @summary list validation test catalog entries for a subscription + * x-ms-original-file: 2026-08-01-preview/ValidationTests_ListBySubscription_MaximumSet_Gen.json + */ +async function validationTestsListBySubscriptionMaximumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.validationTests.listBySubscription({ + filter: "audience eq 'Public'", + })) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to list validation test catalog entries for a subscription + * + * @summary list validation test catalog entries for a subscription + * x-ms-original-file: 2026-08-01-preview/ValidationTests_ListBySubscription_MinimumSet_Gen.json + */ +async function validationTestsListBySubscriptionMinimumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.validationTests.listBySubscription()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await validationTestsListBySubscriptionMaximumSet(); + await validationTestsListBySubscriptionMinimumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/README.md b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/README.md new file mode 100644 index 000000000000..9e37f941f8eb --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/README.md @@ -0,0 +1,98 @@ +# @azure/arm-platformvalidation client library samples for JavaScript (Beta) + +These sample programs show how to use the JavaScript client libraries for @azure/arm-platformvalidation in some common scenarios. + +| **File Name** | **Description** | +| --------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [cloudValidationsCreateOrUpdateSample.js][cloudvalidationscreateorupdatesample] | create or update a cloud validation x-ms-original-file: 2026-08-01-preview/CloudValidations_CreateOrUpdate_MaximumSet_Gen.json | +| [cloudValidationsDeleteSample.js][cloudvalidationsdeletesample] | delete a cloud validation x-ms-original-file: 2026-08-01-preview/CloudValidations_Delete_MaximumSet_Gen.json | +| [cloudValidationsGetSample.js][cloudvalidationsgetsample] | get a cloud validation x-ms-original-file: 2026-08-01-preview/CloudValidations_Get_MaximumSet_Gen.json | +| [cloudValidationsListByResourceGroupSample.js][cloudvalidationslistbyresourcegroupsample] | list cloud validations by resource group x-ms-original-file: 2026-08-01-preview/CloudValidations_ListByResourceGroup_MaximumSet_Gen.json | +| [cloudValidationsListBySubscriptionSample.js][cloudvalidationslistbysubscriptionsample] | list cloud validations by subscription x-ms-original-file: 2026-08-01-preview/CloudValidations_ListBySubscription_MaximumSet_Gen.json | +| [cloudValidationsUpdateSample.js][cloudvalidationsupdatesample] | update a cloud validation x-ms-original-file: 2026-08-01-preview/CloudValidations_Update_MaximumSet_Gen.json | +| [executionPlanRunsCreateOrUpdateSample.js][executionplanrunscreateorupdatesample] | create or update a validation test execution plan x-ms-original-file: 2026-08-01-preview/ExecutionPlanRuns_CreateOrUpdate_MaximumSet_Gen.json | +| [executionPlanRunsDeleteSample.js][executionplanrunsdeletesample] | delete a validation test execution plan run resource x-ms-original-file: 2026-08-01-preview/ExecutionPlanRuns_Delete_MaximumSet_Gen.json | +| [executionPlanRunsGetSample.js][executionplanrunsgetsample] | get a Validation test execution plan run details x-ms-original-file: 2026-08-01-preview/ExecutionPlanRuns_Get_MaximumSet_Gen.json | +| [executionPlanRunsListByExecutionPlanSample.js][executionplanrunslistbyexecutionplansample] | list Validation test execution plan runs for an execution plan x-ms-original-file: 2026-08-01-preview/ExecutionPlanRuns_ListByExecutionPlan_MaximumSet_Gen.json | +| [operationStatusGetSample.js][operationstatusgetsample] | returns the current status of an async operation. x-ms-original-file: 2026-08-01-preview/OperationStatus_Get_MaximumSet_Gen.json | +| [operationsListSample.js][operationslistsample] | list the operations for the provider x-ms-original-file: 2026-08-01-preview/Operations_List_MaximumSet_Gen.json | +| [validationExecutionPlansCreateOrUpdateSample.js][validationexecutionplanscreateorupdatesample] | create or update a validation test execution plan x-ms-original-file: 2026-08-01-preview/ValidationExecutionPlans_CreateOrUpdate_MaximumSet_Gen.json | +| [validationExecutionPlansDeleteSample.js][validationexecutionplansdeletesample] | delete a validation test execution plan x-ms-original-file: 2026-08-01-preview/ValidationExecutionPlans_Delete_MaximumSet_Gen.json | +| [validationExecutionPlansGetSample.js][validationexecutionplansgetsample] | get a validation test execution plan x-ms-original-file: 2026-08-01-preview/ValidationExecutionPlans_Get_MaximumSet_Gen.json | +| [validationExecutionPlansListByResourceGroupSample.js][validationexecutionplanslistbyresourcegroupsample] | list validation test execution plans by resource group x-ms-original-file: 2026-08-01-preview/ValidationExecutionPlans_ListByResourceGroup_MaximumSet_Gen.json | +| [validationExecutionPlansUpdateSample.js][validationexecutionplansupdatesample] | update a validation test execution plan x-ms-original-file: 2026-08-01-preview/ValidationExecutionPlans_Update_MaximumSet_Gen.json | +| [validationTestCategoriesGetSample.js][validationtestcategoriesgetsample] | get a validation test category catalog entry x-ms-original-file: 2026-08-01-preview/ValidationTestCategories_Get_MaximumSet_Gen.json | +| [validationTestCategoriesListBySubscriptionSample.js][validationtestcategorieslistbysubscriptionsample] | list validation test category catalog entries for a subscription x-ms-original-file: 2026-08-01-preview/ValidationTestCategories_ListBySubscription_MaximumSet_Gen.json | +| [validationTestRunsGetSample.js][validationtestrunsgetsample] | get a validation test run details x-ms-original-file: 2026-08-01-preview/ValidationTestRuns_Get_MaximumSet_Gen.json | +| [validationTestRunsListByExecutionPlanRunSample.js][validationtestrunslistbyexecutionplanrunsample] | list validation test runs for an execution plan run x-ms-original-file: 2026-08-01-preview/ValidationTestRuns_ListByExecutionPlanRun_MaximumSet_Gen.json | +| [validationTestVersionsGetSample.js][validationtestversionsgetsample] | get a validation test version catalog entry x-ms-original-file: 2026-08-01-preview/ValidationTestVersions_Get_MaximumSet_Gen.json | +| [validationTestVersionsListSample.js][validationtestversionslistsample] | list validation test version catalog entries x-ms-original-file: 2026-08-01-preview/ValidationTestVersions_List_MaximumSet_Gen.json | +| [validationTestsGetSample.js][validationtestsgetsample] | get a validation test catalog entry x-ms-original-file: 2026-08-01-preview/ValidationTests_Get_MaximumSet_Gen.json | +| [validationTestsListBySubscriptionSample.js][validationtestslistbysubscriptionsample] | list validation test catalog entries for a subscription x-ms-original-file: 2026-08-01-preview/ValidationTests_ListBySubscription_MaximumSet_Gen.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +3. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node cloudValidationsCreateOrUpdateSample.js +``` + +Alternatively, run a single sample with the required environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): + +```bash +node cloudValidationsCreateOrUpdateSample.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[cloudvalidationscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/cloudValidationsCreateOrUpdateSample.js +[cloudvalidationsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/cloudValidationsDeleteSample.js +[cloudvalidationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/cloudValidationsGetSample.js +[cloudvalidationslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/cloudValidationsListByResourceGroupSample.js +[cloudvalidationslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/cloudValidationsListBySubscriptionSample.js +[cloudvalidationsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/cloudValidationsUpdateSample.js +[executionplanrunscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/executionPlanRunsCreateOrUpdateSample.js +[executionplanrunsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/executionPlanRunsDeleteSample.js +[executionplanrunsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/executionPlanRunsGetSample.js +[executionplanrunslistbyexecutionplansample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/executionPlanRunsListByExecutionPlanSample.js +[operationstatusgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/operationStatusGetSample.js +[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/operationsListSample.js +[validationexecutionplanscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/validationExecutionPlansCreateOrUpdateSample.js +[validationexecutionplansdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/validationExecutionPlansDeleteSample.js +[validationexecutionplansgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/validationExecutionPlansGetSample.js +[validationexecutionplanslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/validationExecutionPlansListByResourceGroupSample.js +[validationexecutionplansupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/validationExecutionPlansUpdateSample.js +[validationtestcategoriesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/validationTestCategoriesGetSample.js +[validationtestcategorieslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/validationTestCategoriesListBySubscriptionSample.js +[validationtestrunsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/validationTestRunsGetSample.js +[validationtestrunslistbyexecutionplanrunsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/validationTestRunsListByExecutionPlanRunSample.js +[validationtestversionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/validationTestVersionsGetSample.js +[validationtestversionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/validationTestVersionsListSample.js +[validationtestsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/validationTestsGetSample.js +[validationtestslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/validationTestsListBySubscriptionSample.js +[apiref]: https://learn.microsoft.com/javascript/api/@azure/arm-platformvalidation?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/platformvalidation/arm-platformvalidation/README.md diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/cloudValidationsCreateOrUpdateSample.js b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/cloudValidationsCreateOrUpdateSample.js new file mode 100644 index 000000000000..f737966e0957 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/cloudValidationsCreateOrUpdateSample.js @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { PlatformValidationClient } = require("@azure/arm-platformvalidation"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to create or update a cloud validation + * + * @summary create or update a cloud validation + * x-ms-original-file: 2026-08-01-preview/CloudValidations_CreateOrUpdate_MaximumSet_Gen.json + */ +async function cloudValidationsCreateOrUpdateMaximumSet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const result = await client.cloudValidations.createOrUpdate("rgvalidate", "cvtest01", { + properties: { + description: + "Cloud validation that groups platform validation execution plans for the target subscription.", + }, + tags: { environment: "production" }, + location: "southcentralus", + }); + console.log(result); +} + +async function main() { + await cloudValidationsCreateOrUpdateMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/cloudValidationsDeleteSample.js b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/cloudValidationsDeleteSample.js new file mode 100644 index 000000000000..79d6e09cf42f --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/cloudValidationsDeleteSample.js @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { PlatformValidationClient } = require("@azure/arm-platformvalidation"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to delete a cloud validation + * + * @summary delete a cloud validation + * x-ms-original-file: 2026-08-01-preview/CloudValidations_Delete_MaximumSet_Gen.json + */ +async function cloudValidationsDeleteMaximumSet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + await client.cloudValidations.delete("rgvalidate", "cvtest01"); +} + +async function main() { + await cloudValidationsDeleteMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/cloudValidationsGetSample.js b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/cloudValidationsGetSample.js new file mode 100644 index 000000000000..7a4245823dee --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/cloudValidationsGetSample.js @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { PlatformValidationClient } = require("@azure/arm-platformvalidation"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to get a cloud validation + * + * @summary get a cloud validation + * x-ms-original-file: 2026-08-01-preview/CloudValidations_Get_MaximumSet_Gen.json + */ +async function cloudValidationsGetMaximumSet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const result = await client.cloudValidations.get("rgvalidate", "cvtest01"); + console.log(result); +} + +async function main() { + await cloudValidationsGetMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/cloudValidationsListByResourceGroupSample.js b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/cloudValidationsListByResourceGroupSample.js new file mode 100644 index 000000000000..d6c71376de6f --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/cloudValidationsListByResourceGroupSample.js @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { PlatformValidationClient } = require("@azure/arm-platformvalidation"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to list cloud validations by resource group + * + * @summary list cloud validations by resource group + * x-ms-original-file: 2026-08-01-preview/CloudValidations_ListByResourceGroup_MaximumSet_Gen.json + */ +async function cloudValidationsListByResourceGroupMaximumSet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.cloudValidations.listByResourceGroup("rgvalidate")) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to list cloud validations by resource group + * + * @summary list cloud validations by resource group + * x-ms-original-file: 2026-08-01-preview/CloudValidations_ListByResourceGroup_MinimumSet_Gen.json + */ +async function cloudValidationsListByResourceGroupMinimumSet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.cloudValidations.listByResourceGroup("rgplatformvalidation")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await cloudValidationsListByResourceGroupMaximumSet(); + await cloudValidationsListByResourceGroupMinimumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/cloudValidationsListBySubscriptionSample.js b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/cloudValidationsListBySubscriptionSample.js new file mode 100644 index 000000000000..2b9ed2f37273 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/cloudValidationsListBySubscriptionSample.js @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { PlatformValidationClient } = require("@azure/arm-platformvalidation"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to list cloud validations by subscription + * + * @summary list cloud validations by subscription + * x-ms-original-file: 2026-08-01-preview/CloudValidations_ListBySubscription_MaximumSet_Gen.json + */ +async function cloudValidationsListBySubscriptionMaximumSet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.cloudValidations.listBySubscription()) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to list cloud validations by subscription + * + * @summary list cloud validations by subscription + * x-ms-original-file: 2026-08-01-preview/CloudValidations_ListBySubscription_MinimumSet_Gen.json + */ +async function cloudValidationsListBySubscriptionMinimumSet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.cloudValidations.listBySubscription()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await cloudValidationsListBySubscriptionMaximumSet(); + await cloudValidationsListBySubscriptionMinimumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/cloudValidationsUpdateSample.js b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/cloudValidationsUpdateSample.js new file mode 100644 index 000000000000..961bc19f1dee --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/cloudValidationsUpdateSample.js @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { PlatformValidationClient } = require("@azure/arm-platformvalidation"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to update a cloud validation + * + * @summary update a cloud validation + * x-ms-original-file: 2026-08-01-preview/CloudValidations_Update_MaximumSet_Gen.json + */ +async function cloudValidationsUpdateMaximumSet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const result = await client.cloudValidations.update("rgvalidate", "cvtest01", { + properties: { + description: + "Cloud validation that groups platform validation execution plans for the target subscription.", + }, + tags: { "cost-center": "platform-validation" }, + }); + console.log(result); +} + +async function main() { + await cloudValidationsUpdateMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/executionPlanRunsCreateOrUpdateSample.js b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/executionPlanRunsCreateOrUpdateSample.js new file mode 100644 index 000000000000..ae521028d49a --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/executionPlanRunsCreateOrUpdateSample.js @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { PlatformValidationClient } = require("@azure/arm-platformvalidation"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to create or update a validation test execution plan + * + * @summary create or update a validation test execution plan + * x-ms-original-file: 2026-08-01-preview/ExecutionPlanRuns_CreateOrUpdate_MaximumSet_Gen.json + */ +async function executionPlanRunsCreateOrUpdateMaximumSet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const result = await client.executionPlanRuns.createOrUpdate( + "rgvalidate", + "cvtest01", + "contoso-linux-cert", + "run-001", + { properties: { description: "Run the Contoso Linux image certification plan." } }, + ); + console.log(result); +} + +async function main() { + await executionPlanRunsCreateOrUpdateMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/executionPlanRunsDeleteSample.js b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/executionPlanRunsDeleteSample.js new file mode 100644 index 000000000000..1c66d9aa1a11 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/executionPlanRunsDeleteSample.js @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { PlatformValidationClient } = require("@azure/arm-platformvalidation"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to delete a validation test execution plan run resource + * + * @summary delete a validation test execution plan run resource + * x-ms-original-file: 2026-08-01-preview/ExecutionPlanRuns_Delete_MaximumSet_Gen.json + */ +async function executionPlanRunsDeleteMaximumSet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + await client.executionPlanRuns.delete("rgvalidate", "cvtest01", "veptest01", "veprun01"); +} + +async function main() { + await executionPlanRunsDeleteMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/executionPlanRunsGetSample.js b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/executionPlanRunsGetSample.js new file mode 100644 index 000000000000..3dac64356ad7 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/executionPlanRunsGetSample.js @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { PlatformValidationClient } = require("@azure/arm-platformvalidation"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to get a Validation test execution plan run details + * + * @summary get a Validation test execution plan run details + * x-ms-original-file: 2026-08-01-preview/ExecutionPlanRuns_Get_MaximumSet_Gen.json + */ +async function executionPlanRunsGetMaximumSet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const result = await client.executionPlanRuns.get( + "rgvalidate", + "cvtest01", + "contoso-linux-cert", + "run-001", + ); + console.log(result); +} + +async function main() { + await executionPlanRunsGetMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/executionPlanRunsListByExecutionPlanSample.js b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/executionPlanRunsListByExecutionPlanSample.js new file mode 100644 index 000000000000..f238451dfc2a --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/executionPlanRunsListByExecutionPlanSample.js @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { PlatformValidationClient } = require("@azure/arm-platformvalidation"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to list Validation test execution plan runs for an execution plan + * + * @summary list Validation test execution plan runs for an execution plan + * x-ms-original-file: 2026-08-01-preview/ExecutionPlanRuns_ListByExecutionPlan_MaximumSet_Gen.json + */ +async function executionPlanRunsListByExecutionPlanMaximumSet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.executionPlanRuns.listByExecutionPlan( + "rgvalidate", + "cvtest01", + "contoso-linux-cert", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await executionPlanRunsListByExecutionPlanMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/operationStatusGetSample.js b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/operationStatusGetSample.js new file mode 100644 index 000000000000..87dc05e87150 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/operationStatusGetSample.js @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { PlatformValidationClient } = require("@azure/arm-platformvalidation"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to returns the current status of an async operation. + * + * @summary returns the current status of an async operation. + * x-ms-original-file: 2026-08-01-preview/OperationStatus_Get_MaximumSet_Gen.json + */ +async function operationStatusGetMaximumSet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const result = await client.operationStatus.get( + "southcentralus", + "11111111-1111-4111-8111-111111111111", + ); + console.log(result); +} + +/** + * This sample demonstrates how to returns the current status of an async operation. + * + * @summary returns the current status of an async operation. + * x-ms-original-file: 2026-08-01-preview/OperationStatus_Get_MinimumSet_Gen.json + */ +async function operationStatusGetMaximumSetGeneratedByMinimumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const result = await client.operationStatus.get( + "southcentralus", + "11111111-1111-4111-8111-111111111111", + ); + console.log(result); +} + +async function main() { + await operationStatusGetMaximumSet(); + await operationStatusGetMaximumSetGeneratedByMinimumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/operationsListSample.js b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/operationsListSample.js new file mode 100644 index 000000000000..b28a5bfbbab8 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/operationsListSample.js @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { PlatformValidationClient } = require("@azure/arm-platformvalidation"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to list the operations for the provider + * + * @summary list the operations for the provider + * x-ms-original-file: 2026-08-01-preview/Operations_List_MaximumSet_Gen.json + */ +async function operationsListMaximumSet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.operations.list()) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to list the operations for the provider + * + * @summary list the operations for the provider + * x-ms-original-file: 2026-08-01-preview/Operations_List_MinimumSet_Gen.json + */ +async function operationsListMinimumSet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.operations.list()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await operationsListMaximumSet(); + await operationsListMinimumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/package.json b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/package.json new file mode 100644 index 000000000000..404b9af68e64 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/package.json @@ -0,0 +1,36 @@ +{ + "name": "@azure-samples/arm-platformvalidation-js-beta", + "private": true, + "version": "1.0.0", + "description": "@azure/arm-platformvalidation client library samples for JavaScript (Beta)", + "engines": { + "node": ">=22.0.0" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Azure/azure-sdk-for-js.git", + "directory": "sdk/platformvalidation/arm-platformvalidation" + }, + "keywords": [ + "node", + "azure", + "cloud", + "typescript", + "browser", + "isomorphic" + ], + "author": "Microsoft Corporation", + "license": "MIT", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/platformvalidation/arm-platformvalidation", + "dependencies": { + "@azure/arm-platformvalidation": "beta", + "dotenv": "latest", + "@azure/identity": "^4.13.0" + }, + "devDependencies": { + "cross-env": "latest" + } +} diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/sample.env b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/sample.env new file mode 100644 index 000000000000..508439fc7d62 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/sample.env @@ -0,0 +1 @@ +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/validationExecutionPlansCreateOrUpdateSample.js b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/validationExecutionPlansCreateOrUpdateSample.js new file mode 100644 index 000000000000..5f96aaae34a4 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/validationExecutionPlansCreateOrUpdateSample.js @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { PlatformValidationClient } = require("@azure/arm-platformvalidation"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to create or update a validation test execution plan + * + * @summary create or update a validation test execution plan + * x-ms-original-file: 2026-08-01-preview/ValidationExecutionPlans_CreateOrUpdate_MaximumSet_Gen.json + */ +async function validationExecutionPlansCreateOrUpdateMaximumSet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const result = await client.validationExecutionPlans.createOrUpdate( + "rgvalidate", + "cvtest01", + "contoso-linux-cert", + { + properties: { + description: + "Runs all public Linux-compatible AzCertify catalog tests against the Contoso Linux image.", + planConfigurationJson: + '{"apiVersion":"microsoft.PlatformValidation/validationExecutionPlan.v0","kind":"ValidationExecutionPlan","metadata":{"name":"contoso-linux-cert"},"parameters":{"certificationPackageReference":{"osType":"Linux","vmGenerationType":"V1","architectureType":"X64","recommendedVMSizes":["Standard_D4s_v3"],"storageProfile":{"osDiskImage":{"sourceVhdUri":"https://contoso.blob.core.windows.net/vhds/img.vhd?"},"dataDiskImages":[]},"additionalProperties":{}}},"authoring":{"steps":[{"name":"os-disk-size","type":"test","testRef":"/providers/Microsoft.PlatformValidation/validationTests/os-disk-size/versions/1.0.0"},{"name":"data-disk-size","type":"test","testRef":"/providers/Microsoft.PlatformValidation/validationTests/data-disk-size/versions/1.0.0"},{"name":"malware-defender","type":"test","testRef":"/providers/Microsoft.PlatformValidation/validationTests/malware-defender/versions/1.0.0"},{"name":"malware-esrp","type":"test","testRef":"/providers/Microsoft.PlatformValidation/validationTests/malware-esrp/versions/1.0.0"},{"name":"linux-quality-validation","type":"test","testRef":"/providers/Microsoft.PlatformValidation/validationTests/linux-quality-validation/versions/1.0.0","inputs":{"concurrency":1,"testSuite":[{"testNames":["smoke_test","validate_netvsc_reload"]}]}}]}}', + }, + tags: { "owner-team": "azure-platform-validation" }, + location: "southcentralus", + }, + ); + console.log(result); +} + +async function main() { + await validationExecutionPlansCreateOrUpdateMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/validationExecutionPlansDeleteSample.js b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/validationExecutionPlansDeleteSample.js new file mode 100644 index 000000000000..ff3255144e21 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/validationExecutionPlansDeleteSample.js @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { PlatformValidationClient } = require("@azure/arm-platformvalidation"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to delete a validation test execution plan + * + * @summary delete a validation test execution plan + * x-ms-original-file: 2026-08-01-preview/ValidationExecutionPlans_Delete_MaximumSet_Gen.json + */ +async function validationExecutionPlansDeleteMaximumSet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + await client.validationExecutionPlans.delete("rgvalidate", "cvtest01", "veptest01"); +} + +async function main() { + await validationExecutionPlansDeleteMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/validationExecutionPlansGetSample.js b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/validationExecutionPlansGetSample.js new file mode 100644 index 000000000000..0c55143b23bc --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/validationExecutionPlansGetSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { PlatformValidationClient } = require("@azure/arm-platformvalidation"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to get a validation test execution plan + * + * @summary get a validation test execution plan + * x-ms-original-file: 2026-08-01-preview/ValidationExecutionPlans_Get_MaximumSet_Gen.json + */ +async function validationExecutionPlansGetMaximumSet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const result = await client.validationExecutionPlans.get( + "rgvalidate", + "cvtest01", + "contoso-linux-cert", + ); + console.log(result); +} + +async function main() { + await validationExecutionPlansGetMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/validationExecutionPlansListByResourceGroupSample.js b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/validationExecutionPlansListByResourceGroupSample.js new file mode 100644 index 000000000000..c91a60757d98 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/validationExecutionPlansListByResourceGroupSample.js @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { PlatformValidationClient } = require("@azure/arm-platformvalidation"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to list validation test execution plans by resource group + * + * @summary list validation test execution plans by resource group + * x-ms-original-file: 2026-08-01-preview/ValidationExecutionPlans_ListByResourceGroup_MaximumSet_Gen.json + */ +async function validationExecutionPlansListByResourceGroupMaximumSet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.validationExecutionPlans.listByResourceGroup( + "rgvalidate", + "cvtest01", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await validationExecutionPlansListByResourceGroupMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/validationExecutionPlansUpdateSample.js b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/validationExecutionPlansUpdateSample.js new file mode 100644 index 000000000000..07eaaa296327 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/validationExecutionPlansUpdateSample.js @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { PlatformValidationClient } = require("@azure/arm-platformvalidation"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to update a validation test execution plan + * + * @summary update a validation test execution plan + * x-ms-original-file: 2026-08-01-preview/ValidationExecutionPlans_Update_MaximumSet_Gen.json + */ +async function validationExecutionPlansUpdateMaximumSet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const result = await client.validationExecutionPlans.update( + "rgvalidate", + "cvtest01", + "veptest01", + { + properties: { + description: + "Validation execution plan that runs the network connectivity checks against the target image.", + planConfigurationJson: + '{"apiVersion":"microsoft.PlatformValidation/validationExecutionPlan.v0","kind":"ValidationExecutionPlan","metadata":{"name":"contoso-linux-cert"},"parameters":{"certificationPackageReference":{"osType":"Linux","vmGenerationType":"V1","architectureType":"X64","recommendedVMSizes":["Standard_D4s_v3"],"storageProfile":{"osDiskImage":{"sourceVhdUri":"https://contoso.blob.core.windows.net/vhds/img.vhd?"},"dataDiskImages":[]},"additionalProperties":{}}},"authoring":{"steps":[{"name":"os-disk-size","type":"test","testRef":"/providers/Microsoft.PlatformValidation/validationTests/os-disk-size/versions/1.0.0"},{"name":"data-disk-size","type":"test","testRef":"/providers/Microsoft.PlatformValidation/validationTests/data-disk-size/versions/1.0.0"},{"name":"malware-defender","type":"test","testRef":"/providers/Microsoft.PlatformValidation/validationTests/malware-defender/versions/1.0.0"},{"name":"malware-esrp","type":"test","testRef":"/providers/Microsoft.PlatformValidation/validationTests/malware-esrp/versions/1.0.0"},{"name":"linux-quality-validation","type":"test","testRef":"/providers/Microsoft.PlatformValidation/validationTests/linux-quality-validation/versions/1.0.0","inputs":{"concurrency":1,"testSuite":[{"testNames":["smoke_test","validate_netvsc_reload"]}]}}]}}', + }, + tags: { environment: "production" }, + }, + ); + console.log(result); +} + +async function main() { + await validationExecutionPlansUpdateMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/validationTestCategoriesGetSample.js b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/validationTestCategoriesGetSample.js new file mode 100644 index 000000000000..5f3d6f4a1a96 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/validationTestCategoriesGetSample.js @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { PlatformValidationClient } = require("@azure/arm-platformvalidation"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to get a validation test category catalog entry + * + * @summary get a validation test category catalog entry + * x-ms-original-file: 2026-08-01-preview/ValidationTestCategories_Get_MaximumSet_Gen.json + */ +async function validationTestCategoriesGetMaximumSet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const result = await client.validationTestCategories.get("linux-quality-validations"); + console.log(result); +} + +async function main() { + await validationTestCategoriesGetMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/validationTestCategoriesListBySubscriptionSample.js b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/validationTestCategoriesListBySubscriptionSample.js new file mode 100644 index 000000000000..ea7146c04060 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/validationTestCategoriesListBySubscriptionSample.js @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { PlatformValidationClient } = require("@azure/arm-platformvalidation"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to list validation test category catalog entries for a subscription + * + * @summary list validation test category catalog entries for a subscription + * x-ms-original-file: 2026-08-01-preview/ValidationTestCategories_ListBySubscription_MaximumSet_Gen.json + */ +async function validationTestCategoriesListBySubscriptionMaximumSet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.validationTestCategories.listBySubscription({ + filter: "audience eq 'Public'", + })) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to list validation test category catalog entries for a subscription + * + * @summary list validation test category catalog entries for a subscription + * x-ms-original-file: 2026-08-01-preview/ValidationTestCategories_ListBySubscription_MinimumSet_Gen.json + */ +async function validationTestCategoriesListBySubscriptionMinimumSet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.validationTestCategories.listBySubscription()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await validationTestCategoriesListBySubscriptionMaximumSet(); + await validationTestCategoriesListBySubscriptionMinimumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/validationTestRunsGetSample.js b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/validationTestRunsGetSample.js new file mode 100644 index 000000000000..38e24a8bd25d --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/validationTestRunsGetSample.js @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { PlatformValidationClient } = require("@azure/arm-platformvalidation"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to get a validation test run details + * + * @summary get a validation test run details + * x-ms-original-file: 2026-08-01-preview/ValidationTestRuns_Get_MaximumSet_Gen.json + */ +async function validationTestRunsGetMaximumSet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const result = await client.validationTestRuns.get( + "rgvalidate", + "cvtest01", + "contoso-linux-cert", + "run-001", + "linux-quality-run", + ); + console.log(result); +} + +async function main() { + await validationTestRunsGetMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/validationTestRunsListByExecutionPlanRunSample.js b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/validationTestRunsListByExecutionPlanRunSample.js new file mode 100644 index 000000000000..acf8113ce274 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/validationTestRunsListByExecutionPlanRunSample.js @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { PlatformValidationClient } = require("@azure/arm-platformvalidation"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to list validation test runs for an execution plan run + * + * @summary list validation test runs for an execution plan run + * x-ms-original-file: 2026-08-01-preview/ValidationTestRuns_ListByExecutionPlanRun_MaximumSet_Gen.json + */ +async function validationTestRunsListByExecutionPlanRunMaximumSet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.validationTestRuns.listByExecutionPlanRun( + "rgvalidate", + "cvtest01", + "contoso-linux-cert", + "run-001", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await validationTestRunsListByExecutionPlanRunMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/validationTestVersionsGetSample.js b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/validationTestVersionsGetSample.js new file mode 100644 index 000000000000..36acc84d36e4 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/validationTestVersionsGetSample.js @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { PlatformValidationClient } = require("@azure/arm-platformvalidation"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to get a validation test version catalog entry + * + * @summary get a validation test version catalog entry + * x-ms-original-file: 2026-08-01-preview/ValidationTestVersions_Get_MaximumSet_Gen.json + */ +async function validationTestVersionsGetMaximumSet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const result = await client.validationTestVersions.get("linux-quality-validation", "1.0.0"); + console.log(result); +} + +async function main() { + await validationTestVersionsGetMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/validationTestVersionsListSample.js b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/validationTestVersionsListSample.js new file mode 100644 index 000000000000..a5c913ea8270 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/validationTestVersionsListSample.js @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { PlatformValidationClient } = require("@azure/arm-platformvalidation"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to list validation test version catalog entries + * + * @summary list validation test version catalog entries + * x-ms-original-file: 2026-08-01-preview/ValidationTestVersions_List_MaximumSet_Gen.json + */ +async function validationTestVersionsListMaximumSetGeneratedByMaximumSetRule() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.validationTestVersions.list("linux-quality-validation", { + filter: "audience eq 'Public'", + })) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await validationTestVersionsListMaximumSetGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/validationTestsGetSample.js b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/validationTestsGetSample.js new file mode 100644 index 000000000000..93dee9f2ecc6 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/validationTestsGetSample.js @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { PlatformValidationClient } = require("@azure/arm-platformvalidation"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to get a validation test catalog entry + * + * @summary get a validation test catalog entry + * x-ms-original-file: 2026-08-01-preview/ValidationTests_Get_MaximumSet_Gen.json + */ +async function validationTestsGetMaximumSet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const result = await client.validationTests.get("linux-quality-validation"); + console.log(result); +} + +async function main() { + await validationTestsGetMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/validationTestsListBySubscriptionSample.js b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/validationTestsListBySubscriptionSample.js new file mode 100644 index 000000000000..8fc58feea853 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/javascript/validationTestsListBySubscriptionSample.js @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { PlatformValidationClient } = require("@azure/arm-platformvalidation"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to list validation test catalog entries for a subscription + * + * @summary list validation test catalog entries for a subscription + * x-ms-original-file: 2026-08-01-preview/ValidationTests_ListBySubscription_MaximumSet_Gen.json + */ +async function validationTestsListBySubscriptionMaximumSet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.validationTests.listBySubscription({ + filter: "audience eq 'Public'", + })) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to list validation test catalog entries for a subscription + * + * @summary list validation test catalog entries for a subscription + * x-ms-original-file: 2026-08-01-preview/ValidationTests_ListBySubscription_MinimumSet_Gen.json + */ +async function validationTestsListBySubscriptionMinimumSet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.validationTests.listBySubscription()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await validationTestsListBySubscriptionMaximumSet(); + await validationTestsListBySubscriptionMinimumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/README.md b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/README.md new file mode 100644 index 000000000000..009b4b2cfb32 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/README.md @@ -0,0 +1,111 @@ +# @azure/arm-platformvalidation client library samples for TypeScript (Beta) + +These sample programs show how to use the TypeScript client libraries for @azure/arm-platformvalidation in some common scenarios. + +| **File Name** | **Description** | +| --------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [cloudValidationsCreateOrUpdateSample.ts][cloudvalidationscreateorupdatesample] | create or update a cloud validation x-ms-original-file: 2026-08-01-preview/CloudValidations_CreateOrUpdate_MaximumSet_Gen.json | +| [cloudValidationsDeleteSample.ts][cloudvalidationsdeletesample] | delete a cloud validation x-ms-original-file: 2026-08-01-preview/CloudValidations_Delete_MaximumSet_Gen.json | +| [cloudValidationsGetSample.ts][cloudvalidationsgetsample] | get a cloud validation x-ms-original-file: 2026-08-01-preview/CloudValidations_Get_MaximumSet_Gen.json | +| [cloudValidationsListByResourceGroupSample.ts][cloudvalidationslistbyresourcegroupsample] | list cloud validations by resource group x-ms-original-file: 2026-08-01-preview/CloudValidations_ListByResourceGroup_MaximumSet_Gen.json | +| [cloudValidationsListBySubscriptionSample.ts][cloudvalidationslistbysubscriptionsample] | list cloud validations by subscription x-ms-original-file: 2026-08-01-preview/CloudValidations_ListBySubscription_MaximumSet_Gen.json | +| [cloudValidationsUpdateSample.ts][cloudvalidationsupdatesample] | update a cloud validation x-ms-original-file: 2026-08-01-preview/CloudValidations_Update_MaximumSet_Gen.json | +| [executionPlanRunsCreateOrUpdateSample.ts][executionplanrunscreateorupdatesample] | create or update a validation test execution plan x-ms-original-file: 2026-08-01-preview/ExecutionPlanRuns_CreateOrUpdate_MaximumSet_Gen.json | +| [executionPlanRunsDeleteSample.ts][executionplanrunsdeletesample] | delete a validation test execution plan run resource x-ms-original-file: 2026-08-01-preview/ExecutionPlanRuns_Delete_MaximumSet_Gen.json | +| [executionPlanRunsGetSample.ts][executionplanrunsgetsample] | get a Validation test execution plan run details x-ms-original-file: 2026-08-01-preview/ExecutionPlanRuns_Get_MaximumSet_Gen.json | +| [executionPlanRunsListByExecutionPlanSample.ts][executionplanrunslistbyexecutionplansample] | list Validation test execution plan runs for an execution plan x-ms-original-file: 2026-08-01-preview/ExecutionPlanRuns_ListByExecutionPlan_MaximumSet_Gen.json | +| [operationStatusGetSample.ts][operationstatusgetsample] | returns the current status of an async operation. x-ms-original-file: 2026-08-01-preview/OperationStatus_Get_MaximumSet_Gen.json | +| [operationsListSample.ts][operationslistsample] | list the operations for the provider x-ms-original-file: 2026-08-01-preview/Operations_List_MaximumSet_Gen.json | +| [validationExecutionPlansCreateOrUpdateSample.ts][validationexecutionplanscreateorupdatesample] | create or update a validation test execution plan x-ms-original-file: 2026-08-01-preview/ValidationExecutionPlans_CreateOrUpdate_MaximumSet_Gen.json | +| [validationExecutionPlansDeleteSample.ts][validationexecutionplansdeletesample] | delete a validation test execution plan x-ms-original-file: 2026-08-01-preview/ValidationExecutionPlans_Delete_MaximumSet_Gen.json | +| [validationExecutionPlansGetSample.ts][validationexecutionplansgetsample] | get a validation test execution plan x-ms-original-file: 2026-08-01-preview/ValidationExecutionPlans_Get_MaximumSet_Gen.json | +| [validationExecutionPlansListByResourceGroupSample.ts][validationexecutionplanslistbyresourcegroupsample] | list validation test execution plans by resource group x-ms-original-file: 2026-08-01-preview/ValidationExecutionPlans_ListByResourceGroup_MaximumSet_Gen.json | +| [validationExecutionPlansUpdateSample.ts][validationexecutionplansupdatesample] | update a validation test execution plan x-ms-original-file: 2026-08-01-preview/ValidationExecutionPlans_Update_MaximumSet_Gen.json | +| [validationTestCategoriesGetSample.ts][validationtestcategoriesgetsample] | get a validation test category catalog entry x-ms-original-file: 2026-08-01-preview/ValidationTestCategories_Get_MaximumSet_Gen.json | +| [validationTestCategoriesListBySubscriptionSample.ts][validationtestcategorieslistbysubscriptionsample] | list validation test category catalog entries for a subscription x-ms-original-file: 2026-08-01-preview/ValidationTestCategories_ListBySubscription_MaximumSet_Gen.json | +| [validationTestRunsGetSample.ts][validationtestrunsgetsample] | get a validation test run details x-ms-original-file: 2026-08-01-preview/ValidationTestRuns_Get_MaximumSet_Gen.json | +| [validationTestRunsListByExecutionPlanRunSample.ts][validationtestrunslistbyexecutionplanrunsample] | list validation test runs for an execution plan run x-ms-original-file: 2026-08-01-preview/ValidationTestRuns_ListByExecutionPlanRun_MaximumSet_Gen.json | +| [validationTestVersionsGetSample.ts][validationtestversionsgetsample] | get a validation test version catalog entry x-ms-original-file: 2026-08-01-preview/ValidationTestVersions_Get_MaximumSet_Gen.json | +| [validationTestVersionsListSample.ts][validationtestversionslistsample] | list validation test version catalog entries x-ms-original-file: 2026-08-01-preview/ValidationTestVersions_List_MaximumSet_Gen.json | +| [validationTestsGetSample.ts][validationtestsgetsample] | get a validation test catalog entry x-ms-original-file: 2026-08-01-preview/ValidationTests_Get_MaximumSet_Gen.json | +| [validationTestsListBySubscriptionSample.ts][validationtestslistbysubscriptionsample] | list validation test catalog entries for a subscription x-ms-original-file: 2026-08-01-preview/ValidationTests_ListBySubscription_MaximumSet_Gen.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). + +Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: + +```bash +npm install -g typescript +``` + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Compile the samples: + +```bash +npm run build +``` + +3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +4. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node dist/cloudValidationsCreateOrUpdateSample.js +``` + +Alternatively, run a single sample with the required environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): + +```bash +node dist/cloudValidationsCreateOrUpdateSample.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[cloudvalidationscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/cloudValidationsCreateOrUpdateSample.ts +[cloudvalidationsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/cloudValidationsDeleteSample.ts +[cloudvalidationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/cloudValidationsGetSample.ts +[cloudvalidationslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/cloudValidationsListByResourceGroupSample.ts +[cloudvalidationslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/cloudValidationsListBySubscriptionSample.ts +[cloudvalidationsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/cloudValidationsUpdateSample.ts +[executionplanrunscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/executionPlanRunsCreateOrUpdateSample.ts +[executionplanrunsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/executionPlanRunsDeleteSample.ts +[executionplanrunsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/executionPlanRunsGetSample.ts +[executionplanrunslistbyexecutionplansample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/executionPlanRunsListByExecutionPlanSample.ts +[operationstatusgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/operationStatusGetSample.ts +[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/operationsListSample.ts +[validationexecutionplanscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/validationExecutionPlansCreateOrUpdateSample.ts +[validationexecutionplansdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/validationExecutionPlansDeleteSample.ts +[validationexecutionplansgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/validationExecutionPlansGetSample.ts +[validationexecutionplanslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/validationExecutionPlansListByResourceGroupSample.ts +[validationexecutionplansupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/validationExecutionPlansUpdateSample.ts +[validationtestcategoriesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/validationTestCategoriesGetSample.ts +[validationtestcategorieslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/validationTestCategoriesListBySubscriptionSample.ts +[validationtestrunsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/validationTestRunsGetSample.ts +[validationtestrunslistbyexecutionplanrunsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/validationTestRunsListByExecutionPlanRunSample.ts +[validationtestversionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/validationTestVersionsGetSample.ts +[validationtestversionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/validationTestVersionsListSample.ts +[validationtestsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/validationTestsGetSample.ts +[validationtestslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/validationTestsListBySubscriptionSample.ts +[apiref]: https://learn.microsoft.com/javascript/api/@azure/arm-platformvalidation?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/platformvalidation/arm-platformvalidation/README.md +[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/package.json b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/package.json new file mode 100644 index 000000000000..db61fc9e2882 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/package.json @@ -0,0 +1,43 @@ +{ + "name": "@azure-samples/arm-platformvalidation-ts-beta", + "private": true, + "version": "1.0.0", + "description": "@azure/arm-platformvalidation client library samples for TypeScript (Beta)", + "engines": { + "node": ">=22.0.0" + }, + "scripts": { + "build": "tsc", + "prebuild": "rimraf dist/" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Azure/azure-sdk-for-js.git", + "directory": "sdk/platformvalidation/arm-platformvalidation" + }, + "keywords": [ + "node", + "azure", + "cloud", + "typescript", + "browser", + "isomorphic" + ], + "author": "Microsoft Corporation", + "license": "MIT", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/platformvalidation/arm-platformvalidation", + "dependencies": { + "@azure/arm-platformvalidation": "beta", + "dotenv": "latest", + "@azure/identity": "^4.13.0" + }, + "devDependencies": { + "@types/node": "^22.0.0", + "cross-env": "latest", + "rimraf": "latest", + "typescript": "~6.0.2" + } +} diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/sample.env b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/sample.env new file mode 100644 index 000000000000..508439fc7d62 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/sample.env @@ -0,0 +1 @@ +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/cloudValidationsCreateOrUpdateSample.ts b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/cloudValidationsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..fb971465ade3 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/cloudValidationsCreateOrUpdateSample.ts @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { PlatformValidationClient } from "@azure/arm-platformvalidation"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to create or update a cloud validation + * + * @summary create or update a cloud validation + * x-ms-original-file: 2026-08-01-preview/CloudValidations_CreateOrUpdate_MaximumSet_Gen.json + */ +async function cloudValidationsCreateOrUpdateMaximumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const result = await client.cloudValidations.createOrUpdate("rgvalidate", "cvtest01", { + properties: { + description: + "Cloud validation that groups platform validation execution plans for the target subscription.", + }, + tags: { environment: "production" }, + location: "southcentralus", + }); + console.log(result); +} + +async function main(): Promise { + await cloudValidationsCreateOrUpdateMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/cloudValidationsDeleteSample.ts b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/cloudValidationsDeleteSample.ts new file mode 100644 index 000000000000..4081dc25d1c1 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/cloudValidationsDeleteSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { PlatformValidationClient } from "@azure/arm-platformvalidation"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to delete a cloud validation + * + * @summary delete a cloud validation + * x-ms-original-file: 2026-08-01-preview/CloudValidations_Delete_MaximumSet_Gen.json + */ +async function cloudValidationsDeleteMaximumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + await client.cloudValidations.delete("rgvalidate", "cvtest01"); +} + +async function main(): Promise { + await cloudValidationsDeleteMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/cloudValidationsGetSample.ts b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/cloudValidationsGetSample.ts new file mode 100644 index 000000000000..1ddbd3e45b78 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/cloudValidationsGetSample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { PlatformValidationClient } from "@azure/arm-platformvalidation"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to get a cloud validation + * + * @summary get a cloud validation + * x-ms-original-file: 2026-08-01-preview/CloudValidations_Get_MaximumSet_Gen.json + */ +async function cloudValidationsGetMaximumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const result = await client.cloudValidations.get("rgvalidate", "cvtest01"); + console.log(result); +} + +async function main(): Promise { + await cloudValidationsGetMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/cloudValidationsListByResourceGroupSample.ts b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/cloudValidationsListByResourceGroupSample.ts new file mode 100644 index 000000000000..ca7016962013 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/cloudValidationsListByResourceGroupSample.ts @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { PlatformValidationClient } from "@azure/arm-platformvalidation"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to list cloud validations by resource group + * + * @summary list cloud validations by resource group + * x-ms-original-file: 2026-08-01-preview/CloudValidations_ListByResourceGroup_MaximumSet_Gen.json + */ +async function cloudValidationsListByResourceGroupMaximumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.cloudValidations.listByResourceGroup("rgvalidate")) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to list cloud validations by resource group + * + * @summary list cloud validations by resource group + * x-ms-original-file: 2026-08-01-preview/CloudValidations_ListByResourceGroup_MinimumSet_Gen.json + */ +async function cloudValidationsListByResourceGroupMinimumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.cloudValidations.listByResourceGroup("rgplatformvalidation")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await cloudValidationsListByResourceGroupMaximumSet(); + await cloudValidationsListByResourceGroupMinimumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/cloudValidationsListBySubscriptionSample.ts b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/cloudValidationsListBySubscriptionSample.ts new file mode 100644 index 000000000000..efbb42605f06 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/cloudValidationsListBySubscriptionSample.ts @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { PlatformValidationClient } from "@azure/arm-platformvalidation"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to list cloud validations by subscription + * + * @summary list cloud validations by subscription + * x-ms-original-file: 2026-08-01-preview/CloudValidations_ListBySubscription_MaximumSet_Gen.json + */ +async function cloudValidationsListBySubscriptionMaximumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.cloudValidations.listBySubscription()) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to list cloud validations by subscription + * + * @summary list cloud validations by subscription + * x-ms-original-file: 2026-08-01-preview/CloudValidations_ListBySubscription_MinimumSet_Gen.json + */ +async function cloudValidationsListBySubscriptionMinimumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.cloudValidations.listBySubscription()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await cloudValidationsListBySubscriptionMaximumSet(); + await cloudValidationsListBySubscriptionMinimumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/cloudValidationsUpdateSample.ts b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/cloudValidationsUpdateSample.ts new file mode 100644 index 000000000000..f0b82adc81a9 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/cloudValidationsUpdateSample.ts @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { PlatformValidationClient } from "@azure/arm-platformvalidation"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to update a cloud validation + * + * @summary update a cloud validation + * x-ms-original-file: 2026-08-01-preview/CloudValidations_Update_MaximumSet_Gen.json + */ +async function cloudValidationsUpdateMaximumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const result = await client.cloudValidations.update("rgvalidate", "cvtest01", { + properties: { + description: + "Cloud validation that groups platform validation execution plans for the target subscription.", + }, + tags: { "cost-center": "platform-validation" }, + }); + console.log(result); +} + +async function main(): Promise { + await cloudValidationsUpdateMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/executionPlanRunsCreateOrUpdateSample.ts b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/executionPlanRunsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..ee4a20612d47 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/executionPlanRunsCreateOrUpdateSample.ts @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { PlatformValidationClient } from "@azure/arm-platformvalidation"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to create or update a validation test execution plan + * + * @summary create or update a validation test execution plan + * x-ms-original-file: 2026-08-01-preview/ExecutionPlanRuns_CreateOrUpdate_MaximumSet_Gen.json + */ +async function executionPlanRunsCreateOrUpdateMaximumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const result = await client.executionPlanRuns.createOrUpdate( + "rgvalidate", + "cvtest01", + "contoso-linux-cert", + "run-001", + { properties: { description: "Run the Contoso Linux image certification plan." } }, + ); + console.log(result); +} + +async function main(): Promise { + await executionPlanRunsCreateOrUpdateMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/executionPlanRunsDeleteSample.ts b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/executionPlanRunsDeleteSample.ts new file mode 100644 index 000000000000..ec0dc8632bc1 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/executionPlanRunsDeleteSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { PlatformValidationClient } from "@azure/arm-platformvalidation"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to delete a validation test execution plan run resource + * + * @summary delete a validation test execution plan run resource + * x-ms-original-file: 2026-08-01-preview/ExecutionPlanRuns_Delete_MaximumSet_Gen.json + */ +async function executionPlanRunsDeleteMaximumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + await client.executionPlanRuns.delete("rgvalidate", "cvtest01", "veptest01", "veprun01"); +} + +async function main(): Promise { + await executionPlanRunsDeleteMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/executionPlanRunsGetSample.ts b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/executionPlanRunsGetSample.ts new file mode 100644 index 000000000000..7213d89fb7e6 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/executionPlanRunsGetSample.ts @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { PlatformValidationClient } from "@azure/arm-platformvalidation"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to get a Validation test execution plan run details + * + * @summary get a Validation test execution plan run details + * x-ms-original-file: 2026-08-01-preview/ExecutionPlanRuns_Get_MaximumSet_Gen.json + */ +async function executionPlanRunsGetMaximumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const result = await client.executionPlanRuns.get( + "rgvalidate", + "cvtest01", + "contoso-linux-cert", + "run-001", + ); + console.log(result); +} + +async function main(): Promise { + await executionPlanRunsGetMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/executionPlanRunsListByExecutionPlanSample.ts b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/executionPlanRunsListByExecutionPlanSample.ts new file mode 100644 index 000000000000..f3891e912670 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/executionPlanRunsListByExecutionPlanSample.ts @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { PlatformValidationClient } from "@azure/arm-platformvalidation"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to list Validation test execution plan runs for an execution plan + * + * @summary list Validation test execution plan runs for an execution plan + * x-ms-original-file: 2026-08-01-preview/ExecutionPlanRuns_ListByExecutionPlan_MaximumSet_Gen.json + */ +async function executionPlanRunsListByExecutionPlanMaximumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.executionPlanRuns.listByExecutionPlan( + "rgvalidate", + "cvtest01", + "contoso-linux-cert", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await executionPlanRunsListByExecutionPlanMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/operationStatusGetSample.ts b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/operationStatusGetSample.ts new file mode 100644 index 000000000000..2b8b37980083 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/operationStatusGetSample.ts @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { PlatformValidationClient } from "@azure/arm-platformvalidation"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to returns the current status of an async operation. + * + * @summary returns the current status of an async operation. + * x-ms-original-file: 2026-08-01-preview/OperationStatus_Get_MaximumSet_Gen.json + */ +async function operationStatusGetMaximumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const result = await client.operationStatus.get( + "southcentralus", + "11111111-1111-4111-8111-111111111111", + ); + console.log(result); +} + +/** + * This sample demonstrates how to returns the current status of an async operation. + * + * @summary returns the current status of an async operation. + * x-ms-original-file: 2026-08-01-preview/OperationStatus_Get_MinimumSet_Gen.json + */ +async function operationStatusGetMaximumSetGeneratedByMinimumSetRule(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const result = await client.operationStatus.get( + "southcentralus", + "11111111-1111-4111-8111-111111111111", + ); + console.log(result); +} + +async function main(): Promise { + await operationStatusGetMaximumSet(); + await operationStatusGetMaximumSetGeneratedByMinimumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/operationsListSample.ts b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/operationsListSample.ts new file mode 100644 index 000000000000..abc104dc7b35 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/operationsListSample.ts @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { PlatformValidationClient } from "@azure/arm-platformvalidation"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to list the operations for the provider + * + * @summary list the operations for the provider + * x-ms-original-file: 2026-08-01-preview/Operations_List_MaximumSet_Gen.json + */ +async function operationsListMaximumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.operations.list()) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to list the operations for the provider + * + * @summary list the operations for the provider + * x-ms-original-file: 2026-08-01-preview/Operations_List_MinimumSet_Gen.json + */ +async function operationsListMinimumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.operations.list()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await operationsListMaximumSet(); + await operationsListMinimumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/validationExecutionPlansCreateOrUpdateSample.ts b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/validationExecutionPlansCreateOrUpdateSample.ts new file mode 100644 index 000000000000..4a4d5946cb5b --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/validationExecutionPlansCreateOrUpdateSample.ts @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { PlatformValidationClient } from "@azure/arm-platformvalidation"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to create or update a validation test execution plan + * + * @summary create or update a validation test execution plan + * x-ms-original-file: 2026-08-01-preview/ValidationExecutionPlans_CreateOrUpdate_MaximumSet_Gen.json + */ +async function validationExecutionPlansCreateOrUpdateMaximumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const result = await client.validationExecutionPlans.createOrUpdate( + "rgvalidate", + "cvtest01", + "contoso-linux-cert", + { + properties: { + description: + "Runs all public Linux-compatible AzCertify catalog tests against the Contoso Linux image.", + planConfigurationJson: + '{"apiVersion":"microsoft.PlatformValidation/validationExecutionPlan.v0","kind":"ValidationExecutionPlan","metadata":{"name":"contoso-linux-cert"},"parameters":{"certificationPackageReference":{"osType":"Linux","vmGenerationType":"V1","architectureType":"X64","recommendedVMSizes":["Standard_D4s_v3"],"storageProfile":{"osDiskImage":{"sourceVhdUri":"https://contoso.blob.core.windows.net/vhds/img.vhd?"},"dataDiskImages":[]},"additionalProperties":{}}},"authoring":{"steps":[{"name":"os-disk-size","type":"test","testRef":"/providers/Microsoft.PlatformValidation/validationTests/os-disk-size/versions/1.0.0"},{"name":"data-disk-size","type":"test","testRef":"/providers/Microsoft.PlatformValidation/validationTests/data-disk-size/versions/1.0.0"},{"name":"malware-defender","type":"test","testRef":"/providers/Microsoft.PlatformValidation/validationTests/malware-defender/versions/1.0.0"},{"name":"malware-esrp","type":"test","testRef":"/providers/Microsoft.PlatformValidation/validationTests/malware-esrp/versions/1.0.0"},{"name":"linux-quality-validation","type":"test","testRef":"/providers/Microsoft.PlatformValidation/validationTests/linux-quality-validation/versions/1.0.0","inputs":{"concurrency":1,"testSuite":[{"testNames":["smoke_test","validate_netvsc_reload"]}]}}]}}', + }, + tags: { "owner-team": "azure-platform-validation" }, + location: "southcentralus", + }, + ); + console.log(result); +} + +async function main(): Promise { + await validationExecutionPlansCreateOrUpdateMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/validationExecutionPlansDeleteSample.ts b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/validationExecutionPlansDeleteSample.ts new file mode 100644 index 000000000000..08ed9cb6f8cb --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/validationExecutionPlansDeleteSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { PlatformValidationClient } from "@azure/arm-platformvalidation"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to delete a validation test execution plan + * + * @summary delete a validation test execution plan + * x-ms-original-file: 2026-08-01-preview/ValidationExecutionPlans_Delete_MaximumSet_Gen.json + */ +async function validationExecutionPlansDeleteMaximumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + await client.validationExecutionPlans.delete("rgvalidate", "cvtest01", "veptest01"); +} + +async function main(): Promise { + await validationExecutionPlansDeleteMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/validationExecutionPlansGetSample.ts b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/validationExecutionPlansGetSample.ts new file mode 100644 index 000000000000..5111d4ffc1d2 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/validationExecutionPlansGetSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { PlatformValidationClient } from "@azure/arm-platformvalidation"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to get a validation test execution plan + * + * @summary get a validation test execution plan + * x-ms-original-file: 2026-08-01-preview/ValidationExecutionPlans_Get_MaximumSet_Gen.json + */ +async function validationExecutionPlansGetMaximumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const result = await client.validationExecutionPlans.get( + "rgvalidate", + "cvtest01", + "contoso-linux-cert", + ); + console.log(result); +} + +async function main(): Promise { + await validationExecutionPlansGetMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/validationExecutionPlansListByResourceGroupSample.ts b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/validationExecutionPlansListByResourceGroupSample.ts new file mode 100644 index 000000000000..1ae2dea11bec --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/validationExecutionPlansListByResourceGroupSample.ts @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { PlatformValidationClient } from "@azure/arm-platformvalidation"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to list validation test execution plans by resource group + * + * @summary list validation test execution plans by resource group + * x-ms-original-file: 2026-08-01-preview/ValidationExecutionPlans_ListByResourceGroup_MaximumSet_Gen.json + */ +async function validationExecutionPlansListByResourceGroupMaximumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.validationExecutionPlans.listByResourceGroup( + "rgvalidate", + "cvtest01", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await validationExecutionPlansListByResourceGroupMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/validationExecutionPlansUpdateSample.ts b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/validationExecutionPlansUpdateSample.ts new file mode 100644 index 000000000000..ba2764712ec1 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/validationExecutionPlansUpdateSample.ts @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { PlatformValidationClient } from "@azure/arm-platformvalidation"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to update a validation test execution plan + * + * @summary update a validation test execution plan + * x-ms-original-file: 2026-08-01-preview/ValidationExecutionPlans_Update_MaximumSet_Gen.json + */ +async function validationExecutionPlansUpdateMaximumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const result = await client.validationExecutionPlans.update( + "rgvalidate", + "cvtest01", + "veptest01", + { + properties: { + description: + "Validation execution plan that runs the network connectivity checks against the target image.", + planConfigurationJson: + '{"apiVersion":"microsoft.PlatformValidation/validationExecutionPlan.v0","kind":"ValidationExecutionPlan","metadata":{"name":"contoso-linux-cert"},"parameters":{"certificationPackageReference":{"osType":"Linux","vmGenerationType":"V1","architectureType":"X64","recommendedVMSizes":["Standard_D4s_v3"],"storageProfile":{"osDiskImage":{"sourceVhdUri":"https://contoso.blob.core.windows.net/vhds/img.vhd?"},"dataDiskImages":[]},"additionalProperties":{}}},"authoring":{"steps":[{"name":"os-disk-size","type":"test","testRef":"/providers/Microsoft.PlatformValidation/validationTests/os-disk-size/versions/1.0.0"},{"name":"data-disk-size","type":"test","testRef":"/providers/Microsoft.PlatformValidation/validationTests/data-disk-size/versions/1.0.0"},{"name":"malware-defender","type":"test","testRef":"/providers/Microsoft.PlatformValidation/validationTests/malware-defender/versions/1.0.0"},{"name":"malware-esrp","type":"test","testRef":"/providers/Microsoft.PlatformValidation/validationTests/malware-esrp/versions/1.0.0"},{"name":"linux-quality-validation","type":"test","testRef":"/providers/Microsoft.PlatformValidation/validationTests/linux-quality-validation/versions/1.0.0","inputs":{"concurrency":1,"testSuite":[{"testNames":["smoke_test","validate_netvsc_reload"]}]}}]}}', + }, + tags: { environment: "production" }, + }, + ); + console.log(result); +} + +async function main(): Promise { + await validationExecutionPlansUpdateMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/validationTestCategoriesGetSample.ts b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/validationTestCategoriesGetSample.ts new file mode 100644 index 000000000000..83dc411bd06a --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/validationTestCategoriesGetSample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { PlatformValidationClient } from "@azure/arm-platformvalidation"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to get a validation test category catalog entry + * + * @summary get a validation test category catalog entry + * x-ms-original-file: 2026-08-01-preview/ValidationTestCategories_Get_MaximumSet_Gen.json + */ +async function validationTestCategoriesGetMaximumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const result = await client.validationTestCategories.get("linux-quality-validations"); + console.log(result); +} + +async function main(): Promise { + await validationTestCategoriesGetMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/validationTestCategoriesListBySubscriptionSample.ts b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/validationTestCategoriesListBySubscriptionSample.ts new file mode 100644 index 000000000000..0355a346be7c --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/validationTestCategoriesListBySubscriptionSample.ts @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { PlatformValidationClient } from "@azure/arm-platformvalidation"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to list validation test category catalog entries for a subscription + * + * @summary list validation test category catalog entries for a subscription + * x-ms-original-file: 2026-08-01-preview/ValidationTestCategories_ListBySubscription_MaximumSet_Gen.json + */ +async function validationTestCategoriesListBySubscriptionMaximumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.validationTestCategories.listBySubscription({ + filter: "audience eq 'Public'", + })) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to list validation test category catalog entries for a subscription + * + * @summary list validation test category catalog entries for a subscription + * x-ms-original-file: 2026-08-01-preview/ValidationTestCategories_ListBySubscription_MinimumSet_Gen.json + */ +async function validationTestCategoriesListBySubscriptionMinimumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.validationTestCategories.listBySubscription()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await validationTestCategoriesListBySubscriptionMaximumSet(); + await validationTestCategoriesListBySubscriptionMinimumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/validationTestRunsGetSample.ts b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/validationTestRunsGetSample.ts new file mode 100644 index 000000000000..ce0edbaa4acb --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/validationTestRunsGetSample.ts @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { PlatformValidationClient } from "@azure/arm-platformvalidation"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to get a validation test run details + * + * @summary get a validation test run details + * x-ms-original-file: 2026-08-01-preview/ValidationTestRuns_Get_MaximumSet_Gen.json + */ +async function validationTestRunsGetMaximumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const result = await client.validationTestRuns.get( + "rgvalidate", + "cvtest01", + "contoso-linux-cert", + "run-001", + "linux-quality-run", + ); + console.log(result); +} + +async function main(): Promise { + await validationTestRunsGetMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/validationTestRunsListByExecutionPlanRunSample.ts b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/validationTestRunsListByExecutionPlanRunSample.ts new file mode 100644 index 000000000000..d21ba35c9c6e --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/validationTestRunsListByExecutionPlanRunSample.ts @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { PlatformValidationClient } from "@azure/arm-platformvalidation"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to list validation test runs for an execution plan run + * + * @summary list validation test runs for an execution plan run + * x-ms-original-file: 2026-08-01-preview/ValidationTestRuns_ListByExecutionPlanRun_MaximumSet_Gen.json + */ +async function validationTestRunsListByExecutionPlanRunMaximumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.validationTestRuns.listByExecutionPlanRun( + "rgvalidate", + "cvtest01", + "contoso-linux-cert", + "run-001", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await validationTestRunsListByExecutionPlanRunMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/validationTestVersionsGetSample.ts b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/validationTestVersionsGetSample.ts new file mode 100644 index 000000000000..2a53db5982e0 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/validationTestVersionsGetSample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { PlatformValidationClient } from "@azure/arm-platformvalidation"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to get a validation test version catalog entry + * + * @summary get a validation test version catalog entry + * x-ms-original-file: 2026-08-01-preview/ValidationTestVersions_Get_MaximumSet_Gen.json + */ +async function validationTestVersionsGetMaximumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const result = await client.validationTestVersions.get("linux-quality-validation", "1.0.0"); + console.log(result); +} + +async function main(): Promise { + await validationTestVersionsGetMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/validationTestVersionsListSample.ts b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/validationTestVersionsListSample.ts new file mode 100644 index 000000000000..4817ac9d944f --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/validationTestVersionsListSample.ts @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { PlatformValidationClient } from "@azure/arm-platformvalidation"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to list validation test version catalog entries + * + * @summary list validation test version catalog entries + * x-ms-original-file: 2026-08-01-preview/ValidationTestVersions_List_MaximumSet_Gen.json + */ +async function validationTestVersionsListMaximumSetGeneratedByMaximumSetRule(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.validationTestVersions.list("linux-quality-validation", { + filter: "audience eq 'Public'", + })) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await validationTestVersionsListMaximumSetGeneratedByMaximumSetRule(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/validationTestsGetSample.ts b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/validationTestsGetSample.ts new file mode 100644 index 000000000000..518dc24d0fcf --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/validationTestsGetSample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { PlatformValidationClient } from "@azure/arm-platformvalidation"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to get a validation test catalog entry + * + * @summary get a validation test catalog entry + * x-ms-original-file: 2026-08-01-preview/ValidationTests_Get_MaximumSet_Gen.json + */ +async function validationTestsGetMaximumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const result = await client.validationTests.get("linux-quality-validation"); + console.log(result); +} + +async function main(): Promise { + await validationTestsGetMaximumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/validationTestsListBySubscriptionSample.ts b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/validationTestsListBySubscriptionSample.ts new file mode 100644 index 000000000000..c50f5dd48b6b --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/src/validationTestsListBySubscriptionSample.ts @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { PlatformValidationClient } from "@azure/arm-platformvalidation"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to list validation test catalog entries for a subscription + * + * @summary list validation test catalog entries for a subscription + * x-ms-original-file: 2026-08-01-preview/ValidationTests_ListBySubscription_MaximumSet_Gen.json + */ +async function validationTestsListBySubscriptionMaximumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.validationTests.listBySubscription({ + filter: "audience eq 'Public'", + })) { + resArray.push(item); + } + + console.log(resArray); +} + +/** + * This sample demonstrates how to list validation test catalog entries for a subscription + * + * @summary list validation test catalog entries for a subscription + * x-ms-original-file: 2026-08-01-preview/ValidationTests_ListBySubscription_MinimumSet_Gen.json + */ +async function validationTestsListBySubscriptionMinimumSet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.validationTests.listBySubscription()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await validationTestsListBySubscriptionMaximumSet(); + await validationTestsListBySubscriptionMinimumSet(); +} + +main().catch(console.error); diff --git a/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/tsconfig.json b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/tsconfig.json new file mode 100644 index 000000000000..82d2ed3be723 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/samples/v1-beta/typescript/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "target": "ES2023", + "module": "nodenext", + "moduleResolution": "nodenext", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "strict": true, + "alwaysStrict": true, + "outDir": "dist", + "rootDir": "src" + }, + "include": [ + "src/**/*.ts" + ] +} diff --git a/sdk/platformvalidation/arm-platformvalidation/src/api/cloudValidations/index.ts b/sdk/platformvalidation/arm-platformvalidation/src/api/cloudValidations/index.ts new file mode 100644 index 000000000000..67baa02dce56 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/src/api/cloudValidations/index.ts @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + listBySubscription, + listByResourceGroup, + $delete, + update, + createOrUpdate, + get, +} from "./operations.js"; +export type { + CloudValidationsListBySubscriptionOptionalParams, + CloudValidationsListByResourceGroupOptionalParams, + CloudValidationsDeleteOptionalParams, + CloudValidationsUpdateOptionalParams, + CloudValidationsCreateOrUpdateOptionalParams, + CloudValidationsGetOptionalParams, +} from "./options.js"; diff --git a/sdk/platformvalidation/arm-platformvalidation/src/api/cloudValidations/operations.ts b/sdk/platformvalidation/arm-platformvalidation/src/api/cloudValidations/operations.ts new file mode 100644 index 000000000000..9b6d41016941 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/src/api/cloudValidations/operations.ts @@ -0,0 +1,365 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { PlatformValidationContext as Client } from "../index.js"; +import type { + CloudValidation, + CloudValidationUpdate, + _CloudValidationListResult, +} from "../../models/models.js"; +import { + errorResponseDeserializer, + cloudValidationSerializer, + cloudValidationDeserializer, + cloudValidationUpdateSerializer, + _cloudValidationListResultDeserializer, +} from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { buildPagedAsyncIterator } from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import type { + CloudValidationsListBySubscriptionOptionalParams, + CloudValidationsListByResourceGroupOptionalParams, + CloudValidationsDeleteOptionalParams, + CloudValidationsUpdateOptionalParams, + CloudValidationsCreateOrUpdateOptionalParams, + CloudValidationsGetOptionalParams, +} from "./options.js"; +import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +export function _listBySubscriptionSend( + context: Client, + options: CloudValidationsListBySubscriptionOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.PlatformValidation/cloudValidations{?api%2Dversion,%24filter}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": context.apiVersion ?? "2026-08-01-preview", + "%24filter": options?.filter, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listBySubscriptionDeserialize( + result: PathUncheckedResponse, +): Promise<_CloudValidationListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + if (result.body) { + error.details = errorResponseDeserializer(result.body); + } + + throw error; + } + + return _cloudValidationListResultDeserializer(result.body); +} + +/** List cloud validations by subscription */ +export function listBySubscription( + context: Client, + options: CloudValidationsListBySubscriptionOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listBySubscriptionSend(context, options), + _listBySubscriptionDeserialize, + ["200"], + { + itemName: "value", + nextLinkName: "nextLink", + apiVersion: context.apiVersion ?? "2026-08-01-preview", + }, + ); +} + +export function _listByResourceGroupSend( + context: Client, + resourceGroupName: string, + options: CloudValidationsListByResourceGroupOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations{?api%2Dversion,%24filter}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + "api%2Dversion": context.apiVersion ?? "2026-08-01-preview", + "%24filter": options?.filter, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listByResourceGroupDeserialize( + result: PathUncheckedResponse, +): Promise<_CloudValidationListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + if (result.body) { + error.details = errorResponseDeserializer(result.body); + } + + throw error; + } + + return _cloudValidationListResultDeserializer(result.body); +} + +/** List cloud validations by resource group */ +export function listByResourceGroup( + context: Client, + resourceGroupName: string, + options: CloudValidationsListByResourceGroupOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByResourceGroupSend(context, resourceGroupName, options), + _listByResourceGroupDeserialize, + ["200"], + { + itemName: "value", + nextLinkName: "nextLink", + apiVersion: context.apiVersion ?? "2026-08-01-preview", + }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + cloudValidationName: string, + options: CloudValidationsDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + cloudValidationName: cloudValidationName, + "api%2Dversion": context.apiVersion ?? "2026-08-01-preview", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "204", "200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + if (result.body) { + error.details = errorResponseDeserializer(result.body); + } + + throw error; + } + + return; +} + +/** Delete a cloud validation */ +export function $delete( + context: Client, + resourceGroupName: string, + cloudValidationName: string, + options: CloudValidationsDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["202", "204", "200"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _$deleteSend(context, resourceGroupName, cloudValidationName, options), + resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2026-08-01-preview", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + cloudValidationName: string, + properties: CloudValidationUpdate, + options: CloudValidationsUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + cloudValidationName: cloudValidationName, + "api%2Dversion": context.apiVersion ?? "2026-08-01-preview", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: cloudValidationUpdateSerializer(properties), + }); +} + +export async function _updateDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + if (result.body) { + error.details = errorResponseDeserializer(result.body); + } + + throw error; + } + + return cloudValidationDeserializer(result.body); +} + +/** Update a cloud validation */ +export function update( + context: Client, + resourceGroupName: string, + cloudValidationName: string, + properties: CloudValidationUpdate, + options: CloudValidationsUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, CloudValidation> { + return getLongRunningPoller(context, _updateDeserialize, ["200", "202", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _updateSend(context, resourceGroupName, cloudValidationName, properties, options), + resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2026-08-01-preview", + }) as PollerLike, CloudValidation>; +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + cloudValidationName: string, + resource: CloudValidation, + options: CloudValidationsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + cloudValidationName: cloudValidationName, + "api%2Dversion": context.apiVersion ?? "2026-08-01-preview", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: cloudValidationSerializer(resource), + }); +} + +export async function _createOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + if (result.body) { + error.details = errorResponseDeserializer(result.body); + } + + throw error; + } + + return cloudValidationDeserializer(result.body); +} + +/** Create or update a cloud validation */ +export function createOrUpdate( + context: Client, + resourceGroupName: string, + cloudValidationName: string, + resource: CloudValidation, + options: CloudValidationsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, CloudValidation> { + return getLongRunningPoller(context, _createOrUpdateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createOrUpdateSend(context, resourceGroupName, cloudValidationName, resource, options), + resourceLocationConfig: "azure-async-operation", + apiVersion: context.apiVersion ?? "2026-08-01-preview", + }) as PollerLike, CloudValidation>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + cloudValidationName: string, + options: CloudValidationsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + cloudValidationName: cloudValidationName, + "api%2Dversion": context.apiVersion ?? "2026-08-01-preview", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + if (result.body) { + error.details = errorResponseDeserializer(result.body); + } + + throw error; + } + + return cloudValidationDeserializer(result.body); +} + +/** Get a cloud validation */ +export async function get( + context: Client, + resourceGroupName: string, + cloudValidationName: string, + options: CloudValidationsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, resourceGroupName, cloudValidationName, options); + return _getDeserialize(result); +} diff --git a/sdk/platformvalidation/arm-platformvalidation/src/api/cloudValidations/options.ts b/sdk/platformvalidation/arm-platformvalidation/src/api/cloudValidations/options.ts new file mode 100644 index 000000000000..6b96275d4b4b --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/src/api/cloudValidations/options.ts @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface CloudValidationsListBySubscriptionOptionalParams extends OperationOptions { + /** The OData filter expression to apply to the list operation. */ + filter?: string; +} + +/** Optional parameters. */ +export interface CloudValidationsListByResourceGroupOptionalParams extends OperationOptions { + /** The OData filter expression to apply to the list operation. */ + filter?: string; +} + +/** Optional parameters. */ +export interface CloudValidationsDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface CloudValidationsUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface CloudValidationsCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface CloudValidationsGetOptionalParams extends OperationOptions {} diff --git a/sdk/platformvalidation/arm-platformvalidation/src/api/executionPlanRuns/index.ts b/sdk/platformvalidation/arm-platformvalidation/src/api/executionPlanRuns/index.ts new file mode 100644 index 000000000000..5fd49186eb26 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/src/api/executionPlanRuns/index.ts @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { listByExecutionPlan, $delete, createOrUpdate, get } from "./operations.js"; +export type { + ExecutionPlanRunsListByExecutionPlanOptionalParams, + ExecutionPlanRunsDeleteOptionalParams, + ExecutionPlanRunsCreateOrUpdateOptionalParams, + ExecutionPlanRunsGetOptionalParams, +} from "./options.js"; diff --git a/sdk/platformvalidation/arm-platformvalidation/src/api/executionPlanRuns/operations.ts b/sdk/platformvalidation/arm-platformvalidation/src/api/executionPlanRuns/operations.ts new file mode 100644 index 000000000000..0c2a64847074 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/src/api/executionPlanRuns/operations.ts @@ -0,0 +1,297 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { PlatformValidationContext as Client } from "../index.js"; +import type { ExecutionPlanRun, _ExecutionPlanRunListResult } from "../../models/models.js"; +import { + errorResponseDeserializer, + executionPlanRunSerializer, + executionPlanRunDeserializer, + _executionPlanRunListResultDeserializer, +} from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { buildPagedAsyncIterator } from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import type { + ExecutionPlanRunsListByExecutionPlanOptionalParams, + ExecutionPlanRunsDeleteOptionalParams, + ExecutionPlanRunsCreateOrUpdateOptionalParams, + ExecutionPlanRunsGetOptionalParams, +} from "./options.js"; +import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +export function _listByExecutionPlanSend( + context: Client, + resourceGroupName: string, + cloudValidationName: string, + validationExecutionPlanName: string, + options: ExecutionPlanRunsListByExecutionPlanOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}/validationExecutionPlans/{validationExecutionPlanName}/executionPlanRuns{?api%2Dversion,%24filter}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + cloudValidationName: cloudValidationName, + validationExecutionPlanName: validationExecutionPlanName, + "api%2Dversion": context.apiVersion ?? "2026-08-01-preview", + "%24filter": options?.filter, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listByExecutionPlanDeserialize( + result: PathUncheckedResponse, +): Promise<_ExecutionPlanRunListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + if (result.body) { + error.details = errorResponseDeserializer(result.body); + } + + throw error; + } + + return _executionPlanRunListResultDeserializer(result.body); +} + +/** List Validation test execution plan runs for an execution plan */ +export function listByExecutionPlan( + context: Client, + resourceGroupName: string, + cloudValidationName: string, + validationExecutionPlanName: string, + options: ExecutionPlanRunsListByExecutionPlanOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => + _listByExecutionPlanSend( + context, + resourceGroupName, + cloudValidationName, + validationExecutionPlanName, + options, + ), + _listByExecutionPlanDeserialize, + ["200"], + { + itemName: "value", + nextLinkName: "nextLink", + apiVersion: context.apiVersion ?? "2026-08-01-preview", + }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + cloudValidationName: string, + validationExecutionPlanName: string, + executionPlanRunName: string, + options: ExecutionPlanRunsDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}/validationExecutionPlans/{validationExecutionPlanName}/executionPlanRuns/{executionPlanRunName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + cloudValidationName: cloudValidationName, + validationExecutionPlanName: validationExecutionPlanName, + executionPlanRunName: executionPlanRunName, + "api%2Dversion": context.apiVersion ?? "2026-08-01-preview", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "204", "200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + if (result.body) { + error.details = errorResponseDeserializer(result.body); + } + + throw error; + } + + return; +} + +/** Delete a validation test execution plan run resource */ +export function $delete( + context: Client, + resourceGroupName: string, + cloudValidationName: string, + validationExecutionPlanName: string, + executionPlanRunName: string, + options: ExecutionPlanRunsDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["202", "204", "200"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _$deleteSend( + context, + resourceGroupName, + cloudValidationName, + validationExecutionPlanName, + executionPlanRunName, + options, + ), + resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2026-08-01-preview", + }) as PollerLike, void>; +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + cloudValidationName: string, + validationExecutionPlanName: string, + executionPlanRunName: string, + resource: ExecutionPlanRun, + options: ExecutionPlanRunsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}/validationExecutionPlans/{validationExecutionPlanName}/executionPlanRuns/{executionPlanRunName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + cloudValidationName: cloudValidationName, + validationExecutionPlanName: validationExecutionPlanName, + executionPlanRunName: executionPlanRunName, + "api%2Dversion": context.apiVersion ?? "2026-08-01-preview", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: executionPlanRunSerializer(resource), + }); +} + +export async function _createOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + if (result.body) { + error.details = errorResponseDeserializer(result.body); + } + + throw error; + } + + return executionPlanRunDeserializer(result.body); +} + +/** Create or update a validation test execution plan */ +export function createOrUpdate( + context: Client, + resourceGroupName: string, + cloudValidationName: string, + validationExecutionPlanName: string, + executionPlanRunName: string, + resource: ExecutionPlanRun, + options: ExecutionPlanRunsCreateOrUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, ExecutionPlanRun> { + return getLongRunningPoller(context, _createOrUpdateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createOrUpdateSend( + context, + resourceGroupName, + cloudValidationName, + validationExecutionPlanName, + executionPlanRunName, + resource, + options, + ), + resourceLocationConfig: "azure-async-operation", + apiVersion: context.apiVersion ?? "2026-08-01-preview", + }) as PollerLike, ExecutionPlanRun>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + cloudValidationName: string, + validationExecutionPlanName: string, + executionPlanRunName: string, + options: ExecutionPlanRunsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}/validationExecutionPlans/{validationExecutionPlanName}/executionPlanRuns/{executionPlanRunName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + cloudValidationName: cloudValidationName, + validationExecutionPlanName: validationExecutionPlanName, + executionPlanRunName: executionPlanRunName, + "api%2Dversion": context.apiVersion ?? "2026-08-01-preview", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + if (result.body) { + error.details = errorResponseDeserializer(result.body); + } + + throw error; + } + + return executionPlanRunDeserializer(result.body); +} + +/** Get a Validation test execution plan run details */ +export async function get( + context: Client, + resourceGroupName: string, + cloudValidationName: string, + validationExecutionPlanName: string, + executionPlanRunName: string, + options: ExecutionPlanRunsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend( + context, + resourceGroupName, + cloudValidationName, + validationExecutionPlanName, + executionPlanRunName, + options, + ); + return _getDeserialize(result); +} diff --git a/sdk/platformvalidation/arm-platformvalidation/src/api/executionPlanRuns/options.ts b/sdk/platformvalidation/arm-platformvalidation/src/api/executionPlanRuns/options.ts new file mode 100644 index 000000000000..ae0876ac8161 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/src/api/executionPlanRuns/options.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface ExecutionPlanRunsListByExecutionPlanOptionalParams extends OperationOptions { + /** The OData filter expression to apply to the list operation. */ + filter?: string; +} + +/** Optional parameters. */ +export interface ExecutionPlanRunsDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface ExecutionPlanRunsCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface ExecutionPlanRunsGetOptionalParams extends OperationOptions {} diff --git a/sdk/platformvalidation/arm-platformvalidation/src/api/index.ts b/sdk/platformvalidation/arm-platformvalidation/src/api/index.ts new file mode 100644 index 000000000000..7d6c6850511c --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/src/api/index.ts @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export type { + PlatformValidationContext, + PlatformValidationClientOptionalParams, +} from "./platformValidationContext.js"; +export { createPlatformValidation } from "./platformValidationContext.js"; diff --git a/sdk/platformvalidation/arm-platformvalidation/src/api/operationStatus/index.ts b/sdk/platformvalidation/arm-platformvalidation/src/api/operationStatus/index.ts new file mode 100644 index 000000000000..f32ba55f8f1b --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/src/api/operationStatus/index.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { get } from "./operations.js"; +export type { OperationStatusGetOptionalParams } from "./options.js"; diff --git a/sdk/platformvalidation/arm-platformvalidation/src/api/operationStatus/operations.ts b/sdk/platformvalidation/arm-platformvalidation/src/api/operationStatus/operations.ts new file mode 100644 index 000000000000..4b28546652ac --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/src/api/operationStatus/operations.ts @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { PlatformValidationContext as Client } from "../index.js"; +import type { OperationStatusResult } from "../../models/models.js"; +import { + operationStatusResultDeserializer, + errorResponseDeserializer, +} from "../../models/models.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import type { OperationStatusGetOptionalParams } from "./options.js"; +import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; + +export function _getSend( + context: Client, + location: string, + operationId: string, + options: OperationStatusGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.PlatformValidation/locations/{location}/operationStatuses/{operationId}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + location: location, + operationId: operationId, + "api%2Dversion": context.apiVersion ?? "2026-08-01-preview", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + if (result.body) { + error.details = errorResponseDeserializer(result.body); + } + + throw error; + } + + return operationStatusResultDeserializer(result.body); +} + +/** Returns the current status of an async operation. */ +export async function get( + context: Client, + location: string, + operationId: string, + options: OperationStatusGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, location, operationId, options); + return _getDeserialize(result); +} diff --git a/sdk/platformvalidation/arm-platformvalidation/src/api/operationStatus/options.ts b/sdk/platformvalidation/arm-platformvalidation/src/api/operationStatus/options.ts new file mode 100644 index 000000000000..56a8e6fe5f3d --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/src/api/operationStatus/options.ts @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface OperationStatusGetOptionalParams extends OperationOptions {} diff --git a/sdk/platformvalidation/arm-platformvalidation/src/api/operations/index.ts b/sdk/platformvalidation/arm-platformvalidation/src/api/operations/index.ts new file mode 100644 index 000000000000..de883c05d2f1 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/src/api/operations/index.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { list } from "./operations.js"; +export type { OperationsListOptionalParams } from "./options.js"; diff --git a/sdk/platformvalidation/arm-platformvalidation/src/api/operations/operations.ts b/sdk/platformvalidation/arm-platformvalidation/src/api/operations/operations.ts new file mode 100644 index 000000000000..3c214b8f2577 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/src/api/operations/operations.ts @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { PlatformValidationContext as Client } from "../index.js"; +import type { _OperationListResult, Operation } from "../../models/models.js"; +import { + errorResponseDeserializer, + _operationListResultDeserializer, +} from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { buildPagedAsyncIterator } from "../../static-helpers/pagingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import type { OperationsListOptionalParams } from "./options.js"; +import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; + +export function _listSend( + context: Client, + options: OperationsListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/providers/Microsoft.PlatformValidation/operations{?api%2Dversion}", + { + "api%2Dversion": context.apiVersion ?? "2026-08-01-preview", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listDeserialize( + result: PathUncheckedResponse, +): Promise<_OperationListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + if (result.body) { + error.details = errorResponseDeserializer(result.body); + } + + throw error; + } + + return _operationListResultDeserializer(result.body); +} + +/** List the operations for the provider */ +export function list( + context: Client, + options: OperationsListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, options), + _listDeserialize, + ["200"], + { + itemName: "value", + nextLinkName: "nextLink", + apiVersion: context.apiVersion ?? "2026-08-01-preview", + }, + ); +} diff --git a/sdk/platformvalidation/arm-platformvalidation/src/api/operations/options.ts b/sdk/platformvalidation/arm-platformvalidation/src/api/operations/options.ts new file mode 100644 index 000000000000..b9a3fd9758a3 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/src/api/operations/options.ts @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface OperationsListOptionalParams extends OperationOptions {} diff --git a/sdk/platformvalidation/arm-platformvalidation/src/api/platformValidationContext.ts b/sdk/platformvalidation/arm-platformvalidation/src/api/platformValidationContext.ts new file mode 100644 index 000000000000..e03ef5a14319 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/src/api/platformValidationContext.ts @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { logger } from "../logger.js"; +import pkgJson from "@azure/arm-platformvalidation/package.json" with { type: "json" }; +import { KnownVersions } from "../models/models.js"; +import type { AzureSupportedClouds } from "../static-helpers/cloudSettingHelpers.js"; +import { getArmEndpoint } from "../static-helpers/cloudSettingHelpers.js"; +import type { Client, ClientOptions } from "@azure-rest/core-client"; +import { getClient } from "@azure-rest/core-client"; +import type { TokenCredential } from "@azure/core-auth"; + +/** Microsoft.PlatformValidation Resource Provider management API. */ +export interface PlatformValidationContext extends Client { + /** The ID of the target subscription. The value must be an UUID. */ + subscriptionId: string; + /** The API version to use for this operation. */ + /** Known values of {@link KnownVersions} that the service accepts. */ + apiVersion?: string; +} + +/** Optional parameters for the client. */ +export interface PlatformValidationClientOptionalParams extends ClientOptions { + /** The API version to use for this operation. */ + /** Known values of {@link KnownVersions} that the service accepts. */ + apiVersion?: string; + /** Specifies the Azure cloud environment for the client. */ + cloudSetting?: AzureSupportedClouds; +} + +/** Microsoft.PlatformValidation Resource Provider management API. */ +export function createPlatformValidation( + credential: TokenCredential, + subscriptionId: string, + options: PlatformValidationClientOptionalParams = {}, +): PlatformValidationContext { + const endpointUrl = + options.endpoint ?? getArmEndpoint(options.cloudSetting) ?? "https://management.azure.com"; + const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix; + const userAgentInfo = `azsdk-js-arm-platformvalidation/${pkgJson.version}`; + const userAgentPrefix = prefixFromOptions + ? `${prefixFromOptions} ${userAgentInfo}` + : `${userAgentInfo}`; + const { apiVersion: _, ...updatedOptions } = { + ...options, + userAgentOptions: { userAgentPrefix }, + loggingOptions: { logger: options.loggingOptions?.logger ?? logger.info }, + credentials: { + scopes: options.credentials?.scopes ?? ["https://management.azure.com/.default"], + }, + }; + const clientContext = getClient(endpointUrl, credential, updatedOptions); + const apiVersion = options.apiVersion; + return { ...clientContext, apiVersion, subscriptionId } as PlatformValidationContext; +} diff --git a/sdk/platformvalidation/arm-platformvalidation/src/api/validationExecutionPlans/index.ts b/sdk/platformvalidation/arm-platformvalidation/src/api/validationExecutionPlans/index.ts new file mode 100644 index 000000000000..412542257773 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/src/api/validationExecutionPlans/index.ts @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { listByResourceGroup, $delete, update, createOrUpdate, get } from "./operations.js"; +export type { + ValidationExecutionPlansListByResourceGroupOptionalParams, + ValidationExecutionPlansDeleteOptionalParams, + ValidationExecutionPlansUpdateOptionalParams, + ValidationExecutionPlansCreateOrUpdateOptionalParams, + ValidationExecutionPlansGetOptionalParams, +} from "./options.js"; diff --git a/sdk/platformvalidation/arm-platformvalidation/src/api/validationExecutionPlans/operations.ts b/sdk/platformvalidation/arm-platformvalidation/src/api/validationExecutionPlans/operations.ts new file mode 100644 index 000000000000..ef1c5fb1b435 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/src/api/validationExecutionPlans/operations.ts @@ -0,0 +1,354 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { PlatformValidationContext as Client } from "../index.js"; +import type { + ValidationExecutionPlan, + ValidationExecutionPlanUpdate, + _ValidationExecutionPlanListResult, +} from "../../models/models.js"; +import { + errorResponseDeserializer, + validationExecutionPlanSerializer, + validationExecutionPlanDeserializer, + validationExecutionPlanUpdateSerializer, + _validationExecutionPlanListResultDeserializer, +} from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { buildPagedAsyncIterator } from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import type { + ValidationExecutionPlansListByResourceGroupOptionalParams, + ValidationExecutionPlansDeleteOptionalParams, + ValidationExecutionPlansUpdateOptionalParams, + ValidationExecutionPlansCreateOrUpdateOptionalParams, + ValidationExecutionPlansGetOptionalParams, +} from "./options.js"; +import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +export function _listByResourceGroupSend( + context: Client, + resourceGroupName: string, + cloudValidationName: string, + options: ValidationExecutionPlansListByResourceGroupOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}/validationExecutionPlans{?api%2Dversion,%24filter}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + cloudValidationName: cloudValidationName, + "api%2Dversion": context.apiVersion ?? "2026-08-01-preview", + "%24filter": options?.filter, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listByResourceGroupDeserialize( + result: PathUncheckedResponse, +): Promise<_ValidationExecutionPlanListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + if (result.body) { + error.details = errorResponseDeserializer(result.body); + } + + throw error; + } + + return _validationExecutionPlanListResultDeserializer(result.body); +} + +/** List validation test execution plans by resource group */ +export function listByResourceGroup( + context: Client, + resourceGroupName: string, + cloudValidationName: string, + options: ValidationExecutionPlansListByResourceGroupOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByResourceGroupSend(context, resourceGroupName, cloudValidationName, options), + _listByResourceGroupDeserialize, + ["200"], + { + itemName: "value", + nextLinkName: "nextLink", + apiVersion: context.apiVersion ?? "2026-08-01-preview", + }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + cloudValidationName: string, + validationExecutionPlanName: string, + options: ValidationExecutionPlansDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}/validationExecutionPlans/{validationExecutionPlanName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + cloudValidationName: cloudValidationName, + validationExecutionPlanName: validationExecutionPlanName, + "api%2Dversion": context.apiVersion ?? "2026-08-01-preview", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "204", "200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + if (result.body) { + error.details = errorResponseDeserializer(result.body); + } + + throw error; + } + + return; +} + +/** Delete a validation test execution plan */ +export function $delete( + context: Client, + resourceGroupName: string, + cloudValidationName: string, + validationExecutionPlanName: string, + options: ValidationExecutionPlansDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["202", "204", "200"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _$deleteSend( + context, + resourceGroupName, + cloudValidationName, + validationExecutionPlanName, + options, + ), + resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2026-08-01-preview", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + cloudValidationName: string, + validationExecutionPlanName: string, + properties: ValidationExecutionPlanUpdate, + options: ValidationExecutionPlansUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}/validationExecutionPlans/{validationExecutionPlanName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + cloudValidationName: cloudValidationName, + validationExecutionPlanName: validationExecutionPlanName, + "api%2Dversion": context.apiVersion ?? "2026-08-01-preview", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: validationExecutionPlanUpdateSerializer(properties), + }); +} + +export async function _updateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "202", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + if (result.body) { + error.details = errorResponseDeserializer(result.body); + } + + throw error; + } + + return validationExecutionPlanDeserializer(result.body); +} + +/** Update a validation test execution plan */ +export function update( + context: Client, + resourceGroupName: string, + cloudValidationName: string, + validationExecutionPlanName: string, + properties: ValidationExecutionPlanUpdate, + options: ValidationExecutionPlansUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, ValidationExecutionPlan> { + return getLongRunningPoller(context, _updateDeserialize, ["200", "202", "201"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _updateSend( + context, + resourceGroupName, + cloudValidationName, + validationExecutionPlanName, + properties, + options, + ), + resourceLocationConfig: "location", + apiVersion: context.apiVersion ?? "2026-08-01-preview", + }) as PollerLike, ValidationExecutionPlan>; +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + cloudValidationName: string, + validationExecutionPlanName: string, + resource: ValidationExecutionPlan, + options: ValidationExecutionPlansCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}/validationExecutionPlans/{validationExecutionPlanName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + cloudValidationName: cloudValidationName, + validationExecutionPlanName: validationExecutionPlanName, + "api%2Dversion": context.apiVersion ?? "2026-08-01-preview", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { accept: "application/json", ...options.requestOptions?.headers }, + body: validationExecutionPlanSerializer(resource), + }); +} + +export async function _createOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + if (result.body) { + error.details = errorResponseDeserializer(result.body); + } + + throw error; + } + + return validationExecutionPlanDeserializer(result.body); +} + +/** Create or update a validation test execution plan */ +export function createOrUpdate( + context: Client, + resourceGroupName: string, + cloudValidationName: string, + validationExecutionPlanName: string, + resource: ValidationExecutionPlan, + options: ValidationExecutionPlansCreateOrUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, ValidationExecutionPlan> { + return getLongRunningPoller(context, _createOrUpdateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createOrUpdateSend( + context, + resourceGroupName, + cloudValidationName, + validationExecutionPlanName, + resource, + options, + ), + resourceLocationConfig: "azure-async-operation", + apiVersion: context.apiVersion ?? "2026-08-01-preview", + }) as PollerLike, ValidationExecutionPlan>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + cloudValidationName: string, + validationExecutionPlanName: string, + options: ValidationExecutionPlansGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}/validationExecutionPlans/{validationExecutionPlanName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + cloudValidationName: cloudValidationName, + validationExecutionPlanName: validationExecutionPlanName, + "api%2Dversion": context.apiVersion ?? "2026-08-01-preview", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + if (result.body) { + error.details = errorResponseDeserializer(result.body); + } + + throw error; + } + + return validationExecutionPlanDeserializer(result.body); +} + +/** Get a validation test execution plan */ +export async function get( + context: Client, + resourceGroupName: string, + cloudValidationName: string, + validationExecutionPlanName: string, + options: ValidationExecutionPlansGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend( + context, + resourceGroupName, + cloudValidationName, + validationExecutionPlanName, + options, + ); + return _getDeserialize(result); +} diff --git a/sdk/platformvalidation/arm-platformvalidation/src/api/validationExecutionPlans/options.ts b/sdk/platformvalidation/arm-platformvalidation/src/api/validationExecutionPlans/options.ts new file mode 100644 index 000000000000..e622e59f8cdb --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/src/api/validationExecutionPlans/options.ts @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface ValidationExecutionPlansListByResourceGroupOptionalParams extends OperationOptions { + /** The OData filter expression to apply to the list operation. */ + filter?: string; +} + +/** Optional parameters. */ +export interface ValidationExecutionPlansDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface ValidationExecutionPlansUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface ValidationExecutionPlansCreateOrUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface ValidationExecutionPlansGetOptionalParams extends OperationOptions {} diff --git a/sdk/platformvalidation/arm-platformvalidation/src/api/validationTestCategories/index.ts b/sdk/platformvalidation/arm-platformvalidation/src/api/validationTestCategories/index.ts new file mode 100644 index 000000000000..3546c91a6b10 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/src/api/validationTestCategories/index.ts @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { listBySubscription, get } from "./operations.js"; +export type { + ValidationTestCategoriesListBySubscriptionOptionalParams, + ValidationTestCategoriesGetOptionalParams, +} from "./options.js"; diff --git a/sdk/platformvalidation/arm-platformvalidation/src/api/validationTestCategories/operations.ts b/sdk/platformvalidation/arm-platformvalidation/src/api/validationTestCategories/operations.ts new file mode 100644 index 000000000000..823e76efaa9b --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/src/api/validationTestCategories/operations.ts @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { PlatformValidationContext as Client } from "../index.js"; +import type { + ValidationTestCategory, + _ValidationTestCategoryListResult, +} from "../../models/models.js"; +import { + errorResponseDeserializer, + validationTestCategoryDeserializer, + _validationTestCategoryListResultDeserializer, +} from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { buildPagedAsyncIterator } from "../../static-helpers/pagingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import type { + ValidationTestCategoriesListBySubscriptionOptionalParams, + ValidationTestCategoriesGetOptionalParams, +} from "./options.js"; +import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; + +export function _listBySubscriptionSend( + context: Client, + options: ValidationTestCategoriesListBySubscriptionOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.PlatformValidation/validationTestCategories{?api%2Dversion,%24filter}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": context.apiVersion ?? "2026-08-01-preview", + "%24filter": options?.filter, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listBySubscriptionDeserialize( + result: PathUncheckedResponse, +): Promise<_ValidationTestCategoryListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + if (result.body) { + error.details = errorResponseDeserializer(result.body); + } + + throw error; + } + + return _validationTestCategoryListResultDeserializer(result.body); +} + +/** List validation test category catalog entries for a subscription */ +export function listBySubscription( + context: Client, + options: ValidationTestCategoriesListBySubscriptionOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listBySubscriptionSend(context, options), + _listBySubscriptionDeserialize, + ["200"], + { + itemName: "value", + nextLinkName: "nextLink", + apiVersion: context.apiVersion ?? "2026-08-01-preview", + }, + ); +} + +export function _getSend( + context: Client, + validationTestCategoryName: string, + options: ValidationTestCategoriesGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.PlatformValidation/validationTestCategories/{validationTestCategoryName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + validationTestCategoryName: validationTestCategoryName, + "api%2Dversion": context.apiVersion ?? "2026-08-01-preview", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + if (result.body) { + error.details = errorResponseDeserializer(result.body); + } + + throw error; + } + + return validationTestCategoryDeserializer(result.body); +} + +/** Get a validation test category catalog entry */ +export async function get( + context: Client, + validationTestCategoryName: string, + options: ValidationTestCategoriesGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, validationTestCategoryName, options); + return _getDeserialize(result); +} diff --git a/sdk/platformvalidation/arm-platformvalidation/src/api/validationTestCategories/options.ts b/sdk/platformvalidation/arm-platformvalidation/src/api/validationTestCategories/options.ts new file mode 100644 index 000000000000..5f6b005bee86 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/src/api/validationTestCategories/options.ts @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface ValidationTestCategoriesListBySubscriptionOptionalParams extends OperationOptions { + /** Filter expression used to constrain the returned items. */ + filter?: string; +} + +/** Optional parameters. */ +export interface ValidationTestCategoriesGetOptionalParams extends OperationOptions {} diff --git a/sdk/platformvalidation/arm-platformvalidation/src/api/validationTestRuns/index.ts b/sdk/platformvalidation/arm-platformvalidation/src/api/validationTestRuns/index.ts new file mode 100644 index 000000000000..3dc501f2b904 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/src/api/validationTestRuns/index.ts @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { listByExecutionPlanRun, get } from "./operations.js"; +export type { + ValidationTestRunsListByExecutionPlanRunOptionalParams, + ValidationTestRunsGetOptionalParams, +} from "./options.js"; diff --git a/sdk/platformvalidation/arm-platformvalidation/src/api/validationTestRuns/operations.ts b/sdk/platformvalidation/arm-platformvalidation/src/api/validationTestRuns/operations.ts new file mode 100644 index 000000000000..c1b5219d95ec --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/src/api/validationTestRuns/operations.ts @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { PlatformValidationContext as Client } from "../index.js"; +import type { ValidationTestRun, _ValidationTestRunListResult } from "../../models/models.js"; +import { + errorResponseDeserializer, + validationTestRunDeserializer, + _validationTestRunListResultDeserializer, +} from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { buildPagedAsyncIterator } from "../../static-helpers/pagingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import type { + ValidationTestRunsListByExecutionPlanRunOptionalParams, + ValidationTestRunsGetOptionalParams, +} from "./options.js"; +import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; + +export function _listByExecutionPlanRunSend( + context: Client, + resourceGroupName: string, + cloudValidationName: string, + validationExecutionPlanName: string, + executionPlanRunName: string, + options: ValidationTestRunsListByExecutionPlanRunOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}/validationExecutionPlans/{validationExecutionPlanName}/executionPlanRuns/{executionPlanRunName}/validationTestRuns{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + cloudValidationName: cloudValidationName, + validationExecutionPlanName: validationExecutionPlanName, + executionPlanRunName: executionPlanRunName, + "api%2Dversion": context.apiVersion ?? "2026-08-01-preview", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listByExecutionPlanRunDeserialize( + result: PathUncheckedResponse, +): Promise<_ValidationTestRunListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + if (result.body) { + error.details = errorResponseDeserializer(result.body); + } + + throw error; + } + + return _validationTestRunListResultDeserializer(result.body); +} + +/** List validation test runs for an execution plan run */ +export function listByExecutionPlanRun( + context: Client, + resourceGroupName: string, + cloudValidationName: string, + validationExecutionPlanName: string, + executionPlanRunName: string, + options: ValidationTestRunsListByExecutionPlanRunOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => + _listByExecutionPlanRunSend( + context, + resourceGroupName, + cloudValidationName, + validationExecutionPlanName, + executionPlanRunName, + options, + ), + _listByExecutionPlanRunDeserialize, + ["200"], + { + itemName: "value", + nextLinkName: "nextLink", + apiVersion: context.apiVersion ?? "2026-08-01-preview", + }, + ); +} + +export function _getSend( + context: Client, + resourceGroupName: string, + cloudValidationName: string, + validationExecutionPlanName: string, + executionPlanRunName: string, + validationTestRunName: string, + options: ValidationTestRunsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}/validationExecutionPlans/{validationExecutionPlanName}/executionPlanRuns/{executionPlanRunName}/validationTestRuns/{validationTestRunName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + cloudValidationName: cloudValidationName, + validationExecutionPlanName: validationExecutionPlanName, + executionPlanRunName: executionPlanRunName, + validationTestRunName: validationTestRunName, + "api%2Dversion": context.apiVersion ?? "2026-08-01-preview", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + if (result.body) { + error.details = errorResponseDeserializer(result.body); + } + + throw error; + } + + return validationTestRunDeserializer(result.body); +} + +/** Get a validation test run details */ +export async function get( + context: Client, + resourceGroupName: string, + cloudValidationName: string, + validationExecutionPlanName: string, + executionPlanRunName: string, + validationTestRunName: string, + options: ValidationTestRunsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend( + context, + resourceGroupName, + cloudValidationName, + validationExecutionPlanName, + executionPlanRunName, + validationTestRunName, + options, + ); + return _getDeserialize(result); +} diff --git a/sdk/platformvalidation/arm-platformvalidation/src/api/validationTestRuns/options.ts b/sdk/platformvalidation/arm-platformvalidation/src/api/validationTestRuns/options.ts new file mode 100644 index 000000000000..c23fe685b1c5 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/src/api/validationTestRuns/options.ts @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface ValidationTestRunsListByExecutionPlanRunOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface ValidationTestRunsGetOptionalParams extends OperationOptions {} diff --git a/sdk/platformvalidation/arm-platformvalidation/src/api/validationTestVersions/index.ts b/sdk/platformvalidation/arm-platformvalidation/src/api/validationTestVersions/index.ts new file mode 100644 index 000000000000..a241de091920 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/src/api/validationTestVersions/index.ts @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { list, get } from "./operations.js"; +export type { + ValidationTestVersionsListOptionalParams, + ValidationTestVersionsGetOptionalParams, +} from "./options.js"; diff --git a/sdk/platformvalidation/arm-platformvalidation/src/api/validationTestVersions/operations.ts b/sdk/platformvalidation/arm-platformvalidation/src/api/validationTestVersions/operations.ts new file mode 100644 index 000000000000..c99943807325 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/src/api/validationTestVersions/operations.ts @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { PlatformValidationContext as Client } from "../index.js"; +import type { + ValidationTestVersion, + _ValidationTestVersionListResult, +} from "../../models/models.js"; +import { + errorResponseDeserializer, + validationTestVersionDeserializer, + _validationTestVersionListResultDeserializer, +} from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { buildPagedAsyncIterator } from "../../static-helpers/pagingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import type { + ValidationTestVersionsListOptionalParams, + ValidationTestVersionsGetOptionalParams, +} from "./options.js"; +import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; + +export function _listSend( + context: Client, + validationTestName: string, + options: ValidationTestVersionsListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.PlatformValidation/validationTests/{validationTestName}/versions{?api%2Dversion,%24filter}", + { + subscriptionId: context.subscriptionId, + validationTestName: validationTestName, + "api%2Dversion": context.apiVersion ?? "2026-08-01-preview", + "%24filter": options?.filter, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listDeserialize( + result: PathUncheckedResponse, +): Promise<_ValidationTestVersionListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + if (result.body) { + error.details = errorResponseDeserializer(result.body); + } + + throw error; + } + + return _validationTestVersionListResultDeserializer(result.body); +} + +/** List validation test version catalog entries */ +export function list( + context: Client, + validationTestName: string, + options: ValidationTestVersionsListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, validationTestName, options), + _listDeserialize, + ["200"], + { + itemName: "value", + nextLinkName: "nextLink", + apiVersion: context.apiVersion ?? "2026-08-01-preview", + }, + ); +} + +export function _getSend( + context: Client, + validationTestName: string, + version: string, + options: ValidationTestVersionsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.PlatformValidation/validationTests/{validationTestName}/versions/{version}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + validationTestName: validationTestName, + version: version, + "api%2Dversion": context.apiVersion ?? "2026-08-01-preview", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + if (result.body) { + error.details = errorResponseDeserializer(result.body); + } + + throw error; + } + + return validationTestVersionDeserializer(result.body); +} + +/** Get a validation test version catalog entry */ +export async function get( + context: Client, + validationTestName: string, + version: string, + options: ValidationTestVersionsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, validationTestName, version, options); + return _getDeserialize(result); +} diff --git a/sdk/platformvalidation/arm-platformvalidation/src/api/validationTestVersions/options.ts b/sdk/platformvalidation/arm-platformvalidation/src/api/validationTestVersions/options.ts new file mode 100644 index 000000000000..844394b29ec5 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/src/api/validationTestVersions/options.ts @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface ValidationTestVersionsListOptionalParams extends OperationOptions { + /** Filter expression used to constrain the returned items. */ + filter?: string; +} + +/** Optional parameters. */ +export interface ValidationTestVersionsGetOptionalParams extends OperationOptions {} diff --git a/sdk/platformvalidation/arm-platformvalidation/src/api/validationTests/index.ts b/sdk/platformvalidation/arm-platformvalidation/src/api/validationTests/index.ts new file mode 100644 index 000000000000..e82ae050cf89 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/src/api/validationTests/index.ts @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { listBySubscription, get } from "./operations.js"; +export type { + ValidationTestsListBySubscriptionOptionalParams, + ValidationTestsGetOptionalParams, +} from "./options.js"; diff --git a/sdk/platformvalidation/arm-platformvalidation/src/api/validationTests/operations.ts b/sdk/platformvalidation/arm-platformvalidation/src/api/validationTests/operations.ts new file mode 100644 index 000000000000..3d5fb9ba2393 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/src/api/validationTests/operations.ts @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { PlatformValidationContext as Client } from "../index.js"; +import type { ValidationTest, _ValidationTestListResult } from "../../models/models.js"; +import { + errorResponseDeserializer, + validationTestDeserializer, + _validationTestListResultDeserializer, +} from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { buildPagedAsyncIterator } from "../../static-helpers/pagingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import type { + ValidationTestsListBySubscriptionOptionalParams, + ValidationTestsGetOptionalParams, +} from "./options.js"; +import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; + +export function _listBySubscriptionSend( + context: Client, + options: ValidationTestsListBySubscriptionOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.PlatformValidation/validationTests{?api%2Dversion,%24filter}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": context.apiVersion ?? "2026-08-01-preview", + "%24filter": options?.filter, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _listBySubscriptionDeserialize( + result: PathUncheckedResponse, +): Promise<_ValidationTestListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + if (result.body) { + error.details = errorResponseDeserializer(result.body); + } + + throw error; + } + + return _validationTestListResultDeserializer(result.body); +} + +/** List validation test catalog entries for a subscription */ +export function listBySubscription( + context: Client, + options: ValidationTestsListBySubscriptionOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listBySubscriptionSend(context, options), + _listBySubscriptionDeserialize, + ["200"], + { + itemName: "value", + nextLinkName: "nextLink", + apiVersion: context.apiVersion ?? "2026-08-01-preview", + }, + ); +} + +export function _getSend( + context: Client, + validationTestName: string, + options: ValidationTestsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.PlatformValidation/validationTests/{validationTestName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + validationTestName: validationTestName, + "api%2Dversion": context.apiVersion ?? "2026-08-01-preview", + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { accept: "application/json", ...options.requestOptions?.headers }, + }); +} + +export async function _getDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + if (result.body) { + error.details = errorResponseDeserializer(result.body); + } + + throw error; + } + + return validationTestDeserializer(result.body); +} + +/** Get a validation test catalog entry */ +export async function get( + context: Client, + validationTestName: string, + options: ValidationTestsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, validationTestName, options); + return _getDeserialize(result); +} diff --git a/sdk/platformvalidation/arm-platformvalidation/src/api/validationTests/options.ts b/sdk/platformvalidation/arm-platformvalidation/src/api/validationTests/options.ts new file mode 100644 index 000000000000..361b28763edf --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/src/api/validationTests/options.ts @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface ValidationTestsListBySubscriptionOptionalParams extends OperationOptions { + /** Filter expression used to constrain the returned items. */ + filter?: string; +} + +/** Optional parameters. */ +export interface ValidationTestsGetOptionalParams extends OperationOptions {} diff --git a/sdk/platformvalidation/arm-platformvalidation/src/classic/cloudValidations/index.ts b/sdk/platformvalidation/arm-platformvalidation/src/classic/cloudValidations/index.ts new file mode 100644 index 000000000000..7cbfb246e3b2 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/src/classic/cloudValidations/index.ts @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { PlatformValidationContext } from "../../api/platformValidationContext.js"; +import { + listBySubscription, + listByResourceGroup, + $delete, + update, + createOrUpdate, + get, +} from "../../api/cloudValidations/operations.js"; +import type { + CloudValidationsListBySubscriptionOptionalParams, + CloudValidationsListByResourceGroupOptionalParams, + CloudValidationsDeleteOptionalParams, + CloudValidationsUpdateOptionalParams, + CloudValidationsCreateOrUpdateOptionalParams, + CloudValidationsGetOptionalParams, +} from "../../api/cloudValidations/options.js"; +import type { CloudValidation, CloudValidationUpdate } from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a CloudValidations operations. */ +export interface CloudValidationsOperations { + /** List cloud validations by subscription */ + listBySubscription: ( + options?: CloudValidationsListBySubscriptionOptionalParams, + ) => PagedAsyncIterableIterator; + /** List cloud validations by resource group */ + listByResourceGroup: ( + resourceGroupName: string, + options?: CloudValidationsListByResourceGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** Delete a cloud validation */ + delete: ( + resourceGroupName: string, + cloudValidationName: string, + options?: CloudValidationsDeleteOptionalParams, + ) => PollerLike, void>; + /** Update a cloud validation */ + update: ( + resourceGroupName: string, + cloudValidationName: string, + properties: CloudValidationUpdate, + options?: CloudValidationsUpdateOptionalParams, + ) => PollerLike, CloudValidation>; + /** Create or update a cloud validation */ + createOrUpdate: ( + resourceGroupName: string, + cloudValidationName: string, + resource: CloudValidation, + options?: CloudValidationsCreateOrUpdateOptionalParams, + ) => PollerLike, CloudValidation>; + /** Get a cloud validation */ + get: ( + resourceGroupName: string, + cloudValidationName: string, + options?: CloudValidationsGetOptionalParams, + ) => Promise; +} + +function _getCloudValidations(context: PlatformValidationContext) { + return { + listBySubscription: (options?: CloudValidationsListBySubscriptionOptionalParams) => + listBySubscription(context, options), + listByResourceGroup: ( + resourceGroupName: string, + options?: CloudValidationsListByResourceGroupOptionalParams, + ) => listByResourceGroup(context, resourceGroupName, options), + delete: ( + resourceGroupName: string, + cloudValidationName: string, + options?: CloudValidationsDeleteOptionalParams, + ) => $delete(context, resourceGroupName, cloudValidationName, options), + update: ( + resourceGroupName: string, + cloudValidationName: string, + properties: CloudValidationUpdate, + options?: CloudValidationsUpdateOptionalParams, + ) => update(context, resourceGroupName, cloudValidationName, properties, options), + createOrUpdate: ( + resourceGroupName: string, + cloudValidationName: string, + resource: CloudValidation, + options?: CloudValidationsCreateOrUpdateOptionalParams, + ) => createOrUpdate(context, resourceGroupName, cloudValidationName, resource, options), + get: ( + resourceGroupName: string, + cloudValidationName: string, + options?: CloudValidationsGetOptionalParams, + ) => get(context, resourceGroupName, cloudValidationName, options), + }; +} + +export function _getCloudValidationsOperations( + context: PlatformValidationContext, +): CloudValidationsOperations { + return { + ..._getCloudValidations(context), + }; +} diff --git a/sdk/platformvalidation/arm-platformvalidation/src/classic/executionPlanRuns/index.ts b/sdk/platformvalidation/arm-platformvalidation/src/classic/executionPlanRuns/index.ts new file mode 100644 index 000000000000..9fe3161a82c0 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/src/classic/executionPlanRuns/index.ts @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { PlatformValidationContext } from "../../api/platformValidationContext.js"; +import { + listByExecutionPlan, + $delete, + createOrUpdate, + get, +} from "../../api/executionPlanRuns/operations.js"; +import type { + ExecutionPlanRunsListByExecutionPlanOptionalParams, + ExecutionPlanRunsDeleteOptionalParams, + ExecutionPlanRunsCreateOrUpdateOptionalParams, + ExecutionPlanRunsGetOptionalParams, +} from "../../api/executionPlanRuns/options.js"; +import type { ExecutionPlanRun } from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a ExecutionPlanRuns operations. */ +export interface ExecutionPlanRunsOperations { + /** List Validation test execution plan runs for an execution plan */ + listByExecutionPlan: ( + resourceGroupName: string, + cloudValidationName: string, + validationExecutionPlanName: string, + options?: ExecutionPlanRunsListByExecutionPlanOptionalParams, + ) => PagedAsyncIterableIterator; + /** Delete a validation test execution plan run resource */ + delete: ( + resourceGroupName: string, + cloudValidationName: string, + validationExecutionPlanName: string, + executionPlanRunName: string, + options?: ExecutionPlanRunsDeleteOptionalParams, + ) => PollerLike, void>; + /** Create or update a validation test execution plan */ + createOrUpdate: ( + resourceGroupName: string, + cloudValidationName: string, + validationExecutionPlanName: string, + executionPlanRunName: string, + resource: ExecutionPlanRun, + options?: ExecutionPlanRunsCreateOrUpdateOptionalParams, + ) => PollerLike, ExecutionPlanRun>; + /** Get a Validation test execution plan run details */ + get: ( + resourceGroupName: string, + cloudValidationName: string, + validationExecutionPlanName: string, + executionPlanRunName: string, + options?: ExecutionPlanRunsGetOptionalParams, + ) => Promise; +} + +function _getExecutionPlanRuns(context: PlatformValidationContext) { + return { + listByExecutionPlan: ( + resourceGroupName: string, + cloudValidationName: string, + validationExecutionPlanName: string, + options?: ExecutionPlanRunsListByExecutionPlanOptionalParams, + ) => + listByExecutionPlan( + context, + resourceGroupName, + cloudValidationName, + validationExecutionPlanName, + options, + ), + delete: ( + resourceGroupName: string, + cloudValidationName: string, + validationExecutionPlanName: string, + executionPlanRunName: string, + options?: ExecutionPlanRunsDeleteOptionalParams, + ) => + $delete( + context, + resourceGroupName, + cloudValidationName, + validationExecutionPlanName, + executionPlanRunName, + options, + ), + createOrUpdate: ( + resourceGroupName: string, + cloudValidationName: string, + validationExecutionPlanName: string, + executionPlanRunName: string, + resource: ExecutionPlanRun, + options?: ExecutionPlanRunsCreateOrUpdateOptionalParams, + ) => + createOrUpdate( + context, + resourceGroupName, + cloudValidationName, + validationExecutionPlanName, + executionPlanRunName, + resource, + options, + ), + get: ( + resourceGroupName: string, + cloudValidationName: string, + validationExecutionPlanName: string, + executionPlanRunName: string, + options?: ExecutionPlanRunsGetOptionalParams, + ) => + get( + context, + resourceGroupName, + cloudValidationName, + validationExecutionPlanName, + executionPlanRunName, + options, + ), + }; +} + +export function _getExecutionPlanRunsOperations( + context: PlatformValidationContext, +): ExecutionPlanRunsOperations { + return { + ..._getExecutionPlanRuns(context), + }; +} diff --git a/sdk/platformvalidation/arm-platformvalidation/src/classic/index.ts b/sdk/platformvalidation/arm-platformvalidation/src/classic/index.ts new file mode 100644 index 000000000000..93e3898f76ac --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/src/classic/index.ts @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export type { CloudValidationsOperations } from "./cloudValidations/index.js"; +export type { ExecutionPlanRunsOperations } from "./executionPlanRuns/index.js"; +export type { OperationsOperations } from "./operations/index.js"; +export type { OperationStatusOperations } from "./operationStatus/index.js"; +export type { ValidationExecutionPlansOperations } from "./validationExecutionPlans/index.js"; +export type { ValidationTestCategoriesOperations } from "./validationTestCategories/index.js"; +export type { ValidationTestRunsOperations } from "./validationTestRuns/index.js"; +export type { ValidationTestsOperations } from "./validationTests/index.js"; +export type { ValidationTestVersionsOperations } from "./validationTestVersions/index.js"; diff --git a/sdk/platformvalidation/arm-platformvalidation/src/classic/operationStatus/index.ts b/sdk/platformvalidation/arm-platformvalidation/src/classic/operationStatus/index.ts new file mode 100644 index 000000000000..e7498183ec71 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/src/classic/operationStatus/index.ts @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { PlatformValidationContext } from "../../api/platformValidationContext.js"; +import { get } from "../../api/operationStatus/operations.js"; +import type { OperationStatusGetOptionalParams } from "../../api/operationStatus/options.js"; +import type { OperationStatusResult } from "../../models/models.js"; + +/** Interface representing a OperationStatus operations. */ +export interface OperationStatusOperations { + /** Returns the current status of an async operation. */ + get: ( + location: string, + operationId: string, + options?: OperationStatusGetOptionalParams, + ) => Promise; +} + +function _getOperationStatus(context: PlatformValidationContext) { + return { + get: (location: string, operationId: string, options?: OperationStatusGetOptionalParams) => + get(context, location, operationId, options), + }; +} + +export function _getOperationStatusOperations( + context: PlatformValidationContext, +): OperationStatusOperations { + return { + ..._getOperationStatus(context), + }; +} diff --git a/sdk/platformvalidation/arm-platformvalidation/src/classic/operations/index.ts b/sdk/platformvalidation/arm-platformvalidation/src/classic/operations/index.ts new file mode 100644 index 000000000000..26161f98985a --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/src/classic/operations/index.ts @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { PlatformValidationContext } from "../../api/platformValidationContext.js"; +import { list } from "../../api/operations/operations.js"; +import type { OperationsListOptionalParams } from "../../api/operations/options.js"; +import type { Operation } from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a Operations operations. */ +export interface OperationsOperations { + /** List the operations for the provider */ + list: (options?: OperationsListOptionalParams) => PagedAsyncIterableIterator; +} + +function _getOperations(context: PlatformValidationContext) { + return { + list: (options?: OperationsListOptionalParams) => list(context, options), + }; +} + +export function _getOperationsOperations(context: PlatformValidationContext): OperationsOperations { + return { + ..._getOperations(context), + }; +} diff --git a/sdk/platformvalidation/arm-platformvalidation/src/classic/validationExecutionPlans/index.ts b/sdk/platformvalidation/arm-platformvalidation/src/classic/validationExecutionPlans/index.ts new file mode 100644 index 000000000000..bec1c3860760 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/src/classic/validationExecutionPlans/index.ts @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { PlatformValidationContext } from "../../api/platformValidationContext.js"; +import { + listByResourceGroup, + $delete, + update, + createOrUpdate, + get, +} from "../../api/validationExecutionPlans/operations.js"; +import type { + ValidationExecutionPlansListByResourceGroupOptionalParams, + ValidationExecutionPlansDeleteOptionalParams, + ValidationExecutionPlansUpdateOptionalParams, + ValidationExecutionPlansCreateOrUpdateOptionalParams, + ValidationExecutionPlansGetOptionalParams, +} from "../../api/validationExecutionPlans/options.js"; +import type { + ValidationExecutionPlan, + ValidationExecutionPlanUpdate, +} from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a ValidationExecutionPlans operations. */ +export interface ValidationExecutionPlansOperations { + /** List validation test execution plans by resource group */ + listByResourceGroup: ( + resourceGroupName: string, + cloudValidationName: string, + options?: ValidationExecutionPlansListByResourceGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** Delete a validation test execution plan */ + delete: ( + resourceGroupName: string, + cloudValidationName: string, + validationExecutionPlanName: string, + options?: ValidationExecutionPlansDeleteOptionalParams, + ) => PollerLike, void>; + /** Update a validation test execution plan */ + update: ( + resourceGroupName: string, + cloudValidationName: string, + validationExecutionPlanName: string, + properties: ValidationExecutionPlanUpdate, + options?: ValidationExecutionPlansUpdateOptionalParams, + ) => PollerLike, ValidationExecutionPlan>; + /** Create or update a validation test execution plan */ + createOrUpdate: ( + resourceGroupName: string, + cloudValidationName: string, + validationExecutionPlanName: string, + resource: ValidationExecutionPlan, + options?: ValidationExecutionPlansCreateOrUpdateOptionalParams, + ) => PollerLike, ValidationExecutionPlan>; + /** Get a validation test execution plan */ + get: ( + resourceGroupName: string, + cloudValidationName: string, + validationExecutionPlanName: string, + options?: ValidationExecutionPlansGetOptionalParams, + ) => Promise; +} + +function _getValidationExecutionPlans(context: PlatformValidationContext) { + return { + listByResourceGroup: ( + resourceGroupName: string, + cloudValidationName: string, + options?: ValidationExecutionPlansListByResourceGroupOptionalParams, + ) => listByResourceGroup(context, resourceGroupName, cloudValidationName, options), + delete: ( + resourceGroupName: string, + cloudValidationName: string, + validationExecutionPlanName: string, + options?: ValidationExecutionPlansDeleteOptionalParams, + ) => + $delete( + context, + resourceGroupName, + cloudValidationName, + validationExecutionPlanName, + options, + ), + update: ( + resourceGroupName: string, + cloudValidationName: string, + validationExecutionPlanName: string, + properties: ValidationExecutionPlanUpdate, + options?: ValidationExecutionPlansUpdateOptionalParams, + ) => + update( + context, + resourceGroupName, + cloudValidationName, + validationExecutionPlanName, + properties, + options, + ), + createOrUpdate: ( + resourceGroupName: string, + cloudValidationName: string, + validationExecutionPlanName: string, + resource: ValidationExecutionPlan, + options?: ValidationExecutionPlansCreateOrUpdateOptionalParams, + ) => + createOrUpdate( + context, + resourceGroupName, + cloudValidationName, + validationExecutionPlanName, + resource, + options, + ), + get: ( + resourceGroupName: string, + cloudValidationName: string, + validationExecutionPlanName: string, + options?: ValidationExecutionPlansGetOptionalParams, + ) => get(context, resourceGroupName, cloudValidationName, validationExecutionPlanName, options), + }; +} + +export function _getValidationExecutionPlansOperations( + context: PlatformValidationContext, +): ValidationExecutionPlansOperations { + return { + ..._getValidationExecutionPlans(context), + }; +} diff --git a/sdk/platformvalidation/arm-platformvalidation/src/classic/validationTestCategories/index.ts b/sdk/platformvalidation/arm-platformvalidation/src/classic/validationTestCategories/index.ts new file mode 100644 index 000000000000..aa03d1255381 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/src/classic/validationTestCategories/index.ts @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { PlatformValidationContext } from "../../api/platformValidationContext.js"; +import { listBySubscription, get } from "../../api/validationTestCategories/operations.js"; +import type { + ValidationTestCategoriesListBySubscriptionOptionalParams, + ValidationTestCategoriesGetOptionalParams, +} from "../../api/validationTestCategories/options.js"; +import type { ValidationTestCategory } from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a ValidationTestCategories operations. */ +export interface ValidationTestCategoriesOperations { + /** List validation test category catalog entries for a subscription */ + listBySubscription: ( + options?: ValidationTestCategoriesListBySubscriptionOptionalParams, + ) => PagedAsyncIterableIterator; + /** Get a validation test category catalog entry */ + get: ( + validationTestCategoryName: string, + options?: ValidationTestCategoriesGetOptionalParams, + ) => Promise; +} + +function _getValidationTestCategories(context: PlatformValidationContext) { + return { + listBySubscription: (options?: ValidationTestCategoriesListBySubscriptionOptionalParams) => + listBySubscription(context, options), + get: ( + validationTestCategoryName: string, + options?: ValidationTestCategoriesGetOptionalParams, + ) => get(context, validationTestCategoryName, options), + }; +} + +export function _getValidationTestCategoriesOperations( + context: PlatformValidationContext, +): ValidationTestCategoriesOperations { + return { + ..._getValidationTestCategories(context), + }; +} diff --git a/sdk/platformvalidation/arm-platformvalidation/src/classic/validationTestRuns/index.ts b/sdk/platformvalidation/arm-platformvalidation/src/classic/validationTestRuns/index.ts new file mode 100644 index 000000000000..d3bc951d029e --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/src/classic/validationTestRuns/index.ts @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { PlatformValidationContext } from "../../api/platformValidationContext.js"; +import { listByExecutionPlanRun, get } from "../../api/validationTestRuns/operations.js"; +import type { + ValidationTestRunsListByExecutionPlanRunOptionalParams, + ValidationTestRunsGetOptionalParams, +} from "../../api/validationTestRuns/options.js"; +import type { ValidationTestRun } from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a ValidationTestRuns operations. */ +export interface ValidationTestRunsOperations { + /** List validation test runs for an execution plan run */ + listByExecutionPlanRun: ( + resourceGroupName: string, + cloudValidationName: string, + validationExecutionPlanName: string, + executionPlanRunName: string, + options?: ValidationTestRunsListByExecutionPlanRunOptionalParams, + ) => PagedAsyncIterableIterator; + /** Get a validation test run details */ + get: ( + resourceGroupName: string, + cloudValidationName: string, + validationExecutionPlanName: string, + executionPlanRunName: string, + validationTestRunName: string, + options?: ValidationTestRunsGetOptionalParams, + ) => Promise; +} + +function _getValidationTestRuns(context: PlatformValidationContext) { + return { + listByExecutionPlanRun: ( + resourceGroupName: string, + cloudValidationName: string, + validationExecutionPlanName: string, + executionPlanRunName: string, + options?: ValidationTestRunsListByExecutionPlanRunOptionalParams, + ) => + listByExecutionPlanRun( + context, + resourceGroupName, + cloudValidationName, + validationExecutionPlanName, + executionPlanRunName, + options, + ), + get: ( + resourceGroupName: string, + cloudValidationName: string, + validationExecutionPlanName: string, + executionPlanRunName: string, + validationTestRunName: string, + options?: ValidationTestRunsGetOptionalParams, + ) => + get( + context, + resourceGroupName, + cloudValidationName, + validationExecutionPlanName, + executionPlanRunName, + validationTestRunName, + options, + ), + }; +} + +export function _getValidationTestRunsOperations( + context: PlatformValidationContext, +): ValidationTestRunsOperations { + return { + ..._getValidationTestRuns(context), + }; +} diff --git a/sdk/platformvalidation/arm-platformvalidation/src/classic/validationTestVersions/index.ts b/sdk/platformvalidation/arm-platformvalidation/src/classic/validationTestVersions/index.ts new file mode 100644 index 000000000000..fc94b03626d5 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/src/classic/validationTestVersions/index.ts @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { PlatformValidationContext } from "../../api/platformValidationContext.js"; +import { list, get } from "../../api/validationTestVersions/operations.js"; +import type { + ValidationTestVersionsListOptionalParams, + ValidationTestVersionsGetOptionalParams, +} from "../../api/validationTestVersions/options.js"; +import type { ValidationTestVersion } from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a ValidationTestVersions operations. */ +export interface ValidationTestVersionsOperations { + /** List validation test version catalog entries */ + list: ( + validationTestName: string, + options?: ValidationTestVersionsListOptionalParams, + ) => PagedAsyncIterableIterator; + /** Get a validation test version catalog entry */ + get: ( + validationTestName: string, + version: string, + options?: ValidationTestVersionsGetOptionalParams, + ) => Promise; +} + +function _getValidationTestVersions(context: PlatformValidationContext) { + return { + list: (validationTestName: string, options?: ValidationTestVersionsListOptionalParams) => + list(context, validationTestName, options), + get: ( + validationTestName: string, + version: string, + options?: ValidationTestVersionsGetOptionalParams, + ) => get(context, validationTestName, version, options), + }; +} + +export function _getValidationTestVersionsOperations( + context: PlatformValidationContext, +): ValidationTestVersionsOperations { + return { + ..._getValidationTestVersions(context), + }; +} diff --git a/sdk/platformvalidation/arm-platformvalidation/src/classic/validationTests/index.ts b/sdk/platformvalidation/arm-platformvalidation/src/classic/validationTests/index.ts new file mode 100644 index 000000000000..6bc704db9108 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/src/classic/validationTests/index.ts @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { PlatformValidationContext } from "../../api/platformValidationContext.js"; +import { listBySubscription, get } from "../../api/validationTests/operations.js"; +import type { + ValidationTestsListBySubscriptionOptionalParams, + ValidationTestsGetOptionalParams, +} from "../../api/validationTests/options.js"; +import type { ValidationTest } from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a ValidationTests operations. */ +export interface ValidationTestsOperations { + /** List validation test catalog entries for a subscription */ + listBySubscription: ( + options?: ValidationTestsListBySubscriptionOptionalParams, + ) => PagedAsyncIterableIterator; + /** Get a validation test catalog entry */ + get: ( + validationTestName: string, + options?: ValidationTestsGetOptionalParams, + ) => Promise; +} + +function _getValidationTests(context: PlatformValidationContext) { + return { + listBySubscription: (options?: ValidationTestsListBySubscriptionOptionalParams) => + listBySubscription(context, options), + get: (validationTestName: string, options?: ValidationTestsGetOptionalParams) => + get(context, validationTestName, options), + }; +} + +export function _getValidationTestsOperations( + context: PlatformValidationContext, +): ValidationTestsOperations { + return { + ..._getValidationTests(context), + }; +} diff --git a/sdk/platformvalidation/arm-platformvalidation/src/index.ts b/sdk/platformvalidation/arm-platformvalidation/src/index.ts new file mode 100644 index 000000000000..c8c83fec5f88 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/src/index.ts @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { AzureSupportedClouds } from "./static-helpers/cloudSettingHelpers.js"; +import { AzureClouds } from "./static-helpers/cloudSettingHelpers.js"; +import type { + PageSettings, + ContinuablePage, + PagedAsyncIterableIterator, +} from "./static-helpers/pagingHelpers.js"; + +export { PlatformValidationClient } from "./platformValidationClient.js"; +export type { RestorePollerOptions } from "./restorePollerHelpers.js"; +export { restorePoller } from "./restorePollerHelpers.js"; +export type { + OperationStatusResult, + ErrorDetail, + ErrorAdditionalInfo, + ErrorResponse, + Operation, + OperationDisplay, + Origin, + ActionType, + CloudValidation, + CloudValidationProperties, + ProvisioningState, + ManagedOnBehalfOfConfiguration, + MoboBrokerResource, + TrackedResource, + Resource, + SystemData, + CreatedByType, + ResourceProvisioningState, + CloudValidationUpdate, + CloudValidationUpdateProperties, + ValidationExecutionPlan, + ValidationExecutionPlanProperties, + ValidationExecutionPlanProvisioningState, + ValidationExecutionPlanUpdate, + ValidationExecutionPlanUpdateProperties, + ExecutionPlanRun, + ExecutionPlanRunProperties, + ExecutionPlanRunStatus, + TestRunSummary, + TestRunOverallResult, + ExecutionPlanRunProvisioningState, + ProxyResource, + ValidationTestRun, + ValidationTestRunProperties, + ValidationTestRunStatus, + ValidationTestRunProvisioningState, + ValidationTestPassDetails, + ValidationTestFailureDetails, + ValidationTest, + ValidationTestProperties, + CatalogAudience, + ValidationTestInput, + ValidationTestInputDefinition, + ValidationTestInputDataType, + ValidationTestVersion, + ValidationTestVersionProperties, + ValidationTestCategory, + ValidationTestCategoryProperties, +} from "./models/index.js"; +export { + KnownOrigin, + KnownActionType, + KnownProvisioningState, + KnownCreatedByType, + KnownResourceProvisioningState, + KnownValidationExecutionPlanProvisioningState, + KnownExecutionPlanRunStatus, + KnownTestRunOverallResult, + KnownExecutionPlanRunProvisioningState, + KnownValidationTestRunStatus, + KnownValidationTestRunProvisioningState, + KnownCatalogAudience, + KnownValidationTestInputDataType, + KnownVersions, +} from "./models/index.js"; +export type { PlatformValidationClientOptionalParams } from "./api/index.js"; +export type { + CloudValidationsListBySubscriptionOptionalParams, + CloudValidationsListByResourceGroupOptionalParams, + CloudValidationsDeleteOptionalParams, + CloudValidationsUpdateOptionalParams, + CloudValidationsCreateOrUpdateOptionalParams, + CloudValidationsGetOptionalParams, +} from "./api/cloudValidations/index.js"; +export type { + ExecutionPlanRunsListByExecutionPlanOptionalParams, + ExecutionPlanRunsDeleteOptionalParams, + ExecutionPlanRunsCreateOrUpdateOptionalParams, + ExecutionPlanRunsGetOptionalParams, +} from "./api/executionPlanRuns/index.js"; +export type { OperationsListOptionalParams } from "./api/operations/index.js"; +export type { OperationStatusGetOptionalParams } from "./api/operationStatus/index.js"; +export type { + ValidationExecutionPlansListByResourceGroupOptionalParams, + ValidationExecutionPlansDeleteOptionalParams, + ValidationExecutionPlansUpdateOptionalParams, + ValidationExecutionPlansCreateOrUpdateOptionalParams, + ValidationExecutionPlansGetOptionalParams, +} from "./api/validationExecutionPlans/index.js"; +export type { + ValidationTestCategoriesListBySubscriptionOptionalParams, + ValidationTestCategoriesGetOptionalParams, +} from "./api/validationTestCategories/index.js"; +export type { + ValidationTestRunsListByExecutionPlanRunOptionalParams, + ValidationTestRunsGetOptionalParams, +} from "./api/validationTestRuns/index.js"; +export type { + ValidationTestsListBySubscriptionOptionalParams, + ValidationTestsGetOptionalParams, +} from "./api/validationTests/index.js"; +export type { + ValidationTestVersionsListOptionalParams, + ValidationTestVersionsGetOptionalParams, +} from "./api/validationTestVersions/index.js"; +export type { + CloudValidationsOperations, + ExecutionPlanRunsOperations, + OperationsOperations, + OperationStatusOperations, + ValidationExecutionPlansOperations, + ValidationTestCategoriesOperations, + ValidationTestRunsOperations, + ValidationTestsOperations, + ValidationTestVersionsOperations, +} from "./classic/index.js"; +export type { PageSettings, ContinuablePage, PagedAsyncIterableIterator }; +export { AzureClouds }; +export type { AzureSupportedClouds }; +export { RestError, isRestError } from "@azure/core-rest-pipeline"; diff --git a/sdk/platformvalidation/arm-platformvalidation/src/logger.ts b/sdk/platformvalidation/arm-platformvalidation/src/logger.ts new file mode 100644 index 000000000000..0a21ba07f2d3 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/src/logger.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { createClientLogger } from "@azure/logger"; +export const logger = createClientLogger("arm-platformvalidation"); diff --git a/sdk/platformvalidation/arm-platformvalidation/src/models/index.ts b/sdk/platformvalidation/arm-platformvalidation/src/models/index.ts new file mode 100644 index 000000000000..463e1cc69c8e --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/src/models/index.ts @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export type { + OperationStatusResult, + ErrorDetail, + ErrorAdditionalInfo, + ErrorResponse, + Operation, + OperationDisplay, + Origin, + ActionType, + CloudValidation, + CloudValidationProperties, + ProvisioningState, + ManagedOnBehalfOfConfiguration, + MoboBrokerResource, + TrackedResource, + Resource, + SystemData, + CreatedByType, + ResourceProvisioningState, + CloudValidationUpdate, + CloudValidationUpdateProperties, + ValidationExecutionPlan, + ValidationExecutionPlanProperties, + ValidationExecutionPlanProvisioningState, + ValidationExecutionPlanUpdate, + ValidationExecutionPlanUpdateProperties, + ExecutionPlanRun, + ExecutionPlanRunProperties, + ExecutionPlanRunStatus, + TestRunSummary, + TestRunOverallResult, + ExecutionPlanRunProvisioningState, + ProxyResource, + ValidationTestRun, + ValidationTestRunProperties, + ValidationTestRunStatus, + ValidationTestRunProvisioningState, + ValidationTestPassDetails, + ValidationTestFailureDetails, + ValidationTest, + ValidationTestProperties, + CatalogAudience, + ValidationTestInput, + ValidationTestInputDefinition, + ValidationTestInputDataType, + ValidationTestVersion, + ValidationTestVersionProperties, + ValidationTestCategory, + ValidationTestCategoryProperties, +} from "./models.js"; +export { + KnownOrigin, + KnownActionType, + KnownProvisioningState, + KnownCreatedByType, + KnownResourceProvisioningState, + KnownValidationExecutionPlanProvisioningState, + KnownExecutionPlanRunStatus, + KnownTestRunOverallResult, + KnownExecutionPlanRunProvisioningState, + KnownValidationTestRunStatus, + KnownValidationTestRunProvisioningState, + KnownCatalogAudience, + KnownValidationTestInputDataType, + KnownVersions, +} from "./models.js"; diff --git a/sdk/platformvalidation/arm-platformvalidation/src/models/models.ts b/sdk/platformvalidation/arm-platformvalidation/src/models/models.ts new file mode 100644 index 000000000000..2f83e28a522d --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/src/models/models.ts @@ -0,0 +1,1555 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/* + * This file contains only generated model types and their (de)serializers. + * Disable the following rules for internal models with '_' prefix and deserializers which require 'any' for raw JSON input. + */ +/* eslint-disable @typescript-eslint/naming-convention */ +/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ + +/** The current status of an async operation. */ +export interface OperationStatusResult { + /** Fully qualified ID for the async operation. */ + id?: string; + /** Name of the async operation. */ + name?: string; + /** Operation status. */ + status: string; + /** Percent of the operation that is complete. */ + percentComplete?: number; + /** The start time of the operation. */ + startTime?: Date; + /** The end time of the operation. */ + endTime?: Date; + /** The operations list. */ + operations?: OperationStatusResult[]; + /** If present, details of the operation error. */ + error?: ErrorDetail; + /** Fully qualified ID of the resource against which the original async operation was started. */ + readonly resourceId?: string; +} + +export function operationStatusResultDeserializer(item: any): OperationStatusResult { + return { + id: item["id"], + name: item["name"], + status: item["status"], + percentComplete: item["percentComplete"], + startTime: !item["startTime"] ? item["startTime"] : new Date(item["startTime"]), + endTime: !item["endTime"] ? item["endTime"] : new Date(item["endTime"]), + operations: !item["operations"] + ? item["operations"] + : operationStatusResultArrayDeserializer(item["operations"]), + error: !item["error"] ? item["error"] : errorDetailDeserializer(item["error"]), + resourceId: item["resourceId"], + }; +} + +export function operationStatusResultArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return operationStatusResultDeserializer(item); + }); +} + +/** The error detail. */ +export interface ErrorDetail { + /** The error code. */ + readonly code?: string; + /** The error message. */ + readonly message?: string; + /** The error target. */ + readonly target?: string; + /** The error details. */ + readonly details?: ErrorDetail[]; + /** The error additional info. */ + readonly additionalInfo?: ErrorAdditionalInfo[]; +} + +export function errorDetailDeserializer(item: any): ErrorDetail { + return { + code: item["code"], + message: item["message"], + target: item["target"], + details: !item["details"] ? item["details"] : errorDetailArrayDeserializer(item["details"]), + additionalInfo: !item["additionalInfo"] + ? item["additionalInfo"] + : errorAdditionalInfoArrayDeserializer(item["additionalInfo"]), + }; +} + +export function errorDetailArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return errorDetailDeserializer(item); + }); +} + +export function errorAdditionalInfoArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return errorAdditionalInfoDeserializer(item); + }); +} + +/** The resource management error additional info. */ +export interface ErrorAdditionalInfo { + /** The additional info type. */ + readonly type?: string; + /** The additional info. */ + readonly info?: any; +} + +export function errorAdditionalInfoDeserializer(item: any): ErrorAdditionalInfo { + return { + type: item["type"], + info: item["info"], + }; +} + +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. */ +export interface ErrorResponse { + /** The error object. */ + error?: ErrorDetail; +} + +export function errorResponseDeserializer(item: any): ErrorResponse { + return { + error: !item["error"] ? item["error"] : errorDetailDeserializer(item["error"]), + }; +} + +/** A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. */ +export interface _OperationListResult { + /** The Operation items on this page */ + value: Operation[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _operationListResultDeserializer(item: any): _OperationListResult { + return { + value: operationArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function operationArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return operationDeserializer(item); + }); +} + +/** Details of a REST API operation, returned from the Resource Provider Operations API */ +export interface Operation { + /** The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" */ + readonly name?: string; + /** Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure Resource Manager/control-plane operations. */ + readonly isDataAction?: boolean; + /** Localized display information for this particular operation. */ + display?: OperationDisplay; + /** The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" */ + readonly origin?: Origin; + /** Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ + readonly actionType?: ActionType; +} + +export function operationDeserializer(item: any): Operation { + return { + name: item["name"], + isDataAction: item["isDataAction"], + display: !item["display"] ? item["display"] : operationDisplayDeserializer(item["display"]), + origin: item["origin"], + actionType: item["actionType"], + }; +} + +/** Localized display information for an operation. */ +export interface OperationDisplay { + /** The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". */ + readonly provider?: string; + /** The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". */ + readonly resource?: string; + /** The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". */ + readonly operation?: string; + /** The short, localized friendly description of the operation; suitable for tool tips and detailed views. */ + readonly description?: string; +} + +export function operationDisplayDeserializer(item: any): OperationDisplay { + return { + provider: item["provider"], + resource: item["resource"], + operation: item["operation"], + description: item["description"], + }; +} + +/** The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" */ +export enum KnownOrigin { + /** Indicates the operation is initiated by a user. */ + User = "user", + /** Indicates the operation is initiated by a system. */ + System = "system", + /** Indicates the operation is initiated by a user or system. */ + UserSystem = "user,system", +} + +/** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" \ + * {@link KnownOrigin} can be used interchangeably with Origin, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **user**: Indicates the operation is initiated by a user. \ + * **system**: Indicates the operation is initiated by a system. \ + * **user,system**: Indicates the operation is initiated by a user or system. + */ +export type Origin = string; + +/** Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ +export enum KnownActionType { + /** Actions are for internal-only APIs. */ + Internal = "Internal", +} + +/** + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. \ + * {@link KnownActionType} can be used interchangeably with ActionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Internal**: Actions are for internal-only APIs. + */ +export type ActionType = string; + +/** Cloud Validation Resource */ +export interface CloudValidation extends TrackedResource { + /** The resource-specific properties for this resource. */ + properties?: CloudValidationProperties; +} + +export function cloudValidationSerializer(item: CloudValidation): any { + return { + tags: item["tags"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : cloudValidationPropertiesSerializer(item["properties"]), + }; +} + +export function cloudValidationDeserializer(item: any): CloudValidation { + return { + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : cloudValidationPropertiesDeserializer(item["properties"]), + }; +} + +/** Cloud Validation properties */ +export interface CloudValidationProperties { + /** The description of the resource. */ + description?: string; + /** The provisioning state of the resource. */ + readonly provisioningState?: ProvisioningState; + /** Error details. Populated when provisioningState is Failed or Canceled. */ + readonly error?: ErrorDetail; + /** Managed On Behalf Of Configuration. */ + readonly managedOnBehalfOfConfiguration?: ManagedOnBehalfOfConfiguration; +} + +export function cloudValidationPropertiesSerializer(item: CloudValidationProperties): any { + return { description: item["description"] }; +} + +export function cloudValidationPropertiesDeserializer(item: any): CloudValidationProperties { + return { + description: item["description"], + provisioningState: item["provisioningState"], + error: !item["error"] ? item["error"] : errorDetailDeserializer(item["error"]), + managedOnBehalfOfConfiguration: !item["managedOnBehalfOfConfiguration"] + ? item["managedOnBehalfOfConfiguration"] + : managedOnBehalfOfConfigurationDeserializer(item["managedOnBehalfOfConfiguration"]), + }; +} + +/** The resource provisioning state. */ +export enum KnownProvisioningState { + /** Resource has been created. */ + Succeeded = "Succeeded", + /** Resource creation failed. */ + Failed = "Failed", + /** Resource creation was canceled. */ + Canceled = "Canceled", + /** The resource is being provisioned. */ + Creating = "Creating", + /** The resource is updating. */ + Updating = "Updating", + /** The resource is being disabled. */ + Disabling = "Disabling", + /** The resource is being deleted */ + Deleting = "Deleting", + /** The resource create request has been accepted */ + Accepted = "Accepted", +} + +/** + * The resource provisioning state. \ + * {@link KnownProvisioningState} can be used interchangeably with ProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded**: Resource has been created. \ + * **Failed**: Resource creation failed. \ + * **Canceled**: Resource creation was canceled. \ + * **Creating**: The resource is being provisioned. \ + * **Updating**: The resource is updating. \ + * **Disabling**: The resource is being disabled. \ + * **Deleting**: The resource is being deleted \ + * **Accepted**: The resource create request has been accepted + */ +export type ProvisioningState = string; + +/** Managed-On-Behalf-Of configuration properties. This configuration exists for the resources where a resource provider manages those resources on behalf of the resource owner. */ +export interface ManagedOnBehalfOfConfiguration { + /** Managed-On-Behalf-Of broker resources */ + readonly moboBrokerResources?: MoboBrokerResource[]; +} + +export function managedOnBehalfOfConfigurationDeserializer( + item: any, +): ManagedOnBehalfOfConfiguration { + return { + moboBrokerResources: !item["moboBrokerResources"] + ? item["moboBrokerResources"] + : moboBrokerResourceArrayDeserializer(item["moboBrokerResources"]), + }; +} + +export function moboBrokerResourceArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return moboBrokerResourceDeserializer(item); + }); +} + +/** Managed-On-Behalf-Of broker resource. This resource is created by the Resource Provider to manage some resources on behalf of the user. */ +export interface MoboBrokerResource { + /** Resource identifier of a Managed-On-Behalf-Of broker resource */ + id?: string; +} + +export function moboBrokerResourceDeserializer(item: any): MoboBrokerResource { + return { + id: item["id"], + }; +} + +/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ +export interface TrackedResource extends Resource { + /** Resource tags. */ + tags?: Record; + /** The geo-location where the resource lives */ + location: string; +} + +export function trackedResourceSerializer(item: TrackedResource): any { + return { tags: item["tags"], location: item["location"] }; +} + +export function trackedResourceDeserializer(item: any): TrackedResource { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + location: item["location"], + }; +} + +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { + /** Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} */ + readonly id?: string; + /** The name of the resource */ + readonly name?: string; + /** The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" */ + readonly type?: string; + /** Azure Resource Manager metadata containing createdBy and modifiedBy information. */ + readonly systemData?: SystemData; +} + +export function resourceSerializer(_item: Resource): any { + return {}; +} + +export function resourceDeserializer(item: any): Resource { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + }; +} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** The type of identity that last modified the resource. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; +} + +export function systemDataDeserializer(item: any): SystemData { + return { + createdBy: item["createdBy"], + createdByType: item["createdByType"], + createdAt: !item["createdAt"] ? item["createdAt"] : new Date(item["createdAt"]), + lastModifiedBy: item["lastModifiedBy"], + lastModifiedByType: item["lastModifiedByType"], + lastModifiedAt: !item["lastModifiedAt"] + ? item["lastModifiedAt"] + : new Date(item["lastModifiedAt"]), + }; +} + +/** The kind of entity that created the resource. */ +export enum KnownCreatedByType { + /** The entity was created by a user. */ + User = "User", + /** The entity was created by an application. */ + Application = "Application", + /** The entity was created by a managed identity. */ + ManagedIdentity = "ManagedIdentity", + /** The entity was created by a key. */ + Key = "Key", +} + +/** + * The kind of entity that created the resource. \ + * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **User**: The entity was created by a user. \ + * **Application**: The entity was created by an application. \ + * **ManagedIdentity**: The entity was created by a managed identity. \ + * **Key**: The entity was created by a key. + */ +export type CreatedByType = string; + +/** The provisioning state of a resource type. */ +export enum KnownResourceProvisioningState { + /** Resource has been created. */ + Succeeded = "Succeeded", + /** Resource creation failed. */ + Failed = "Failed", + /** Resource creation was canceled. */ + Canceled = "Canceled", +} + +/** + * The provisioning state of a resource type. \ + * {@link KnownResourceProvisioningState} can be used interchangeably with ResourceProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded**: Resource has been created. \ + * **Failed**: Resource creation failed. \ + * **Canceled**: Resource creation was canceled. + */ +export type ResourceProvisioningState = string; + +/** The type used for update operations of the CloudValidation. */ +export interface CloudValidationUpdate { + /** Resource tags. */ + tags?: Record; + /** The resource-specific properties for this resource. */ + properties?: CloudValidationUpdateProperties; +} + +export function cloudValidationUpdateSerializer(item: CloudValidationUpdate): any { + return { + tags: item["tags"], + properties: !item["properties"] + ? item["properties"] + : cloudValidationUpdatePropertiesSerializer(item["properties"]), + }; +} + +/** The updatable properties of the CloudValidation. */ +export interface CloudValidationUpdateProperties { + /** The description of the resource. */ + description?: string; +} + +export function cloudValidationUpdatePropertiesSerializer( + item: CloudValidationUpdateProperties, +): any { + return { description: item["description"] }; +} + +/** The response of a CloudValidation list operation. */ +export interface _CloudValidationListResult { + /** The CloudValidation items on this page */ + value: CloudValidation[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _cloudValidationListResultDeserializer(item: any): _CloudValidationListResult { + return { + value: cloudValidationArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function cloudValidationArraySerializer(result: Array): any[] { + return result.map((item) => { + return cloudValidationSerializer(item); + }); +} + +export function cloudValidationArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return cloudValidationDeserializer(item); + }); +} + +/** Validation Test Execution Plan */ +export interface ValidationExecutionPlan extends TrackedResource { + /** The resource-specific properties for this resource. */ + properties?: ValidationExecutionPlanProperties; +} + +export function validationExecutionPlanSerializer(item: ValidationExecutionPlan): any { + return { + tags: item["tags"], + location: item["location"], + properties: !item["properties"] + ? item["properties"] + : validationExecutionPlanPropertiesSerializer(item["properties"]), + }; +} + +export function validationExecutionPlanDeserializer(item: any): ValidationExecutionPlan { + return { + tags: !item["tags"] + ? item["tags"] + : Object.fromEntries(Object.entries(item["tags"]).map(([k, p]: [string, any]) => [k, p])), + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : validationExecutionPlanPropertiesDeserializer(item["properties"]), + }; +} + +/** Validation Test Execution Plan properties */ +export interface ValidationExecutionPlanProperties { + /** The description of the resource. */ + description?: string; + /** + * URI where the configuration of the execution plan is defined. + * Either this property or `planConfigurationJson` is mandatory while creating; they are mutually exclusive. + * This must be a plain, non-SAS reference (no embedded credentials, tokens, or query-string secrets); + * the service reads the referenced content using its managed identity. + * This value is returned as-is in get responses, so it must not contain credentials or other secrets. + */ + planConfigurationUri?: string; + /** + * Entire execution plan configuration/manifest json. + * Either this property or `planConfigurationUri` is mandatory while creating; they are mutually exclusive. + * In get, always return the entire json configuration. + * This value is returned as-is in get responses, so it must not contain credentials or other secrets. + */ + planConfigurationJson?: string; + /** The provisioning state of the resource. */ + readonly provisioningState?: ValidationExecutionPlanProvisioningState; + /** Error details. Populated when provisioningState is Failed or Canceled. */ + readonly error?: ErrorDetail; +} + +export function validationExecutionPlanPropertiesSerializer( + item: ValidationExecutionPlanProperties, +): any { + return { + description: item["description"], + planConfigurationUri: item["planConfigurationUri"], + planConfigurationJson: item["planConfigurationJson"], + }; +} + +export function validationExecutionPlanPropertiesDeserializer( + item: any, +): ValidationExecutionPlanProperties { + return { + description: item["description"], + planConfigurationUri: item["planConfigurationUri"], + planConfigurationJson: item["planConfigurationJson"], + provisioningState: item["provisioningState"], + error: !item["error"] ? item["error"] : errorDetailDeserializer(item["error"]), + }; +} + +/** The execution plan resource provisioning state. */ +export enum KnownValidationExecutionPlanProvisioningState { + /** Resource has been created. */ + Succeeded = "Succeeded", + /** Resource creation failed. */ + Failed = "Failed", + /** Resource creation was canceled. */ + Canceled = "Canceled", + /** The resource is being provisioned. */ + Creating = "Creating", + /** The resource is updating. */ + Updating = "Updating", +} + +/** + * The execution plan resource provisioning state. \ + * {@link KnownValidationExecutionPlanProvisioningState} can be used interchangeably with ValidationExecutionPlanProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded**: Resource has been created. \ + * **Failed**: Resource creation failed. \ + * **Canceled**: Resource creation was canceled. \ + * **Creating**: The resource is being provisioned. \ + * **Updating**: The resource is updating. + */ +export type ValidationExecutionPlanProvisioningState = string; + +/** The type used for update operations of the ValidationExecutionPlan. */ +export interface ValidationExecutionPlanUpdate { + /** Resource tags. */ + tags?: Record; + /** The resource-specific properties for this resource. */ + properties?: ValidationExecutionPlanUpdateProperties; +} + +export function validationExecutionPlanUpdateSerializer(item: ValidationExecutionPlanUpdate): any { + return { + tags: item["tags"], + properties: !item["properties"] + ? item["properties"] + : validationExecutionPlanUpdatePropertiesSerializer(item["properties"]), + }; +} + +/** The updatable properties of the ValidationExecutionPlan. */ +export interface ValidationExecutionPlanUpdateProperties { + /** The description of the resource. */ + description?: string; + /** + * URI where the configuration of the execution plan is defined. + * Either this property or `planConfigurationJson` is mandatory while creating; they are mutually exclusive. + * This must be a plain, non-SAS reference (no embedded credentials, tokens, or query-string secrets); + * the service reads the referenced content using its managed identity. + * This value is returned as-is in get responses, so it must not contain credentials or other secrets. + */ + planConfigurationUri?: string; + /** + * Entire execution plan configuration/manifest json. + * Either this property or `planConfigurationUri` is mandatory while creating; they are mutually exclusive. + * In get, always return the entire json configuration. + * This value is returned as-is in get responses, so it must not contain credentials or other secrets. + */ + planConfigurationJson?: string; +} + +export function validationExecutionPlanUpdatePropertiesSerializer( + item: ValidationExecutionPlanUpdateProperties, +): any { + return { + description: item["description"], + planConfigurationUri: item["planConfigurationUri"], + planConfigurationJson: item["planConfigurationJson"], + }; +} + +/** The response of a ValidationExecutionPlan list operation. */ +export interface _ValidationExecutionPlanListResult { + /** The ValidationExecutionPlan items on this page */ + value: ValidationExecutionPlan[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _validationExecutionPlanListResultDeserializer( + item: any, +): _ValidationExecutionPlanListResult { + return { + value: validationExecutionPlanArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function validationExecutionPlanArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return validationExecutionPlanSerializer(item); + }); +} + +export function validationExecutionPlanArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return validationExecutionPlanDeserializer(item); + }); +} + +/** The properties of the execution plan run. */ +export interface ExecutionPlanRun extends ProxyResource { + /** The resource-specific properties for this resource. */ + properties?: ExecutionPlanRunProperties; +} + +export function executionPlanRunSerializer(item: ExecutionPlanRun): any { + return { + properties: !item["properties"] + ? item["properties"] + : executionPlanRunPropertiesSerializer(item["properties"]), + }; +} + +export function executionPlanRunDeserializer(item: any): ExecutionPlanRun { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : executionPlanRunPropertiesDeserializer(item["properties"]), + }; +} + +/** The properties of the execution plan run. */ +export interface ExecutionPlanRunProperties { + /** The description of the resource. */ + description?: string; + /** The status of the execution plan run. */ + readonly status?: ExecutionPlanRunStatus; + /** Error details. Populated when status is Failed, TimedOut, or Unknown. */ + readonly error?: ErrorDetail; + /** The start time of the execution plan run. */ + readonly startedAt?: Date; + /** The completion time of the execution plan run. */ + readonly completedAt?: Date; + /** The time at which the execution result was reported. */ + readonly reportedAt?: Date; + /** Summary of tests executed for this run. */ + readonly testRunSummary?: TestRunSummary; + /** Snapshot of the execution plan configuration captured at trigger time. */ + readonly planConfigurationSnapshot?: string; + /** The ARM resource IDs of the validation test runs (ValidationTestRun resources) executed as part of this execution plan run. */ + readonly testRunIds?: string[]; + /** The provisioning state of the execution plan run. */ + readonly provisioningState?: ExecutionPlanRunProvisioningState; +} + +export function executionPlanRunPropertiesSerializer(item: ExecutionPlanRunProperties): any { + return { description: item["description"] }; +} + +export function executionPlanRunPropertiesDeserializer(item: any): ExecutionPlanRunProperties { + return { + description: item["description"], + status: item["status"], + error: !item["error"] ? item["error"] : errorDetailDeserializer(item["error"]), + startedAt: !item["startedAt"] ? item["startedAt"] : new Date(item["startedAt"]), + completedAt: !item["completedAt"] ? item["completedAt"] : new Date(item["completedAt"]), + reportedAt: !item["reportedAt"] ? item["reportedAt"] : new Date(item["reportedAt"]), + testRunSummary: !item["testRunSummary"] + ? item["testRunSummary"] + : testRunSummaryDeserializer(item["testRunSummary"]), + planConfigurationSnapshot: item["planConfigurationSnapshot"], + testRunIds: !item["testRunIds"] + ? item["testRunIds"] + : item["testRunIds"].map((p: any) => { + return p; + }), + provisioningState: item["provisioningState"], + }; +} + +/** The status of the execution plan run. */ +export enum KnownExecutionPlanRunStatus { + /** The execution plan run is succeeded. */ + Succeeded = "Succeeded", + /** The execution plan run has been queued. */ + Queued = "Queued", + /** The execution plan run is running. */ + Running = "Running", + /** The execution plan run is completed. */ + Completed = "Completed", + /** The execution plan run is failed. */ + Failed = "Failed", + /** The execution plan run is timed out. */ + TimedOut = "TimedOut", + /** The execution plan run is unknown. */ + Unknown = "Unknown", +} + +/** + * The status of the execution plan run. \ + * {@link KnownExecutionPlanRunStatus} can be used interchangeably with ExecutionPlanRunStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded**: The execution plan run is succeeded. \ + * **Queued**: The execution plan run has been queued. \ + * **Running**: The execution plan run is running. \ + * **Completed**: The execution plan run is completed. \ + * **Failed**: The execution plan run is failed. \ + * **TimedOut**: The execution plan run is timed out. \ + * **Unknown**: The execution plan run is unknown. + */ +export type ExecutionPlanRunStatus = string; + +/** Execution summary details for a validation test run collection. */ +export interface TestRunSummary { + /** Total number of tests executed. */ + totalTests?: number; + /** Number of passed tests. */ + passedTests?: number; + /** Number of failed tests. */ + failedTests?: number; + /** Number of skipped tests. */ + skippedTests?: number; + /** Overall result for the execution plan run. */ + overallResult?: TestRunOverallResult; + /** Human-readable summary message. */ + message?: string; +} + +export function testRunSummaryDeserializer(item: any): TestRunSummary { + return { + totalTests: item["totalTests"], + passedTests: item["passedTests"], + failedTests: item["failedTests"], + skippedTests: item["skippedTests"], + overallResult: item["overallResult"], + message: item["message"], + }; +} + +/** The overall result of a validation test run collection. */ +export enum KnownTestRunOverallResult { + /** All tests passed. */ + Passed = "Passed", + /** One or more tests failed. */ + Failed = "Failed", + /** Some tests passed and some failed. */ + PartiallyPassed = "PartiallyPassed", +} + +/** + * The overall result of a validation test run collection. \ + * {@link KnownTestRunOverallResult} can be used interchangeably with TestRunOverallResult, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Passed**: All tests passed. \ + * **Failed**: One or more tests failed. \ + * **PartiallyPassed**: Some tests passed and some failed. + */ +export type TestRunOverallResult = string; + +/** The provisioning state of the execution plan run. */ +export enum KnownExecutionPlanRunProvisioningState { + /** Resource has been created. */ + Succeeded = "Succeeded", + /** Resource creation failed. */ + Failed = "Failed", + /** Resource creation was canceled. */ + Canceled = "Canceled", + /** The execution plan run is in progress. */ + Creating = "Creating", + /** The execution plan run is running. */ + Running = "Running", + /** The execution plan run is waiting. */ + Waiting = "Waiting", + /** The execution plan run is partially executed. */ + Processing = "Processing", +} + +/** + * The provisioning state of the execution plan run. \ + * {@link KnownExecutionPlanRunProvisioningState} can be used interchangeably with ExecutionPlanRunProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded**: Resource has been created. \ + * **Failed**: Resource creation failed. \ + * **Canceled**: Resource creation was canceled. \ + * **Creating**: The execution plan run is in progress. \ + * **Running**: The execution plan run is running. \ + * **Waiting**: The execution plan run is waiting. \ + * **Processing**: The execution plan run is partially executed. + */ +export type ExecutionPlanRunProvisioningState = string; + +/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ +export interface ProxyResource extends Resource {} + +export function proxyResourceSerializer(_item: ProxyResource): any { + return {}; +} + +export function proxyResourceDeserializer(item: any): ProxyResource { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + }; +} + +/** The response of a ExecutionPlanRun list operation. */ +export interface _ExecutionPlanRunListResult { + /** The ExecutionPlanRun items on this page */ + value: ExecutionPlanRun[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _executionPlanRunListResultDeserializer(item: any): _ExecutionPlanRunListResult { + return { + value: executionPlanRunArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function executionPlanRunArraySerializer(result: Array): any[] { + return result.map((item) => { + return executionPlanRunSerializer(item); + }); +} + +export function executionPlanRunArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return executionPlanRunDeserializer(item); + }); +} + +/** Validation Test Run represents execution instance(s) of a Validation Test instance under execution plan. */ +export interface ValidationTestRun extends ProxyResource { + /** The resource-specific properties for this resource. */ + properties?: ValidationTestRunProperties; +} + +export function validationTestRunDeserializer(item: any): ValidationTestRun { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : validationTestRunPropertiesDeserializer(item["properties"]), + }; +} + +/** Validation Test Run properties. */ +export interface ValidationTestRunProperties { + /** The overall status of the test run. */ + readonly status?: ValidationTestRunStatus; + /** Error details. Populated when status is Error. */ + readonly error?: ErrorDetail; + /** The state of the test run. */ + readonly provisioningState?: ValidationTestRunProvisioningState; + /** The start time of the test run. */ + readonly startedAt?: Date; + /** The completion time of the test run. */ + readonly completedAt?: Date; + /** The time at which the test run result was reported. */ + readonly reportedAt?: Date; + /** The resource ID of the validation test in the validation test catalog. */ + readonly testId?: string; + /** + * Validation test run inputs json, conforming to the input contract declared by `ValidationTestInput` on the corresponding validation test. + * This value is returned as-is in get responses, so it must not contain credentials or other secrets. + */ + readonly inputsJson?: string; + /** Detailed pass information when the test passes. */ + readonly passDetails?: ValidationTestPassDetails[]; + /** Detailed failure information when the test fails. */ + readonly failureDetails?: ValidationTestFailureDetails[]; +} + +export function validationTestRunPropertiesDeserializer(item: any): ValidationTestRunProperties { + return { + status: item["status"], + error: !item["error"] ? item["error"] : errorDetailDeserializer(item["error"]), + provisioningState: item["provisioningState"], + startedAt: !item["startedAt"] ? item["startedAt"] : new Date(item["startedAt"]), + completedAt: !item["completedAt"] ? item["completedAt"] : new Date(item["completedAt"]), + reportedAt: !item["reportedAt"] ? item["reportedAt"] : new Date(item["reportedAt"]), + testId: item["testId"], + inputsJson: item["inputsJson"], + passDetails: !item["passDetails"] + ? item["passDetails"] + : validationTestPassDetailsArrayDeserializer(item["passDetails"]), + failureDetails: !item["failureDetails"] + ? item["failureDetails"] + : validationTestFailureDetailsArrayDeserializer(item["failureDetails"]), + }; +} + +/** The overall status of the test run. */ +export enum KnownValidationTestRunStatus { + /** The test run is not running. */ + NotRunning = "NotRunning", + /** The test run is scheduled. */ + Scheduled = "Scheduled", + /** The test run is ready. */ + Ready = "Ready", + /** The test run is running. */ + Running = "Running", + /** The test run is completed. */ + Completed = "Completed", + /** The test run is stopped. */ + Stopped = "Stopped", + /** The test run is errored out. */ + Error = "Error", +} + +/** + * The overall status of the test run. \ + * {@link KnownValidationTestRunStatus} can be used interchangeably with ValidationTestRunStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **NotRunning**: The test run is not running. \ + * **Scheduled**: The test run is scheduled. \ + * **Ready**: The test run is ready. \ + * **Running**: The test run is running. \ + * **Completed**: The test run is completed. \ + * **Stopped**: The test run is stopped. \ + * **Error**: The test run is errored out. + */ +export type ValidationTestRunStatus = string; + +/** The provisioning state of the validation test run. */ +export enum KnownValidationTestRunProvisioningState { + /** Resource has been created. */ + Succeeded = "Succeeded", + /** Resource creation failed. */ + Failed = "Failed", + /** Resource creation was canceled. */ + Canceled = "Canceled", + /** The validation test run is in progress. */ + Running = "Running", +} + +/** + * The provisioning state of the validation test run. \ + * {@link KnownValidationTestRunProvisioningState} can be used interchangeably with ValidationTestRunProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded**: Resource has been created. \ + * **Failed**: Resource creation failed. \ + * **Canceled**: Resource creation was canceled. \ + * **Running**: The validation test run is in progress. + */ +export type ValidationTestRunProvisioningState = string; + +export function validationTestPassDetailsArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return validationTestPassDetailsDeserializer(item); + }); +} + +/** Detailed information about test pass. */ +export interface ValidationTestPassDetails { + /** Result code categorizing the type of pass. */ + readonly resultCode?: string; + /** test name which passed. */ + readonly testName?: string; + /** Detailed information about the passed test. */ + readonly resultDetails?: string; +} + +export function validationTestPassDetailsDeserializer(item: any): ValidationTestPassDetails { + return { + resultCode: item["resultCode"], + testName: item["testName"], + resultDetails: item["resultDetails"], + }; +} + +export function validationTestFailureDetailsArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return validationTestFailureDetailsDeserializer(item); + }); +} + +/** Detailed information about test failure. */ +export interface ValidationTestFailureDetails { + /** Error code categorizing the type of failure. */ + readonly errorCode?: string; + /** Human-readable error message describing the failure. */ + readonly errorMessage?: string; + /** Detailed information about the failure. */ + readonly details?: string; + /** Additional diagnostic information. */ + readonly diagnosticInfo?: string; + /** Suggested remediation steps for the customer. */ + readonly recommendedActions?: string[]; +} + +export function validationTestFailureDetailsDeserializer(item: any): ValidationTestFailureDetails { + return { + errorCode: item["errorCode"], + errorMessage: item["errorMessage"], + details: item["details"], + diagnosticInfo: item["diagnosticInfo"], + recommendedActions: !item["recommendedActions"] + ? item["recommendedActions"] + : item["recommendedActions"].map((p: any) => { + return p; + }), + }; +} + +/** The response of a ValidationTestRun list operation. */ +export interface _ValidationTestRunListResult { + /** The ValidationTestRun items on this page */ + value: ValidationTestRun[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _validationTestRunListResultDeserializer(item: any): _ValidationTestRunListResult { + return { + value: validationTestRunArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function validationTestRunArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return validationTestRunDeserializer(item); + }); +} + +/** Validation test catalog entry. */ +export interface ValidationTest extends ProxyResource { + /** The resource-specific properties for this resource. */ + properties?: ValidationTestProperties; +} + +export function validationTestDeserializer(item: any): ValidationTest { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : validationTestPropertiesDeserializer(item["properties"]), + }; +} + +/** Validation test catalog properties. */ +export interface ValidationTestProperties { + /** Display name of the validation test. */ + readonly displayName?: string; + /** Validation test description. */ + readonly description?: string; + /** Audience visibility of this validation test. */ + readonly audience?: CatalogAudience; + /** Provisioning state of the validation test catalog resource. */ + readonly provisioningState?: ResourceProvisioningState; + /** The names of the validation test categories (ValidationTestCategory resource names, not ARM resource IDs) associated with this test. */ + readonly categoryIds?: string[]; + /** + * Owners of the validation test definition, expressed as team or distribution list aliases. + * Individual user aliases and directory object identifiers are not published in this field. + * Only catalog publishers(limited to microsoft internal only) set this value through an internal publishing process; end users of the validation + * service consume catalog entries read-only through Get/List and cannot modify it. + */ + readonly owners?: string[]; + /** Declared input contract for this validation test. */ + readonly inputs?: ValidationTestInput[]; + /** URI of the location where the test artifact is stored. */ + readonly testStoreUri?: string; + /** The resource ID of the current immutable version snapshot. */ + readonly currentVersion?: string; + /** The resource ID of the latest published version snapshot. */ + readonly latestPublishedVersion?: string; + /** Timestamp of the last version publication. */ + readonly lastPublishedAt?: Date; +} + +export function validationTestPropertiesDeserializer(item: any): ValidationTestProperties { + return { + displayName: item["displayName"], + description: item["description"], + audience: item["audience"], + provisioningState: item["provisioningState"], + categoryIds: !item["categoryIds"] + ? item["categoryIds"] + : item["categoryIds"].map((p: any) => { + return p; + }), + owners: !item["owners"] + ? item["owners"] + : item["owners"].map((p: any) => { + return p; + }), + inputs: !item["inputs"] ? item["inputs"] : validationTestInputArrayDeserializer(item["inputs"]), + testStoreUri: item["testStoreUri"], + currentVersion: item["currentVersion"], + latestPublishedVersion: item["latestPublishedVersion"], + lastPublishedAt: !item["lastPublishedAt"] + ? item["lastPublishedAt"] + : new Date(item["lastPublishedAt"]), + }; +} + +/** Audience visibility of a published catalog item. */ +export enum KnownCatalogAudience { + /** Visible to all customers, including first-party and third-party callers. */ + Public = "Public", + /** Visible only to authorized Microsoft-internal callers. */ + Internal = "Internal", +} + +/** + * Audience visibility of a published catalog item. \ + * {@link KnownCatalogAudience} can be used interchangeably with CatalogAudience, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Public**: Visible to all customers, including first-party and third-party callers. \ + * **Internal**: Visible only to authorized Microsoft-internal callers. + */ +export type CatalogAudience = string; + +export function validationTestInputArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return validationTestInputDeserializer(item); + }); +} + +/** A named declared input parameter for a validation test contract. */ +export interface ValidationTestInput { + /** The input parameter name. */ + name: string; + /** The declared contract for this input parameter. */ + definition: ValidationTestInputDefinition; +} + +export function validationTestInputDeserializer(item: any): ValidationTestInput { + return { + name: item["name"], + definition: validationTestInputDefinitionDeserializer(item["definition"]), + }; +} + +/** Declared contract for a validation test input parameter. */ +export interface ValidationTestInputDefinition { + /** Description of the declared input parameter. */ + description?: string; + /** The data type expected for this input parameter. */ + type?: ValidationTestInputDataType; + /** Whether this input parameter is required. */ + required?: boolean; + /** Optional default value to use when input is not provided. */ + defaultValue?: string; + /** Allowed values for this input parameter. */ + allowedValues?: string[]; +} + +export function validationTestInputDefinitionDeserializer( + item: any, +): ValidationTestInputDefinition { + return { + description: item["description"], + type: item["type"], + required: item["required"], + defaultValue: item["defaultValue"], + allowedValues: !item["allowedValues"] + ? item["allowedValues"] + : item["allowedValues"].map((p: any) => { + return p; + }), + }; +} + +/** Supported data types for a declared test input. */ +export enum KnownValidationTestInputDataType { + /** String input value. */ + String = "String", + /** Integer input value. */ + Integer = "Integer", + /** Numeric input value. */ + Number = "Number", + /** Boolean input value. */ + Boolean = "Boolean", + /** Object input value. */ + Object = "Object", + /** Array input value. */ + Array = "Array", +} + +/** + * Supported data types for a declared test input. \ + * {@link KnownValidationTestInputDataType} can be used interchangeably with ValidationTestInputDataType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **String**: String input value. \ + * **Integer**: Integer input value. \ + * **Number**: Numeric input value. \ + * **Boolean**: Boolean input value. \ + * **Object**: Object input value. \ + * **Array**: Array input value. + */ +export type ValidationTestInputDataType = string; + +/** The response of a ValidationTest list operation. */ +export interface _ValidationTestListResult { + /** The ValidationTest items on this page */ + value: ValidationTest[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _validationTestListResultDeserializer(item: any): _ValidationTestListResult { + return { + value: validationTestArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function validationTestArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return validationTestDeserializer(item); + }); +} + +/** Validation test version catalog entry. */ +export interface ValidationTestVersion extends ProxyResource { + /** The resource-specific properties for this resource. */ + properties?: ValidationTestVersionProperties; +} + +export function validationTestVersionDeserializer(item: any): ValidationTestVersion { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : validationTestVersionPropertiesDeserializer(item["properties"]), + }; +} + +/** Validation test version catalog properties. */ +export interface ValidationTestVersionProperties { + /** Display name of the validation test version. */ + readonly displayName?: string; + /** Validation test description. */ + readonly description?: string; + /** Audience visibility of this validation test version. */ + readonly audience?: CatalogAudience; + /** Provisioning state of the validation test version catalog resource. */ + readonly provisioningState?: ResourceProvisioningState; + /** The names of the validation test categories (ValidationTestCategory resource names, not ARM resource IDs) associated with this test version. */ + readonly categoryIds?: string[]; + /** + * Owners of the validation test version definition, expressed as team or distribution list aliases. + * Individual user aliases and directory object identifiers are not published in this field. + * Only catalog publishers set this value through an internal publishing process; end users of the validation + * service consume catalog entries read-only through Get/List and cannot modify it. + */ + readonly owners?: string[]; + /** Declared input contract for this validation test version. */ + readonly inputs?: ValidationTestInput[]; + /** SHA-256 hash of the version content used for integrity and deduplication. */ + readonly contentHash?: string; + /** URI of the location where the test artifact is stored. */ + readonly testStoreUri?: string; +} + +export function validationTestVersionPropertiesDeserializer( + item: any, +): ValidationTestVersionProperties { + return { + displayName: item["displayName"], + description: item["description"], + audience: item["audience"], + provisioningState: item["provisioningState"], + categoryIds: !item["categoryIds"] + ? item["categoryIds"] + : item["categoryIds"].map((p: any) => { + return p; + }), + owners: !item["owners"] + ? item["owners"] + : item["owners"].map((p: any) => { + return p; + }), + inputs: !item["inputs"] ? item["inputs"] : validationTestInputArrayDeserializer(item["inputs"]), + contentHash: item["contentHash"], + testStoreUri: item["testStoreUri"], + }; +} + +/** The response of a ValidationTestVersion list operation. */ +export interface _ValidationTestVersionListResult { + /** The ValidationTestVersion items on this page */ + value: ValidationTestVersion[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _validationTestVersionListResultDeserializer( + item: any, +): _ValidationTestVersionListResult { + return { + value: validationTestVersionArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function validationTestVersionArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return validationTestVersionDeserializer(item); + }); +} + +/** Validation test category catalog entry. */ +export interface ValidationTestCategory extends ProxyResource { + /** The resource-specific properties for this resource. */ + properties?: ValidationTestCategoryProperties; +} + +export function validationTestCategoryDeserializer(item: any): ValidationTestCategory { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : validationTestCategoryPropertiesDeserializer(item["properties"]), + }; +} + +/** Validation test category properties. */ +export interface ValidationTestCategoryProperties { + /** Display name of the validation test category. */ + readonly displayName?: string; + /** Validation test category description. */ + readonly description?: string; + /** Audience visibility of this validation test category. */ + readonly audience?: CatalogAudience; + /** Provisioning state of the validation test category catalog resource. */ + readonly provisioningState?: ResourceProvisioningState; + /** + * Parent validation test category id. Categories form a two-level hierarchy only: + * a top-level category leaves this unset, and a sub-category sets this to its + * top-level parent's category id. Sub-categories cannot themselves have sub-categories, + * and a category must not reference itself as its own parent. + */ + readonly parentCategoryId?: string; + /** + * Owners of the validation test category, expressed as team or distribution list aliases. + * Individual user aliases and directory object identifiers are not published in this field. + * Only catalog publishers set this value through an internal publishing process; end users of the validation + * service consume catalog entries read-only through Get/List and cannot modify it. + */ + readonly owners?: string[]; +} + +export function validationTestCategoryPropertiesDeserializer( + item: any, +): ValidationTestCategoryProperties { + return { + displayName: item["displayName"], + description: item["description"], + audience: item["audience"], + provisioningState: item["provisioningState"], + parentCategoryId: item["parentCategoryId"], + owners: !item["owners"] + ? item["owners"] + : item["owners"].map((p: any) => { + return p; + }), + }; +} + +/** The response of a ValidationTestCategory list operation. */ +export interface _ValidationTestCategoryListResult { + /** The ValidationTestCategory items on this page */ + value: ValidationTestCategory[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _validationTestCategoryListResultDeserializer( + item: any, +): _ValidationTestCategoryListResult { + return { + value: validationTestCategoryArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function validationTestCategoryArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return validationTestCategoryDeserializer(item); + }); +} + +/** The available API versions. */ +export enum KnownVersions { + /** 2026-08-01-preview version */ + V20260801Preview = "2026-08-01-preview", +} diff --git a/sdk/platformvalidation/arm-platformvalidation/src/platformValidationClient.ts b/sdk/platformvalidation/arm-platformvalidation/src/platformValidationClient.ts new file mode 100644 index 000000000000..2ea56fcb0dd6 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/src/platformValidationClient.ts @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { + PlatformValidationContext, + PlatformValidationClientOptionalParams, +} from "./api/index.js"; +import { createPlatformValidation } from "./api/index.js"; +import type { CloudValidationsOperations } from "./classic/cloudValidations/index.js"; +import { _getCloudValidationsOperations } from "./classic/cloudValidations/index.js"; +import type { ExecutionPlanRunsOperations } from "./classic/executionPlanRuns/index.js"; +import { _getExecutionPlanRunsOperations } from "./classic/executionPlanRuns/index.js"; +import type { OperationStatusOperations } from "./classic/operationStatus/index.js"; +import { _getOperationStatusOperations } from "./classic/operationStatus/index.js"; +import type { OperationsOperations } from "./classic/operations/index.js"; +import { _getOperationsOperations } from "./classic/operations/index.js"; +import type { ValidationExecutionPlansOperations } from "./classic/validationExecutionPlans/index.js"; +import { _getValidationExecutionPlansOperations } from "./classic/validationExecutionPlans/index.js"; +import type { ValidationTestCategoriesOperations } from "./classic/validationTestCategories/index.js"; +import { _getValidationTestCategoriesOperations } from "./classic/validationTestCategories/index.js"; +import type { ValidationTestRunsOperations } from "./classic/validationTestRuns/index.js"; +import { _getValidationTestRunsOperations } from "./classic/validationTestRuns/index.js"; +import type { ValidationTestVersionsOperations } from "./classic/validationTestVersions/index.js"; +import { _getValidationTestVersionsOperations } from "./classic/validationTestVersions/index.js"; +import type { ValidationTestsOperations } from "./classic/validationTests/index.js"; +import { _getValidationTestsOperations } from "./classic/validationTests/index.js"; +import type { TokenCredential } from "@azure/core-auth"; +import type { Pipeline } from "@azure/core-rest-pipeline"; + +export type { PlatformValidationClientOptionalParams } from "./api/platformValidationContext.js"; + +export class PlatformValidationClient { + private _client: PlatformValidationContext; + /** The pipeline used by this client to make requests */ + public readonly pipeline: Pipeline; + + /** Microsoft.PlatformValidation Resource Provider management API. */ + constructor( + credential: TokenCredential, + subscriptionId: string, + options: PlatformValidationClientOptionalParams = {}, + ) { + this._client = createPlatformValidation(credential, subscriptionId, options); + this.pipeline = this._client.pipeline; + this.validationTestCategories = _getValidationTestCategoriesOperations(this._client); + this.validationTestVersions = _getValidationTestVersionsOperations(this._client); + this.validationTests = _getValidationTestsOperations(this._client); + this.validationTestRuns = _getValidationTestRunsOperations(this._client); + this.executionPlanRuns = _getExecutionPlanRunsOperations(this._client); + this.validationExecutionPlans = _getValidationExecutionPlansOperations(this._client); + this.cloudValidations = _getCloudValidationsOperations(this._client); + this.operations = _getOperationsOperations(this._client); + this.operationStatus = _getOperationStatusOperations(this._client); + } + + /** The operation groups for validationTestCategories */ + public readonly validationTestCategories: ValidationTestCategoriesOperations; + /** The operation groups for validationTestVersions */ + public readonly validationTestVersions: ValidationTestVersionsOperations; + /** The operation groups for validationTests */ + public readonly validationTests: ValidationTestsOperations; + /** The operation groups for validationTestRuns */ + public readonly validationTestRuns: ValidationTestRunsOperations; + /** The operation groups for executionPlanRuns */ + public readonly executionPlanRuns: ExecutionPlanRunsOperations; + /** The operation groups for validationExecutionPlans */ + public readonly validationExecutionPlans: ValidationExecutionPlansOperations; + /** The operation groups for cloudValidations */ + public readonly cloudValidations: CloudValidationsOperations; + /** The operation groups for operations */ + public readonly operations: OperationsOperations; + /** The operation groups for operationStatus */ + public readonly operationStatus: OperationStatusOperations; +} diff --git a/sdk/platformvalidation/arm-platformvalidation/src/restorePollerHelpers.ts b/sdk/platformvalidation/arm-platformvalidation/src/restorePollerHelpers.ts new file mode 100644 index 000000000000..95bcdb4f4e8c --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/src/restorePollerHelpers.ts @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { PlatformValidationClient } from "./platformValidationClient.js"; +import { + _$deleteDeserialize, + _createOrUpdateDeserialize, +} from "./api/executionPlanRuns/operations.js"; +import { + _$deleteDeserialize as _$deleteDeserializeValidationExecutionPlans, + _updateDeserialize, + _createOrUpdateDeserialize as _createOrUpdateDeserializeValidationExecutionPlans, +} from "./api/validationExecutionPlans/operations.js"; +import { + _$deleteDeserialize as _$deleteDeserializeCloudValidations, + _updateDeserialize as _updateDeserializeCloudValidations, + _createOrUpdateDeserialize as _createOrUpdateDeserializeCloudValidations, +} from "./api/cloudValidations/operations.js"; +import { getLongRunningPoller } from "./static-helpers/pollingHelpers.js"; +import type { OperationOptions, PathUncheckedResponse } from "@azure-rest/core-client"; +import type { AbortSignalLike } from "@azure/abort-controller"; +import type { PollerLike, OperationState, ResourceLocationConfig } from "@azure/core-lro"; +import { deserializeState } from "@azure/core-lro"; + +export interface RestorePollerOptions< + TResult, + TResponse extends PathUncheckedResponse = PathUncheckedResponse, +> extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** + * The signal which can be used to abort requests. + */ + abortSignal?: AbortSignalLike; + /** Deserialization function for raw response body */ + processResponseBody?: (result: TResponse) => Promise; +} + +/** + * Creates a poller from the serialized state of another poller. This can be + * useful when you want to create pollers on a different host or a poller + * needs to be constructed after the original one is not in scope. + */ +export function restorePoller( + client: PlatformValidationClient, + serializedState: string, + sourceOperation: (...args: any[]) => PollerLike, TResult>, + options?: RestorePollerOptions, +): PollerLike, TResult> { + const pollerConfig = deserializeState(serializedState).config; + const { initialRequestUrl, requestMethod, metadata } = pollerConfig; + if (!initialRequestUrl || !requestMethod) { + throw new Error( + `Invalid serialized state: ${serializedState} for sourceOperation ${sourceOperation?.name}`, + ); + } + const resourceLocationConfig = metadata?.["resourceLocationConfig"] as + ResourceLocationConfig | undefined; + const { deserializer, expectedStatuses = [] } = + getDeserializationHelper(initialRequestUrl, requestMethod) ?? {}; + const deserializeHelper = options?.processResponseBody ?? deserializer; + if (!deserializeHelper) { + throw new Error( + `Please ensure the operation is in this client! We can't find its deserializeHelper for ${sourceOperation?.name}.`, + ); + } + const apiVersion = getApiVersionFromUrl(initialRequestUrl); + return getLongRunningPoller( + (client as any)["_client"] ?? client, + deserializeHelper as (result: TResponse) => Promise, + expectedStatuses, + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + resourceLocationConfig, + restoreFrom: serializedState, + initialRequestUrl, + apiVersion, + }, + ); +} + +interface DeserializationHelper { + deserializer: (result: PathUncheckedResponse) => Promise; + expectedStatuses: string[]; +} + +const deserializeMap: Record = { + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}/validationExecutionPlans/{validationExecutionPlanName}/executionPlanRuns/{executionPlanRunName}": + { deserializer: _$deleteDeserialize, expectedStatuses: ["202", "204", "200"] }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}/validationExecutionPlans/{validationExecutionPlanName}/executionPlanRuns/{executionPlanRunName}": + { deserializer: _createOrUpdateDeserialize, expectedStatuses: ["200", "201", "202"] }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}/validationExecutionPlans/{validationExecutionPlanName}": + { + deserializer: _$deleteDeserializeValidationExecutionPlans, + expectedStatuses: ["202", "204", "200"], + }, + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}/validationExecutionPlans/{validationExecutionPlanName}": + { deserializer: _updateDeserialize, expectedStatuses: ["200", "202", "201"] }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}/validationExecutionPlans/{validationExecutionPlanName}": + { + deserializer: _createOrUpdateDeserializeValidationExecutionPlans, + expectedStatuses: ["200", "201", "202"], + }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}": + { deserializer: _$deleteDeserializeCloudValidations, expectedStatuses: ["202", "204", "200"] }, + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}": + { deserializer: _updateDeserializeCloudValidations, expectedStatuses: ["200", "202", "201"] }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}": + { + deserializer: _createOrUpdateDeserializeCloudValidations, + expectedStatuses: ["200", "201", "202"], + }, +}; + +function getDeserializationHelper( + urlStr: string, + method: string, +): DeserializationHelper | undefined { + const path = new URL(urlStr).pathname; + const pathParts = path.split("/"); + + // Traverse list to match the longest candidate + // matchedLen: the length of candidate path + // matchedValue: the matched status code array + let matchedLen = -1, + matchedValue: DeserializationHelper | undefined; + + // Iterate the responseMap to find a match + for (const [key, value] of Object.entries(deserializeMap)) { + // Extracting the path from the map key which is in format + // GET /path/foo + if (!key.startsWith(method)) { + continue; + } + const candidatePath = getPathFromMapKey(key); + // Get each part of the url path + const candidateParts = candidatePath.split("/"); + + // track if we have found a match to return the values found. + let found = true; + for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) { + if (candidateParts[i]?.startsWith("{") && candidateParts[i]?.indexOf("}") !== -1) { + const start = candidateParts[i]!.indexOf("}") + 1, + end = candidateParts[i]?.length; + // If the current part of the candidate is a "template" part + // Try to use the suffix of pattern to match the path + // {guid} ==> $ + // {guid}:export ==> :export$ + const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test( + pathParts[j] || "", + ); + + if (!isMatched) { + found = false; + break; + } + continue; + } + + // If the candidate part is not a template and + // the parts don't match mark the candidate as not found + // to move on with the next candidate path. + if (candidateParts[i] !== pathParts[j]) { + found = false; + break; + } + } + + // We finished evaluating the current candidate parts + // Update the matched value if and only if we found the longer pattern + if (found && candidatePath.length > matchedLen) { + matchedLen = candidatePath.length; + matchedValue = value; + } + } + + return matchedValue; +} + +function getPathFromMapKey(mapKey: string): string { + const pathStart = mapKey.indexOf("/"); + return mapKey.slice(pathStart); +} + +function getApiVersionFromUrl(urlStr: string): string | undefined { + const url = new URL(urlStr); + return url.searchParams.get("api-version") ?? undefined; +} diff --git a/sdk/platformvalidation/arm-platformvalidation/src/static-helpers/cloudSettingHelpers.ts b/sdk/platformvalidation/arm-platformvalidation/src/static-helpers/cloudSettingHelpers.ts new file mode 100644 index 000000000000..613112c6e397 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/src/static-helpers/cloudSettingHelpers.ts @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * An enum to describe Azure Cloud environments. + * @enum {string} + */ +export enum AzureClouds { + /** Azure public cloud, which is the default cloud for Azure SDKs. */ + AZURE_PUBLIC_CLOUD = "AZURE_PUBLIC_CLOUD", + /** Azure China cloud */ + AZURE_CHINA_CLOUD = "AZURE_CHINA_CLOUD", + /** Azure US government cloud */ + AZURE_US_GOVERNMENT = "AZURE_US_GOVERNMENT", +} + +/** The supported values for cloud setting as a string literal type */ +export type AzureSupportedClouds = `${AzureClouds}`; + +/** + * Gets the Azure Resource Manager endpoint URL for the specified cloud setting. + * @param cloudSetting - The Azure cloud environment setting. Use one of the AzureClouds enum values. + * @returns The ARM endpoint URL for the specified cloud, or undefined if cloudSetting is undefined. + * @throws {Error} Throws an error if an unknown cloud setting is provided. + */ +export function getArmEndpoint(cloudSetting?: AzureSupportedClouds): string | undefined { + if (cloudSetting === undefined) { + return undefined; + } + const cloudEndpoints: Record = { + AZURE_CHINA_CLOUD: "https://management.chinacloudapi.cn/", + AZURE_US_GOVERNMENT: "https://management.usgovcloudapi.net/", + AZURE_PUBLIC_CLOUD: "https://management.azure.com/", + }; + if (cloudSetting in cloudEndpoints) { + return cloudEndpoints[cloudSetting]; + } else { + throw new Error( + `Unknown cloud setting: ${cloudSetting}. Please refer to the enum AzureClouds for possible values.`, + ); + } +} diff --git a/sdk/platformvalidation/arm-platformvalidation/src/static-helpers/pagingHelpers.ts b/sdk/platformvalidation/arm-platformvalidation/src/static-helpers/pagingHelpers.ts new file mode 100644 index 000000000000..4b0ff077dafd --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/src/static-helpers/pagingHelpers.ts @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { Client, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError } from "@azure-rest/core-client"; +import { RestError } from "@azure/core-rest-pipeline"; + +/** + * Options for the byPage method + */ +export interface PageSettings { + /** + * A reference to a specific page to start iterating from. + */ + continuationToken?: string; +} + +/** + * An interface that describes a page of results. + */ +export type ContinuablePage = TPage & { + /** + * The token that keeps track of where to continue the iterator + */ + continuationToken?: string; +}; + +/** + * An interface that allows async iterable iteration both to completion and by page. + */ +export interface PagedAsyncIterableIterator< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, +> { + /** + * The next method, part of the iteration protocol + */ + next(): Promise>; + /** + * The connection to the async iterator, part of the iteration protocol + */ + [Symbol.asyncIterator](): PagedAsyncIterableIterator; + /** + * Return an AsyncIterableIterator that works a page at a time + */ + byPage: (settings?: TPageSettings) => AsyncIterableIterator>; +} + +/** + * An interface that describes how to communicate with the service. + */ +export interface PagedResult< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, +> { + /** + * Link to the first page of results. + */ + firstPageLink?: string; + /** + * A method that returns a page of results. + */ + getPage: (pageLink?: string) => Promise<{ page: TPage; nextPageLink?: string } | undefined>; + /** + * a function to implement the `byPage` method on the paged async iterator. + */ + byPage?: (settings?: TPageSettings) => AsyncIterableIterator>; + + /** + * A function to extract elements from a page. + */ + toElements?: (page: TPage) => TElement[]; +} + +/** + * Options for the paging helper + */ +export interface BuildPagedAsyncIteratorOptions { + itemName?: string; + nextLinkName?: string; + nextLinkMethod?: "GET" | "POST"; + apiVersion?: string; +} + +/** + * Helper to paginate results in a generic way and return a PagedAsyncIterableIterator + */ +export function buildPagedAsyncIterator< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, + TResponse extends PathUncheckedResponse = PathUncheckedResponse, +>( + client: Client, + getInitialResponse: () => PromiseLike, + processResponseBody: (result: TResponse) => PromiseLike, + expectedStatuses: string[], + options: BuildPagedAsyncIteratorOptions = {}, +): PagedAsyncIterableIterator { + const itemName = options.itemName ?? "value"; + const nextLinkName = options.nextLinkName ?? "nextLink"; + const nextLinkMethod = options.nextLinkMethod ?? "GET"; + const apiVersion = options.apiVersion; + const pagedResult: PagedResult = { + getPage: async (pageLink?: string) => { + let result; + if (pageLink === undefined) { + result = await getInitialResponse(); + } else { + const resolvedPageLink = apiVersion ? addApiVersionToUrl(pageLink, apiVersion) : pageLink; + result = + nextLinkMethod === "POST" + ? await client.pathUnchecked(resolvedPageLink).post() + : await client.pathUnchecked(resolvedPageLink).get(); + } + checkPagingRequest(result, expectedStatuses); + const results = await processResponseBody(result as TResponse); + const nextLink = getNextLink(results, nextLinkName); + const values = getElements(results, itemName) as TPage; + return { + page: values, + nextPageLink: nextLink, + }; + }, + byPage: (settings?: TPageSettings) => { + const { continuationToken } = settings ?? {}; + return getPageAsyncIterator(pagedResult, { + pageLink: continuationToken, + }); + }, + }; + return getPagedAsyncIterator(pagedResult); +} + +/** + * returns an async iterator that iterates over results. It also has a `byPage` + * method that returns pages of items at once. + * + * @param pagedResult - an object that specifies how to get pages. + * @returns a paged async iterator that iterates over results. + */ + +function getPagedAsyncIterator< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, +>( + pagedResult: PagedResult, +): PagedAsyncIterableIterator { + const iter = getItemAsyncIterator(pagedResult); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: + pagedResult?.byPage ?? + ((settings?: TPageSettings) => { + const { continuationToken } = settings ?? {}; + return getPageAsyncIterator(pagedResult, { + pageLink: continuationToken, + }); + }), + }; +} + +async function* getItemAsyncIterator( + pagedResult: PagedResult, +): AsyncIterableIterator { + const pages = getPageAsyncIterator(pagedResult); + for await (const page of pages) { + yield* page as unknown as TElement[]; + } +} + +async function* getPageAsyncIterator( + pagedResult: PagedResult, + options: { + pageLink?: string; + } = {}, +): AsyncIterableIterator> { + const { pageLink } = options; + let response = await pagedResult.getPage(pageLink ?? pagedResult.firstPageLink); + if (!response) { + return; + } + let result = response.page as ContinuablePage; + result.continuationToken = response.nextPageLink; + yield result; + while (response.nextPageLink) { + response = await pagedResult.getPage(response.nextPageLink); + if (!response) { + return; + } + result = response.page as ContinuablePage; + result.continuationToken = response.nextPageLink; + yield result; + } +} + +/** + * Gets for the value of nextLink in the body + */ +function getNextLink(body: unknown, nextLinkName?: string): string | undefined { + if (!nextLinkName) { + return undefined; + } + + const nextLink = (body as Record)[nextLinkName]; + + if (typeof nextLink !== "string" && typeof nextLink !== "undefined" && nextLink !== null) { + throw new RestError( + `Body Property ${nextLinkName} should be a string or undefined or null but got ${typeof nextLink}`, + ); + } + + if (nextLink === null) { + return undefined; + } + + return nextLink; +} + +/** + * Gets the elements of the current request in the body. + */ +function getElements(body: unknown, itemName: string): T[] { + const value = (body as Record)[itemName] as T[]; + if (!Array.isArray(value)) { + throw new RestError( + `Couldn't paginate response\n Body doesn't contain an array property with name: ${itemName}`, + ); + } + + return value ?? []; +} + +/** + * Checks if a request failed + */ +function checkPagingRequest(response: PathUncheckedResponse, expectedStatuses: string[]): void { + if (!expectedStatuses.includes(response.status)) { + throw createRestError( + `Pagination failed with unexpected statusCode ${response.status}`, + response, + ); + } +} + +/** + * Adds the api-version query parameter on a URL if it's not present. + * @param url - the URL to modify + * @param apiVersion - the API version to set + * @returns - the URL with the api-version query parameter set + */ +function addApiVersionToUrl(url: string, apiVersion: string): string { + // The base URL is only used for parsing and won't appear in the returned URL + const urlObj = new URL(url, "https://microsoft.com"); + if (!urlObj.searchParams.get("api-version")) { + // Append one if there is no apiVersion + return `${url}${urlObj.search ? "&" : "?"}api-version=${apiVersion}`; + } + return url; +} diff --git a/sdk/platformvalidation/arm-platformvalidation/src/static-helpers/pollingHelpers.ts b/sdk/platformvalidation/arm-platformvalidation/src/static-helpers/pollingHelpers.ts new file mode 100644 index 000000000000..05306f6ec10c --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/src/static-helpers/pollingHelpers.ts @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { + OperationResponse, + OperationState, + PollerLike, + ResourceLocationConfig, + RunningOperation, +} from "@azure/core-lro"; +import { createHttpPoller } from "@azure/core-lro"; + +import type { Client, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError } from "@azure-rest/core-client"; +import type { AbortSignalLike } from "@azure/abort-controller"; + +export interface GetLongRunningPollerOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** + * The signal which can be used to abort requests. + */ + abortSignal?: AbortSignalLike; + /** + * The potential location of the result of the LRO if specified by the LRO extension in the swagger. + */ + resourceLocationConfig?: ResourceLocationConfig; + /** + * The original url of the LRO + * Should not be null when restoreFrom is set + */ + initialRequestUrl?: string; + /** + * A serialized poller which can be used to resume an existing paused Long-Running-Operation. + */ + restoreFrom?: string; + /** + * The function to get the initial response + */ + getInitialResponse?: () => PromiseLike; + /** + * The api-version of the LRO + */ + apiVersion?: string; +} +export function getLongRunningPoller( + client: Client, + processResponseBody: (result: TResponse) => Promise, + expectedStatuses: string[], + options: GetLongRunningPollerOptions, +): PollerLike, TResult> { + const { restoreFrom, getInitialResponse, apiVersion } = options; + if (!restoreFrom && !getInitialResponse) { + throw new Error("Either restoreFrom or getInitialResponse must be specified"); + } + let initialResponse: TResponse | undefined = undefined; + const pollAbortController = new AbortController(); + const poller: RunningOperation = { + sendInitialRequest: async () => { + if (!getInitialResponse) { + throw new Error("getInitialResponse is required when initializing a new poller"); + } + initialResponse = await getInitialResponse(); + return getLroResponse(initialResponse, expectedStatuses); + }, + sendPollRequest: async ( + path: string, + pollOptions?: { + abortSignal?: AbortSignalLike; + }, + ) => { + // The poll request would both listen to the user provided abort signal and the poller's own abort signal + function abortListener(): void { + pollAbortController.abort(); + } + const abortSignal = pollAbortController.signal; + if (options.abortSignal?.aborted) { + pollAbortController.abort(); + } else if (pollOptions?.abortSignal?.aborted) { + pollAbortController.abort(); + } else if (!abortSignal.aborted) { + options.abortSignal?.addEventListener("abort", abortListener, { + once: true, + }); + pollOptions?.abortSignal?.addEventListener("abort", abortListener, { + once: true, + }); + } + let response; + try { + const pollingPath = apiVersion ? addApiVersionToUrl(path, apiVersion) : path; + response = await client.pathUnchecked(pollingPath).get({ abortSignal }); + } finally { + options.abortSignal?.removeEventListener("abort", abortListener); + pollOptions?.abortSignal?.removeEventListener("abort", abortListener); + } + + return getLroResponse(response as TResponse, expectedStatuses); + }, + }; + return createHttpPoller(poller, { + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: options?.resourceLocationConfig, + restoreFrom: options?.restoreFrom, + processResult: (result: unknown) => { + return processResponseBody(result as TResponse); + }, + }); +} +/** + * Converts a Rest Client response to a response that the LRO implementation understands + * @param response - a rest client http response + * @param deserializeFn - deserialize function to convert Rest response to modular output + * @returns - An LRO response that the LRO implementation understands + */ +function getLroResponse( + response: TResponse, + expectedStatuses: string[], +): OperationResponse { + if (!expectedStatuses.includes(response.status)) { + throw createRestError(response); + } + + return { + flatResponse: response, + rawResponse: { + ...response, + statusCode: Number.parseInt(response.status), + body: response.body, + }, + }; +} + +/** + * Adds the api-version query parameter on a URL if it's not present. + * @param url - the URL to modify + * @param apiVersion - the API version to set + * @returns - the URL with the api-version query parameter set + */ +function addApiVersionToUrl(url: string, apiVersion: string): string { + // The base URL is only used for parsing and won't appear in the returned URL + const urlObj = new URL(url, "https://microsoft.com"); + if (!urlObj.searchParams.get("api-version")) { + // Append one if there is no apiVersion + return `${url}${urlObj.search ? "&" : "?"}api-version=${apiVersion}`; + } + return url; +} diff --git a/sdk/platformvalidation/arm-platformvalidation/src/static-helpers/urlTemplate.ts b/sdk/platformvalidation/arm-platformvalidation/src/static-helpers/urlTemplate.ts new file mode 100644 index 000000000000..e38a96fc747f --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/src/static-helpers/urlTemplate.ts @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +// --------------------- +// interfaces +// --------------------- +interface ValueOptions { + isFirst: boolean; // is first value in the expression + op?: string; // operator + varValue?: any; // variable value + varName?: string; // variable name + modifier?: string; // modifier e.g * + reserved?: boolean; // if true we'll keep reserved words with not encoding +} + +export interface UrlTemplateOptions { + // if set to true, reserved characters will not be encoded + allowReserved?: boolean; +} + +// --------------------- +// helpers +// --------------------- +function encodeComponent(val: string, reserved?: boolean, op?: string): string { + return (reserved ?? op === "+") || op === "#" + ? encodeReservedComponent(val) + : encodeRFC3986URIComponent(val); +} + +function encodeReservedComponent(str: string): string { + return str + .split(/(%[0-9A-Fa-f]{2})/g) + .map((part) => (!/%[0-9A-Fa-f]/.test(part) ? encodeURI(part) : part)) + .join(""); +} + +function encodeRFC3986URIComponent(str: string): string { + return encodeURIComponent(str).replace( + /[!'()*]/g, + (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`, + ); +} + +function isDefined(val: any): boolean { + return val !== undefined && val !== null; +} + +function getNamedAndIfEmpty(op?: string): [boolean, string] { + return [!!op && [";", "?", "&"].includes(op), !!op && ["?", "&"].includes(op) ? "=" : ""]; +} + +function getFirstOrSep(op?: string, isFirst = false): string { + if (isFirst) { + return !op || op === "+" ? "" : op; + } else if (!op || op === "+" || op === "#") { + return ","; + } else if (op === "?") { + return "&"; + } else { + return op; + } +} + +function getExpandedValue(option: ValueOptions): string { + let isFirst = option.isFirst; + const { op, varName, varValue: value, reserved } = option; + const vals: string[] = []; + const [named, ifEmpty] = getNamedAndIfEmpty(op); + + if (Array.isArray(value)) { + for (const val of value.filter(isDefined)) { + // prepare the following parts: separator, varName, value + vals.push(`${getFirstOrSep(op, isFirst)}`); + if (named && varName) { + // No need to encode varName considering it is already encoded + vals.push(`${varName}`); + if (val === "") { + vals.push(ifEmpty); + } else { + vals.push("="); + } + } + vals.push(encodeComponent(val, reserved, op)); + isFirst = false; + } + } else if (typeof value === "object") { + for (const key of Object.keys(value)) { + const val = value[key]; + if (!isDefined(val)) { + continue; + } + // prepare the following parts: separator, key, value + vals.push(`${getFirstOrSep(op, isFirst)}`); + if (key) { + vals.push(`${encodeURIComponent(key)}`); + if (named && val === "") { + vals.push(ifEmpty); + } else { + vals.push("="); + } + } + vals.push(encodeComponent(val, reserved, op)); + isFirst = false; + } + } + return vals.join(""); +} + +function getNonExpandedValue(option: ValueOptions): string | undefined { + const { op, varName, varValue: value, isFirst, reserved } = option; + const vals: string[] = []; + const first = getFirstOrSep(op, isFirst); + const [named, ifEmpty] = getNamedAndIfEmpty(op); + if (named && varName) { + // No need to encode varName considering it is already encoded + vals.push(varName); + if (value === "") { + if (!ifEmpty) { + vals.push(ifEmpty); + } + return !vals.join("") ? undefined : `${first}${vals.join("")}`; + } + vals.push("="); + } + + const items = []; + if (Array.isArray(value)) { + for (const val of value.filter(isDefined)) { + items.push(encodeComponent(val, reserved, op)); + } + } else if (typeof value === "object") { + for (const key of Object.keys(value)) { + if (!isDefined(value[key])) { + continue; + } + items.push(encodeRFC3986URIComponent(key)); + items.push(encodeComponent(value[key], reserved, op)); + } + } + vals.push(items.join(",")); + return !vals.join(",") ? undefined : `${first}${vals.join("")}`; +} + +function getVarValue(option: ValueOptions): string | undefined { + const { op, varName, modifier, isFirst, reserved, varValue: value } = option; + + if (!isDefined(value)) { + return undefined; + } else if (["string", "number", "boolean"].includes(typeof value)) { + let val = value.toString(); + const [named, ifEmpty] = getNamedAndIfEmpty(op); + const vals: string[] = [getFirstOrSep(op, isFirst)]; + if (named && varName) { + // No need to encode varName considering it is already encoded + vals.push(varName); + if (val === "") { + vals.push(ifEmpty); + } else { + vals.push("="); + } + } + if (modifier && modifier !== "*") { + val = val.substring(0, parseInt(modifier, 10)); + } + vals.push(encodeComponent(val, reserved, op)); + return vals.join(""); + } else if (modifier === "*") { + return getExpandedValue(option); + } else { + return getNonExpandedValue(option); + } +} + +// --------------------------------------------------------------------------------------------------- +// This is an implementation of RFC 6570 URI Template: https://datatracker.ietf.org/doc/html/rfc6570. +// --------------------------------------------------------------------------------------------------- +export function expandUrlTemplate( + template: string, + context: Record, + option?: UrlTemplateOptions, +): string { + const result = template.replace(/\{([^{}]+)\}|([^{}]+)/g, (_, expr, text) => { + if (!expr) { + return encodeReservedComponent(text); + } + let op; + if (["+", "#", ".", "/", ";", "?", "&"].includes(expr[0])) { + op = expr[0]; + expr = expr.slice(1); + } + const varList = expr.split(/,/g); + const innerResult = []; + for (const varSpec of varList) { + const varMatch = /([^:*]*)(?::(\d+)|(\*))?/.exec(varSpec); + if (!varMatch || !varMatch[1]) { + continue; + } + const varValue = getVarValue({ + isFirst: innerResult.length === 0, + op, + varValue: context[varMatch[1]], + varName: varMatch[1], + modifier: varMatch[2] || varMatch[3], + reserved: option?.allowReserved, + }); + if (varValue) { + innerResult.push(varValue); + } + } + return innerResult.join(""); + }); + + return normalizeUnreserved(result); +} + +/** + * Normalize an expanded URI by decoding percent-encoded unreserved characters. + * RFC 3986 unreserved: "-" / "." / "~" + */ +function normalizeUnreserved(uri: string): string { + return uri.replace(/%([0-9A-Fa-f]{2})/g, (match, hex) => { + const char = String.fromCharCode(parseInt(hex, 16)); + // Decode only if it's unreserved + if (/[.~-]/.test(char)) { + return char; + } + return match; // leave other encodings intact + }); +} diff --git a/sdk/platformvalidation/arm-platformvalidation/test/public/sampleTest.spec.ts b/sdk/platformvalidation/arm-platformvalidation/test/public/sampleTest.spec.ts new file mode 100644 index 000000000000..02e40ba0c606 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/test/public/sampleTest.spec.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +// import { Recorder } from "@azure-tools/test-recorder"; +// import { createRecorder } from "./utils/recordedClient.js"; +import { + assert, + // beforeEach, + // afterEach, + it, + describe, +} from "vitest"; + +describe("My test", () => { + // let recorder: Recorder; + + // beforeEach(async function(ctx) { + // recorder = await createRecorder(ctx); + // }); + + // afterEach(async function() { + // await recorder.stop(); + // }); + + it("sample test", async function () { + assert.equal(1, 1); + }); +}); diff --git a/sdk/platformvalidation/arm-platformvalidation/test/public/utils/recordedClient.ts b/sdk/platformvalidation/arm-platformvalidation/test/public/utils/recordedClient.ts new file mode 100644 index 000000000000..285e4643c45e --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/test/public/utils/recordedClient.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { RecorderStartOptions, VitestTestContext } from "@azure-tools/test-recorder"; +import { Recorder } from "@azure-tools/test-recorder"; + +const replaceableVariables: Record = { + SUBSCRIPTION_ID: "azure_subscription_id", +}; + +const recorderEnvSetup: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables, +}; + +/** + * creates the recorder and reads the environment variables from the `.env` file. + * Should be called first in the test suite to make sure environment variables are + * read before they are being used. + */ +export async function createRecorder(context: VitestTestContext): Promise { + const recorder = new Recorder(context); + await recorder.start(recorderEnvSetup); + return recorder; +} diff --git a/sdk/platformvalidation/arm-platformvalidation/test/snippets.spec.ts b/sdk/platformvalidation/arm-platformvalidation/test/snippets.spec.ts new file mode 100644 index 000000000000..ef7d08857811 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/test/snippets.spec.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { PlatformValidationClient } from "../src/index.js"; +import { DefaultAzureCredential, InteractiveBrowserCredential } from "@azure/identity"; +import { setLogLevel } from "@azure/logger"; +import { describe, it } from "vitest"; + +describe("snippets", () => { + it("ReadmeSampleCreateClient_Node", async () => { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(new DefaultAzureCredential(), subscriptionId); + }); + + it("ReadmeSampleCreateClient_Browser", async () => { + const credential = new InteractiveBrowserCredential({ + tenantId: "", + clientId: "", + }); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new PlatformValidationClient(credential, subscriptionId); + }); + + it("SetLogLevel", async () => { + setLogLevel("info"); + }); +}); diff --git a/sdk/platformvalidation/arm-platformvalidation/tsconfig.json b/sdk/platformvalidation/arm-platformvalidation/tsconfig.json new file mode 100644 index 000000000000..d0a44aae0734 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/tsconfig.json @@ -0,0 +1,26 @@ +{ + "references": [ + { + "path": "./config/tsconfig.src.esm.json" + }, + { + "path": "./config/tsconfig.src.browser.json" + }, + { + "path": "./config/tsconfig.src.cjs.json" + }, + { + "path": "./config/tsconfig.test.node.json" + }, + { + "path": "./config/tsconfig.test.browser.json" + }, + { + "path": "./config/tsconfig.samples.json" + }, + { + "path": "./config/tsconfig.snippets.json" + } + ], + "files": [] +} diff --git a/sdk/platformvalidation/arm-platformvalidation/tsp-location.yaml b/sdk/platformvalidation/arm-platformvalidation/tsp-location.yaml new file mode 100644 index 000000000000..d8045b0bb378 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/platformvalidation/resource-manager/Microsoft.PlatformValidation/PlatformValidation +commit: c7569077719927adf8835d79ef8d0763dd3d492d +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/platformvalidation/arm-platformvalidation/vitest.browser.config.ts b/sdk/platformvalidation/arm-platformvalidation/vitest.browser.config.ts new file mode 100644 index 000000000000..3005cfd05093 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/vitest.browser.config.ts @@ -0,0 +1,4 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { default } from "../../../eng/vitestconfigs/browser.config.ts"; diff --git a/sdk/platformvalidation/arm-platformvalidation/vitest.config.ts b/sdk/platformvalidation/arm-platformvalidation/vitest.config.ts new file mode 100644 index 000000000000..0dfa15cc4498 --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/vitest.config.ts @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import viteConfig from "../../../vitest.shared.config.ts"; + +export default viteConfig; diff --git a/sdk/platformvalidation/arm-platformvalidation/warp.config.yml b/sdk/platformvalidation/arm-platformvalidation/warp.config.yml new file mode 100644 index 000000000000..376485189f2e --- /dev/null +++ b/sdk/platformvalidation/arm-platformvalidation/warp.config.yml @@ -0,0 +1,29 @@ +# warp.config.yml — build configuration + +exports: + "./package.json": "./package.json" + ".": "./src/index.ts" + "./api": "./src/api/index.ts" + "./api/validationTestCategories": "./src/api/validationTestCategories/index.ts" + "./api/validationTestVersions": "./src/api/validationTestVersions/index.ts" + "./api/validationTests": "./src/api/validationTests/index.ts" + "./api/validationTestRuns": "./src/api/validationTestRuns/index.ts" + "./api/executionPlanRuns": "./src/api/executionPlanRuns/index.ts" + "./api/validationExecutionPlans": "./src/api/validationExecutionPlans/index.ts" + "./api/cloudValidations": "./src/api/cloudValidations/index.ts" + "./api/operations": "./src/api/operations/index.ts" + "./api/operationStatus": "./src/api/operationStatus/index.ts" + "./models": "./src/models/index.ts" + +targets: + - name: browser + tsconfig: "./config/tsconfig.src.browser.json" + + - name: esm + condition: import + tsconfig: "./config/tsconfig.src.esm.json" + + - name: commonjs + condition: require + tsconfig: "./config/tsconfig.src.cjs.json" + moduleType: commonjs diff --git a/sdk/platformvalidation/ci.mgmt.yml b/sdk/platformvalidation/ci.mgmt.yml new file mode 100644 index 000000000000..13945b50ee66 --- /dev/null +++ b/sdk/platformvalidation/ci.mgmt.yml @@ -0,0 +1,35 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - feature/* + - release/* + - hotfix/* + exclude: + - feature/v4 + paths: + include: + - sdk/platformvalidation/arm-platformvalidation + - sdk/platformvalidation/ci.mgmt.yml +pr: + branches: + include: + - main + - feature/* + - release/* + - hotfix/* + exclude: + - feature/v4 + paths: + include: + - sdk/platformvalidation/arm-platformvalidation + - sdk/platformvalidation/ci.mgmt.yml +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: platformvalidation + Artifacts: + - name: azure-arm-platformvalidation + safeName: azurearmplatformvalidation