diff --git a/eng/emitter-package-lock.json b/eng/emitter-package-lock.json index 7d897567fb9a..fe86a6afbc9d 100644 --- a/eng/emitter-package-lock.json +++ b/eng/emitter-package-lock.json @@ -5,23 +5,27 @@ "packages": { "": { "dependencies": { - "@azure-tools/typespec-java": "0.45.5" + "@azure-tools/typespec-java": "/mnt/vss/_work/1/typespec-azure/packages/typespec-java/azure-tools-typespec-java-0.45.6.tgz" }, "devDependencies": { - "@azure-tools/openai-typespec": "1.20.0", - "@azure-tools/typespec-autorest": "0.69.1", - "@azure-tools/typespec-azure-core": "0.69.0", - "@azure-tools/typespec-azure-resource-manager": "0.69.2", - "@azure-tools/typespec-azure-rulesets": "0.69.2", - "@azure-tools/typespec-client-generator-core": "0.69.2", - "@azure-tools/typespec-liftr-base": "0.14.0", - "@typespec/compiler": "1.13.0", - "@typespec/http": "1.13.0", - "@typespec/openapi": "1.13.0", - "@typespec/openapi3": "1.13.0", - "@typespec/rest": "0.83.0", - "@typespec/versioning": "0.83.0", - "@typespec/xml": "0.83.0" + "@azure-tools/openai-typespec": "1.21.1", + "@azure-tools/typespec-autorest": "0.70.0", + "@azure-tools/typespec-azure-core": "0.70.0", + "@azure-tools/typespec-azure-portal-core": "0.70.0", + "@azure-tools/typespec-azure-resource-manager": "0.70.0", + "@azure-tools/typespec-azure-rulesets": "0.70.0", + "@azure-tools/typespec-client-generator-core": "0.70.0", + "@azure-tools/typespec-liftr-base": "0.13.0", + "@typespec/compiler": "1.14.0", + "@typespec/events": "0.84.0", + "@typespec/http": "1.14.0", + "@typespec/openapi": "1.14.0", + "@typespec/openapi3": "1.14.0", + "@typespec/rest": "0.84.0", + "@typespec/sse": "0.84.0", + "@typespec/streams": "0.84.0", + "@typespec/versioning": "0.84.0", + "@typespec/xml": "0.84.0" } }, "node_modules/@autorest/codemodel": { @@ -37,18 +41,6 @@ "node": ">=12.0.0" } }, - "node_modules/@autorest/codemodel/node_modules/js-yaml": { - "version": "4.1.1", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/js-yaml/-/js-yaml-4.1.1.tgz", - "integrity": "sha1-hUwpJGdwW2mUduGi3swMijRYgGs=", - "license": "MIT", - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, "node_modules/@azure-tools/async-io": { "version": "3.0.254", "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure-tools/async-io/-/async-io-3.0.254.tgz", @@ -76,26 +68,15 @@ "node": ">=12.0.0" } }, - "node_modules/@azure-tools/codegen/node_modules/js-yaml": { - "version": "4.1.1", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/js-yaml/-/js-yaml-4.1.1.tgz", - "integrity": "sha1-hUwpJGdwW2mUduGi3swMijRYgGs=", - "license": "MIT", - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, "node_modules/@azure-tools/openai-typespec": { - "version": "1.20.0", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure-tools/openai-typespec/-/openai-typespec-1.20.0.tgz", - "integrity": "sha1-pcUlfx0cFVyYqgX84nCj0VkbdJk=", + "version": "1.21.1", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure-tools/openai-typespec/-/openai-typespec-1.21.1.tgz", + "integrity": "sha1-3lRJQxVbXPPs59xVqj6qRv8ULgU=", + "dev": true, "license": "MIT", "peerDependencies": { - "@typespec/http": "^1.11.0", - "@typespec/openapi": "^1.11.0" + "@typespec/http": "^1.13.0", + "@typespec/openapi": "^1.13.0" } }, "node_modules/@azure-tools/tasks": { @@ -108,23 +89,26 @@ } }, "node_modules/@azure-tools/typespec-autorest": { - "version": "0.69.1", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure-tools/typespec-autorest/-/typespec-autorest-0.69.1.tgz", - "integrity": "sha1-Xqa9GjpEsawclmX/6IwzKVIRu3Y=", + "version": "0.70.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure-tools/typespec-autorest/-/typespec-autorest-0.70.0.tgz", + "integrity": "sha1-hxXdmTz6UUqpPXEGLwyRUHHNt38=", "license": "MIT", + "dependencies": { + "yaml": "^2.8.3" + }, "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": "^0.69.0", - "@azure-tools/typespec-azure-resource-manager": "^0.69.1", - "@azure-tools/typespec-client-generator-core": "^0.69.0", - "@typespec/compiler": "^1.13.0", - "@typespec/http": "^1.13.0", - "@typespec/openapi": "^1.13.0", - "@typespec/rest": "^0.83.0", - "@typespec/versioning": "^0.83.0", - "@typespec/xml": "^0.83.0" + "@azure-tools/typespec-azure-core": "^0.70.0", + "@azure-tools/typespec-azure-resource-manager": "^0.70.0", + "@azure-tools/typespec-client-generator-core": "^0.70.0", + "@typespec/compiler": "^1.14.0", + "@typespec/http": "^1.14.0", + "@typespec/openapi": "^1.14.0", + "@typespec/rest": "^0.84.0", + "@typespec/versioning": "^0.84.0", + "@typespec/xml": "^0.84.0" }, "peerDependenciesMeta": { "@typespec/xml": { @@ -133,23 +117,34 @@ } }, "node_modules/@azure-tools/typespec-azure-core": { - "version": "0.69.0", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure-tools/typespec-azure-core/-/typespec-azure-core-0.69.0.tgz", - "integrity": "sha1-nUUoo+wXvMDKjoSwpsmBUbNA4OU=", + "version": "0.70.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure-tools/typespec-azure-core/-/typespec-azure-core-0.70.0.tgz", + "integrity": "sha1-k3VYRkt7yNAA1kiBElz71YbZH7A=", "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0", - "@typespec/http": "^1.13.0", - "@typespec/rest": "^0.83.0" + "@typespec/compiler": "^1.14.0", + "@typespec/http": "^1.14.0", + "@typespec/rest": "^0.84.0" + } + }, + "node_modules/@azure-tools/typespec-azure-portal-core": { + "version": "0.70.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure-tools/typespec-azure-portal-core/-/typespec-azure-portal-core-0.70.0.tgz", + "integrity": "sha1-lBhBuWg3V9oENi5XPxYBysFpB58=", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@azure-tools/typespec-azure-resource-manager": "^0.70.0", + "@typespec/compiler": "^1.14.0" } }, "node_modules/@azure-tools/typespec-azure-resource-manager": { - "version": "0.69.2", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure-tools/typespec-azure-resource-manager/-/typespec-azure-resource-manager-0.69.2.tgz", - "integrity": "sha1-38rBk0p9bNsdHXUYSmutW75OJe8=", + "version": "0.70.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure-tools/typespec-azure-resource-manager/-/typespec-azure-resource-manager-0.70.0.tgz", + "integrity": "sha1-+Skz0cnW1LADE60g/JnqYk0nixg=", "license": "MIT", "dependencies": { "change-case": "^5.4.4", @@ -159,33 +154,33 @@ "node": ">=22.0.0" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": "^0.69.0", - "@typespec/compiler": "^1.13.0", - "@typespec/http": "^1.13.0", - "@typespec/openapi": "^1.13.0", - "@typespec/rest": "^0.83.0", - "@typespec/versioning": "^0.83.0" + "@azure-tools/typespec-azure-core": "^0.70.0", + "@typespec/compiler": "^1.14.0", + "@typespec/http": "^1.14.0", + "@typespec/openapi": "^1.14.0", + "@typespec/rest": "^0.84.0", + "@typespec/versioning": "^0.84.0" } }, "node_modules/@azure-tools/typespec-azure-rulesets": { - "version": "0.69.2", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure-tools/typespec-azure-rulesets/-/typespec-azure-rulesets-0.69.2.tgz", - "integrity": "sha1-wD+Y5AC8lOUTcl0s8y5m37voSHA=", + "version": "0.70.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure-tools/typespec-azure-rulesets/-/typespec-azure-rulesets-0.70.0.tgz", + "integrity": "sha1-/iCKSwMs+gWfYYd9UTZFo/AXjrQ=", "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": "^0.69.0", - "@azure-tools/typespec-azure-resource-manager": "^0.69.2", - "@azure-tools/typespec-client-generator-core": "^0.69.2", - "@typespec/compiler": "^1.13.0" + "@azure-tools/typespec-azure-core": "^0.70.0", + "@azure-tools/typespec-azure-resource-manager": "^0.70.0", + "@azure-tools/typespec-client-generator-core": "^0.70.0", + "@typespec/compiler": "^1.14.0" } }, "node_modules/@azure-tools/typespec-client-generator-core": { - "version": "0.69.2", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.69.2.tgz", - "integrity": "sha1-UGOckCevYslK4puCkn6GmTK53jQ=", + "version": "0.70.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.70.0.tgz", + "integrity": "sha1-k7nEgErM8Vd5PRVdaR8rfSPFpic=", "license": "MIT", "dependencies": { "change-case": "^5.4.4", @@ -196,52 +191,53 @@ "node": ">=22.0.0" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": "^0.69.0", - "@typespec/compiler": "^1.13.0", - "@typespec/events": "^0.83.0", - "@typespec/http": "^1.13.0", - "@typespec/openapi": "^1.13.0", - "@typespec/rest": "^0.83.0", - "@typespec/sse": "^0.83.0", - "@typespec/streams": "^0.83.0", - "@typespec/versioning": "^0.83.0", - "@typespec/xml": "^0.83.0" + "@azure-tools/typespec-azure-core": "^0.70.0", + "@typespec/compiler": "^1.14.0", + "@typespec/events": "^0.84.0", + "@typespec/http": "^1.14.0", + "@typespec/openapi": "^1.14.0", + "@typespec/rest": "^0.84.0", + "@typespec/sse": "^0.84.0", + "@typespec/streams": "^0.84.0", + "@typespec/versioning": "^0.84.0", + "@typespec/xml": "^0.84.0" } }, "node_modules/@azure-tools/typespec-java": { - "version": "0.45.5", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure-tools/typespec-java/-/typespec-java-0.45.5.tgz", - "integrity": "sha1-MyKlRsphjvgGwrHwt24tCcpym0I=", + "version": "0.45.6", + "resolved": "file:../../typespec-azure/packages/typespec-java/azure-tools-typespec-java-0.45.6.tgz", + "integrity": "sha512-66K4PbhkoFvBK08tVgRBTZDWCNc8h0dge9o5g/hvMk9ssQojtw15ULLI3MiZRdUYEiQS5UFoVYuurmTks66+lg==", "license": "MIT", "dependencies": { "@autorest/codemodel": "~4.20.1", - "js-yaml": "~4.3.0", - "lodash": "~4.18.1" + "@azure-tools/codegen": "~2.10.1", + "yaml": "^2.8.3" }, "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@azure-tools/openai-typespec": "^1.20.0", - "@azure-tools/typespec-autorest": ">=0.69.1 <1.0.0", - "@azure-tools/typespec-azure-core": ">=0.69.0 <1.0.0", - "@azure-tools/typespec-azure-resource-manager": ">=0.69.2 <1.0.0", - "@azure-tools/typespec-azure-rulesets": ">=0.69.2 <1.0.0", - "@azure-tools/typespec-client-generator-core": ">=0.69.2 <1.0.0", - "@azure-tools/typespec-liftr-base": ">=0.14.0 <1.0.0", - "@typespec/compiler": "^1.13.0", - "@typespec/http": "^1.13.0", - "@typespec/openapi": "^1.13.0", - "@typespec/openapi3": "^1.13.0", - "@typespec/rest": ">=0.83.0 <1.0.0", - "@typespec/versioning": ">=0.83.0 <1.0.0", - "@typespec/xml": ">=0.83.0 <1.0.0" + "@azure-tools/typespec-autorest": "^0.70.0", + "@azure-tools/typespec-azure-core": "^0.70.0", + "@azure-tools/typespec-azure-resource-manager": "^0.70.0", + "@azure-tools/typespec-azure-rulesets": "^0.70.0", + "@azure-tools/typespec-client-generator-core": "^0.70.0", + "@typespec/compiler": "^1.14.0", + "@typespec/events": "^0.84.0", + "@typespec/http": "^1.14.0", + "@typespec/openapi": "^1.14.0", + "@typespec/rest": "^0.84.0", + "@typespec/sse": "^0.84.0", + "@typespec/streams": "^0.84.0", + "@typespec/versioning": "^0.84.0", + "@typespec/xml": "^0.84.0" } }, "node_modules/@azure-tools/typespec-liftr-base": { - "version": "0.14.0", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure-tools/typespec-liftr-base/-/typespec-liftr-base-0.14.0.tgz", - "integrity": "sha1-vZWLRgDrWTvDqGM/7VyT5X82nU4=" + "version": "0.13.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@azure-tools/typespec-liftr-base/-/typespec-liftr-base-0.13.0.tgz", + "integrity": "sha1-vSGud1SYlpiPGU7ybeXyWL/Zxw8=", + "dev": true }, "node_modules/@babel/code-frame": { "version": "7.29.7", @@ -607,21 +603,23 @@ } }, "node_modules/@scalar/helpers": { - "version": "0.9.0", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@scalar/helpers/-/helpers-0.9.0.tgz", - "integrity": "sha1-s9sRNhIJtLknMzSHUj4ehMT/1A8=", + "version": "0.9.1", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@scalar/helpers/-/helpers-0.9.1.tgz", + "integrity": "sha1-TJPai3+XQY5oiFvsZ8bwYPShpbY=", + "dev": true, "license": "MIT", "engines": { "node": ">=22" } }, "node_modules/@scalar/json-magic": { - "version": "0.12.17", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@scalar/json-magic/-/json-magic-0.12.17.tgz", - "integrity": "sha1-4nnGMIOcENeTdgDd5o373T8fGFM=", + "version": "0.12.18", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@scalar/json-magic/-/json-magic-0.12.18.tgz", + "integrity": "sha1-kUIbJivbHZv4xJRLWwmFru3h/0U=", + "dev": true, "license": "MIT", "dependencies": { - "@scalar/helpers": "0.9.0", + "@scalar/helpers": "0.9.1", "pathe": "^2.0.3", "yaml": "^2.8.3" }, @@ -630,15 +628,16 @@ } }, "node_modules/@scalar/openapi-parser": { - "version": "0.28.8", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@scalar/openapi-parser/-/openapi-parser-0.28.8.tgz", - "integrity": "sha1-LVIO/1wSL5qJ4d91bsc9AFUr11U=", + "version": "0.28.9", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@scalar/openapi-parser/-/openapi-parser-0.28.9.tgz", + "integrity": "sha1-VNc0tdOQHXemaJ/BF1Ugmo/ljXI=", + "dev": true, "license": "MIT", "dependencies": { - "@scalar/helpers": "0.9.0", - "@scalar/json-magic": "0.12.17", - "@scalar/openapi-types": "0.9.1", - "@scalar/openapi-upgrader": "0.2.9", + "@scalar/helpers": "0.9.1", + "@scalar/json-magic": "0.12.18", + "@scalar/openapi-types": "0.9.2", + "@scalar/openapi-upgrader": "0.2.10", "ajv": "^8.17.1", "ajv-draft-04": "^1.0.0", "ajv-formats": "^3.0.1", @@ -651,21 +650,23 @@ } }, "node_modules/@scalar/openapi-types": { - "version": "0.9.1", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@scalar/openapi-types/-/openapi-types-0.9.1.tgz", - "integrity": "sha1-EW7oh5Byy1qr2c7hz0MUYmjbkiY=", + "version": "0.9.2", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@scalar/openapi-types/-/openapi-types-0.9.2.tgz", + "integrity": "sha1-7Qv4KHUA0FkQMYbhJduDr+NoC0M=", + "dev": true, "license": "MIT", "engines": { "node": ">=22" } }, "node_modules/@scalar/openapi-upgrader": { - "version": "0.2.9", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@scalar/openapi-upgrader/-/openapi-upgrader-0.2.9.tgz", - "integrity": "sha1-7ZGjDb+tJEvXpKFwZIrGS4+w+VI=", + "version": "0.2.10", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@scalar/openapi-upgrader/-/openapi-upgrader-0.2.10.tgz", + "integrity": "sha1-pcONc8YpGrbqqastwG4A0JNsTF8=", + "dev": true, "license": "MIT", "dependencies": { - "@scalar/openapi-types": "0.9.1" + "@scalar/openapi-types": "0.9.2" }, "engines": { "node": ">=22" @@ -675,6 +676,7 @@ "version": "0.79.1", "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/asset-emitter/-/asset-emitter-0.79.1.tgz", "integrity": "sha1-ustlnxj/oOyPs7Wkf44wS8qKImo=", + "dev": true, "license": "MIT", "engines": { "node": ">=20.0.0" @@ -684,9 +686,9 @@ } }, "node_modules/@typespec/compiler": { - "version": "1.13.0", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/compiler/-/compiler-1.13.0.tgz", - "integrity": "sha1-9rRSNTfToVgLNNYWCs7hO+AI6UA=", + "version": "1.14.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/compiler/-/compiler-1.14.0.tgz", + "integrity": "sha1-2FXCBu7K+j54eOf0JVthKC8FP0Y=", "license": "MIT", "dependencies": { "@babel/code-frame": "^7.29.0", @@ -700,8 +702,8 @@ "prettier": "^3.8.1", "semver": "^7.7.4", "tar": "^7.5.13", - "temporal-polyfill": "^0.3.2", - "vscode-languageserver": "^9.0.1", + "temporal-polyfill": "^1.0.1", + "vscode-languageserver": "^10.0.0", "vscode-languageserver-textdocument": "^1.0.12", "yaml": "^2.8.3", "yargs": "^18.0.0" @@ -715,29 +717,28 @@ } }, "node_modules/@typespec/events": { - "version": "0.83.0", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/events/-/events-0.83.0.tgz", - "integrity": "sha1-muxeJanyHS+6QCQoU5T8pQg/nDA=", + "version": "0.84.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/events/-/events-0.84.0.tgz", + "integrity": "sha1-U6JW0cqeb0+n5fCjTbaW3DlOYPk=", "license": "MIT", - "peer": true, "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0" + "@typespec/compiler": "^1.14.0" } }, "node_modules/@typespec/http": { - "version": "1.13.0", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/http/-/http-1.13.0.tgz", - "integrity": "sha1-qQ89noV+3DME0HhJLscj0suz4Zs=", + "version": "1.14.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/http/-/http-1.14.0.tgz", + "integrity": "sha1-La9yB2Ny8FhnXSBbst9wYQBiOq4=", "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0", - "@typespec/streams": "^0.83.0" + "@typespec/compiler": "^1.14.0", + "@typespec/streams": "^0.84.0" }, "peerDependenciesMeta": { "@typespec/streams": { @@ -746,22 +747,23 @@ } }, "node_modules/@typespec/openapi": { - "version": "1.13.0", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/openapi/-/openapi-1.13.0.tgz", - "integrity": "sha1-YmlA5T5uoIaeZ0hvfS/5czuDCkA=", + "version": "1.14.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/openapi/-/openapi-1.14.0.tgz", + "integrity": "sha1-uwjWOV3VwWP59UXlR2xVUuzyCGc=", "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0", - "@typespec/http": "^1.13.0" + "@typespec/compiler": "^1.14.0", + "@typespec/http": "^1.14.0" } }, "node_modules/@typespec/openapi3": { - "version": "1.13.0", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/openapi3/-/openapi3-1.13.0.tgz", - "integrity": "sha1-a/4+2NCZhysSM4hDwmLGzrL9jwA=", + "version": "1.14.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/openapi3/-/openapi3-1.14.0.tgz", + "integrity": "sha1-y2vbsHoAsmitk11DD8LOxXxcixw=", + "dev": true, "license": "MIT", "dependencies": { "@scalar/json-magic": "^0.12.15", @@ -777,14 +779,14 @@ "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0", - "@typespec/events": "^0.83.0", - "@typespec/http": "^1.13.0", - "@typespec/json-schema": "^1.13.0", - "@typespec/openapi": "^1.13.0", - "@typespec/sse": "^0.83.0", - "@typespec/streams": "^0.83.0", - "@typespec/versioning": "^0.83.0" + "@typespec/compiler": "^1.14.0", + "@typespec/events": "^0.84.0", + "@typespec/http": "^1.14.0", + "@typespec/json-schema": "^1.14.0", + "@typespec/openapi": "^1.14.0", + "@typespec/sse": "^0.84.0", + "@typespec/streams": "^0.84.0", + "@typespec/versioning": "^0.84.0" }, "peerDependenciesMeta": { "@typespec/events": { @@ -808,69 +810,67 @@ } }, "node_modules/@typespec/rest": { - "version": "0.83.0", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/rest/-/rest-0.83.0.tgz", - "integrity": "sha1-VdO6JyTFMQjlEUciZ9kKaI22BkU=", + "version": "0.84.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/rest/-/rest-0.84.0.tgz", + "integrity": "sha1-kMLB39G8geZbiA3EEdQBaqteuuA=", "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0", - "@typespec/http": "^1.13.0" + "@typespec/compiler": "^1.14.0", + "@typespec/http": "^1.14.0" } }, "node_modules/@typespec/sse": { - "version": "0.83.0", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/sse/-/sse-0.83.0.tgz", - "integrity": "sha1-hNyNnk7rrJXC0Lfm4myUdYPL6Lg=", + "version": "0.84.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/sse/-/sse-0.84.0.tgz", + "integrity": "sha1-dkP/3P+tvI4Q2SV3oRz/F2JMVXo=", "license": "MIT", - "peer": true, "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0", - "@typespec/events": "^0.83.0", - "@typespec/http": "^1.13.0", - "@typespec/streams": "^0.83.0" + "@typespec/compiler": "^1.14.0", + "@typespec/events": "^0.84.0", + "@typespec/http": "^1.14.0", + "@typespec/streams": "^0.84.0" } }, "node_modules/@typespec/streams": { - "version": "0.83.0", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/streams/-/streams-0.83.0.tgz", - "integrity": "sha1-WJdJb4yL+BgQl4Q+d7NS+6gEcbM=", + "version": "0.84.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/streams/-/streams-0.84.0.tgz", + "integrity": "sha1-Bm3D76chBKlcou2jj913xFfTBI4=", "license": "MIT", - "peer": true, "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0" + "@typespec/compiler": "^1.14.0" } }, "node_modules/@typespec/versioning": { - "version": "0.83.0", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/versioning/-/versioning-0.83.0.tgz", - "integrity": "sha1-IE6Hk9aRF7JC93SQKMA5Ex/uCW8=", + "version": "0.84.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/versioning/-/versioning-0.84.0.tgz", + "integrity": "sha1-YS06C7uMMWXKp7vwuy8qV8kjr38=", "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0" + "@typespec/compiler": "^1.14.0" } }, "node_modules/@typespec/xml": { - "version": "0.83.0", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/xml/-/xml-0.83.0.tgz", - "integrity": "sha1-PMnR1zxpV2mLz/gUfU67AqJTGXk=", + "version": "0.84.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/@typespec/xml/-/xml-0.84.0.tgz", + "integrity": "sha1-aP99jZ3+wHS7f9mMJbEUT4Py7+g=", "license": "MIT", "engines": { "node": ">=22.0.0" }, "peerDependencies": { - "@typespec/compiler": "^1.13.0" + "@typespec/compiler": "^1.14.0" } }, "node_modules/ajv": { @@ -893,6 +893,7 @@ "version": "1.0.0", "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/ajv-draft-04/-/ajv-draft-04-1.0.0.tgz", "integrity": "sha1-O2R2GyaLoLnmaPC0G6U/zgrXf8g=", + "dev": true, "license": "MIT", "peerDependencies": { "ajv": "^8.5.0" @@ -907,6 +908,7 @@ "version": "3.0.1", "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/ajv-formats/-/ajv-formats-3.0.1.tgz", "integrity": "sha1-PV3HYryhdnnDwup+kK1rdTIwlXg=", + "dev": true, "license": "MIT", "dependencies": { "ajv": "^8.0.0" @@ -1144,19 +1146,9 @@ "license": "MIT" }, "node_modules/js-yaml": { - "version": "4.3.0", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/js-yaml/-/js-yaml-4.3.0.tgz", - "integrity": "sha1-0ZAFcqf3zwtfVAyDZz5gutNDZZI=", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/puzrin" - }, - { - "type": "github", - "url": "https://github.com/sponsors/nodeca" - } - ], + "version": "4.1.1", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/js-yaml/-/js-yaml-4.1.1.tgz", + "integrity": "sha1-hUwpJGdwW2mUduGi3swMijRYgGs=", "license": "MIT", "dependencies": { "argparse": "^2.0.1" @@ -1175,6 +1167,7 @@ "version": "5.0.1", "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/jsonpointer/-/jsonpointer-5.0.1.tgz", "integrity": "sha1-IRDgrwkA/TdGe1kH7NE6eIShtVk=", + "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -1184,6 +1177,7 @@ "version": "4.1.0", "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/leven/-/leven-4.1.0.tgz", "integrity": "sha1-HjcVDhcR0YuxTjgKXHeZlSNacQ4=", + "dev": true, "license": "MIT", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" @@ -1192,12 +1186,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/lodash": { - "version": "4.18.1", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/lodash/-/lodash-4.18.1.tgz", - "integrity": "sha1-/ytmwfYybVlRPeJAe/iBQ5gSdxw=", - "license": "MIT" - }, "node_modules/minipass": { "version": "7.1.3", "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/minipass/-/minipass-7.1.3.tgz", @@ -1241,6 +1229,7 @@ "version": "2.0.3", "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/pathe/-/pathe-2.0.3.tgz", "integrity": "sha1-PsvsVUIWhbcKnahyss/z4cvtFxY=", + "dev": true, "license": "MIT" }, "node_modules/picocolors": { @@ -1259,9 +1248,9 @@ } }, "node_modules/prettier": { - "version": "3.9.4", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/prettier/-/prettier-3.9.4.tgz", - "integrity": "sha1-qcR3zxYUN2vR9rvFk9jA1BS87Ic=", + "version": "3.9.5", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/prettier/-/prettier-3.9.5.tgz", + "integrity": "sha1-T+yXc24zudC2ILSJFP6TtTDoNa0=", "license": "MIT", "bin": { "prettier": "bin/prettier.cjs" @@ -1367,9 +1356,9 @@ } }, "node_modules/tar": { - "version": "7.5.19", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/tar/-/tar-7.5.19.tgz", - "integrity": "sha1-2JFea3F/gDannYOcqUSBmLACsKc=", + "version": "7.5.20", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/tar/-/tar-7.5.20.tgz", + "integrity": "sha1-N6ZaqRHL1phkAC4Uv4qSalVR4kA=", "license": "BlueOak-1.0.0", "dependencies": { "@isaacs/fs-minipass": "^4.0.0", @@ -1383,49 +1372,56 @@ } }, "node_modules/temporal-polyfill": { - "version": "0.3.2", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/temporal-polyfill/-/temporal-polyfill-0.3.2.tgz", - "integrity": "sha1-6w9P02x36sQ9bltShRvuNkgjS4E=", + "version": "1.0.1", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/temporal-polyfill/-/temporal-polyfill-1.0.1.tgz", + "integrity": "sha1-lWd9+PpWcaeY6KqztY9FlJGIDZ8=", "license": "MIT", "dependencies": { - "temporal-spec": "0.3.1" + "temporal-spec": "1.0.0", + "temporal-utils": "1.0.1" } }, "node_modules/temporal-spec": { - "version": "0.3.1", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/temporal-spec/-/temporal-spec-0.3.1.tgz", - "integrity": "sha1-CILPKVSqxoOiSEIItfXMc2a/3RQ=", - "license": "ISC" + "version": "1.0.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/temporal-spec/-/temporal-spec-1.0.0.tgz", + "integrity": "sha1-gep3lAsAmndZ/SH0R9wPK3VHwco=", + "license": "Apache-2.0" + }, + "node_modules/temporal-utils": { + "version": "1.0.1", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/temporal-utils/-/temporal-utils-1.0.1.tgz", + "integrity": "sha1-+vJ24hZRLM0VdaRwWljXOgka64I=", + "license": "MIT" }, "node_modules/vscode-jsonrpc": { - "version": "8.2.0", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0.tgz", - "integrity": "sha1-9D36NftR52PRfNlNzKDJRY81q/k=", + "version": "9.0.1", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/vscode-jsonrpc/-/vscode-jsonrpc-9.0.1.tgz", + "integrity": "sha1-XoSKSt3wBLYzcVb3hYoAbgg4tPU=", "license": "MIT", "engines": { "node": ">=14.0.0" } }, "node_modules/vscode-languageserver": { - "version": "9.0.1", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/vscode-languageserver/-/vscode-languageserver-9.0.1.tgz", - "integrity": "sha1-UArvggl+uU35DQCGeLC2tfR0AVs=", + "version": "10.1.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/vscode-languageserver/-/vscode-languageserver-10.1.0.tgz", + "integrity": "sha1-6IB0MTmF2kpsCPrCvr1zN5ykv8U=", "license": "MIT", "dependencies": { - "vscode-languageserver-protocol": "3.17.5" + "vscode-languageserver-protocol": "3.18.2" }, "bin": { "installServerIntoExtension": "bin/installServerIntoExtension" } }, "node_modules/vscode-languageserver-protocol": { - "version": "3.17.5", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.5.tgz", - "integrity": "sha1-hkqLjzkINVcvThO9n4MT0OOsS+o=", + "version": "3.18.2", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.18.2.tgz", + "integrity": "sha1-5/s25royvHumIiV623imEmJz3cU=", "license": "MIT", "dependencies": { - "vscode-jsonrpc": "8.2.0", - "vscode-languageserver-types": "3.17.5" + "vscode-jsonrpc": "9.0.1", + "vscode-languageserver-types": "3.18.0" } }, "node_modules/vscode-languageserver-textdocument": { @@ -1435,9 +1431,9 @@ "license": "MIT" }, "node_modules/vscode-languageserver-types": { - "version": "3.17.5", - "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz", - "integrity": "sha1-MnNnbwzy6rQLP0TQhay7fwijnYo=", + "version": "3.18.0", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/vscode-languageserver-types/-/vscode-languageserver-types-3.18.0.tgz", + "integrity": "sha1-EyMhIpYEg2urcQyXSH5s2vub17s=", "license": "MIT" }, "node_modules/wrap-ansi": { diff --git a/eng/emitter-package.json b/eng/emitter-package.json index 865c11d13de3..c021d9f03165 100644 --- a/eng/emitter-package.json +++ b/eng/emitter-package.json @@ -1,22 +1,26 @@ { "main": "dist/src/index.js", "dependencies": { - "@azure-tools/typespec-java": "0.45.5" + "@azure-tools/typespec-java": "/mnt/vss/_work/1/typespec-azure/packages/typespec-java/azure-tools-typespec-java-0.45.6.tgz" }, "devDependencies": { - "@azure-tools/openai-typespec": "1.20.0", - "@azure-tools/typespec-autorest": "0.69.1", - "@azure-tools/typespec-azure-core": "0.69.0", - "@azure-tools/typespec-azure-resource-manager": "0.69.2", - "@azure-tools/typespec-azure-rulesets": "0.69.2", - "@azure-tools/typespec-client-generator-core": "0.69.2", - "@azure-tools/typespec-liftr-base": "0.14.0", - "@typespec/compiler": "1.13.0", - "@typespec/http": "1.13.0", - "@typespec/openapi": "1.13.0", - "@typespec/rest": "0.83.0", - "@typespec/versioning": "0.83.0", - "@typespec/xml": "0.83.0", - "@typespec/openapi3": "1.13.0" + "@azure-tools/typespec-autorest": "0.70.0", + "@azure-tools/typespec-azure-core": "0.70.0", + "@azure-tools/typespec-azure-resource-manager": "0.70.0", + "@azure-tools/typespec-azure-rulesets": "0.70.0", + "@azure-tools/typespec-client-generator-core": "0.70.0", + "@typespec/compiler": "1.14.0", + "@typespec/http": "1.14.0", + "@typespec/openapi": "1.14.0", + "@typespec/rest": "0.84.0", + "@typespec/versioning": "0.84.0", + "@typespec/xml": "0.84.0", + "@typespec/events": "0.84.0", + "@typespec/sse": "0.84.0", + "@typespec/streams": "0.84.0", + "@azure-tools/openai-typespec": "1.21.1", + "@azure-tools/typespec-liftr-base": "0.13.0", + "@azure-tools/typespec-azure-portal-core": "0.70.0", + "@typespec/openapi3": "1.14.0" } } \ No newline at end of file diff --git a/eng/pipelines/post-publish-emitter.yaml b/eng/pipelines/post-publish-emitter.yaml new file mode 100644 index 000000000000..8fb17913d5da --- /dev/null +++ b/eng/pipelines/post-publish-emitter.yaml @@ -0,0 +1,161 @@ +# Regenerates all TypeSpec-based SDKs in azure-sdk-for-java using the typespec-java emitter, +# then opens an automated draft PR with the results. +# +# The typespec-java emitter lives in Azure/typespec-azure (packages/typespec-java). +# Published route (EmitterVersion set): pins eng/emitter-package.json to that published +# @azure-tools/typespec-java version, then regenerates. This is the post-publish path and does +# not touch typespec-azure sources. +# Dev route (EmitterVersion is 'none'): builds the emitter dev package from source instead +# - from the typespec-azure PR or branch given by PRIdOrBranch, or from the default branch (main) +# when PRIdOrBranch is 'none'. +trigger: none +pr: none + +parameters: +# Set EmitterVersion for the default (post-publish) route. Leave it as 'none' to build the +# emitter from source, in which case PRIdOrBranch selects the typespec-azure PR / branch (or main). +- name: EmitterVersion + displayName: 'Emitter Version (e.g. 0.45.4; none = build from source)' + type: string + default: 'none' +- name: PRIdOrBranch + displayName: 'typespec-azure PR ID or branch — used only when Emitter Version is none (e.g. 43321 or my-branch; none = main)' + type: string + default: 'none' + +jobs: +- job: Generate_SDK + + timeoutInMinutes: 120 + + variables: + - template: /eng/pipelines/templates/variables/globals.yml + - template: /eng/pipelines/templates/variables/image.yml + - name: NodeVersion + value: '24.x' + # Local clone target for the (public) Azure/typespec-azure emitter repo (dev route only). + - name: TypeSpecAzureDirectory + value: $(Agent.BuildDirectory)/typespec-azure + # For the published route this is the given version. For the dev route it is overwritten at + # runtime from the built emitter's package.json (see 'Get Package Version'). + - name: PackageVersion + ${{ if ne(parameters.EmitterVersion, 'none') }}: + value: ${{ parameters.EmitterVersion }} + ${{ else }}: + value: '' + - name: PullRequestTitleSuffix + ${{ if eq(parameters.EmitterVersion, 'none') }}: + ${{ if ne(parameters.PRIdOrBranch, 'none') }}: + value: " DEV (typespec-azure ${{ parameters.PRIdOrBranch }})" + ${{ else }}: + value: " DEV (typespec-azure main)" + ${{ else }}: + value: "" + + pool: + name: $(LINUXPOOL) + image: $(LINUXVMIMAGE) + os: linux + + steps: + # azure-sdk-for-java (self) is the only repo resource, so it is checked out to + # $(Build.SourcesDirectory). Azure/typespec-azure is public, so it is cloned directly + # (below) instead of via a repository resource + GitHub service connection. + - checkout: self + + - task: NodeTool@0 + displayName: 'Install Node.js $(NodeVersion)' + inputs: + versionSpec: '$(NodeVersion)' + + - template: /eng/pipelines/templates/steps/maven-authenticate.yml + parameters: + SourceDirectory: $(Build.SourcesDirectory) + + - template: /eng/common/pipelines/templates/steps/create-authenticated-npmrc.yml + parameters: + registryUrl: https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/ + + # Clone the public Azure/typespec-azure repo (dev route only; no service connection required). + # PRIdOrBranch selects what to build the emitter from: a bare PR number is expanded to + # refs/pull//merge; any other non-'none' value is treated as a branch name (or full ref) and + # fetched as-is. When PRIdOrBranch is 'none', the emitter is built from the default branch (main). + # Submodules are then initialized because typespec-azure vendors the TypeSpec compiler and the + # http-client-java generator via the 'core' submodule, which build:generator (Build-Generator.ps1) + # and tspd both require. + - task: PowerShell@2 + displayName: 'Clone typespec-azure' + condition: and(succeeded(), eq('${{ parameters.EmitterVersion }}', 'none')) + inputs: + pwsh: true + targetType: 'inline' + script: | + git clone https://github.com/Azure/typespec-azure.git "$(TypeSpecAzureDirectory)" + $prIdOrBranch = '${{ parameters.PRIdOrBranch }}' + if ($prIdOrBranch -and $prIdOrBranch -ne 'none') { + if ($prIdOrBranch -match '^\d+$') { + # bare number -> PR merge ref + $ref = "refs/pull/$prIdOrBranch/merge" + } else { + # branch name (or full ref) + $ref = $prIdOrBranch + } + Write-Host "Fetching typespec-azure ref $ref" + git -C "$(TypeSpecAzureDirectory)" fetch origin $ref + git -C "$(TypeSpecAzureDirectory)" checkout FETCH_HEAD + } + git -C "$(TypeSpecAzureDirectory)" submodule update --init --recursive + + # Build the emitter dev package (.tgz) from the typespec-azure PR. + # typespec-java depends on other workspace packages (workspace:^). First build only those + # upstream dependencies with turbo (the `^...` filter selects dependencies but excludes + # typespec-java itself). Then Build-TypeSpec.ps1 builds and packs typespec-java (its + # build:generator step runs Build-Generator.ps1, which needs JDK 11+ and Maven), producing + # the .tgz next to the package.json for sync_emitter.py to pick up. + - task: PowerShell@2 + retryCountOnTaskFailure: 1 + condition: and(succeeded(), eq('${{ parameters.EmitterVersion }}', 'none')) + displayName: 'Build typespec-java dev package' + inputs: + pwsh: true + targetType: 'inline' + script: | + corepack enable + pnpm install + pnpm turbo run build --filter "@azure-tools/typespec-java^..." + ./packages/typespec-java/Build-TypeSpec.ps1 + workingDirectory: $(TypeSpecAzureDirectory) + + - script: | + npm install -g @azure-tools/typespec-client-generator-cli + displayName: 'Install tsp-client' + + # Dev route only: the built emitter's version drives the PR title. For the published route + # PackageVersion is already the given EmitterVersion. + - task: PowerShell@2 + displayName: 'Get Package Version' + condition: and(succeeded(), eq('${{ parameters.EmitterVersion }}', 'none')) + inputs: + pwsh: true + targetType: 'inline' + script: | + $PACKAGE_VERSION = node -p -e "require('./packages/typespec-java/package.json').version" + Write-Host("##vso[task.setvariable variable=PackageVersion]$PACKAGE_VERSION") + workingDirectory: $(TypeSpecAzureDirectory) + + - script: | + python3 ./eng/pipelines/scripts/sync_emitter.py --sdk-root=$(Build.SourcesDirectory) --emitter-version='${{ parameters.EmitterVersion }}' --package-json-path=$(TypeSpecAzureDirectory)/packages/typespec-java/package.json + displayName: 'Generate SDK' + workingDirectory: $(Build.SourcesDirectory) + + - template: /eng/common/pipelines/templates/steps/create-pull-request.yml + parameters: + WorkingDirectory: $(Build.SourcesDirectory) + ScriptDirectory: $(Build.SourcesDirectory)/eng/common/scripts + RepoName: azure-sdk-for-java + BaseBranchName: 'refs/heads/main' + PRBranchName: typespec-java-generation-$(Build.BuildId) + CommitMsg: '[Automation] Generate SDK based on TypeSpec $(PackageVersion)$(PullRequestTitleSuffix)' + PRTitle: '[Automation] Generate SDK based on TypeSpec $(PackageVersion)$(PullRequestTitleSuffix)' + PRLabels: 'DPG' + OpenAsDraft: 'true' diff --git a/eng/pipelines/scripts/patches/0001-key-certificates-impl.patch b/eng/pipelines/scripts/patches/0001-key-certificates-impl.patch new file mode 100644 index 000000000000..ea3813e85588 --- /dev/null +++ b/eng/pipelines/scripts/patches/0001-key-certificates-impl.patch @@ -0,0 +1,239 @@ +From e2df7de3f5643ff2006a8244e28ed9aa3598ecf3 Mon Sep 17 00:00:00 2001 +From: Weidong Xu +Date: Thu, 11 Jun 2026 20:39:16 +0800 +Subject: [PATCH] Revert "regen" + +This reverts commit 7ccefe36941cc38f14a52ca796167a95f263ce3f. +--- + .../models/CertificatePolicy.java | 66 ++++++++++++++----- + 1 file changed, 51 insertions(+), 15 deletions(-) + +diff --git a/sdk/keyvault/azure-security-keyvault-certificates/src/main/java/com/azure/security/keyvault/certificates/implementation/models/CertificatePolicy.java b/sdk/keyvault/azure-security-keyvault-certificates/src/main/java/com/azure/security/keyvault/certificates/implementation/models/CertificatePolicy.java +index e16ea8f5900..33d11980151 100644 +--- a/sdk/keyvault/azure-security-keyvault-certificates/src/main/java/com/azure/security/keyvault/certificates/implementation/models/CertificatePolicy.java ++++ b/sdk/keyvault/azure-security-keyvault-certificates/src/main/java/com/azure/security/keyvault/certificates/implementation/models/CertificatePolicy.java +@@ -1,6 +1,7 @@ + // Copyright (c) Microsoft Corporation. All rights reserved. + // Licensed under the MIT License. + // Code generated by Microsoft (R) TypeSpec Code Generator. ++ + package com.azure.security.keyvault.certificates.implementation.models; + + import com.azure.core.annotation.Fluent; +@@ -9,6 +10,7 @@ import com.azure.json.JsonReader; + import com.azure.json.JsonSerializable; + import com.azure.json.JsonToken; + import com.azure.json.JsonWriter; ++import com.azure.security.keyvault.certificates.models.PlatformManaged; + import java.io.IOException; + import java.util.List; + +@@ -17,7 +19,6 @@ import java.util.List; + */ + @Fluent + public final class CertificatePolicy implements JsonSerializable { +- + /* + * The certificate id. + */ +@@ -60,6 +61,12 @@ public final class CertificatePolicy implements JsonSerializable writer.writeJson(element)); + jsonWriter.writeJsonField("issuer", this.issuerParameters); + jsonWriter.writeJsonField("attributes", this.attributes); ++ jsonWriter.writeJsonField("platformManaged", this.platformManaged); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CertificatePolicy from the JsonReader. +- * ++ * + * @param jsonReader The JsonReader being read. + * @return An instance of CertificatePolicy if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. +@@ -241,6 +273,7 @@ public final class CertificatePolicy implements JsonSerializable +Date: Mon, 22 Sep 2025 15:32:34 +0800 +Subject: [PATCH] revert Impl for onlineexperimentation + +--- + .../OnlineExperimentationClientImpl.java | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +diff --git a/sdk/onlineexperimentation/azure-analytics-onlineexperimentation/src/main/java/com/azure/analytics/onlineexperimentation/implementation/OnlineExperimentationClientImpl.java b/sdk/onlineexperimentation/azure-analytics-onlineexperimentation/src/main/java/com/azure/analytics/onlineexperimentation/implementation/OnlineExperimentationClientImpl.java +index 32e6622cbc6..ed26312e71d 100644 +--- a/sdk/onlineexperimentation/azure-analytics-onlineexperimentation/src/main/java/com/azure/analytics/onlineexperimentation/implementation/OnlineExperimentationClientImpl.java ++++ b/sdk/onlineexperimentation/azure-analytics-onlineexperimentation/src/main/java/com/azure/analytics/onlineexperimentation/implementation/OnlineExperimentationClientImpl.java +@@ -233,7 +233,7 @@ public final class OnlineExperimentationClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteMetric(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("experimentMetricId") String experimentMetricId, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Delete("/experiment-metrics/{experimentMetricId}") + @ExpectedResponses({ 204 }) +@@ -243,7 +243,7 @@ public final class OnlineExperimentationClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteMetricSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("experimentMetricId") String experimentMetricId, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/experiment-metrics") + @ExpectedResponses({ 200 }) +@@ -698,8 +698,9 @@ public final class OnlineExperimentationClientImpl { + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteMetricWithResponseAsync(String experimentMetricId, + RequestOptions requestOptions) { ++ final String accept = "application/json"; + return FluxUtil.withContext(context -> service.deleteMetric(this.getEndpoint(), +- this.getServiceVersion().getVersion(), experimentMetricId, requestOptions, context)); ++ this.getServiceVersion().getVersion(), experimentMetricId, accept, requestOptions, context)); + } + + /** +@@ -730,8 +731,9 @@ public final class OnlineExperimentationClientImpl { + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteMetricWithResponse(String experimentMetricId, RequestOptions requestOptions) { ++ final String accept = "application/json"; + return service.deleteMetricSync(this.getEndpoint(), this.getServiceVersion().getVersion(), experimentMetricId, +- requestOptions, Context.NONE); ++ accept, requestOptions, Context.NONE); + } + + /** +-- +2.51.0.windows.1 + diff --git a/eng/pipelines/scripts/patches/0001-revert-azure-ai-speech-transcription.patch b/eng/pipelines/scripts/patches/0001-revert-azure-ai-speech-transcription.patch new file mode 100644 index 000000000000..926230202d80 --- /dev/null +++ b/eng/pipelines/scripts/patches/0001-revert-azure-ai-speech-transcription.patch @@ -0,0 +1,113 @@ +From bc30c29232e16f5b29af07159d6f9bac6d3bf36c Mon Sep 17 00:00:00 2001 +From: Weidong Xu +Date: Thu, 21 May 2026 11:20:39 +0800 +Subject: [PATCH] revert azure-ai-speech-transcription + +--- + .../generated/TranscribeAudioFileTests.java | 10 +++++----- + .../generated/TranscribeAudioFromURLTests.java | 10 +++++----- + .../generated/TranscribeWithEnhancedModeTests.java | 10 +++++----- + 3 files changed, 15 insertions(+), 15 deletions(-) + +diff --git a/sdk/transcription/azure-ai-speech-transcription/src/test/java/com/azure/ai/speech/transcription/generated/TranscribeAudioFileTests.java b/sdk/transcription/azure-ai-speech-transcription/src/test/java/com/azure/ai/speech/transcription/generated/TranscribeAudioFileTests.java +index a6285e1cfe2..ac8c847552a 100644 +--- a/sdk/transcription/azure-ai-speech-transcription/src/test/java/com/azure/ai/speech/transcription/generated/TranscribeAudioFileTests.java ++++ b/sdk/transcription/azure-ai-speech-transcription/src/test/java/com/azure/ai/speech/transcription/generated/TranscribeAudioFileTests.java +@@ -24,7 +24,7 @@ public final class TranscribeAudioFileTests extends TranscriptionClientTestBase + // response assertion + Assertions.assertNotNull(response); + // verify property "duration" +- Assertions.assertEquals(2000, response.getDuration()); ++ Assertions.assertEquals(2000, response.getDuration().toMillis()); + // verify property "combinedPhrases" + List responseCombinedPhrases = response.getCombinedPhrases(); + ChannelCombinedPhrases responseCombinedPhrasesFirstItem = responseCombinedPhrases.iterator().next(); +@@ -34,15 +34,15 @@ public final class TranscribeAudioFileTests extends TranscriptionClientTestBase + List responsePhrases = response.getPhrases(); + TranscribedPhrase responsePhrasesFirstItem = responsePhrases.iterator().next(); + Assertions.assertNotNull(responsePhrasesFirstItem); +- Assertions.assertEquals(40, responsePhrasesFirstItem.getOffset()); +- Assertions.assertEquals(320, responsePhrasesFirstItem.getDuration()); ++ Assertions.assertEquals(40, responsePhrasesFirstItem.getOffset().toMillis()); ++ Assertions.assertEquals(320, responsePhrasesFirstItem.getDuration().toMillis()); + Assertions.assertEquals("Weather", responsePhrasesFirstItem.getText()); + List responsePhrasesFirstItemWords = responsePhrasesFirstItem.getWords(); + TranscribedWord responsePhrasesFirstItemWordsFirstItem = responsePhrasesFirstItemWords.iterator().next(); + Assertions.assertNotNull(responsePhrasesFirstItemWordsFirstItem); + Assertions.assertEquals("weather", responsePhrasesFirstItemWordsFirstItem.getText()); +- Assertions.assertEquals(40, responsePhrasesFirstItemWordsFirstItem.getOffset()); +- Assertions.assertEquals(320, responsePhrasesFirstItemWordsFirstItem.getDuration()); ++ Assertions.assertEquals(40, responsePhrasesFirstItemWordsFirstItem.getOffset().toMillis()); ++ Assertions.assertEquals(320, responsePhrasesFirstItemWordsFirstItem.getDuration().toMillis()); + Assertions.assertEquals("en-US", responsePhrasesFirstItem.getLocale()); + Assertions.assertEquals(0.78983736, responsePhrasesFirstItem.getConfidence()); + } +diff --git a/sdk/transcription/azure-ai-speech-transcription/src/test/java/com/azure/ai/speech/transcription/generated/TranscribeAudioFromURLTests.java b/sdk/transcription/azure-ai-speech-transcription/src/test/java/com/azure/ai/speech/transcription/generated/TranscribeAudioFromURLTests.java +index c904299bcab..e431b89cc08 100644 +--- a/sdk/transcription/azure-ai-speech-transcription/src/test/java/com/azure/ai/speech/transcription/generated/TranscribeAudioFromURLTests.java ++++ b/sdk/transcription/azure-ai-speech-transcription/src/test/java/com/azure/ai/speech/transcription/generated/TranscribeAudioFromURLTests.java +@@ -24,7 +24,7 @@ public final class TranscribeAudioFromURLTests extends TranscriptionClientTestBa + // response assertion + Assertions.assertNotNull(response); + // verify property "duration" +- Assertions.assertEquals(2000, response.getDuration()); ++ Assertions.assertEquals(2000, response.getDuration().toMillis()); + // verify property "combinedPhrases" + List responseCombinedPhrases = response.getCombinedPhrases(); + ChannelCombinedPhrases responseCombinedPhrasesFirstItem = responseCombinedPhrases.iterator().next(); +@@ -34,15 +34,15 @@ public final class TranscribeAudioFromURLTests extends TranscriptionClientTestBa + List responsePhrases = response.getPhrases(); + TranscribedPhrase responsePhrasesFirstItem = responsePhrases.iterator().next(); + Assertions.assertNotNull(responsePhrasesFirstItem); +- Assertions.assertEquals(40, responsePhrasesFirstItem.getOffset()); +- Assertions.assertEquals(320, responsePhrasesFirstItem.getDuration()); ++ Assertions.assertEquals(40, responsePhrasesFirstItem.getOffset().toMillis()); ++ Assertions.assertEquals(320, responsePhrasesFirstItem.getDuration().toMillis()); + Assertions.assertEquals("Weather", responsePhrasesFirstItem.getText()); + List responsePhrasesFirstItemWords = responsePhrasesFirstItem.getWords(); + TranscribedWord responsePhrasesFirstItemWordsFirstItem = responsePhrasesFirstItemWords.iterator().next(); + Assertions.assertNotNull(responsePhrasesFirstItemWordsFirstItem); + Assertions.assertEquals("weather", responsePhrasesFirstItemWordsFirstItem.getText()); +- Assertions.assertEquals(40, responsePhrasesFirstItemWordsFirstItem.getOffset()); +- Assertions.assertEquals(320, responsePhrasesFirstItemWordsFirstItem.getDuration()); ++ Assertions.assertEquals(40, responsePhrasesFirstItemWordsFirstItem.getOffset().toMillis()); ++ Assertions.assertEquals(320, responsePhrasesFirstItemWordsFirstItem.getDuration().toMillis()); + Assertions.assertEquals("en-US", responsePhrasesFirstItem.getLocale()); + Assertions.assertEquals(0.78983736, responsePhrasesFirstItem.getConfidence()); + } +diff --git a/sdk/transcription/azure-ai-speech-transcription/src/test/java/com/azure/ai/speech/transcription/generated/TranscribeWithEnhancedModeTests.java b/sdk/transcription/azure-ai-speech-transcription/src/test/java/com/azure/ai/speech/transcription/generated/TranscribeWithEnhancedModeTests.java +index 926e39c0905..b92423bd969 100644 +--- a/sdk/transcription/azure-ai-speech-transcription/src/test/java/com/azure/ai/speech/transcription/generated/TranscribeWithEnhancedModeTests.java ++++ b/sdk/transcription/azure-ai-speech-transcription/src/test/java/com/azure/ai/speech/transcription/generated/TranscribeWithEnhancedModeTests.java +@@ -24,7 +24,7 @@ public final class TranscribeWithEnhancedModeTests extends TranscriptionClientTe + // response assertion + Assertions.assertNotNull(response); + // verify property "duration" +- Assertions.assertEquals(2000, response.getDuration()); ++ Assertions.assertEquals(2000, response.getDuration().toMillis()); + // verify property "combinedPhrases" + List responseCombinedPhrases = response.getCombinedPhrases(); + ChannelCombinedPhrases responseCombinedPhrasesFirstItem = responseCombinedPhrases.iterator().next(); +@@ -34,15 +34,15 @@ public final class TranscribeWithEnhancedModeTests extends TranscriptionClientTe + List responsePhrases = response.getPhrases(); + TranscribedPhrase responsePhrasesFirstItem = responsePhrases.iterator().next(); + Assertions.assertNotNull(responsePhrasesFirstItem); +- Assertions.assertEquals(40, responsePhrasesFirstItem.getOffset()); +- Assertions.assertEquals(320, responsePhrasesFirstItem.getDuration()); ++ Assertions.assertEquals(40, responsePhrasesFirstItem.getOffset().toMillis()); ++ Assertions.assertEquals(320, responsePhrasesFirstItem.getDuration().toMillis()); + Assertions.assertEquals("天气", responsePhrasesFirstItem.getText()); + List responsePhrasesFirstItemWords = responsePhrasesFirstItem.getWords(); + TranscribedWord responsePhrasesFirstItemWordsFirstItem = responsePhrasesFirstItemWords.iterator().next(); + Assertions.assertNotNull(responsePhrasesFirstItemWordsFirstItem); + Assertions.assertEquals("天", responsePhrasesFirstItemWordsFirstItem.getText()); +- Assertions.assertEquals(0, responsePhrasesFirstItemWordsFirstItem.getOffset()); +- Assertions.assertEquals(0, responsePhrasesFirstItemWordsFirstItem.getDuration()); ++ Assertions.assertEquals(0, responsePhrasesFirstItemWordsFirstItem.getOffset().toMillis()); ++ Assertions.assertEquals(0, responsePhrasesFirstItemWordsFirstItem.getDuration().toMillis()); + Assertions.assertEquals("zh-CN", responsePhrasesFirstItem.getLocale()); + Assertions.assertEquals(0.78983736, responsePhrasesFirstItem.getConfidence()); + } +-- +2.53.0.windows.2 + diff --git a/eng/pipelines/scripts/patches/0001-revert-impl-in-communication.patch b/eng/pipelines/scripts/patches/0001-revert-impl-in-communication.patch new file mode 100644 index 000000000000..767d5d08bb4d --- /dev/null +++ b/eng/pipelines/scripts/patches/0001-revert-impl-in-communication.patch @@ -0,0 +1,268 @@ +From 46e470e80eeb94ef3da2346bce9e6368792ad4ae Mon Sep 17 00:00:00 2001 +From: Weidong Xu +Date: Thu, 7 Aug 2025 14:13:06 +0800 +Subject: [PATCH] revert impl in communication + +--- + .../JobRouterAdministrationClientImpl.java | 48 +++++++++++-------- + .../implementation/JobRouterClientImpl.java | 22 +++++---- + 2 files changed, 41 insertions(+), 29 deletions(-) + +diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/JobRouterAdministrationClientImpl.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/JobRouterAdministrationClientImpl.java +index 78b69849b85..3a598fb5a4e 100644 +--- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/JobRouterAdministrationClientImpl.java ++++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/JobRouterAdministrationClientImpl.java +@@ -234,8 +234,8 @@ public final class JobRouterAdministrationClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteDistributionPolicy(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, +- @PathParam("distributionPolicyId") String distributionPolicyId, RequestOptions requestOptions, +- Context context); ++ @PathParam("distributionPolicyId") String distributionPolicyId, @HeaderParam("Accept") String accept, ++ RequestOptions requestOptions, Context context); + + @Delete("/routing/distributionPolicies/{distributionPolicyId}") + @ExpectedResponses({ 204 }) +@@ -245,8 +245,8 @@ public final class JobRouterAdministrationClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteDistributionPolicySync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, +- @PathParam("distributionPolicyId") String distributionPolicyId, RequestOptions requestOptions, +- Context context); ++ @PathParam("distributionPolicyId") String distributionPolicyId, @HeaderParam("Accept") String accept, ++ RequestOptions requestOptions, Context context); + + @Patch("/routing/classificationPolicies/{classificationPolicyId}") + @ExpectedResponses({ 200, 201 }) +@@ -324,8 +324,8 @@ public final class JobRouterAdministrationClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteClassificationPolicy(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, +- @PathParam("classificationPolicyId") String classificationPolicyId, RequestOptions requestOptions, +- Context context); ++ @PathParam("classificationPolicyId") String classificationPolicyId, @HeaderParam("Accept") String accept, ++ RequestOptions requestOptions, Context context); + + @Delete("/routing/classificationPolicies/{classificationPolicyId}") + @ExpectedResponses({ 204 }) +@@ -335,8 +335,8 @@ public final class JobRouterAdministrationClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteClassificationPolicySync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, +- @PathParam("classificationPolicyId") String classificationPolicyId, RequestOptions requestOptions, +- Context context); ++ @PathParam("classificationPolicyId") String classificationPolicyId, @HeaderParam("Accept") String accept, ++ RequestOptions requestOptions, Context context); + + @Patch("/routing/exceptionPolicies/{exceptionPolicyId}") + @ExpectedResponses({ 200, 201 }) +@@ -410,7 +410,7 @@ public final class JobRouterAdministrationClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteExceptionPolicy(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("exceptionPolicyId") String exceptionPolicyId, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Delete("/routing/exceptionPolicies/{exceptionPolicyId}") + @ExpectedResponses({ 204 }) +@@ -420,7 +420,7 @@ public final class JobRouterAdministrationClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteExceptionPolicySync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("exceptionPolicyId") String exceptionPolicyId, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Patch("/routing/queues/{queueId}") + @ExpectedResponses({ 200, 201 }) +@@ -494,7 +494,7 @@ public final class JobRouterAdministrationClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteQueue(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("queueId") String queueId, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Delete("/routing/queues/{queueId}") + @ExpectedResponses({ 204 }) +@@ -504,7 +504,7 @@ public final class JobRouterAdministrationClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteQueueSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("queueId") String queueId, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) +@@ -1032,8 +1032,9 @@ public final class JobRouterAdministrationClientImpl { + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteDistributionPolicyWithResponseAsync(String distributionPolicyId, + RequestOptions requestOptions) { ++ final String accept = "application/json"; + return FluxUtil.withContext(context -> service.deleteDistributionPolicy(this.getEndpoint(), +- this.getServiceVersion().getVersion(), distributionPolicyId, requestOptions, context)); ++ this.getServiceVersion().getVersion(), distributionPolicyId, accept, requestOptions, context)); + } + + /** +@@ -1050,8 +1051,9 @@ public final class JobRouterAdministrationClientImpl { + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteDistributionPolicyWithResponse(String distributionPolicyId, + RequestOptions requestOptions) { ++ final String accept = "application/json"; + return service.deleteDistributionPolicySync(this.getEndpoint(), this.getServiceVersion().getVersion(), +- distributionPolicyId, requestOptions, Context.NONE); ++ distributionPolicyId, accept, requestOptions, Context.NONE); + } + + /** +@@ -1569,8 +1571,9 @@ public final class JobRouterAdministrationClientImpl { + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteClassificationPolicyWithResponseAsync(String classificationPolicyId, + RequestOptions requestOptions) { ++ final String accept = "application/json"; + return FluxUtil.withContext(context -> service.deleteClassificationPolicy(this.getEndpoint(), +- this.getServiceVersion().getVersion(), classificationPolicyId, requestOptions, context)); ++ this.getServiceVersion().getVersion(), classificationPolicyId, accept, requestOptions, context)); + } + + /** +@@ -1587,8 +1590,9 @@ public final class JobRouterAdministrationClientImpl { + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteClassificationPolicyWithResponse(String classificationPolicyId, + RequestOptions requestOptions) { ++ final String accept = "application/json"; + return service.deleteClassificationPolicySync(this.getEndpoint(), this.getServiceVersion().getVersion(), +- classificationPolicyId, requestOptions, Context.NONE); ++ classificationPolicyId, accept, requestOptions, Context.NONE); + } + + /** +@@ -2106,8 +2110,9 @@ public final class JobRouterAdministrationClientImpl { + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteExceptionPolicyWithResponseAsync(String exceptionPolicyId, + RequestOptions requestOptions) { ++ final String accept = "application/json"; + return FluxUtil.withContext(context -> service.deleteExceptionPolicy(this.getEndpoint(), +- this.getServiceVersion().getVersion(), exceptionPolicyId, requestOptions, context)); ++ this.getServiceVersion().getVersion(), exceptionPolicyId, accept, requestOptions, context)); + } + + /** +@@ -2123,8 +2128,9 @@ public final class JobRouterAdministrationClientImpl { + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteExceptionPolicyWithResponse(String exceptionPolicyId, RequestOptions requestOptions) { ++ final String accept = "application/json"; + return service.deleteExceptionPolicySync(this.getEndpoint(), this.getServiceVersion().getVersion(), +- exceptionPolicyId, requestOptions, Context.NONE); ++ exceptionPolicyId, accept, requestOptions, Context.NONE); + } + + /** +@@ -2548,8 +2554,9 @@ public final class JobRouterAdministrationClientImpl { + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteQueueWithResponseAsync(String queueId, RequestOptions requestOptions) { ++ final String accept = "application/json"; + return FluxUtil.withContext(context -> service.deleteQueue(this.getEndpoint(), +- this.getServiceVersion().getVersion(), queueId, requestOptions, context)); ++ this.getServiceVersion().getVersion(), queueId, accept, requestOptions, context)); + } + + /** +@@ -2565,7 +2572,8 @@ public final class JobRouterAdministrationClientImpl { + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteQueueWithResponse(String queueId, RequestOptions requestOptions) { +- return service.deleteQueueSync(this.getEndpoint(), this.getServiceVersion().getVersion(), queueId, ++ final String accept = "application/json"; ++ return service.deleteQueueSync(this.getEndpoint(), this.getServiceVersion().getVersion(), queueId, accept, + requestOptions, Context.NONE); + } + +diff --git a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/JobRouterClientImpl.java b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/JobRouterClientImpl.java +index 1ab1634dd63..e0d6dc7f6e7 100644 +--- a/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/JobRouterClientImpl.java ++++ b/sdk/communication/azure-communication-jobrouter/src/main/java/com/azure/communication/jobrouter/implementation/JobRouterClientImpl.java +@@ -210,7 +210,7 @@ public final class JobRouterClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteJob(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Delete("/routing/jobs/{jobId}") + @ExpectedResponses({ 204 }) +@@ -220,7 +220,7 @@ public final class JobRouterClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteJobSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("jobId") String jobId, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/routing/jobs/{jobId}:reclassify") + @ExpectedResponses({ 200 }) +@@ -484,7 +484,7 @@ public final class JobRouterClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteWorker(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("workerId") String workerId, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Delete("/routing/workers/{workerId}") + @ExpectedResponses({ 204 }) +@@ -494,7 +494,7 @@ public final class JobRouterClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteWorkerSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("workerId") String workerId, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/routing/workers") + @ExpectedResponses({ 200 }) +@@ -1012,8 +1012,9 @@ public final class JobRouterClientImpl { + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteJobWithResponseAsync(String jobId, RequestOptions requestOptions) { ++ final String accept = "application/json"; + return FluxUtil.withContext(context -> service.deleteJob(this.getEndpoint(), +- this.getServiceVersion().getVersion(), jobId, requestOptions, context)); ++ this.getServiceVersion().getVersion(), jobId, accept, requestOptions, context)); + } + + /** +@@ -1029,8 +1030,9 @@ public final class JobRouterClientImpl { + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteJobWithResponse(String jobId, RequestOptions requestOptions) { +- return service.deleteJobSync(this.getEndpoint(), this.getServiceVersion().getVersion(), jobId, requestOptions, +- Context.NONE); ++ final String accept = "application/json"; ++ return service.deleteJobSync(this.getEndpoint(), this.getServiceVersion().getVersion(), jobId, accept, ++ requestOptions, Context.NONE); + } + + /** +@@ -2671,8 +2673,9 @@ public final class JobRouterClientImpl { + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteWorkerWithResponseAsync(String workerId, RequestOptions requestOptions) { ++ final String accept = "application/json"; + return FluxUtil.withContext(context -> service.deleteWorker(this.getEndpoint(), +- this.getServiceVersion().getVersion(), workerId, requestOptions, context)); ++ this.getServiceVersion().getVersion(), workerId, accept, requestOptions, context)); + } + + /** +@@ -2688,7 +2691,8 @@ public final class JobRouterClientImpl { + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWorkerWithResponse(String workerId, RequestOptions requestOptions) { +- return service.deleteWorkerSync(this.getEndpoint(), this.getServiceVersion().getVersion(), workerId, ++ final String accept = "application/json"; ++ return service.deleteWorkerSync(this.getEndpoint(), this.getServiceVersion().getVersion(), workerId, accept, + requestOptions, Context.NONE); + } + +-- +2.50.1.windows.1 + diff --git a/eng/pipelines/scripts/patches/0001-revert-impl-in-contentsafety.patch b/eng/pipelines/scripts/patches/0001-revert-impl-in-contentsafety.patch new file mode 100644 index 000000000000..9bace5b40da0 --- /dev/null +++ b/eng/pipelines/scripts/patches/0001-revert-impl-in-contentsafety.patch @@ -0,0 +1,99 @@ +From 1185f9ded7e644d6b64c955c2faa9422765eea24 Mon Sep 17 00:00:00 2001 +From: Weidong Xu +Date: Thu, 7 Aug 2025 14:28:55 +0800 +Subject: [PATCH] revert impl in contentsafety + +--- + .../implementation/BlocklistClientImpl.java | 24 +++++++++++-------- + 1 file changed, 14 insertions(+), 10 deletions(-) + +diff --git a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/implementation/BlocklistClientImpl.java b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/implementation/BlocklistClientImpl.java +index e7e96b52ccf..727d27c5547 100644 +--- a/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/implementation/BlocklistClientImpl.java ++++ b/sdk/contentsafety/azure-ai-contentsafety/src/main/java/com/azure/ai/contentsafety/implementation/BlocklistClientImpl.java +@@ -216,7 +216,7 @@ public final class BlocklistClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteTextBlocklist(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("blocklistName") String name, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Delete("/text/blocklists/{blocklistName}") + @ExpectedResponses({ 204 }) +@@ -226,7 +226,7 @@ public final class BlocklistClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteTextBlocklistSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("blocklistName") String name, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/text/blocklists/{blocklistName}") + @ExpectedResponses({ 200 }) +@@ -318,8 +318,8 @@ public final class BlocklistClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> removeBlocklistItems(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("blocklistName") String name, +- @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData options, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, ++ @BodyParam("application/json") BinaryData options, RequestOptions requestOptions, Context context); + + @Post("/text/blocklists/{blocklistName}:removeBlocklistItems") + @ExpectedResponses({ 204 }) +@@ -329,8 +329,8 @@ public final class BlocklistClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response removeBlocklistItemsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("blocklistName") String name, +- @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData options, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, ++ @BodyParam("application/json") BinaryData options, RequestOptions requestOptions, Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) +@@ -587,8 +587,9 @@ public final class BlocklistClientImpl { + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteTextBlocklistWithResponseAsync(String name, RequestOptions requestOptions) { ++ final String accept = "application/json"; + return FluxUtil.withContext(context -> service.deleteTextBlocklist(this.getEndpoint(), +- this.getServiceVersion().getVersion(), name, requestOptions, context)); ++ this.getServiceVersion().getVersion(), name, accept, requestOptions, context)); + } + + /** +@@ -606,7 +607,8 @@ public final class BlocklistClientImpl { + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteTextBlocklistWithResponse(String name, RequestOptions requestOptions) { +- return service.deleteTextBlocklistSync(this.getEndpoint(), this.getServiceVersion().getVersion(), name, ++ final String accept = "application/json"; ++ return service.deleteTextBlocklistSync(this.getEndpoint(), this.getServiceVersion().getVersion(), name, accept, + requestOptions, Context.NONE); + } + +@@ -1126,8 +1128,9 @@ public final class BlocklistClientImpl { + public Mono> removeBlocklistItemsWithResponseAsync(String name, BinaryData options, + RequestOptions requestOptions) { + final String contentType = "application/json"; ++ final String accept = "application/json"; + return FluxUtil.withContext(context -> service.removeBlocklistItems(this.getEndpoint(), +- this.getServiceVersion().getVersion(), name, contentType, options, requestOptions, context)); ++ this.getServiceVersion().getVersion(), name, contentType, accept, options, requestOptions, context)); + } + + /** +@@ -1159,8 +1162,9 @@ public final class BlocklistClientImpl { + public Response removeBlocklistItemsWithResponse(String name, BinaryData options, + RequestOptions requestOptions) { + final String contentType = "application/json"; ++ final String accept = "application/json"; + return service.removeBlocklistItemsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), name, +- contentType, options, requestOptions, Context.NONE); ++ contentType, accept, options, requestOptions, Context.NONE); + } + + /** +-- +2.50.1.windows.1 + diff --git a/eng/pipelines/scripts/patches/0001-revert-impl-in-documentintelligence.patch b/eng/pipelines/scripts/patches/0001-revert-impl-in-documentintelligence.patch new file mode 100644 index 000000000000..a43942ea8dee --- /dev/null +++ b/eng/pipelines/scripts/patches/0001-revert-impl-in-documentintelligence.patch @@ -0,0 +1,534 @@ +From 3efa4c0cb7a78e09ff941b751092948faa74e70a Mon Sep 17 00:00:00 2001 +From: Weidong Xu +Date: Thu, 7 Aug 2025 12:28:19 +0800 +Subject: [PATCH] revert impl in documentintelligence + +--- + ...tIntelligenceAdministrationClientImpl.java | 90 ++++++++++++------- + .../DocumentIntelligenceClientImpl.java | 68 ++++++++------ + 2 files changed, 98 insertions(+), 60 deletions(-) + +diff --git a/sdk/documentintelligence/azure-ai-documentintelligence/src/main/java/com/azure/ai/documentintelligence/implementation/DocumentIntelligenceAdministrationClientImpl.java b/sdk/documentintelligence/azure-ai-documentintelligence/src/main/java/com/azure/ai/documentintelligence/implementation/DocumentIntelligenceAdministrationClientImpl.java +index edb1f567ca1..54d0a403774 100644 +--- a/sdk/documentintelligence/azure-ai-documentintelligence/src/main/java/com/azure/ai/documentintelligence/implementation/DocumentIntelligenceAdministrationClientImpl.java ++++ b/sdk/documentintelligence/azure-ai-documentintelligence/src/main/java/com/azure/ai/documentintelligence/implementation/DocumentIntelligenceAdministrationClientImpl.java +@@ -178,7 +178,8 @@ public final class DocumentIntelligenceAdministrationClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> buildDocumentModel(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, +- @BodyParam("application/json") BinaryData buildRequest, RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData buildRequest, ++ RequestOptions requestOptions, Context context); + + @Post("/documentModels:build") + @ExpectedResponses({ 202 }) +@@ -188,7 +189,8 @@ public final class DocumentIntelligenceAdministrationClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response buildDocumentModelSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, +- @BodyParam("application/json") BinaryData buildRequest, RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData buildRequest, ++ RequestOptions requestOptions, Context context); + + @Post("/documentModels:compose") + @ExpectedResponses({ 202 }) +@@ -198,7 +200,8 @@ public final class DocumentIntelligenceAdministrationClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> composeModel(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, +- @BodyParam("application/json") BinaryData composeRequest, RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData composeRequest, ++ RequestOptions requestOptions, Context context); + + @Post("/documentModels:compose") + @ExpectedResponses({ 202 }) +@@ -208,7 +211,8 @@ public final class DocumentIntelligenceAdministrationClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response composeModelSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, +- @BodyParam("application/json") BinaryData composeRequest, RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData composeRequest, ++ RequestOptions requestOptions, Context context); + + @Post("/documentModels:authorizeCopy") + @ExpectedResponses({ 200 }) +@@ -240,8 +244,8 @@ public final class DocumentIntelligenceAdministrationClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> copyModelTo(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("modelId") String modelId, +- @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData copyToRequest, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, ++ @BodyParam("application/json") BinaryData copyToRequest, RequestOptions requestOptions, Context context); + + @Post("/documentModels/{modelId}:copyTo") + @ExpectedResponses({ 202 }) +@@ -251,8 +255,8 @@ public final class DocumentIntelligenceAdministrationClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response copyModelToSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("modelId") String modelId, +- @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData copyToRequest, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, ++ @BodyParam("application/json") BinaryData copyToRequest, RequestOptions requestOptions, Context context); + + @Get("/documentModels/{modelId}") + @ExpectedResponses({ 200 }) +@@ -302,7 +306,7 @@ public final class DocumentIntelligenceAdministrationClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteModel(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("modelId") String modelId, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Delete("/documentModels/{modelId}") + @ExpectedResponses({ 204 }) +@@ -312,7 +316,7 @@ public final class DocumentIntelligenceAdministrationClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteModelSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("modelId") String modelId, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/info") + @ExpectedResponses({ 200 }) +@@ -382,7 +386,8 @@ public final class DocumentIntelligenceAdministrationClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> buildClassifier(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, +- @BodyParam("application/json") BinaryData buildRequest, RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData buildRequest, ++ RequestOptions requestOptions, Context context); + + @Post("/documentClassifiers:build") + @ExpectedResponses({ 202 }) +@@ -392,7 +397,8 @@ public final class DocumentIntelligenceAdministrationClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response buildClassifierSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, +- @BodyParam("application/json") BinaryData buildRequest, RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData buildRequest, ++ RequestOptions requestOptions, Context context); + + @Post("/documentClassifiers:authorizeCopy") + @ExpectedResponses({ 200 }) +@@ -424,8 +430,8 @@ public final class DocumentIntelligenceAdministrationClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> copyClassifierTo(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("classifierId") String classifierId, +- @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData copyToRequest, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, ++ @BodyParam("application/json") BinaryData copyToRequest, RequestOptions requestOptions, Context context); + + @Post("/documentClassifiers/{classifierId}:copyTo") + @ExpectedResponses({ 202 }) +@@ -435,8 +441,8 @@ public final class DocumentIntelligenceAdministrationClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response copyClassifierToSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("classifierId") String classifierId, +- @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData copyToRequest, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, ++ @BodyParam("application/json") BinaryData copyToRequest, RequestOptions requestOptions, Context context); + + @Get("/documentClassifiers/{classifierId}") + @ExpectedResponses({ 200 }) +@@ -486,7 +492,7 @@ public final class DocumentIntelligenceAdministrationClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteClassifier(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("classifierId") String classifierId, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Delete("/documentClassifiers/{classifierId}") + @ExpectedResponses({ 204 }) +@@ -496,7 +502,7 @@ public final class DocumentIntelligenceAdministrationClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteClassifierSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("classifierId") String classifierId, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) +@@ -598,8 +604,9 @@ public final class DocumentIntelligenceAdministrationClientImpl { + private Mono> buildDocumentModelWithResponseAsync(BinaryData buildRequest, + RequestOptions requestOptions) { + final String contentType = "application/json"; ++ final String accept = "application/json"; + return FluxUtil.withContext(context -> service.buildDocumentModel(this.getEndpoint(), +- this.getServiceVersion().getVersion(), contentType, buildRequest, requestOptions, context)); ++ this.getServiceVersion().getVersion(), contentType, accept, buildRequest, requestOptions, context)); + } + + /** +@@ -640,8 +647,9 @@ public final class DocumentIntelligenceAdministrationClientImpl { + @ServiceMethod(returns = ReturnType.SINGLE) + private Response buildDocumentModelWithResponse(BinaryData buildRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; ++ final String accept = "application/json"; + return service.buildDocumentModelSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType, +- buildRequest, requestOptions, Context.NONE); ++ accept, buildRequest, requestOptions, Context.NONE); + } + + /** +@@ -909,8 +917,9 @@ public final class DocumentIntelligenceAdministrationClientImpl { + private Mono> composeModelWithResponseAsync(BinaryData composeRequest, + RequestOptions requestOptions) { + final String contentType = "application/json"; ++ final String accept = "application/json"; + return FluxUtil.withContext(context -> service.composeModel(this.getEndpoint(), +- this.getServiceVersion().getVersion(), contentType, composeRequest, requestOptions, context)); ++ this.getServiceVersion().getVersion(), contentType, accept, composeRequest, requestOptions, context)); + } + + /** +@@ -971,7 +980,8 @@ public final class DocumentIntelligenceAdministrationClientImpl { + @ServiceMethod(returns = ReturnType.SINGLE) + private Response composeModelWithResponse(BinaryData composeRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; +- return service.composeModelSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType, ++ final String accept = "application/json"; ++ return service.composeModelSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType, accept, + composeRequest, requestOptions, Context.NONE); + } + +@@ -1391,8 +1401,10 @@ public final class DocumentIntelligenceAdministrationClientImpl { + private Mono> copyModelToWithResponseAsync(String modelId, BinaryData copyToRequest, + RequestOptions requestOptions) { + final String contentType = "application/json"; +- return FluxUtil.withContext(context -> service.copyModelTo(this.getEndpoint(), +- this.getServiceVersion().getVersion(), modelId, contentType, copyToRequest, requestOptions, context)); ++ final String accept = "application/json"; ++ return FluxUtil ++ .withContext(context -> service.copyModelTo(this.getEndpoint(), this.getServiceVersion().getVersion(), ++ modelId, contentType, accept, copyToRequest, requestOptions, context)); + } + + /** +@@ -1425,8 +1437,9 @@ public final class DocumentIntelligenceAdministrationClientImpl { + private Response copyModelToWithResponse(String modelId, BinaryData copyToRequest, + RequestOptions requestOptions) { + final String contentType = "application/json"; ++ final String accept = "application/json"; + return service.copyModelToSync(this.getEndpoint(), this.getServiceVersion().getVersion(), modelId, contentType, +- copyToRequest, requestOptions, Context.NONE); ++ accept, copyToRequest, requestOptions, Context.NONE); + } + + /** +@@ -2116,8 +2129,9 @@ public final class DocumentIntelligenceAdministrationClientImpl { + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteModelWithResponseAsync(String modelId, RequestOptions requestOptions) { ++ final String accept = "application/json"; + return FluxUtil.withContext(context -> service.deleteModel(this.getEndpoint(), +- this.getServiceVersion().getVersion(), modelId, requestOptions, context)); ++ this.getServiceVersion().getVersion(), modelId, accept, requestOptions, context)); + } + + /** +@@ -2133,7 +2147,8 @@ public final class DocumentIntelligenceAdministrationClientImpl { + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteModelWithResponse(String modelId, RequestOptions requestOptions) { +- return service.deleteModelSync(this.getEndpoint(), this.getServiceVersion().getVersion(), modelId, ++ final String accept = "application/json"; ++ return service.deleteModelSync(this.getEndpoint(), this.getServiceVersion().getVersion(), modelId, accept, + requestOptions, Context.NONE); + } + +@@ -2544,8 +2559,9 @@ public final class DocumentIntelligenceAdministrationClientImpl { + private Mono> buildClassifierWithResponseAsync(BinaryData buildRequest, + RequestOptions requestOptions) { + final String contentType = "application/json"; ++ final String accept = "application/json"; + return FluxUtil.withContext(context -> service.buildClassifier(this.getEndpoint(), +- this.getServiceVersion().getVersion(), contentType, buildRequest, requestOptions, context)); ++ this.getServiceVersion().getVersion(), contentType, accept, buildRequest, requestOptions, context)); + } + + /** +@@ -2587,8 +2603,9 @@ public final class DocumentIntelligenceAdministrationClientImpl { + @ServiceMethod(returns = ReturnType.SINGLE) + private Response buildClassifierWithResponse(BinaryData buildRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; ++ final String accept = "application/json"; + return service.buildClassifierSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType, +- buildRequest, requestOptions, Context.NONE); ++ accept, buildRequest, requestOptions, Context.NONE); + } + + /** +@@ -2931,8 +2948,10 @@ public final class DocumentIntelligenceAdministrationClientImpl { + private Mono> copyClassifierToWithResponseAsync(String classifierId, BinaryData copyToRequest, + RequestOptions requestOptions) { + final String contentType = "application/json"; +- return FluxUtil.withContext(context -> service.copyClassifierTo(this.getEndpoint(), +- this.getServiceVersion().getVersion(), classifierId, contentType, copyToRequest, requestOptions, context)); ++ final String accept = "application/json"; ++ return FluxUtil ++ .withContext(context -> service.copyClassifierTo(this.getEndpoint(), this.getServiceVersion().getVersion(), ++ classifierId, contentType, accept, copyToRequest, requestOptions, context)); + } + + /** +@@ -2965,8 +2984,9 @@ public final class DocumentIntelligenceAdministrationClientImpl { + private Response copyClassifierToWithResponse(String classifierId, BinaryData copyToRequest, + RequestOptions requestOptions) { + final String contentType = "application/json"; ++ final String accept = "application/json"; + return service.copyClassifierToSync(this.getEndpoint(), this.getServiceVersion().getVersion(), classifierId, +- contentType, copyToRequest, requestOptions, Context.NONE); ++ contentType, accept, copyToRequest, requestOptions, Context.NONE); + } + + /** +@@ -3479,8 +3499,9 @@ public final class DocumentIntelligenceAdministrationClientImpl { + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteClassifierWithResponseAsync(String classifierId, RequestOptions requestOptions) { ++ final String accept = "application/json"; + return FluxUtil.withContext(context -> service.deleteClassifier(this.getEndpoint(), +- this.getServiceVersion().getVersion(), classifierId, requestOptions, context)); ++ this.getServiceVersion().getVersion(), classifierId, accept, requestOptions, context)); + } + + /** +@@ -3496,8 +3517,9 @@ public final class DocumentIntelligenceAdministrationClientImpl { + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteClassifierWithResponse(String classifierId, RequestOptions requestOptions) { ++ final String accept = "application/json"; + return service.deleteClassifierSync(this.getEndpoint(), this.getServiceVersion().getVersion(), classifierId, +- requestOptions, Context.NONE); ++ accept, requestOptions, Context.NONE); + } + + /** +diff --git a/sdk/documentintelligence/azure-ai-documentintelligence/src/main/java/com/azure/ai/documentintelligence/implementation/DocumentIntelligenceClientImpl.java b/sdk/documentintelligence/azure-ai-documentintelligence/src/main/java/com/azure/ai/documentintelligence/implementation/DocumentIntelligenceClientImpl.java +index 35d46b5d152..f1ad7faf330 100644 +--- a/sdk/documentintelligence/azure-ai-documentintelligence/src/main/java/com/azure/ai/documentintelligence/implementation/DocumentIntelligenceClientImpl.java ++++ b/sdk/documentintelligence/azure-ai-documentintelligence/src/main/java/com/azure/ai/documentintelligence/implementation/DocumentIntelligenceClientImpl.java +@@ -174,8 +174,8 @@ public final class DocumentIntelligenceClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> analyzeDocument(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("modelId") String modelId, +- @HeaderParam("content-type") String contentType, @BodyParam("application/json") BinaryData analyzeRequest, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, ++ @BodyParam("application/json") BinaryData analyzeRequest, RequestOptions requestOptions, Context context); + + @Post("/documentModels/{modelId}:analyze") + @ExpectedResponses({ 202 }) +@@ -185,8 +185,8 @@ public final class DocumentIntelligenceClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response analyzeDocumentSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("modelId") String modelId, +- @HeaderParam("content-type") String contentType, @BodyParam("application/json") BinaryData analyzeRequest, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, ++ @BodyParam("application/json") BinaryData analyzeRequest, RequestOptions requestOptions, Context context); + + @Get("/documentModels/{modelId}/analyzeResults/{resultId}/pdf") + @ExpectedResponses({ 200 }) +@@ -240,7 +240,8 @@ public final class DocumentIntelligenceClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteAnalyzeResult(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("modelId") String modelId, +- @PathParam("resultId") String resultId, RequestOptions requestOptions, Context context); ++ @PathParam("resultId") String resultId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, ++ Context context); + + @Delete("/documentModels/{modelId}/analyzeResults/{resultId}") + @ExpectedResponses({ 204 }) +@@ -250,7 +251,8 @@ public final class DocumentIntelligenceClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteAnalyzeResultSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("modelId") String modelId, +- @PathParam("resultId") String resultId, RequestOptions requestOptions, Context context); ++ @PathParam("resultId") String resultId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, ++ Context context); + + @Post("/documentModels/{modelId}:analyzeBatch") + @ExpectedResponses({ 202 }) +@@ -260,7 +262,7 @@ public final class DocumentIntelligenceClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> analyzeBatchDocuments(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("modelId") String modelId, +- @HeaderParam("content-type") String contentType, ++ @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData analyzeBatchRequest, RequestOptions requestOptions, + Context context); + +@@ -272,7 +274,7 @@ public final class DocumentIntelligenceClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response analyzeBatchDocumentsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("modelId") String modelId, +- @HeaderParam("content-type") String contentType, ++ @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData analyzeBatchRequest, RequestOptions requestOptions, + Context context); + +@@ -304,7 +306,8 @@ public final class DocumentIntelligenceClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteAnalyzeBatchResult(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("modelId") String modelId, +- @PathParam("resultId") String resultId, RequestOptions requestOptions, Context context); ++ @PathParam("resultId") String resultId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, ++ Context context); + + @Delete("/documentModels/{modelId}/analyzeBatchResults/{resultId}") + @ExpectedResponses({ 204 }) +@@ -314,7 +317,8 @@ public final class DocumentIntelligenceClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteAnalyzeBatchResultSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("modelId") String modelId, +- @PathParam("resultId") String resultId, RequestOptions requestOptions, Context context); ++ @PathParam("resultId") String resultId, @HeaderParam("Accept") String accept, RequestOptions requestOptions, ++ Context context); + + @Get("/documentModels/{modelId}/analyzeBatchResults/{resultId}") + @ExpectedResponses({ 200 }) +@@ -346,8 +350,8 @@ public final class DocumentIntelligenceClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> classifyDocument(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("classifierId") String classifierId, +- @HeaderParam("content-type") String contentType, @BodyParam("application/json") BinaryData classifyRequest, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, ++ @BodyParam("application/json") BinaryData classifyRequest, RequestOptions requestOptions, Context context); + + @Post("/documentClassifiers/{classifierId}:analyze") + @ExpectedResponses({ 202 }) +@@ -357,8 +361,8 @@ public final class DocumentIntelligenceClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response classifyDocumentSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("classifierId") String classifierId, +- @HeaderParam("content-type") String contentType, @BodyParam("application/json") BinaryData classifyRequest, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept, ++ @BodyParam("application/json") BinaryData classifyRequest, RequestOptions requestOptions, Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) +@@ -427,8 +431,10 @@ public final class DocumentIntelligenceClientImpl { + private Mono> analyzeDocumentWithResponseAsync(String modelId, BinaryData analyzeRequest, + RequestOptions requestOptions) { + final String contentType = "application/json"; +- return FluxUtil.withContext(context -> service.analyzeDocument(this.getEndpoint(), +- this.getServiceVersion().getVersion(), modelId, contentType, analyzeRequest, requestOptions, context)); ++ final String accept = "application/json"; ++ return FluxUtil ++ .withContext(context -> service.analyzeDocument(this.getEndpoint(), this.getServiceVersion().getVersion(), ++ modelId, contentType, accept, analyzeRequest, requestOptions, context)); + } + + /** +@@ -477,8 +483,9 @@ public final class DocumentIntelligenceClientImpl { + private Response analyzeDocumentWithResponse(String modelId, BinaryData analyzeRequest, + RequestOptions requestOptions) { + final String contentType = "application/json"; ++ final String accept = "application/json"; + return service.analyzeDocumentSync(this.getEndpoint(), this.getServiceVersion().getVersion(), modelId, +- contentType, analyzeRequest, requestOptions, Context.NONE); ++ contentType, accept, analyzeRequest, requestOptions, Context.NONE); + } + + /** +@@ -842,8 +849,9 @@ public final class DocumentIntelligenceClientImpl { + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteAnalyzeResultWithResponseAsync(String modelId, String resultId, + RequestOptions requestOptions) { ++ final String accept = "application/json"; + return FluxUtil.withContext(context -> service.deleteAnalyzeResult(this.getEndpoint(), +- this.getServiceVersion().getVersion(), modelId, resultId, requestOptions, context)); ++ this.getServiceVersion().getVersion(), modelId, resultId, accept, requestOptions, context)); + } + + /** +@@ -861,8 +869,9 @@ public final class DocumentIntelligenceClientImpl { + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteAnalyzeResultWithResponse(String modelId, String resultId, + RequestOptions requestOptions) { ++ final String accept = "application/json"; + return service.deleteAnalyzeResultSync(this.getEndpoint(), this.getServiceVersion().getVersion(), modelId, +- resultId, requestOptions, Context.NONE); ++ resultId, accept, requestOptions, Context.NONE); + } + + /** +@@ -920,8 +929,10 @@ public final class DocumentIntelligenceClientImpl { + private Mono> analyzeBatchDocumentsWithResponseAsync(String modelId, BinaryData analyzeBatchRequest, + RequestOptions requestOptions) { + final String contentType = "application/json"; +- return FluxUtil.withContext(context -> service.analyzeBatchDocuments(this.getEndpoint(), +- this.getServiceVersion().getVersion(), modelId, contentType, analyzeBatchRequest, requestOptions, context)); ++ final String accept = "application/json"; ++ return FluxUtil.withContext( ++ context -> service.analyzeBatchDocuments(this.getEndpoint(), this.getServiceVersion().getVersion(), modelId, ++ contentType, accept, analyzeBatchRequest, requestOptions, context)); + } + + /** +@@ -979,8 +990,9 @@ public final class DocumentIntelligenceClientImpl { + private Response analyzeBatchDocumentsWithResponse(String modelId, BinaryData analyzeBatchRequest, + RequestOptions requestOptions) { + final String contentType = "application/json"; ++ final String accept = "application/json"; + return service.analyzeBatchDocumentsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), modelId, +- contentType, analyzeBatchRequest, requestOptions, Context.NONE); ++ contentType, accept, analyzeBatchRequest, requestOptions, Context.NONE); + } + + /** +@@ -1507,8 +1519,9 @@ public final class DocumentIntelligenceClientImpl { + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteAnalyzeBatchResultWithResponseAsync(String modelId, String resultId, + RequestOptions requestOptions) { ++ final String accept = "application/json"; + return FluxUtil.withContext(context -> service.deleteAnalyzeBatchResult(this.getEndpoint(), +- this.getServiceVersion().getVersion(), modelId, resultId, requestOptions, context)); ++ this.getServiceVersion().getVersion(), modelId, resultId, accept, requestOptions, context)); + } + + /** +@@ -1526,8 +1539,9 @@ public final class DocumentIntelligenceClientImpl { + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteAnalyzeBatchResultWithResponse(String modelId, String resultId, + RequestOptions requestOptions) { ++ final String accept = "application/json"; + return service.deleteAnalyzeBatchResultSync(this.getEndpoint(), this.getServiceVersion().getVersion(), modelId, +- resultId, requestOptions, Context.NONE); ++ resultId, accept, requestOptions, Context.NONE); + } + + /** +@@ -1686,9 +1700,10 @@ public final class DocumentIntelligenceClientImpl { + private Mono> classifyDocumentWithResponseAsync(String classifierId, BinaryData classifyRequest, + RequestOptions requestOptions) { + final String contentType = "application/json"; ++ final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.classifyDocument(this.getEndpoint(), this.getServiceVersion().getVersion(), +- classifierId, contentType, classifyRequest, requestOptions, context)); ++ classifierId, contentType, accept, classifyRequest, requestOptions, context)); + } + + /** +@@ -1728,8 +1743,9 @@ public final class DocumentIntelligenceClientImpl { + private Response classifyDocumentWithResponse(String classifierId, BinaryData classifyRequest, + RequestOptions requestOptions) { + final String contentType = "application/json"; ++ final String accept = "application/json"; + return service.classifyDocumentSync(this.getEndpoint(), this.getServiceVersion().getVersion(), classifierId, +- contentType, classifyRequest, requestOptions, Context.NONE); ++ contentType, accept, classifyRequest, requestOptions, Context.NONE); + } + + /** +-- +2.50.1.windows.1 + diff --git a/eng/pipelines/scripts/patches/0001-revert-impl-in-easm.patch b/eng/pipelines/scripts/patches/0001-revert-impl-in-easm.patch new file mode 100644 index 000000000000..0ff7844e6d57 --- /dev/null +++ b/eng/pipelines/scripts/patches/0001-revert-impl-in-easm.patch @@ -0,0 +1,135 @@ +From ee9efb32a58711f5bcb4667e4ae9bea70be2e138 Mon Sep 17 00:00:00 2001 +From: Weidong Xu +Date: Thu, 7 Aug 2025 13:47:27 +0800 +Subject: [PATCH] revert impl in easm + +--- + .../easm/implementation/EasmClientImpl.java | 30 +++++++++++-------- + 1 file changed, 18 insertions(+), 12 deletions(-) + +diff --git a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/EasmClientImpl.java b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/EasmClientImpl.java +index 74965f145fd..cd574da24ef 100644 +--- a/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/EasmClientImpl.java ++++ b/sdk/easm/azure-analytics-defender-easm/src/main/java/com/azure/analytics/defender/easm/implementation/EasmClientImpl.java +@@ -315,7 +315,7 @@ public final class EasmClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteDataConnection(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("dataConnectionName") String dataConnectionName, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Delete("/dataConnections/{dataConnectionName}") + @ExpectedResponses({ 204 }) +@@ -325,7 +325,7 @@ public final class EasmClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteDataConnectionSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("dataConnectionName") String dataConnectionName, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/discoGroups") + @ExpectedResponses({ 200 }) +@@ -419,7 +419,7 @@ public final class EasmClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> runDiscoGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("groupName") String groupName, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/discoGroups/{groupName}:run") + @ExpectedResponses({ 204 }) +@@ -429,7 +429,7 @@ public final class EasmClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response runDiscoGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("groupName") String groupName, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/discoGroups/{groupName}/runs") + @ExpectedResponses({ 200 }) +@@ -625,7 +625,7 @@ public final class EasmClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteSavedFilter(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("filterName") String filterName, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Delete("/savedFilters/{filterName}") + @ExpectedResponses({ 204 }) +@@ -635,7 +635,7 @@ public final class EasmClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteSavedFilterSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("filterName") String filterName, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/tasks") + @ExpectedResponses({ 200 }) +@@ -1886,8 +1886,9 @@ public final class EasmClientImpl { + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteDataConnectionWithResponseAsync(String dataConnectionName, + RequestOptions requestOptions) { ++ final String accept = "application/json"; + return FluxUtil.withContext(context -> service.deleteDataConnection(this.getEndpoint(), +- this.getServiceVersion().getVersion(), dataConnectionName, requestOptions, context)); ++ this.getServiceVersion().getVersion(), dataConnectionName, accept, requestOptions, context)); + } + + /** +@@ -1903,8 +1904,9 @@ public final class EasmClientImpl { + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteDataConnectionWithResponse(String dataConnectionName, RequestOptions requestOptions) { ++ final String accept = "application/json"; + return service.deleteDataConnectionSync(this.getEndpoint(), this.getServiceVersion().getVersion(), +- dataConnectionName, requestOptions, Context.NONE); ++ dataConnectionName, accept, requestOptions, Context.NONE); + } + + /** +@@ -2696,8 +2698,9 @@ public final class EasmClientImpl { + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> runDiscoGroupWithResponseAsync(String groupName, RequestOptions requestOptions) { ++ final String accept = "application/json"; + return FluxUtil.withContext(context -> service.runDiscoGroup(this.getEndpoint(), +- this.getServiceVersion().getVersion(), groupName, requestOptions, context)); ++ this.getServiceVersion().getVersion(), groupName, accept, requestOptions, context)); + } + + /** +@@ -2713,7 +2716,8 @@ public final class EasmClientImpl { + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response runDiscoGroupWithResponse(String groupName, RequestOptions requestOptions) { +- return service.runDiscoGroupSync(this.getEndpoint(), this.getServiceVersion().getVersion(), groupName, ++ final String accept = "application/json"; ++ return service.runDiscoGroupSync(this.getEndpoint(), this.getServiceVersion().getVersion(), groupName, accept, + requestOptions, Context.NONE); + } + +@@ -4053,8 +4057,9 @@ public final class EasmClientImpl { + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteSavedFilterWithResponseAsync(String filterName, RequestOptions requestOptions) { ++ final String accept = "application/json"; + return FluxUtil.withContext(context -> service.deleteSavedFilter(this.getEndpoint(), +- this.getServiceVersion().getVersion(), filterName, requestOptions, context)); ++ this.getServiceVersion().getVersion(), filterName, accept, requestOptions, context)); + } + + /** +@@ -4070,8 +4075,9 @@ public final class EasmClientImpl { + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteSavedFilterWithResponse(String filterName, RequestOptions requestOptions) { ++ final String accept = "application/json"; + return service.deleteSavedFilterSync(this.getEndpoint(), this.getServiceVersion().getVersion(), filterName, +- requestOptions, Context.NONE); ++ accept, requestOptions, Context.NONE); + } + + /** +-- +2.50.1.windows.1 + diff --git a/eng/pipelines/scripts/patches/0001-revert-impl-in-monitor.patch b/eng/pipelines/scripts/patches/0001-revert-impl-in-monitor.patch new file mode 100644 index 000000000000..f54f516b672e --- /dev/null +++ b/eng/pipelines/scripts/patches/0001-revert-impl-in-monitor.patch @@ -0,0 +1,58 @@ +From d767417fc77ec1a5754ea6c973c258acab2cc9a6 Mon Sep 17 00:00:00 2001 +From: Weidong Xu +Date: Thu, 7 Aug 2025 12:44:57 +0800 +Subject: [PATCH] revert impl in monitor + +--- + .../implementation/LogsIngestionClientImpl.java | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + +diff --git a/sdk/monitor/azure-monitor-ingestion/src/main/java/com/azure/monitor/ingestion/implementation/LogsIngestionClientImpl.java b/sdk/monitor/azure-monitor-ingestion/src/main/java/com/azure/monitor/ingestion/implementation/LogsIngestionClientImpl.java +index 1d513291f2b..7e7a7ed1484 100644 +--- a/sdk/monitor/azure-monitor-ingestion/src/main/java/com/azure/monitor/ingestion/implementation/LogsIngestionClientImpl.java ++++ b/sdk/monitor/azure-monitor-ingestion/src/main/java/com/azure/monitor/ingestion/implementation/LogsIngestionClientImpl.java +@@ -161,7 +161,8 @@ public final class LogsIngestionClientImpl { + Mono> upload(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("ruleId") String ruleId, + @PathParam("stream") String streamName, @HeaderParam("Content-Type") String contentType, +- @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, ++ RequestOptions requestOptions, Context context); + + @Post("/dataCollectionRules/{ruleId}/streams/{stream}") + @ExpectedResponses({ 204 }) +@@ -171,8 +172,8 @@ public final class LogsIngestionClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response uploadSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("ruleId") String ruleId, @PathParam("stream") String streamName, +- @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData body, +- RequestOptions requestOptions, Context context); ++ @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, ++ @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + } + + /** +@@ -211,8 +212,9 @@ public final class LogsIngestionClientImpl { + public Mono> uploadWithResponseAsync(String ruleId, String streamName, BinaryData body, + RequestOptions requestOptions) { + final String contentType = "application/json"; ++ final String accept = "application/json"; + return FluxUtil.withContext(context -> service.upload(this.getEndpoint(), this.getServiceVersion().getVersion(), +- ruleId, streamName, contentType, body, requestOptions, context)); ++ ruleId, streamName, contentType, accept, body, requestOptions, context)); + } + + /** +@@ -251,7 +253,8 @@ public final class LogsIngestionClientImpl { + public Response uploadWithResponse(String ruleId, String streamName, BinaryData body, + RequestOptions requestOptions) { + final String contentType = "application/json"; ++ final String accept = "application/json"; + return service.uploadSync(this.getEndpoint(), this.getServiceVersion().getVersion(), ruleId, streamName, +- contentType, body, requestOptions, Context.NONE); ++ contentType, accept, body, requestOptions, Context.NONE); + } + } +-- +2.50.1.windows.1 + diff --git a/eng/pipelines/scripts/patches/0001-revert-impl-in-translation.patch b/eng/pipelines/scripts/patches/0001-revert-impl-in-translation.patch new file mode 100644 index 000000000000..1a561ced9a94 --- /dev/null +++ b/eng/pipelines/scripts/patches/0001-revert-impl-in-translation.patch @@ -0,0 +1,59 @@ +From 67cd3515137238ae3c69008d0a65ec74af3338e9 Mon Sep 17 00:00:00 2001 +From: Weidong Xu +Date: Thu, 7 Aug 2025 12:13:55 +0800 +Subject: [PATCH] revert impl in translation + +--- + .../DocumentTranslationClientImpl.java | 14 +++++++++----- + 1 file changed, 9 insertions(+), 5 deletions(-) + +diff --git a/sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/implementation/DocumentTranslationClientImpl.java b/sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/implementation/DocumentTranslationClientImpl.java +index 9fb5a9e6fc8..cefc7bff313 100644 +--- a/sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/implementation/DocumentTranslationClientImpl.java ++++ b/sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/implementation/DocumentTranslationClientImpl.java +@@ -179,7 +179,8 @@ public final class DocumentTranslationClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> translation(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, +- @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, ++ RequestOptions requestOptions, Context context); + + @Post("/document/batches") + @ExpectedResponses({ 202 }) +@@ -189,7 +190,8 @@ public final class DocumentTranslationClientImpl { + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response translationSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, +- @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); ++ @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, ++ RequestOptions requestOptions, Context context); + + @Get("/document/batches") + @ExpectedResponses({ 200 }) +@@ -426,8 +428,9 @@ public final class DocumentTranslationClientImpl { + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> translationWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; ++ final String accept = "application/json"; + return FluxUtil.withContext(context -> service.translation(this.getEndpoint(), +- this.getServiceVersion().getVersion(), contentType, body, requestOptions, context)); ++ this.getServiceVersion().getVersion(), contentType, accept, body, requestOptions, context)); + } + + /** +@@ -502,8 +505,9 @@ public final class DocumentTranslationClientImpl { + @ServiceMethod(returns = ReturnType.SINGLE) + private Response translationWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; +- return service.translationSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType, body, +- requestOptions, Context.NONE); ++ final String accept = "application/json"; ++ return service.translationSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType, accept, ++ body, requestOptions, Context.NONE); + } + + /** +-- +2.50.1.windows.1 + diff --git a/eng/pipelines/scripts/sync_emitter.py b/eng/pipelines/scripts/sync_emitter.py new file mode 100644 index 000000000000..8d6a024773c7 --- /dev/null +++ b/eng/pipelines/scripts/sync_emitter.py @@ -0,0 +1,493 @@ +#!/usr/bin/env python3 + +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +import os +import sys +import logging +import argparse +import subprocess +import glob +import shutil +import json +import tarfile +import tempfile +import urllib.request +from typing import List + +sdk_root: str +# script is in "eng/pipelines/scripts/" +script_root: str = os.path.dirname(os.path.realpath(__file__)) + +skip_artifacts: List[str] = [ + "azure-ai-anomalydetector", # deprecated + # expect failure on below + # emitter generates inconsistent code for id-parameterized subclients (LargePersonGroup, + # LargeFaceList): wrapper clients call the removed plural getLargePersonGroups()/getLargeFaceLists() + # accessors and stale plural *sImpl files are left behind, so the module does not compile. + "azure-ai-vision-face", + # "azure-developer-devcenter", # 2 breaks introduced into stable api-version +] + + +def parse_args() -> argparse.Namespace: + parser = argparse.ArgumentParser() + parser.add_argument( + "--sdk-root", + type=str, + required=True, + help="azure-sdk-for-java repository root.", + ) + parser.add_argument( + "--package-json-path", + type=str, + required=False, + default="", + help="path to package.json of typespec-java. Required when --emitter-version is empty " + "(the dev build route).", + ) + parser.add_argument( + "--emitter-version", + type=str, + required=False, + default="", + help="published @azure-tools/typespec-java version to regenerate with. When empty, the " + "emitter is built from source (dev route) instead.", + ) + return parser.parse_args() + + +EMITTER_PACKAGE_NAME = "@azure-tools/typespec-java" + +# Prefixes of the TypeSpec dependency entries in emitter-package.json whose versions we resolve to +# the latest published npm version (see resolve_dependency_versions_to_latest). +TYPESPEC_DEPENDENCY_PREFIXES = ("@azure-tools/", "@typespec/") + +# TypeSpec libraries that some specs depend on but which are intentionally NOT declared as +# dependencies of the typespec-java emitter itself (declaring them there would force every +# downstream emitter/repo to carry them - see discussion on Azure/typespec-azure PR 4866). We add +# them to emitter-package.json here so that generated SDKs referencing these libraries compile. +# +# These are versioned from the azure-rest-api-specs package.json (the source of truth for the +# versions the specs actually use), falling back to the latest published npm version if the specs +# repo has not updated yet. They are released independently of the TypeSpec compiler/Azure +# libraries, so their specs-pinned version does not have to move in lockstep with the emitter's +# other dependencies. +DESIGNATED_LIBRARIES_FROM_SPECS = [ + "@azure-tools/openai-typespec", + "@azure-tools/typespec-liftr-base", +] + +# These designated libraries are versioned from the latest published npm version instead of the +# specs repo. They belong to the same release group as the TypeSpec compiler / Azure libraries that +# the emitter depends on (e.g. @typespec/*, @azure-tools/typespec-azure-*), which +# resolve_dependency_versions_to_latest already pins to the latest published version. Sourcing +# these from npm latest too keeps the whole release group on the same version, avoiding peer +# conflicts that a lagging specs-repo pin (e.g. openapi3 requiring an older @typespec/http) would +# otherwise cause. +DESIGNATED_LIBRARIES_FROM_NPM_LATEST = [ + "@azure-tools/typespec-azure-portal-core", + "@typespec/openapi3", +] + +# All designated libraries, used to exclude them from resolve_dependency_versions_to_latest (they +# are versioned separately by add_designated_libraries). +DESIGNATED_LIBRARIES = DESIGNATED_LIBRARIES_FROM_SPECS + DESIGNATED_LIBRARIES_FROM_NPM_LATEST + +# package.json of the specs repo, the source of truth for the specs-versioned designated libraries. +SPECS_PACKAGE_JSON_URL = "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/package.json" + + +def emitter_package_json_path() -> str: + return os.path.join(sdk_root, "eng", "emitter-package.json") + + +def extract_package_json_from_tgz(tgz_path: str, dest_path: str) -> None: + # npm/pnpm pack tarballs place all files under a top-level "package/" directory. The + # package.json inside has the "catalog:"/"workspace:" protocols resolved to concrete + # versions, which is what tsp-client generate-config-files needs (npm cannot resolve those + # protocols, and generate-config-files reads the emitter's peerDependencies from this file). + with tarfile.open(tgz_path, "r:gz") as tar: + with tar.extractfile("package/package.json") as member: + with open(dest_path, "wb") as f: + f.write(member.read()) + + +def generate_config_files(emitter_package_json: str, use_npm_pinning: bool, overrides_path: str = "") -> None: + # tsp-client generate-config-files seeds eng/emitter-package.json from an emitter package.json + # (its peerDependencies) and then generates the lock file (via "npm install"). Used by both + # routes: + # - Published route: use_npm_pinning=True so peer versions are pinned from the published + # emitter's dependencies (looked up with "npm view"). + # - Dev route: overrides_path points the emitter dependency at the locally built dev tarball, + # so the lock-generation "npm install" resolves the (unpublished) emitter from that tarball + # instead of the registry. --use-npm-pinning is not used, because it would "npm view" the + # unpublished dev emitter, which does not exist on the registry. + # + # Remove the designated libraries from any existing eng/emitter-package.json first: + # generate-config-files MERGES into it rather than replacing it, and it only overwrites entries + # that are emitter peers. A designated library left from a previous run (e.g. @typespec/openapi3, + # which is NOT an emitter peer) would survive the merge with its stale version and break the + # lock-generation "npm install" with ERESOLVE. We add the designated libraries back (from npm + # latest or the specs repo) after seeding, so the merge starts from only the emitter's own peers. + # + # Alternative: delete the whole eng/emitter-package.json before generating (os.remove) so it is + # seeded entirely from scratch. That is more robust against non-designated orphans (e.g. an + # emitter peer that was dropped), but it regenerates the key order from the emitter manifest, + # producing noisier diffs. We remove only the designated entries to keep the existing key order. + remove_designated_libraries() + + command = [ + "tsp-client", + "generate-config-files", + "--package-json", + emitter_package_json, + "--emitter-package-json-path", + emitter_package_json_path(), + ] + if use_npm_pinning: + command.append("--use-npm-pinning") + if overrides_path: + command.extend(["--overrides", overrides_path]) + subprocess.check_call(command, cwd=sdk_root) + + +def npm_view_version(package_ref: str) -> str: + # "npm view version" reads a published version from the npm registry. Preferred over + # "ncu -u" (which may be unavailable in CFS environments) for looking up dependency versions. + return subprocess.check_output( + ["npm", "view", package_ref, "version"], + cwd=sdk_root, + text=True, + ).strip() + + +def load_emitter_package_json() -> dict: + with open(emitter_package_json_path(), "r") as json_file: + return json.load(json_file) + + +def save_emitter_package_json(package_json: dict) -> None: + with open(emitter_package_json_path(), "w") as json_file: + json.dump(package_json, json_file, indent=2) + + +def remove_designated_libraries() -> None: + # Remove the designated libraries from an existing eng/emitter-package.json before seeding. + # generate-config-files merges into that file and only overwrites emitter-peer entries, so a + # designated library carried over from a previous run (e.g. @typespec/openapi3) would keep its + # stale version and conflict with the freshly pinned peers. They are added back afterward by + # add_designated_libraries. The skipped designated libraries (still emitter peers) are re-added + # by generate-config-files itself from the emitter's peerDependencies. + path = emitter_package_json_path() + if not os.path.exists(path): + return + package_json = load_emitter_package_json() + dev_dependencies = package_json.get("devDependencies", {}) + for library in DESIGNATED_LIBRARIES: + if library in dev_dependencies: + logging.info(f"Remove designated library {library} before seeding") + del dev_dependencies[library] + save_emitter_package_json(package_json) + + +def resolve_dependency_versions_to_latest() -> None: + # Seeding (either route) leaves the @azure-tools/* and @typespec/* devDependencies as the + # emitter's caret ranges (e.g. "^0.70.0"), but eng/emitter-package.json must pin exact versions. + # Resolve each of these entries to its latest published version via "npm view ...@latest". + # Designated libraries are handled separately (from the specs repo), so skip them here. + package_json = load_emitter_package_json() + dev_dependencies = package_json.get("devDependencies", {}) + for name in list(dev_dependencies.keys()): + if name in DESIGNATED_LIBRARIES: + continue + if name.startswith(TYPESPEC_DEPENDENCY_PREFIXES): + version = npm_view_version(f"{name}@latest") + logging.info(f"Resolve {name} to latest published version {version}") + dev_dependencies[name] = version + save_emitter_package_json(package_json) + + +def fetch_specs_dev_dependencies() -> dict: + # Read the devDependencies map from the specs repo package.json, the source of truth for the + # designated library versions. + logging.info(f"Fetch designated library versions from {SPECS_PACKAGE_JSON_URL}") + with urllib.request.urlopen(SPECS_PACKAGE_JSON_URL) as response: + specs_package_json = json.loads(response.read().decode("utf-8")) + return specs_package_json.get("devDependencies", {}) + + +def add_designated_libraries() -> None: + # Add the designated libraries (not declared by the emitter) to emitter-package.json. Two + # groups, versioned from different sources: + # - DESIGNATED_LIBRARIES_FROM_SPECS: pinned to the exact version declared in the specs repo + # package.json (the version the specs actually use). If a library is missing there (the + # specs repo may not have updated yet), fall back to its latest published npm version. + # - DESIGNATED_LIBRARIES_FROM_NPM_LATEST: pinned to the latest published npm version. + specs_dev_dependencies = fetch_specs_dev_dependencies() + package_json = load_emitter_package_json() + dev_dependencies = package_json.setdefault("devDependencies", {}) + + for library in DESIGNATED_LIBRARIES_FROM_SPECS: + version = specs_dev_dependencies.get(library) + if version: + logging.info(f"Add designated library {library}@{version} (from specs repo)") + else: + version = npm_view_version(f"{library}@latest") + logging.info(f"Add designated library {library}@{version} (specs repo missing it, using npm latest)") + dev_dependencies[library] = version + + for library in DESIGNATED_LIBRARIES_FROM_NPM_LATEST: + version = npm_view_version(f"{library}@latest") + logging.info(f"Add designated library {library}@{version} (from npm latest)") + dev_dependencies[library] = version + + save_emitter_package_json(package_json) + + +def update_emitter(package_json_path: str, emitter_version: str): + # 'none' is the pipeline sentinel for "not specified" (Azure DevOps string parameters + # cannot be left truly empty in the run UI), so normalize it to empty here. + if emitter_version.lower() == "none": + emitter_version = "" + + if emitter_version: + # Published route (post-publish): seed emitter-package.json from the published emitter. + logging.info(f"Seed emitter-package.json from published typespec-java {emitter_version}") + with tempfile.TemporaryDirectory() as tmp_dir: + # "npm view --json" returns the published registry manifest (name, version, main, + # peerDependencies). generate-config-files --use-npm-pinning reads its peerDependencies + # to seed emitter-package.json, pinning the emitter to this published version. + manifest = subprocess.check_output( + ["npm", "view", f"{EMITTER_PACKAGE_NAME}@{emitter_version}", "--json"], + cwd=sdk_root, + text=True, + ) + published_package_json_path = os.path.join(tmp_dir, "package.json") + with open(published_package_json_path, "w") as f: + f.write(manifest) + + logging.info("Update emitter-package.json") + generate_config_files(published_package_json_path, use_npm_pinning=True) + else: + # Dev route: build the emitter from source, then seed emitter-package.json from the local + # dev package. The dev emitter version is unpublished, so generate-config-files consumes + # the emitter's (resolved) package.json extracted from the dev tarball, and an overrides + # file points the emitter dependency at that tarball so the lock-generation "npm install" + # can resolve the emitter locally instead of from the registry. + if not package_json_path: + raise ValueError("--package-json-path is required when --emitter-version is empty.") + + # Locate the dev package tarball built by the "Build typespec-java dev package" step of + # the post-publish-emitter pipeline (pnpm pack), next to the emitter's package.json. + dev_package_path = None + typespec_extension_path = os.path.dirname(package_json_path) + for file in os.listdir(typespec_extension_path): + if file.endswith(".tgz"): + dev_package_path = os.path.abspath(os.path.join(typespec_extension_path, file)) + logging.info(f'Found dev package at "{dev_package_path}"') + break + if not dev_package_path: + logging.error("Failed to locate the dev package.") + return + + with tempfile.TemporaryDirectory() as tmp_dir: + # The tarball's package.json has "catalog:"/"workspace:" protocols resolved to concrete + # versions, which generate-config-files needs (npm cannot resolve those protocols). + resolved_package_json_path = os.path.join(tmp_dir, "package.json") + extract_package_json_from_tgz(dev_package_path, resolved_package_json_path) + + # Point the (unpublished) emitter dependency at the local dev tarball. + overrides_path = os.path.join(tmp_dir, "overrides.json") + with open(overrides_path, "w") as f: + json.dump({EMITTER_PACKAGE_NAME: dev_package_path}, f) + + logging.info("Update emitter-package.json") + generate_config_files(resolved_package_json_path, use_npm_pinning=False, overrides_path=overrides_path) + + # Both routes: pin the emitter's TypeSpec dependencies to their latest published versions and + # add the designated libraries from the specs repo, then (re)generate the lock file so it + # reflects the final dependency set. + resolve_dependency_versions_to_latest() + add_designated_libraries() + + logging.info("Update emitter-package-lock.json") + generate_lock_file() + + +def update_latest_dev(): + subprocess.check_call( + ["npx", "-y", "@azure-tools/typespec-bump-deps", "eng/emitter-package.json", "--add-npm-overrides"], + cwd=sdk_root, + ) + + +def generate_lock_file(): + subprocess.check_call(["tsp-client", "generate-lock-file"], cwd=sdk_root) + + +def get_generated_folder_from_artifact(module_path: str, artifact: str, type: str) -> str: + path = os.path.join(module_path, "src", type, "java", "com") + for seg in artifact.split("-"): + path = os.path.join(path, seg) + path = os.path.join(path, "generated") + return path + + +def update_sdks(): + failed_modules = [] + for tsp_location_file in glob.glob(os.path.join(sdk_root, "sdk/*/*/tsp-location.yaml")): + module_path = os.path.dirname(tsp_location_file) + artifact = os.path.basename(module_path) + + arm_module = "-resourcemanager-" in artifact + + if artifact in skip_artifacts: + continue + + # # update commit ID for ARM module + # commit_id = "3c15c2f8c50fb3130b34887d29442da75f07fefb" + # if commit_id and arm_module: + # with open(tsp_location_file, "r", encoding="utf-8") as f_in: + # lines = f_in.readlines() + # lines_out = [] + # for line in lines: + # if line.startswith("commit:"): + # line = f"commit: {commit_id}\n" + # lines_out.append(line) + # with open(tsp_location_file, "w", encoding="utf-8") as f_out: + # f_out.writelines(lines_out) + + # logging.info("Updated tsp-location file content:\n%s", "".join(lines_out)) + + if os.path.dirname(module_path).endswith("-v2"): + # skip modules on azure-core-v2 + logging.info(f"Skip azure-core-v2 module on path {module_path}") + continue + + generated_samples_path = os.path.join( + module_path, get_generated_folder_from_artifact(module_path, artifact, "samples") + ) + generated_test_path = os.path.join( + module_path, get_generated_folder_from_artifact(module_path, artifact, "test") + ) + generated_samples_exists = os.path.isdir(generated_samples_path) + generated_test_exists = os.path.isdir(generated_test_path) + + if arm_module: + logging.info("Delete generated source code of resourcemanager module %s", artifact) + shutil.rmtree(os.path.join(module_path, "src", "main", "resources"), ignore_errors=True) + delete_generated_source_code(os.path.join(module_path, "src", "main", "java")) + + logging.info(f"Generate for module {artifact}") + try: + subprocess.check_call(["tsp-client", "update"], cwd=module_path) + except subprocess.CalledProcessError: + # one retry + # sometimes customization have intermittent failure + logging.warning(f"Retry generate for module {artifact}") + try: + subprocess.check_call(["tsp-client", "update", "--debug"], cwd=module_path) + except subprocess.CalledProcessError: + logging.error(f"Failed to generate for module {artifact}") + failed_modules.append(artifact) + + if not arm_module: + # run mvn package, as this is what's done in "TypeSpec-Compare-CurrentToCodegeneration.ps1" script + try: + subprocess.check_call( + ["mvn", "--no-transfer-progress", "codesnippet:update-codesnippet"], cwd=module_path + ) + except subprocess.CalledProcessError: + logging.error(f"Failed to update code snippet for module {artifact}") + failed_modules.append(artifact) + + if arm_module: + # revert mock test code + cmd = ["git", "checkout", "src/test"] + subprocess.check_call(cmd, cwd=module_path) + + # For ARM module, we want to keep the generated samples code. + # For data-plane, if the generated samples/test code is not there before generation, we will delete the generated code after generation, to avoid unnecessary code check-in. + if not generated_samples_exists and not arm_module: + shutil.rmtree(generated_samples_path, ignore_errors=True) + if not generated_test_exists: + shutil.rmtree(generated_test_path, ignore_errors=True) + + # revert change on pom.xml, readme.md, changelog.md, etc. + cmd = ["git", "checkout", "**/pom.xml"] + subprocess.check_call(cmd, cwd=sdk_root) + cmd = ["git", "checkout", "**/*.md"] + subprocess.check_call(cmd, cwd=sdk_root) + + # temporary, revert change on metadata.json + cmd = ["git", "checkout", "**/*_metadata.json"] + subprocess.check_call(cmd, cwd=sdk_root) + + cmd = ["git", "add", "."] + subprocess.check_call(cmd, cwd=sdk_root) + + if failed_modules: + logging.error(f"Failed modules {failed_modules}") + + +def apply_patches() -> None: + failed_patches = [] + for patch_file in glob.glob(os.path.join(script_root, "patches/*.patch")): + try: + subprocess.check_call(["git", "apply", patch_file, "--ignore-whitespace"], cwd=sdk_root) + except subprocess.CalledProcessError: + logging.error(f"Failed to apply patch {patch_file}") + failed_patches.append(patch_file) + + if failed_patches: + logging.error(f"Failed patches {failed_patches}") + + +def delete_generated_source_code(path: str) -> None: + autorest_generated_header = "Code generated by Microsoft (R) AutoRest Code Generator" + typespec_generated_header = "Code generated by Microsoft (R) TypeSpec Code Generator" + if os.path.exists(path): + for file in os.listdir(path): + cur_path = os.path.join(path, file) + if os.path.isdir(cur_path): + # Recurse into subdirectory + delete_generated_source_code(cur_path) + else: + try: + # Read file content and check for header + with open(cur_path, "r", encoding="utf-8") as f: + content = f.read() + if autorest_generated_header in content or typespec_generated_header in content: + os.remove(cur_path) # Delete the file + except Exception as e: + # Skip files that can't be read (binary files, permission issues) + print(f"Warning: Could not process file {cur_path}: {e}") + continue + + +def main(): + global sdk_root + + args = vars(parse_args()) + sdk_root = args["sdk_root"] + + update_emitter( + args["package_json_path"], + args["emitter_version"], + ) + + update_sdks() + + apply_patches() + + +if __name__ == "__main__": + logging.basicConfig( + stream=sys.stdout, + level=logging.INFO, + format="%(asctime)s %(levelname)s %(message)s", + datefmt="%Y-%m-%d %X", + ) + main() diff --git a/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AppServicePlanPatchResourceProperties.java b/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AppServicePlanPatchResourceProperties.java index f03987740fc8..94269cc8eab4 100644 --- a/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AppServicePlanPatchResourceProperties.java +++ b/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AppServicePlanPatchResourceProperties.java @@ -60,6 +60,7 @@ public final class AppServicePlanPatchResourceProperties private String geoRegion; /* + * * If true, apps assigned to this App Service plan can be scaled independently. * If false, apps assigned to this App Service plan will scale to all instances of the plan. */ @@ -136,6 +137,7 @@ public final class AppServicePlanPatchResourceProperties private KubeEnvironmentProfile kubeEnvironmentProfile; /* + * * If true, this App Service Plan will perform availability zone balancing. * If false, this App Service Plan will not perform availability zone balancing. */ @@ -237,8 +239,8 @@ public String geoRegion() { } /** - * Get the perSiteScaling property: If <code>true</code>, apps assigned to this App Service plan can be - * scaled independently. + * Get the perSiteScaling property: + * If <code>true</code>, apps assigned to this App Service plan can be scaled independently. * If <code>false</code>, apps assigned to this App Service plan will scale to all instances of the * plan. * @@ -249,8 +251,8 @@ public Boolean perSiteScaling() { } /** - * Set the perSiteScaling property: If <code>true</code>, apps assigned to this App Service plan can be - * scaled independently. + * Set the perSiteScaling property: + * If <code>true</code>, apps assigned to this App Service plan can be scaled independently. * If <code>false</code>, apps assigned to this App Service plan will scale to all instances of the * plan. * @@ -525,8 +527,8 @@ public KubeEnvironmentProfile kubeEnvironmentProfile() { } /** - * Get the zoneRedundant property: If <code>true</code>, this App Service Plan will perform availability - * zone balancing. + * Get the zoneRedundant property: + * If <code>true</code>, this App Service Plan will perform availability zone balancing. * If <code>false</code>, this App Service Plan will not perform availability zone balancing. * * @return the zoneRedundant value. @@ -536,8 +538,8 @@ public Boolean zoneRedundant() { } /** - * Set the zoneRedundant property: If <code>true</code>, this App Service Plan will perform availability - * zone balancing. + * Set the zoneRedundant property: + * If <code>true</code>, this App Service Plan will perform availability zone balancing. * If <code>false</code>, this App Service Plan will not perform availability zone balancing. * * @param zoneRedundant the zoneRedundant value to set. diff --git a/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/PushSettingsInner.java b/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/PushSettingsInner.java index 97bebe48f280..8967c149c0ad 100644 --- a/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/PushSettingsInner.java +++ b/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/PushSettingsInner.java @@ -139,8 +139,9 @@ public PushSettingsInner withTagWhitelistJson(String tagWhitelistJson) { } /** - * Get the tagsRequiringAuth property: Gets or sets a JSON string containing a list of tags that require user - * authentication to be used in the push registration endpoint. + * Get the tagsRequiringAuth property: + * Gets or sets a JSON string containing a list of tags that require user authentication to be used in the push + * registration endpoint. * Tags can consist of alphanumeric characters and the following: * '_', '@', '#', '.', ':', '-'. * Validation should be performed at the PushRequestHandler. @@ -152,8 +153,9 @@ public String tagsRequiringAuth() { } /** - * Set the tagsRequiringAuth property: Gets or sets a JSON string containing a list of tags that require user - * authentication to be used in the push registration endpoint. + * Set the tagsRequiringAuth property: + * Gets or sets a JSON string containing a list of tags that require user authentication to be used in the push + * registration endpoint. * Tags can consist of alphanumeric characters and the following: * '_', '@', '#', '.', ':', '-'. * Validation should be performed at the PushRequestHandler. diff --git a/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/PushSettingsProperties.java b/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/PushSettingsProperties.java index 5b1d9dcc4724..a4f36b04fbf3 100644 --- a/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/PushSettingsProperties.java +++ b/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/PushSettingsProperties.java @@ -28,6 +28,7 @@ public final class PushSettingsProperties implements JsonSerializable facebookOAuthS } /** - * Get the gitHubClientId property: The Client Id of the GitHub app used for login. + * Get the gitHubClientId property: + * The Client Id of the GitHub app used for login. * This setting is required for enabling Github login. * * @return the gitHubClientId value. @@ -763,7 +766,8 @@ public String gitHubClientId() { } /** - * Set the gitHubClientId property: The Client Id of the GitHub app used for login. + * Set the gitHubClientId property: + * The Client Id of the GitHub app used for login. * This setting is required for enabling Github login. * * @param gitHubClientId the gitHubClientId value to set. @@ -778,7 +782,8 @@ public SiteAuthSettingsInner withGitHubClientId(String gitHubClientId) { } /** - * Get the gitHubClientSecret property: The Client Secret of the GitHub app used for Github Login. + * Get the gitHubClientSecret property: + * The Client Secret of the GitHub app used for Github Login. * This setting is required for enabling Github login. * * @return the gitHubClientSecret value. @@ -788,7 +793,8 @@ public String gitHubClientSecret() { } /** - * Set the gitHubClientSecret property: The Client Secret of the GitHub app used for Github Login. + * Set the gitHubClientSecret property: + * The Client Secret of the GitHub app used for Github Login. * This setting is required for enabling Github login. * * @param gitHubClientSecret the gitHubClientSecret value to set. @@ -803,8 +809,8 @@ public SiteAuthSettingsInner withGitHubClientSecret(String gitHubClientSecret) { } /** - * Get the gitHubClientSecretSettingName property: The app setting name that contains the client secret of the - * Github + * Get the gitHubClientSecretSettingName property: + * The app setting name that contains the client secret of the Github * app used for GitHub Login. * * @return the gitHubClientSecretSettingName value. @@ -814,8 +820,8 @@ public String gitHubClientSecretSettingName() { } /** - * Set the gitHubClientSecretSettingName property: The app setting name that contains the client secret of the - * Github + * Set the gitHubClientSecretSettingName property: + * The app setting name that contains the client secret of the Github * app used for GitHub Login. * * @param gitHubClientSecretSettingName the gitHubClientSecretSettingName value to set. @@ -830,8 +836,8 @@ public SiteAuthSettingsInner withGitHubClientSecretSettingName(String gitHubClie } /** - * Get the gitHubOAuthScopes property: The OAuth 2.0 scopes that will be requested as part of GitHub Login - * authentication. + * Get the gitHubOAuthScopes property: + * The OAuth 2.0 scopes that will be requested as part of GitHub Login authentication. * This setting is optional. * * @return the gitHubOAuthScopes value. @@ -841,8 +847,8 @@ public List gitHubOAuthScopes() { } /** - * Set the gitHubOAuthScopes property: The OAuth 2.0 scopes that will be requested as part of GitHub Login - * authentication. + * Set the gitHubOAuthScopes property: + * The OAuth 2.0 scopes that will be requested as part of GitHub Login authentication. * This setting is optional. * * @param gitHubOAuthScopes the gitHubOAuthScopes value to set. @@ -913,8 +919,8 @@ public SiteAuthSettingsInner withTwitterConsumerSecret(String twitterConsumerSec } /** - * Get the twitterConsumerSecretSettingName property: The app setting name that contains the OAuth 1.0a consumer - * secret of the Twitter + * Get the twitterConsumerSecretSettingName property: + * The app setting name that contains the OAuth 1.0a consumer secret of the Twitter * application used for sign-in. * * @return the twitterConsumerSecretSettingName value. @@ -924,8 +930,8 @@ public String twitterConsumerSecretSettingName() { } /** - * Set the twitterConsumerSecretSettingName property: The app setting name that contains the OAuth 1.0a consumer - * secret of the Twitter + * Set the twitterConsumerSecretSettingName property: + * The app setting name that contains the OAuth 1.0a consumer secret of the Twitter * application used for sign-in. * * @param twitterConsumerSecretSettingName the twitterConsumerSecretSettingName value to set. @@ -998,8 +1004,8 @@ public SiteAuthSettingsInner withMicrosoftAccountClientSecret(String microsoftAc } /** - * Get the microsoftAccountClientSecretSettingName property: The app setting name containing the OAuth 2.0 client - * secret that was created for the + * Get the microsoftAccountClientSecretSettingName property: + * The app setting name containing the OAuth 2.0 client secret that was created for the * app used for authentication. * * @return the microsoftAccountClientSecretSettingName value. @@ -1009,8 +1015,8 @@ public String microsoftAccountClientSecretSettingName() { } /** - * Set the microsoftAccountClientSecretSettingName property: The app setting name containing the OAuth 2.0 client - * secret that was created for the + * Set the microsoftAccountClientSecretSettingName property: + * The app setting name containing the OAuth 2.0 client secret that was created for the * app used for authentication. * * @param microsoftAccountClientSecretSettingName the microsoftAccountClientSecretSettingName value to set. @@ -1080,7 +1086,8 @@ public SiteAuthSettingsInner withIsAuthFromFile(String isAuthFromFile) { } /** - * Get the authFilePath property: The path of the config file containing auth settings. + * Get the authFilePath property: + * The path of the config file containing auth settings. * If the path is relative, base will the site's root directory. * * @return the authFilePath value. @@ -1090,7 +1097,8 @@ public String authFilePath() { } /** - * Set the authFilePath property: The path of the config file containing auth settings. + * Set the authFilePath property: + * The path of the config file containing auth settings. * If the path is relative, base will the site's root directory. * * @param authFilePath the authFilePath value to set. @@ -1105,8 +1113,8 @@ public SiteAuthSettingsInner withAuthFilePath(String authFilePath) { } /** - * Get the configVersion property: The ConfigVersion of the Authentication / Authorization feature in use for the - * current app. + * Get the configVersion property: + * The ConfigVersion of the Authentication / Authorization feature in use for the current app. * The setting in this value can control the behavior of the control plane for Authentication / Authorization. * * @return the configVersion value. @@ -1116,8 +1124,8 @@ public String configVersion() { } /** - * Set the configVersion property: The ConfigVersion of the Authentication / Authorization feature in use for the - * current app. + * Set the configVersion property: + * The ConfigVersion of the Authentication / Authorization feature in use for the current app. * The setting in this value can control the behavior of the control plane for Authentication / Authorization. * * @param configVersion the configVersion value to set. diff --git a/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteAuthSettingsProperties.java b/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteAuthSettingsProperties.java index 817f8320d6d3..ceeaa57b6635 100644 --- a/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteAuthSettingsProperties.java +++ b/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SiteAuthSettingsProperties.java @@ -26,6 +26,7 @@ public final class SiteAuthSettingsProperties implements JsonSerializable facebookOAuthScopes; /* + * * The Client Id of the GitHub app used for login. * This setting is required for enabling Github login */ private String gitHubClientId; /* + * * The Client Secret of the GitHub app used for Github Login. * This setting is required for enabling Github login. */ private String gitHubClientSecret; /* + * * The app setting name that contains the client secret of the Github * app used for GitHub Login. */ private String gitHubClientSecretSettingName; /* + * * The OAuth 2.0 scopes that will be requested as part of GitHub Login authentication. * This setting is optional */ @@ -219,6 +227,7 @@ public final class SiteAuthSettingsProperties implements JsonSerializable facebookO } /** - * Get the gitHubClientId property: The Client Id of the GitHub app used for login. + * Get the gitHubClientId property: + * The Client Id of the GitHub app used for login. * This setting is required for enabling Github login. * * @return the gitHubClientId value. @@ -873,7 +888,8 @@ public String gitHubClientId() { } /** - * Set the gitHubClientId property: The Client Id of the GitHub app used for login. + * Set the gitHubClientId property: + * The Client Id of the GitHub app used for login. * This setting is required for enabling Github login. * * @param gitHubClientId the gitHubClientId value to set. @@ -885,7 +901,8 @@ public SiteAuthSettingsProperties withGitHubClientId(String gitHubClientId) { } /** - * Get the gitHubClientSecret property: The Client Secret of the GitHub app used for Github Login. + * Get the gitHubClientSecret property: + * The Client Secret of the GitHub app used for Github Login. * This setting is required for enabling Github login. * * @return the gitHubClientSecret value. @@ -895,7 +912,8 @@ public String gitHubClientSecret() { } /** - * Set the gitHubClientSecret property: The Client Secret of the GitHub app used for Github Login. + * Set the gitHubClientSecret property: + * The Client Secret of the GitHub app used for Github Login. * This setting is required for enabling Github login. * * @param gitHubClientSecret the gitHubClientSecret value to set. @@ -907,8 +925,8 @@ public SiteAuthSettingsProperties withGitHubClientSecret(String gitHubClientSecr } /** - * Get the gitHubClientSecretSettingName property: The app setting name that contains the client secret of the - * Github + * Get the gitHubClientSecretSettingName property: + * The app setting name that contains the client secret of the Github * app used for GitHub Login. * * @return the gitHubClientSecretSettingName value. @@ -918,8 +936,8 @@ public String gitHubClientSecretSettingName() { } /** - * Set the gitHubClientSecretSettingName property: The app setting name that contains the client secret of the - * Github + * Set the gitHubClientSecretSettingName property: + * The app setting name that contains the client secret of the Github * app used for GitHub Login. * * @param gitHubClientSecretSettingName the gitHubClientSecretSettingName value to set. @@ -931,8 +949,8 @@ public SiteAuthSettingsProperties withGitHubClientSecretSettingName(String gitHu } /** - * Get the gitHubOAuthScopes property: The OAuth 2.0 scopes that will be requested as part of GitHub Login - * authentication. + * Get the gitHubOAuthScopes property: + * The OAuth 2.0 scopes that will be requested as part of GitHub Login authentication. * This setting is optional. * * @return the gitHubOAuthScopes value. @@ -942,8 +960,8 @@ public List gitHubOAuthScopes() { } /** - * Set the gitHubOAuthScopes property: The OAuth 2.0 scopes that will be requested as part of GitHub Login - * authentication. + * Set the gitHubOAuthScopes property: + * The OAuth 2.0 scopes that will be requested as part of GitHub Login authentication. * This setting is optional. * * @param gitHubOAuthScopes the gitHubOAuthScopes value to set. @@ -1005,8 +1023,8 @@ public SiteAuthSettingsProperties withTwitterConsumerSecret(String twitterConsum } /** - * Get the twitterConsumerSecretSettingName property: The app setting name that contains the OAuth 1.0a consumer - * secret of the Twitter + * Get the twitterConsumerSecretSettingName property: + * The app setting name that contains the OAuth 1.0a consumer secret of the Twitter * application used for sign-in. * * @return the twitterConsumerSecretSettingName value. @@ -1016,8 +1034,8 @@ public String twitterConsumerSecretSettingName() { } /** - * Set the twitterConsumerSecretSettingName property: The app setting name that contains the OAuth 1.0a consumer - * secret of the Twitter + * Set the twitterConsumerSecretSettingName property: + * The app setting name that contains the OAuth 1.0a consumer secret of the Twitter * application used for sign-in. * * @param twitterConsumerSecretSettingName the twitterConsumerSecretSettingName value to set. @@ -1081,8 +1099,8 @@ public SiteAuthSettingsProperties withMicrosoftAccountClientSecret(String micros } /** - * Get the microsoftAccountClientSecretSettingName property: The app setting name containing the OAuth 2.0 client - * secret that was created for the + * Get the microsoftAccountClientSecretSettingName property: + * The app setting name containing the OAuth 2.0 client secret that was created for the * app used for authentication. * * @return the microsoftAccountClientSecretSettingName value. @@ -1092,8 +1110,8 @@ public String microsoftAccountClientSecretSettingName() { } /** - * Set the microsoftAccountClientSecretSettingName property: The app setting name containing the OAuth 2.0 client - * secret that was created for the + * Set the microsoftAccountClientSecretSettingName property: + * The app setting name containing the OAuth 2.0 client secret that was created for the * app used for authentication. * * @param microsoftAccountClientSecretSettingName the microsoftAccountClientSecretSettingName value to set. @@ -1154,7 +1172,8 @@ public SiteAuthSettingsProperties withIsAuthFromFile(String isAuthFromFile) { } /** - * Get the authFilePath property: The path of the config file containing auth settings. + * Get the authFilePath property: + * The path of the config file containing auth settings. * If the path is relative, base will the site's root directory. * * @return the authFilePath value. @@ -1164,7 +1183,8 @@ public String authFilePath() { } /** - * Set the authFilePath property: The path of the config file containing auth settings. + * Set the authFilePath property: + * The path of the config file containing auth settings. * If the path is relative, base will the site's root directory. * * @param authFilePath the authFilePath value to set. @@ -1176,8 +1196,8 @@ public SiteAuthSettingsProperties withAuthFilePath(String authFilePath) { } /** - * Get the configVersion property: The ConfigVersion of the Authentication / Authorization feature in use for the - * current app. + * Get the configVersion property: + * The ConfigVersion of the Authentication / Authorization feature in use for the current app. * The setting in this value can control the behavior of the control plane for Authentication / Authorization. * * @return the configVersion value. @@ -1187,8 +1207,8 @@ public String configVersion() { } /** - * Set the configVersion property: The ConfigVersion of the Authentication / Authorization feature in use for the - * current app. + * Set the configVersion property: + * The ConfigVersion of the Authentication / Authorization feature in use for the current app. * The setting in this value can control the behavior of the control plane for Authentication / Authorization. * * @param configVersion the configVersion value to set. diff --git a/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SitePatchResourceInner.java b/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SitePatchResourceInner.java index 8e090c336f4c..f1eebeb8de6e 100644 --- a/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SitePatchResourceInner.java +++ b/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SitePatchResourceInner.java @@ -529,7 +529,8 @@ public SitePatchResourceInner withClientCertEnabled(Boolean clientCertEnabled) { } /** - * Get the clientCertMode property: This composes with ClientCertEnabled setting. + * Get the clientCertMode property: + * This composes with ClientCertEnabled setting. * - ClientCertEnabled: false means ClientCert is ignored. * - ClientCertEnabled: true and ClientCertMode: Required means ClientCert is required. * - ClientCertEnabled: true and ClientCertMode: Optional means ClientCert is optional or accepted. @@ -541,7 +542,8 @@ public ClientCertMode clientCertMode() { } /** - * Set the clientCertMode property: This composes with ClientCertEnabled setting. + * Set the clientCertMode property: + * This composes with ClientCertEnabled setting. * - ClientCertEnabled: false means ClientCert is ignored. * - ClientCertEnabled: true and ClientCertMode: Required means ClientCert is required. * - ClientCertEnabled: true and ClientCertMode: Optional means ClientCert is optional or accepted. diff --git a/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SitePatchResourcePropertiesInner.java b/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SitePatchResourcePropertiesInner.java index 7c1b31f43b3f..a45950e67a0e 100644 --- a/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SitePatchResourcePropertiesInner.java +++ b/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SitePatchResourcePropertiesInner.java @@ -147,6 +147,7 @@ public final class SitePatchResourcePropertiesInner implements JsonSerializable< private Boolean clientCertEnabled; /* + * * This composes with ClientCertEnabled setting. * - ClientCertEnabled: false means ClientCert is ignored. * - ClientCertEnabled: true and ClientCertMode: Required means ClientCert is required. @@ -637,7 +638,8 @@ public SitePatchResourcePropertiesInner withClientCertEnabled(Boolean clientCert } /** - * Get the clientCertMode property: This composes with ClientCertEnabled setting. + * Get the clientCertMode property: + * This composes with ClientCertEnabled setting. * - ClientCertEnabled: false means ClientCert is ignored. * - ClientCertEnabled: true and ClientCertMode: Required means ClientCert is required. * - ClientCertEnabled: true and ClientCertMode: Optional means ClientCert is optional or accepted. @@ -649,7 +651,8 @@ public ClientCertMode clientCertMode() { } /** - * Set the clientCertMode property: This composes with ClientCertEnabled setting. + * Set the clientCertMode property: + * This composes with ClientCertEnabled setting. * - ClientCertEnabled: false means ClientCert is ignored. * - ClientCertEnabled: true and ClientCertMode: Required means ClientCert is required. * - ClientCertEnabled: true and ClientCertMode: Optional means ClientCert is optional or accepted. diff --git a/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SnapshotRestoreRequestProperties.java b/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SnapshotRestoreRequestProperties.java index bf83fd6e2861..7ac0d017fba7 100644 --- a/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SnapshotRestoreRequestProperties.java +++ b/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/SnapshotRestoreRequestProperties.java @@ -39,6 +39,7 @@ public final class SnapshotRestoreRequestProperties implements JsonSerializable< private Boolean recoverConfiguration; /* + * * If true, custom hostname conflicts will be ignored when recovering to a target web app. * This setting is only necessary when RecoverConfiguration is enabled. */ @@ -142,8 +143,8 @@ public SnapshotRestoreRequestProperties withRecoverConfiguration(Boolean recover } /** - * Get the ignoreConflictingHostNames property: If true, custom hostname conflicts will be ignored when recovering - * to a target web app. + * Get the ignoreConflictingHostNames property: + * If true, custom hostname conflicts will be ignored when recovering to a target web app. * This setting is only necessary when RecoverConfiguration is enabled. * * @return the ignoreConflictingHostNames value. @@ -153,8 +154,8 @@ public Boolean ignoreConflictingHostNames() { } /** - * Set the ignoreConflictingHostNames property: If true, custom hostname conflicts will be ignored when recovering - * to a target web app. + * Set the ignoreConflictingHostNames property: + * If true, custom hostname conflicts will be ignored when recovering to a target web app. * This setting is only necessary when RecoverConfiguration is enabled. * * @param ignoreConflictingHostNames the ignoreConflictingHostNames value to set. diff --git a/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServicePlanPatchResource.java b/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServicePlanPatchResource.java index 26e82aa4328f..466e5625f663 100644 --- a/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServicePlanPatchResource.java +++ b/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AppServicePlanPatchResource.java @@ -212,8 +212,8 @@ public String geoRegion() { } /** - * Get the perSiteScaling property: If <code>true</code>, apps assigned to this App Service plan can be - * scaled independently. + * Get the perSiteScaling property: + * If <code>true</code>, apps assigned to this App Service plan can be scaled independently. * If <code>false</code>, apps assigned to this App Service plan will scale to all instances of the * plan. * @@ -224,8 +224,8 @@ public Boolean perSiteScaling() { } /** - * Set the perSiteScaling property: If <code>true</code>, apps assigned to this App Service plan can be - * scaled independently. + * Set the perSiteScaling property: + * If <code>true</code>, apps assigned to this App Service plan can be scaled independently. * If <code>false</code>, apps assigned to this App Service plan will scale to all instances of the * plan. * @@ -535,8 +535,8 @@ public AppServicePlanPatchResource withKubeEnvironmentProfile(KubeEnvironmentPro } /** - * Get the zoneRedundant property: If <code>true</code>, this App Service Plan will perform availability - * zone balancing. + * Get the zoneRedundant property: + * If <code>true</code>, this App Service Plan will perform availability zone balancing. * If <code>false</code>, this App Service Plan will not perform availability zone balancing. * * @return the zoneRedundant value. @@ -546,8 +546,8 @@ public Boolean zoneRedundant() { } /** - * Set the zoneRedundant property: If <code>true</code>, this App Service Plan will perform availability - * zone balancing. + * Set the zoneRedundant property: + * If <code>true</code>, this App Service Plan will perform availability zone balancing. * If <code>false</code>, this App Service Plan will not perform availability zone balancing. * * @param zoneRedundant the zoneRedundant value to set. diff --git a/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AutoHealActions.java b/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AutoHealActions.java index ea47e5eb34b8..a530a3e3211b 100644 --- a/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AutoHealActions.java +++ b/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/AutoHealActions.java @@ -27,6 +27,7 @@ public final class AutoHealActions implements JsonSerializable private AutoHealCustomAction customAction; /* + * * Minimum time the process must execute * before taking the action */ @@ -79,7 +80,8 @@ public AutoHealActions withCustomAction(AutoHealCustomAction customAction) { } /** - * Get the minProcessExecutionTime property: Minimum time the process must execute + * Get the minProcessExecutionTime property: + * Minimum time the process must execute * before taking the action. * * @return the minProcessExecutionTime value. @@ -89,7 +91,8 @@ public String minProcessExecutionTime() { } /** - * Set the minProcessExecutionTime property: Minimum time the process must execute + * Set the minProcessExecutionTime property: + * Minimum time the process must execute * before taking the action. * * @param minProcessExecutionTime the minProcessExecutionTime value to set. diff --git a/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SnapshotRestoreRequest.java b/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SnapshotRestoreRequest.java index 3b8cfd145875..66b6013d60b0 100644 --- a/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SnapshotRestoreRequest.java +++ b/sdk/appservice/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/SnapshotRestoreRequest.java @@ -189,8 +189,8 @@ public SnapshotRestoreRequest withRecoverConfiguration(Boolean recoverConfigurat } /** - * Get the ignoreConflictingHostNames property: If true, custom hostname conflicts will be ignored when recovering - * to a target web app. + * Get the ignoreConflictingHostNames property: + * If true, custom hostname conflicts will be ignored when recovering to a target web app. * This setting is only necessary when RecoverConfiguration is enabled. * * @return the ignoreConflictingHostNames value. @@ -200,8 +200,8 @@ public Boolean ignoreConflictingHostNames() { } /** - * Set the ignoreConflictingHostNames property: If true, custom hostname conflicts will be ignored when recovering - * to a target web app. + * Set the ignoreConflictingHostNames property: + * If true, custom hostname conflicts will be ignored when recovering to a target web app. * This setting is only necessary when RecoverConfiguration is enabled. * * @param ignoreConflictingHostNames the ignoreConflictingHostNames value to set. diff --git a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/IdentitySource.java b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/IdentitySource.java index e5bcdc6c737f..d1c0924799a2 100644 --- a/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/IdentitySource.java +++ b/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/IdentitySource.java @@ -57,12 +57,14 @@ public final class IdentitySource implements JsonSerializable { private SslEnum ssl; /* + * * The ID of an Active Directory user with a minimum of read-only access to Base * DN for users and group */ private String username; /* + * * The password of the Active Directory user with a minimum of read-only access to * Base DN for users and groups. */ @@ -235,7 +237,8 @@ public IdentitySource withSsl(SslEnum ssl) { } /** - * Get the username property: The ID of an Active Directory user with a minimum of read-only access to Base + * Get the username property: + * The ID of an Active Directory user with a minimum of read-only access to Base * DN for users and group. * * @return the username value. @@ -245,7 +248,8 @@ public String username() { } /** - * Set the username property: The ID of an Active Directory user with a minimum of read-only access to Base + * Set the username property: + * The ID of an Active Directory user with a minimum of read-only access to Base * DN for users and group. * * @param username the username value to set. @@ -257,7 +261,8 @@ public IdentitySource withUsername(String username) { } /** - * Get the password property: The password of the Active Directory user with a minimum of read-only access to + * Get the password property: + * The password of the Active Directory user with a minimum of read-only access to * Base DN for users and groups. * * @return the password value. @@ -267,7 +272,8 @@ public String password() { } /** - * Set the password property: The password of the Active Directory user with a minimum of read-only access to + * Set the password property: + * The password of the Active Directory user with a minimum of read-only access to * Base DN for users and groups. * * @param password the password value to set. diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/PhysicalToLogicalZoneMapping.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/PhysicalToLogicalZoneMapping.java index f097b31ae1d6..46c4265b6aae 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/PhysicalToLogicalZoneMapping.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/PhysicalToLogicalZoneMapping.java @@ -22,6 +22,7 @@ public final class PhysicalToLogicalZoneMapping implements JsonSerializable { /* - * Host pattern to match using DNS wildcard syntax (e.g., "*.openai.com"). - * A leading "*." matches any subdomain. Omit to match all hosts. + * Host pattern to match using DNS wildcard syntax (e.g., "\*.openai.com"). + * A leading "\*." matches any subdomain. Omit to match all hosts. */ private String host; /* - * Path pattern to match using URI prefix with '*' wildcard (e.g., "/v1/*"). - * Omit to match all paths. + * Path pattern to match using URI prefix matching. + * An asterisk serves as a single-segment wildcard. + * For example, "/v1/\*" matches "/v1/chat". Omit to match all paths. */ private String path; @@ -38,8 +40,8 @@ public RaiEgressRuleMatch() { } /** - * Get the host property: Host pattern to match using DNS wildcard syntax (e.g., "*.openai.com"). - * A leading "*." matches any subdomain. Omit to match all hosts. + * Get the host property: Host pattern to match using DNS wildcard syntax (e.g., "\*.openai.com"). + * A leading "\*." matches any subdomain. Omit to match all hosts. * * @return the host value. */ @@ -48,8 +50,8 @@ public String host() { } /** - * Set the host property: Host pattern to match using DNS wildcard syntax (e.g., "*.openai.com"). - * A leading "*." matches any subdomain. Omit to match all hosts. + * Set the host property: Host pattern to match using DNS wildcard syntax (e.g., "\*.openai.com"). + * A leading "\*." matches any subdomain. Omit to match all hosts. * * @param host the host value to set. * @return the RaiEgressRuleMatch object itself. @@ -60,8 +62,9 @@ public RaiEgressRuleMatch withHost(String host) { } /** - * Get the path property: Path pattern to match using URI prefix with '*' wildcard (e.g., "/v1/*"). - * Omit to match all paths. + * Get the path property: Path pattern to match using URI prefix matching. + * An asterisk serves as a single-segment wildcard. + * For example, "/v1/\*" matches "/v1/chat". Omit to match all paths. * * @return the path value. */ @@ -70,8 +73,9 @@ public String path() { } /** - * Set the path property: Path pattern to match using URI prefix with '*' wildcard (e.g., "/v1/*"). - * Omit to match all paths. + * Set the path property: Path pattern to match using URI prefix matching. + * An asterisk serves as a single-segment wildcard. + * For example, "/v1/\*" matches "/v1/chat". Omit to match all paths. * * @param path the path value to set. * @return the RaiEgressRuleMatch object itself. diff --git a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/tsp-location.yaml b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/tsp-location.yaml index bafbd5abd0b4..cecbdf3bb541 100644 --- a/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/tsp-location.yaml +++ b/sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/cognitiveservices/CognitiveServices.Management -commit: fc12374be89d7869e1a5cff58b7586c9dcb6bf64 +commit: 39bf1b80fd8bc55b091192d51d67433c84930639 repo: Azure/azure-rest-api-specs additionalDirectories: diff --git a/sdk/compute/azure-resourcemanager-compute/src/samples/java/com/azure/resourcemanager/compute/generated/UsageListSamples.java b/sdk/compute/azure-resourcemanager-compute/src/samples/java/com/azure/resourcemanager/compute/generated/UsageListSamples.java index f6fba57eb03c..458bddd5bcf5 100644 --- a/sdk/compute/azure-resourcemanager-compute/src/samples/java/com/azure/resourcemanager/compute/generated/UsageListSamples.java +++ b/sdk/compute/azure-resourcemanager-compute/src/samples/java/com/azure/resourcemanager/compute/generated/UsageListSamples.java @@ -29,6 +29,6 @@ public static void usageListMinimumSetGen(com.azure.resourcemanager.compute.Comp * @param manager Entry point to ComputeManager. */ public static void usageListMaximumSetGen(com.azure.resourcemanager.compute.ComputeManager manager) { - manager.serviceClient().getUsages().list("4.0", com.azure.core.util.Context.NONE); + manager.serviceClient().getUsages().list("4_.", com.azure.core.util.Context.NONE); } } diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VMCategory.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VMCategory.java index 712db453e194..c3d97aa34fbe 100644 --- a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VMCategory.java +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/VMCategory.java @@ -32,20 +32,23 @@ public final class VMCategory extends ExpandableStringEnum { public static final VMCategory MEMORY_OPTIMIZED = fromString("MemoryOptimized"); /** - * Storage optimized virtual machine (VM) sizes offer high disk throughput and IO, and are ideal for Big Data, SQL, - * NoSQL databases, data warehousing, and large transactional databases. + * Storage optimized virtual machine (VM) + * sizes offer high disk throughput and IO, and are ideal for Big Data, SQL, NoSQL databases, data warehousing, and + * large transactional databases. * Examples include Cassandra, MongoDB, Cloudera, and Redis. */ public static final VMCategory STORAGE_OPTIMIZED = fromString("StorageOptimized"); /** - * GPU optimized VM sizes are specialized virtual machines available with single, multiple, or fractional GPUs. + * GPU optimized VM sizes are specialized + * virtual machines available with single, multiple, or fractional GPUs. * These sizes are designed for compute-intensive, graphics-intensive, and visualization workloads. */ public static final VMCategory GPU_ACCELERATED = fromString("GpuAccelerated"); /** - * FPGA optimized VM sizes are specialized virtual machines available with single or multiple FPGA. + * FPGA optimized VM sizes are specialized + * virtual machines available with single or multiple FPGA. * These sizes are designed for compute-intensive workloads. This article provides information about the number and * type of FPGA, vCPUs, data disks, and NICs. * Storage throughput and network bandwidth are also included for each size in this grouping. @@ -53,8 +56,9 @@ public final class VMCategory extends ExpandableStringEnum { public static final VMCategory FPGA_ACCELERATED = fromString("FpgaAccelerated"); /** - * Azure High Performance Compute VMs are optimized for various HPC workloads such as computational fluid dynamics, - * finite element analysis, frontend and backend EDA, + * Azure High Performance Compute VMs are + * optimized for various HPC workloads such as computational fluid dynamics, finite element analysis, frontend and + * backend EDA, * rendering, molecular dynamics, computational geo science, weather simulation, and financial risk analysis. */ public static final VMCategory HIGH_PERFORMANCE_COMPUTE = fromString("HighPerformanceCompute"); diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ZoneDistributionStrategy.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ZoneDistributionStrategy.java index 4c866d47a0a7..7b8e53305776 100644 --- a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ZoneDistributionStrategy.java +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ZoneDistributionStrategy.java @@ -12,19 +12,22 @@ */ public final class ZoneDistributionStrategy extends ExpandableStringEnum { /** - * Default. Launch instances in a single zone based on best effort. + * Default. Launch instances in a single zone + * based on best effort. * If capacity is not available, LaunchBulkInstancesOperation can allocate capacity in different zones. */ public static final ZoneDistributionStrategy BEST_EFFORT_SINGLE_ZONE = fromString("BestEffortSingleZone"); /** - * Launch instances based on zone preferences. + * Launch instances based on zone + * preferences. * Higher priority zones are filled first before allocating to lower priority zones. */ public static final ZoneDistributionStrategy PRIORITIZED = fromString("Prioritized"); /** - * Balance launching instances across zones specified based on best effort. + * Balance launching instances across zones + * specified based on best effort. * If capacity is not available, LaunchBulkInstancesOperation can deviate balancing across all zones. */ public static final ZoneDistributionStrategy BEST_EFFORT_BALANCED = fromString("BestEffortBalanced"); diff --git a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ZonePreference.java b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ZonePreference.java index a80bddcce40a..c7490da34257 100644 --- a/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ZonePreference.java +++ b/sdk/computebulkactions/azure-resourcemanager-computebulkactions/src/main/java/com/azure/resourcemanager/computebulkactions/models/ZonePreference.java @@ -22,7 +22,8 @@ public final class ZonePreference implements JsonSerializable { private String zone; /* - * The rank of the zone. This is used with 'Prioritized' ZoneDistributionStrategy. + * The rank of the zone. This is used with + * 'Prioritized' ZoneDistributionStrategy. * The lower the number, the higher the priority, starting with 0. * 0 is the highest rank. If not specified, defaults to lowest rank. */ @@ -55,7 +56,8 @@ public ZonePreference withZone(String zone) { } /** - * Get the rank property: The rank of the zone. This is used with 'Prioritized' ZoneDistributionStrategy. + * Get the rank property: The rank of the zone. This is used with + * 'Prioritized' ZoneDistributionStrategy. * The lower the number, the higher the priority, starting with 0. * 0 is the highest rank. If not specified, defaults to lowest rank. * @@ -66,7 +68,8 @@ public Integer rank() { } /** - * Set the rank property: The rank of the zone. This is used with 'Prioritized' ZoneDistributionStrategy. + * Set the rank property: The rank of the zone. This is used with + * 'Prioritized' ZoneDistributionStrategy. * The lower the number, the higher the priority, starting with 0. * 0 is the highest rank. If not specified, defaults to lowest rank. * diff --git a/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/models/AdditionalUnattendContent.java b/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/models/AdditionalUnattendContent.java index 952b28f17a3f..34bdfc5e0a2a 100644 --- a/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/models/AdditionalUnattendContent.java +++ b/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/models/AdditionalUnattendContent.java @@ -30,12 +30,14 @@ public final class AdditionalUnattendContent implements JsonSerializable { /* + * * Specifies the reboot setting for all AutomaticByPlatform patch installation * operations. */ @@ -36,7 +37,8 @@ public LinuxVMGuestPatchAutomaticByPlatformSettings() { } /** - * Get the rebootSetting property: Specifies the reboot setting for all AutomaticByPlatform patch installation + * Get the rebootSetting property: + * Specifies the reboot setting for all AutomaticByPlatform patch installation * operations. * * @return the rebootSetting value. @@ -46,7 +48,8 @@ public LinuxVMGuestPatchAutomaticByPlatformRebootSetting rebootSetting() { } /** - * Set the rebootSetting property: Specifies the reboot setting for all AutomaticByPlatform patch installation + * Set the rebootSetting property: + * Specifies the reboot setting for all AutomaticByPlatform patch installation * operations. * * @param rebootSetting the rebootSetting value to set. diff --git a/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/models/VMDiskSecurityProfile.java b/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/models/VMDiskSecurityProfile.java index 217264e20639..f5b01bd349ba 100644 --- a/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/models/VMDiskSecurityProfile.java +++ b/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/models/VMDiskSecurityProfile.java @@ -18,6 +18,7 @@ @Fluent public final class VMDiskSecurityProfile implements JsonSerializable { /* + * * Specifies the EncryptionType of the managed disk. It is set to * DiskWithVMGuestState for encryption of the managed disk along with VMGuestState * blob, VMGuestStateOnly for encryption of just the VMGuestState blob, and @@ -27,6 +28,7 @@ public final class VMDiskSecurityProfile implements JsonSerializable { /* + * * If a value is provided and is different from the previous value, the extension * handler will be forced to update even if the extension configuration has not * changed. @@ -43,6 +44,7 @@ public final class VirtualMachineScaleSetExtensionProperties private String typeHandlerVersion; /* + * * Indicates whether the extension should use a newer minor version if one is * available at deployment time. Once deployed, however, the extension will not * upgrade minor versions unless redeployed, even with this property set to true. @@ -50,6 +52,7 @@ public final class VirtualMachineScaleSetExtensionProperties private Boolean autoUpgradeMinorVersion; /* + * * Indicates whether the extension should be automatically upgraded by the * platform if there is a newer version of the extension available. */ @@ -72,12 +75,14 @@ public final class VirtualMachineScaleSetExtensionProperties private String provisioningState; /* + * * Collection of extension names after which this extension needs to be * provisioned. */ private List provisionAfterExtensions; /* + * * Indicates whether failures stemming from the extension will be suppressed * (Operational failures such as not connecting to the VM will not be suppressed * regardless of this value). The default is false. @@ -85,6 +90,7 @@ public final class VirtualMachineScaleSetExtensionProperties private Boolean suppressFailures; /* + * * The extensions protected settings that are passed by reference, and consumed * from key vault */ @@ -97,7 +103,8 @@ public VirtualMachineScaleSetExtensionProperties() { } /** - * Get the forceUpdateTag property: If a value is provided and is different from the previous value, the extension + * Get the forceUpdateTag property: + * If a value is provided and is different from the previous value, the extension * handler will be forced to update even if the extension configuration has not * changed. * @@ -108,7 +115,8 @@ public String forceUpdateTag() { } /** - * Set the forceUpdateTag property: If a value is provided and is different from the previous value, the extension + * Set the forceUpdateTag property: + * If a value is provided and is different from the previous value, the extension * handler will be forced to update even if the extension configuration has not * changed. * @@ -181,8 +189,8 @@ public VirtualMachineScaleSetExtensionProperties withTypeHandlerVersion(String t } /** - * Get the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one - * is + * Get the autoUpgradeMinorVersion property: + * Indicates whether the extension should use a newer minor version if one is * available at deployment time. Once deployed, however, the extension will not * upgrade minor versions unless redeployed, even with this property set to true. * @@ -193,8 +201,8 @@ public Boolean autoUpgradeMinorVersion() { } /** - * Set the autoUpgradeMinorVersion property: Indicates whether the extension should use a newer minor version if one - * is + * Set the autoUpgradeMinorVersion property: + * Indicates whether the extension should use a newer minor version if one is * available at deployment time. Once deployed, however, the extension will not * upgrade minor versions unless redeployed, even with this property set to true. * @@ -207,7 +215,8 @@ public VirtualMachineScaleSetExtensionProperties withAutoUpgradeMinorVersion(Boo } /** - * Get the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * Get the enableAutomaticUpgrade property: + * Indicates whether the extension should be automatically upgraded by the * platform if there is a newer version of the extension available. * * @return the enableAutomaticUpgrade value. @@ -217,7 +226,8 @@ public Boolean enableAutomaticUpgrade() { } /** - * Set the enableAutomaticUpgrade property: Indicates whether the extension should be automatically upgraded by the + * Set the enableAutomaticUpgrade property: + * Indicates whether the extension should be automatically upgraded by the * platform if there is a newer version of the extension available. * * @param enableAutomaticUpgrade the enableAutomaticUpgrade value to set. @@ -280,7 +290,8 @@ public String provisioningState() { } /** - * Get the provisionAfterExtensions property: Collection of extension names after which this extension needs to be + * Get the provisionAfterExtensions property: + * Collection of extension names after which this extension needs to be * provisioned. * * @return the provisionAfterExtensions value. @@ -290,7 +301,8 @@ public List provisionAfterExtensions() { } /** - * Set the provisionAfterExtensions property: Collection of extension names after which this extension needs to be + * Set the provisionAfterExtensions property: + * Collection of extension names after which this extension needs to be * provisioned. * * @param provisionAfterExtensions the provisionAfterExtensions value to set. @@ -303,7 +315,8 @@ public List provisionAfterExtensions() { } /** - * Get the suppressFailures property: Indicates whether failures stemming from the extension will be suppressed + * Get the suppressFailures property: + * Indicates whether failures stemming from the extension will be suppressed * (Operational failures such as not connecting to the VM will not be suppressed * regardless of this value). The default is false. * @@ -314,7 +327,8 @@ public Boolean suppressFailures() { } /** - * Set the suppressFailures property: Indicates whether failures stemming from the extension will be suppressed + * Set the suppressFailures property: + * Indicates whether failures stemming from the extension will be suppressed * (Operational failures such as not connecting to the VM will not be suppressed * regardless of this value). The default is false. * @@ -327,8 +341,8 @@ public VirtualMachineScaleSetExtensionProperties withSuppressFailures(Boolean su } /** - * Get the protectedSettingsFromKeyVault property: The extensions protected settings that are passed by reference, - * and consumed + * Get the protectedSettingsFromKeyVault property: + * The extensions protected settings that are passed by reference, and consumed * from key vault. * * @return the protectedSettingsFromKeyVault value. @@ -338,8 +352,8 @@ public KeyVaultSecretReference protectedSettingsFromKeyVault() { } /** - * Set the protectedSettingsFromKeyVault property: The extensions protected settings that are passed by reference, - * and consumed + * Set the protectedSettingsFromKeyVault property: + * The extensions protected settings that are passed by reference, and consumed * from key vault. * * @param protectedSettingsFromKeyVault the protectedSettingsFromKeyVault value to set. diff --git a/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/models/VirtualMachineScaleSetIPConfiguration.java b/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/models/VirtualMachineScaleSetIPConfiguration.java index a8c460630ccb..5885a824aaf7 100644 --- a/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/models/VirtualMachineScaleSetIPConfiguration.java +++ b/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/models/VirtualMachineScaleSetIPConfiguration.java @@ -23,6 +23,7 @@ public final class VirtualMachineScaleSetIPConfiguration private String name; /* + * * Describes a virtual machine scale set network profile's IP configuration * properties. */ @@ -55,7 +56,8 @@ public VirtualMachineScaleSetIPConfiguration withName(String name) { } /** - * Get the properties property: Describes a virtual machine scale set network profile's IP configuration + * Get the properties property: + * Describes a virtual machine scale set network profile's IP configuration * properties. * * @return the properties value. @@ -65,7 +67,8 @@ public VirtualMachineScaleSetIPConfigurationProperties properties() { } /** - * Set the properties property: Describes a virtual machine scale set network profile's IP configuration + * Set the properties property: + * Describes a virtual machine scale set network profile's IP configuration * properties. * * @param properties the properties value to set. diff --git a/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/models/VirtualMachineScaleSetNetworkConfigurationProperties.java b/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/models/VirtualMachineScaleSetNetworkConfigurationProperties.java index facaa2b175cd..2b3d5b563416 100644 --- a/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/models/VirtualMachineScaleSetNetworkConfigurationProperties.java +++ b/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/models/VirtualMachineScaleSetNetworkConfigurationProperties.java @@ -20,6 +20,7 @@ public final class VirtualMachineScaleSetNetworkConfigurationProperties implements JsonSerializable { /* + * * Specifies the primary network interface in case the virtual machine has more * than 1 network interface. */ @@ -66,12 +67,14 @@ public final class VirtualMachineScaleSetNetworkConfigurationProperties private DeleteOptions deleteOption; /* + * * Specifies whether the Auxiliary mode is enabled for the Network Interface * resource. */ private NetworkInterfaceAuxiliaryMode auxiliaryMode; /* + * * Specifies whether the Auxiliary sku is enabled for the Network Interface * resource. */ @@ -84,7 +87,8 @@ public VirtualMachineScaleSetNetworkConfigurationProperties() { } /** - * Get the primary property: Specifies the primary network interface in case the virtual machine has more + * Get the primary property: + * Specifies the primary network interface in case the virtual machine has more * than 1 network interface. * * @return the primary value. @@ -94,7 +98,8 @@ public Boolean primary() { } /** - * Set the primary property: Specifies the primary network interface in case the virtual machine has more + * Set the primary property: + * Specifies the primary network interface in case the virtual machine has more * than 1 network interface. * * @param primary the primary value to set. @@ -275,7 +280,8 @@ public VirtualMachineScaleSetNetworkConfigurationProperties withDeleteOption(Del } /** - * Get the auxiliaryMode property: Specifies whether the Auxiliary mode is enabled for the Network Interface + * Get the auxiliaryMode property: + * Specifies whether the Auxiliary mode is enabled for the Network Interface * resource. * * @return the auxiliaryMode value. @@ -285,7 +291,8 @@ public NetworkInterfaceAuxiliaryMode auxiliaryMode() { } /** - * Set the auxiliaryMode property: Specifies whether the Auxiliary mode is enabled for the Network Interface + * Set the auxiliaryMode property: + * Specifies whether the Auxiliary mode is enabled for the Network Interface * resource. * * @param auxiliaryMode the auxiliaryMode value to set. @@ -298,7 +305,8 @@ public NetworkInterfaceAuxiliaryMode auxiliaryMode() { } /** - * Get the auxiliarySku property: Specifies whether the Auxiliary sku is enabled for the Network Interface + * Get the auxiliarySku property: + * Specifies whether the Auxiliary sku is enabled for the Network Interface * resource. * * @return the auxiliarySku value. @@ -308,7 +316,8 @@ public NetworkInterfaceAuxiliarySku auxiliarySku() { } /** - * Set the auxiliarySku property: Specifies whether the Auxiliary sku is enabled for the Network Interface + * Set the auxiliarySku property: + * Specifies whether the Auxiliary sku is enabled for the Network Interface * resource. * * @param auxiliarySku the auxiliarySku value to set. diff --git a/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/models/WinRMListener.java b/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/models/WinRMListener.java index 2ec4b204943c..33376ece79a8 100644 --- a/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/models/WinRMListener.java +++ b/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/models/WinRMListener.java @@ -17,6 +17,7 @@ @Fluent public final class WinRMListener implements JsonSerializable { /* + * * Specifies the protocol of WinRM listener. Possible values are: **http,** * **https.** */ @@ -46,7 +47,8 @@ public WinRMListener() { } /** - * Get the protocol property: Specifies the protocol of WinRM listener. Possible values are: **http,** + * Get the protocol property: + * Specifies the protocol of WinRM listener. Possible values are: **http,** * **https.**. * * @return the protocol value. @@ -56,7 +58,8 @@ public ProtocolTypes protocol() { } /** - * Set the protocol property: Specifies the protocol of WinRM listener. Possible values are: **http,** + * Set the protocol property: + * Specifies the protocol of WinRM listener. Possible values are: **http,** * **https.**. * * @param protocol the protocol value to set. diff --git a/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/models/WindowsVMGuestPatchAutomaticByPlatformSettings.java b/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/models/WindowsVMGuestPatchAutomaticByPlatformSettings.java index b5448d09efa5..94c246fd8868 100644 --- a/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/models/WindowsVMGuestPatchAutomaticByPlatformSettings.java +++ b/sdk/computefleet/azure-resourcemanager-computefleet/src/main/java/com/azure/resourcemanager/computefleet/models/WindowsVMGuestPatchAutomaticByPlatformSettings.java @@ -19,6 +19,7 @@ public final class WindowsVMGuestPatchAutomaticByPlatformSettings implements JsonSerializable { /* + * * Specifies the reboot setting for all AutomaticByPlatform patch installation * operations. */ @@ -36,7 +37,8 @@ public WindowsVMGuestPatchAutomaticByPlatformSettings() { } /** - * Get the rebootSetting property: Specifies the reboot setting for all AutomaticByPlatform patch installation + * Get the rebootSetting property: + * Specifies the reboot setting for all AutomaticByPlatform patch installation * operations. * * @return the rebootSetting value. @@ -46,7 +48,8 @@ public WindowsVMGuestPatchAutomaticByPlatformRebootSetting rebootSetting() { } /** - * Set the rebootSetting property: Specifies the reboot setting for all AutomaticByPlatform patch installation + * Set the rebootSetting property: + * Specifies the reboot setting for all AutomaticByPlatform patch installation * operations. * * @param rebootSetting the rebootSetting value to set. diff --git a/sdk/computeschedule/azure-resourcemanager-computeschedule/src/main/java/com/azure/resourcemanager/computeschedule/fluent/OccurrencesClient.java b/sdk/computeschedule/azure-resourcemanager-computeschedule/src/main/java/com/azure/resourcemanager/computeschedule/fluent/OccurrencesClient.java index 85bc96cb4cd8..6d67f9552194 100644 --- a/sdk/computeschedule/azure-resourcemanager-computeschedule/src/main/java/com/azure/resourcemanager/computeschedule/fluent/OccurrencesClient.java +++ b/sdk/computeschedule/azure-resourcemanager-computeschedule/src/main/java/com/azure/resourcemanager/computeschedule/fluent/OccurrencesClient.java @@ -145,7 +145,7 @@ RecurringActionsResourceOperationResultInner cancel(String resourceGroupName, St String occurrenceId, CancelOccurrenceRequest body); /** - * A long-running resource action. + * The delay operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scheduledActionName The name of the ScheduledAction. @@ -162,7 +162,7 @@ RecurringActionsResourceOperationResultInner cancel(String resourceGroupName, St beginDelay(String resourceGroupName, String scheduledActionName, String occurrenceId, DelayRequest body); /** - * A long-running resource action. + * The delay operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scheduledActionName The name of the ScheduledAction. @@ -181,7 +181,7 @@ RecurringActionsResourceOperationResultInner cancel(String resourceGroupName, St Context context); /** - * A long-running resource action. + * The delay operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scheduledActionName The name of the ScheduledAction. @@ -197,7 +197,7 @@ RecurringActionsResourceOperationResultInner delay(String resourceGroupName, Str String occurrenceId, DelayRequest body); /** - * A long-running resource action. + * The delay operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scheduledActionName The name of the ScheduledAction. diff --git a/sdk/computeschedule/azure-resourcemanager-computeschedule/src/main/java/com/azure/resourcemanager/computeschedule/implementation/OccurrencesClientImpl.java b/sdk/computeschedule/azure-resourcemanager-computeschedule/src/main/java/com/azure/resourcemanager/computeschedule/implementation/OccurrencesClientImpl.java index d41e2d6bcf30..cb17285751ea 100644 --- a/sdk/computeschedule/azure-resourcemanager-computeschedule/src/main/java/com/azure/resourcemanager/computeschedule/implementation/OccurrencesClientImpl.java +++ b/sdk/computeschedule/azure-resourcemanager-computeschedule/src/main/java/com/azure/resourcemanager/computeschedule/implementation/OccurrencesClientImpl.java @@ -616,7 +616,7 @@ public RecurringActionsResourceOperationResultInner cancel(String resourceGroupN } /** - * A long-running resource action. + * The delay operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scheduledActionName The name of the ScheduledAction. @@ -641,7 +641,7 @@ private Mono>> delayWithResponseAsync(String resourceG } /** - * A long-running resource action. + * The delay operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scheduledActionName The name of the ScheduledAction. @@ -664,7 +664,7 @@ private Response delayWithResponse(String resourceGroupName, String } /** - * A long-running resource action. + * The delay operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scheduledActionName The name of the ScheduledAction. @@ -688,7 +688,7 @@ private Response delayWithResponse(String resourceGroupName, String } /** - * A long-running resource action. + * The delay operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scheduledActionName The name of the ScheduledAction. @@ -713,7 +713,7 @@ private Response delayWithResponse(String resourceGroupName, String } /** - * A long-running resource action. + * The delay operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scheduledActionName The name of the ScheduledAction. @@ -737,7 +737,7 @@ private Response delayWithResponse(String resourceGroupName, String } /** - * A long-running resource action. + * The delay operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scheduledActionName The name of the ScheduledAction. @@ -764,7 +764,7 @@ private Response delayWithResponse(String resourceGroupName, String } /** - * A long-running resource action. + * The delay operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scheduledActionName The name of the ScheduledAction. @@ -784,7 +784,7 @@ private Mono delayAsync(String res } /** - * A long-running resource action. + * The delay operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scheduledActionName The name of the ScheduledAction. @@ -802,7 +802,7 @@ public RecurringActionsResourceOperationResultInner delay(String resourceGroupNa } /** - * A long-running resource action. + * The delay operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scheduledActionName The name of the ScheduledAction. diff --git a/sdk/computeschedule/azure-resourcemanager-computeschedule/src/main/java/com/azure/resourcemanager/computeschedule/models/Occurrences.java b/sdk/computeschedule/azure-resourcemanager-computeschedule/src/main/java/com/azure/resourcemanager/computeschedule/models/Occurrences.java index 2332a6280725..876a25d1ef45 100644 --- a/sdk/computeschedule/azure-resourcemanager-computeschedule/src/main/java/com/azure/resourcemanager/computeschedule/models/Occurrences.java +++ b/sdk/computeschedule/azure-resourcemanager-computeschedule/src/main/java/com/azure/resourcemanager/computeschedule/models/Occurrences.java @@ -128,7 +128,7 @@ RecurringActionsResourceOperationResult cancel(String resourceGroupName, String String occurrenceId, CancelOccurrenceRequest body); /** - * A long-running resource action. + * The delay operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scheduledActionName The name of the ScheduledAction. @@ -143,7 +143,7 @@ RecurringActionsResourceOperationResult delay(String resourceGroupName, String s String occurrenceId, DelayRequest body); /** - * A long-running resource action. + * The delay operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param scheduledActionName The name of the ScheduledAction. diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-tasks/src/main/java/com/azure/resourcemanager/containerregistry/tasks/models/CustomRegistryCredentials.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-tasks/src/main/java/com/azure/resourcemanager/containerregistry/tasks/models/CustomRegistryCredentials.java index d248bfb6d1bd..628306d3f5df 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry-tasks/src/main/java/com/azure/resourcemanager/containerregistry/tasks/models/CustomRegistryCredentials.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-tasks/src/main/java/com/azure/resourcemanager/containerregistry/tasks/models/CustomRegistryCredentials.java @@ -22,6 +22,7 @@ public final class CustomRegistryCredentials implements JsonSerializable arguments() { } /** - * Set the arguments property: Gets or sets the collection of override arguments to be used when + * Set the arguments property: + * Gets or sets the collection of override arguments to be used when * executing a build step. * * @param arguments the arguments value to set. diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry-tasks/src/main/java/com/azure/resourcemanager/containerregistry/tasks/models/SourceRegistryCredentials.java b/sdk/containerregistry/azure-resourcemanager-containerregistry-tasks/src/main/java/com/azure/resourcemanager/containerregistry/tasks/models/SourceRegistryCredentials.java index 5f9cce4e1463..96d924c38fa4 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry-tasks/src/main/java/com/azure/resourcemanager/containerregistry/tasks/models/SourceRegistryCredentials.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry-tasks/src/main/java/com/azure/resourcemanager/containerregistry/tasks/models/SourceRegistryCredentials.java @@ -17,6 +17,7 @@ @Fluent public final class SourceRegistryCredentials implements JsonSerializable { /* + * * The Entra identity used for source registry login. * The value is `[system]` for system-assigned managed identity, `[caller]` for caller identity, * and client ID for user-assigned managed identity. @@ -24,6 +25,7 @@ public final class SourceRegistryCredentials implements JsonSerializable { /* + * * Name of the group. * It must match a group name of an existing fleet member. */ private String name; /* + * * The max number of upgrades that can run concurrently in this specific group. * Acts as a ceiling (and not a quota) for the number of concurrent upgrades within the group you want to tolerate * at a time. @@ -59,7 +61,8 @@ public UpdateGroup() { } /** - * Get the name property: Name of the group. + * Get the name property: + * Name of the group. * It must match a group name of an existing fleet member. * * @return the name value. @@ -69,7 +72,8 @@ public String name() { } /** - * Set the name property: Name of the group. + * Set the name property: + * Name of the group. * It must match a group name of an existing fleet member. * * @param name the name value to set. @@ -81,7 +85,8 @@ public UpdateGroup withName(String name) { } /** - * Get the maxConcurrency property: The max number of upgrades that can run concurrently in this specific group. + * Get the maxConcurrency property: + * The max number of upgrades that can run concurrently in this specific group. * Acts as a ceiling (and not a quota) for the number of concurrent upgrades within the group you want to tolerate * at a time. * Actual concurrency may be lower depending on stage-level concurrency limits or individual member conditions. @@ -104,7 +109,8 @@ public String maxConcurrency() { } /** - * Set the maxConcurrency property: The max number of upgrades that can run concurrently in this specific group. + * Set the maxConcurrency property: + * The max number of upgrades that can run concurrently in this specific group. * Acts as a ceiling (and not a quota) for the number of concurrent upgrades within the group you want to tolerate * at a time. * Actual concurrency may be lower depending on stage-level concurrency limits or individual member conditions. diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/UpgradeChannel.java b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/UpgradeChannel.java index b276c4efe4a3..7052c77ad23d 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/UpgradeChannel.java +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/src/main/java/com/azure/resourcemanager/containerservicefleet/models/UpgradeChannel.java @@ -12,8 +12,9 @@ */ public final class UpgradeChannel extends ExpandableStringEnum { /** - * Upgrades the clusters kubernetes version to the latest supported patch release on minor version N-1, where N is - * the latest supported minor version. + * Upgrades the clusters kubernetes + * version to the latest supported patch release on minor version N-1, where N is the latest supported minor + * version. * For example, if a cluster runs version 1.17.7 and versions 1.17.9, 1.18.4, 1.18.6, and 1.19.1 are available, the * cluster upgrades to 1.18.6. */ @@ -31,8 +32,8 @@ public final class UpgradeChannel extends ExpandableStringEnum { public static final UpgradeChannel NODE_IMAGE = fromString("NodeImage"); /** - * Upgrades the clusters Kubernetes version to the latest supported patch version of the specified target Kubernetes - * version. + * Upgrades the clusters Kubernetes + * version to the latest supported patch version of the specified target Kubernetes version. * For information on the behavior of update run for Kubernetes version upgrade, * see https://learn.microsoft.com/en-us/azure/kubernetes-fleet/update-orchestration?tabs=azure-portal. */ diff --git a/sdk/contentunderstanding/azure-ai-contentunderstanding/src/main/java/com/azure/ai/contentunderstanding/ContentUnderstandingAsyncClient.java b/sdk/contentunderstanding/azure-ai-contentunderstanding/src/main/java/com/azure/ai/contentunderstanding/ContentUnderstandingAsyncClient.java index a777b0a32bc3..6d0d131693db 100644 --- a/sdk/contentunderstanding/azure-ai-contentunderstanding/src/main/java/com/azure/ai/contentunderstanding/ContentUnderstandingAsyncClient.java +++ b/sdk/contentunderstanding/azure-ai-contentunderstanding/src/main/java/com/azure/ai/contentunderstanding/ContentUnderstandingAsyncClient.java @@ -1535,7 +1535,8 @@ public Mono> updateDefaultsWithResponse(BinaryData updateDe * * @param analyzerId The unique identifier of the analyzer. * @param inputs Inputs to analyze. Currently, only pro mode supports multiple inputs. - * @param stringEncoding The string encoding format for content spans in the response. + * @param stringEncoding The string encoding format for content spans in + * the response. * Possible values are 'codePoint', 'utf16', and `utf8`. Default is `codePoint`."). * @param modelDeployments Specify the default mapping of model names to LLM/embedding deployments in Microsoft * Foundry. For details and current semantics, see https://aka.ms/cudoc-quickstart-rest. @@ -1569,7 +1570,8 @@ PollerFlux beginAnalyze(S * * @param analyzerId The unique identifier of the analyzer. * @param inputs Inputs to analyze. Currently, only pro mode supports multiple inputs. - * @param stringEncoding The string encoding format for content spans in the response. + * @param stringEncoding The string encoding format for content spans in + * the response. * Possible values are 'codePoint', 'utf16', and `utf8`. Default is `codePoint`."). * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. @@ -1596,7 +1598,8 @@ PollerFlux beginAnalyze(S * * @param analyzerId The unique identifier of the analyzer. * @param binaryInput The binary content of the document to analyze. - * @param stringEncoding The string encoding format for content spans in the response. + * @param stringEncoding The string encoding format for content spans in + * the response. * Possible values are 'codePoint', 'utf16', and `utf8`. Default is `codePoint`."). * @param contentType Request content type. * @param contentRange Range of the input to analyze (ex. `1-3,5,9-`). Document content uses 1-based page numbers, @@ -1632,7 +1635,8 @@ PollerFlux beginAnalyzeBi * * @param analyzerId The unique identifier of the analyzer. * @param binaryInput The binary content of the document to analyze. - * @param stringEncoding The string encoding format for content spans in the response. + * @param stringEncoding The string encoding format for content spans in + * the response. * Possible values are 'codePoint', 'utf16', and `utf8`. Default is `codePoint`."). * @param contentType Request content type. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/contentunderstanding/azure-ai-contentunderstanding/src/main/java/com/azure/ai/contentunderstanding/ContentUnderstandingClient.java b/sdk/contentunderstanding/azure-ai-contentunderstanding/src/main/java/com/azure/ai/contentunderstanding/ContentUnderstandingClient.java index b68689cdf78b..8d571c97eda9 100644 --- a/sdk/contentunderstanding/azure-ai-contentunderstanding/src/main/java/com/azure/ai/contentunderstanding/ContentUnderstandingClient.java +++ b/sdk/contentunderstanding/azure-ai-contentunderstanding/src/main/java/com/azure/ai/contentunderstanding/ContentUnderstandingClient.java @@ -1523,7 +1523,8 @@ public Response updateDefaultsWithResponse(BinaryData updateDefaults * * @param analyzerId The unique identifier of the analyzer. * @param inputs Inputs to analyze. Currently, only pro mode supports multiple inputs. - * @param stringEncoding The string encoding format for content spans in the response. + * @param stringEncoding The string encoding format for content spans in + * the response. * Possible values are 'codePoint', 'utf16', and `utf8`. Default is `codePoint`."). * @param modelDeployments Specify the default mapping of model names to LLM/embedding deployments in Microsoft * Foundry. For details and current semantics, see https://aka.ms/cudoc-quickstart-rest. @@ -1557,7 +1558,8 @@ SyncPoller beginAnalyze(S * * @param analyzerId The unique identifier of the analyzer. * @param inputs Inputs to analyze. Currently, only pro mode supports multiple inputs. - * @param stringEncoding The string encoding format for content spans in the response. + * @param stringEncoding The string encoding format for content spans in + * the response. * Possible values are 'codePoint', 'utf16', and `utf8`. Default is `codePoint`."). * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. @@ -1584,7 +1586,8 @@ SyncPoller beginAnalyze(S * * @param analyzerId The unique identifier of the analyzer. * @param binaryInput The binary content of the document to analyze. - * @param stringEncoding The string encoding format for content spans in the response. + * @param stringEncoding The string encoding format for content spans in + * the response. * Possible values are 'codePoint', 'utf16', and `utf8`. Default is `codePoint`."). * @param contentType Request content type. * @param contentRange Range of the input to analyze (ex. `1-3,5,9-`). Document content uses 1-based page numbers, @@ -1620,7 +1623,8 @@ SyncPoller beginAnalyzeBi * * @param analyzerId The unique identifier of the analyzer. * @param binaryInput The binary content of the document to analyze. - * @param stringEncoding The string encoding format for content spans in the response. + * @param stringEncoding The string encoding format for content spans in + * the response. * Possible values are 'codePoint', 'utf16', and `utf8`. Default is `codePoint`."). * @param contentType Request content type. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/contentunderstanding/azure-ai-contentunderstanding/src/main/java/com/azure/ai/contentunderstanding/models/AnalysisResult.java b/sdk/contentunderstanding/azure-ai-contentunderstanding/src/main/java/com/azure/ai/contentunderstanding/models/AnalysisResult.java index abe73c72ad56..21308c5fe5a1 100644 --- a/sdk/contentunderstanding/azure-ai-contentunderstanding/src/main/java/com/azure/ai/contentunderstanding/models/AnalysisResult.java +++ b/sdk/contentunderstanding/azure-ai-contentunderstanding/src/main/java/com/azure/ai/contentunderstanding/models/AnalysisResult.java @@ -47,7 +47,8 @@ public final class AnalysisResult implements JsonSerializable { private List warnings; /* - * The string encoding format for content spans in the response. + * The string encoding format for content spans in the + * response. * Possible values are 'codePoint', 'utf16', and `utf8`. Default is `codePoint`.") */ @Generated @@ -110,7 +111,8 @@ public List getWarnings() { } /** - * Get the stringEncoding property: The string encoding format for content spans in the response. + * Get the stringEncoding property: The string encoding format for content spans in the + * response. * Possible values are 'codePoint', 'utf16', and `utf8`. Default is `codePoint`."). * * @return the stringEncoding value. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/DeletedBackupInstancesClient.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/DeletedBackupInstancesClient.java index 08d3bf4b71a5..92264da64466 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/DeletedBackupInstancesClient.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/DeletedBackupInstancesClient.java @@ -75,7 +75,7 @@ Response getWithResponse(String resourceGrou PagedIterable list(String resourceGroupName, String vaultName, Context context); /** - * A long-running resource action. + * The undelete operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param vaultName The name of the backup vault. @@ -90,7 +90,7 @@ SyncPoller, Void> beginUndelete(String resourceGroupName, Strin String backupInstanceName); /** - * A long-running resource action. + * The undelete operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param vaultName The name of the backup vault. @@ -106,7 +106,7 @@ SyncPoller, Void> beginUndelete(String resourceGroupName, Strin String backupInstanceName, Context context); /** - * A long-running resource action. + * The undelete operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param vaultName The name of the backup vault. @@ -119,7 +119,7 @@ SyncPoller, Void> beginUndelete(String resourceGroupName, Strin void undelete(String resourceGroupName, String vaultName, String backupInstanceName); /** - * A long-running resource action. + * The undelete operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param vaultName The name of the backup vault. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DeletedBackupInstancesClientImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DeletedBackupInstancesClientImpl.java index 18879f627f08..b404854d26b0 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DeletedBackupInstancesClientImpl.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/DeletedBackupInstancesClientImpl.java @@ -336,7 +336,7 @@ public PagedIterable list(String resourceGro } /** - * A long-running resource action. + * The undelete operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param vaultName The name of the backup vault. @@ -356,7 +356,7 @@ private Mono>> undeleteWithResponseAsync(String resour } /** - * A long-running resource action. + * The undelete operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param vaultName The name of the backup vault. @@ -374,7 +374,7 @@ private Response undeleteWithResponse(String resourceGroupName, Stri } /** - * A long-running resource action. + * The undelete operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param vaultName The name of the backup vault. @@ -393,7 +393,7 @@ private Response undeleteWithResponse(String resourceGroupName, Stri } /** - * A long-running resource action. + * The undelete operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param vaultName The name of the backup vault. @@ -413,7 +413,7 @@ private PollerFlux, Void> beginUndeleteAsync(String resourceGro } /** - * A long-running resource action. + * The undelete operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param vaultName The name of the backup vault. @@ -431,7 +431,7 @@ public SyncPoller, Void> beginUndelete(String resourceGroupName } /** - * A long-running resource action. + * The undelete operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param vaultName The name of the backup vault. @@ -450,7 +450,7 @@ public SyncPoller, Void> beginUndelete(String resourceGroupName } /** - * A long-running resource action. + * The undelete operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param vaultName The name of the backup vault. @@ -467,7 +467,7 @@ private Mono undeleteAsync(String resourceGroupName, String vaultName, Str } /** - * A long-running resource action. + * The undelete operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param vaultName The name of the backup vault. @@ -482,7 +482,7 @@ public void undelete(String resourceGroupName, String vaultName, String backupIn } /** - * A long-running resource action. + * The undelete operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param vaultName The name of the backup vault. diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DeletedBackupInstances.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DeletedBackupInstances.java index b1274849253f..e9abe22823fb 100644 --- a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DeletedBackupInstances.java +++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/models/DeletedBackupInstances.java @@ -66,7 +66,7 @@ Response getWithResponse(String resourceGroupName PagedIterable list(String resourceGroupName, String vaultName, Context context); /** - * A long-running resource action. + * The undelete operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param vaultName The name of the backup vault. @@ -78,7 +78,7 @@ Response getWithResponse(String resourceGroupName void undelete(String resourceGroupName, String vaultName, String backupInstanceName); /** - * A long-running resource action. + * The undelete operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param vaultName The name of the backup vault. diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/CredentialsClient.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/CredentialsClient.java index 64cbd6736a29..5506dc8e2049 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/CredentialsClient.java +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/CredentialsClient.java @@ -247,7 +247,7 @@ CredentialInner update(String resourceGroupName, String namespaceName, Credentia PagedIterable listByResourceGroup(String resourceGroupName, String namespaceName, Context context); /** - * A long-running resource action. + * The synchronize operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -260,7 +260,7 @@ CredentialInner update(String resourceGroupName, String namespaceName, Credentia SyncPoller, Void> beginSynchronize(String resourceGroupName, String namespaceName); /** - * A long-running resource action. + * The synchronize operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -275,7 +275,7 @@ SyncPoller, Void> beginSynchronize(String resourceGroupName, St Context context); /** - * A long-running resource action. + * The synchronize operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -287,7 +287,7 @@ SyncPoller, Void> beginSynchronize(String resourceGroupName, St void synchronize(String resourceGroupName, String namespaceName); /** - * A long-running resource action. + * The synchronize operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/NamespaceDevicesClient.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/NamespaceDevicesClient.java index 9fcbcc89b32a..daf8e8098383 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/NamespaceDevicesClient.java +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/NamespaceDevicesClient.java @@ -267,7 +267,7 @@ PagedIterable listByResourceGroup(String resourceGroupName Context context); /** - * A long-running resource action. + * The revoke operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -283,7 +283,7 @@ SyncPoller, Void> beginRevoke(String resourceGroupName, String DeviceCredentialsRevokeRequest body); /** - * A long-running resource action. + * The revoke operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -300,7 +300,7 @@ SyncPoller, Void> beginRevoke(String resourceGroupName, String DeviceCredentialsRevokeRequest body, Context context); /** - * A long-running resource action. + * The revoke operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -314,7 +314,7 @@ SyncPoller, Void> beginRevoke(String resourceGroupName, String void revoke(String resourceGroupName, String namespaceName, String deviceName, DeviceCredentialsRevokeRequest body); /** - * A long-running resource action. + * The revoke operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/PoliciesClient.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/PoliciesClient.java index 26447eb5f0a4..2e5e37935066 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/PoliciesClient.java +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/fluent/PoliciesClient.java @@ -264,7 +264,7 @@ PolicyInner update(String resourceGroupName, String namespaceName, String policy PagedIterable listByResourceGroup(String resourceGroupName, String namespaceName, Context context); /** - * A long-running resource action. + * The revokeIssuer operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -279,7 +279,7 @@ SyncPoller, Void> beginRevokeIssuer(String resourceGroupName, S String policyName); /** - * A long-running resource action. + * The revokeIssuer operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -295,7 +295,7 @@ SyncPoller, Void> beginRevokeIssuer(String resourceGroupName, S String policyName, Context context); /** - * A long-running resource action. + * The revokeIssuer operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -308,7 +308,7 @@ SyncPoller, Void> beginRevokeIssuer(String resourceGroupName, S void revokeIssuer(String resourceGroupName, String namespaceName, String policyName); /** - * A long-running resource action. + * The revokeIssuer operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/CredentialsClientImpl.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/CredentialsClientImpl.java index 9a15962cada1..46fb6d54ac53 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/CredentialsClientImpl.java +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/CredentialsClientImpl.java @@ -881,7 +881,7 @@ public PagedIterable listByResourceGroup(String resourceGroupNa } /** - * A long-running resource action. + * The synchronize operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -900,7 +900,7 @@ private Mono>> synchronizeWithResponseAsync(String res } /** - * A long-running resource action. + * The synchronize operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -916,7 +916,7 @@ private Response synchronizeWithResponse(String resourceGroupName, S } /** - * A long-running resource action. + * The synchronize operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -934,7 +934,7 @@ private Response synchronizeWithResponse(String resourceGroupName, S } /** - * A long-running resource action. + * The synchronize operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -951,7 +951,7 @@ private PollerFlux, Void> beginSynchronizeAsync(String resource } /** - * A long-running resource action. + * The synchronize operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -967,7 +967,7 @@ public SyncPoller, Void> beginSynchronize(String resourceGroupN } /** - * A long-running resource action. + * The synchronize operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -985,7 +985,7 @@ public SyncPoller, Void> beginSynchronize(String resourceGroupN } /** - * A long-running resource action. + * The synchronize operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -1001,7 +1001,7 @@ private Mono synchronizeAsync(String resourceGroupName, String namespaceNa } /** - * A long-running resource action. + * The synchronize operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -1015,7 +1015,7 @@ public void synchronize(String resourceGroupName, String namespaceName) { } /** - * A long-running resource action. + * The synchronize operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/NamespaceDevicesClientImpl.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/NamespaceDevicesClientImpl.java index 4aff3afac66d..7436e363b218 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/NamespaceDevicesClientImpl.java +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/NamespaceDevicesClientImpl.java @@ -935,7 +935,7 @@ public PagedIterable listByResourceGroup(String resourceGr } /** - * A long-running resource action. + * The revoke operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -960,7 +960,7 @@ private Mono>> revokeWithResponseAsync(String resource } /** - * A long-running resource action. + * The revoke operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -982,7 +982,7 @@ private Response revokeWithResponse(String resourceGroupName, String } /** - * A long-running resource action. + * The revoke operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -1005,7 +1005,7 @@ private Response revokeWithResponse(String resourceGroupName, String } /** - * A long-running resource action. + * The revoke operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -1026,7 +1026,7 @@ private PollerFlux, Void> beginRevokeAsync(String resourceGroup } /** - * A long-running resource action. + * The revoke operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -1045,7 +1045,7 @@ public SyncPoller, Void> beginRevoke(String resourceGroupName, } /** - * A long-running resource action. + * The revoke operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -1065,7 +1065,7 @@ public SyncPoller, Void> beginRevoke(String resourceGroupName, } /** - * A long-running resource action. + * The revoke operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -1084,7 +1084,7 @@ private Mono revokeAsync(String resourceGroupName, String namespaceName, S } /** - * A long-running resource action. + * The revoke operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -1101,7 +1101,7 @@ public void revoke(String resourceGroupName, String namespaceName, String device } /** - * A long-running resource action. + * The revoke operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/PoliciesClientImpl.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/PoliciesClientImpl.java index ccf7293599c7..cad68971ba79 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/PoliciesClientImpl.java +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/implementation/PoliciesClientImpl.java @@ -948,7 +948,7 @@ public PagedIterable listByResourceGroup(String resourceGroupName, } /** - * A long-running resource action. + * The revokeIssuer operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -968,7 +968,7 @@ private Mono>> revokeIssuerWithResponseAsync(String re } /** - * A long-running resource action. + * The revokeIssuer operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -986,7 +986,7 @@ private Response revokeIssuerWithResponse(String resourceGroupName, } /** - * A long-running resource action. + * The revokeIssuer operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -1005,7 +1005,7 @@ private Response revokeIssuerWithResponse(String resourceGroupName, } /** - * A long-running resource action. + * The revokeIssuer operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -1025,7 +1025,7 @@ private PollerFlux, Void> beginRevokeIssuerAsync(String resourc } /** - * A long-running resource action. + * The revokeIssuer operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -1043,7 +1043,7 @@ public SyncPoller, Void> beginRevokeIssuer(String resourceGroup } /** - * A long-running resource action. + * The revokeIssuer operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -1062,7 +1062,7 @@ public SyncPoller, Void> beginRevokeIssuer(String resourceGroup } /** - * A long-running resource action. + * The revokeIssuer operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -1079,7 +1079,7 @@ private Mono revokeIssuerAsync(String resourceGroupName, String namespaceN } /** - * A long-running resource action. + * The revokeIssuer operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -1094,7 +1094,7 @@ public void revokeIssuer(String resourceGroupName, String namespaceName, String } /** - * A long-running resource action. + * The revokeIssuer operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/Credentials.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/Credentials.java index d079717052dd..23845116ac0c 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/Credentials.java +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/Credentials.java @@ -142,7 +142,7 @@ Credential createOrUpdate(String resourceGroupName, String namespaceName, Creden PagedIterable listByResourceGroup(String resourceGroupName, String namespaceName, Context context); /** - * A long-running resource action. + * The synchronize operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -153,7 +153,7 @@ Credential createOrUpdate(String resourceGroupName, String namespaceName, Creden void synchronize(String resourceGroupName, String namespaceName); /** - * A long-running resource action. + * The synchronize operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/NamespaceDevice.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/NamespaceDevice.java index 788fecf29c37..c87641d5f65b 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/NamespaceDevice.java +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/NamespaceDevice.java @@ -293,7 +293,7 @@ interface WithProperties { NamespaceDevice refresh(Context context); /** - * A long-running resource action. + * The revoke operation. * * @param body The content of the action request. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -303,7 +303,7 @@ interface WithProperties { void revoke(DeviceCredentialsRevokeRequest body); /** - * A long-running resource action. + * The revoke operation. * * @param body The content of the action request. * @param context The context to associate with this operation. diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/NamespaceDevices.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/NamespaceDevices.java index b8a1c5ed5e45..bafaa286daa0 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/NamespaceDevices.java +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/NamespaceDevices.java @@ -91,7 +91,7 @@ Response getWithResponse(String resourceGroupName, String names PagedIterable listByResourceGroup(String resourceGroupName, String namespaceName, Context context); /** - * A long-running resource action. + * The revoke operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -104,7 +104,7 @@ Response getWithResponse(String resourceGroupName, String names void revoke(String resourceGroupName, String namespaceName, String deviceName, DeviceCredentialsRevokeRequest body); /** - * A long-running resource action. + * The revoke operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/Policies.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/Policies.java index bba492bb4482..531303017ca0 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/Policies.java +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/Policies.java @@ -91,7 +91,7 @@ Response getWithResponse(String resourceGroupName, String namespaceName, PagedIterable listByResourceGroup(String resourceGroupName, String namespaceName, Context context); /** - * A long-running resource action. + * The revokeIssuer operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. @@ -103,7 +103,7 @@ Response getWithResponse(String resourceGroupName, String namespaceName, void revokeIssuer(String resourceGroupName, String namespaceName, String policyName); /** - * A long-running resource action. + * The revokeIssuer operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param namespaceName The name of the namespace. diff --git a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/Policy.java b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/Policy.java index ee71cf639bf8..6afdb32953c4 100644 --- a/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/Policy.java +++ b/sdk/deviceregistry/azure-resourcemanager-deviceregistry/src/main/java/com/azure/resourcemanager/deviceregistry/models/Policy.java @@ -188,7 +188,7 @@ interface WithProperties { Policy refresh(Context context); /** - * A long-running resource action. + * The revokeIssuer operation. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -196,7 +196,7 @@ interface WithProperties { void revokeIssuer(); /** - * A long-running resource action. + * The revokeIssuer operation. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/FormulasCreateOrUpdateSamples.java b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/FormulasCreateOrUpdateSamples.java index 497ec70c614e..d6573e638887 100644 --- a/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/FormulasCreateOrUpdateSamples.java +++ b/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/samples/java/com/azure/resourcemanager/devtestlabs/generated/FormulasCreateOrUpdateSamples.java @@ -44,7 +44,7 @@ public static void formulasCreateOrUpdate(com.azure.resourcemanager.devtestlabs. .withParameters(Arrays.asList()))) .withGalleryImageReference(new GalleryImageReference().withOffer("0001-com-ubuntu-server-groovy") .withPublisher("canonical") - .withSku("2010") + .withSku("20_10") .withOsType("Linux") .withVersion("latest")) .withNetworkInterface(new NetworkInterfaceProperties().withSharedPublicIpAddressConfiguration( diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/EdgeActionVersionsClient.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/EdgeActionVersionsClient.java index ab2a5f58387e..b6da58bd2096 100644 --- a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/EdgeActionVersionsClient.java +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/fluent/EdgeActionVersionsClient.java @@ -272,7 +272,7 @@ PagedIterable listByEdgeAction(String resourceGroupName, Context context); /** - * A long-running resource action. + * The deployVersionCode operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param edgeActionName The name of the Edge Action. @@ -288,7 +288,7 @@ PagedIterable listByEdgeAction(String resourceGroupName, beginDeployVersionCode(String resourceGroupName, String edgeActionName, String version, VersionCodeInner body); /** - * A long-running resource action. + * The deployVersionCode operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param edgeActionName The name of the Edge Action. @@ -305,7 +305,7 @@ SyncPoller, EdgeActionVersionProper String resourceGroupName, String edgeActionName, String version, VersionCodeInner body, Context context); /** - * A long-running resource action. + * The deployVersionCode operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param edgeActionName The name of the Edge Action. @@ -321,7 +321,7 @@ EdgeActionVersionPropertiesInner deployVersionCode(String resourceGroupName, Str VersionCodeInner body); /** - * A long-running resource action. + * The deployVersionCode operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param edgeActionName The name of the Edge Action. diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionVersionsClientImpl.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionVersionsClientImpl.java index 3513ce7c2233..c23934f668fa 100644 --- a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionVersionsClientImpl.java +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/implementation/EdgeActionVersionsClientImpl.java @@ -990,7 +990,7 @@ public PagedIterable listByEdgeAction(String resourceGro } /** - * A long-running resource action. + * The deployVersionCode operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param edgeActionName The name of the Edge Action. @@ -1014,7 +1014,7 @@ private Mono>> deployVersionCodeWithResponseAsync(Stri } /** - * A long-running resource action. + * The deployVersionCode operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param edgeActionName The name of the Edge Action. @@ -1036,7 +1036,7 @@ private Response deployVersionCodeWithResponse(String resourceGroupN } /** - * A long-running resource action. + * The deployVersionCode operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param edgeActionName The name of the Edge Action. @@ -1059,7 +1059,7 @@ private Response deployVersionCodeWithResponse(String resourceGroupN } /** - * A long-running resource action. + * The deployVersionCode operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param edgeActionName The name of the Edge Action. @@ -1082,7 +1082,7 @@ private Response deployVersionCodeWithResponse(String resourceGroupN } /** - * A long-running resource action. + * The deployVersionCode operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param edgeActionName The name of the Edge Action. @@ -1102,7 +1102,7 @@ private Response deployVersionCodeWithResponse(String resourceGroupN } /** - * A long-running resource action. + * The deployVersionCode operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param edgeActionName The name of the Edge Action. @@ -1125,7 +1125,7 @@ private Response deployVersionCodeWithResponse(String resourceGroupN } /** - * A long-running resource action. + * The deployVersionCode operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param edgeActionName The name of the Edge Action. @@ -1144,7 +1144,7 @@ private Mono deployVersionCodeAsync(String res } /** - * A long-running resource action. + * The deployVersionCode operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param edgeActionName The name of the Edge Action. @@ -1162,7 +1162,7 @@ public EdgeActionVersionPropertiesInner deployVersionCode(String resourceGroupNa } /** - * A long-running resource action. + * The deployVersionCode operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param edgeActionName The name of the Edge Action. diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionVersion.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionVersion.java index ecece901b645..8ad940c32a23 100644 --- a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionVersion.java +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionVersion.java @@ -267,7 +267,7 @@ interface WithProperties { EdgeActionVersion refresh(Context context); /** - * A long-running resource action. + * The deployVersionCode operation. * * @param body The content of the action request. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -278,7 +278,7 @@ interface WithProperties { EdgeActionVersionProperties deployVersionCode(VersionCodeInner body); /** - * A long-running resource action. + * The deployVersionCode operation. * * @param body The content of the action request. * @param context The context to associate with this operation. diff --git a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionVersions.java b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionVersions.java index 013fd1fd2a36..3e7b5ca7a536 100644 --- a/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionVersions.java +++ b/sdk/edgeactions/azure-resourcemanager-edgeactions/src/main/java/com/azure/resourcemanager/edgeactions/models/EdgeActionVersions.java @@ -92,7 +92,7 @@ Response getWithResponse(String resourceGroupName, String edg PagedIterable listByEdgeAction(String resourceGroupName, String edgeActionName, Context context); /** - * A long-running resource action. + * The deployVersionCode operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param edgeActionName The name of the Edge Action. @@ -107,7 +107,7 @@ EdgeActionVersionProperties deployVersionCode(String resourceGroupName, String e VersionCodeInner body); /** - * A long-running resource action. + * The deployVersionCode operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param edgeActionName The name of the Edge Action. diff --git a/sdk/face/azure-ai-vision-face/tsp-location.yaml b/sdk/face/azure-ai-vision-face/tsp-location.yaml index 36a6a5076595..4df11fd791b3 100644 --- a/sdk/face/azure-ai-vision-face/tsp-location.yaml +++ b/sdk/face/azure-ai-vision-face/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/ai/Face -commit: cf80ee4aacdb4ef9926b42f09837fe16add9e66a +commit: 39bf1b80fd8bc55b091192d51d67433c84930639 repo: Azure/azure-rest-api-specs additionalDirectories: diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/PublicCloudConnectorsClient.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/PublicCloudConnectorsClient.java index 7a7b01a11a43..b71b9ffa08a5 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/PublicCloudConnectorsClient.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/PublicCloudConnectorsClient.java @@ -214,7 +214,7 @@ PublicCloudConnectorInner update(String resourceGroupName, String publicCloudCon PagedIterable list(Context context); /** - * A long-running resource action. + * The testPermissions operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param publicCloudConnector Represent public cloud connectors resource. @@ -228,7 +228,7 @@ PublicCloudConnectorInner update(String resourceGroupName, String publicCloudCon beginTestPermissions(String resourceGroupName, String publicCloudConnector); /** - * A long-running resource action. + * The testPermissions operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param publicCloudConnector Represent public cloud connectors resource. @@ -243,7 +243,7 @@ PublicCloudConnectorInner update(String resourceGroupName, String publicCloudCon beginTestPermissions(String resourceGroupName, String publicCloudConnector, Context context); /** - * A long-running resource action. + * The testPermissions operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param publicCloudConnector Represent public cloud connectors resource. @@ -256,7 +256,7 @@ PublicCloudConnectorInner update(String resourceGroupName, String publicCloudCon OperationStatusResultInner testPermissions(String resourceGroupName, String publicCloudConnector); /** - * A long-running resource action. + * The testPermissions operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param publicCloudConnector Represent public cloud connectors resource. diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/PublicCloudConnectorsClientImpl.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/PublicCloudConnectorsClientImpl.java index 1ebd1abc0093..a4090e2ff338 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/PublicCloudConnectorsClientImpl.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/PublicCloudConnectorsClientImpl.java @@ -835,7 +835,7 @@ public PagedIterable list(Context context) { } /** - * A long-running resource action. + * The testPermissions operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param publicCloudConnector Represent public cloud connectors resource. @@ -856,7 +856,7 @@ private Mono>> testPermissionsWithResponseAsync(String } /** - * A long-running resource action. + * The testPermissions operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param publicCloudConnector Represent public cloud connectors resource. @@ -873,7 +873,7 @@ private Response testPermissionsWithResponse(String resourceGroupNam } /** - * A long-running resource action. + * The testPermissions operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param publicCloudConnector Represent public cloud connectors resource. @@ -892,7 +892,7 @@ private Response testPermissionsWithResponse(String resourceGroupNam } /** - * A long-running resource action. + * The testPermissions operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param publicCloudConnector Represent public cloud connectors resource. @@ -912,7 +912,7 @@ private Response testPermissionsWithResponse(String resourceGroupNam } /** - * A long-running resource action. + * The testPermissions operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param publicCloudConnector Represent public cloud connectors resource. @@ -930,7 +930,7 @@ private Response testPermissionsWithResponse(String resourceGroupNam } /** - * A long-running resource action. + * The testPermissions operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param publicCloudConnector Represent public cloud connectors resource. @@ -949,7 +949,7 @@ private Response testPermissionsWithResponse(String resourceGroupNam } /** - * A long-running resource action. + * The testPermissions operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param publicCloudConnector Represent public cloud connectors resource. @@ -966,7 +966,7 @@ private Mono testPermissionsAsync(String resourceGro } /** - * A long-running resource action. + * The testPermissions operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param publicCloudConnector Represent public cloud connectors resource. @@ -981,7 +981,7 @@ public OperationStatusResultInner testPermissions(String resourceGroupName, Stri } /** - * A long-running resource action. + * The testPermissions operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param publicCloudConnector Represent public cloud connectors resource. diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/PublicCloudConnector.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/PublicCloudConnector.java index 10cb05922789..dbeb73cfc473 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/PublicCloudConnector.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/PublicCloudConnector.java @@ -264,7 +264,7 @@ interface WithProperties { PublicCloudConnector refresh(Context context); /** - * A long-running resource action. + * The testPermissions operation. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -273,7 +273,7 @@ interface WithProperties { OperationStatusResult testPermissions(); /** - * A long-running resource action. + * The testPermissions operation. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/PublicCloudConnectors.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/PublicCloudConnectors.java index ddadab694633..127cf637deb7 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/PublicCloudConnectors.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/PublicCloudConnectors.java @@ -107,7 +107,7 @@ Response deleteByResourceGroupWithResponse(String resourceGroupName, Strin PagedIterable list(Context context); /** - * A long-running resource action. + * The testPermissions operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param publicCloudConnector Represent public cloud connectors resource. @@ -119,7 +119,7 @@ Response deleteByResourceGroupWithResponse(String resourceGroupName, Strin OperationStatusResult testPermissions(String resourceGroupName, String publicCloudConnector); /** - * A long-running resource action. + * The testPermissions operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param publicCloudConnector Represent public cloud connectors resource. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubClientImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubClientImpl.java index 0536556f3185..7d9552739ea7 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubClientImpl.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubClientImpl.java @@ -247,7 +247,7 @@ public ResourceProviderCommonsClient getResourceProviderCommons() { this.defaultPollInterval = defaultPollInterval; this.endpoint = endpoint; this.subscriptionId = subscriptionId; - this.apiVersion = "2025-08-01-preview"; + this.apiVersion = "2026-03-01-preview"; this.operations = new OperationsClientImpl(this); this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); this.iotHubResources = new IotHubResourcesClientImpl(this); diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/GatewayVersion.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/GatewayVersion.java new file mode 100644 index 000000000000..5636c1fd5130 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/GatewayVersion.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.iothub.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The IoT hub Gateway version. + */ +public final class GatewayVersion extends ExpandableStringEnum { + /** + * V1. + */ + public static final GatewayVersion V1 = fromString("V1"); + + /** + * V2. + */ + public static final GatewayVersion V2 = fromString("V2"); + + /** + * Creates a new instance of GatewayVersion value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public GatewayVersion() { + } + + /** + * Creates or finds a GatewayVersion from its string representation. + * + * @param name a name to look for. + * @return the corresponding GatewayVersion. + */ + public static GatewayVersion fromString(String name) { + return fromString(name, GatewayVersion.class); + } + + /** + * Gets known GatewayVersion values. + * + * @return known GatewayVersion values. + */ + public static Collection values() { + return values(GatewayVersion.class); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubDetails.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubDetails.java new file mode 100644 index 000000000000..fa5140efbfb3 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubDetails.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.iothub.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Set of additional read-only properties for the IoT hub. + */ +@Immutable +public final class IotHubDetails implements JsonSerializable { + /* + * The IoT hub Gateway version. + */ + private GatewayVersion gatewayVersion; + + /** + * Creates an instance of IotHubDetails class. + */ + private IotHubDetails() { + } + + /** + * Get the gatewayVersion property: The IoT hub Gateway version. + * + * @return the gatewayVersion value. + */ + public GatewayVersion gatewayVersion() { + return this.gatewayVersion; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("gatewayVersion", + this.gatewayVersion == null ? null : this.gatewayVersion.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IotHubDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IotHubDetails if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the IotHubDetails. + */ + public static IotHubDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IotHubDetails deserializedIotHubDetails = new IotHubDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("gatewayVersion".equals(fieldName)) { + deserializedIotHubDetails.gatewayVersion = GatewayVersion.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedIotHubDetails; + }); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubProperties.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubProperties.java index 3b744a35072d..650b9b465b35 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubProperties.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/IotHubProperties.java @@ -92,6 +92,16 @@ public final class IotHubProperties implements JsonSerializable eventHubEndpoints = reader.readMap(reader1 -> EventHubProperties.fromJson(reader1)); @@ -871,6 +917,8 @@ public static IotHubProperties fromJson(JsonReader jsonReader) throws IOExceptio deserializedIotHubProperties.ipVersion = IpVersion.fromString(reader.getString()); } else if ("deviceRegistry".equals(fieldName)) { deserializedIotHubProperties.deviceRegistry = DeviceRegistry.fromJson(reader); + } else if ("iotHubDetails".equals(fieldName)) { + deserializedIotHubProperties.iotHubDetails = IotHubDetails.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingTwin.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingTwin.java index 610d2796e27a..991c7bb90251 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingTwin.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingTwin.java @@ -10,6 +10,7 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; +import java.util.Map; /** * Twin reference input parameter. This is an optional parameter. @@ -19,7 +20,7 @@ public final class RoutingTwin implements JsonSerializable { /* * Twin Tags */ - private Object tags; + private Map tags; /* * The properties property. @@ -37,7 +38,7 @@ public RoutingTwin() { * * @return the tags value. */ - public Object tags() { + public Map tags() { return this.tags; } @@ -47,7 +48,7 @@ public Object tags() { * @param tags the tags value to set. * @return the RoutingTwin object itself. */ - public RoutingTwin withTags(Object tags) { + public RoutingTwin withTags(Map tags) { this.tags = tags; return this; } @@ -78,9 +79,7 @@ public RoutingTwin withProperties(RoutingTwinProperties properties) { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - if (this.tags != null) { - jsonWriter.writeUntypedField("tags", this.tags); - } + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeUntyped(element)); jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -101,7 +100,8 @@ public static RoutingTwin fromJson(JsonReader jsonReader) throws IOException { reader.nextToken(); if ("tags".equals(fieldName)) { - deserializedRoutingTwin.tags = reader.readUntyped(); + Map tags = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedRoutingTwin.tags = tags; } else if ("properties".equals(fieldName)) { deserializedRoutingTwin.properties = RoutingTwinProperties.fromJson(reader); } else { diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingTwinProperties.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingTwinProperties.java index 3951828034ae..0ea862c77e0d 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingTwinProperties.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/RoutingTwinProperties.java @@ -10,6 +10,7 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; +import java.util.Map; /** * The RoutingTwinProperties model. @@ -19,12 +20,12 @@ public final class RoutingTwinProperties implements JsonSerializable desired; /* - * Twin desired properties + * Twin reported properties */ - private Object reported; + private Map reported; /** * Creates an instance of RoutingTwinProperties class. @@ -37,7 +38,7 @@ public RoutingTwinProperties() { * * @return the desired value. */ - public Object desired() { + public Map desired() { return this.desired; } @@ -47,27 +48,27 @@ public Object desired() { * @param desired the desired value to set. * @return the RoutingTwinProperties object itself. */ - public RoutingTwinProperties withDesired(Object desired) { + public RoutingTwinProperties withDesired(Map desired) { this.desired = desired; return this; } /** - * Get the reported property: Twin desired properties. + * Get the reported property: Twin reported properties. * * @return the reported value. */ - public Object reported() { + public Map reported() { return this.reported; } /** - * Set the reported property: Twin desired properties. + * Set the reported property: Twin reported properties. * * @param reported the reported value to set. * @return the RoutingTwinProperties object itself. */ - public RoutingTwinProperties withReported(Object reported) { + public RoutingTwinProperties withReported(Map reported) { this.reported = reported; return this; } @@ -78,12 +79,8 @@ public RoutingTwinProperties withReported(Object reported) { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - if (this.desired != null) { - jsonWriter.writeUntypedField("desired", this.desired); - } - if (this.reported != null) { - jsonWriter.writeUntypedField("reported", this.reported); - } + jsonWriter.writeMapField("desired", this.desired, (writer, element) -> writer.writeUntyped(element)); + jsonWriter.writeMapField("reported", this.reported, (writer, element) -> writer.writeUntyped(element)); return jsonWriter.writeEndObject(); } @@ -103,9 +100,11 @@ public static RoutingTwinProperties fromJson(JsonReader jsonReader) throws IOExc reader.nextToken(); if ("desired".equals(fieldName)) { - deserializedRoutingTwinProperties.desired = reader.readUntyped(); + Map desired = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedRoutingTwinProperties.desired = desired; } else if ("reported".equals(fieldName)) { - deserializedRoutingTwinProperties.reported = reader.readUntyped(); + Map reported = reader.readMap(reader1 -> reader1.readUntyped()); + deserializedRoutingTwinProperties.reported = reported; } else { reader.skipChildren(); } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesCreateOrUpdateSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesCreateOrUpdateSamples.java index 97a31267d9a9..522638105e57 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesCreateOrUpdateSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesCreateOrUpdateSamples.java @@ -11,7 +11,7 @@ */ public final class CertificatesCreateOrUpdateSamples { /* - * x-ms-original-file: 2025-08-01-preview/iothub_certificatescreateorupdate.json + * x-ms-original-file: 2026-03-01-preview/iothub_certificatescreateorupdate.json */ /** * Sample code: Certificates_CreateOrUpdate. @@ -27,7 +27,7 @@ public static void certificatesCreateOrUpdate(com.azure.resourcemanager.iothub.I } /* - * x-ms-original-file: 2025-08-01-preview/CreateOrReplace_Certificates_With_DeviceRegistryPolicy.json + * x-ms-original-file: 2026-03-01-preview/CreateOrReplace_Certificates_With_DeviceRegistryPolicy.json */ /** * Sample code: CreateOrReplace_Certificates_With_DeviceRegistryPolicy. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesDeleteSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesDeleteSamples.java index bc2dcac623a4..ca516caf0410 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesDeleteSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesDeleteSamples.java @@ -9,7 +9,7 @@ */ public final class CertificatesDeleteSamples { /* - * x-ms-original-file: 2025-08-01-preview/iothub_certificatesdelete.json + * x-ms-original-file: 2026-03-01-preview/iothub_certificatesdelete.json */ /** * Sample code: Certificates_Delete. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesGenerateVerificationCodeSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesGenerateVerificationCodeSamples.java index 04ef1d23d0b0..9e2daef54456 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesGenerateVerificationCodeSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesGenerateVerificationCodeSamples.java @@ -9,7 +9,7 @@ */ public final class CertificatesGenerateVerificationCodeSamples { /* - * x-ms-original-file: 2025-08-01-preview/iothub_generateverificationcode.json + * x-ms-original-file: 2026-03-01-preview/iothub_generateverificationcode.json */ /** * Sample code: Certificates_GenerateVerificationCode. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesGetSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesGetSamples.java index 6e644f11a84b..c79312162c6e 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesGetSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesGetSamples.java @@ -9,7 +9,7 @@ */ public final class CertificatesGetSamples { /* - * x-ms-original-file: 2025-08-01-preview/iothub_getcertificate.json + * x-ms-original-file: 2026-03-01-preview/iothub_getcertificate.json */ /** * Sample code: Certificates_Get. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesListByIotHubSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesListByIotHubSamples.java index c95eeb9076bc..f451881d77e6 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesListByIotHubSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesListByIotHubSamples.java @@ -9,7 +9,7 @@ */ public final class CertificatesListByIotHubSamples { /* - * x-ms-original-file: 2025-08-01-preview/iothub_listcertificates.json + * x-ms-original-file: 2026-03-01-preview/iothub_listcertificates.json */ /** * Sample code: Certificates_ListByIotHub. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesVerifySamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesVerifySamples.java index 7b85fb32e48f..319926201e11 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesVerifySamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/CertificatesVerifySamples.java @@ -11,7 +11,7 @@ */ public final class CertificatesVerifySamples { /* - * x-ms-original-file: 2025-08-01-preview/iothub_certverify.json + * x-ms-original-file: 2026-03-01-preview/iothub_certverify.json */ /** * Sample code: Certificates_Verify. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubManualFailoverSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubManualFailoverSamples.java index cd7bd75a9999..f4a784bfee7f 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubManualFailoverSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubManualFailoverSamples.java @@ -11,7 +11,7 @@ */ public final class IotHubManualFailoverSamples { /* - * x-ms-original-file: 2025-08-01-preview/IotHub_ManualFailover.json + * x-ms-original-file: 2026-03-01-preview/IotHub_ManualFailover.json */ /** * Sample code: IotHub_ManualFailover. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceCheckNameAvailabilitySamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceCheckNameAvailabilitySamples.java index f3529fee10a8..a86be5ff23dc 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceCheckNameAvailabilitySamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceCheckNameAvailabilitySamples.java @@ -11,7 +11,7 @@ */ public final class IotHubResourceCheckNameAvailabilitySamples { /* - * x-ms-original-file: 2025-08-01-preview/checkNameAvailability.json + * x-ms-original-file: 2026-03-01-preview/checkNameAvailability.json */ /** * Sample code: IotHubResource_CheckNameAvailability. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceCreateEventHubConsumerGroupSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceCreateEventHubConsumerGroupSamples.java index 75cb31ebe09b..b42a653b1da2 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceCreateEventHubConsumerGroupSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceCreateEventHubConsumerGroupSamples.java @@ -11,7 +11,7 @@ */ public final class IotHubResourceCreateEventHubConsumerGroupSamples { /* - * x-ms-original-file: 2025-08-01-preview/iothub_createconsumergroup.json + * x-ms-original-file: 2026-03-01-preview/iothub_createconsumergroup.json */ /** * Sample code: IotHubResource_CreateEventHubConsumerGroup. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceCreateOrUpdateSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceCreateOrUpdateSamples.java index c6d2c7517d69..0a646e95266d 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceCreateOrUpdateSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceCreateOrUpdateSamples.java @@ -34,7 +34,7 @@ */ public final class IotHubResourceCreateOrUpdateSamples { /* - * x-ms-original-file: 2025-08-01-preview/CreateOrReplace_IoTHub_With_DeviceRegistry.json + * x-ms-original-file: 2026-03-01-preview/CreateOrReplace_IoTHub_With_DeviceRegistry.json */ /** * Sample code: CreateOrReplace_IoTHub_With_DeviceRegistry. @@ -99,7 +99,7 @@ public static void createOrReplaceIoTHubWithDeviceRegistry(com.azure.resourceman } /* - * x-ms-original-file: 2025-08-01-preview/iothub_createOrUpdate.json + * x-ms-original-file: 2026-03-01-preview/iothub_createOrUpdate.json */ /** * Sample code: IotHubResource_CreateOrUpdate. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceDeleteEventHubConsumerGroupSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceDeleteEventHubConsumerGroupSamples.java index 5c36207bf6b7..679009116822 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceDeleteEventHubConsumerGroupSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceDeleteEventHubConsumerGroupSamples.java @@ -9,7 +9,7 @@ */ public final class IotHubResourceDeleteEventHubConsumerGroupSamples { /* - * x-ms-original-file: 2025-08-01-preview/iothub_deleteconsumergroup.json + * x-ms-original-file: 2026-03-01-preview/iothub_deleteconsumergroup.json */ /** * Sample code: IotHubResource_DeleteEventHubConsumerGroup. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceDeleteSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceDeleteSamples.java index bdc9f83aae98..32a47c16356e 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceDeleteSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceDeleteSamples.java @@ -9,7 +9,7 @@ */ public final class IotHubResourceDeleteSamples { /* - * x-ms-original-file: 2025-08-01-preview/iothub_delete.json + * x-ms-original-file: 2026-03-01-preview/iothub_delete.json */ /** * Sample code: IotHubResource_Delete. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceExportDevicesSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceExportDevicesSamples.java index d0db3c1c1ff1..5f8ccea20118 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceExportDevicesSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceExportDevicesSamples.java @@ -13,7 +13,7 @@ */ public final class IotHubResourceExportDevicesSamples { /* - * x-ms-original-file: 2025-08-01-preview/iothub_exportdevices.json + * x-ms-original-file: 2026-03-01-preview/iothub_exportdevices.json */ /** * Sample code: IotHubResource_ExportDevices. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetByResourceGroupSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetByResourceGroupSamples.java index 669d4b9af018..1437d56d8c28 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetByResourceGroupSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetByResourceGroupSamples.java @@ -9,7 +9,7 @@ */ public final class IotHubResourceGetByResourceGroupSamples { /* - * x-ms-original-file: 2025-08-01-preview/iothub_get.json + * x-ms-original-file: 2026-03-01-preview/iothub_get.json */ /** * Sample code: IotHubResource_Get. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetEndpointHealthSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetEndpointHealthSamples.java index 140232e37faa..808483c385d9 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetEndpointHealthSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetEndpointHealthSamples.java @@ -9,7 +9,7 @@ */ public final class IotHubResourceGetEndpointHealthSamples { /* - * x-ms-original-file: 2025-08-01-preview/iothub_routingendpointhealth.json + * x-ms-original-file: 2026-03-01-preview/iothub_routingendpointhealth.json */ /** * Sample code: IotHubResource_GetEndpointHealth. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetEventHubConsumerGroupSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetEventHubConsumerGroupSamples.java index ce6c7c1427f2..f92a111b9430 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetEventHubConsumerGroupSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetEventHubConsumerGroupSamples.java @@ -9,7 +9,7 @@ */ public final class IotHubResourceGetEventHubConsumerGroupSamples { /* - * x-ms-original-file: 2025-08-01-preview/iothub_getconsumergroup.json + * x-ms-original-file: 2026-03-01-preview/iothub_getconsumergroup.json */ /** * Sample code: IotHubResource_ListEventHubConsumerGroups. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetJobSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetJobSamples.java index 7cf30329c4b7..d28333263b5d 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetJobSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetJobSamples.java @@ -9,7 +9,7 @@ */ public final class IotHubResourceGetJobSamples { /* - * x-ms-original-file: 2025-08-01-preview/iothub_getjob.json + * x-ms-original-file: 2026-03-01-preview/iothub_getjob.json */ /** * Sample code: IotHubResource_GetJob. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetKeysForKeyNameSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetKeysForKeyNameSamples.java index 4be207a3019d..1321c03131a9 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetKeysForKeyNameSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetKeysForKeyNameSamples.java @@ -9,7 +9,7 @@ */ public final class IotHubResourceGetKeysForKeyNameSamples { /* - * x-ms-original-file: 2025-08-01-preview/iothub_getkey.json + * x-ms-original-file: 2026-03-01-preview/iothub_getkey.json */ /** * Sample code: IotHubResource_GetKeysForKeyName. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetQuotaMetricsSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetQuotaMetricsSamples.java index 78a108746cbb..95ceac249e17 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetQuotaMetricsSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetQuotaMetricsSamples.java @@ -9,7 +9,7 @@ */ public final class IotHubResourceGetQuotaMetricsSamples { /* - * x-ms-original-file: 2025-08-01-preview/iothub_quotametrics.json + * x-ms-original-file: 2026-03-01-preview/iothub_quotametrics.json */ /** * Sample code: IotHubResource_GetQuotaMetrics. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetStatsSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetStatsSamples.java index 3eb5d766e92e..f610ef431de6 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetStatsSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetStatsSamples.java @@ -9,7 +9,7 @@ */ public final class IotHubResourceGetStatsSamples { /* - * x-ms-original-file: 2025-08-01-preview/iothub_stats.json + * x-ms-original-file: 2026-03-01-preview/iothub_stats.json */ /** * Sample code: IotHubResource_GetStats. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetValidSkusSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetValidSkusSamples.java index 23000016fed7..e5355bceafbb 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetValidSkusSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceGetValidSkusSamples.java @@ -9,7 +9,7 @@ */ public final class IotHubResourceGetValidSkusSamples { /* - * x-ms-original-file: 2025-08-01-preview/iothub_getskus.json + * x-ms-original-file: 2026-03-01-preview/iothub_getskus.json */ /** * Sample code: IotHubResource_GetValidSkus. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceImportDevicesSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceImportDevicesSamples.java index 5acc0e3a7d24..4b0a150ff85f 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceImportDevicesSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceImportDevicesSamples.java @@ -11,7 +11,7 @@ */ public final class IotHubResourceImportDevicesSamples { /* - * x-ms-original-file: 2025-08-01-preview/iothub_importdevices.json + * x-ms-original-file: 2026-03-01-preview/iothub_importdevices.json */ /** * Sample code: IotHubResource_ImportDevices. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListByResourceGroupSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListByResourceGroupSamples.java index c2040062d270..21a0d9e7611c 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListByResourceGroupSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListByResourceGroupSamples.java @@ -9,7 +9,7 @@ */ public final class IotHubResourceListByResourceGroupSamples { /* - * x-ms-original-file: 2025-08-01-preview/iothub_listbyrg.json + * x-ms-original-file: 2026-03-01-preview/iothub_listbyrg.json */ /** * Sample code: IotHubResource_ListByResourceGroup. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListEventHubConsumerGroupsSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListEventHubConsumerGroupsSamples.java index 423b2ce6de11..66d0c694f98f 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListEventHubConsumerGroupsSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListEventHubConsumerGroupsSamples.java @@ -9,7 +9,7 @@ */ public final class IotHubResourceListEventHubConsumerGroupsSamples { /* - * x-ms-original-file: 2025-08-01-preview/iothub_listehgroups.json + * x-ms-original-file: 2026-03-01-preview/iothub_listehgroups.json */ /** * Sample code: IotHubResource_ListEventHubConsumerGroups. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListJobsSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListJobsSamples.java index 5cdfb0edae6e..d5dd55c4ad1e 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListJobsSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListJobsSamples.java @@ -9,7 +9,7 @@ */ public final class IotHubResourceListJobsSamples { /* - * x-ms-original-file: 2025-08-01-preview/iothub_listjobs.json + * x-ms-original-file: 2026-03-01-preview/iothub_listjobs.json */ /** * Sample code: IotHubResource_ListJobs. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListKeysSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListKeysSamples.java index 2e901ff1be07..14bfdfa2c46f 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListKeysSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListKeysSamples.java @@ -9,7 +9,7 @@ */ public final class IotHubResourceListKeysSamples { /* - * x-ms-original-file: 2025-08-01-preview/iothub_listkeys.json + * x-ms-original-file: 2026-03-01-preview/iothub_listkeys.json */ /** * Sample code: IotHubResource_ListKeys. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListSamples.java index cf9d48d9e88c..d3fd42a1dd00 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceListSamples.java @@ -9,7 +9,7 @@ */ public final class IotHubResourceListSamples { /* - * x-ms-original-file: 2025-08-01-preview/iothub_listbysubscription.json + * x-ms-original-file: 2026-03-01-preview/iothub_listbysubscription.json */ /** * Sample code: IotHubResource_ListBySubscription. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceTestAllRoutesSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceTestAllRoutesSamples.java index 85c2ca10f705..984767e502fc 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceTestAllRoutesSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceTestAllRoutesSamples.java @@ -15,7 +15,7 @@ */ public final class IotHubResourceTestAllRoutesSamples { /* - * x-ms-original-file: 2025-08-01-preview/iothub_testallroutes.json + * x-ms-original-file: 2026-03-01-preview/iothub_testallroutes.json */ /** * Sample code: IotHubResource_TestAllRoutes. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceTestRouteSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceTestRouteSamples.java index ada79bc0b5e3..199b88075bf5 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceTestRouteSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceTestRouteSamples.java @@ -17,7 +17,7 @@ */ public final class IotHubResourceTestRouteSamples { /* - * x-ms-original-file: 2025-08-01-preview/iothub_testnewroute.json + * x-ms-original-file: 2026-03-01-preview/iothub_testnewroute.json */ /** * Sample code: IotHubResource_TestRoute. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceUpdateSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceUpdateSamples.java index 16ad66281431..c68b31be343b 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceUpdateSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/IotHubResourceUpdateSamples.java @@ -13,7 +13,7 @@ */ public final class IotHubResourceUpdateSamples { /* - * x-ms-original-file: 2025-08-01-preview/iothub_patch.json + * x-ms-original-file: 2026-03-01-preview/iothub_patch.json */ /** * Sample code: IotHubResource_Update. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/OperationsListSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/OperationsListSamples.java index cec45f4615dc..b09bdf574b3d 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/OperationsListSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/OperationsListSamples.java @@ -9,7 +9,7 @@ */ public final class OperationsListSamples { /* - * x-ms-original-file: 2025-08-01-preview/iothub_operations.json + * x-ms-original-file: 2026-03-01-preview/iothub_operations.json */ /** * Sample code: Operations_List. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsDeleteSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsDeleteSamples.java index ee2fb9c2bba3..041ccfc66c99 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsDeleteSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsDeleteSamples.java @@ -9,7 +9,7 @@ */ public final class PrivateEndpointConnectionsDeleteSamples { /* - * x-ms-original-file: 2025-08-01-preview/iothub_deleteprivateendpointconnection.json + * x-ms-original-file: 2026-03-01-preview/iothub_deleteprivateendpointconnection.json */ /** * Sample code: PrivateEndpointConnection_Delete. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsGetSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsGetSamples.java index 9db8945811e8..cabe590e534a 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsGetSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsGetSamples.java @@ -9,7 +9,7 @@ */ public final class PrivateEndpointConnectionsGetSamples { /* - * x-ms-original-file: 2025-08-01-preview/iothub_getprivateendpointconnection.json + * x-ms-original-file: 2026-03-01-preview/iothub_getprivateendpointconnection.json */ /** * Sample code: PrivateEndpointConnection_Get. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsListSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsListSamples.java index 8255d998dd52..5912c44d739a 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsListSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsListSamples.java @@ -9,7 +9,7 @@ */ public final class PrivateEndpointConnectionsListSamples { /* - * x-ms-original-file: 2025-08-01-preview/iothub_listprivateendpointconnections.json + * x-ms-original-file: 2026-03-01-preview/iothub_listprivateendpointconnections.json */ /** * Sample code: PrivateEndpointConnections_List. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsUpdateSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsUpdateSamples.java index 57cc3d3207be..67c5fdeae7a4 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsUpdateSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateEndpointConnectionsUpdateSamples.java @@ -14,7 +14,7 @@ */ public final class PrivateEndpointConnectionsUpdateSamples { /* - * x-ms-original-file: 2025-08-01-preview/iothub_updateprivateendpointconnection.json + * x-ms-original-file: 2026-03-01-preview/iothub_updateprivateendpointconnection.json */ /** * Sample code: PrivateEndpointConnection_Update. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateLinkResourcesOperationGetSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateLinkResourcesOperationGetSamples.java index 203d09cca160..80cb0d22ad60 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateLinkResourcesOperationGetSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateLinkResourcesOperationGetSamples.java @@ -9,7 +9,7 @@ */ public final class PrivateLinkResourcesOperationGetSamples { /* - * x-ms-original-file: 2025-08-01-preview/iothub_getprivatelinkresources.json + * x-ms-original-file: 2026-03-01-preview/iothub_getprivatelinkresources.json */ /** * Sample code: PrivateLinkResources_List. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateLinkResourcesOperationListSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateLinkResourcesOperationListSamples.java index a901f4e329f8..fcec9d503cdf 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateLinkResourcesOperationListSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/PrivateLinkResourcesOperationListSamples.java @@ -9,7 +9,7 @@ */ public final class PrivateLinkResourcesOperationListSamples { /* - * x-ms-original-file: 2025-08-01-preview/iothub_listprivatelinkresources.json + * x-ms-original-file: 2026-03-01-preview/iothub_listprivatelinkresources.json */ /** * Sample code: PrivateLinkResources_List. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/ResourceProviderCommonGetSubscriptionQuotaSamples.java b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/ResourceProviderCommonGetSubscriptionQuotaSamples.java index e7d463c343a6..68ab21174205 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/ResourceProviderCommonGetSubscriptionQuotaSamples.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/samples/java/com/azure/resourcemanager/iothub/generated/ResourceProviderCommonGetSubscriptionQuotaSamples.java @@ -9,7 +9,7 @@ */ public final class ResourceProviderCommonGetSubscriptionQuotaSamples { /* - * x-ms-original-file: 2025-08-01-preview/iothub_usages.json + * x-ms-original-file: 2026-03-01-preview/iothub_usages.json */ /** * Sample code: ResourceProviderCommon_GetSubscriptionQuota. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubDetailsTests.java b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubDetailsTests.java new file mode 100644 index 000000000000..a742fba8c941 --- /dev/null +++ b/sdk/iothub/azure-resourcemanager-iothub/src/test/java/com/azure/resourcemanager/iothub/generated/IotHubDetailsTests.java @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.iothub.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.iothub.models.GatewayVersion; +import com.azure.resourcemanager.iothub.models.IotHubDetails; +import org.junit.jupiter.api.Assertions; + +public final class IotHubDetailsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + IotHubDetails model = BinaryData.fromString("{\"gatewayVersion\":\"V1\"}").toObject(IotHubDetails.class); + Assertions.assertEquals(GatewayVersion.V1, model.gatewayVersion()); + } +} diff --git a/sdk/iothub/azure-resourcemanager-iothub/tsp-location.yaml b/sdk/iothub/azure-resourcemanager-iothub/tsp-location.yaml index 2120e1db53b3..ce14d5eb4b42 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/tsp-location.yaml +++ b/sdk/iothub/azure-resourcemanager-iothub/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/iothub/resource-manager/Microsoft.Devices/IoTHub -commit: 0ef19ebba9ab78ef1d53f87d8dfdded6a7755151 +commit: 39bf1b80fd8bc55b091192d51d67433c84930639 repo: Azure/azure-rest-api-specs additionalDirectories: diff --git a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensions/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensions/models/ResourceIdentityType.java b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensions/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensions/models/ResourceIdentityType.java index fd933fa907c9..003ff2d64711 100644 --- a/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensions/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensions/models/ResourceIdentityType.java +++ b/sdk/kubernetesconfiguration/azure-resourcemanager-kubernetesconfiguration-extensions/src/main/java/com/azure/resourcemanager/kubernetesconfiguration/extensions/models/ResourceIdentityType.java @@ -5,7 +5,7 @@ package com.azure.resourcemanager.kubernetesconfiguration.extensions.models; /** - * Defines values for ResourceIdentityType. + * Resource Identity Type. */ public enum ResourceIdentityType { /** diff --git a/sdk/netapp/azure-resourcemanager-netapp/src/samples/java/com/azure/resourcemanager/netapp/generated/NetAppResourceUpdateNetworkSiblingSetSamples.java b/sdk/netapp/azure-resourcemanager-netapp/src/samples/java/com/azure/resourcemanager/netapp/generated/NetAppResourceUpdateNetworkSiblingSetSamples.java index b1b9b0cd1ea2..9895725ad88d 100644 --- a/sdk/netapp/azure-resourcemanager-netapp/src/samples/java/com/azure/resourcemanager/netapp/generated/NetAppResourceUpdateNetworkSiblingSetSamples.java +++ b/sdk/netapp/azure-resourcemanager-netapp/src/samples/java/com/azure/resourcemanager/netapp/generated/NetAppResourceUpdateNetworkSiblingSetSamples.java @@ -25,7 +25,7 @@ public static void networkFeaturesUpdate(com.azure.resourcemanager.netapp.NetApp .withNetworkSiblingSetId("9760acf5-4638-11e7-9bdb-020073ca3333") .withSubnetId( "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testVnet/subnets/testSubnet") - .withNetworkSiblingSetStateId("1.2345444208001578E9") + .withNetworkSiblingSetStateId("12345_44420.8001578125") .withNetworkFeatures(NetworkFeatures.STANDARD), com.azure.core.util.Context.NONE); } } diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/MonitorsClient.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/MonitorsClient.java index dfa69634c7b2..3d1b0c52bc28 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/MonitorsClient.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/fluent/MonitorsClient.java @@ -672,9 +672,7 @@ Response latestLinkedSaaSWithResponse(String reso NewRelicMonitorResourceInner linkSaaS(String resourceGroupName, String monitorName, SaaSData body, Context context); /** - * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace - * - * A long-running resource action. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -688,9 +686,7 @@ Response latestLinkedSaaSWithResponse(String reso beginResubscribe(String resourceGroupName, String monitorName); /** - * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace - * - * A long-running resource action. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -706,9 +702,7 @@ Response latestLinkedSaaSWithResponse(String reso beginResubscribe(String resourceGroupName, String monitorName, ResubscribeProperties body, Context context); /** - * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace - * - * A long-running resource action. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -721,9 +715,7 @@ Response latestLinkedSaaSWithResponse(String reso NewRelicMonitorResourceInner resubscribe(String resourceGroupName, String monitorName); /** - * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace - * - * A long-running resource action. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitorsClientImpl.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitorsClientImpl.java index d4f181e6cbc2..8eab5a28c398 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitorsClientImpl.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/implementation/MonitorsClientImpl.java @@ -2461,9 +2461,7 @@ public NewRelicMonitorResourceInner linkSaaS(String resourceGroupName, String mo } /** - * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace - * - * A long-running resource action. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -2484,9 +2482,7 @@ private Mono>> resubscribeWithResponseAsync(String res } /** - * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace - * - * A long-running resource action. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -2505,9 +2501,7 @@ private Response resubscribeWithResponse(String resourceGroupName, S } /** - * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace - * - * A long-running resource action. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -2527,9 +2521,7 @@ private Response resubscribeWithResponse(String resourceGroupName, S } /** - * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace - * - * A long-running resource action. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -2549,9 +2541,7 @@ private Response resubscribeWithResponse(String resourceGroupName, S } /** - * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace - * - * A long-running resource action. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -2571,9 +2561,7 @@ private Response resubscribeWithResponse(String resourceGroupName, S } /** - * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace - * - * A long-running resource action. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -2592,9 +2580,7 @@ private Response resubscribeWithResponse(String resourceGroupName, S } /** - * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace - * - * A long-running resource action. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -2613,9 +2599,7 @@ private Response resubscribeWithResponse(String resourceGroupName, S } /** - * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace - * - * A long-running resource action. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -2635,9 +2619,7 @@ private Response resubscribeWithResponse(String resourceGroupName, S } /** - * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace - * - * A long-running resource action. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -2655,9 +2637,7 @@ private Mono resubscribeAsync(String resourceGroup } /** - * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace - * - * A long-running resource action. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -2674,9 +2654,7 @@ private Mono resubscribeAsync(String resourceGroup } /** - * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace - * - * A long-running resource action. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -2692,9 +2670,7 @@ public NewRelicMonitorResourceInner resubscribe(String resourceGroupName, String } /** - * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace - * - * A long-running resource action. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Monitors.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Monitors.java index 8470b0991f1e..b02451a4d513 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Monitors.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/Monitors.java @@ -422,9 +422,7 @@ Response latestLinkedSaaSWithResponse(String resourceG NewRelicMonitorResource linkSaaS(String resourceGroupName, String monitorName, SaaSData body, Context context); /** - * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace - * - * A long-running resource action. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. @@ -436,9 +434,7 @@ Response latestLinkedSaaSWithResponse(String resourceG NewRelicMonitorResource resubscribe(String resourceGroupName, String monitorName); /** - * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace - * - * A long-running resource action. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param monitorName Name of the Monitors resource. diff --git a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/NewRelicMonitorResource.java b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/NewRelicMonitorResource.java index 5b04d3b11c81..55ec484da29c 100644 --- a/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/NewRelicMonitorResource.java +++ b/sdk/newrelicobservability/azure-resourcemanager-newrelicobservability/src/main/java/com/azure/resourcemanager/newrelicobservability/models/NewRelicMonitorResource.java @@ -803,9 +803,7 @@ interface WithAccountCreationSource { NewRelicMonitorResource linkSaaS(SaaSData body, Context context); /** - * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace - * - * A long-running resource action. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -814,9 +812,7 @@ interface WithAccountCreationSource { NewRelicMonitorResource resubscribe(); /** - * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace - * - * A long-running resource action. + * Resubscribes the New Relic Organization of the underline Monitor Resource to be billed by Azure Marketplace. * * @param body Resubscribe Properties. * @param context The context to associate with this operation. diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureChatExtensionConfiguration.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureChatExtensionConfiguration.java index cc5dfd1dbbeb..26534273ac5f 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureChatExtensionConfiguration.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureChatExtensionConfiguration.java @@ -12,7 +12,8 @@ import java.io.IOException; /** - * A representation of configuration data for a single Azure OpenAI chat extension. This will be used by a chat + * A representation of configuration data for a single Azure + * OpenAI chat extension. This will be used by a chat * completions request that should use Azure OpenAI chat extensions to augment the response behavior. * The use of this configuration is compatible only with Azure OpenAI. */ @@ -27,15 +28,16 @@ public AzureChatExtensionConfiguration() { } /* - * The label for the type of an Azure chat extension. This typically corresponds to a matching Azure resource. + * The label for the type of an Azure chat extension. + * This typically corresponds to a matching Azure resource. * Azure chat extensions are only compatible with Azure OpenAI. */ @Generated private AzureChatExtensionType type = AzureChatExtensionType.fromString("AzureChatExtensionConfiguration"); /** - * Get the type property: The label for the type of an Azure chat extension. This typically corresponds to a - * matching Azure resource. + * Get the type property: The label for the type of an Azure chat extension. + * This typically corresponds to a matching Azure resource. * Azure chat extensions are only compatible with Azure OpenAI. * * @return the type value. diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureChatExtensionType.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureChatExtensionType.java index defa41fc578c..7f47687717cc 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureChatExtensionType.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureChatExtensionType.java @@ -8,7 +8,8 @@ import java.util.Collection; /** - * A representation of configuration data for a single Azure OpenAI chat extension. This will be used by a chat + * A representation of configuration data for a single + * Azure OpenAI chat extension. This will be used by a chat * completions request that should use Azure OpenAI chat extensions to augment the response behavior. * The use of this configuration is compatible only with Azure OpenAI. */ diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureChatExtensionsMessageContext.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureChatExtensionsMessageContext.java index d61b26fd7b61..bac1e8d968e5 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureChatExtensionsMessageContext.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureChatExtensionsMessageContext.java @@ -13,7 +13,8 @@ import java.util.List; /** - * A representation of the additional context information available when Azure OpenAI chat extensions are involved + * A representation of the additional context + * information available when Azure OpenAI chat extensions are involved * in the generation of a corresponding chat completions response. This context information is only populated when * using an Azure OpenAI request configured to use a matching extension. */ @@ -28,7 +29,8 @@ private AzureChatExtensionsMessageContext() { } /* - * The contextual information associated with the Azure chat extensions used for a chat completions request. + * The contextual information associated with + * the Azure chat extensions used for a chat completions request. * These messages describe the data source retrievals, plugin invocations, and other intermediate steps taken in the * course of generating a chat completions response that was augmented by capabilities from Azure OpenAI chat * extensions. @@ -43,8 +45,8 @@ private AzureChatExtensionsMessageContext() { private String intent; /** - * Get the citations property: The contextual information associated with the Azure chat extensions used for a chat - * completions request. + * Get the citations property: The contextual information associated with + * the Azure chat extensions used for a chat completions request. * These messages describe the data source retrievals, plugin invocations, and other intermediate steps taken in the * course of generating a chat completions response that was augmented by capabilities from Azure OpenAI chat * extensions. diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureCosmosDBChatExtensionConfiguration.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureCosmosDBChatExtensionConfiguration.java index aad6eaf7259c..33ef0588b5a7 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureCosmosDBChatExtensionConfiguration.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureCosmosDBChatExtensionConfiguration.java @@ -44,15 +44,16 @@ public AzureCosmosDBChatExtensionConfiguration(AzureCosmosDBChatExtensionParamet } /* - * The label for the type of an Azure chat extension. This typically corresponds to a matching Azure resource. + * The label for the type of an Azure chat extension. + * This typically corresponds to a matching Azure resource. * Azure chat extensions are only compatible with Azure OpenAI. */ @Generated private AzureChatExtensionType type = AzureChatExtensionType.AZURE_COSMOS_DB; /** - * Get the type property: The label for the type of an Azure chat extension. This typically corresponds to a - * matching Azure resource. + * Get the type property: The label for the type of an Azure chat extension. + * This typically corresponds to a matching Azure resource. * Azure chat extensions are only compatible with Azure OpenAI. * * @return the type value. diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureSearchChatExtensionConfiguration.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureSearchChatExtensionConfiguration.java index cd90945f61e0..1ec296eba568 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureSearchChatExtensionConfiguration.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureSearchChatExtensionConfiguration.java @@ -44,15 +44,16 @@ public AzureSearchChatExtensionParameters getParameters() { } /* - * The label for the type of an Azure chat extension. This typically corresponds to a matching Azure resource. + * The label for the type of an Azure chat extension. + * This typically corresponds to a matching Azure resource. * Azure chat extensions are only compatible with Azure OpenAI. */ @Generated private AzureChatExtensionType type = AzureChatExtensionType.AZURE_SEARCH; /** - * Get the type property: The label for the type of an Azure chat extension. This typically corresponds to a - * matching Azure resource. + * Get the type property: The label for the type of an Azure chat extension. + * This typically corresponds to a matching Azure resource. * Azure chat extensions are only compatible with Azure OpenAI. * * @return the type value. diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ChatCompletionsOptions.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ChatCompletionsOptions.java index e1e5f6dc20a6..45743cd435d8 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ChatCompletionsOptions.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ChatCompletionsOptions.java @@ -154,7 +154,8 @@ public final class ChatCompletionsOptions implements JsonSerializable getDataSources() { } /** - * Set the dataSources property: The configuration entries for Azure OpenAI chat extensions that use them. + * Set the dataSources property: The configuration entries for Azure OpenAI chat extensions + * that use them. * This additional specification is only compatible with Azure OpenAI. * * @param dataSources the dataSources value to set. diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ChatMessageImageUrl.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ChatMessageImageUrl.java index 3dedd61fce2a..5fc4e88b2766 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ChatMessageImageUrl.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ChatMessageImageUrl.java @@ -44,6 +44,7 @@ public String getUrl() { } /* + * * The evaluation quality setting to use, which controls relative prioritization of speed, token consumption, and * accuracy. */ @@ -51,8 +52,8 @@ public String getUrl() { private ChatMessageImageDetailLevel detail; /** - * Get the detail property: The evaluation quality setting to use, which controls relative prioritization of speed, - * token consumption, and + * Get the detail property: + * The evaluation quality setting to use, which controls relative prioritization of speed, token consumption, and * accuracy. * * @return the detail value. @@ -63,8 +64,8 @@ public ChatMessageImageDetailLevel getDetail() { } /** - * Set the detail property: The evaluation quality setting to use, which controls relative prioritization of speed, - * token consumption, and + * Set the detail property: + * The evaluation quality setting to use, which controls relative prioritization of speed, token consumption, and * accuracy. * * @param detail the detail value to set. diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ElasticsearchChatExtensionConfiguration.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ElasticsearchChatExtensionConfiguration.java index d567e4b46ec7..0da14dc7cecb 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ElasticsearchChatExtensionConfiguration.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ElasticsearchChatExtensionConfiguration.java @@ -44,15 +44,16 @@ public ElasticsearchChatExtensionConfiguration(ElasticsearchChatExtensionParamet } /* - * The label for the type of an Azure chat extension. This typically corresponds to a matching Azure resource. + * The label for the type of an Azure chat extension. + * This typically corresponds to a matching Azure resource. * Azure chat extensions are only compatible with Azure OpenAI. */ @Generated private AzureChatExtensionType type = AzureChatExtensionType.ELASTICSEARCH; /** - * Get the type property: The label for the type of an Azure chat extension. This typically corresponds to a - * matching Azure resource. + * Get the type property: The label for the type of an Azure chat extension. + * This typically corresponds to a matching Azure resource. * Azure chat extensions are only compatible with Azure OpenAI. * * @return the type value. diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/MongoDBChatExtensionConfiguration.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/MongoDBChatExtensionConfiguration.java index dd35a05e079d..d6c5476cdf86 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/MongoDBChatExtensionConfiguration.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/MongoDBChatExtensionConfiguration.java @@ -17,7 +17,8 @@ public final class MongoDBChatExtensionConfiguration extends AzureChatExtensionConfiguration { /* - * The label for the type of an Azure chat extension. This typically corresponds to a matching Azure resource. + * The label for the type of an Azure chat extension. + * This typically corresponds to a matching Azure resource. * Azure chat extensions are only compatible with Azure OpenAI. */ @Generated @@ -40,8 +41,8 @@ public MongoDBChatExtensionConfiguration(MongoDBChatExtensionParameters paramete } /** - * Get the type property: The label for the type of an Azure chat extension. This typically corresponds to a - * matching Azure resource. + * Get the type property: The label for the type of an Azure chat extension. + * This typically corresponds to a matching Azure resource. * Azure chat extensions are only compatible with Azure OpenAI. * * @return the type value. diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/PineconeChatExtensionConfiguration.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/PineconeChatExtensionConfiguration.java index 5be07634e49c..0f1f1e8344c2 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/PineconeChatExtensionConfiguration.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/PineconeChatExtensionConfiguration.java @@ -44,15 +44,16 @@ public PineconeChatExtensionConfiguration(PineconeChatExtensionParameters parame } /* - * The label for the type of an Azure chat extension. This typically corresponds to a matching Azure resource. + * The label for the type of an Azure chat extension. + * This typically corresponds to a matching Azure resource. * Azure chat extensions are only compatible with Azure OpenAI. */ @Generated private AzureChatExtensionType type = AzureChatExtensionType.PINECONE; /** - * Get the type property: The label for the type of an Azure chat extension. This typically corresponds to a - * matching Azure resource. + * Get the type property: The label for the type of an Azure chat extension. + * This typically corresponds to a matching Azure resource. * Azure chat extensions are only compatible with Azure OpenAI. * * @return the type value. diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/QuotaManager.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/QuotaManager.java index 23c340fd0f79..da5c566db19d 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/QuotaManager.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/QuotaManager.java @@ -34,9 +34,11 @@ import com.azure.resourcemanager.quota.implementation.GroupQuotaSubscriptionsImpl; import com.azure.resourcemanager.quota.implementation.GroupQuotaUsagesImpl; import com.azure.resourcemanager.quota.implementation.GroupQuotasImpl; +import com.azure.resourcemanager.quota.implementation.IncomingQuotaTransfersImpl; import com.azure.resourcemanager.quota.implementation.QuotaManagementClientBuilder; import com.azure.resourcemanager.quota.implementation.QuotaOperationsImpl; import com.azure.resourcemanager.quota.implementation.QuotaRequestStatusImpl; +import com.azure.resourcemanager.quota.implementation.QuotaTransfersImpl; import com.azure.resourcemanager.quota.implementation.QuotasImpl; import com.azure.resourcemanager.quota.implementation.UsagesImpl; import com.azure.resourcemanager.quota.models.GroupQuotaLimits; @@ -48,8 +50,10 @@ import com.azure.resourcemanager.quota.models.GroupQuotaSubscriptions; import com.azure.resourcemanager.quota.models.GroupQuotaUsages; import com.azure.resourcemanager.quota.models.GroupQuotas; +import com.azure.resourcemanager.quota.models.IncomingQuotaTransfers; import com.azure.resourcemanager.quota.models.QuotaOperations; import com.azure.resourcemanager.quota.models.QuotaRequestStatus; +import com.azure.resourcemanager.quota.models.QuotaTransfers; import com.azure.resourcemanager.quota.models.Quotas; import com.azure.resourcemanager.quota.models.Usages; import java.time.Duration; @@ -69,6 +73,10 @@ public final class QuotaManager { private QuotaRequestStatus quotaRequestStatus; + private QuotaTransfers quotaTransfers; + + private IncomingQuotaTransfers incomingQuotaTransfers; + private GroupQuotas groupQuotas; private GroupQuotaLimitsRequests groupQuotaLimitsRequests; @@ -330,6 +338,31 @@ public QuotaRequestStatus quotaRequestStatus() { return quotaRequestStatus; } + /** + * Gets the resource collection API of QuotaTransfers. It manages QuotaTransfer. + * + * @return Resource collection API of QuotaTransfers. + */ + public QuotaTransfers quotaTransfers() { + if (this.quotaTransfers == null) { + this.quotaTransfers = new QuotaTransfersImpl(clientObject.getQuotaTransfers(), this); + } + return quotaTransfers; + } + + /** + * Gets the resource collection API of IncomingQuotaTransfers. + * + * @return Resource collection API of IncomingQuotaTransfers. + */ + public IncomingQuotaTransfers incomingQuotaTransfers() { + if (this.incomingQuotaTransfers == null) { + this.incomingQuotaTransfers + = new IncomingQuotaTransfersImpl(clientObject.getIncomingQuotaTransfers(), this); + } + return incomingQuotaTransfers; + } + /** * Gets the resource collection API of GroupQuotas. * diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/IncomingQuotaTransfersClient.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/IncomingQuotaTransfersClient.java new file mode 100644 index 000000000000..266f38c46559 --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/IncomingQuotaTransfersClient.java @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.quota.fluent.models.IncomingQuotaTransferInner; +import com.azure.resourcemanager.quota.models.IncomingQuotaTransferApproveRequest; +import com.azure.resourcemanager.quota.models.IncomingQuotaTransferRejectRequest; + +/** + * An instance of this class provides access to all the operations defined in IncomingQuotaTransfersClient. + */ +public interface IncomingQuotaTransfersClient { + /** + * Get an incoming quota transfer. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. + * @param transferId Server-generated identifier of the transfer (matches `properties.transferId`). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an incoming quota transfer along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String targetProvider, String region, String transferId, + Context context); + + /** + * Get an incoming quota transfer. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. + * @param transferId Server-generated identifier of the transfer (matches `properties.transferId`). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an incoming quota transfer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IncomingQuotaTransferInner get(String targetProvider, String region, String transferId); + + /** + * List incoming quota transfers at the (subscription, targetProvider, region) scope. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IncomingQuotaTransfer list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String targetProvider, String region); + + /** + * List incoming quota transfers at the (subscription, targetProvider, region) scope. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IncomingQuotaTransfer list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String targetProvider, String region, Context context); + + /** + * List incoming quota transfers across every targetProvider and region for the + * subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IncomingQuotaTransfer list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBySubscription(); + + /** + * List incoming quota transfers across every targetProvider and region for the + * subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IncomingQuotaTransfer list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBySubscription(Context context); + + /** + * Approve a Pending incoming quota transfer. Long-running. The `If-Match` header value + * must equal `properties.sourceEtag` returned on a prior GET; a stale value yields + * 412 SourceResourceModified. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. + * @param transferId Server-generated identifier of the transfer (matches `properties.transferId`). + * @param ifMatch Optimistic-concurrency precondition. Must equal `properties.sourceEtag` from a + * prior GET on the incoming transfer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of recipient-side projection of a quota transfer. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IncomingQuotaTransferInner> beginApprove(String targetProvider, + String region, String transferId, String ifMatch); + + /** + * Approve a Pending incoming quota transfer. Long-running. The `If-Match` header value + * must equal `properties.sourceEtag` returned on a prior GET; a stale value yields + * 412 SourceResourceModified. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. + * @param transferId Server-generated identifier of the transfer (matches `properties.transferId`). + * @param ifMatch Optimistic-concurrency precondition. Must equal `properties.sourceEtag` from a + * prior GET on the incoming transfer. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of recipient-side projection of a quota transfer. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, IncomingQuotaTransferInner> beginApprove(String targetProvider, + String region, String transferId, String ifMatch, IncomingQuotaTransferApproveRequest body, Context context); + + /** + * Approve a Pending incoming quota transfer. Long-running. The `If-Match` header value + * must equal `properties.sourceEtag` returned on a prior GET; a stale value yields + * 412 SourceResourceModified. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. + * @param transferId Server-generated identifier of the transfer (matches `properties.transferId`). + * @param ifMatch Optimistic-concurrency precondition. Must equal `properties.sourceEtag` from a + * prior GET on the incoming transfer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recipient-side projection of a quota transfer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IncomingQuotaTransferInner approve(String targetProvider, String region, String transferId, String ifMatch); + + /** + * Approve a Pending incoming quota transfer. Long-running. The `If-Match` header value + * must equal `properties.sourceEtag` returned on a prior GET; a stale value yields + * 412 SourceResourceModified. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. + * @param transferId Server-generated identifier of the transfer (matches `properties.transferId`). + * @param ifMatch Optimistic-concurrency precondition. Must equal `properties.sourceEtag` from a + * prior GET on the incoming transfer. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recipient-side projection of a quota transfer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IncomingQuotaTransferInner approve(String targetProvider, String region, String transferId, String ifMatch, + IncomingQuotaTransferApproveRequest body, Context context); + + /** + * Reject a Pending incoming quota transfer. Synchronous. The `If-Match` header value + * must equal `properties.sourceEtag` returned on a prior GET. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. + * @param transferId Server-generated identifier of the transfer (matches `properties.transferId`). + * @param ifMatch Optimistic-concurrency precondition. Must equal `properties.sourceEtag` from a + * prior GET on the incoming transfer. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recipient-side projection of a quota transfer along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response rejectWithResponse(String targetProvider, String region, String transferId, + String ifMatch, IncomingQuotaTransferRejectRequest body, Context context); + + /** + * Reject a Pending incoming quota transfer. Synchronous. The `If-Match` header value + * must equal `properties.sourceEtag` returned on a prior GET. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. + * @param transferId Server-generated identifier of the transfer (matches `properties.transferId`). + * @param ifMatch Optimistic-concurrency precondition. Must equal `properties.sourceEtag` from a + * prior GET on the incoming transfer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recipient-side projection of a quota transfer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + IncomingQuotaTransferInner reject(String targetProvider, String region, String transferId, String ifMatch); +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/QuotaManagementClient.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/QuotaManagementClient.java index 3861cc6fb62c..adcc335c1a49 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/QuotaManagementClient.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/QuotaManagementClient.java @@ -60,6 +60,20 @@ public interface QuotaManagementClient { */ QuotaRequestStatusClient getQuotaRequestStatus(); + /** + * Gets the QuotaTransfersClient object to access its operations. + * + * @return the QuotaTransfersClient object. + */ + QuotaTransfersClient getQuotaTransfers(); + + /** + * Gets the IncomingQuotaTransfersClient object to access its operations. + * + * @return the IncomingQuotaTransfersClient object. + */ + IncomingQuotaTransfersClient getIncomingQuotaTransfers(); + /** * Gets the GroupQuotasClient object to access its operations. * diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/QuotaTransfersClient.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/QuotaTransfersClient.java new file mode 100644 index 000000000000..6c3b36b2a74e --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/QuotaTransfersClient.java @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.quota.fluent.models.QuotaTransferInner; +import com.azure.resourcemanager.quota.models.QuotaTransferCancelRequest; + +/** + * An instance of this class provides access to all the operations defined in QuotaTransfersClient. + */ +public interface QuotaTransfersClient { + /** + * Get a quota transfer. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. A transfer URI is region-singular. + * @param transferName The donor-chosen name segment of the quota transfer. Used as the idempotency key + * for retries on the donor side. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a quota transfer along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String targetProvider, String region, String transferName, + Context context); + + /** + * Get a quota transfer. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. A transfer URI is region-singular. + * @param transferName The donor-chosen name segment of the quota transfer. Used as the idempotency key + * for retries on the donor side. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a quota transfer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + QuotaTransferInner get(String targetProvider, String region, String transferName); + + /** + * Submit a quota transfer. Idempotent on the URI: a retry with the same body returns the + * cached outcome and the same `transferId`; a retry with a different financial body + * returns 409 BodyMismatch. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. A transfer URI is region-singular. + * @param transferName The donor-chosen name segment of the quota transfer. Used as the idempotency key + * for retries on the donor side. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a quota transfer authored on the donor side. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, QuotaTransferInner> beginCreateOrUpdate(String targetProvider, + String region, String transferName, QuotaTransferInner resource); + + /** + * Submit a quota transfer. Idempotent on the URI: a retry with the same body returns the + * cached outcome and the same `transferId`; a retry with a different financial body + * returns 409 BodyMismatch. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. A transfer URI is region-singular. + * @param transferName The donor-chosen name segment of the quota transfer. Used as the idempotency key + * for retries on the donor side. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a quota transfer authored on the donor side. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, QuotaTransferInner> beginCreateOrUpdate(String targetProvider, + String region, String transferName, QuotaTransferInner resource, Context context); + + /** + * Submit a quota transfer. Idempotent on the URI: a retry with the same body returns the + * cached outcome and the same `transferId`; a retry with a different financial body + * returns 409 BodyMismatch. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. A transfer URI is region-singular. + * @param transferName The donor-chosen name segment of the quota transfer. Used as the idempotency key + * for retries on the donor side. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a quota transfer authored on the donor side. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + QuotaTransferInner createOrUpdate(String targetProvider, String region, String transferName, + QuotaTransferInner resource); + + /** + * Submit a quota transfer. Idempotent on the URI: a retry with the same body returns the + * cached outcome and the same `transferId`; a retry with a different financial body + * returns 409 BodyMismatch. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. A transfer URI is region-singular. + * @param transferName The donor-chosen name segment of the quota transfer. Used as the idempotency key + * for retries on the donor side. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a quota transfer authored on the donor side. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + QuotaTransferInner createOrUpdate(String targetProvider, String region, String transferName, + QuotaTransferInner resource, Context context); + + /** + * Delete a quota transfer record. Quota is not moved by delete; only the resource entry + * is removed. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. A transfer URI is region-singular. + * @param transferName The donor-chosen name segment of the quota transfer. Used as the idempotency key + * for retries on the donor side. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String targetProvider, String region, String transferName, Context context); + + /** + * Delete a quota transfer record. Quota is not moved by delete; only the resource entry + * is removed. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. A transfer URI is region-singular. + * @param transferName The donor-chosen name segment of the quota transfer. Used as the idempotency key + * for retries on the donor side. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String targetProvider, String region, String transferName); + + /** + * List quota transfers at the (subscription, targetProvider, region) scope. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. A transfer URI is region-singular. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a QuotaTransfer list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String targetProvider, String region); + + /** + * List quota transfers at the (subscription, targetProvider, region) scope. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. A transfer URI is region-singular. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a QuotaTransfer list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String targetProvider, String region, Context context); + + /** + * Cancel a Pending quota transfer. Synchronous. Transitions the transfer to Cancelled + * and returns the refreshed resource envelope. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. A transfer URI is region-singular. + * @param transferName The donor-chosen name segment of the quota transfer. Used as the idempotency key + * for retries on the donor side. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a quota transfer authored on the donor side along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response cancelWithResponse(String targetProvider, String region, String transferName, + QuotaTransferCancelRequest body, Context context); + + /** + * Cancel a Pending quota transfer. Synchronous. Transitions the transfer to Cancelled + * and returns the refreshed resource envelope. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. A transfer URI is region-singular. + * @param transferName The donor-chosen name segment of the quota transfer. Used as the idempotency key + * for retries on the donor side. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a quota transfer authored on the donor side. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + QuotaTransferInner cancel(String targetProvider, String region, String transferName); +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/IncomingQuotaTransferInner.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/IncomingQuotaTransferInner.java new file mode 100644 index 000000000000..b2d9dc4c8cc5 --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/IncomingQuotaTransferInner.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.quota.models.IncomingQuotaTransferProperties; +import java.io.IOException; + +/** + * Recipient-side projection of a quota transfer. The URI key `{transferId}` is the + * server-generated GUID returned to the donor in the PUT response under + * `properties.transferId`. The resource is read-only from the recipient side; state + * changes occur through the approve and reject actions. + */ +@Immutable +public final class IncomingQuotaTransferInner extends ProxyResource { + /* + * Properties of the incoming quota transfer. + */ + private IncomingQuotaTransferProperties properties; + + /* + * "If etag is provided in the response body, it may also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields." + * ) + */ + private String etag; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of IncomingQuotaTransferInner class. + */ + private IncomingQuotaTransferInner() { + } + + /** + * Get the properties property: Properties of the incoming quota transfer. + * + * @return the properties value. + */ + public IncomingQuotaTransferProperties properties() { + return this.properties; + } + + /** + * Get the etag property: "If etag is provided in the response body, it may also be provided as a header per the + * normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. + * HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), + * and If-Range (section 14.27) header fields."). + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IncomingQuotaTransferInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IncomingQuotaTransferInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the IncomingQuotaTransferInner. + */ + public static IncomingQuotaTransferInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IncomingQuotaTransferInner deserializedIncomingQuotaTransferInner = new IncomingQuotaTransferInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedIncomingQuotaTransferInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedIncomingQuotaTransferInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedIncomingQuotaTransferInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedIncomingQuotaTransferInner.properties + = IncomingQuotaTransferProperties.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedIncomingQuotaTransferInner.etag = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedIncomingQuotaTransferInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedIncomingQuotaTransferInner; + }); + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/QuotaTransferInner.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/QuotaTransferInner.java new file mode 100644 index 000000000000..f7442eaf0c7b --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/QuotaTransferInner.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.quota.models.QuotaTransferProperties; +import java.io.IOException; + +/** + * A quota transfer authored on the donor side. The donor selects the URI segment + * `{transferName}`; the recipient addresses the same logical transfer via the + * server-generated `properties.transferId` GUID on the `incomingQuotaTransfers` URI. + */ +@Fluent +public final class QuotaTransferInner extends ProxyResource { + /* + * Properties of the quota transfer. + */ + private QuotaTransferProperties properties; + + /* + * "If etag is provided in the response body, it may also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields." + * ) + */ + private String etag; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of QuotaTransferInner class. + */ + public QuotaTransferInner() { + } + + /** + * Get the properties property: Properties of the quota transfer. + * + * @return the properties value. + */ + public QuotaTransferProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of the quota transfer. + * + * @param properties the properties value to set. + * @return the QuotaTransferInner object itself. + */ + public QuotaTransferInner withProperties(QuotaTransferProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the etag property: "If etag is provided in the response body, it may also be provided as a header per the + * normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. + * HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), + * and If-Range (section 14.27) header fields."). + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of QuotaTransferInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of QuotaTransferInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the QuotaTransferInner. + */ + public static QuotaTransferInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + QuotaTransferInner deserializedQuotaTransferInner = new QuotaTransferInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedQuotaTransferInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedQuotaTransferInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedQuotaTransferInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedQuotaTransferInner.properties = QuotaTransferProperties.fromJson(reader); + } else if ("etag".equals(fieldName)) { + deserializedQuotaTransferInner.etag = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedQuotaTransferInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedQuotaTransferInner; + }); + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/IncomingQuotaTransferImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/IncomingQuotaTransferImpl.java new file mode 100644 index 000000000000..f83096cad07f --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/IncomingQuotaTransferImpl.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.quota.fluent.models.IncomingQuotaTransferInner; +import com.azure.resourcemanager.quota.models.IncomingQuotaTransfer; +import com.azure.resourcemanager.quota.models.IncomingQuotaTransferProperties; + +public final class IncomingQuotaTransferImpl implements IncomingQuotaTransfer { + private IncomingQuotaTransferInner innerObject; + + private final com.azure.resourcemanager.quota.QuotaManager serviceManager; + + IncomingQuotaTransferImpl(IncomingQuotaTransferInner innerObject, + com.azure.resourcemanager.quota.QuotaManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public IncomingQuotaTransferProperties properties() { + return this.innerModel().properties(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public IncomingQuotaTransferInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.quota.QuotaManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/IncomingQuotaTransfersClientImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/IncomingQuotaTransfersClientImpl.java new file mode 100644 index 000000000000..585c52a926ce --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/IncomingQuotaTransfersClientImpl.java @@ -0,0 +1,1031 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.DateTimeRfc1123; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.quota.fluent.IncomingQuotaTransfersClient; +import com.azure.resourcemanager.quota.fluent.models.IncomingQuotaTransferInner; +import com.azure.resourcemanager.quota.implementation.models.IncomingQuotaTransferListResult; +import com.azure.resourcemanager.quota.models.IncomingQuotaTransferApproveRequest; +import com.azure.resourcemanager.quota.models.IncomingQuotaTransferRejectRequest; +import java.nio.ByteBuffer; +import java.time.OffsetDateTime; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in IncomingQuotaTransfersClient. + */ +public final class IncomingQuotaTransfersClientImpl implements IncomingQuotaTransfersClient { + /** + * The proxy service used to perform REST calls. + */ + private final IncomingQuotaTransfersService service; + + /** + * The service client containing this operation class. + */ + private final QuotaManagementClientImpl client; + + /** + * Initializes an instance of IncomingQuotaTransfersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + IncomingQuotaTransfersClientImpl(QuotaManagementClientImpl client) { + this.service = RestProxy.create(IncomingQuotaTransfersService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for QuotaManagementClientIncomingQuotaTransfers to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "QuotaManagementClientIncomingQuotaTransfers") + public interface IncomingQuotaTransfersService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/{targetProvider}/locations/{region}/providers/Microsoft.Quota/incomingQuotaTransfers/{transferId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("targetProvider") String targetProvider, @PathParam("region") String region, + @PathParam("transferId") String transferId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/{targetProvider}/locations/{region}/providers/Microsoft.Quota/incomingQuotaTransfers/{transferId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("targetProvider") String targetProvider, @PathParam("region") String region, + @PathParam("transferId") String transferId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/{targetProvider}/locations/{region}/providers/Microsoft.Quota/incomingQuotaTransfers") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("targetProvider") String targetProvider, @PathParam("region") String region, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/{targetProvider}/locations/{region}/providers/Microsoft.Quota/incomingQuotaTransfers") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("targetProvider") String targetProvider, @PathParam("region") String region, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Quota/incomingQuotaTransfers") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscription(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Quota/incomingQuotaTransfers") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySubscriptionSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/providers/{targetProvider}/locations/{region}/providers/Microsoft.Quota/incomingQuotaTransfers/{transferId}/approve") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> approve(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("targetProvider") String targetProvider, @PathParam("region") String region, + @PathParam("transferId") String transferId, @HeaderParam("If-Match") String ifMatch, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") IncomingQuotaTransferApproveRequest body, + @HeaderParam("repeatability-request-id") String repeatabilityRequestId, + @HeaderParam("repeatability-first-sent") String repeatabilityFirstSent, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/providers/{targetProvider}/locations/{region}/providers/Microsoft.Quota/incomingQuotaTransfers/{transferId}/approve") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response approveSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("targetProvider") String targetProvider, @PathParam("region") String region, + @PathParam("transferId") String transferId, @HeaderParam("If-Match") String ifMatch, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") IncomingQuotaTransferApproveRequest body, + @HeaderParam("repeatability-request-id") String repeatabilityRequestId, + @HeaderParam("repeatability-first-sent") String repeatabilityFirstSent, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/providers/{targetProvider}/locations/{region}/providers/Microsoft.Quota/incomingQuotaTransfers/{transferId}/reject") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> reject(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("targetProvider") String targetProvider, @PathParam("region") String region, + @PathParam("transferId") String transferId, @HeaderParam("If-Match") String ifMatch, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") IncomingQuotaTransferRejectRequest body, + @HeaderParam("repeatability-request-id") String repeatabilityRequestId, + @HeaderParam("repeatability-first-sent") String repeatabilityFirstSent, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/providers/{targetProvider}/locations/{region}/providers/Microsoft.Quota/incomingQuotaTransfers/{transferId}/reject") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response rejectSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("targetProvider") String targetProvider, @PathParam("region") String region, + @PathParam("transferId") String transferId, @HeaderParam("If-Match") String ifMatch, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") IncomingQuotaTransferRejectRequest body, + @HeaderParam("repeatability-request-id") String repeatabilityRequestId, + @HeaderParam("repeatability-first-sent") String repeatabilityFirstSent, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySubscriptionNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get an incoming quota transfer. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. + * @param transferId Server-generated identifier of the transfer (matches `properties.transferId`). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an incoming quota transfer along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String targetProvider, String region, + String transferId) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), targetProvider, region, transferId, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get an incoming quota transfer. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. + * @param transferId Server-generated identifier of the transfer (matches `properties.transferId`). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an incoming quota transfer on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String targetProvider, String region, String transferId) { + return getWithResponseAsync(targetProvider, region, transferId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get an incoming quota transfer. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. + * @param transferId Server-generated identifier of the transfer (matches `properties.transferId`). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an incoming quota transfer along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String targetProvider, String region, String transferId, + Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + targetProvider, region, transferId, accept, context); + } + + /** + * Get an incoming quota transfer. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. + * @param transferId Server-generated identifier of the transfer (matches `properties.transferId`). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an incoming quota transfer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IncomingQuotaTransferInner get(String targetProvider, String region, String transferId) { + return getWithResponse(targetProvider, region, transferId, Context.NONE).getValue(); + } + + /** + * List incoming quota transfers at the (subscription, targetProvider, region) scope. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IncomingQuotaTransfer list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String targetProvider, String region) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), targetProvider, region, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List incoming quota transfers at the (subscription, targetProvider, region) scope. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IncomingQuotaTransfer list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String targetProvider, String region) { + return new PagedFlux<>(() -> listSinglePageAsync(targetProvider, region), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List incoming quota transfers at the (subscription, targetProvider, region) scope. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IncomingQuotaTransfer list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String targetProvider, String region) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), targetProvider, region, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List incoming quota transfers at the (subscription, targetProvider, region) scope. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IncomingQuotaTransfer list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String targetProvider, String region, + Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), targetProvider, region, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List incoming quota transfers at the (subscription, targetProvider, region) scope. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IncomingQuotaTransfer list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String targetProvider, String region) { + return new PagedIterable<>(() -> listSinglePage(targetProvider, region), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List incoming quota transfers at the (subscription, targetProvider, region) scope. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IncomingQuotaTransfer list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String targetProvider, String region, Context context) { + return new PagedIterable<>(() -> listSinglePage(targetProvider, region, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * List incoming quota transfers across every targetProvider and region for the + * subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IncomingQuotaTransfer list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionSinglePageAsync() { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listBySubscription(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List incoming quota transfers across every targetProvider and region for the + * subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IncomingQuotaTransfer list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySubscriptionAsync() { + return new PagedFlux<>(() -> listBySubscriptionSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List incoming quota transfers across every targetProvider and region for the + * subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IncomingQuotaTransfer list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionSinglePage() { + final String accept = "application/json"; + Response res = service.listBySubscriptionSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List incoming quota transfers across every targetProvider and region for the + * subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IncomingQuotaTransfer list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionSinglePage(Context context) { + final String accept = "application/json"; + Response res = service.listBySubscriptionSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List incoming quota transfers across every targetProvider and region for the + * subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IncomingQuotaTransfer list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBySubscription() { + return new PagedIterable<>(() -> listBySubscriptionSinglePage(), + nextLink -> listBySubscriptionNextSinglePage(nextLink)); + } + + /** + * List incoming quota transfers across every targetProvider and region for the + * subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IncomingQuotaTransfer list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBySubscription(Context context) { + return new PagedIterable<>(() -> listBySubscriptionSinglePage(context), + nextLink -> listBySubscriptionNextSinglePage(nextLink, context)); + } + + /** + * Approve a Pending incoming quota transfer. Long-running. The `If-Match` header value + * must equal `properties.sourceEtag` returned on a prior GET; a stale value yields + * 412 SourceResourceModified. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. + * @param transferId Server-generated identifier of the transfer (matches `properties.transferId`). + * @param ifMatch Optimistic-concurrency precondition. Must equal `properties.sourceEtag` from a + * prior GET on the incoming transfer. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recipient-side projection of a quota transfer along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> approveWithResponseAsync(String targetProvider, String region, + String transferId, String ifMatch, IncomingQuotaTransferApproveRequest body) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.approve(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), targetProvider, region, transferId, ifMatch, accept, body, + CoreUtils.randomUuid().toString(), DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()), context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Approve a Pending incoming quota transfer. Long-running. The `If-Match` header value + * must equal `properties.sourceEtag` returned on a prior GET; a stale value yields + * 412 SourceResourceModified. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. + * @param transferId Server-generated identifier of the transfer (matches `properties.transferId`). + * @param ifMatch Optimistic-concurrency precondition. Must equal `properties.sourceEtag` from a + * prior GET on the incoming transfer. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recipient-side projection of a quota transfer along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response approveWithResponse(String targetProvider, String region, String transferId, + String ifMatch, IncomingQuotaTransferApproveRequest body) { + final String accept = "application/json"; + return service.approveSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), targetProvider, region, transferId, ifMatch, accept, body, + CoreUtils.randomUuid().toString(), DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()), Context.NONE); + } + + /** + * Approve a Pending incoming quota transfer. Long-running. The `If-Match` header value + * must equal `properties.sourceEtag` returned on a prior GET; a stale value yields + * 412 SourceResourceModified. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. + * @param transferId Server-generated identifier of the transfer (matches `properties.transferId`). + * @param ifMatch Optimistic-concurrency precondition. Must equal `properties.sourceEtag` from a + * prior GET on the incoming transfer. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recipient-side projection of a quota transfer along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response approveWithResponse(String targetProvider, String region, String transferId, + String ifMatch, IncomingQuotaTransferApproveRequest body, Context context) { + final String accept = "application/json"; + return service.approveSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), targetProvider, region, transferId, ifMatch, accept, body, + CoreUtils.randomUuid().toString(), DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()), context); + } + + /** + * Approve a Pending incoming quota transfer. Long-running. The `If-Match` header value + * must equal `properties.sourceEtag` returned on a prior GET; a stale value yields + * 412 SourceResourceModified. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. + * @param transferId Server-generated identifier of the transfer (matches `properties.transferId`). + * @param ifMatch Optimistic-concurrency precondition. Must equal `properties.sourceEtag` from a + * prior GET on the incoming transfer. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of recipient-side projection of a quota transfer. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IncomingQuotaTransferInner> beginApproveAsync( + String targetProvider, String region, String transferId, String ifMatch, + IncomingQuotaTransferApproveRequest body) { + Mono>> mono + = approveWithResponseAsync(targetProvider, region, transferId, ifMatch, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), IncomingQuotaTransferInner.class, IncomingQuotaTransferInner.class, + this.client.getContext()); + } + + /** + * Approve a Pending incoming quota transfer. Long-running. The `If-Match` header value + * must equal `properties.sourceEtag` returned on a prior GET; a stale value yields + * 412 SourceResourceModified. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. + * @param transferId Server-generated identifier of the transfer (matches `properties.transferId`). + * @param ifMatch Optimistic-concurrency precondition. Must equal `properties.sourceEtag` from a + * prior GET on the incoming transfer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of recipient-side projection of a quota transfer. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, IncomingQuotaTransferInner> + beginApproveAsync(String targetProvider, String region, String transferId, String ifMatch) { + final IncomingQuotaTransferApproveRequest body = null; + Mono>> mono + = approveWithResponseAsync(targetProvider, region, transferId, ifMatch, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), IncomingQuotaTransferInner.class, IncomingQuotaTransferInner.class, + this.client.getContext()); + } + + /** + * Approve a Pending incoming quota transfer. Long-running. The `If-Match` header value + * must equal `properties.sourceEtag` returned on a prior GET; a stale value yields + * 412 SourceResourceModified. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. + * @param transferId Server-generated identifier of the transfer (matches `properties.transferId`). + * @param ifMatch Optimistic-concurrency precondition. Must equal `properties.sourceEtag` from a + * prior GET on the incoming transfer. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of recipient-side projection of a quota transfer. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IncomingQuotaTransferInner> beginApprove( + String targetProvider, String region, String transferId, String ifMatch, + IncomingQuotaTransferApproveRequest body) { + Response response = approveWithResponse(targetProvider, region, transferId, ifMatch, body); + return this.client.getLroResult(response, + IncomingQuotaTransferInner.class, IncomingQuotaTransferInner.class, Context.NONE); + } + + /** + * Approve a Pending incoming quota transfer. Long-running. The `If-Match` header value + * must equal `properties.sourceEtag` returned on a prior GET; a stale value yields + * 412 SourceResourceModified. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. + * @param transferId Server-generated identifier of the transfer (matches `properties.transferId`). + * @param ifMatch Optimistic-concurrency precondition. Must equal `properties.sourceEtag` from a + * prior GET on the incoming transfer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of recipient-side projection of a quota transfer. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IncomingQuotaTransferInner> + beginApprove(String targetProvider, String region, String transferId, String ifMatch) { + final IncomingQuotaTransferApproveRequest body = null; + Response response = approveWithResponse(targetProvider, region, transferId, ifMatch, body); + return this.client.getLroResult(response, + IncomingQuotaTransferInner.class, IncomingQuotaTransferInner.class, Context.NONE); + } + + /** + * Approve a Pending incoming quota transfer. Long-running. The `If-Match` header value + * must equal `properties.sourceEtag` returned on a prior GET; a stale value yields + * 412 SourceResourceModified. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. + * @param transferId Server-generated identifier of the transfer (matches `properties.transferId`). + * @param ifMatch Optimistic-concurrency precondition. Must equal `properties.sourceEtag` from a + * prior GET on the incoming transfer. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of recipient-side projection of a quota transfer. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, IncomingQuotaTransferInner> beginApprove( + String targetProvider, String region, String transferId, String ifMatch, + IncomingQuotaTransferApproveRequest body, Context context) { + Response response = approveWithResponse(targetProvider, region, transferId, ifMatch, body, context); + return this.client.getLroResult(response, + IncomingQuotaTransferInner.class, IncomingQuotaTransferInner.class, context); + } + + /** + * Approve a Pending incoming quota transfer. Long-running. The `If-Match` header value + * must equal `properties.sourceEtag` returned on a prior GET; a stale value yields + * 412 SourceResourceModified. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. + * @param transferId Server-generated identifier of the transfer (matches `properties.transferId`). + * @param ifMatch Optimistic-concurrency precondition. Must equal `properties.sourceEtag` from a + * prior GET on the incoming transfer. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recipient-side projection of a quota transfer on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono approveAsync(String targetProvider, String region, String transferId, + String ifMatch, IncomingQuotaTransferApproveRequest body) { + return beginApproveAsync(targetProvider, region, transferId, ifMatch, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Approve a Pending incoming quota transfer. Long-running. The `If-Match` header value + * must equal `properties.sourceEtag` returned on a prior GET; a stale value yields + * 412 SourceResourceModified. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. + * @param transferId Server-generated identifier of the transfer (matches `properties.transferId`). + * @param ifMatch Optimistic-concurrency precondition. Must equal `properties.sourceEtag` from a + * prior GET on the incoming transfer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recipient-side projection of a quota transfer on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono approveAsync(String targetProvider, String region, String transferId, + String ifMatch) { + final IncomingQuotaTransferApproveRequest body = null; + return beginApproveAsync(targetProvider, region, transferId, ifMatch, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Approve a Pending incoming quota transfer. Long-running. The `If-Match` header value + * must equal `properties.sourceEtag` returned on a prior GET; a stale value yields + * 412 SourceResourceModified. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. + * @param transferId Server-generated identifier of the transfer (matches `properties.transferId`). + * @param ifMatch Optimistic-concurrency precondition. Must equal `properties.sourceEtag` from a + * prior GET on the incoming transfer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recipient-side projection of a quota transfer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IncomingQuotaTransferInner approve(String targetProvider, String region, String transferId, String ifMatch) { + final IncomingQuotaTransferApproveRequest body = null; + return beginApprove(targetProvider, region, transferId, ifMatch, body).getFinalResult(); + } + + /** + * Approve a Pending incoming quota transfer. Long-running. The `If-Match` header value + * must equal `properties.sourceEtag` returned on a prior GET; a stale value yields + * 412 SourceResourceModified. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. + * @param transferId Server-generated identifier of the transfer (matches `properties.transferId`). + * @param ifMatch Optimistic-concurrency precondition. Must equal `properties.sourceEtag` from a + * prior GET on the incoming transfer. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recipient-side projection of a quota transfer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IncomingQuotaTransferInner approve(String targetProvider, String region, String transferId, String ifMatch, + IncomingQuotaTransferApproveRequest body, Context context) { + return beginApprove(targetProvider, region, transferId, ifMatch, body, context).getFinalResult(); + } + + /** + * Reject a Pending incoming quota transfer. Synchronous. The `If-Match` header value + * must equal `properties.sourceEtag` returned on a prior GET. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. + * @param transferId Server-generated identifier of the transfer (matches `properties.transferId`). + * @param ifMatch Optimistic-concurrency precondition. Must equal `properties.sourceEtag` from a + * prior GET on the incoming transfer. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recipient-side projection of a quota transfer along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> rejectWithResponseAsync(String targetProvider, String region, + String transferId, String ifMatch, IncomingQuotaTransferRejectRequest body) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.reject(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), targetProvider, region, transferId, ifMatch, accept, body, + CoreUtils.randomUuid().toString(), DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()), context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Reject a Pending incoming quota transfer. Synchronous. The `If-Match` header value + * must equal `properties.sourceEtag` returned on a prior GET. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. + * @param transferId Server-generated identifier of the transfer (matches `properties.transferId`). + * @param ifMatch Optimistic-concurrency precondition. Must equal `properties.sourceEtag` from a + * prior GET on the incoming transfer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recipient-side projection of a quota transfer on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono rejectAsync(String targetProvider, String region, String transferId, + String ifMatch) { + final IncomingQuotaTransferRejectRequest body = null; + return rejectWithResponseAsync(targetProvider, region, transferId, ifMatch, body) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Reject a Pending incoming quota transfer. Synchronous. The `If-Match` header value + * must equal `properties.sourceEtag` returned on a prior GET. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. + * @param transferId Server-generated identifier of the transfer (matches `properties.transferId`). + * @param ifMatch Optimistic-concurrency precondition. Must equal `properties.sourceEtag` from a + * prior GET on the incoming transfer. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recipient-side projection of a quota transfer along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response rejectWithResponse(String targetProvider, String region, + String transferId, String ifMatch, IncomingQuotaTransferRejectRequest body, Context context) { + final String accept = "application/json"; + return service.rejectSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), targetProvider, region, transferId, ifMatch, accept, body, + CoreUtils.randomUuid().toString(), DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()), context); + } + + /** + * Reject a Pending incoming quota transfer. Synchronous. The `If-Match` header value + * must equal `properties.sourceEtag` returned on a prior GET. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. + * @param transferId Server-generated identifier of the transfer (matches `properties.transferId`). + * @param ifMatch Optimistic-concurrency precondition. Must equal `properties.sourceEtag` from a + * prior GET on the incoming transfer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recipient-side projection of a quota transfer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public IncomingQuotaTransferInner reject(String targetProvider, String region, String transferId, String ifMatch) { + final IncomingQuotaTransferRejectRequest body = null; + return rejectWithResponse(targetProvider, region, transferId, ifMatch, body, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IncomingQuotaTransfer list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IncomingQuotaTransfer list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IncomingQuotaTransfer list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IncomingQuotaTransfer list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IncomingQuotaTransfer list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IncomingQuotaTransfer list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink, + Context context) { + final String accept = "application/json"; + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/IncomingQuotaTransfersImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/IncomingQuotaTransfersImpl.java new file mode 100644 index 000000000000..2d9d27e14dda --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/IncomingQuotaTransfersImpl.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.quota.fluent.IncomingQuotaTransfersClient; +import com.azure.resourcemanager.quota.fluent.models.IncomingQuotaTransferInner; +import com.azure.resourcemanager.quota.models.IncomingQuotaTransfer; +import com.azure.resourcemanager.quota.models.IncomingQuotaTransferApproveRequest; +import com.azure.resourcemanager.quota.models.IncomingQuotaTransferRejectRequest; +import com.azure.resourcemanager.quota.models.IncomingQuotaTransfers; + +public final class IncomingQuotaTransfersImpl implements IncomingQuotaTransfers { + private static final ClientLogger LOGGER = new ClientLogger(IncomingQuotaTransfersImpl.class); + + private final IncomingQuotaTransfersClient innerClient; + + private final com.azure.resourcemanager.quota.QuotaManager serviceManager; + + public IncomingQuotaTransfersImpl(IncomingQuotaTransfersClient innerClient, + com.azure.resourcemanager.quota.QuotaManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String targetProvider, String region, String transferId, + Context context) { + Response inner + = this.serviceClient().getWithResponse(targetProvider, region, transferId, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new IncomingQuotaTransferImpl(inner.getValue(), this.manager())); + } + + public IncomingQuotaTransfer get(String targetProvider, String region, String transferId) { + IncomingQuotaTransferInner inner = this.serviceClient().get(targetProvider, region, transferId); + if (inner != null) { + return new IncomingQuotaTransferImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String targetProvider, String region) { + PagedIterable inner = this.serviceClient().list(targetProvider, region); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IncomingQuotaTransferImpl(inner1, this.manager())); + } + + public PagedIterable list(String targetProvider, String region, Context context) { + PagedIterable inner = this.serviceClient().list(targetProvider, region, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IncomingQuotaTransferImpl(inner1, this.manager())); + } + + public PagedIterable listBySubscription() { + PagedIterable inner = this.serviceClient().listBySubscription(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IncomingQuotaTransferImpl(inner1, this.manager())); + } + + public PagedIterable listBySubscription(Context context) { + PagedIterable inner = this.serviceClient().listBySubscription(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new IncomingQuotaTransferImpl(inner1, this.manager())); + } + + public IncomingQuotaTransfer approve(String targetProvider, String region, String transferId, String ifMatch) { + IncomingQuotaTransferInner inner = this.serviceClient().approve(targetProvider, region, transferId, ifMatch); + if (inner != null) { + return new IncomingQuotaTransferImpl(inner, this.manager()); + } else { + return null; + } + } + + public IncomingQuotaTransfer approve(String targetProvider, String region, String transferId, String ifMatch, + IncomingQuotaTransferApproveRequest body, Context context) { + IncomingQuotaTransferInner inner + = this.serviceClient().approve(targetProvider, region, transferId, ifMatch, body, context); + if (inner != null) { + return new IncomingQuotaTransferImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response rejectWithResponse(String targetProvider, String region, String transferId, + String ifMatch, IncomingQuotaTransferRejectRequest body, Context context) { + Response inner + = this.serviceClient().rejectWithResponse(targetProvider, region, transferId, ifMatch, body, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new IncomingQuotaTransferImpl(inner.getValue(), this.manager())); + } + + public IncomingQuotaTransfer reject(String targetProvider, String region, String transferId, String ifMatch) { + IncomingQuotaTransferInner inner = this.serviceClient().reject(targetProvider, region, transferId, ifMatch); + if (inner != null) { + return new IncomingQuotaTransferImpl(inner, this.manager()); + } else { + return null; + } + } + + private IncomingQuotaTransfersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.quota.QuotaManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaManagementClientImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaManagementClientImpl.java index cac82fc026e1..4807126e19c1 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaManagementClientImpl.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaManagementClientImpl.java @@ -35,9 +35,11 @@ import com.azure.resourcemanager.quota.fluent.GroupQuotaSubscriptionsClient; import com.azure.resourcemanager.quota.fluent.GroupQuotaUsagesClient; import com.azure.resourcemanager.quota.fluent.GroupQuotasClient; +import com.azure.resourcemanager.quota.fluent.IncomingQuotaTransfersClient; import com.azure.resourcemanager.quota.fluent.QuotaManagementClient; import com.azure.resourcemanager.quota.fluent.QuotaOperationsClient; import com.azure.resourcemanager.quota.fluent.QuotaRequestStatusClient; +import com.azure.resourcemanager.quota.fluent.QuotaTransfersClient; import com.azure.resourcemanager.quota.fluent.QuotasClient; import com.azure.resourcemanager.quota.fluent.UsagesClient; import java.io.IOException; @@ -166,6 +168,34 @@ public QuotaRequestStatusClient getQuotaRequestStatus() { return this.quotaRequestStatus; } + /** + * The QuotaTransfersClient object to access its operations. + */ + private final QuotaTransfersClient quotaTransfers; + + /** + * Gets the QuotaTransfersClient object to access its operations. + * + * @return the QuotaTransfersClient object. + */ + public QuotaTransfersClient getQuotaTransfers() { + return this.quotaTransfers; + } + + /** + * The IncomingQuotaTransfersClient object to access its operations. + */ + private final IncomingQuotaTransfersClient incomingQuotaTransfers; + + /** + * Gets the IncomingQuotaTransfersClient object to access its operations. + * + * @return the IncomingQuotaTransfersClient object. + */ + public IncomingQuotaTransfersClient getIncomingQuotaTransfers() { + return this.incomingQuotaTransfers; + } + /** * The GroupQuotasClient object to access its operations. */ @@ -337,9 +367,11 @@ public QuotasClient getQuotas() { this.defaultPollInterval = defaultPollInterval; this.endpoint = endpoint; this.subscriptionId = subscriptionId; - this.apiVersion = "2025-09-01"; + this.apiVersion = "2026-09-01-preview"; this.quotaOperations = new QuotaOperationsClientImpl(this); this.quotaRequestStatus = new QuotaRequestStatusClientImpl(this); + this.quotaTransfers = new QuotaTransfersClientImpl(this); + this.incomingQuotaTransfers = new IncomingQuotaTransfersClientImpl(this); this.groupQuotas = new GroupQuotasClientImpl(this); this.groupQuotaLimitsRequests = new GroupQuotaLimitsRequestsClientImpl(this); this.groupQuotaUsages = new GroupQuotaUsagesClientImpl(this); diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaTransferImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaTransferImpl.java new file mode 100644 index 000000000000..625d381922f4 --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaTransferImpl.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.quota.fluent.models.QuotaTransferInner; +import com.azure.resourcemanager.quota.models.QuotaTransfer; +import com.azure.resourcemanager.quota.models.QuotaTransferCancelRequest; +import com.azure.resourcemanager.quota.models.QuotaTransferProperties; + +public final class QuotaTransferImpl implements QuotaTransfer, QuotaTransfer.Definition, QuotaTransfer.Update { + private QuotaTransferInner innerObject; + + private final com.azure.resourcemanager.quota.QuotaManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public QuotaTransferProperties properties() { + return this.innerModel().properties(); + } + + public String etag() { + return this.innerModel().etag(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public QuotaTransferInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.quota.QuotaManager manager() { + return this.serviceManager; + } + + private String targetProvider; + + private String region; + + private String transferName; + + public QuotaTransferImpl withExistingLocation(String targetProvider, String region) { + this.targetProvider = targetProvider; + this.region = region; + return this; + } + + public QuotaTransfer create() { + this.innerObject = serviceManager.serviceClient() + .getQuotaTransfers() + .createOrUpdate(targetProvider, region, transferName, this.innerModel(), Context.NONE); + return this; + } + + public QuotaTransfer create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getQuotaTransfers() + .createOrUpdate(targetProvider, region, transferName, this.innerModel(), context); + return this; + } + + QuotaTransferImpl(String name, com.azure.resourcemanager.quota.QuotaManager serviceManager) { + this.innerObject = new QuotaTransferInner(); + this.serviceManager = serviceManager; + this.transferName = name; + } + + public QuotaTransferImpl update() { + return this; + } + + public QuotaTransfer apply() { + this.innerObject = serviceManager.serviceClient() + .getQuotaTransfers() + .createOrUpdate(targetProvider, region, transferName, this.innerModel(), Context.NONE); + return this; + } + + public QuotaTransfer apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getQuotaTransfers() + .createOrUpdate(targetProvider, region, transferName, this.innerModel(), context); + return this; + } + + QuotaTransferImpl(QuotaTransferInner innerObject, com.azure.resourcemanager.quota.QuotaManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.targetProvider = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "providers"); + this.region = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "locations"); + this.transferName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "quotaTransfers"); + } + + public QuotaTransfer refresh() { + this.innerObject = serviceManager.serviceClient() + .getQuotaTransfers() + .getWithResponse(targetProvider, region, transferName, Context.NONE) + .getValue(); + return this; + } + + public QuotaTransfer refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getQuotaTransfers() + .getWithResponse(targetProvider, region, transferName, context) + .getValue(); + return this; + } + + public Response cancelWithResponse(QuotaTransferCancelRequest body, Context context) { + return serviceManager.quotaTransfers().cancelWithResponse(targetProvider, region, transferName, body, context); + } + + public QuotaTransfer cancel() { + return serviceManager.quotaTransfers().cancel(targetProvider, region, transferName); + } + + public QuotaTransferImpl withProperties(QuotaTransferProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaTransfersClientImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaTransfersClientImpl.java new file mode 100644 index 000000000000..8efa0647f0b7 --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaTransfersClientImpl.java @@ -0,0 +1,843 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.DateTimeRfc1123; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.quota.fluent.QuotaTransfersClient; +import com.azure.resourcemanager.quota.fluent.models.QuotaTransferInner; +import com.azure.resourcemanager.quota.implementation.models.QuotaTransferListResult; +import com.azure.resourcemanager.quota.models.QuotaTransferCancelRequest; +import java.nio.ByteBuffer; +import java.time.OffsetDateTime; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in QuotaTransfersClient. + */ +public final class QuotaTransfersClientImpl implements QuotaTransfersClient { + /** + * The proxy service used to perform REST calls. + */ + private final QuotaTransfersService service; + + /** + * The service client containing this operation class. + */ + private final QuotaManagementClientImpl client; + + /** + * Initializes an instance of QuotaTransfersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + QuotaTransfersClientImpl(QuotaManagementClientImpl client) { + this.service + = RestProxy.create(QuotaTransfersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for QuotaManagementClientQuotaTransfers to be used by the proxy service + * to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "QuotaManagementClientQuotaTransfers") + public interface QuotaTransfersService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/{targetProvider}/locations/{region}/providers/Microsoft.Quota/quotaTransfers/{transferName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("targetProvider") String targetProvider, @PathParam("region") String region, + @PathParam("transferName") String transferName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/{targetProvider}/locations/{region}/providers/Microsoft.Quota/quotaTransfers/{transferName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("targetProvider") String targetProvider, @PathParam("region") String region, + @PathParam("transferName") String transferName, @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/providers/{targetProvider}/locations/{region}/providers/Microsoft.Quota/quotaTransfers/{transferName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("targetProvider") String targetProvider, @PathParam("region") String region, + @PathParam("transferName") String transferName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") QuotaTransferInner resource, + Context context); + + @Put("/subscriptions/{subscriptionId}/providers/{targetProvider}/locations/{region}/providers/Microsoft.Quota/quotaTransfers/{transferName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("targetProvider") String targetProvider, @PathParam("region") String region, + @PathParam("transferName") String transferName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") QuotaTransferInner resource, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/providers/{targetProvider}/locations/{region}/providers/Microsoft.Quota/quotaTransfers/{transferName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("targetProvider") String targetProvider, @PathParam("region") String region, + @PathParam("transferName") String transferName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/providers/{targetProvider}/locations/{region}/providers/Microsoft.Quota/quotaTransfers/{transferName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("targetProvider") String targetProvider, + @PathParam("region") String region, @PathParam("transferName") String transferName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/{targetProvider}/locations/{region}/providers/Microsoft.Quota/quotaTransfers") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("targetProvider") String targetProvider, @PathParam("region") String region, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/{targetProvider}/locations/{region}/providers/Microsoft.Quota/quotaTransfers") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("targetProvider") String targetProvider, @PathParam("region") String region, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/providers/{targetProvider}/locations/{region}/providers/Microsoft.Quota/quotaTransfers/{transferName}/cancel") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> cancel(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("targetProvider") String targetProvider, @PathParam("region") String region, + @PathParam("transferName") String transferName, @HeaderParam("Accept") String accept, + @BodyParam("application/json") QuotaTransferCancelRequest body, + @HeaderParam("repeatability-request-id") String repeatabilityRequestId, + @HeaderParam("repeatability-first-sent") String repeatabilityFirstSent, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/providers/{targetProvider}/locations/{region}/providers/Microsoft.Quota/quotaTransfers/{transferName}/cancel") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response cancelSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("targetProvider") String targetProvider, @PathParam("region") String region, + @PathParam("transferName") String transferName, @HeaderParam("Accept") String accept, + @BodyParam("application/json") QuotaTransferCancelRequest body, + @HeaderParam("repeatability-request-id") String repeatabilityRequestId, + @HeaderParam("repeatability-first-sent") String repeatabilityFirstSent, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a quota transfer. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. A transfer URI is region-singular. + * @param transferName The donor-chosen name segment of the quota transfer. Used as the idempotency key + * for retries on the donor side. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a quota transfer along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String targetProvider, String region, + String transferName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), targetProvider, region, transferName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a quota transfer. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. A transfer URI is region-singular. + * @param transferName The donor-chosen name segment of the quota transfer. Used as the idempotency key + * for retries on the donor side. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a quota transfer on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String targetProvider, String region, String transferName) { + return getWithResponseAsync(targetProvider, region, transferName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a quota transfer. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. A transfer URI is region-singular. + * @param transferName The donor-chosen name segment of the quota transfer. Used as the idempotency key + * for retries on the donor side. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a quota transfer along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String targetProvider, String region, String transferName, + Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + targetProvider, region, transferName, accept, context); + } + + /** + * Get a quota transfer. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. A transfer URI is region-singular. + * @param transferName The donor-chosen name segment of the quota transfer. Used as the idempotency key + * for retries on the donor side. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a quota transfer. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public QuotaTransferInner get(String targetProvider, String region, String transferName) { + return getWithResponse(targetProvider, region, transferName, Context.NONE).getValue(); + } + + /** + * Submit a quota transfer. Idempotent on the URI: a retry with the same body returns the + * cached outcome and the same `transferId`; a retry with a different financial body + * returns 409 BodyMismatch. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. A transfer URI is region-singular. + * @param transferName The donor-chosen name segment of the quota transfer. Used as the idempotency key + * for retries on the donor side. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a quota transfer authored on the donor side along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String targetProvider, String region, + String transferName, QuotaTransferInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), targetProvider, region, transferName, contentType, accept, resource, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Submit a quota transfer. Idempotent on the URI: a retry with the same body returns the + * cached outcome and the same `transferId`; a retry with a different financial body + * returns 409 BodyMismatch. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. A transfer URI is region-singular. + * @param transferName The donor-chosen name segment of the quota transfer. Used as the idempotency key + * for retries on the donor side. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a quota transfer authored on the donor side along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String targetProvider, String region, String transferName, + QuotaTransferInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), targetProvider, region, transferName, contentType, accept, resource, + Context.NONE); + } + + /** + * Submit a quota transfer. Idempotent on the URI: a retry with the same body returns the + * cached outcome and the same `transferId`; a retry with a different financial body + * returns 409 BodyMismatch. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. A transfer URI is region-singular. + * @param transferName The donor-chosen name segment of the quota transfer. Used as the idempotency key + * for retries on the donor side. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a quota transfer authored on the donor side along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String targetProvider, String region, String transferName, + QuotaTransferInner resource, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), targetProvider, region, transferName, contentType, accept, resource, + context); + } + + /** + * Submit a quota transfer. Idempotent on the URI: a retry with the same body returns the + * cached outcome and the same `transferId`; a retry with a different financial body + * returns 409 BodyMismatch. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. A transfer URI is region-singular. + * @param transferName The donor-chosen name segment of the quota transfer. Used as the idempotency key + * for retries on the donor side. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a quota transfer authored on the donor side. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, QuotaTransferInner> beginCreateOrUpdateAsync( + String targetProvider, String region, String transferName, QuotaTransferInner resource) { + Mono>> mono + = createOrUpdateWithResponseAsync(targetProvider, region, transferName, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + QuotaTransferInner.class, QuotaTransferInner.class, this.client.getContext()); + } + + /** + * Submit a quota transfer. Idempotent on the URI: a retry with the same body returns the + * cached outcome and the same `transferId`; a retry with a different financial body + * returns 409 BodyMismatch. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. A transfer URI is region-singular. + * @param transferName The donor-chosen name segment of the quota transfer. Used as the idempotency key + * for retries on the donor side. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a quota transfer authored on the donor side. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, QuotaTransferInner> beginCreateOrUpdate(String targetProvider, + String region, String transferName, QuotaTransferInner resource) { + Response response = createOrUpdateWithResponse(targetProvider, region, transferName, resource); + return this.client.getLroResult(response, QuotaTransferInner.class, + QuotaTransferInner.class, Context.NONE); + } + + /** + * Submit a quota transfer. Idempotent on the URI: a retry with the same body returns the + * cached outcome and the same `transferId`; a retry with a different financial body + * returns 409 BodyMismatch. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. A transfer URI is region-singular. + * @param transferName The donor-chosen name segment of the quota transfer. Used as the idempotency key + * for retries on the donor side. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a quota transfer authored on the donor side. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, QuotaTransferInner> beginCreateOrUpdate(String targetProvider, + String region, String transferName, QuotaTransferInner resource, Context context) { + Response response + = createOrUpdateWithResponse(targetProvider, region, transferName, resource, context); + return this.client.getLroResult(response, QuotaTransferInner.class, + QuotaTransferInner.class, context); + } + + /** + * Submit a quota transfer. Idempotent on the URI: a retry with the same body returns the + * cached outcome and the same `transferId`; a retry with a different financial body + * returns 409 BodyMismatch. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. A transfer URI is region-singular. + * @param transferName The donor-chosen name segment of the quota transfer. Used as the idempotency key + * for retries on the donor side. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a quota transfer authored on the donor side on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String targetProvider, String region, String transferName, + QuotaTransferInner resource) { + return beginCreateOrUpdateAsync(targetProvider, region, transferName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Submit a quota transfer. Idempotent on the URI: a retry with the same body returns the + * cached outcome and the same `transferId`; a retry with a different financial body + * returns 409 BodyMismatch. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. A transfer URI is region-singular. + * @param transferName The donor-chosen name segment of the quota transfer. Used as the idempotency key + * for retries on the donor side. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a quota transfer authored on the donor side. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public QuotaTransferInner createOrUpdate(String targetProvider, String region, String transferName, + QuotaTransferInner resource) { + return beginCreateOrUpdate(targetProvider, region, transferName, resource).getFinalResult(); + } + + /** + * Submit a quota transfer. Idempotent on the URI: a retry with the same body returns the + * cached outcome and the same `transferId`; a retry with a different financial body + * returns 409 BodyMismatch. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. A transfer URI is region-singular. + * @param transferName The donor-chosen name segment of the quota transfer. Used as the idempotency key + * for retries on the donor side. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a quota transfer authored on the donor side. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public QuotaTransferInner createOrUpdate(String targetProvider, String region, String transferName, + QuotaTransferInner resource, Context context) { + return beginCreateOrUpdate(targetProvider, region, transferName, resource, context).getFinalResult(); + } + + /** + * Delete a quota transfer record. Quota is not moved by delete; only the resource entry + * is removed. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. A transfer URI is region-singular. + * @param transferName The donor-chosen name segment of the quota transfer. Used as the idempotency key + * for retries on the donor side. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String targetProvider, String region, String transferName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), targetProvider, region, transferName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a quota transfer record. Quota is not moved by delete; only the resource entry + * is removed. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. A transfer URI is region-singular. + * @param transferName The donor-chosen name segment of the quota transfer. Used as the idempotency key + * for retries on the donor side. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String targetProvider, String region, String transferName) { + return deleteWithResponseAsync(targetProvider, region, transferName).flatMap(ignored -> Mono.empty()); + } + + /** + * Delete a quota transfer record. Quota is not moved by delete; only the resource entry + * is removed. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. A transfer URI is region-singular. + * @param transferName The donor-chosen name segment of the quota transfer. Used as the idempotency key + * for retries on the donor side. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String targetProvider, String region, String transferName, + Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), targetProvider, region, transferName, context); + } + + /** + * Delete a quota transfer record. Quota is not moved by delete; only the resource entry + * is removed. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. A transfer URI is region-singular. + * @param transferName The donor-chosen name segment of the quota transfer. Used as the idempotency key + * for retries on the donor side. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String targetProvider, String region, String transferName) { + deleteWithResponse(targetProvider, region, transferName, Context.NONE); + } + + /** + * List quota transfers at the (subscription, targetProvider, region) scope. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. A transfer URI is region-singular. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a QuotaTransfer list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String targetProvider, String region) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), targetProvider, region, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List quota transfers at the (subscription, targetProvider, region) scope. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. A transfer URI is region-singular. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a QuotaTransfer list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String targetProvider, String region) { + return new PagedFlux<>(() -> listSinglePageAsync(targetProvider, region), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List quota transfers at the (subscription, targetProvider, region) scope. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. A transfer URI is region-singular. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a QuotaTransfer list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String targetProvider, String region) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), targetProvider, region, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List quota transfers at the (subscription, targetProvider, region) scope. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. A transfer URI is region-singular. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a QuotaTransfer list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String targetProvider, String region, Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), targetProvider, region, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List quota transfers at the (subscription, targetProvider, region) scope. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. A transfer URI is region-singular. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a QuotaTransfer list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String targetProvider, String region) { + return new PagedIterable<>(() -> listSinglePage(targetProvider, region), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List quota transfers at the (subscription, targetProvider, region) scope. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. A transfer URI is region-singular. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a QuotaTransfer list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String targetProvider, String region, Context context) { + return new PagedIterable<>(() -> listSinglePage(targetProvider, region, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Cancel a Pending quota transfer. Synchronous. Transitions the transfer to Cancelled + * and returns the refreshed resource envelope. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. A transfer URI is region-singular. + * @param transferName The donor-chosen name segment of the quota transfer. Used as the idempotency key + * for retries on the donor side. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a quota transfer authored on the donor side along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> cancelWithResponseAsync(String targetProvider, String region, + String transferName, QuotaTransferCancelRequest body) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.cancel(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), targetProvider, region, transferName, accept, body, + CoreUtils.randomUuid().toString(), DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()), context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Cancel a Pending quota transfer. Synchronous. Transitions the transfer to Cancelled + * and returns the refreshed resource envelope. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. A transfer URI is region-singular. + * @param transferName The donor-chosen name segment of the quota transfer. Used as the idempotency key + * for retries on the donor side. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a quota transfer authored on the donor side on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono cancelAsync(String targetProvider, String region, String transferName) { + final QuotaTransferCancelRequest body = null; + return cancelWithResponseAsync(targetProvider, region, transferName, body) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Cancel a Pending quota transfer. Synchronous. Transitions the transfer to Cancelled + * and returns the refreshed resource envelope. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. A transfer URI is region-singular. + * @param transferName The donor-chosen name segment of the quota transfer. Used as the idempotency key + * for retries on the donor side. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a quota transfer authored on the donor side along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response cancelWithResponse(String targetProvider, String region, String transferName, + QuotaTransferCancelRequest body, Context context) { + final String accept = "application/json"; + return service.cancelSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), targetProvider, region, transferName, accept, body, + CoreUtils.randomUuid().toString(), DateTimeRfc1123.toRfc1123String(OffsetDateTime.now()), context); + } + + /** + * Cancel a Pending quota transfer. Synchronous. Transitions the transfer to Cancelled + * and returns the refreshed resource envelope. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. A transfer URI is region-singular. + * @param transferName The donor-chosen name segment of the quota transfer. Used as the idempotency key + * for retries on the donor side. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a quota transfer authored on the donor side. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public QuotaTransferInner cancel(String targetProvider, String region, String transferName) { + final QuotaTransferCancelRequest body = null; + return cancelWithResponse(targetProvider, region, transferName, body, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a QuotaTransfer list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a QuotaTransfer list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a QuotaTransfer list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaTransfersImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaTransfersImpl.java new file mode 100644 index 000000000000..de885fe17f83 --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaTransfersImpl.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.quota.fluent.QuotaTransfersClient; +import com.azure.resourcemanager.quota.fluent.models.QuotaTransferInner; +import com.azure.resourcemanager.quota.models.QuotaTransfer; +import com.azure.resourcemanager.quota.models.QuotaTransferCancelRequest; +import com.azure.resourcemanager.quota.models.QuotaTransfers; + +public final class QuotaTransfersImpl implements QuotaTransfers { + private static final ClientLogger LOGGER = new ClientLogger(QuotaTransfersImpl.class); + + private final QuotaTransfersClient innerClient; + + private final com.azure.resourcemanager.quota.QuotaManager serviceManager; + + public QuotaTransfersImpl(QuotaTransfersClient innerClient, + com.azure.resourcemanager.quota.QuotaManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String targetProvider, String region, String transferName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(targetProvider, region, transferName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new QuotaTransferImpl(inner.getValue(), this.manager())); + } + + public QuotaTransfer get(String targetProvider, String region, String transferName) { + QuotaTransferInner inner = this.serviceClient().get(targetProvider, region, transferName); + if (inner != null) { + return new QuotaTransferImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteWithResponse(String targetProvider, String region, String transferName, + Context context) { + return this.serviceClient().deleteWithResponse(targetProvider, region, transferName, context); + } + + public void delete(String targetProvider, String region, String transferName) { + this.serviceClient().delete(targetProvider, region, transferName); + } + + public PagedIterable list(String targetProvider, String region) { + PagedIterable inner = this.serviceClient().list(targetProvider, region); + return ResourceManagerUtils.mapPage(inner, inner1 -> new QuotaTransferImpl(inner1, this.manager())); + } + + public PagedIterable list(String targetProvider, String region, Context context) { + PagedIterable inner = this.serviceClient().list(targetProvider, region, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new QuotaTransferImpl(inner1, this.manager())); + } + + public Response cancelWithResponse(String targetProvider, String region, String transferName, + QuotaTransferCancelRequest body, Context context) { + Response inner + = this.serviceClient().cancelWithResponse(targetProvider, region, transferName, body, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new QuotaTransferImpl(inner.getValue(), this.manager())); + } + + public QuotaTransfer cancel(String targetProvider, String region, String transferName) { + QuotaTransferInner inner = this.serviceClient().cancel(targetProvider, region, transferName); + if (inner != null) { + return new QuotaTransferImpl(inner, this.manager()); + } else { + return null; + } + } + + public QuotaTransfer getById(String id) { + String targetProvider = ResourceManagerUtils.getValueFromIdByName(id, "providers"); + if (targetProvider == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'providers'.", id))); + } + String region = ResourceManagerUtils.getValueFromIdByName(id, "locations"); + if (region == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'locations'.", id))); + } + String transferName = ResourceManagerUtils.getValueFromIdByName(id, "quotaTransfers"); + if (transferName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'quotaTransfers'.", id))); + } + return this.getWithResponse(targetProvider, region, transferName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String targetProvider = ResourceManagerUtils.getValueFromIdByName(id, "providers"); + if (targetProvider == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'providers'.", id))); + } + String region = ResourceManagerUtils.getValueFromIdByName(id, "locations"); + if (region == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'locations'.", id))); + } + String transferName = ResourceManagerUtils.getValueFromIdByName(id, "quotaTransfers"); + if (transferName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'quotaTransfers'.", id))); + } + return this.getWithResponse(targetProvider, region, transferName, context); + } + + public void deleteById(String id) { + String targetProvider = ResourceManagerUtils.getValueFromIdByName(id, "providers"); + if (targetProvider == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'providers'.", id))); + } + String region = ResourceManagerUtils.getValueFromIdByName(id, "locations"); + if (region == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'locations'.", id))); + } + String transferName = ResourceManagerUtils.getValueFromIdByName(id, "quotaTransfers"); + if (transferName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'quotaTransfers'.", id))); + } + this.deleteWithResponse(targetProvider, region, transferName, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String targetProvider = ResourceManagerUtils.getValueFromIdByName(id, "providers"); + if (targetProvider == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'providers'.", id))); + } + String region = ResourceManagerUtils.getValueFromIdByName(id, "locations"); + if (region == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'locations'.", id))); + } + String transferName = ResourceManagerUtils.getValueFromIdByName(id, "quotaTransfers"); + if (transferName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'quotaTransfers'.", id))); + } + return this.deleteWithResponse(targetProvider, region, transferName, context); + } + + private QuotaTransfersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.quota.QuotaManager manager() { + return this.serviceManager; + } + + public QuotaTransferImpl define(String name) { + return new QuotaTransferImpl(name, this.manager()); + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/models/IncomingQuotaTransferListResult.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/models/IncomingQuotaTransferListResult.java new file mode 100644 index 000000000000..15aeb5673277 --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/models/IncomingQuotaTransferListResult.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.quota.fluent.models.IncomingQuotaTransferInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a IncomingQuotaTransfer list operation. + */ +@Immutable +public final class IncomingQuotaTransferListResult implements JsonSerializable { + /* + * The IncomingQuotaTransfer items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of IncomingQuotaTransferListResult class. + */ + private IncomingQuotaTransferListResult() { + } + + /** + * Get the value property: The IncomingQuotaTransfer items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IncomingQuotaTransferListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IncomingQuotaTransferListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the IncomingQuotaTransferListResult. + */ + public static IncomingQuotaTransferListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IncomingQuotaTransferListResult deserializedIncomingQuotaTransferListResult + = new IncomingQuotaTransferListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> IncomingQuotaTransferInner.fromJson(reader1)); + deserializedIncomingQuotaTransferListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedIncomingQuotaTransferListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIncomingQuotaTransferListResult; + }); + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/models/QuotaTransferListResult.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/models/QuotaTransferListResult.java new file mode 100644 index 000000000000..81385e9bd48e --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/models/QuotaTransferListResult.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.quota.fluent.models.QuotaTransferInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a QuotaTransfer list operation. + */ +@Immutable +public final class QuotaTransferListResult implements JsonSerializable { + /* + * The QuotaTransfer items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of QuotaTransferListResult class. + */ + private QuotaTransferListResult() { + } + + /** + * Get the value property: The QuotaTransfer items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of QuotaTransferListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of QuotaTransferListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the QuotaTransferListResult. + */ + public static QuotaTransferListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + QuotaTransferListResult deserializedQuotaTransferListResult = new QuotaTransferListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> QuotaTransferInner.fromJson(reader1)); + deserializedQuotaTransferListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedQuotaTransferListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedQuotaTransferListResult; + }); + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/ApprovalRecord.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/ApprovalRecord.java new file mode 100644 index 000000000000..1c9c2b9a96d4 --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/ApprovalRecord.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Record of an approval action on a transfer. + */ +@Immutable +public final class ApprovalRecord implements JsonSerializable { + /* + * Optional free-text comment supplied by the approver. + */ + private String comment; + + /* + * Principal that performed the approval (typically a UPN or service principal id). + */ + private String actor; + + /* + * Timestamp at which the approval was recorded. + */ + private OffsetDateTime occurredAt; + + /** + * Creates an instance of ApprovalRecord class. + */ + private ApprovalRecord() { + } + + /** + * Get the comment property: Optional free-text comment supplied by the approver. + * + * @return the comment value. + */ + public String comment() { + return this.comment; + } + + /** + * Get the actor property: Principal that performed the approval (typically a UPN or service principal id). + * + * @return the actor value. + */ + public String actor() { + return this.actor; + } + + /** + * Get the occurredAt property: Timestamp at which the approval was recorded. + * + * @return the occurredAt value. + */ + public OffsetDateTime occurredAt() { + return this.occurredAt; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("actor", this.actor); + jsonWriter.writeStringField("occurredAt", + this.occurredAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.occurredAt)); + jsonWriter.writeStringField("comment", this.comment); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApprovalRecord from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApprovalRecord if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ApprovalRecord. + */ + public static ApprovalRecord fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ApprovalRecord deserializedApprovalRecord = new ApprovalRecord(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("actor".equals(fieldName)) { + deserializedApprovalRecord.actor = reader.getString(); + } else if ("occurredAt".equals(fieldName)) { + deserializedApprovalRecord.occurredAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("comment".equals(fieldName)) { + deserializedApprovalRecord.comment = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedApprovalRecord; + }); + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/CancellationRecord.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/CancellationRecord.java new file mode 100644 index 000000000000..b45b2785477d --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/CancellationRecord.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Record of a cancellation action on a transfer. + */ +@Immutable +public final class CancellationRecord implements JsonSerializable { + /* + * Optional free-text reason supplied by the donor when cancelling. + */ + private String reason; + + /* + * Principal that performed the cancellation. + */ + private String actor; + + /* + * Timestamp at which the cancellation was recorded. + */ + private OffsetDateTime occurredAt; + + /** + * Creates an instance of CancellationRecord class. + */ + private CancellationRecord() { + } + + /** + * Get the reason property: Optional free-text reason supplied by the donor when cancelling. + * + * @return the reason value. + */ + public String reason() { + return this.reason; + } + + /** + * Get the actor property: Principal that performed the cancellation. + * + * @return the actor value. + */ + public String actor() { + return this.actor; + } + + /** + * Get the occurredAt property: Timestamp at which the cancellation was recorded. + * + * @return the occurredAt value. + */ + public OffsetDateTime occurredAt() { + return this.occurredAt; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("actor", this.actor); + jsonWriter.writeStringField("occurredAt", + this.occurredAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.occurredAt)); + jsonWriter.writeStringField("reason", this.reason); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CancellationRecord from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CancellationRecord if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CancellationRecord. + */ + public static CancellationRecord fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CancellationRecord deserializedCancellationRecord = new CancellationRecord(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("actor".equals(fieldName)) { + deserializedCancellationRecord.actor = reader.getString(); + } else if ("occurredAt".equals(fieldName)) { + deserializedCancellationRecord.occurredAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("reason".equals(fieldName)) { + deserializedCancellationRecord.reason = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCancellationRecord; + }); + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/IncomingQuotaTransfer.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/IncomingQuotaTransfer.java new file mode 100644 index 000000000000..fabb9c3d4a07 --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/IncomingQuotaTransfer.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.quota.fluent.models.IncomingQuotaTransferInner; + +/** + * An immutable client-side representation of IncomingQuotaTransfer. + */ +public interface IncomingQuotaTransfer { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: Properties of the incoming quota transfer. + * + * @return the properties value. + */ + IncomingQuotaTransferProperties properties(); + + /** + * Gets the etag property: "If etag is provided in the response body, it may also be provided as a header per the + * normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. + * HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), + * and If-Range (section 14.27) header fields."). + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.quota.fluent.models.IncomingQuotaTransferInner object. + * + * @return the inner object. + */ + IncomingQuotaTransferInner innerModel(); +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/IncomingQuotaTransferApproveRequest.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/IncomingQuotaTransferApproveRequest.java new file mode 100644 index 000000000000..56a87cd72a8f --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/IncomingQuotaTransferApproveRequest.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Request body for the recipient approve action. + */ +@Fluent +public final class IncomingQuotaTransferApproveRequest + implements JsonSerializable { + /* + * Optional free-text comment recorded on the transfer. + */ + private String comment; + + /** + * Creates an instance of IncomingQuotaTransferApproveRequest class. + */ + public IncomingQuotaTransferApproveRequest() { + } + + /** + * Get the comment property: Optional free-text comment recorded on the transfer. + * + * @return the comment value. + */ + public String comment() { + return this.comment; + } + + /** + * Set the comment property: Optional free-text comment recorded on the transfer. + * + * @param comment the comment value to set. + * @return the IncomingQuotaTransferApproveRequest object itself. + */ + public IncomingQuotaTransferApproveRequest withComment(String comment) { + this.comment = comment; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("comment", this.comment); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IncomingQuotaTransferApproveRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IncomingQuotaTransferApproveRequest if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the IncomingQuotaTransferApproveRequest. + */ + public static IncomingQuotaTransferApproveRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IncomingQuotaTransferApproveRequest deserializedIncomingQuotaTransferApproveRequest + = new IncomingQuotaTransferApproveRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("comment".equals(fieldName)) { + deserializedIncomingQuotaTransferApproveRequest.comment = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIncomingQuotaTransferApproveRequest; + }); + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/IncomingQuotaTransferProperties.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/IncomingQuotaTransferProperties.java new file mode 100644 index 000000000000..47abad1d53d5 --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/IncomingQuotaTransferProperties.java @@ -0,0 +1,260 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Recipient-side projection properties of a quota transfer. + */ +@Immutable +public final class IncomingQuotaTransferProperties implements JsonSerializable { + /* + * The status of the underlying ARM resource operation. + */ + private TransferProvisioningState provisioningState; + + /* + * The business status of the transfer. + */ + private TransferStatus transferStatus; + + /* + * Server-generated identifier of the transfer (matches the URI key). + */ + private String transferId; + + /* + * Fully qualified ARM resource id of the donor-side quotaTransfers resource. + */ + private String transferRef; + + /* + * Donor subscription id. The recipient subscription is the one in the request URI. + */ + private String sourceSubscriptionId; + + /* + * Donor tenant id, resolved by the service from the donor subscription. + */ + private String sourceTenantId; + + /* + * Billing account id both donor and recipient subscriptions roll up to. + */ + private String billingAccountId; + + /* + * The quota dimension being moved. + */ + private String resourceName; + + /* + * Amount being transferred in the resource's native unit. + */ + private Long amount; + + /* + * ETag of the donor-side source document at the time the inbox entry was projected. Used + * as the If-Match value on approve and reject requests. + */ + private String sourceEtag; + + /* + * Approval record. Populated when `transferStatus` is `Accepted` or `Completed`. + * Mutually exclusive with `rejection`. + */ + private ApprovalRecord approval; + + /* + * Rejection record. Populated when `transferStatus` is `Rejected`. + * Mutually exclusive with `approval`. + */ + private RejectionRecord rejection; + + /** + * Creates an instance of IncomingQuotaTransferProperties class. + */ + private IncomingQuotaTransferProperties() { + } + + /** + * Get the provisioningState property: The status of the underlying ARM resource operation. + * + * @return the provisioningState value. + */ + public TransferProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the transferStatus property: The business status of the transfer. + * + * @return the transferStatus value. + */ + public TransferStatus transferStatus() { + return this.transferStatus; + } + + /** + * Get the transferId property: Server-generated identifier of the transfer (matches the URI key). + * + * @return the transferId value. + */ + public String transferId() { + return this.transferId; + } + + /** + * Get the transferRef property: Fully qualified ARM resource id of the donor-side quotaTransfers resource. + * + * @return the transferRef value. + */ + public String transferRef() { + return this.transferRef; + } + + /** + * Get the sourceSubscriptionId property: Donor subscription id. The recipient subscription is the one in the + * request URI. + * + * @return the sourceSubscriptionId value. + */ + public String sourceSubscriptionId() { + return this.sourceSubscriptionId; + } + + /** + * Get the sourceTenantId property: Donor tenant id, resolved by the service from the donor subscription. + * + * @return the sourceTenantId value. + */ + public String sourceTenantId() { + return this.sourceTenantId; + } + + /** + * Get the billingAccountId property: Billing account id both donor and recipient subscriptions roll up to. + * + * @return the billingAccountId value. + */ + public String billingAccountId() { + return this.billingAccountId; + } + + /** + * Get the resourceName property: The quota dimension being moved. + * + * @return the resourceName value. + */ + public String resourceName() { + return this.resourceName; + } + + /** + * Get the amount property: Amount being transferred in the resource's native unit. + * + * @return the amount value. + */ + public Long amount() { + return this.amount; + } + + /** + * Get the sourceEtag property: ETag of the donor-side source document at the time the inbox entry was projected. + * Used + * as the If-Match value on approve and reject requests. + * + * @return the sourceEtag value. + */ + public String sourceEtag() { + return this.sourceEtag; + } + + /** + * Get the approval property: Approval record. Populated when `transferStatus` is `Accepted` or `Completed`. + * Mutually exclusive with `rejection`. + * + * @return the approval value. + */ + public ApprovalRecord approval() { + return this.approval; + } + + /** + * Get the rejection property: Rejection record. Populated when `transferStatus` is `Rejected`. + * Mutually exclusive with `approval`. + * + * @return the rejection value. + */ + public RejectionRecord rejection() { + return this.rejection; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IncomingQuotaTransferProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IncomingQuotaTransferProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the IncomingQuotaTransferProperties. + */ + public static IncomingQuotaTransferProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IncomingQuotaTransferProperties deserializedIncomingQuotaTransferProperties + = new IncomingQuotaTransferProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedIncomingQuotaTransferProperties.provisioningState + = TransferProvisioningState.fromString(reader.getString()); + } else if ("transferStatus".equals(fieldName)) { + deserializedIncomingQuotaTransferProperties.transferStatus + = TransferStatus.fromString(reader.getString()); + } else if ("transferId".equals(fieldName)) { + deserializedIncomingQuotaTransferProperties.transferId = reader.getString(); + } else if ("transferRef".equals(fieldName)) { + deserializedIncomingQuotaTransferProperties.transferRef = reader.getString(); + } else if ("sourceSubscriptionId".equals(fieldName)) { + deserializedIncomingQuotaTransferProperties.sourceSubscriptionId = reader.getString(); + } else if ("sourceTenantId".equals(fieldName)) { + deserializedIncomingQuotaTransferProperties.sourceTenantId = reader.getString(); + } else if ("billingAccountId".equals(fieldName)) { + deserializedIncomingQuotaTransferProperties.billingAccountId = reader.getString(); + } else if ("resourceName".equals(fieldName)) { + deserializedIncomingQuotaTransferProperties.resourceName = reader.getString(); + } else if ("amount".equals(fieldName)) { + deserializedIncomingQuotaTransferProperties.amount = reader.getNullable(JsonReader::getLong); + } else if ("sourceEtag".equals(fieldName)) { + deserializedIncomingQuotaTransferProperties.sourceEtag = reader.getString(); + } else if ("approval".equals(fieldName)) { + deserializedIncomingQuotaTransferProperties.approval = ApprovalRecord.fromJson(reader); + } else if ("rejection".equals(fieldName)) { + deserializedIncomingQuotaTransferProperties.rejection = RejectionRecord.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedIncomingQuotaTransferProperties; + }); + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/IncomingQuotaTransferRejectRequest.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/IncomingQuotaTransferRejectRequest.java new file mode 100644 index 000000000000..fdb1d1dcac51 --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/IncomingQuotaTransferRejectRequest.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Request body for the recipient reject action. + */ +@Fluent +public final class IncomingQuotaTransferRejectRequest implements JsonSerializable { + /* + * Optional free-text reason recorded on the transfer. + */ + private String reason; + + /** + * Creates an instance of IncomingQuotaTransferRejectRequest class. + */ + public IncomingQuotaTransferRejectRequest() { + } + + /** + * Get the reason property: Optional free-text reason recorded on the transfer. + * + * @return the reason value. + */ + public String reason() { + return this.reason; + } + + /** + * Set the reason property: Optional free-text reason recorded on the transfer. + * + * @param reason the reason value to set. + * @return the IncomingQuotaTransferRejectRequest object itself. + */ + public IncomingQuotaTransferRejectRequest withReason(String reason) { + this.reason = reason; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("reason", this.reason); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IncomingQuotaTransferRejectRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IncomingQuotaTransferRejectRequest if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the IncomingQuotaTransferRejectRequest. + */ + public static IncomingQuotaTransferRejectRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IncomingQuotaTransferRejectRequest deserializedIncomingQuotaTransferRejectRequest + = new IncomingQuotaTransferRejectRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("reason".equals(fieldName)) { + deserializedIncomingQuotaTransferRejectRequest.reason = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIncomingQuotaTransferRejectRequest; + }); + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/IncomingQuotaTransfers.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/IncomingQuotaTransfers.java new file mode 100644 index 000000000000..b44ec4521af5 --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/IncomingQuotaTransfers.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of IncomingQuotaTransfers. + */ +public interface IncomingQuotaTransfers { + /** + * Get an incoming quota transfer. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. + * @param transferId Server-generated identifier of the transfer (matches `properties.transferId`). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an incoming quota transfer along with {@link Response}. + */ + Response getWithResponse(String targetProvider, String region, String transferId, + Context context); + + /** + * Get an incoming quota transfer. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. + * @param transferId Server-generated identifier of the transfer (matches `properties.transferId`). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an incoming quota transfer. + */ + IncomingQuotaTransfer get(String targetProvider, String region, String transferId); + + /** + * List incoming quota transfers at the (subscription, targetProvider, region) scope. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IncomingQuotaTransfer list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String targetProvider, String region); + + /** + * List incoming quota transfers at the (subscription, targetProvider, region) scope. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IncomingQuotaTransfer list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String targetProvider, String region, Context context); + + /** + * List incoming quota transfers across every targetProvider and region for the + * subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IncomingQuotaTransfer list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listBySubscription(); + + /** + * List incoming quota transfers across every targetProvider and region for the + * subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a IncomingQuotaTransfer list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listBySubscription(Context context); + + /** + * Approve a Pending incoming quota transfer. Long-running. The `If-Match` header value + * must equal `properties.sourceEtag` returned on a prior GET; a stale value yields + * 412 SourceResourceModified. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. + * @param transferId Server-generated identifier of the transfer (matches `properties.transferId`). + * @param ifMatch Optimistic-concurrency precondition. Must equal `properties.sourceEtag` from a + * prior GET on the incoming transfer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recipient-side projection of a quota transfer. + */ + IncomingQuotaTransfer approve(String targetProvider, String region, String transferId, String ifMatch); + + /** + * Approve a Pending incoming quota transfer. Long-running. The `If-Match` header value + * must equal `properties.sourceEtag` returned on a prior GET; a stale value yields + * 412 SourceResourceModified. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. + * @param transferId Server-generated identifier of the transfer (matches `properties.transferId`). + * @param ifMatch Optimistic-concurrency precondition. Must equal `properties.sourceEtag` from a + * prior GET on the incoming transfer. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recipient-side projection of a quota transfer. + */ + IncomingQuotaTransfer approve(String targetProvider, String region, String transferId, String ifMatch, + IncomingQuotaTransferApproveRequest body, Context context); + + /** + * Reject a Pending incoming quota transfer. Synchronous. The `If-Match` header value + * must equal `properties.sourceEtag` returned on a prior GET. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. + * @param transferId Server-generated identifier of the transfer (matches `properties.transferId`). + * @param ifMatch Optimistic-concurrency precondition. Must equal `properties.sourceEtag` from a + * prior GET on the incoming transfer. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recipient-side projection of a quota transfer along with {@link Response}. + */ + Response rejectWithResponse(String targetProvider, String region, String transferId, + String ifMatch, IncomingQuotaTransferRejectRequest body, Context context); + + /** + * Reject a Pending incoming quota transfer. Synchronous. The `If-Match` header value + * must equal `properties.sourceEtag` returned on a prior GET. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. + * @param transferId Server-generated identifier of the transfer (matches `properties.transferId`). + * @param ifMatch Optimistic-concurrency precondition. Must equal `properties.sourceEtag` from a + * prior GET on the incoming transfer. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return recipient-side projection of a quota transfer. + */ + IncomingQuotaTransfer reject(String targetProvider, String region, String transferId, String ifMatch); +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaTransfer.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaTransfer.java new file mode 100644 index 000000000000..2e469cf161a6 --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaTransfer.java @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.quota.fluent.models.QuotaTransferInner; + +/** + * An immutable client-side representation of QuotaTransfer. + */ +public interface QuotaTransfer { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: Properties of the quota transfer. + * + * @return the properties value. + */ + QuotaTransferProperties properties(); + + /** + * Gets the etag property: "If etag is provided in the response body, it may also be provided as a header per the + * normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. + * HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), + * and If-Range (section 14.27) header fields."). + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.quota.fluent.models.QuotaTransferInner object. + * + * @return the inner object. + */ + QuotaTransferInner innerModel(); + + /** + * The entirety of the QuotaTransfer definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The QuotaTransfer definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the QuotaTransfer definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the QuotaTransfer definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies targetProvider, region. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. A transfer URI is region-singular. + * @return the next definition stage. + */ + WithCreate withExistingLocation(String targetProvider, String region); + } + + /** + * The stage of the QuotaTransfer definition which contains all the minimum required properties for the resource + * to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + QuotaTransfer create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + QuotaTransfer create(Context context); + } + + /** + * The stage of the QuotaTransfer definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: Properties of the quota transfer.. + * + * @param properties Properties of the quota transfer. + * @return the next definition stage. + */ + WithCreate withProperties(QuotaTransferProperties properties); + } + } + + /** + * Begins update for the QuotaTransfer resource. + * + * @return the stage of resource update. + */ + QuotaTransfer.Update update(); + + /** + * The template for QuotaTransfer update. + */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + QuotaTransfer apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + QuotaTransfer apply(Context context); + } + + /** + * The QuotaTransfer update stages. + */ + interface UpdateStages { + /** + * The stage of the QuotaTransfer update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: Properties of the quota transfer.. + * + * @param properties Properties of the quota transfer. + * @return the next definition stage. + */ + Update withProperties(QuotaTransferProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + QuotaTransfer refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + QuotaTransfer refresh(Context context); + + /** + * Cancel a Pending quota transfer. Synchronous. Transitions the transfer to Cancelled + * and returns the refreshed resource envelope. + * + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a quota transfer authored on the donor side along with {@link Response}. + */ + Response cancelWithResponse(QuotaTransferCancelRequest body, Context context); + + /** + * Cancel a Pending quota transfer. Synchronous. Transitions the transfer to Cancelled + * and returns the refreshed resource envelope. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a quota transfer authored on the donor side. + */ + QuotaTransfer cancel(); +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaTransferCancelRequest.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaTransferCancelRequest.java new file mode 100644 index 000000000000..a8041115b4ca --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaTransferCancelRequest.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Request body for the donor cancel action. + */ +@Fluent +public final class QuotaTransferCancelRequest implements JsonSerializable { + /* + * Optional free-text reason recorded on the transfer. + */ + private String reason; + + /** + * Creates an instance of QuotaTransferCancelRequest class. + */ + public QuotaTransferCancelRequest() { + } + + /** + * Get the reason property: Optional free-text reason recorded on the transfer. + * + * @return the reason value. + */ + public String reason() { + return this.reason; + } + + /** + * Set the reason property: Optional free-text reason recorded on the transfer. + * + * @param reason the reason value to set. + * @return the QuotaTransferCancelRequest object itself. + */ + public QuotaTransferCancelRequest withReason(String reason) { + this.reason = reason; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("reason", this.reason); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of QuotaTransferCancelRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of QuotaTransferCancelRequest if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the QuotaTransferCancelRequest. + */ + public static QuotaTransferCancelRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + QuotaTransferCancelRequest deserializedQuotaTransferCancelRequest = new QuotaTransferCancelRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("reason".equals(fieldName)) { + deserializedQuotaTransferCancelRequest.reason = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedQuotaTransferCancelRequest; + }); + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaTransferProperties.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaTransferProperties.java new file mode 100644 index 000000000000..a7349cfd22b3 --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaTransferProperties.java @@ -0,0 +1,430 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * Donor-side properties of a quota transfer. + */ +@Fluent +public final class QuotaTransferProperties implements JsonSerializable { + /* + * The status of the underlying ARM resource operation. + */ + private TransferProvisioningState provisioningState; + + /* + * The business status of the transfer. + */ + private TransferStatus transferStatus; + + /* + * Server-generated identifier the recipient uses to address the transfer on the + * incomingQuotaTransfers URI. + */ + private String transferId; + + /* + * Human-friendly label surfaced on customer GET responses and recipient inbox listings. + */ + private String displayName; + + /* + * Donor-supplied free-text rationale captured at submit time. + */ + private String comment; + + /* + * Recipient subscription id. Must differ from the donor subscription. + */ + private String destinationSubscriptionId; + + /* + * Recipient tenant id, resolved by the service from the recipient subscription. + */ + private String destinationTenantId; + + /* + * Billing account id both donor and recipient subscriptions must roll up to. + */ + private String billingAccountId; + + /* + * The quota dimension being moved, scoped by the URI's target provider + * (for example, `standardDv5Family` under Microsoft.Compute). + */ + private String resourceName; + + /* + * Amount to transfer in the resource's native unit (e.g. vCPU count). + */ + private long amount; + + /* + * Same-tenant one-shot opt-in. When true, the donor PUT admission-checks recipient-side + * RBAC and cap at submit time and drives the transfer to terminal Completed within the + * same LRO, with no recipient approve required. The outcome is reflected by + * `transferStatus`: `Completed` means the auto path committed; `Pending` means it did + * not (e.g. cross-tenant, missing RBAC, cap exceeded) and the recipient must approve. + */ + private Boolean autoApprove; + + /* + * Time the transfer was created. + */ + private OffsetDateTime createdAt; + + /* + * Time at which a Pending transfer expires if the recipient has not approved or rejected it. + */ + private OffsetDateTime expiresAt; + + /* + * Principal that created the transfer. + */ + private String createdBy; + + /* + * Approval record. Populated when `transferStatus` is `Accepted` or `Completed`. + * Mutually exclusive with `cancellation`. + */ + private ApprovalRecord approval; + + /* + * Cancellation record. Populated when `transferStatus` is `Cancelled`. + * Mutually exclusive with `approval`. + */ + private CancellationRecord cancellation; + + /** + * Creates an instance of QuotaTransferProperties class. + */ + public QuotaTransferProperties() { + } + + /** + * Get the provisioningState property: The status of the underlying ARM resource operation. + * + * @return the provisioningState value. + */ + public TransferProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the transferStatus property: The business status of the transfer. + * + * @return the transferStatus value. + */ + public TransferStatus transferStatus() { + return this.transferStatus; + } + + /** + * Get the transferId property: Server-generated identifier the recipient uses to address the transfer on the + * incomingQuotaTransfers URI. + * + * @return the transferId value. + */ + public String transferId() { + return this.transferId; + } + + /** + * Get the displayName property: Human-friendly label surfaced on customer GET responses and recipient inbox + * listings. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Human-friendly label surfaced on customer GET responses and recipient inbox + * listings. + * + * @param displayName the displayName value to set. + * @return the QuotaTransferProperties object itself. + */ + public QuotaTransferProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the comment property: Donor-supplied free-text rationale captured at submit time. + * + * @return the comment value. + */ + public String comment() { + return this.comment; + } + + /** + * Set the comment property: Donor-supplied free-text rationale captured at submit time. + * + * @param comment the comment value to set. + * @return the QuotaTransferProperties object itself. + */ + public QuotaTransferProperties withComment(String comment) { + this.comment = comment; + return this; + } + + /** + * Get the destinationSubscriptionId property: Recipient subscription id. Must differ from the donor subscription. + * + * @return the destinationSubscriptionId value. + */ + public String destinationSubscriptionId() { + return this.destinationSubscriptionId; + } + + /** + * Set the destinationSubscriptionId property: Recipient subscription id. Must differ from the donor subscription. + * + * @param destinationSubscriptionId the destinationSubscriptionId value to set. + * @return the QuotaTransferProperties object itself. + */ + public QuotaTransferProperties withDestinationSubscriptionId(String destinationSubscriptionId) { + this.destinationSubscriptionId = destinationSubscriptionId; + return this; + } + + /** + * Get the destinationTenantId property: Recipient tenant id, resolved by the service from the recipient + * subscription. + * + * @return the destinationTenantId value. + */ + public String destinationTenantId() { + return this.destinationTenantId; + } + + /** + * Get the billingAccountId property: Billing account id both donor and recipient subscriptions must roll up to. + * + * @return the billingAccountId value. + */ + public String billingAccountId() { + return this.billingAccountId; + } + + /** + * Set the billingAccountId property: Billing account id both donor and recipient subscriptions must roll up to. + * + * @param billingAccountId the billingAccountId value to set. + * @return the QuotaTransferProperties object itself. + */ + public QuotaTransferProperties withBillingAccountId(String billingAccountId) { + this.billingAccountId = billingAccountId; + return this; + } + + /** + * Get the resourceName property: The quota dimension being moved, scoped by the URI's target provider + * (for example, `standardDv5Family` under Microsoft.Compute). + * + * @return the resourceName value. + */ + public String resourceName() { + return this.resourceName; + } + + /** + * Set the resourceName property: The quota dimension being moved, scoped by the URI's target provider + * (for example, `standardDv5Family` under Microsoft.Compute). + * + * @param resourceName the resourceName value to set. + * @return the QuotaTransferProperties object itself. + */ + public QuotaTransferProperties withResourceName(String resourceName) { + this.resourceName = resourceName; + return this; + } + + /** + * Get the amount property: Amount to transfer in the resource's native unit (e.g. vCPU count). + * + * @return the amount value. + */ + public long amount() { + return this.amount; + } + + /** + * Set the amount property: Amount to transfer in the resource's native unit (e.g. vCPU count). + * + * @param amount the amount value to set. + * @return the QuotaTransferProperties object itself. + */ + public QuotaTransferProperties withAmount(long amount) { + this.amount = amount; + return this; + } + + /** + * Get the autoApprove property: Same-tenant one-shot opt-in. When true, the donor PUT admission-checks + * recipient-side + * RBAC and cap at submit time and drives the transfer to terminal Completed within the + * same LRO, with no recipient approve required. The outcome is reflected by + * `transferStatus`: `Completed` means the auto path committed; `Pending` means it did + * not (e.g. cross-tenant, missing RBAC, cap exceeded) and the recipient must approve. + * + * @return the autoApprove value. + */ + public Boolean autoApprove() { + return this.autoApprove; + } + + /** + * Set the autoApprove property: Same-tenant one-shot opt-in. When true, the donor PUT admission-checks + * recipient-side + * RBAC and cap at submit time and drives the transfer to terminal Completed within the + * same LRO, with no recipient approve required. The outcome is reflected by + * `transferStatus`: `Completed` means the auto path committed; `Pending` means it did + * not (e.g. cross-tenant, missing RBAC, cap exceeded) and the recipient must approve. + * + * @param autoApprove the autoApprove value to set. + * @return the QuotaTransferProperties object itself. + */ + public QuotaTransferProperties withAutoApprove(Boolean autoApprove) { + this.autoApprove = autoApprove; + return this; + } + + /** + * Get the createdAt property: Time the transfer was created. + * + * @return the createdAt value. + */ + public OffsetDateTime createdAt() { + return this.createdAt; + } + + /** + * Get the expiresAt property: Time at which a Pending transfer expires if the recipient has not approved or + * rejected it. + * + * @return the expiresAt value. + */ + public OffsetDateTime expiresAt() { + return this.expiresAt; + } + + /** + * Get the createdBy property: Principal that created the transfer. + * + * @return the createdBy value. + */ + public String createdBy() { + return this.createdBy; + } + + /** + * Get the approval property: Approval record. Populated when `transferStatus` is `Accepted` or `Completed`. + * Mutually exclusive with `cancellation`. + * + * @return the approval value. + */ + public ApprovalRecord approval() { + return this.approval; + } + + /** + * Get the cancellation property: Cancellation record. Populated when `transferStatus` is `Cancelled`. + * Mutually exclusive with `approval`. + * + * @return the cancellation value. + */ + public CancellationRecord cancellation() { + return this.cancellation; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("destinationSubscriptionId", this.destinationSubscriptionId); + jsonWriter.writeStringField("billingAccountId", this.billingAccountId); + jsonWriter.writeStringField("resourceName", this.resourceName); + jsonWriter.writeLongField("amount", this.amount); + jsonWriter.writeStringField("comment", this.comment); + jsonWriter.writeBooleanField("autoApprove", this.autoApprove); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of QuotaTransferProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of QuotaTransferProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the QuotaTransferProperties. + */ + public static QuotaTransferProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + QuotaTransferProperties deserializedQuotaTransferProperties = new QuotaTransferProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("displayName".equals(fieldName)) { + deserializedQuotaTransferProperties.displayName = reader.getString(); + } else if ("destinationSubscriptionId".equals(fieldName)) { + deserializedQuotaTransferProperties.destinationSubscriptionId = reader.getString(); + } else if ("billingAccountId".equals(fieldName)) { + deserializedQuotaTransferProperties.billingAccountId = reader.getString(); + } else if ("resourceName".equals(fieldName)) { + deserializedQuotaTransferProperties.resourceName = reader.getString(); + } else if ("amount".equals(fieldName)) { + deserializedQuotaTransferProperties.amount = reader.getLong(); + } else if ("provisioningState".equals(fieldName)) { + deserializedQuotaTransferProperties.provisioningState + = TransferProvisioningState.fromString(reader.getString()); + } else if ("transferStatus".equals(fieldName)) { + deserializedQuotaTransferProperties.transferStatus = TransferStatus.fromString(reader.getString()); + } else if ("transferId".equals(fieldName)) { + deserializedQuotaTransferProperties.transferId = reader.getString(); + } else if ("comment".equals(fieldName)) { + deserializedQuotaTransferProperties.comment = reader.getString(); + } else if ("destinationTenantId".equals(fieldName)) { + deserializedQuotaTransferProperties.destinationTenantId = reader.getString(); + } else if ("autoApprove".equals(fieldName)) { + deserializedQuotaTransferProperties.autoApprove = reader.getNullable(JsonReader::getBoolean); + } else if ("createdAt".equals(fieldName)) { + deserializedQuotaTransferProperties.createdAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("expiresAt".equals(fieldName)) { + deserializedQuotaTransferProperties.expiresAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("createdBy".equals(fieldName)) { + deserializedQuotaTransferProperties.createdBy = reader.getString(); + } else if ("approval".equals(fieldName)) { + deserializedQuotaTransferProperties.approval = ApprovalRecord.fromJson(reader); + } else if ("cancellation".equals(fieldName)) { + deserializedQuotaTransferProperties.cancellation = CancellationRecord.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedQuotaTransferProperties; + }); + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaTransfers.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaTransfers.java new file mode 100644 index 000000000000..05628dc501d7 --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaTransfers.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of QuotaTransfers. + */ +public interface QuotaTransfers { + /** + * Get a quota transfer. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. A transfer URI is region-singular. + * @param transferName The donor-chosen name segment of the quota transfer. Used as the idempotency key + * for retries on the donor side. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a quota transfer along with {@link Response}. + */ + Response getWithResponse(String targetProvider, String region, String transferName, Context context); + + /** + * Get a quota transfer. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. A transfer URI is region-singular. + * @param transferName The donor-chosen name segment of the quota transfer. Used as the idempotency key + * for retries on the donor side. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a quota transfer. + */ + QuotaTransfer get(String targetProvider, String region, String transferName); + + /** + * Delete a quota transfer record. Quota is not moved by delete; only the resource entry + * is removed. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. A transfer URI is region-singular. + * @param transferName The donor-chosen name segment of the quota transfer. Used as the idempotency key + * for retries on the donor side. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteWithResponse(String targetProvider, String region, String transferName, Context context); + + /** + * Delete a quota transfer record. Quota is not moved by delete; only the resource entry + * is removed. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. A transfer URI is region-singular. + * @param transferName The donor-chosen name segment of the quota transfer. Used as the idempotency key + * for retries on the donor side. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String targetProvider, String region, String transferName); + + /** + * List quota transfers at the (subscription, targetProvider, region) scope. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. A transfer URI is region-singular. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a QuotaTransfer list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String targetProvider, String region); + + /** + * List quota transfers at the (subscription, targetProvider, region) scope. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. A transfer URI is region-singular. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a QuotaTransfer list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String targetProvider, String region, Context context); + + /** + * Cancel a Pending quota transfer. Synchronous. Transitions the transfer to Cancelled + * and returns the refreshed resource envelope. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. A transfer URI is region-singular. + * @param transferName The donor-chosen name segment of the quota transfer. Used as the idempotency key + * for retries on the donor side. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a quota transfer authored on the donor side along with {@link Response}. + */ + Response cancelWithResponse(String targetProvider, String region, String transferName, + QuotaTransferCancelRequest body, Context context); + + /** + * Cancel a Pending quota transfer. Synchronous. Transitions the transfer to Cancelled + * and returns the refreshed resource envelope. + * + * @param targetProvider The ARM provider namespace whose quota is being transferred (for example, + * `Microsoft.Compute`). + * @param region The Azure region the quota transfer applies to. A transfer URI is region-singular. + * @param transferName The donor-chosen name segment of the quota transfer. Used as the idempotency key + * for retries on the donor side. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a quota transfer authored on the donor side. + */ + QuotaTransfer cancel(String targetProvider, String region, String transferName); + + /** + * Get a quota transfer. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a quota transfer along with {@link Response}. + */ + QuotaTransfer getById(String id); + + /** + * Get a quota transfer. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a quota transfer along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a quota transfer record. Quota is not moved by delete; only the resource entry + * is removed. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a quota transfer record. Quota is not moved by delete; only the resource entry + * is removed. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new QuotaTransfer resource. + * + * @param name resource name. + * @return the first stage of the new QuotaTransfer definition. + */ + QuotaTransfer.DefinitionStages.Blank define(String name); +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/RejectionRecord.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/RejectionRecord.java new file mode 100644 index 000000000000..2cbc7843e0a9 --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/RejectionRecord.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Record of a rejection action on a transfer. + */ +@Immutable +public final class RejectionRecord implements JsonSerializable { + /* + * Optional free-text reason supplied by the recipient when rejecting. + */ + private String reason; + + /* + * Principal that performed the rejection. + */ + private String actor; + + /* + * Timestamp at which the rejection was recorded. + */ + private OffsetDateTime occurredAt; + + /** + * Creates an instance of RejectionRecord class. + */ + private RejectionRecord() { + } + + /** + * Get the reason property: Optional free-text reason supplied by the recipient when rejecting. + * + * @return the reason value. + */ + public String reason() { + return this.reason; + } + + /** + * Get the actor property: Principal that performed the rejection. + * + * @return the actor value. + */ + public String actor() { + return this.actor; + } + + /** + * Get the occurredAt property: Timestamp at which the rejection was recorded. + * + * @return the occurredAt value. + */ + public OffsetDateTime occurredAt() { + return this.occurredAt; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("actor", this.actor); + jsonWriter.writeStringField("occurredAt", + this.occurredAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.occurredAt)); + jsonWriter.writeStringField("reason", this.reason); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RejectionRecord from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RejectionRecord if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RejectionRecord. + */ + public static RejectionRecord fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RejectionRecord deserializedRejectionRecord = new RejectionRecord(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("actor".equals(fieldName)) { + deserializedRejectionRecord.actor = reader.getString(); + } else if ("occurredAt".equals(fieldName)) { + deserializedRejectionRecord.occurredAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("reason".equals(fieldName)) { + deserializedRejectionRecord.reason = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRejectionRecord; + }); + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/TransferProvisioningState.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/TransferProvisioningState.java new file mode 100644 index 000000000000..485740e47e5e --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/TransferProvisioningState.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Provisioning state of the ARM long-running operation that last wrote to a quota + * transfer resource (the donor PUT, or the recipient approve / reject actions). + * Reflects the infrastructure outcome of that call only; the business outcome of the + * transfer itself is reported separately on `transferStatus`. + */ +public final class TransferProvisioningState extends ExpandableStringEnum { + /** + * The LRO completed successfully. + */ + public static final TransferProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * The LRO terminated with a failure. + */ + public static final TransferProvisioningState FAILED = fromString("Failed"); + + /** + * The LRO was canceled before it reached a terminal state. + */ + public static final TransferProvisioningState CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of TransferProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TransferProvisioningState() { + } + + /** + * Creates or finds a TransferProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding TransferProvisioningState. + */ + public static TransferProvisioningState fromString(String name) { + return fromString(name, TransferProvisioningState.class); + } + + /** + * Gets known TransferProvisioningState values. + * + * @return known TransferProvisioningState values. + */ + public static Collection values() { + return values(TransferProvisioningState.class); + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/TransferStatus.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/TransferStatus.java new file mode 100644 index 000000000000..b28c006e0291 --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/TransferStatus.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Business status of a quota transfer. Distinct from `provisioningState`, which only + * reports the ARM LRO outcome of the most recent call. + */ +public final class TransferStatus extends ExpandableStringEnum { + /** + * The transfer has been created on the donor side and is awaiting recipient action. + */ + public static final TransferStatus PENDING = fromString("Pending"); + + /** + * The recipient has approved the transfer; quota commit is in progress. + */ + public static final TransferStatus ACCEPTED = fromString("Accepted"); + + /** + * The transfer has been applied and quota is committed at the recipient. + */ + public static final TransferStatus COMPLETED = fromString("Completed"); + + /** + * The donor cancelled the transfer before it was approved. + */ + public static final TransferStatus CANCELLED = fromString("Cancelled"); + + /** + * The recipient rejected the transfer. + */ + public static final TransferStatus REJECTED = fromString("Rejected"); + + /** + * The transfer aged out before the recipient approved or rejected it. + */ + public static final TransferStatus EXPIRED = fromString("Expired"); + + /** + * The transfer terminated with a failure. + */ + public static final TransferStatus FAILED = fromString("Failed"); + + /** + * Creates a new instance of TransferStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TransferStatus() { + } + + /** + * Creates or finds a TransferStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding TransferStatus. + */ + public static TransferStatus fromString(String name) { + return fromString(name, TransferStatus.class); + } + + /** + * Gets known TransferStatus values. + * + * @return known TransferStatus values. + */ + public static Collection values() { + return values(TransferStatus.class); + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-quota/proxy-config.json b/sdk/quota/azure-resourcemanager-quota/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-quota/proxy-config.json index 903a9bbcceac..39eb42748515 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-quota/proxy-config.json +++ b/sdk/quota/azure-resourcemanager-quota/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-quota/proxy-config.json @@ -1 +1 @@ -[["com.azure.resourcemanager.quota.implementation.GroupQuotaLimitsClientImpl$GroupQuotaLimitsService"],["com.azure.resourcemanager.quota.implementation.GroupQuotaLimitsRequestsClientImpl$GroupQuotaLimitsRequestsService"],["com.azure.resourcemanager.quota.implementation.GroupQuotaLocationSettingsClientImpl$GroupQuotaLocationSettingsService"],["com.azure.resourcemanager.quota.implementation.GroupQuotaSubscriptionAllocationRequestsClientImpl$GroupQuotaSubscriptionAllocationRequestsService"],["com.azure.resourcemanager.quota.implementation.GroupQuotaSubscriptionAllocationsClientImpl$GroupQuotaSubscriptionAllocationsService"],["com.azure.resourcemanager.quota.implementation.GroupQuotaSubscriptionRequestsClientImpl$GroupQuotaSubscriptionRequestsService"],["com.azure.resourcemanager.quota.implementation.GroupQuotaSubscriptionsClientImpl$GroupQuotaSubscriptionsService"],["com.azure.resourcemanager.quota.implementation.GroupQuotaUsagesClientImpl$GroupQuotaUsagesService"],["com.azure.resourcemanager.quota.implementation.GroupQuotasClientImpl$GroupQuotasService"],["com.azure.resourcemanager.quota.implementation.QuotaOperationsClientImpl$QuotaOperationsService"],["com.azure.resourcemanager.quota.implementation.QuotaRequestStatusClientImpl$QuotaRequestStatusService"],["com.azure.resourcemanager.quota.implementation.QuotasClientImpl$QuotasService"],["com.azure.resourcemanager.quota.implementation.UsagesClientImpl$UsagesService"]] \ No newline at end of file +[["com.azure.resourcemanager.quota.implementation.GroupQuotaLimitsClientImpl$GroupQuotaLimitsService"],["com.azure.resourcemanager.quota.implementation.GroupQuotaLimitsRequestsClientImpl$GroupQuotaLimitsRequestsService"],["com.azure.resourcemanager.quota.implementation.GroupQuotaLocationSettingsClientImpl$GroupQuotaLocationSettingsService"],["com.azure.resourcemanager.quota.implementation.GroupQuotaSubscriptionAllocationRequestsClientImpl$GroupQuotaSubscriptionAllocationRequestsService"],["com.azure.resourcemanager.quota.implementation.GroupQuotaSubscriptionAllocationsClientImpl$GroupQuotaSubscriptionAllocationsService"],["com.azure.resourcemanager.quota.implementation.GroupQuotaSubscriptionRequestsClientImpl$GroupQuotaSubscriptionRequestsService"],["com.azure.resourcemanager.quota.implementation.GroupQuotaSubscriptionsClientImpl$GroupQuotaSubscriptionsService"],["com.azure.resourcemanager.quota.implementation.GroupQuotaUsagesClientImpl$GroupQuotaUsagesService"],["com.azure.resourcemanager.quota.implementation.GroupQuotasClientImpl$GroupQuotasService"],["com.azure.resourcemanager.quota.implementation.IncomingQuotaTransfersClientImpl$IncomingQuotaTransfersService"],["com.azure.resourcemanager.quota.implementation.QuotaOperationsClientImpl$QuotaOperationsService"],["com.azure.resourcemanager.quota.implementation.QuotaRequestStatusClientImpl$QuotaRequestStatusService"],["com.azure.resourcemanager.quota.implementation.QuotaTransfersClientImpl$QuotaTransfersService"],["com.azure.resourcemanager.quota.implementation.QuotasClientImpl$QuotasService"],["com.azure.resourcemanager.quota.implementation.UsagesClientImpl$UsagesService"]] \ No newline at end of file diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitsListSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitsListSamples.java index 7e25f432e997..dabb717cc04d 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitsListSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitsListSamples.java @@ -9,7 +9,7 @@ */ public final class GroupQuotaLimitsListSamples { /* - * x-ms-original-file: 2025-09-01/GroupQuotaLimits/ListGroupQuotaLimits-Compute.json + * x-ms-original-file: 2026-09-01-preview/GroupQuotaLimits/ListGroupQuotaLimits-Compute.json */ /** * Sample code: GroupQuotaLimits_Get_Request_ForCompute. diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitsRequestGetSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitsRequestGetSamples.java index 01abcc891320..6ba25a2a31c8 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitsRequestGetSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitsRequestGetSamples.java @@ -9,7 +9,7 @@ */ public final class GroupQuotaLimitsRequestGetSamples { /* - * x-ms-original-file: 2025-09-01/GroupQuotaLimitsRequests/GroupQuotaLimitsRequests_Get.json + * x-ms-original-file: 2026-09-01-preview/GroupQuotaLimitsRequests/GroupQuotaLimitsRequests_Get.json */ /** * Sample code: GroupQuotaLimitsRequests_Get. diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitsRequestListSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitsRequestListSamples.java index 526fe6690dd5..cff640ead6c9 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitsRequestListSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitsRequestListSamples.java @@ -9,7 +9,7 @@ */ public final class GroupQuotaLimitsRequestListSamples { /* - * x-ms-original-file: 2025-09-01/GroupQuotaLimitsRequests/GroupQuotaLimitsRequests_List.json + * x-ms-original-file: 2026-09-01-preview/GroupQuotaLimitsRequests/GroupQuotaLimitsRequests_List.json */ /** * Sample code: GroupQuotaLimitsRequest_List. diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitsRequestUpdateSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitsRequestUpdateSamples.java index 8ba84a720460..3314fdf53f5d 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitsRequestUpdateSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLimitsRequestUpdateSamples.java @@ -15,7 +15,7 @@ */ public final class GroupQuotaLimitsRequestUpdateSamples { /* - * x-ms-original-file: 2025-09-01/GroupQuotaLimitsRequests/PatchGroupQuotaLimitsRequests-Compute.json + * x-ms-original-file: 2026-09-01-preview/GroupQuotaLimitsRequests/PatchGroupQuotaLimitsRequests-Compute.json */ /** * Sample code: GroupQuotaLimitsRequests_Update. diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLocationSettingsCreateOrUpdateSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLocationSettingsCreateOrUpdateSamples.java index 3e4b883747dd..dcdabb4cd3cf 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLocationSettingsCreateOrUpdateSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLocationSettingsCreateOrUpdateSamples.java @@ -13,7 +13,7 @@ */ public final class GroupQuotaLocationSettingsCreateOrUpdateSamples { /* - * x-ms-original-file: 2025-09-01/GroupQuotasEnforcement/PutGroupQuotaEnforcement.json + * x-ms-original-file: 2026-09-01-preview/GroupQuotasEnforcement/PutGroupQuotaEnforcement.json */ /** * Sample code: GroupQuotaLocationSettings_CreateOrUpdate. @@ -29,7 +29,7 @@ public static void groupQuotaLocationSettingsCreateOrUpdate(com.azure.resourcema } /* - * x-ms-original-file: 2025-09-01/GroupQuotasEnforcement/PutGroupQuotaEnforcementFailed.json + * x-ms-original-file: 2026-09-01-preview/GroupQuotasEnforcement/PutGroupQuotaEnforcementFailed.json */ /** * Sample code: GroupQuotaLocationSettings_CreateOrUpdate_Failed. diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLocationSettingsGetSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLocationSettingsGetSamples.java index 77af661c166b..86b5d3e4b1cd 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLocationSettingsGetSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLocationSettingsGetSamples.java @@ -9,7 +9,7 @@ */ public final class GroupQuotaLocationSettingsGetSamples { /* - * x-ms-original-file: 2025-09-01/GroupQuotasEnforcement/GetGroupQuotaEnforcement.json + * x-ms-original-file: 2026-09-01-preview/GroupQuotasEnforcement/GetGroupQuotaEnforcement.json */ /** * Sample code: GroupQuotasEnforcement_Get. diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLocationSettingsUpdateSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLocationSettingsUpdateSamples.java index 7a50c3c5c535..9d878beb4345 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLocationSettingsUpdateSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaLocationSettingsUpdateSamples.java @@ -13,7 +13,7 @@ */ public final class GroupQuotaLocationSettingsUpdateSamples { /* - * x-ms-original-file: 2025-09-01/GroupQuotasEnforcement/PatchGroupQuotaEnforcement.json + * x-ms-original-file: 2026-09-01-preview/GroupQuotasEnforcement/PatchGroupQuotaEnforcement.json */ /** * Sample code: GroupQuotaLocationSettings_Patch. diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionAllocationListSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionAllocationListSamples.java index 746546e55abe..9a132b4afb4d 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionAllocationListSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionAllocationListSamples.java @@ -9,7 +9,7 @@ */ public final class GroupQuotaSubscriptionAllocationListSamples { /* - * x-ms-original-file: 2025-09-01/SubscriptionQuotaAllocation/SubscriptionQuotaAllocation_List-Compute.json + * x-ms-original-file: 2026-09-01-preview/SubscriptionQuotaAllocation/SubscriptionQuotaAllocation_List-Compute.json */ /** * Sample code: SubscriptionQuotaAllocation_List_ForCompute. diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionAllocationRequestGetSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionAllocationRequestGetSamples.java index bb786adda358..50792d3164f3 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionAllocationRequestGetSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionAllocationRequestGetSamples.java @@ -10,7 +10,7 @@ public final class GroupQuotaSubscriptionAllocationRequestGetSamples { /* * x-ms-original-file: - * 2025-09-01/SubscriptionQuotaAllocationRequests/SubscriptionQuotaAllocationRequests_Get-Compute.json + * 2026-09-01-preview/SubscriptionQuotaAllocationRequests/SubscriptionQuotaAllocationRequests_Get-Compute.json */ /** * Sample code: SubscriptionQuotaAllocationRequests_Get_Request_ForCompute. diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionAllocationRequestListSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionAllocationRequestListSamples.java index 2d203c8d41ce..ab04dcf1faa7 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionAllocationRequestListSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionAllocationRequestListSamples.java @@ -10,7 +10,7 @@ public final class GroupQuotaSubscriptionAllocationRequestListSamples { /* * x-ms-original-file: - * 2025-09-01/SubscriptionQuotaAllocationRequests/SubscriptionQuotaAllocationRequests_List-Compute.json + * 2026-09-01-preview/SubscriptionQuotaAllocationRequests/SubscriptionQuotaAllocationRequests_List-Compute.json */ /** * Sample code: SubscriptionQuotaAllocation_List_Request_ForCompute. diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionAllocationRequestUpdateSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionAllocationRequestUpdateSamples.java index 4dac531ab11d..7ece5355c213 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionAllocationRequestUpdateSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionAllocationRequestUpdateSamples.java @@ -16,7 +16,7 @@ public final class GroupQuotaSubscriptionAllocationRequestUpdateSamples { /* * x-ms-original-file: - * 2025-09-01/SubscriptionQuotaAllocationRequests/PatchSubscriptionQuotaAllocationRequest-Compute.json + * 2026-09-01-preview/SubscriptionQuotaAllocationRequests/PatchSubscriptionQuotaAllocationRequest-Compute.json */ /** * Sample code: SubscriptionQuotaAllocation_Patch_Request_ForCompute. diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionRequestsGetSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionRequestsGetSamples.java index 63950529714d..049a82ecce5d 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionRequestsGetSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionRequestsGetSamples.java @@ -9,7 +9,7 @@ */ public final class GroupQuotaSubscriptionRequestsGetSamples { /* - * x-ms-original-file: 2025-09-01/SubscriptionRequests/SubscriptionRequests_Get.json + * x-ms-original-file: 2026-09-01-preview/SubscriptionRequests/SubscriptionRequests_Get.json */ /** * Sample code: GroupQuotaSubscriptionRequests_Get. diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionRequestsListSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionRequestsListSamples.java index 982d82280f07..1a67b61a8d1a 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionRequestsListSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionRequestsListSamples.java @@ -9,7 +9,7 @@ */ public final class GroupQuotaSubscriptionRequestsListSamples { /* - * x-ms-original-file: 2025-09-01/SubscriptionRequests/SubscriptionRequests_List.json + * x-ms-original-file: 2026-09-01-preview/SubscriptionRequests/SubscriptionRequests_List.json */ /** * Sample code: GroupQuotaSubscriptionRequests_List. diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsCreateOrUpdateSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsCreateOrUpdateSamples.java index 5c1c24075476..e832fd499715 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsCreateOrUpdateSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsCreateOrUpdateSamples.java @@ -9,7 +9,7 @@ */ public final class GroupQuotaSubscriptionsCreateOrUpdateSamples { /* - * x-ms-original-file: 2025-09-01/GroupQuotasSubscriptions/PutGroupQuotasSubscription.json + * x-ms-original-file: 2026-09-01-preview/GroupQuotasSubscriptions/PutGroupQuotasSubscription.json */ /** * Sample code: GroupQuotaSubscriptions_Put_Subscriptions. diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsDeleteSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsDeleteSamples.java index e29947c1fe0a..e6c1c1e27fe9 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsDeleteSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsDeleteSamples.java @@ -9,7 +9,7 @@ */ public final class GroupQuotaSubscriptionsDeleteSamples { /* - * x-ms-original-file: 2025-09-01/GroupQuotasSubscriptions/DeleteGroupQuotaSubscriptions.json + * x-ms-original-file: 2026-09-01-preview/GroupQuotasSubscriptions/DeleteGroupQuotaSubscriptions.json */ /** * Sample code: GroupQuotaSubscriptions_Delete_Subscriptions. diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsGetSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsGetSamples.java index 36fb09f235c0..ad42b53bda5e 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsGetSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsGetSamples.java @@ -9,7 +9,7 @@ */ public final class GroupQuotaSubscriptionsGetSamples { /* - * x-ms-original-file: 2025-09-01/GroupQuotasSubscriptions/GetGroupQuotaSubscriptions.json + * x-ms-original-file: 2026-09-01-preview/GroupQuotasSubscriptions/GetGroupQuotaSubscriptions.json */ /** * Sample code: GroupQuotaSubscriptions_Get_Subscriptions. diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsListSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsListSamples.java index 2ffb6b1f1e3e..4a4e35300ab6 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsListSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsListSamples.java @@ -9,7 +9,7 @@ */ public final class GroupQuotaSubscriptionsListSamples { /* - * x-ms-original-file: 2025-09-01/GroupQuotasSubscriptions/ListGroupQuotaSubscriptions.json + * x-ms-original-file: 2026-09-01-preview/GroupQuotasSubscriptions/ListGroupQuotaSubscriptions.json */ /** * Sample code: GroupQuotaSubscriptions_List_Subscriptions. diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsUpdateSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsUpdateSamples.java index de68bdf8730d..54b5d76cba6f 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsUpdateSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaSubscriptionsUpdateSamples.java @@ -9,7 +9,7 @@ */ public final class GroupQuotaSubscriptionsUpdateSamples { /* - * x-ms-original-file: 2025-09-01/GroupQuotasSubscriptions/PatchGroupQuotasSubscription.json + * x-ms-original-file: 2026-09-01-preview/GroupQuotasSubscriptions/PatchGroupQuotasSubscription.json */ /** * Sample code: GroupQuotaSubscriptions_Patch_Subscriptions. diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaUsagesListSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaUsagesListSamples.java index 6b3c31f1cd94..6ca322fd6d42 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaUsagesListSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotaUsagesListSamples.java @@ -9,7 +9,7 @@ */ public final class GroupQuotaUsagesListSamples { /* - * x-ms-original-file: 2025-09-01/GroupQuotaUsages/GetGroupQuotaUsages.json + * x-ms-original-file: 2026-09-01-preview/GroupQuotaUsages/GetGroupQuotaUsages.json */ /** * Sample code: GroupQuotasUsages_List. diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotasCreateOrUpdateSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotasCreateOrUpdateSamples.java index 9b29ed908153..8f687bc7ea35 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotasCreateOrUpdateSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotasCreateOrUpdateSamples.java @@ -12,7 +12,7 @@ */ public final class GroupQuotasCreateOrUpdateSamples { /* - * x-ms-original-file: 2025-09-01/GroupQuotas/PutGroupQuotas.json + * x-ms-original-file: 2026-09-01-preview/GroupQuotas/PutGroupQuotas.json */ /** * Sample code: GroupQuotas_Put_Request_ForCompute. diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotasDeleteSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotasDeleteSamples.java index 5ccacc416bf3..81cc6d01f3ec 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotasDeleteSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotasDeleteSamples.java @@ -9,7 +9,7 @@ */ public final class GroupQuotasDeleteSamples { /* - * x-ms-original-file: 2025-09-01/GroupQuotas/DeleteGroupQuotas.json + * x-ms-original-file: 2026-09-01-preview/GroupQuotas/DeleteGroupQuotas.json */ /** * Sample code: GroupQuotas_Delete_Request_ForCompute. diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotasGetSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotasGetSamples.java index 2d484c710c31..8bfddffa5cfa 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotasGetSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotasGetSamples.java @@ -9,7 +9,7 @@ */ public final class GroupQuotasGetSamples { /* - * x-ms-original-file: 2025-09-01/GroupQuotas/GetGroupQuotas.json + * x-ms-original-file: 2026-09-01-preview/GroupQuotas/GetGroupQuotas.json */ /** * Sample code: GroupQuotas_Get_Request_ForCompute. diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotasListSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotasListSamples.java index 76bfd11481ad..03ee4749354d 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotasListSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotasListSamples.java @@ -9,7 +9,7 @@ */ public final class GroupQuotasListSamples { /* - * x-ms-original-file: 2025-09-01/GroupQuotas/ListGroupQuotas.json + * x-ms-original-file: 2026-09-01-preview/GroupQuotas/ListGroupQuotas.json */ /** * Sample code: GroupQuotas_List_Request_ForCompute. diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotasUpdateSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotasUpdateSamples.java index ce6df11df020..4c922b611679 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotasUpdateSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/GroupQuotasUpdateSamples.java @@ -12,7 +12,7 @@ */ public final class GroupQuotasUpdateSamples { /* - * x-ms-original-file: 2025-09-01/GroupQuotas/PatchGroupQuotas.json + * x-ms-original-file: 2026-09-01-preview/GroupQuotas/PatchGroupQuotas.json */ /** * Sample code: GroupQuotas_Patch_Request_ForCompute. diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/IncomingQuotaTransfersApproveSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/IncomingQuotaTransfersApproveSamples.java new file mode 100644 index 000000000000..4da4ccf4b2be --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/IncomingQuotaTransfersApproveSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.generated; + +import com.azure.resourcemanager.quota.models.IncomingQuotaTransferApproveRequest; + +/** + * Samples for IncomingQuotaTransfers Approve. + */ +public final class IncomingQuotaTransfersApproveSamples { + /* + * x-ms-original-file: 2026-09-01-preview/IncomingQuotaTransfers/IncomingQuotaTransfers_Approve.json + */ + /** + * Sample code: IncomingQuotaTransfers_Approve. + * + * @param manager Entry point to QuotaManager. + */ + public static void incomingQuotaTransfersApprove(com.azure.resourcemanager.quota.QuotaManager manager) { + manager.incomingQuotaTransfers() + .approve("Microsoft.Compute", "eastus", "12345678-1234-1234-1234-1234567890ab", "abc123", + new IncomingQuotaTransferApproveRequest().withComment("Approved by capacity team."), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/IncomingQuotaTransfersGetSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/IncomingQuotaTransfersGetSamples.java new file mode 100644 index 000000000000..0e0dfcc4b893 --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/IncomingQuotaTransfersGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.generated; + +/** + * Samples for IncomingQuotaTransfers Get. + */ +public final class IncomingQuotaTransfersGetSamples { + /* + * x-ms-original-file: 2026-09-01-preview/IncomingQuotaTransfers/IncomingQuotaTransfers_Get.json + */ + /** + * Sample code: IncomingQuotaTransfers_Get. + * + * @param manager Entry point to QuotaManager. + */ + public static void incomingQuotaTransfersGet(com.azure.resourcemanager.quota.QuotaManager manager) { + manager.incomingQuotaTransfers() + .getWithResponse("Microsoft.Compute", "eastus", "12345678-1234-1234-1234-1234567890ab", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/IncomingQuotaTransfersListBySubscriptionSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/IncomingQuotaTransfersListBySubscriptionSamples.java new file mode 100644 index 000000000000..c44f2fb1cb64 --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/IncomingQuotaTransfersListBySubscriptionSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.generated; + +/** + * Samples for IncomingQuotaTransfers ListBySubscription. + */ +public final class IncomingQuotaTransfersListBySubscriptionSamples { + /* + * x-ms-original-file: 2026-09-01-preview/IncomingQuotaTransfers/IncomingQuotaTransfers_ListBySubscription.json + */ + /** + * Sample code: IncomingQuotaTransfers_ListBySubscription. + * + * @param manager Entry point to QuotaManager. + */ + public static void incomingQuotaTransfersListBySubscription(com.azure.resourcemanager.quota.QuotaManager manager) { + manager.incomingQuotaTransfers().listBySubscription(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/IncomingQuotaTransfersListSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/IncomingQuotaTransfersListSamples.java new file mode 100644 index 000000000000..dc20592ce25d --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/IncomingQuotaTransfersListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.generated; + +/** + * Samples for IncomingQuotaTransfers List. + */ +public final class IncomingQuotaTransfersListSamples { + /* + * x-ms-original-file: 2026-09-01-preview/IncomingQuotaTransfers/IncomingQuotaTransfers_List.json + */ + /** + * Sample code: IncomingQuotaTransfers_List. + * + * @param manager Entry point to QuotaManager. + */ + public static void incomingQuotaTransfersList(com.azure.resourcemanager.quota.QuotaManager manager) { + manager.incomingQuotaTransfers().list("Microsoft.Compute", "eastus", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/IncomingQuotaTransfersRejectSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/IncomingQuotaTransfersRejectSamples.java new file mode 100644 index 000000000000..95d059402eff --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/IncomingQuotaTransfersRejectSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.generated; + +import com.azure.resourcemanager.quota.models.IncomingQuotaTransferRejectRequest; + +/** + * Samples for IncomingQuotaTransfers Reject. + */ +public final class IncomingQuotaTransfersRejectSamples { + /* + * x-ms-original-file: 2026-09-01-preview/IncomingQuotaTransfers/IncomingQuotaTransfers_Reject.json + */ + /** + * Sample code: IncomingQuotaTransfers_Reject. + * + * @param manager Entry point to QuotaManager. + */ + public static void incomingQuotaTransfersReject(com.azure.resourcemanager.quota.QuotaManager manager) { + manager.incomingQuotaTransfers() + .rejectWithResponse("Microsoft.Compute", "eastus", "12345678-1234-1234-1234-1234567890ab", "abc123", + new IncomingQuotaTransferRejectRequest().withReason("Recipient capacity already satisfied."), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaCreateOrUpdateSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaCreateOrUpdateSamples.java index 1a34a579d9fa..9f78c6cffc7d 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaCreateOrUpdateSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaCreateOrUpdateSamples.java @@ -13,7 +13,7 @@ */ public final class QuotaCreateOrUpdateSamples { /* - * x-ms-original-file: 2025-09-01/putMachineLearningServicesQuotaRequestLowPriority.json + * x-ms-original-file: 2026-09-01-preview/putMachineLearningServicesQuotaRequestLowPriority.json */ /** * Sample code: Quotas_Request_ForMachineLearningServices_LowPriorityResource. @@ -33,7 +33,7 @@ public static void quotasRequestForMachineLearningServicesLowPriorityResource( } /* - * x-ms-original-file: 2025-09-01/putComputeOneSkuQuotaRequest.json + * x-ms-original-file: 2026-09-01-preview/putComputeOneSkuQuotaRequest.json */ /** * Sample code: Quotas_Put_Request_ForCompute. @@ -51,7 +51,7 @@ public static void quotasPutRequestForCompute(com.azure.resourcemanager.quota.Qu } /* - * x-ms-original-file: 2025-09-01/putNetworkOneSkuQuotaRequestStandardSkuPublicIpAddresses.json + * x-ms-original-file: 2026-09-01-preview/putNetworkOneSkuQuotaRequestStandardSkuPublicIpAddresses.json */ /** * Sample code: Quotas_PutRequest_ForNetwork_StandardSkuPublicIpAddressesResource. @@ -71,7 +71,7 @@ public static void quotasPutRequestForNetworkStandardSkuPublicIpAddressesResourc } /* - * x-ms-original-file: 2025-09-01/putNetworkOneSkuQuotaRequest.json + * x-ms-original-file: 2026-09-01-preview/putNetworkOneSkuQuotaRequest.json */ /** * Sample code: Quotas_PutRequest_ForNetwork. diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaGetSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaGetSamples.java index badd49978a0b..3b8acb583b8c 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaGetSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaGetSamples.java @@ -9,7 +9,7 @@ */ public final class QuotaGetSamples { /* - * x-ms-original-file: 2025-09-01/getNetworkOneSkuQuotaLimit.json + * x-ms-original-file: 2026-09-01-preview/getNetworkOneSkuQuotaLimit.json */ /** * Sample code: Quotas_UsagesRequest_ForNetwork. @@ -24,7 +24,7 @@ public static void quotasUsagesRequestForNetwork(com.azure.resourcemanager.quota } /* - * x-ms-original-file: 2025-09-01/getComputeOneSkuQuotaLimit.json + * x-ms-original-file: 2026-09-01-preview/getComputeOneSkuQuotaLimit.json */ /** * Sample code: Quotas_Get_Request_ForCompute. diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaListSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaListSamples.java index 4097df13e8df..aefb78f68d8c 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaListSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaListSamples.java @@ -9,7 +9,7 @@ */ public final class QuotaListSamples { /* - * x-ms-original-file: 2025-09-01/getMachineLearningServicesQuotaLimits.json + * x-ms-original-file: 2026-09-01-preview/getMachineLearningServicesQuotaLimits.json */ /** * Sample code: Quotas_listQuotaLimitsMachineLearningServices. @@ -25,7 +25,7 @@ public final class QuotaListSamples { } /* - * x-ms-original-file: 2025-09-01/getComputeQuotaLimits.json + * x-ms-original-file: 2026-09-01-preview/getComputeQuotaLimits.json */ /** * Sample code: Quotas_listQuotaLimitsForCompute. @@ -39,7 +39,7 @@ public static void quotasListQuotaLimitsForCompute(com.azure.resourcemanager.quo } /* - * x-ms-original-file: 2025-09-01/getNetworkQuotaLimits.json + * x-ms-original-file: 2026-09-01-preview/getNetworkQuotaLimits.json */ /** * Sample code: Quotas_listQuotaLimitsForNetwork. diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaOperationListSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaOperationListSamples.java index 65dfac564bc8..806ccb450ec3 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaOperationListSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaOperationListSamples.java @@ -9,7 +9,7 @@ */ public final class QuotaOperationListSamples { /* - * x-ms-original-file: 2025-09-01/GetOperations.json + * x-ms-original-file: 2026-09-01-preview/GetOperations.json */ /** * Sample code: GetOperations. diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaRequestStatusGetSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaRequestStatusGetSamples.java index c4cb6d0dc176..b348d185cb46 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaRequestStatusGetSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaRequestStatusGetSamples.java @@ -9,7 +9,7 @@ */ public final class QuotaRequestStatusGetSamples { /* - * x-ms-original-file: 2025-09-01/getQuotaRequestStatusFailed.json + * x-ms-original-file: 2026-09-01-preview/getQuotaRequestStatusFailed.json */ /** * Sample code: QuotaRequestFailed. @@ -24,7 +24,7 @@ public static void quotaRequestFailed(com.azure.resourcemanager.quota.QuotaManag } /* - * x-ms-original-file: 2025-09-01/getQuotaRequestStatusById.json + * x-ms-original-file: 2026-09-01-preview/getQuotaRequestStatusById.json */ /** * Sample code: QuotaRequestStatus. @@ -39,7 +39,7 @@ public static void quotaRequestStatus(com.azure.resourcemanager.quota.QuotaManag } /* - * x-ms-original-file: 2025-09-01/getQuotaRequestStatusInProgress.json + * x-ms-original-file: 2026-09-01-preview/getQuotaRequestStatusInProgress.json */ /** * Sample code: QuotaRequestInProgress. diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaRequestStatusListSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaRequestStatusListSamples.java index e87247774b0f..7290b6cdfb88 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaRequestStatusListSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaRequestStatusListSamples.java @@ -9,7 +9,7 @@ */ public final class QuotaRequestStatusListSamples { /* - * x-ms-original-file: 2025-09-01/getQuotaRequestsHistory.json + * x-ms-original-file: 2026-09-01-preview/getQuotaRequestsHistory.json */ /** * Sample code: QuotaRequestHistory. diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaTransfersCancelSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaTransfersCancelSamples.java new file mode 100644 index 000000000000..75a5ae37a52f --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaTransfersCancelSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.generated; + +import com.azure.resourcemanager.quota.models.QuotaTransferCancelRequest; + +/** + * Samples for QuotaTransfers Cancel. + */ +public final class QuotaTransfersCancelSamples { + /* + * x-ms-original-file: 2026-09-01-preview/QuotaTransfers/QuotaTransfers_Cancel.json + */ + /** + * Sample code: QuotaTransfers_Cancel. + * + * @param manager Entry point to QuotaManager. + */ + public static void quotaTransfersCancel(com.azure.resourcemanager.quota.QuotaManager manager) { + manager.quotaTransfers() + .cancelWithResponse("Microsoft.Compute", "eastus", "compute-stdDv5-uplift-101", + new QuotaTransferCancelRequest().withReason("Donor changed plans before recipient acted."), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaTransfersCreateOrUpdateSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaTransfersCreateOrUpdateSamples.java new file mode 100644 index 000000000000..bcc15fbf08f3 --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaTransfersCreateOrUpdateSamples.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.generated; + +import com.azure.resourcemanager.quota.models.QuotaTransferProperties; + +/** + * Samples for QuotaTransfers CreateOrUpdate. + */ +public final class QuotaTransfersCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-09-01-preview/QuotaTransfers/QuotaTransfers_CreateOrUpdate_AutoApprove.json + */ + /** + * Sample code: QuotaTransfers_CreateOrUpdate - autoApprove same-tenant. + * + * @param manager Entry point to QuotaManager. + */ + public static void + quotaTransfersCreateOrUpdateAutoApproveSameTenant(com.azure.resourcemanager.quota.QuotaManager manager) { + manager.quotaTransfers() + .define("compute-stdDv5-autoapprove-202") + .withExistingLocation("Microsoft.Compute", "eastus") + .withProperties(new QuotaTransferProperties().withDisplayName("Move 25 Dv5 vCPU - auto approved") + .withDestinationSubscriptionId("aaaaaaaa-bbbb-cccc-dddd-000000000002") + .withBillingAccountId("1234567890") + .withResourceName("standardDv5Family") + .withAmount(25L) + .withAutoApprove(true)) + .create(); + } + + /* + * x-ms-original-file: 2026-09-01-preview/QuotaTransfers/QuotaTransfers_CreateOrUpdate.json + */ + /** + * Sample code: QuotaTransfers_CreateOrUpdate - donor submit. + * + * @param manager Entry point to QuotaManager. + */ + public static void quotaTransfersCreateOrUpdateDonorSubmit(com.azure.resourcemanager.quota.QuotaManager manager) { + manager.quotaTransfers() + .define("compute-stdDv5-uplift-101") + .withExistingLocation("Microsoft.Compute", "eastus") + .withProperties(new QuotaTransferProperties().withDisplayName("Move 50 Dv5 vCPU to recipient") + .withComment("Backfill for new prod fleet rollout.") + .withDestinationSubscriptionId("aaaaaaaa-bbbb-cccc-dddd-000000000002") + .withBillingAccountId("1234567890") + .withResourceName("standardDv5Family") + .withAmount(50L) + .withAutoApprove(false)) + .create(); + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaTransfersDeleteSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaTransfersDeleteSamples.java new file mode 100644 index 000000000000..70429d1562cf --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaTransfersDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.generated; + +/** + * Samples for QuotaTransfers Delete. + */ +public final class QuotaTransfersDeleteSamples { + /* + * x-ms-original-file: 2026-09-01-preview/QuotaTransfers/QuotaTransfers_Delete.json + */ + /** + * Sample code: QuotaTransfers_Delete. + * + * @param manager Entry point to QuotaManager. + */ + public static void quotaTransfersDelete(com.azure.resourcemanager.quota.QuotaManager manager) { + manager.quotaTransfers() + .deleteWithResponse("Microsoft.Compute", "eastus", "compute-stdDv5-uplift-101", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaTransfersGetSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaTransfersGetSamples.java new file mode 100644 index 000000000000..3bf4c4597214 --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaTransfersGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.generated; + +/** + * Samples for QuotaTransfers Get. + */ +public final class QuotaTransfersGetSamples { + /* + * x-ms-original-file: 2026-09-01-preview/QuotaTransfers/QuotaTransfers_Get.json + */ + /** + * Sample code: QuotaTransfers_Get. + * + * @param manager Entry point to QuotaManager. + */ + public static void quotaTransfersGet(com.azure.resourcemanager.quota.QuotaManager manager) { + manager.quotaTransfers() + .getWithResponse("Microsoft.Compute", "eastus", "compute-stdDv5-uplift-101", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaTransfersListSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaTransfersListSamples.java new file mode 100644 index 000000000000..2cfe8b6d5362 --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaTransfersListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.generated; + +/** + * Samples for QuotaTransfers List. + */ +public final class QuotaTransfersListSamples { + /* + * x-ms-original-file: 2026-09-01-preview/QuotaTransfers/QuotaTransfers_List.json + */ + /** + * Sample code: QuotaTransfers_List. + * + * @param manager Entry point to QuotaManager. + */ + public static void quotaTransfersList(com.azure.resourcemanager.quota.QuotaManager manager) { + manager.quotaTransfers().list("Microsoft.Compute", "eastus", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaUpdateSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaUpdateSamples.java index 9249872ff766..8a57e39f0093 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaUpdateSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaUpdateSamples.java @@ -14,7 +14,7 @@ */ public final class QuotaUpdateSamples { /* - * x-ms-original-file: 2025-09-01/patchComputeQuotaRequest.json + * x-ms-original-file: 2026-09-01-preview/patchComputeQuotaRequest.json */ /** * Sample code: Quotas_Request_PatchForCompute. @@ -34,7 +34,7 @@ public static void quotasRequestPatchForCompute(com.azure.resourcemanager.quota. } /* - * x-ms-original-file: 2025-09-01/patchNetworkOneSkuQuotaRequest.json + * x-ms-original-file: 2026-09-01-preview/patchNetworkOneSkuQuotaRequest.json */ /** * Sample code: Quotas_Request_PatchForNetwork. diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/UsagesGetSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/UsagesGetSamples.java index f6328d66757a..fdbdb92fd1e2 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/UsagesGetSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/UsagesGetSamples.java @@ -9,7 +9,7 @@ */ public final class UsagesGetSamples { /* - * x-ms-original-file: 2025-09-01/getNetworkOneSkuUsages.json + * x-ms-original-file: 2026-09-01-preview/getNetworkOneSkuUsages.json */ /** * Sample code: Quotas_UsagesRequest_ForNetwork. @@ -24,7 +24,7 @@ public static void quotasUsagesRequestForNetwork(com.azure.resourcemanager.quota } /* - * x-ms-original-file: 2025-09-01/getComputeOneSkuUsages.json + * x-ms-original-file: 2026-09-01-preview/getComputeOneSkuUsages.json */ /** * Sample code: Quotas_UsagesRequest_ForCompute. diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/UsagesListSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/UsagesListSamples.java index c3189e4b63ee..50bf16b5ce04 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/UsagesListSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/UsagesListSamples.java @@ -9,7 +9,7 @@ */ public final class UsagesListSamples { /* - * x-ms-original-file: 2025-09-01/getComputeUsages.json + * x-ms-original-file: 2026-09-01-preview/getComputeUsages.json */ /** * Sample code: Quotas_listUsagesForCompute. @@ -23,7 +23,7 @@ public static void quotasListUsagesForCompute(com.azure.resourcemanager.quota.Qu } /* - * x-ms-original-file: 2025-09-01/getNetworkUsages.json + * x-ms-original-file: 2026-09-01-preview/getNetworkUsages.json */ /** * Sample code: Quotas_listUsagesForNetwork. @@ -37,7 +37,7 @@ public static void quotasListUsagesForNetwork(com.azure.resourcemanager.quota.Qu } /* - * x-ms-original-file: 2025-09-01/getMachineLearningServicesUsages.json + * x-ms-original-file: 2026-09-01-preview/getMachineLearningServicesUsages.json */ /** * Sample code: Quotas_listUsagesMachineLearningServices. diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/ApprovalRecordTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/ApprovalRecordTests.java new file mode 100644 index 000000000000..85ddb6a61ef6 --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/ApprovalRecordTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.quota.models.ApprovalRecord; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class ApprovalRecordTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ApprovalRecord model = BinaryData + .fromString("{\"comment\":\"jbasvmsmjqulngs\",\"actor\":\"tnb\",\"occurredAt\":\"2021-06-06T02:55:58Z\"}") + .toObject(ApprovalRecord.class); + Assertions.assertEquals("jbasvmsmjqulngs", model.comment()); + Assertions.assertEquals("tnb", model.actor()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-06T02:55:58Z"), model.occurredAt()); + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/CancellationRecordTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/CancellationRecordTests.java new file mode 100644 index 000000000000..268f01048fc8 --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/CancellationRecordTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.quota.models.CancellationRecord; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class CancellationRecordTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CancellationRecord model = BinaryData + .fromString("{\"reason\":\"zgcwrw\",\"actor\":\"lxxwrljdouskc\",\"occurredAt\":\"2021-02-01T10:32:52Z\"}") + .toObject(CancellationRecord.class); + Assertions.assertEquals("zgcwrw", model.reason()); + Assertions.assertEquals("lxxwrljdouskc", model.actor()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-01T10:32:52Z"), model.occurredAt()); + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/IncomingQuotaTransferApproveRequestTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/IncomingQuotaTransferApproveRequestTests.java new file mode 100644 index 000000000000..862028111fc1 --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/IncomingQuotaTransferApproveRequestTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.quota.models.IncomingQuotaTransferApproveRequest; +import org.junit.jupiter.api.Assertions; + +public final class IncomingQuotaTransferApproveRequestTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + IncomingQuotaTransferApproveRequest model = BinaryData.fromString("{\"comment\":\"vjsllrmvvdfw\"}") + .toObject(IncomingQuotaTransferApproveRequest.class); + Assertions.assertEquals("vjsllrmvvdfw", model.comment()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + IncomingQuotaTransferApproveRequest model + = new IncomingQuotaTransferApproveRequest().withComment("vjsllrmvvdfw"); + model = BinaryData.fromObject(model).toObject(IncomingQuotaTransferApproveRequest.class); + Assertions.assertEquals("vjsllrmvvdfw", model.comment()); + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/IncomingQuotaTransferInnerTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/IncomingQuotaTransferInnerTests.java new file mode 100644 index 000000000000..bd4896d9879f --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/IncomingQuotaTransferInnerTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.quota.fluent.models.IncomingQuotaTransferInner; + +public final class IncomingQuotaTransferInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + IncomingQuotaTransferInner model = BinaryData.fromString( + "{\"properties\":{\"provisioningState\":\"Succeeded\",\"transferStatus\":\"Failed\",\"transferId\":\"dxob\",\"transferRef\":\"dxkqpx\",\"sourceSubscriptionId\":\"ajionpimexgstxg\",\"sourceTenantId\":\"odgmaajrmvdjwz\",\"billingAccountId\":\"ovmclwhijcoejct\",\"resourceName\":\"aqsqsycbkbfk\",\"amount\":6954441473774697621,\"sourceEtag\":\"exxppofmxaxcfjp\",\"approval\":{\"comment\":\"toc\",\"actor\":\"j\",\"occurredAt\":\"2021-04-14T06:41:07Z\"},\"rejection\":{\"reason\":\"mouexhdzx\",\"actor\":\"bqe\",\"occurredAt\":\"2021-05-02T06:52:14Z\"}},\"etag\":\"xqbzvddntwnd\",\"id\":\"cbtwnpzaoqvuh\",\"name\":\"hcffcyddglmjthjq\",\"type\":\"wpyeicxmqciwqvh\"}") + .toObject(IncomingQuotaTransferInner.class); + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/IncomingQuotaTransferListResultTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/IncomingQuotaTransferListResultTests.java new file mode 100644 index 000000000000..7861db599ff5 --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/IncomingQuotaTransferListResultTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.quota.implementation.models.IncomingQuotaTransferListResult; +import org.junit.jupiter.api.Assertions; + +public final class IncomingQuotaTransferListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + IncomingQuotaTransferListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"provisioningState\":\"Succeeded\",\"transferStatus\":\"Accepted\",\"transferId\":\"bmqj\",\"transferRef\":\"bcypmi\",\"sourceSubscriptionId\":\"w\",\"sourceTenantId\":\"uvcc\",\"billingAccountId\":\"nfnbacfionlebxe\",\"resourceName\":\"gtzxdpn\",\"amount\":3640331879972668788,\"sourceEtag\":\"xrjfeallnwsub\",\"approval\":{\"comment\":\"jampmngnzscxaqw\",\"actor\":\"ochcbonqvpkvl\",\"occurredAt\":\"2020-12-31T09:27:55Z\"},\"rejection\":{\"reason\":\"ea\",\"actor\":\"eipheoflokeyy\",\"occurredAt\":\"2021-04-03T12:50:56Z\"}},\"etag\":\"jbdlwtgrhpdjpju\",\"id\":\"sxazjpq\",\"name\":\"e\",\"type\":\"ualhbxxhejj\"},{\"properties\":{\"provisioningState\":\"Canceled\",\"transferStatus\":\"Completed\",\"transferId\":\"wdslfhotwmcy\",\"transferRef\":\"wlbjnpgacftade\",\"sourceSubscriptionId\":\"nltyfsoppusuesnz\",\"sourceTenantId\":\"ej\",\"billingAccountId\":\"vorxzdmohct\",\"resourceName\":\"vudwx\",\"amount\":6410833982728127894,\"sourceEtag\":\"owgujjugwdkcglhs\",\"approval\":{\"comment\":\"jdyggdtji\",\"actor\":\"hbkuofqwey\",\"occurredAt\":\"2021-10-20T00:24:32Z\"},\"rejection\":{\"reason\":\"n\",\"actor\":\"vfyexfw\",\"occurredAt\":\"2021-07-29T04:53:55Z\"}},\"etag\":\"cibvyvdcsitynn\",\"id\":\"mdectehfiqscjey\",\"name\":\"vhezrkgqhcj\",\"type\":\"efovgmk\"},{\"properties\":{\"provisioningState\":\"Succeeded\",\"transferStatus\":\"Expired\",\"transferId\":\"xyqj\",\"transferRef\":\"cattpngjcrcczsq\",\"sourceSubscriptionId\":\"hvmdajvnysounq\",\"sourceTenantId\":\"a\",\"billingAccountId\":\"ae\",\"resourceName\":\"fhyhltrpmopjmcma\",\"amount\":3697104418323921457,\"sourceEtag\":\"hfuiuaodsfc\",\"approval\":{\"comment\":\"xodpuozmyzydagfu\",\"actor\":\"xbezyiuokktwh\",\"occurredAt\":\"2021-07-25T13:50:11Z\"},\"rejection\":{\"reason\":\"zywqsmbsu\",\"actor\":\"exim\",\"occurredAt\":\"2021-01-06T03:50:02Z\"}},\"etag\":\"ocfs\",\"id\":\"s\",\"name\":\"mddystkiiux\",\"type\":\"qyud\"}],\"nextLink\":\"rrqnbpoczvyifqrv\"}") + .toObject(IncomingQuotaTransferListResult.class); + Assertions.assertEquals("rrqnbpoczvyifqrv", model.nextLink()); + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/IncomingQuotaTransferPropertiesTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/IncomingQuotaTransferPropertiesTests.java new file mode 100644 index 000000000000..b4d56d91e501 --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/IncomingQuotaTransferPropertiesTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.quota.models.IncomingQuotaTransferProperties; + +public final class IncomingQuotaTransferPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + IncomingQuotaTransferProperties model = BinaryData.fromString( + "{\"provisioningState\":\"Canceled\",\"transferStatus\":\"Rejected\",\"transferId\":\"gdtopbobjogh\",\"transferRef\":\"w\",\"sourceSubscriptionId\":\"m\",\"sourceTenantId\":\"hrzayvvtpgvdf\",\"billingAccountId\":\"otkftutqxlngx\",\"resourceName\":\"fgugnxkrxdqmid\",\"amount\":6800420676916675082,\"sourceEtag\":\"vqdra\",\"approval\":{\"comment\":\"yb\",\"actor\":\"gehoqfbowskany\",\"occurredAt\":\"2020-12-21T07:17:40Z\"},\"rejection\":{\"reason\":\"cuiywgqyw\",\"actor\":\"ndrvynhzg\",\"occurredAt\":\"2021-05-17T00:23:41Z\"}}") + .toObject(IncomingQuotaTransferProperties.class); + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/IncomingQuotaTransferRejectRequestTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/IncomingQuotaTransferRejectRequestTests.java new file mode 100644 index 000000000000..a547df07ea14 --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/IncomingQuotaTransferRejectRequestTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.quota.models.IncomingQuotaTransferRejectRequest; +import org.junit.jupiter.api.Assertions; + +public final class IncomingQuotaTransferRejectRequestTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + IncomingQuotaTransferRejectRequest model = BinaryData.fromString("{\"reason\":\"kpnpulexxbczwtr\"}") + .toObject(IncomingQuotaTransferRejectRequest.class); + Assertions.assertEquals("kpnpulexxbczwtr", model.reason()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + IncomingQuotaTransferRejectRequest model + = new IncomingQuotaTransferRejectRequest().withReason("kpnpulexxbczwtr"); + model = BinaryData.fromObject(model).toObject(IncomingQuotaTransferRejectRequest.class); + Assertions.assertEquals("kpnpulexxbczwtr", model.reason()); + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/IncomingQuotaTransfersApproveMockTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/IncomingQuotaTransfersApproveMockTests.java new file mode 100644 index 000000000000..744700191212 --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/IncomingQuotaTransfersApproveMockTests.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.quota.QuotaManager; +import com.azure.resourcemanager.quota.models.IncomingQuotaTransfer; +import com.azure.resourcemanager.quota.models.IncomingQuotaTransferApproveRequest; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class IncomingQuotaTransfersApproveMockTests { + @Test + public void testApprove() throws Exception { + String responseStr + = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"transferStatus\":\"Completed\",\"transferId\":\"qfhwyg\",\"transferRef\":\"vdnkfxusem\",\"sourceSubscriptionId\":\"zrmuhapfcqdps\",\"sourceTenantId\":\"qvpsvuoymg\",\"billingAccountId\":\"elvezrypq\",\"resourceName\":\"feo\",\"amount\":5192491540746882951,\"sourceEtag\":\"kyhkobopg\",\"approval\":{\"comment\":\"k\",\"actor\":\"wep\",\"occurredAt\":\"2021-03-03T13:40:47Z\"},\"rejection\":{\"reason\":\"rfkbwccsnjvcdwxl\",\"actor\":\"qek\",\"occurredAt\":\"2021-11-18T15:26:35Z\"}},\"etag\":\"khtj\",\"id\":\"i\",\"name\":\"gwfqatmt\",\"type\":\"htmdvy\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + QuotaManager manager = QuotaManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + IncomingQuotaTransfer response = manager.incomingQuotaTransfers() + .approve("zqzudph", "amvdkfwynwcvtbv", "ayhmtnvyqiatkz", "pcnp", + new IncomingQuotaTransferApproveRequest().withComment("cjaesgvvs"), com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/IncomingQuotaTransfersGetWithResponseMockTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/IncomingQuotaTransfersGetWithResponseMockTests.java new file mode 100644 index 000000000000..4ed158628efa --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/IncomingQuotaTransfersGetWithResponseMockTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.quota.QuotaManager; +import com.azure.resourcemanager.quota.models.IncomingQuotaTransfer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class IncomingQuotaTransfersGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"transferStatus\":\"Pending\",\"transferId\":\"vu\",\"transferRef\":\"raehtwdwrft\",\"sourceSubscriptionId\":\"iby\",\"sourceTenantId\":\"dl\",\"billingAccountId\":\"shfwpracstwity\",\"resourceName\":\"evxccedcp\",\"amount\":2519577399124400742,\"sourceEtag\":\"dnwzxltjcvnhltiu\",\"approval\":{\"comment\":\"navvwx\",\"actor\":\"ibyqunyowxwlmdj\",\"occurredAt\":\"2021-09-01T17:47:47Z\"},\"rejection\":{\"reason\":\"g\",\"actor\":\"vfvpdbodaciz\",\"occurredAt\":\"2021-07-05T22:49:30Z\"}},\"etag\":\"lhkrribdeibqipqk\",\"id\":\"vxndz\",\"name\":\"mkrefajpjorwkq\",\"type\":\"yhgbijtjivfx\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + QuotaManager manager = QuotaManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + IncomingQuotaTransfer response = manager.incomingQuotaTransfers() + .getWithResponse("ygqukyhejh", "isxgfp", "lolp", com.azure.core.util.Context.NONE) + .getValue(); + + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/IncomingQuotaTransfersListBySubscriptionMockTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/IncomingQuotaTransfersListBySubscriptionMockTests.java new file mode 100644 index 000000000000..f07ca2b47c3f --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/IncomingQuotaTransfersListBySubscriptionMockTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.quota.QuotaManager; +import com.azure.resourcemanager.quota.models.IncomingQuotaTransfer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class IncomingQuotaTransfersListBySubscriptionMockTests { + @Test + public void testListBySubscription() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Succeeded\",\"transferStatus\":\"Accepted\",\"transferId\":\"vrmbzono\",\"transferRef\":\"xrjqcirgzpfrlazs\",\"sourceSubscriptionId\":\"nwoiind\",\"sourceTenantId\":\"wp\",\"billingAccountId\":\"lwbtlhf\",\"resourceName\":\"jcdh\",\"amount\":6540094820562857174,\"sourceEtag\":\"fbgofeljagrqmqh\",\"approval\":{\"comment\":\"riiiojnalghfkv\",\"actor\":\"vsexsowuelu\",\"occurredAt\":\"2021-11-06T19:32:24Z\"},\"rejection\":{\"reason\":\"hhxvrhmzkwpj\",\"actor\":\"wws\",\"occurredAt\":\"2021-02-08T16:54:53Z\"}},\"etag\":\"hftqsxhqxujxukn\",\"id\":\"digrjguufzdmsyqt\",\"name\":\"ihwhbotzingamvpp\",\"type\":\"o\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + QuotaManager manager = QuotaManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.incomingQuotaTransfers().listBySubscription(com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/IncomingQuotaTransfersListMockTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/IncomingQuotaTransfersListMockTests.java new file mode 100644 index 000000000000..1c101be2deed --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/IncomingQuotaTransfersListMockTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.quota.QuotaManager; +import com.azure.resourcemanager.quota.models.IncomingQuotaTransfer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class IncomingQuotaTransfersListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Canceled\",\"transferStatus\":\"Rejected\",\"transferId\":\"bzkdvn\",\"transferRef\":\"abudurgk\",\"sourceSubscriptionId\":\"mokzhjjklf\",\"sourceTenantId\":\"mouwqlgzrfzeey\",\"billingAccountId\":\"izikayuhq\",\"resourceName\":\"jbsybbqw\",\"amount\":629489002910902814,\"sourceEtag\":\"gmfpgvmp\",\"approval\":{\"comment\":\"slthaq\",\"actor\":\"x\",\"occurredAt\":\"2021-09-03T05:44:20Z\"},\"rejection\":{\"reason\":\"u\",\"actor\":\"wbdsr\",\"occurredAt\":\"2021-06-17T07:53:40Z\"}},\"etag\":\"drhneuyow\",\"id\":\"d\",\"name\":\"ytisibir\",\"type\":\"gpikpzimejza\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + QuotaManager manager = QuotaManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.incomingQuotaTransfers().list("sjabibs", "stawfsdjpvkv", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/IncomingQuotaTransfersRejectWithResponseMockTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/IncomingQuotaTransfersRejectWithResponseMockTests.java new file mode 100644 index 000000000000..b660476b9376 --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/IncomingQuotaTransfersRejectWithResponseMockTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.quota.QuotaManager; +import com.azure.resourcemanager.quota.models.IncomingQuotaTransfer; +import com.azure.resourcemanager.quota.models.IncomingQuotaTransferRejectRequest; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class IncomingQuotaTransfersRejectWithResponseMockTests { + @Test + public void testRejectWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"transferStatus\":\"Cancelled\",\"transferId\":\"pmfi\",\"transferRef\":\"fggjioolvr\",\"sourceSubscriptionId\":\"kvtkkg\",\"sourceTenantId\":\"qwjygvja\",\"billingAccountId\":\"blmhvkzuhb\",\"resourceName\":\"vyhgs\",\"amount\":9113659582785442970,\"sourceEtag\":\"qufegxuvwzfbn\",\"approval\":{\"comment\":\"ctlpdngitvgb\",\"actor\":\"hrixkwmy\",\"occurredAt\":\"2021-11-14T16:57:12Z\"},\"rejection\":{\"reason\":\"veg\",\"actor\":\"hbpnaixexccbd\",\"occurredAt\":\"2021-08-31T06:18:37Z\"}},\"etag\":\"xhcexdrrvqahq\",\"id\":\"htpwij\",\"name\":\"hyjsvfycx\",\"type\":\"bfvoowvrv\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + QuotaManager manager = QuotaManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + IncomingQuotaTransfer response = manager.incomingQuotaTransfers() + .rejectWithResponse("gikdgsz", "w", "birryuzhl", "kj", + new IncomingQuotaTransferRejectRequest().withReason("rvqqaatj"), com.azure.core.util.Context.NONE) + .getValue(); + + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotaTransferCancelRequestTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotaTransferCancelRequestTests.java new file mode 100644 index 000000000000..67f90f0f939b --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotaTransferCancelRequestTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.quota.models.QuotaTransferCancelRequest; +import org.junit.jupiter.api.Assertions; + +public final class QuotaTransferCancelRequestTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + QuotaTransferCancelRequest model + = BinaryData.fromString("{\"reason\":\"csglum\"}").toObject(QuotaTransferCancelRequest.class); + Assertions.assertEquals("csglum", model.reason()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + QuotaTransferCancelRequest model = new QuotaTransferCancelRequest().withReason("csglum"); + model = BinaryData.fromObject(model).toObject(QuotaTransferCancelRequest.class); + Assertions.assertEquals("csglum", model.reason()); + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotaTransferInnerTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotaTransferInnerTests.java new file mode 100644 index 000000000000..9f625c7fd447 --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotaTransferInnerTests.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.quota.fluent.models.QuotaTransferInner; +import com.azure.resourcemanager.quota.models.QuotaTransferProperties; +import org.junit.jupiter.api.Assertions; + +public final class QuotaTransferInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + QuotaTransferInner model = BinaryData.fromString( + "{\"properties\":{\"provisioningState\":\"Failed\",\"transferStatus\":\"Failed\",\"transferId\":\"jspodmailzyde\",\"displayName\":\"o\",\"comment\":\"yahux\",\"destinationSubscriptionId\":\"npmqnjaqwixjspro\",\"destinationTenantId\":\"cputegjvwmfdats\",\"billingAccountId\":\"mdvpjhulsu\",\"resourceName\":\"vmkjozkrwfndiodj\",\"amount\":990616165450785388,\"autoApprove\":false,\"createdAt\":\"2021-12-10T02:07:51Z\",\"expiresAt\":\"2021-06-14T18:24:45Z\",\"createdBy\":\"ryo\",\"approval\":{\"comment\":\"oacctaza\",\"actor\":\"ljlahbcryf\",\"occurredAt\":\"2021-06-19T00:38:01Z\"},\"cancellation\":{\"reason\":\"osygex\",\"actor\":\"aojakhmsbzjhcrz\",\"occurredAt\":\"2021-04-18T16:59:04Z\"}},\"etag\":\"phlxa\",\"id\":\"thqt\",\"name\":\"gqjbpfzfsin\",\"type\":\"gvfcj\"}") + .toObject(QuotaTransferInner.class); + Assertions.assertEquals("o", model.properties().displayName()); + Assertions.assertEquals("yahux", model.properties().comment()); + Assertions.assertEquals("npmqnjaqwixjspro", model.properties().destinationSubscriptionId()); + Assertions.assertEquals("mdvpjhulsu", model.properties().billingAccountId()); + Assertions.assertEquals("vmkjozkrwfndiodj", model.properties().resourceName()); + Assertions.assertEquals(990616165450785388L, model.properties().amount()); + Assertions.assertFalse(model.properties().autoApprove()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + QuotaTransferInner model + = new QuotaTransferInner().withProperties(new QuotaTransferProperties().withDisplayName("o") + .withComment("yahux") + .withDestinationSubscriptionId("npmqnjaqwixjspro") + .withBillingAccountId("mdvpjhulsu") + .withResourceName("vmkjozkrwfndiodj") + .withAmount(990616165450785388L) + .withAutoApprove(false)); + model = BinaryData.fromObject(model).toObject(QuotaTransferInner.class); + Assertions.assertEquals("o", model.properties().displayName()); + Assertions.assertEquals("yahux", model.properties().comment()); + Assertions.assertEquals("npmqnjaqwixjspro", model.properties().destinationSubscriptionId()); + Assertions.assertEquals("mdvpjhulsu", model.properties().billingAccountId()); + Assertions.assertEquals("vmkjozkrwfndiodj", model.properties().resourceName()); + Assertions.assertEquals(990616165450785388L, model.properties().amount()); + Assertions.assertFalse(model.properties().autoApprove()); + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotaTransferListResultTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotaTransferListResultTests.java new file mode 100644 index 000000000000..621eaeb15d8a --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotaTransferListResultTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.quota.implementation.models.QuotaTransferListResult; +import org.junit.jupiter.api.Assertions; + +public final class QuotaTransferListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + QuotaTransferListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"provisioningState\":\"Failed\",\"transferStatus\":\"Expired\",\"transferId\":\"kwt\",\"displayName\":\"hxbnjbiksqrg\",\"comment\":\"sainqpjwnzl\",\"destinationSubscriptionId\":\"jfm\",\"destinationTenantId\":\"eebvmgxsab\",\"billingAccountId\":\"yqduujit\",\"resourceName\":\"jczdzevndh\",\"amount\":8804397533569148627,\"autoApprove\":false,\"createdAt\":\"2021-11-13T03:37:30Z\",\"expiresAt\":\"2021-12-05T19:33:11Z\",\"createdBy\":\"bdkvwrwjf\",\"approval\":{\"comment\":\"nhutjeltmrldhugj\",\"actor\":\"zdatqxhocdg\",\"occurredAt\":\"2021-01-21T00:19:14Z\"},\"cancellation\":{\"reason\":\"gphuticndvka\",\"actor\":\"zwyiftyhxhur\",\"occurredAt\":\"2021-07-29T16:08:14Z\"}},\"etag\":\"tyxolniwpwc\",\"id\":\"jfkgiawxk\",\"name\":\"ryplwckbasyypn\",\"type\":\"dhsgcba\"},{\"properties\":{\"provisioningState\":\"Canceled\",\"transferStatus\":\"Cancelled\",\"transferId\":\"tynqgoul\",\"displayName\":\"ndlik\",\"comment\":\"qkgfgibma\",\"destinationSubscriptionId\":\"gakeqsr\",\"destinationTenantId\":\"bzqqedqytbciq\",\"billingAccountId\":\"ouf\",\"resourceName\":\"mmnkzsmodmgl\",\"amount\":6403472314236480425,\"autoApprove\":false,\"createdAt\":\"2021-09-04T08:41:08Z\",\"expiresAt\":\"2021-09-06T16:19:25Z\",\"createdBy\":\"tduqktapspwgcuer\",\"approval\":{\"comment\":\"kdosvqw\",\"actor\":\"bmdg\",\"occurredAt\":\"2021-11-07T14:00:09Z\"},\"cancellation\":{\"reason\":\"ddgmb\",\"actor\":\"bexppb\",\"occurredAt\":\"2021-04-11T05:58:57Z\"}},\"etag\":\"qrolfpf\",\"id\":\"algbquxigjyjg\",\"name\":\"jaoyfhrtx\",\"type\":\"lnerkujysvleju\"},{\"properties\":{\"provisioningState\":\"Succeeded\",\"transferStatus\":\"Expired\",\"transferId\":\"yxwjkcp\",\"displayName\":\"bnwbxgjvtbvpyssz\",\"comment\":\"rujqg\",\"destinationSubscriptionId\":\"hmuouqfprwzwbn\",\"destinationTenantId\":\"itnwuizgazxufi\",\"billingAccountId\":\"uckyf\",\"resourceName\":\"hr\",\"amount\":2960158026731988032,\"autoApprove\":true,\"createdAt\":\"2021-05-02T03:10:17Z\",\"expiresAt\":\"2021-09-09T05:52:09Z\",\"createdBy\":\"tymw\",\"approval\":{\"comment\":\"kfthwxmntei\",\"actor\":\"aop\",\"occurredAt\":\"2021-05-06T07:03:15Z\"},\"cancellation\":{\"reason\":\"jcmmxdcufufsrp\",\"actor\":\"mzidnsezcxtb\",\"occurredAt\":\"2021-03-29T14:50:19Z\"}},\"etag\":\"fycc\",\"id\":\"ewmdw\",\"name\":\"jeiachboosfl\",\"type\":\"ro\"},{\"properties\":{\"provisioningState\":\"Succeeded\",\"transferStatus\":\"Cancelled\",\"transferId\":\"hzzvypyq\",\"displayName\":\"i\",\"comment\":\"inpvswjdkirsoodq\",\"destinationSubscriptionId\":\"hc\",\"destinationTenantId\":\"nohjt\",\"billingAccountId\":\"kwh\",\"resourceName\":\"soifiyipjxsqw\",\"amount\":1314224972042297481,\"autoApprove\":true,\"createdAt\":\"2021-09-25T11:27:13Z\",\"expiresAt\":\"2021-01-10T20:57:48Z\",\"createdBy\":\"jxvsnbyxqabn\",\"approval\":{\"comment\":\"pcyshu\",\"actor\":\"zafb\",\"occurredAt\":\"2021-08-03T22:49:59Z\"},\"cancellation\":{\"reason\":\"pbtoqcjmkl\",\"actor\":\"a\",\"occurredAt\":\"2021-11-10T07:50:07Z\"}},\"etag\":\"idtqajzyu\",\"id\":\"kudjkrlkhb\",\"name\":\"hfepgzgqex\",\"type\":\"locx\"}],\"nextLink\":\"paierh\"}") + .toObject(QuotaTransferListResult.class); + Assertions.assertEquals("hxbnjbiksqrg", model.value().get(0).properties().displayName()); + Assertions.assertEquals("sainqpjwnzl", model.value().get(0).properties().comment()); + Assertions.assertEquals("jfm", model.value().get(0).properties().destinationSubscriptionId()); + Assertions.assertEquals("yqduujit", model.value().get(0).properties().billingAccountId()); + Assertions.assertEquals("jczdzevndh", model.value().get(0).properties().resourceName()); + Assertions.assertEquals(8804397533569148627L, model.value().get(0).properties().amount()); + Assertions.assertFalse(model.value().get(0).properties().autoApprove()); + Assertions.assertEquals("paierh", model.nextLink()); + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotaTransferPropertiesTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotaTransferPropertiesTests.java new file mode 100644 index 000000000000..2e786d8050a0 --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotaTransferPropertiesTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.quota.models.QuotaTransferProperties; +import org.junit.jupiter.api.Assertions; + +public final class QuotaTransferPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + QuotaTransferProperties model = BinaryData.fromString( + "{\"provisioningState\":\"Succeeded\",\"transferStatus\":\"Completed\",\"transferId\":\"j\",\"displayName\":\"felluwfzitonpe\",\"comment\":\"pjkjlxofpdv\",\"destinationSubscriptionId\":\"pfxxy\",\"destinationTenantId\":\"ninmayhuyb\",\"billingAccountId\":\"kpode\",\"resourceName\":\"ooginuvamih\",\"amount\":7828545349855824504,\"autoApprove\":true,\"createdAt\":\"2021-11-25T13:34:59Z\",\"expiresAt\":\"2021-11-26T09:10:23Z\",\"createdBy\":\"heotusiv\",\"approval\":{\"comment\":\"cciqihnhungbwjz\",\"actor\":\"nfygxgispemvtz\",\"occurredAt\":\"2021-03-05T22:34:29Z\"},\"cancellation\":{\"reason\":\"ubljofxqe\",\"actor\":\"fjaeq\",\"occurredAt\":\"2021-01-23T13:20:17Z\"}}") + .toObject(QuotaTransferProperties.class); + Assertions.assertEquals("felluwfzitonpe", model.displayName()); + Assertions.assertEquals("pjkjlxofpdv", model.comment()); + Assertions.assertEquals("pfxxy", model.destinationSubscriptionId()); + Assertions.assertEquals("kpode", model.billingAccountId()); + Assertions.assertEquals("ooginuvamih", model.resourceName()); + Assertions.assertEquals(7828545349855824504L, model.amount()); + Assertions.assertTrue(model.autoApprove()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + QuotaTransferProperties model = new QuotaTransferProperties().withDisplayName("felluwfzitonpe") + .withComment("pjkjlxofpdv") + .withDestinationSubscriptionId("pfxxy") + .withBillingAccountId("kpode") + .withResourceName("ooginuvamih") + .withAmount(7828545349855824504L) + .withAutoApprove(true); + model = BinaryData.fromObject(model).toObject(QuotaTransferProperties.class); + Assertions.assertEquals("felluwfzitonpe", model.displayName()); + Assertions.assertEquals("pjkjlxofpdv", model.comment()); + Assertions.assertEquals("pfxxy", model.destinationSubscriptionId()); + Assertions.assertEquals("kpode", model.billingAccountId()); + Assertions.assertEquals("ooginuvamih", model.resourceName()); + Assertions.assertEquals(7828545349855824504L, model.amount()); + Assertions.assertTrue(model.autoApprove()); + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotaTransfersCancelWithResponseMockTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotaTransfersCancelWithResponseMockTests.java new file mode 100644 index 000000000000..4110fa40ec74 --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotaTransfersCancelWithResponseMockTests.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.quota.QuotaManager; +import com.azure.resourcemanager.quota.models.QuotaTransfer; +import com.azure.resourcemanager.quota.models.QuotaTransferCancelRequest; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class QuotaTransfersCancelWithResponseMockTests { + @Test + public void testCancelWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"provisioningState\":\"Canceled\",\"transferStatus\":\"Failed\",\"transferId\":\"lxqtvcofudfl\",\"displayName\":\"kgjubgdknnqvsazn\",\"comment\":\"tor\",\"destinationSubscriptionId\":\"dsg\",\"destinationTenantId\":\"hmk\",\"billingAccountId\":\"c\",\"resourceName\":\"rauwjuetaebu\",\"amount\":602178268406598897,\"autoApprove\":true,\"createdAt\":\"2021-01-16T01:35:10Z\",\"expiresAt\":\"2021-09-18T15:34:48Z\",\"createdBy\":\"l\",\"approval\":{\"comment\":\"b\",\"actor\":\"q\",\"occurredAt\":\"2021-09-17T06:29:30Z\"},\"cancellation\":{\"reason\":\"ifrvtpu\",\"actor\":\"ujmqlgkfbtndoa\",\"occurredAt\":\"2021-05-03T08:21:34Z\"}},\"etag\":\"bjcntujitc\",\"id\":\"df\",\"name\":\"wwa\",\"type\":\"zkoj\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + QuotaManager manager = QuotaManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + QuotaTransfer response = manager.quotaTransfers() + .cancelWithResponse("ncwsob", "wcsdbnwdcfhucq", "pfuvglsbjjca", + new QuotaTransferCancelRequest().withReason("xbvtvudu"), com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("kgjubgdknnqvsazn", response.properties().displayName()); + Assertions.assertEquals("tor", response.properties().comment()); + Assertions.assertEquals("dsg", response.properties().destinationSubscriptionId()); + Assertions.assertEquals("c", response.properties().billingAccountId()); + Assertions.assertEquals("rauwjuetaebu", response.properties().resourceName()); + Assertions.assertEquals(602178268406598897L, response.properties().amount()); + Assertions.assertTrue(response.properties().autoApprove()); + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotaTransfersCreateOrUpdateMockTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotaTransfersCreateOrUpdateMockTests.java new file mode 100644 index 000000000000..d03874485661 --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotaTransfersCreateOrUpdateMockTests.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.quota.QuotaManager; +import com.azure.resourcemanager.quota.models.QuotaTransfer; +import com.azure.resourcemanager.quota.models.QuotaTransferProperties; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class QuotaTransfersCreateOrUpdateMockTests { + @Test + public void testCreateOrUpdate() throws Exception { + String responseStr + = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"transferStatus\":\"Completed\",\"transferId\":\"uzkopbminrfd\",\"displayName\":\"oyuhhziui\",\"comment\":\"ozbhdmsmlmzq\",\"destinationSubscriptionId\":\"oftrmaequia\",\"destinationTenantId\":\"icslfaoq\",\"billingAccountId\":\"piyylhalnswhccsp\",\"resourceName\":\"kaivwit\",\"amount\":5403952490171525009,\"autoApprove\":false,\"createdAt\":\"2021-11-24T11:26:12Z\",\"expiresAt\":\"2021-10-03T06:29:22Z\",\"createdBy\":\"luhczbw\",\"approval\":{\"comment\":\"ai\",\"actor\":\"sbrgz\",\"occurredAt\":\"2021-02-08T08:17:57Z\"},\"cancellation\":{\"reason\":\"weyp\",\"actor\":\"w\",\"occurredAt\":\"2021-02-27T06:45:47Z\"}},\"etag\":\"gicccnxqhuex\",\"id\":\"ttlstvlzywemhz\",\"name\":\"ncsdtclusiyp\",\"type\":\"sfgytguslfead\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + QuotaManager manager = QuotaManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + QuotaTransfer response = manager.quotaTransfers() + .define("ybxarzgszu") + .withExistingLocation("dcpzfoqo", "i") + .withProperties(new QuotaTransferProperties().withDisplayName("doamciodhkha") + .withComment("khnzbonlw") + .withDestinationSubscriptionId("toego") + .withBillingAccountId("kszzcmrvexztv") + .withResourceName("t") + .withAmount(4260556874996196928L) + .withAutoApprove(false)) + .create(); + + Assertions.assertEquals("oyuhhziui", response.properties().displayName()); + Assertions.assertEquals("ozbhdmsmlmzq", response.properties().comment()); + Assertions.assertEquals("oftrmaequia", response.properties().destinationSubscriptionId()); + Assertions.assertEquals("piyylhalnswhccsp", response.properties().billingAccountId()); + Assertions.assertEquals("kaivwit", response.properties().resourceName()); + Assertions.assertEquals(5403952490171525009L, response.properties().amount()); + Assertions.assertFalse(response.properties().autoApprove()); + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotaTransfersDeleteWithResponseMockTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotaTransfersDeleteWithResponseMockTests.java new file mode 100644 index 000000000000..6aec531dd273 --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotaTransfersDeleteWithResponseMockTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.quota.QuotaManager; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class QuotaTransfersDeleteWithResponseMockTests { + @Test + public void testDeleteWithResponse() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + QuotaManager manager = QuotaManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.quotaTransfers().deleteWithResponse("tdooaoj", "niodkooeb", "nuj", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotaTransfersGetWithResponseMockTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotaTransfersGetWithResponseMockTests.java new file mode 100644 index 000000000000..1f9108317c82 --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotaTransfersGetWithResponseMockTests.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.quota.QuotaManager; +import com.azure.resourcemanager.quota.models.QuotaTransfer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class QuotaTransfersGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"transferStatus\":\"Pending\",\"transferId\":\"ssofwqmzqa\",\"displayName\":\"krmnjijpxacqqud\",\"comment\":\"byxbaaabjy\",\"destinationSubscriptionId\":\"ayffim\",\"destinationTenantId\":\"rtuzqogs\",\"billingAccountId\":\"xnevfdnwn\",\"resourceName\":\"mewzsyyc\",\"amount\":4687942406282696717,\"autoApprove\":true,\"createdAt\":\"2021-09-08T21:11:14Z\",\"expiresAt\":\"2021-09-06T23:25:45Z\",\"createdBy\":\"pfrxtrthzvay\",\"approval\":{\"comment\":\"kqb\",\"actor\":\"qu\",\"occurredAt\":\"2021-08-22T14:33:21Z\"},\"cancellation\":{\"reason\":\"h\",\"actor\":\"xiilivpdtiirqt\",\"occurredAt\":\"2021-05-27T12:16:15Z\"}},\"etag\":\"axoruzfgsquy\",\"id\":\"rxxle\",\"name\":\"tramxjez\",\"type\":\"lwnwxuqlcvydyp\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + QuotaManager manager = QuotaManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + QuotaTransfer response = manager.quotaTransfers() + .getWithResponse("duhpk", "kgymareqnajxqug", "hky", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("krmnjijpxacqqud", response.properties().displayName()); + Assertions.assertEquals("byxbaaabjy", response.properties().comment()); + Assertions.assertEquals("ayffim", response.properties().destinationSubscriptionId()); + Assertions.assertEquals("xnevfdnwn", response.properties().billingAccountId()); + Assertions.assertEquals("mewzsyyc", response.properties().resourceName()); + Assertions.assertEquals(4687942406282696717L, response.properties().amount()); + Assertions.assertTrue(response.properties().autoApprove()); + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotaTransfersListMockTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotaTransfersListMockTests.java new file mode 100644 index 000000000000..0f1c0f8ca854 --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/QuotaTransfersListMockTests.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.quota.QuotaManager; +import com.azure.resourcemanager.quota.models.QuotaTransfer; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class QuotaTransfersListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Failed\",\"transferStatus\":\"Cancelled\",\"transferId\":\"tkacj\",\"displayName\":\"efkdlf\",\"comment\":\"kggkfpa\",\"destinationSubscriptionId\":\"ao\",\"destinationTenantId\":\"ulpqblylsyxkqjn\",\"billingAccountId\":\"jervtia\",\"resourceName\":\"xsdszuempsb\",\"amount\":6849457451153472340,\"autoApprove\":true,\"createdAt\":\"2021-08-25T17:09:36Z\",\"expiresAt\":\"2021-05-04T06:37:39Z\",\"createdBy\":\"qi\",\"approval\":{\"comment\":\"nvkjjxdxrbuukzcl\",\"actor\":\"wyhmlw\",\"occurredAt\":\"2021-08-10T23:19:11Z\"},\"cancellation\":{\"reason\":\"zpof\",\"actor\":\"cckwyfzqwhxxbu\",\"occurredAt\":\"2021-06-02T21:30:28Z\"}},\"etag\":\"xzfe\",\"id\":\"tpp\",\"name\":\"iolxor\",\"type\":\"altol\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + QuotaManager manager = QuotaManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.quotaTransfers().list("emmsbvdkc", "odtji", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("efkdlf", response.iterator().next().properties().displayName()); + Assertions.assertEquals("kggkfpa", response.iterator().next().properties().comment()); + Assertions.assertEquals("ao", response.iterator().next().properties().destinationSubscriptionId()); + Assertions.assertEquals("jervtia", response.iterator().next().properties().billingAccountId()); + Assertions.assertEquals("xsdszuempsb", response.iterator().next().properties().resourceName()); + Assertions.assertEquals(6849457451153472340L, response.iterator().next().properties().amount()); + Assertions.assertTrue(response.iterator().next().properties().autoApprove()); + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/RejectionRecordTests.java b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/RejectionRecordTests.java new file mode 100644 index 000000000000..ebc8fefaa6da --- /dev/null +++ b/sdk/quota/azure-resourcemanager-quota/src/test/java/com/azure/resourcemanager/quota/generated/RejectionRecordTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.quota.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.quota.models.RejectionRecord; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class RejectionRecordTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RejectionRecord model = BinaryData + .fromString("{\"reason\":\"rcgyn\",\"actor\":\"ocpecfvmmco\",\"occurredAt\":\"2021-10-28T16:04:22Z\"}") + .toObject(RejectionRecord.class); + Assertions.assertEquals("rcgyn", model.reason()); + Assertions.assertEquals("ocpecfvmmco", model.actor()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-28T16:04:22Z"), model.occurredAt()); + } +} diff --git a/sdk/quota/azure-resourcemanager-quota/tsp-location.yaml b/sdk/quota/azure-resourcemanager-quota/tsp-location.yaml index 2e6e94f8909a..f78799e281f2 100644 --- a/sdk/quota/azure-resourcemanager-quota/tsp-location.yaml +++ b/sdk/quota/azure-resourcemanager-quota/tsp-location.yaml @@ -1,4 +1,4 @@ -directory: specification/quota/Quota.Management -commit: 180b3d38b484507810c2ed2f747dd7cd11443cca +directory: specification/quota/resource-manager/Microsoft.Quota/Quota +commit: 39bf1b80fd8bc55b091192d51d67433c84930639 repo: Azure/azure-rest-api-specs additionalDirectories: diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/RecoveryServicesBackupManager.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/RecoveryServicesBackupManager.java index 54c24fb41522..4e847c413b6c 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/RecoveryServicesBackupManager.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/RecoveryServicesBackupManager.java @@ -26,11 +26,13 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.recoveryservicesbackup.fluent.RecoveryServicesBackupManagementClient; import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupEnginesImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupJobsFromCrossTenantVaultsImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupJobsImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupOperationResultsImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupOperationStatusesImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupPoliciesImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupProtectableItemsImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupProtectedItemsFromCrossTenantVaultsImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupProtectedItemsImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupProtectionContainersImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupProtectionIntentsImpl; @@ -42,6 +44,13 @@ import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupWorkloadItemsImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupsImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.BmsPrepareDataMoveOperationResultsImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.CrossTenantVaultCredentialOperationResultsImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.CrossTenantVaultCredentialOperationStatusesImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.CrossTenantVaultCredentialsImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.CrossTenantVaultMappingStatusImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.CrossTenantVaultMappingsImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.CrossTenantVaultRecoveryPointOperationsImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.CrossTenantVaultRecoveryPointsImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.DeletedProtectionContainersImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.ExportJobsOperationResultsImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.FeatureSupportsImpl; @@ -49,15 +58,20 @@ import com.azure.resourcemanager.recoveryservicesbackup.implementation.GetTieringCostOperationResultsImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.ItemLevelRecoveryConnectionsImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.JobCancellationsImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.JobDetailsFromCrossTenantVaultsImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.JobDetailsImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.JobOperationResultsImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.JobsImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.OperationFromCrossTenantVaultsImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.OperationOperationsImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.OperationsImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.PrivateEndpointConnectionsImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.PrivateEndpointsImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectableContainersImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectedItemFromCrossTenantVaultsImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectedItemOperationResultsFromCrossTenantVaultsImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectedItemOperationResultsImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectedItemOperationStatusesFromCrossTenantVaultsImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectedItemOperationStatusesImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectedItemsImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectionContainerOperationResultsImpl; @@ -72,19 +86,25 @@ import com.azure.resourcemanager.recoveryservicesbackup.implementation.RecoveryServicesBackupManagementClientBuilder; import com.azure.resourcemanager.recoveryservicesbackup.implementation.ResourceGuardProxyOperationsImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.ResourceProvidersImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.RestoresFromCrossTenantVaultsImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.RestoresImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.SecurityPINsImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.TieringCostOperationStatusImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.ValidateOperationFromCrossTenantVaultsImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.ValidateOperationResultFromCrossTenantVaultsImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.ValidateOperationResultsImpl; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.ValidateOperationStatusFromCrossTenantVaultsImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.ValidateOperationStatusesImpl; import com.azure.resourcemanager.recoveryservicesbackup.implementation.ValidateOperationsImpl; import com.azure.resourcemanager.recoveryservicesbackup.models.BackupEngines; import com.azure.resourcemanager.recoveryservicesbackup.models.BackupJobs; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupJobsFromCrossTenantVaults; import com.azure.resourcemanager.recoveryservicesbackup.models.BackupOperationResults; import com.azure.resourcemanager.recoveryservicesbackup.models.BackupOperationStatuses; import com.azure.resourcemanager.recoveryservicesbackup.models.BackupPolicies; import com.azure.resourcemanager.recoveryservicesbackup.models.BackupProtectableItems; import com.azure.resourcemanager.recoveryservicesbackup.models.BackupProtectedItems; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupProtectedItemsFromCrossTenantVaults; import com.azure.resourcemanager.recoveryservicesbackup.models.BackupProtectionContainers; import com.azure.resourcemanager.recoveryservicesbackup.models.BackupProtectionIntents; import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceEncryptionConfigs; @@ -95,6 +115,13 @@ import com.azure.resourcemanager.recoveryservicesbackup.models.BackupWorkloadItems; import com.azure.resourcemanager.recoveryservicesbackup.models.Backups; import com.azure.resourcemanager.recoveryservicesbackup.models.BmsPrepareDataMoveOperationResults; +import com.azure.resourcemanager.recoveryservicesbackup.models.CrossTenantVaultCredentialOperationResults; +import com.azure.resourcemanager.recoveryservicesbackup.models.CrossTenantVaultCredentialOperationStatuses; +import com.azure.resourcemanager.recoveryservicesbackup.models.CrossTenantVaultCredentials; +import com.azure.resourcemanager.recoveryservicesbackup.models.CrossTenantVaultMappingStatus; +import com.azure.resourcemanager.recoveryservicesbackup.models.CrossTenantVaultMappings; +import com.azure.resourcemanager.recoveryservicesbackup.models.CrossTenantVaultRecoveryPointOperations; +import com.azure.resourcemanager.recoveryservicesbackup.models.CrossTenantVaultRecoveryPoints; import com.azure.resourcemanager.recoveryservicesbackup.models.DeletedProtectionContainers; import com.azure.resourcemanager.recoveryservicesbackup.models.ExportJobsOperationResults; import com.azure.resourcemanager.recoveryservicesbackup.models.FeatureSupports; @@ -103,15 +130,20 @@ import com.azure.resourcemanager.recoveryservicesbackup.models.ItemLevelRecoveryConnections; import com.azure.resourcemanager.recoveryservicesbackup.models.JobCancellations; import com.azure.resourcemanager.recoveryservicesbackup.models.JobDetails; +import com.azure.resourcemanager.recoveryservicesbackup.models.JobDetailsFromCrossTenantVaults; import com.azure.resourcemanager.recoveryservicesbackup.models.JobOperationResults; import com.azure.resourcemanager.recoveryservicesbackup.models.Jobs; +import com.azure.resourcemanager.recoveryservicesbackup.models.OperationFromCrossTenantVaults; import com.azure.resourcemanager.recoveryservicesbackup.models.OperationOperations; import com.azure.resourcemanager.recoveryservicesbackup.models.Operations; import com.azure.resourcemanager.recoveryservicesbackup.models.PrivateEndpointConnections; import com.azure.resourcemanager.recoveryservicesbackup.models.PrivateEndpoints; import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectableContainers; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectedItemFromCrossTenantVaults; import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectedItemOperationResults; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectedItemOperationResultsFromCrossTenantVaults; import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectedItemOperationStatuses; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectedItemOperationStatusesFromCrossTenantVaults; import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectedItems; import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionContainerOperationResults; import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionContainerRefreshOperationResults; @@ -125,9 +157,13 @@ import com.azure.resourcemanager.recoveryservicesbackup.models.ResourceGuardProxyOperations; import com.azure.resourcemanager.recoveryservicesbackup.models.ResourceProviders; import com.azure.resourcemanager.recoveryservicesbackup.models.Restores; +import com.azure.resourcemanager.recoveryservicesbackup.models.RestoresFromCrossTenantVaults; import com.azure.resourcemanager.recoveryservicesbackup.models.SecurityPINs; import com.azure.resourcemanager.recoveryservicesbackup.models.TieringCostOperationStatus; +import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperationFromCrossTenantVaults; +import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperationResultFromCrossTenantVaults; import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperationResults; +import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperationStatusFromCrossTenantVaults; import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperationStatuses; import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperations; import java.time.Duration; @@ -197,6 +233,42 @@ public final class RecoveryServicesBackupManager { private BackupEngines backupEngines; + private CrossTenantVaultMappings crossTenantVaultMappings; + + private CrossTenantVaultMappingStatus crossTenantVaultMappingStatus; + + private BackupProtectedItemsFromCrossTenantVaults backupProtectedItemsFromCrossTenantVaults; + + private ProtectedItemFromCrossTenantVaults protectedItemFromCrossTenantVaults; + + private CrossTenantVaultRecoveryPoints crossTenantVaultRecoveryPoints; + + private CrossTenantVaultRecoveryPointOperations crossTenantVaultRecoveryPointOperations; + + private RestoresFromCrossTenantVaults restoresFromCrossTenantVaults; + + private ProtectedItemOperationResultsFromCrossTenantVaults protectedItemOperationResultsFromCrossTenantVaults; + + private ProtectedItemOperationStatusesFromCrossTenantVaults protectedItemOperationStatusesFromCrossTenantVaults; + + private BackupJobsFromCrossTenantVaults backupJobsFromCrossTenantVaults; + + private JobDetailsFromCrossTenantVaults jobDetailsFromCrossTenantVaults; + + private OperationFromCrossTenantVaults operationFromCrossTenantVaults; + + private ValidateOperationFromCrossTenantVaults validateOperationFromCrossTenantVaults; + + private ValidateOperationResultFromCrossTenantVaults validateOperationResultFromCrossTenantVaults; + + private ValidateOperationStatusFromCrossTenantVaults validateOperationStatusFromCrossTenantVaults; + + private CrossTenantVaultCredentials crossTenantVaultCredentials; + + private CrossTenantVaultCredentialOperationResults crossTenantVaultCredentialOperationResults; + + private CrossTenantVaultCredentialOperationStatuses crossTenantVaultCredentialOperationStatuses; + private BackupStatus backupStatus; private FeatureSupports featureSupports; @@ -800,6 +872,242 @@ public BackupEngines backupEngines() { return backupEngines; } + /** + * Gets the resource collection API of CrossTenantVaultMappings. It manages CrossTenantVaultMapping. + * + * @return Resource collection API of CrossTenantVaultMappings. + */ + public CrossTenantVaultMappings crossTenantVaultMappings() { + if (this.crossTenantVaultMappings == null) { + this.crossTenantVaultMappings + = new CrossTenantVaultMappingsImpl(clientObject.getCrossTenantVaultMappings(), this); + } + return crossTenantVaultMappings; + } + + /** + * Gets the resource collection API of CrossTenantVaultMappingStatus. + * + * @return Resource collection API of CrossTenantVaultMappingStatus. + */ + public CrossTenantVaultMappingStatus crossTenantVaultMappingStatus() { + if (this.crossTenantVaultMappingStatus == null) { + this.crossTenantVaultMappingStatus + = new CrossTenantVaultMappingStatusImpl(clientObject.getCrossTenantVaultMappingStatus(), this); + } + return crossTenantVaultMappingStatus; + } + + /** + * Gets the resource collection API of BackupProtectedItemsFromCrossTenantVaults. + * + * @return Resource collection API of BackupProtectedItemsFromCrossTenantVaults. + */ + public BackupProtectedItemsFromCrossTenantVaults backupProtectedItemsFromCrossTenantVaults() { + if (this.backupProtectedItemsFromCrossTenantVaults == null) { + this.backupProtectedItemsFromCrossTenantVaults = new BackupProtectedItemsFromCrossTenantVaultsImpl( + clientObject.getBackupProtectedItemsFromCrossTenantVaults(), this); + } + return backupProtectedItemsFromCrossTenantVaults; + } + + /** + * Gets the resource collection API of ProtectedItemFromCrossTenantVaults. + * + * @return Resource collection API of ProtectedItemFromCrossTenantVaults. + */ + public ProtectedItemFromCrossTenantVaults protectedItemFromCrossTenantVaults() { + if (this.protectedItemFromCrossTenantVaults == null) { + this.protectedItemFromCrossTenantVaults = new ProtectedItemFromCrossTenantVaultsImpl( + clientObject.getProtectedItemFromCrossTenantVaults(), this); + } + return protectedItemFromCrossTenantVaults; + } + + /** + * Gets the resource collection API of CrossTenantVaultRecoveryPoints. + * + * @return Resource collection API of CrossTenantVaultRecoveryPoints. + */ + public CrossTenantVaultRecoveryPoints crossTenantVaultRecoveryPoints() { + if (this.crossTenantVaultRecoveryPoints == null) { + this.crossTenantVaultRecoveryPoints + = new CrossTenantVaultRecoveryPointsImpl(clientObject.getCrossTenantVaultRecoveryPoints(), this); + } + return crossTenantVaultRecoveryPoints; + } + + /** + * Gets the resource collection API of CrossTenantVaultRecoveryPointOperations. + * + * @return Resource collection API of CrossTenantVaultRecoveryPointOperations. + */ + public CrossTenantVaultRecoveryPointOperations crossTenantVaultRecoveryPointOperations() { + if (this.crossTenantVaultRecoveryPointOperations == null) { + this.crossTenantVaultRecoveryPointOperations = new CrossTenantVaultRecoveryPointOperationsImpl( + clientObject.getCrossTenantVaultRecoveryPointOperations(), this); + } + return crossTenantVaultRecoveryPointOperations; + } + + /** + * Gets the resource collection API of RestoresFromCrossTenantVaults. + * + * @return Resource collection API of RestoresFromCrossTenantVaults. + */ + public RestoresFromCrossTenantVaults restoresFromCrossTenantVaults() { + if (this.restoresFromCrossTenantVaults == null) { + this.restoresFromCrossTenantVaults + = new RestoresFromCrossTenantVaultsImpl(clientObject.getRestoresFromCrossTenantVaults(), this); + } + return restoresFromCrossTenantVaults; + } + + /** + * Gets the resource collection API of ProtectedItemOperationResultsFromCrossTenantVaults. + * + * @return Resource collection API of ProtectedItemOperationResultsFromCrossTenantVaults. + */ + public ProtectedItemOperationResultsFromCrossTenantVaults protectedItemOperationResultsFromCrossTenantVaults() { + if (this.protectedItemOperationResultsFromCrossTenantVaults == null) { + this.protectedItemOperationResultsFromCrossTenantVaults + = new ProtectedItemOperationResultsFromCrossTenantVaultsImpl( + clientObject.getProtectedItemOperationResultsFromCrossTenantVaults(), this); + } + return protectedItemOperationResultsFromCrossTenantVaults; + } + + /** + * Gets the resource collection API of ProtectedItemOperationStatusesFromCrossTenantVaults. + * + * @return Resource collection API of ProtectedItemOperationStatusesFromCrossTenantVaults. + */ + public ProtectedItemOperationStatusesFromCrossTenantVaults protectedItemOperationStatusesFromCrossTenantVaults() { + if (this.protectedItemOperationStatusesFromCrossTenantVaults == null) { + this.protectedItemOperationStatusesFromCrossTenantVaults + = new ProtectedItemOperationStatusesFromCrossTenantVaultsImpl( + clientObject.getProtectedItemOperationStatusesFromCrossTenantVaults(), this); + } + return protectedItemOperationStatusesFromCrossTenantVaults; + } + + /** + * Gets the resource collection API of BackupJobsFromCrossTenantVaults. + * + * @return Resource collection API of BackupJobsFromCrossTenantVaults. + */ + public BackupJobsFromCrossTenantVaults backupJobsFromCrossTenantVaults() { + if (this.backupJobsFromCrossTenantVaults == null) { + this.backupJobsFromCrossTenantVaults + = new BackupJobsFromCrossTenantVaultsImpl(clientObject.getBackupJobsFromCrossTenantVaults(), this); + } + return backupJobsFromCrossTenantVaults; + } + + /** + * Gets the resource collection API of JobDetailsFromCrossTenantVaults. + * + * @return Resource collection API of JobDetailsFromCrossTenantVaults. + */ + public JobDetailsFromCrossTenantVaults jobDetailsFromCrossTenantVaults() { + if (this.jobDetailsFromCrossTenantVaults == null) { + this.jobDetailsFromCrossTenantVaults + = new JobDetailsFromCrossTenantVaultsImpl(clientObject.getJobDetailsFromCrossTenantVaults(), this); + } + return jobDetailsFromCrossTenantVaults; + } + + /** + * Gets the resource collection API of OperationFromCrossTenantVaults. + * + * @return Resource collection API of OperationFromCrossTenantVaults. + */ + public OperationFromCrossTenantVaults operationFromCrossTenantVaults() { + if (this.operationFromCrossTenantVaults == null) { + this.operationFromCrossTenantVaults + = new OperationFromCrossTenantVaultsImpl(clientObject.getOperationFromCrossTenantVaults(), this); + } + return operationFromCrossTenantVaults; + } + + /** + * Gets the resource collection API of ValidateOperationFromCrossTenantVaults. + * + * @return Resource collection API of ValidateOperationFromCrossTenantVaults. + */ + public ValidateOperationFromCrossTenantVaults validateOperationFromCrossTenantVaults() { + if (this.validateOperationFromCrossTenantVaults == null) { + this.validateOperationFromCrossTenantVaults = new ValidateOperationFromCrossTenantVaultsImpl( + clientObject.getValidateOperationFromCrossTenantVaults(), this); + } + return validateOperationFromCrossTenantVaults; + } + + /** + * Gets the resource collection API of ValidateOperationResultFromCrossTenantVaults. + * + * @return Resource collection API of ValidateOperationResultFromCrossTenantVaults. + */ + public ValidateOperationResultFromCrossTenantVaults validateOperationResultFromCrossTenantVaults() { + if (this.validateOperationResultFromCrossTenantVaults == null) { + this.validateOperationResultFromCrossTenantVaults = new ValidateOperationResultFromCrossTenantVaultsImpl( + clientObject.getValidateOperationResultFromCrossTenantVaults(), this); + } + return validateOperationResultFromCrossTenantVaults; + } + + /** + * Gets the resource collection API of ValidateOperationStatusFromCrossTenantVaults. + * + * @return Resource collection API of ValidateOperationStatusFromCrossTenantVaults. + */ + public ValidateOperationStatusFromCrossTenantVaults validateOperationStatusFromCrossTenantVaults() { + if (this.validateOperationStatusFromCrossTenantVaults == null) { + this.validateOperationStatusFromCrossTenantVaults = new ValidateOperationStatusFromCrossTenantVaultsImpl( + clientObject.getValidateOperationStatusFromCrossTenantVaults(), this); + } + return validateOperationStatusFromCrossTenantVaults; + } + + /** + * Gets the resource collection API of CrossTenantVaultCredentials. + * + * @return Resource collection API of CrossTenantVaultCredentials. + */ + public CrossTenantVaultCredentials crossTenantVaultCredentials() { + if (this.crossTenantVaultCredentials == null) { + this.crossTenantVaultCredentials + = new CrossTenantVaultCredentialsImpl(clientObject.getCrossTenantVaultCredentials(), this); + } + return crossTenantVaultCredentials; + } + + /** + * Gets the resource collection API of CrossTenantVaultCredentialOperationResults. + * + * @return Resource collection API of CrossTenantVaultCredentialOperationResults. + */ + public CrossTenantVaultCredentialOperationResults crossTenantVaultCredentialOperationResults() { + if (this.crossTenantVaultCredentialOperationResults == null) { + this.crossTenantVaultCredentialOperationResults = new CrossTenantVaultCredentialOperationResultsImpl( + clientObject.getCrossTenantVaultCredentialOperationResults(), this); + } + return crossTenantVaultCredentialOperationResults; + } + + /** + * Gets the resource collection API of CrossTenantVaultCredentialOperationStatuses. + * + * @return Resource collection API of CrossTenantVaultCredentialOperationStatuses. + */ + public CrossTenantVaultCredentialOperationStatuses crossTenantVaultCredentialOperationStatuses() { + if (this.crossTenantVaultCredentialOperationStatuses == null) { + this.crossTenantVaultCredentialOperationStatuses = new CrossTenantVaultCredentialOperationStatusesImpl( + clientObject.getCrossTenantVaultCredentialOperationStatuses(), this); + } + return crossTenantVaultCredentialOperationStatuses; + } + /** * Gets the resource collection API of BackupStatus. * diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupJobsFromCrossTenantVaultsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupJobsFromCrossTenantVaultsClient.java new file mode 100644 index 000000000000..c2c2f661406f --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupJobsFromCrossTenantVaultsClient.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.JobResourceInner; + +/** + * An instance of this class provides access to all the operations defined in BackupJobsFromCrossTenantVaultsClient. + */ +public interface BackupJobsFromCrossTenantVaultsClient { + /** + * Provides a pageable list of cross-tenant backup jobs. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of jobs for cross-tenant restore operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName); + + /** + * Provides a pageable list of cross-tenant backup jobs. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of jobs for cross-tenant restore operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + String filter, String skipToken, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupProtectedItemsFromCrossTenantVaultsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupProtectedItemsFromCrossTenantVaultsClient.java new file mode 100644 index 000000000000..bc05d9b038b2 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/BackupProtectedItemsFromCrossTenantVaultsClient.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectedItemResourceInner; + +/** + * An instance of this class provides access to all the operations defined in + * BackupProtectedItemsFromCrossTenantVaultsClient. + */ +public interface BackupProtectedItemsFromCrossTenantVaultsClient { + /** + * Lists the protected items from the source vault in a different tenant. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of protected items for cross-tenant restore operations as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName); + + /** + * Lists the protected items from the source vault in a different tenant. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of protected items for cross-tenant restore operations as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String filter, String skipToken, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/CrossTenantVaultCredentialOperationResultsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/CrossTenantVaultCredentialOperationResultsClient.java new file mode 100644 index 000000000000..cb7a73964a92 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/CrossTenantVaultCredentialOperationResultsClient.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; + +/** + * An instance of this class provides access to all the operations defined in + * CrossTenantVaultCredentialOperationResultsClient. + */ +public interface CrossTenantVaultCredentialOperationResultsClient { + /** + * Gets the result of an async vault credential generation operation. + * While the TEE job is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. When the job completes it returns either + * 200 OK with the generated VaultCredentialCertificateResponse body, or 204 No Content + * if there is no body to return. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param certificateName Name identifier for the certificate. + * @param operationId Operation ID returned in the Location header of the generate call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the result of an async vault credential generation operation. + * While the TEE job is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginGet(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String certificateName, String operationId); + + /** + * Gets the result of an async vault credential generation operation. + * While the TEE job is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. When the job completes it returns either + * 200 OK with the generated VaultCredentialCertificateResponse body, or 204 No Content + * if there is no body to return. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param certificateName Name identifier for the certificate. + * @param operationId Operation ID returned in the Location header of the generate call. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the result of an async vault credential generation operation. + * While the TEE job is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginGet(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String certificateName, String operationId, Context context); + + /** + * Gets the result of an async vault credential generation operation. + * While the TEE job is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. When the job completes it returns either + * 200 OK with the generated VaultCredentialCertificateResponse body, or 204 No Content + * if there is no body to return. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param certificateName Name identifier for the certificate. + * @param operationId Operation ID returned in the Location header of the generate call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void get(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, String certificateName, + String operationId); + + /** + * Gets the result of an async vault credential generation operation. + * While the TEE job is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. When the job completes it returns either + * 200 OK with the generated VaultCredentialCertificateResponse body, or 204 No Content + * if there is no body to return. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param certificateName Name identifier for the certificate. + * @param operationId Operation ID returned in the Location header of the generate call. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void get(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, String certificateName, + String operationId, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/CrossTenantVaultCredentialOperationStatusesClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/CrossTenantVaultCredentialOperationStatusesClient.java new file mode 100644 index 000000000000..db5c7242441d --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/CrossTenantVaultCredentialOperationStatusesClient.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationStatusInner; + +/** + * An instance of this class provides access to all the operations defined in + * CrossTenantVaultCredentialOperationStatusesClient. + */ +public interface CrossTenantVaultCredentialOperationStatusesClient { + /** + * Gets the status of an async vault credential generation operation. + * Returns the current status (InProgress, Completed, Failed) and any associated job details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param certificateName Name identifier for the certificate. + * @param operationId Operation ID returned in the Azure-AsyncOperation header of the generate call. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of an async vault credential generation operation. + * Returns the current status (InProgress, Completed, Failed) and any associated job details along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String certificateName, String operationId, Context context); + + /** + * Gets the status of an async vault credential generation operation. + * Returns the current status (InProgress, Completed, Failed) and any associated job details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param certificateName Name identifier for the certificate. + * @param operationId Operation ID returned in the Azure-AsyncOperation header of the generate call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of an async vault credential generation operation. + * Returns the current status (InProgress, Completed, Failed) and any associated job details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusInner get(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + String certificateName, String operationId); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/CrossTenantVaultCredentialsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/CrossTenantVaultCredentialsClient.java new file mode 100644 index 000000000000..54e7f15d1d31 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/CrossTenantVaultCredentialsClient.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.recoveryservicesbackup.models.VaultCredentialCertificateRequest; + +/** + * An instance of this class provides access to all the operations defined in CrossTenantVaultCredentialsClient. + */ +public interface CrossTenantVaultCredentialsClient { + /** + * Generates a vault credential certificate for cross-tenant restore scenarios. + * This is an asynchronous operation. BMS creates a TEE job that calls IDM's certificates + * endpoint for the source vault, generating a self-signed certificate registered with AAD. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param certificateName Name identifier for the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginGenerate(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String certificateName); + + /** + * Generates a vault credential certificate for cross-tenant restore scenarios. + * This is an asynchronous operation. BMS creates a TEE job that calls IDM's certificates + * endpoint for the source vault, generating a self-signed certificate registered with AAD. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param certificateName Name identifier for the certificate. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginGenerate(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String certificateName, VaultCredentialCertificateRequest body, + Context context); + + /** + * Generates a vault credential certificate for cross-tenant restore scenarios. + * This is an asynchronous operation. BMS creates a TEE job that calls IDM's certificates + * endpoint for the source vault, generating a self-signed certificate registered with AAD. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param certificateName Name identifier for the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void generate(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + String certificateName); + + /** + * Generates a vault credential certificate for cross-tenant restore scenarios. + * This is an asynchronous operation. BMS creates a TEE job that calls IDM's certificates + * endpoint for the source vault, generating a self-signed certificate registered with AAD. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param certificateName Name identifier for the certificate. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void generate(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + String certificateName, VaultCredentialCertificateRequest body, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/CrossTenantVaultMappingStatusClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/CrossTenantVaultMappingStatusClient.java new file mode 100644 index 000000000000..e16bad7970ba --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/CrossTenantVaultMappingStatusClient.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.CrossTenantVaultMappingStatusResponseInner; + +/** + * An instance of this class provides access to all the operations defined in CrossTenantVaultMappingStatusClient. + */ +public interface CrossTenantVaultMappingStatusClient { + /** + * Gets the mapping status of the vault for cross-tenant restore operations. + * Returns the mapping status that indicates whether the vault is properly configured for cross-tenant operations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the mapping status of the vault for cross-tenant restore operations. + * Returns the mapping status that indicates whether the vault is properly configured for cross-tenant operations + * along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkWithResponse(String resourceGroupName, String vaultName, + Context context); + + /** + * Gets the mapping status of the vault for cross-tenant restore operations. + * Returns the mapping status that indicates whether the vault is properly configured for cross-tenant operations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the mapping status of the vault for cross-tenant restore operations. + * Returns the mapping status that indicates whether the vault is properly configured for cross-tenant operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CrossTenantVaultMappingStatusResponseInner check(String resourceGroupName, String vaultName); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/CrossTenantVaultMappingsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/CrossTenantVaultMappingsClient.java new file mode 100644 index 000000000000..f167d9e4d6f1 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/CrossTenantVaultMappingsClient.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.CrossTenantVaultMappingInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.RemoveCrossTenantVaultMappingRequest; + +/** + * An instance of this class provides access to all the operations defined in CrossTenantVaultMappingsClient. + */ +public interface CrossTenantVaultMappingsClient { + /** + * Gets the cross-tenant vault mapping by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the cross-tenant vault mapping by name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, Context context); + + /** + * Gets the cross-tenant vault mapping by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the cross-tenant vault mapping by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CrossTenantVaultMappingInner get(String resourceGroupName, String vaultName, String crossTenantVaultMappingName); + + /** + * Creates or updates the cross-tenant vault mapping for cross-tenant restore operations. + * This API updates the target vault properties with source vault ID and creates catalog mapping. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param resource Request body for operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cross-tenant vault mapping resource for cross-tenant restore along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, CrossTenantVaultMappingInner resource, Context context); + + /** + * Creates or updates the cross-tenant vault mapping for cross-tenant restore operations. + * This API updates the target vault properties with source vault ID and creates catalog mapping. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param resource Request body for operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cross-tenant vault mapping resource for cross-tenant restore. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CrossTenantVaultMappingInner createOrUpdate(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, CrossTenantVaultMappingInner resource); + + /** + * Lists the cross-tenant vault mapping configurations for cross-tenant restore operations. + * Retrieves the current cross-tenant vault mapping details including source vault mappings and mapping state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CrossTenantVaultMapping list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String vaultName); + + /** + * Lists the cross-tenant vault mapping configurations for cross-tenant restore operations. + * Retrieves the current cross-tenant vault mapping details including source vault mappings and mapping state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CrossTenantVaultMapping list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String vaultName, Context context); + + /** + * Removes the cross-tenant vault mapping for cross-tenant restore operations. + * This API removes the target vault properties associated with source vault ID and deletes catalog mapping. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param body Request body for operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRemove(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, RemoveCrossTenantVaultMappingRequest body); + + /** + * Removes the cross-tenant vault mapping for cross-tenant restore operations. + * This API removes the target vault properties associated with source vault ID and deletes catalog mapping. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param body Request body for operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginRemove(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, RemoveCrossTenantVaultMappingRequest body, Context context); + + /** + * Removes the cross-tenant vault mapping for cross-tenant restore operations. + * This API removes the target vault properties associated with source vault ID and deletes catalog mapping. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param body Request body for operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void remove(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + RemoveCrossTenantVaultMappingRequest body); + + /** + * Removes the cross-tenant vault mapping for cross-tenant restore operations. + * This API removes the target vault properties associated with source vault ID and deletes catalog mapping. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param body Request body for operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void remove(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + RemoveCrossTenantVaultMappingRequest body, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/CrossTenantVaultRecoveryPointOperationsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/CrossTenantVaultRecoveryPointOperationsClient.java new file mode 100644 index 000000000000..fe5c0bd80f65 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/CrossTenantVaultRecoveryPointOperationsClient.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.RecoveryPointResourceInner; + +/** + * An instance of this class provides access to all the operations defined in + * CrossTenantVaultRecoveryPointOperationsClient. + */ +public interface CrossTenantVaultRecoveryPointOperationsClient { + /** + * Provides the information of the backed up data identified using RecoveryPointID from the source + * vault in a different tenant. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup copies along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String fabricName, String containerName, String protectedItemName, + String recoveryPointId, Context context); + + /** + * Provides the information of the backed up data identified using RecoveryPointID from the source + * vault in a different tenant. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup copies. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RecoveryPointResourceInner get(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + String fabricName, String containerName, String protectedItemName, String recoveryPointId); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/CrossTenantVaultRecoveryPointsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/CrossTenantVaultRecoveryPointsClient.java new file mode 100644 index 000000000000..e4e9497f2504 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/CrossTenantVaultRecoveryPointsClient.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.RecoveryPointResourceInner; + +/** + * An instance of this class provides access to all the operations defined in CrossTenantVaultRecoveryPointsClient. + */ +public interface CrossTenantVaultRecoveryPointsClient { + /** + * Lists recovery points from the source vault in a different tenant. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of recovery points for cross-tenant restore operations as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String fabricName, String containerName, String protectedItemName); + + /** + * Lists recovery points from the source vault in a different tenant. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of recovery points for cross-tenant restore operations as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String fabricName, String containerName, String protectedItemName, + String filter, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/JobDetailsFromCrossTenantVaultsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/JobDetailsFromCrossTenantVaultsClient.java new file mode 100644 index 000000000000..727341725c71 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/JobDetailsFromCrossTenantVaultsClient.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.JobResourceInner; + +/** + * An instance of this class provides access to all the operations defined in JobDetailsFromCrossTenantVaultsClient. + */ +public interface JobDetailsFromCrossTenantVaultsClient { + /** + * Gets extended information associated with a cross-tenant backup job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param jobName Name of the job whose details are to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return extended information associated with a cross-tenant backup job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String jobName, Context context); + + /** + * Gets extended information associated with a cross-tenant backup job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param jobName Name of the job whose details are to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return extended information associated with a cross-tenant backup job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + JobResourceInner get(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + String jobName); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/OperationFromCrossTenantVaultsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/OperationFromCrossTenantVaultsClient.java new file mode 100644 index 000000000000..fbda4a7a5257 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/OperationFromCrossTenantVaultsClient.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ValidateOperationsResponseInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperationRequestResource; + +/** + * An instance of this class provides access to all the operations defined in OperationFromCrossTenantVaultsClient. + */ +public interface OperationFromCrossTenantVaultsClient { + /** + * Validates a backup operation for cross-tenant restore scenarios. + * This API performs validation checks before executing a backup operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response validateWithResponse(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, ValidateOperationRequestResource body, Context context); + + /** + * Validates a backup operation for cross-tenant restore scenarios. + * This API performs validation checks before executing a backup operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ValidateOperationsResponseInner validate(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, ValidateOperationRequestResource body); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectedItemFromCrossTenantVaultsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectedItemFromCrossTenantVaultsClient.java new file mode 100644 index 000000000000..c4e6d1c83b6a --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectedItemFromCrossTenantVaultsClient.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectedItemResourceInner; + +/** + * An instance of this class provides access to all the operations defined in ProtectedItemFromCrossTenantVaultsClient. + */ +public interface ProtectedItemFromCrossTenantVaultsClient { + /** + * Gets the details of a protected item from a cross-tenant vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name whose details are to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a protected item from a cross-tenant vault along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String fabricName, String containerName, String protectedItemName, + Context context); + + /** + * Gets the details of a protected item from a cross-tenant vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name whose details are to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a protected item from a cross-tenant vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ProtectedItemResourceInner get(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + String fabricName, String containerName, String protectedItemName); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectedItemOperationResultsFromCrossTenantVaultsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectedItemOperationResultsFromCrossTenantVaultsClient.java new file mode 100644 index 000000000000..be3988e19a2e --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectedItemOperationResultsFromCrossTenantVaultsClient.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; + +/** + * An instance of this class provides access to all the operations defined in + * ProtectedItemOperationResultsFromCrossTenantVaultsClient. + */ +public interface ProtectedItemOperationResultsFromCrossTenantVaultsClient { + /** + * Fetches the result of any cross-tenant operation on the backup item. + * While the operation is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. When the operation completes it returns + * either 200 OK with the final ProtectedItemResource body, or 204 No Content if there + * is no body to return. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @param operationId OperationID which represents the operation whose result needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of base class for backup items. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginGet(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String fabricName, String containerName, String protectedItemName, + String operationId); + + /** + * Fetches the result of any cross-tenant operation on the backup item. + * While the operation is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. When the operation completes it returns + * either 200 OK with the final ProtectedItemResource body, or 204 No Content if there + * is no body to return. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @param operationId OperationID which represents the operation whose result needs to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of base class for backup items. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginGet(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String fabricName, String containerName, String protectedItemName, + String operationId, Context context); + + /** + * Fetches the result of any cross-tenant operation on the backup item. + * While the operation is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. When the operation completes it returns + * either 200 OK with the final ProtectedItemResource body, or 204 No Content if there + * is no body to return. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @param operationId OperationID which represents the operation whose result needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void get(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, String fabricName, + String containerName, String protectedItemName, String operationId); + + /** + * Fetches the result of any cross-tenant operation on the backup item. + * While the operation is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. When the operation completes it returns + * either 200 OK with the final ProtectedItemResource body, or 204 No Content if there + * is no body to return. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @param operationId OperationID which represents the operation whose result needs to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void get(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, String fabricName, + String containerName, String protectedItemName, String operationId, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectedItemOperationStatusesFromCrossTenantVaultsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectedItemOperationStatusesFromCrossTenantVaultsClient.java new file mode 100644 index 000000000000..7095cdffa30a --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ProtectedItemOperationStatusesFromCrossTenantVaultsClient.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationStatusInner; + +/** + * An instance of this class provides access to all the operations defined in + * ProtectedItemOperationStatusesFromCrossTenantVaultsClient. + */ +public interface ProtectedItemOperationStatusesFromCrossTenantVaultsClient { + /** + * Fetches the status of a cross-tenant operation such as triggering a restore. + * The status can be in progress, completed or failed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @param operationId OperationID represents the operation whose status needs to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String fabricName, String containerName, String protectedItemName, + String operationId, Context context); + + /** + * Fetches the status of a cross-tenant operation such as triggering a restore. + * The status can be in progress, completed or failed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @param operationId OperationID represents the operation whose status needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusInner get(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + String fabricName, String containerName, String protectedItemName, String operationId); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RecoveryServicesBackupManagementClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RecoveryServicesBackupManagementClient.java index 4fbf3fbeea52..be8061fbaa35 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RecoveryServicesBackupManagementClient.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RecoveryServicesBackupManagementClient.java @@ -235,6 +235,132 @@ public interface RecoveryServicesBackupManagementClient { */ BackupEnginesClient getBackupEngines(); + /** + * Gets the CrossTenantVaultMappingsClient object to access its operations. + * + * @return the CrossTenantVaultMappingsClient object. + */ + CrossTenantVaultMappingsClient getCrossTenantVaultMappings(); + + /** + * Gets the CrossTenantVaultMappingStatusClient object to access its operations. + * + * @return the CrossTenantVaultMappingStatusClient object. + */ + CrossTenantVaultMappingStatusClient getCrossTenantVaultMappingStatus(); + + /** + * Gets the BackupProtectedItemsFromCrossTenantVaultsClient object to access its operations. + * + * @return the BackupProtectedItemsFromCrossTenantVaultsClient object. + */ + BackupProtectedItemsFromCrossTenantVaultsClient getBackupProtectedItemsFromCrossTenantVaults(); + + /** + * Gets the ProtectedItemFromCrossTenantVaultsClient object to access its operations. + * + * @return the ProtectedItemFromCrossTenantVaultsClient object. + */ + ProtectedItemFromCrossTenantVaultsClient getProtectedItemFromCrossTenantVaults(); + + /** + * Gets the CrossTenantVaultRecoveryPointsClient object to access its operations. + * + * @return the CrossTenantVaultRecoveryPointsClient object. + */ + CrossTenantVaultRecoveryPointsClient getCrossTenantVaultRecoveryPoints(); + + /** + * Gets the CrossTenantVaultRecoveryPointOperationsClient object to access its operations. + * + * @return the CrossTenantVaultRecoveryPointOperationsClient object. + */ + CrossTenantVaultRecoveryPointOperationsClient getCrossTenantVaultRecoveryPointOperations(); + + /** + * Gets the RestoresFromCrossTenantVaultsClient object to access its operations. + * + * @return the RestoresFromCrossTenantVaultsClient object. + */ + RestoresFromCrossTenantVaultsClient getRestoresFromCrossTenantVaults(); + + /** + * Gets the ProtectedItemOperationResultsFromCrossTenantVaultsClient object to access its operations. + * + * @return the ProtectedItemOperationResultsFromCrossTenantVaultsClient object. + */ + ProtectedItemOperationResultsFromCrossTenantVaultsClient getProtectedItemOperationResultsFromCrossTenantVaults(); + + /** + * Gets the ProtectedItemOperationStatusesFromCrossTenantVaultsClient object to access its operations. + * + * @return the ProtectedItemOperationStatusesFromCrossTenantVaultsClient object. + */ + ProtectedItemOperationStatusesFromCrossTenantVaultsClient getProtectedItemOperationStatusesFromCrossTenantVaults(); + + /** + * Gets the BackupJobsFromCrossTenantVaultsClient object to access its operations. + * + * @return the BackupJobsFromCrossTenantVaultsClient object. + */ + BackupJobsFromCrossTenantVaultsClient getBackupJobsFromCrossTenantVaults(); + + /** + * Gets the JobDetailsFromCrossTenantVaultsClient object to access its operations. + * + * @return the JobDetailsFromCrossTenantVaultsClient object. + */ + JobDetailsFromCrossTenantVaultsClient getJobDetailsFromCrossTenantVaults(); + + /** + * Gets the OperationFromCrossTenantVaultsClient object to access its operations. + * + * @return the OperationFromCrossTenantVaultsClient object. + */ + OperationFromCrossTenantVaultsClient getOperationFromCrossTenantVaults(); + + /** + * Gets the ValidateOperationFromCrossTenantVaultsClient object to access its operations. + * + * @return the ValidateOperationFromCrossTenantVaultsClient object. + */ + ValidateOperationFromCrossTenantVaultsClient getValidateOperationFromCrossTenantVaults(); + + /** + * Gets the ValidateOperationResultFromCrossTenantVaultsClient object to access its operations. + * + * @return the ValidateOperationResultFromCrossTenantVaultsClient object. + */ + ValidateOperationResultFromCrossTenantVaultsClient getValidateOperationResultFromCrossTenantVaults(); + + /** + * Gets the ValidateOperationStatusFromCrossTenantVaultsClient object to access its operations. + * + * @return the ValidateOperationStatusFromCrossTenantVaultsClient object. + */ + ValidateOperationStatusFromCrossTenantVaultsClient getValidateOperationStatusFromCrossTenantVaults(); + + /** + * Gets the CrossTenantVaultCredentialsClient object to access its operations. + * + * @return the CrossTenantVaultCredentialsClient object. + */ + CrossTenantVaultCredentialsClient getCrossTenantVaultCredentials(); + + /** + * Gets the CrossTenantVaultCredentialOperationResultsClient object to access its operations. + * + * @return the CrossTenantVaultCredentialOperationResultsClient object. + */ + CrossTenantVaultCredentialOperationResultsClient getCrossTenantVaultCredentialOperationResults(); + + /** + * Gets the CrossTenantVaultCredentialOperationStatusesClient object to access its operations. + * + * @return the CrossTenantVaultCredentialOperationStatusesClient object. + */ + CrossTenantVaultCredentialOperationStatusesClient getCrossTenantVaultCredentialOperationStatuses(); + /** * Gets the BackupStatusClient object to access its operations. * diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RestoresFromCrossTenantVaultsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RestoresFromCrossTenantVaultsClient.java new file mode 100644 index 000000000000..816927419951 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/RestoresFromCrossTenantVaultsClient.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.recoveryservicesbackup.models.RestoreRequestResource; + +/** + * An instance of this class provides access to all the operations defined in RestoresFromCrossTenantVaultsClient. + */ +public interface RestoresFromCrossTenantVaultsClient { + /** + * Restores the specified backed up data from a source vault in a different tenant. This is an asynchronous + * operation. + * To know the status of this API call, use GetProtectedItemOperationResult API. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginTrigger(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String fabricName, String containerName, String protectedItemName, + String recoveryPointId, RestoreRequestResource body); + + /** + * Restores the specified backed up data from a source vault in a different tenant. This is an asynchronous + * operation. + * To know the status of this API call, use GetProtectedItemOperationResult API. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginTrigger(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String fabricName, String containerName, String protectedItemName, + String recoveryPointId, RestoreRequestResource body, Context context); + + /** + * Restores the specified backed up data from a source vault in a different tenant. This is an asynchronous + * operation. + * To know the status of this API call, use GetProtectedItemOperationResult API. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void trigger(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, String fabricName, + String containerName, String protectedItemName, String recoveryPointId, RestoreRequestResource body); + + /** + * Restores the specified backed up data from a source vault in a different tenant. This is an asynchronous + * operation. + * To know the status of this API call, use GetProtectedItemOperationResult API. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void trigger(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, String fabricName, + String containerName, String protectedItemName, String recoveryPointId, RestoreRequestResource body, + Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ValidateOperationFromCrossTenantVaultsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ValidateOperationFromCrossTenantVaultsClient.java new file mode 100644 index 000000000000..0c75b0488a44 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ValidateOperationFromCrossTenantVaultsClient.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ValidateOperationsResponseInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperationRequestResource; + +/** + * An instance of this class provides access to all the operations defined in + * ValidateOperationFromCrossTenantVaultsClient. + */ +public interface ValidateOperationFromCrossTenantVaultsClient { + /** + * Triggers a validate operation for cross-tenant restore scenarios. + * This is an asynchronous operation that performs validation checks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ValidateOperationsResponseInner> beginTrigger( + String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + ValidateOperationRequestResource body); + + /** + * Triggers a validate operation for cross-tenant restore scenarios. + * This is an asynchronous operation that performs validation checks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ValidateOperationsResponseInner> beginTrigger( + String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + ValidateOperationRequestResource body, Context context); + + /** + * Triggers a validate operation for cross-tenant restore scenarios. + * This is an asynchronous operation that performs validation checks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ValidateOperationsResponseInner trigger(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, ValidateOperationRequestResource body); + + /** + * Triggers a validate operation for cross-tenant restore scenarios. + * This is an asynchronous operation that performs validation checks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ValidateOperationsResponseInner trigger(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, ValidateOperationRequestResource body, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ValidateOperationResultFromCrossTenantVaultsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ValidateOperationResultFromCrossTenantVaultsClient.java new file mode 100644 index 000000000000..063d32694b91 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ValidateOperationResultFromCrossTenantVaultsClient.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; + +/** + * An instance of this class provides access to all the operations defined in + * ValidateOperationResultFromCrossTenantVaultsClient. + */ +public interface ValidateOperationResultFromCrossTenantVaultsClient { + /** + * Gets the result of a specific validate operation for cross-tenant restore scenarios. + * While the operation is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. When the operation completes it returns + * either 200 OK with the final ValidateOperationsResponse body, or 204 No Content if + * there is no body to return. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param operationId OperationID which represents the operation whose result needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the result of a specific validate operation for cross-tenant + * restore scenarios. + * While the operation is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginGet(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String operationId); + + /** + * Gets the result of a specific validate operation for cross-tenant restore scenarios. + * While the operation is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. When the operation completes it returns + * either 200 OK with the final ValidateOperationsResponse body, or 204 No Content if + * there is no body to return. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param operationId OperationID which represents the operation whose result needs to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the result of a specific validate operation for cross-tenant + * restore scenarios. + * While the operation is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginGet(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String operationId, Context context); + + /** + * Gets the result of a specific validate operation for cross-tenant restore scenarios. + * While the operation is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. When the operation completes it returns + * either 200 OK with the final ValidateOperationsResponse body, or 204 No Content if + * there is no body to return. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param operationId OperationID which represents the operation whose result needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void get(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, String operationId); + + /** + * Gets the result of a specific validate operation for cross-tenant restore scenarios. + * While the operation is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. When the operation completes it returns + * either 200 OK with the final ValidateOperationsResponse body, or 204 No Content if + * there is no body to return. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param operationId OperationID which represents the operation whose result needs to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void get(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, String operationId, + Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ValidateOperationStatusFromCrossTenantVaultsClient.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ValidateOperationStatusFromCrossTenantVaultsClient.java new file mode 100644 index 000000000000..47149f2c6c65 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/ValidateOperationStatusFromCrossTenantVaultsClient.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationStatusInner; + +/** + * An instance of this class provides access to all the operations defined in + * ValidateOperationStatusFromCrossTenantVaultsClient. + */ +public interface ValidateOperationStatusFromCrossTenantVaultsClient { + /** + * Gets the status of a validate operation for cross-tenant restore scenarios. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param operationId OperationID represents the operation whose status needs to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a validate operation for cross-tenant restore scenarios along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String operationId, Context context); + + /** + * Gets the status of a validate operation for cross-tenant restore scenarios. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param operationId OperationID represents the operation whose status needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a validate operation for cross-tenant restore scenarios. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusInner get(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + String operationId); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/CrossTenantVaultMappingInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/CrossTenantVaultMappingInner.java new file mode 100644 index 000000000000..e6caca20a95a --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/CrossTenantVaultMappingInner.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.recoveryservicesbackup.models.CrossTenantVaultMappingProperties; +import java.io.IOException; + +/** + * Cross-tenant vault mapping resource for cross-tenant restore. + */ +@Fluent +public final class CrossTenantVaultMappingInner extends ProxyResource { + /* + * CrossTenantVaultMapping properties + */ + private CrossTenantVaultMappingProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of CrossTenantVaultMappingInner class. + */ + public CrossTenantVaultMappingInner() { + } + + /** + * Get the properties property: CrossTenantVaultMapping properties. + * + * @return the properties value. + */ + public CrossTenantVaultMappingProperties properties() { + return this.properties; + } + + /** + * Set the properties property: CrossTenantVaultMapping properties. + * + * @param properties the properties value to set. + * @return the CrossTenantVaultMappingInner object itself. + */ + public CrossTenantVaultMappingInner withProperties(CrossTenantVaultMappingProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CrossTenantVaultMappingInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CrossTenantVaultMappingInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CrossTenantVaultMappingInner. + */ + public static CrossTenantVaultMappingInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CrossTenantVaultMappingInner deserializedCrossTenantVaultMappingInner = new CrossTenantVaultMappingInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedCrossTenantVaultMappingInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedCrossTenantVaultMappingInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedCrossTenantVaultMappingInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedCrossTenantVaultMappingInner.properties + = CrossTenantVaultMappingProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedCrossTenantVaultMappingInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCrossTenantVaultMappingInner; + }); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/CrossTenantVaultMappingStatusResponseInner.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/CrossTenantVaultMappingStatusResponseInner.java new file mode 100644 index 000000000000..4462e6f5a4cf --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/CrossTenantVaultMappingStatusResponseInner.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.recoveryservicesbackup.models.VaultMappingState; +import java.io.IOException; + +/** + * Response for CheckVaultMappingStatus API. + * Contains information about whether a source vault is mapped to a target vault. + */ +@Immutable +public final class CrossTenantVaultMappingStatusResponseInner + implements JsonSerializable { + /* + * Mapping name (if mapped). + */ + private String mappingName; + + /* + * Current state of the mapping. + */ + private VaultMappingState mappingState; + + /** + * Creates an instance of CrossTenantVaultMappingStatusResponseInner class. + */ + private CrossTenantVaultMappingStatusResponseInner() { + } + + /** + * Get the mappingName property: Mapping name (if mapped). + * + * @return the mappingName value. + */ + public String mappingName() { + return this.mappingName; + } + + /** + * Get the mappingState property: Current state of the mapping. + * + * @return the mappingState value. + */ + public VaultMappingState mappingState() { + return this.mappingState; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("mappingName", this.mappingName); + jsonWriter.writeStringField("mappingState", this.mappingState == null ? null : this.mappingState.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CrossTenantVaultMappingStatusResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CrossTenantVaultMappingStatusResponseInner if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CrossTenantVaultMappingStatusResponseInner. + */ + public static CrossTenantVaultMappingStatusResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CrossTenantVaultMappingStatusResponseInner deserializedCrossTenantVaultMappingStatusResponseInner + = new CrossTenantVaultMappingStatusResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("mappingName".equals(fieldName)) { + deserializedCrossTenantVaultMappingStatusResponseInner.mappingName = reader.getString(); + } else if ("mappingState".equals(fieldName)) { + deserializedCrossTenantVaultMappingStatusResponseInner.mappingState + = VaultMappingState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCrossTenantVaultMappingStatusResponseInner; + }); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupJobsFromCrossTenantVaultsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupJobsFromCrossTenantVaultsClientImpl.java new file mode 100644 index 000000000000..a302e33cbf88 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupJobsFromCrossTenantVaultsClientImpl.java @@ -0,0 +1,320 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupJobsFromCrossTenantVaultsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.JobResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.models.CrossTenantJobResourceList; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in BackupJobsFromCrossTenantVaultsClient. + */ +public final class BackupJobsFromCrossTenantVaultsClientImpl implements BackupJobsFromCrossTenantVaultsClient { + /** + * The proxy service used to perform REST calls. + */ + private final BackupJobsFromCrossTenantVaultsService service; + + /** + * The service client containing this operation class. + */ + private final RecoveryServicesBackupManagementClientImpl client; + + /** + * Initializes an instance of BackupJobsFromCrossTenantVaultsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BackupJobsFromCrossTenantVaultsClientImpl(RecoveryServicesBackupManagementClientImpl client) { + this.service = RestProxy.create(BackupJobsFromCrossTenantVaultsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupManagementClientBackupJobsFromCrossTenantVaults + * to be used by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RecoveryServicesBackupManagementClientBackupJobsFromCrossTenantVaults") + public interface BackupJobsFromCrossTenantVaultsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupCrossTenantVaultMappings/{crossTenantVaultMappingName}/backupJobs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @PathParam("crossTenantVaultMappingName") String crossTenantVaultMappingName, + @QueryParam("$filter") String filter, @QueryParam("$skipToken") String skipToken, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupCrossTenantVaultMappings/{crossTenantVaultMappingName}/backupJobs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @PathParam("crossTenantVaultMappingName") String crossTenantVaultMappingName, + @QueryParam("$filter") String filter, @QueryParam("$skipToken") String skipToken, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Provides a pageable list of cross-tenant backup jobs. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of jobs for cross-tenant restore operations along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String filter, String skipToken) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vaultName, crossTenantVaultMappingName, filter, + skipToken, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Provides a pageable list of cross-tenant backup jobs. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of jobs for cross-tenant restore operations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String filter, String skipToken) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, vaultName, crossTenantVaultMappingName, filter, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Provides a pageable list of cross-tenant backup jobs. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of jobs for cross-tenant restore operations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName) { + final String filter = null; + final String skipToken = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, vaultName, crossTenantVaultMappingName, filter, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Provides a pageable list of cross-tenant backup jobs. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of jobs for cross-tenant restore operations along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String filter, String skipToken) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, vaultName, crossTenantVaultMappingName, filter, skipToken, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Provides a pageable list of cross-tenant backup jobs. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of jobs for cross-tenant restore operations along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String filter, String skipToken, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, vaultName, crossTenantVaultMappingName, filter, skipToken, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Provides a pageable list of cross-tenant backup jobs. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of jobs for cross-tenant restore operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName) { + final String filter = null; + final String skipToken = null; + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, vaultName, crossTenantVaultMappingName, filter, skipToken), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Provides a pageable list of cross-tenant backup jobs. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of jobs for cross-tenant restore operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String filter, String skipToken, Context context) { + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, vaultName, crossTenantVaultMappingName, filter, skipToken, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of jobs for cross-tenant restore operations along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of jobs for cross-tenant restore operations along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of jobs for cross-tenant restore operations along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupJobsFromCrossTenantVaultsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupJobsFromCrossTenantVaultsImpl.java new file mode 100644 index 000000000000..db1bbbda8913 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupJobsFromCrossTenantVaultsImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupJobsFromCrossTenantVaultsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.JobResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupJobsFromCrossTenantVaults; +import com.azure.resourcemanager.recoveryservicesbackup.models.JobResource; + +public final class BackupJobsFromCrossTenantVaultsImpl implements BackupJobsFromCrossTenantVaults { + private static final ClientLogger LOGGER = new ClientLogger(BackupJobsFromCrossTenantVaultsImpl.class); + + private final BackupJobsFromCrossTenantVaultsClient innerClient; + + private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; + + public BackupJobsFromCrossTenantVaultsImpl(BackupJobsFromCrossTenantVaultsClient innerClient, + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, vaultName, crossTenantVaultMappingName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new JobResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String filter, String skipToken, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, vaultName, crossTenantVaultMappingName, filter, skipToken, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new JobResourceImpl(inner1, this.manager())); + } + + private BackupJobsFromCrossTenantVaultsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectedItemsFromCrossTenantVaultsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectedItemsFromCrossTenantVaultsClientImpl.java new file mode 100644 index 000000000000..e3cde6e2117f --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectedItemsFromCrossTenantVaultsClientImpl.java @@ -0,0 +1,325 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupProtectedItemsFromCrossTenantVaultsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectedItemResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.models.CrossTenantProtectedItemResourceList; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * BackupProtectedItemsFromCrossTenantVaultsClient. + */ +public final class BackupProtectedItemsFromCrossTenantVaultsClientImpl + implements BackupProtectedItemsFromCrossTenantVaultsClient { + /** + * The proxy service used to perform REST calls. + */ + private final BackupProtectedItemsFromCrossTenantVaultsService service; + + /** + * The service client containing this operation class. + */ + private final RecoveryServicesBackupManagementClientImpl client; + + /** + * Initializes an instance of BackupProtectedItemsFromCrossTenantVaultsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BackupProtectedItemsFromCrossTenantVaultsClientImpl(RecoveryServicesBackupManagementClientImpl client) { + this.service = RestProxy.create(BackupProtectedItemsFromCrossTenantVaultsService.class, + client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for + * RecoveryServicesBackupManagementClientBackupProtectedItemsFromCrossTenantVaults to be used by the proxy service + * to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RecoveryServicesBackupManagementClientBackupProtectedItemsFromCrossTenantVaults") + public interface BackupProtectedItemsFromCrossTenantVaultsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupCrossTenantVaultMappings/{crossTenantVaultMappingName}/backupProtectedItems") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @PathParam("crossTenantVaultMappingName") String crossTenantVaultMappingName, + @QueryParam("$filter") String filter, @QueryParam("$skipToken") String skipToken, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupCrossTenantVaultMappings/{crossTenantVaultMappingName}/backupProtectedItems") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @PathParam("crossTenantVaultMappingName") String crossTenantVaultMappingName, + @QueryParam("$filter") String filter, @QueryParam("$skipToken") String skipToken, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Lists the protected items from the source vault in a different tenant. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of protected items for cross-tenant restore operations along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String vaultName, String crossTenantVaultMappingName, String filter, String skipToken) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vaultName, crossTenantVaultMappingName, filter, + skipToken, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the protected items from the source vault in a different tenant. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of protected items for cross-tenant restore operations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String filter, String skipToken) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, vaultName, crossTenantVaultMappingName, filter, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the protected items from the source vault in a different tenant. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of protected items for cross-tenant restore operations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName) { + final String filter = null; + final String skipToken = null; + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, vaultName, crossTenantVaultMappingName, filter, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the protected items from the source vault in a different tenant. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of protected items for cross-tenant restore operations along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String filter, String skipToken) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, vaultName, crossTenantVaultMappingName, filter, skipToken, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists the protected items from the source vault in a different tenant. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of protected items for cross-tenant restore operations along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String filter, String skipToken, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, vaultName, crossTenantVaultMappingName, filter, skipToken, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists the protected items from the source vault in a different tenant. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of protected items for cross-tenant restore operations as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName) { + final String filter = null; + final String skipToken = null; + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, vaultName, crossTenantVaultMappingName, filter, skipToken), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Lists the protected items from the source vault in a different tenant. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of protected items for cross-tenant restore operations as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String filter, String skipToken, Context context) { + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, vaultName, crossTenantVaultMappingName, filter, skipToken, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of protected items for cross-tenant restore operations along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of protected items for cross-tenant restore operations along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of protected items for cross-tenant restore operations along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectedItemsFromCrossTenantVaultsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectedItemsFromCrossTenantVaultsImpl.java new file mode 100644 index 000000000000..c80afb48e185 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/BackupProtectedItemsFromCrossTenantVaultsImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupProtectedItemsFromCrossTenantVaultsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectedItemResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupProtectedItemsFromCrossTenantVaults; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectedItemResource; + +public final class BackupProtectedItemsFromCrossTenantVaultsImpl implements BackupProtectedItemsFromCrossTenantVaults { + private static final ClientLogger LOGGER = new ClientLogger(BackupProtectedItemsFromCrossTenantVaultsImpl.class); + + private final BackupProtectedItemsFromCrossTenantVaultsClient innerClient; + + private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; + + public BackupProtectedItemsFromCrossTenantVaultsImpl(BackupProtectedItemsFromCrossTenantVaultsClient innerClient, + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, vaultName, crossTenantVaultMappingName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ProtectedItemResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String filter, String skipToken, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, vaultName, crossTenantVaultMappingName, filter, skipToken, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ProtectedItemResourceImpl(inner1, this.manager())); + } + + private BackupProtectedItemsFromCrossTenantVaultsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossTenantVaultCredentialOperationResultsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossTenantVaultCredentialOperationResultsClientImpl.java new file mode 100644 index 000000000000..b0a08dd36d87 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossTenantVaultCredentialOperationResultsClientImpl.java @@ -0,0 +1,333 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.CrossTenantVaultCredentialOperationResultsClient; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * CrossTenantVaultCredentialOperationResultsClient. + */ +public final class CrossTenantVaultCredentialOperationResultsClientImpl + implements CrossTenantVaultCredentialOperationResultsClient { + /** + * The proxy service used to perform REST calls. + */ + private final CrossTenantVaultCredentialOperationResultsService service; + + /** + * The service client containing this operation class. + */ + private final RecoveryServicesBackupManagementClientImpl client; + + /** + * Initializes an instance of CrossTenantVaultCredentialOperationResultsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CrossTenantVaultCredentialOperationResultsClientImpl(RecoveryServicesBackupManagementClientImpl client) { + this.service = RestProxy.create(CrossTenantVaultCredentialOperationResultsService.class, + client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for + * RecoveryServicesBackupManagementClientCrossTenantVaultCredentialOperationResults to be used by the proxy service + * to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RecoveryServicesBackupManagementClientCrossTenantVaultCredentialOperationResults") + public interface CrossTenantVaultCredentialOperationResultsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupCrossTenantVaultMappings/{crossTenantVaultMappingName}/vaultCredentials/{certificateName}/operationResults/{operationId}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @PathParam("crossTenantVaultMappingName") String crossTenantVaultMappingName, + @PathParam("certificateName") String certificateName, @PathParam("operationId") String operationId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupCrossTenantVaultMappings/{crossTenantVaultMappingName}/vaultCredentials/{certificateName}/operationResults/{operationId}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @PathParam("crossTenantVaultMappingName") String crossTenantVaultMappingName, + @PathParam("certificateName") String certificateName, @PathParam("operationId") String operationId, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets the result of an async vault credential generation operation. + * While the TEE job is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. When the job completes it returns either + * 200 OK with the generated VaultCredentialCertificateResponse body, or 204 No Content + * if there is no body to return. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param certificateName Name identifier for the certificate. + * @param operationId Operation ID returned in the Location header of the generate call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of an async vault credential generation operation. + * While the TEE job is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getWithResponseAsync(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String certificateName, String operationId) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vaultName, crossTenantVaultMappingName, + certificateName, operationId, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the result of an async vault credential generation operation. + * While the TEE job is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. When the job completes it returns either + * 200 OK with the generated VaultCredentialCertificateResponse body, or 204 No Content + * if there is no body to return. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param certificateName Name identifier for the certificate. + * @param operationId Operation ID returned in the Location header of the generate call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of an async vault credential generation operation. + * While the TEE job is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response getWithResponse(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String certificateName, String operationId) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, vaultName, crossTenantVaultMappingName, certificateName, operationId, accept, + Context.NONE); + } + + /** + * Gets the result of an async vault credential generation operation. + * While the TEE job is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. When the job completes it returns either + * 200 OK with the generated VaultCredentialCertificateResponse body, or 204 No Content + * if there is no body to return. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param certificateName Name identifier for the certificate. + * @param operationId Operation ID returned in the Location header of the generate call. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of an async vault credential generation operation. + * While the TEE job is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response getWithResponse(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String certificateName, String operationId, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, vaultName, crossTenantVaultMappingName, certificateName, operationId, accept, context); + } + + /** + * Gets the result of an async vault credential generation operation. + * While the TEE job is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. When the job completes it returns either + * 200 OK with the generated VaultCredentialCertificateResponse body, or 204 No Content + * if there is no body to return. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param certificateName Name identifier for the certificate. + * @param operationId Operation ID returned in the Location header of the generate call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the result of an async vault credential generation operation. + * While the TEE job is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginGetAsync(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String certificateName, String operationId) { + Mono>> mono = getWithResponseAsync(resourceGroupName, vaultName, + crossTenantVaultMappingName, certificateName, operationId); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Gets the result of an async vault credential generation operation. + * While the TEE job is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. When the job completes it returns either + * 200 OK with the generated VaultCredentialCertificateResponse body, or 204 No Content + * if there is no body to return. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param certificateName Name identifier for the certificate. + * @param operationId Operation ID returned in the Location header of the generate call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the result of an async vault credential generation operation. + * While the TEE job is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginGet(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String certificateName, String operationId) { + Response response + = getWithResponse(resourceGroupName, vaultName, crossTenantVaultMappingName, certificateName, operationId); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Gets the result of an async vault credential generation operation. + * While the TEE job is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. When the job completes it returns either + * 200 OK with the generated VaultCredentialCertificateResponse body, or 204 No Content + * if there is no body to return. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param certificateName Name identifier for the certificate. + * @param operationId Operation ID returned in the Location header of the generate call. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the result of an async vault credential generation operation. + * While the TEE job is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginGet(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String certificateName, String operationId, Context context) { + Response response = getWithResponse(resourceGroupName, vaultName, crossTenantVaultMappingName, + certificateName, operationId, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Gets the result of an async vault credential generation operation. + * While the TEE job is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. When the job completes it returns either + * 200 OK with the generated VaultCredentialCertificateResponse body, or 204 No Content + * if there is no body to return. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param certificateName Name identifier for the certificate. + * @param operationId Operation ID returned in the Location header of the generate call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of an async vault credential generation operation. + * While the TEE job is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + String certificateName, String operationId) { + return beginGetAsync(resourceGroupName, vaultName, crossTenantVaultMappingName, certificateName, operationId) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Gets the result of an async vault credential generation operation. + * While the TEE job is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. When the job completes it returns either + * 200 OK with the generated VaultCredentialCertificateResponse body, or 204 No Content + * if there is no body to return. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param certificateName Name identifier for the certificate. + * @param operationId Operation ID returned in the Location header of the generate call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void get(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + String certificateName, String operationId) { + beginGet(resourceGroupName, vaultName, crossTenantVaultMappingName, certificateName, operationId) + .getFinalResult(); + } + + /** + * Gets the result of an async vault credential generation operation. + * While the TEE job is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. When the job completes it returns either + * 200 OK with the generated VaultCredentialCertificateResponse body, or 204 No Content + * if there is no body to return. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param certificateName Name identifier for the certificate. + * @param operationId Operation ID returned in the Location header of the generate call. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void get(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + String certificateName, String operationId, Context context) { + beginGet(resourceGroupName, vaultName, crossTenantVaultMappingName, certificateName, operationId, context) + .getFinalResult(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossTenantVaultCredentialOperationResultsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossTenantVaultCredentialOperationResultsImpl.java new file mode 100644 index 000000000000..384b2f375fb4 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossTenantVaultCredentialOperationResultsImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.CrossTenantVaultCredentialOperationResultsClient; +import com.azure.resourcemanager.recoveryservicesbackup.models.CrossTenantVaultCredentialOperationResults; + +public final class CrossTenantVaultCredentialOperationResultsImpl + implements CrossTenantVaultCredentialOperationResults { + private static final ClientLogger LOGGER = new ClientLogger(CrossTenantVaultCredentialOperationResultsImpl.class); + + private final CrossTenantVaultCredentialOperationResultsClient innerClient; + + private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; + + public CrossTenantVaultCredentialOperationResultsImpl(CrossTenantVaultCredentialOperationResultsClient innerClient, + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void get(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + String certificateName, String operationId) { + this.serviceClient() + .get(resourceGroupName, vaultName, crossTenantVaultMappingName, certificateName, operationId); + } + + public void get(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + String certificateName, String operationId, Context context) { + this.serviceClient() + .get(resourceGroupName, vaultName, crossTenantVaultMappingName, certificateName, operationId, context); + } + + private CrossTenantVaultCredentialOperationResultsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossTenantVaultCredentialOperationStatusesClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossTenantVaultCredentialOperationStatusesClientImpl.java new file mode 100644 index 000000000000..04087878678b --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossTenantVaultCredentialOperationStatusesClientImpl.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.CrossTenantVaultCredentialOperationStatusesClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationStatusInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * CrossTenantVaultCredentialOperationStatusesClient. + */ +public final class CrossTenantVaultCredentialOperationStatusesClientImpl + implements CrossTenantVaultCredentialOperationStatusesClient { + /** + * The proxy service used to perform REST calls. + */ + private final CrossTenantVaultCredentialOperationStatusesService service; + + /** + * The service client containing this operation class. + */ + private final RecoveryServicesBackupManagementClientImpl client; + + /** + * Initializes an instance of CrossTenantVaultCredentialOperationStatusesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CrossTenantVaultCredentialOperationStatusesClientImpl(RecoveryServicesBackupManagementClientImpl client) { + this.service = RestProxy.create(CrossTenantVaultCredentialOperationStatusesService.class, + client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for + * RecoveryServicesBackupManagementClientCrossTenantVaultCredentialOperationStatuses to be used by the proxy service + * to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RecoveryServicesBackupManagementClientCrossTenantVaultCredentialOperationStatuses") + public interface CrossTenantVaultCredentialOperationStatusesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupCrossTenantVaultMappings/{crossTenantVaultMappingName}/vaultCredentials/{certificateName}/operationStatus/{operationId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @PathParam("crossTenantVaultMappingName") String crossTenantVaultMappingName, + @PathParam("certificateName") String certificateName, @PathParam("operationId") String operationId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupCrossTenantVaultMappings/{crossTenantVaultMappingName}/vaultCredentials/{certificateName}/operationStatus/{operationId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @PathParam("crossTenantVaultMappingName") String crossTenantVaultMappingName, + @PathParam("certificateName") String certificateName, @PathParam("operationId") String operationId, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets the status of an async vault credential generation operation. + * Returns the current status (InProgress, Completed, Failed) and any associated job details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param certificateName Name identifier for the certificate. + * @param operationId Operation ID returned in the Azure-AsyncOperation header of the generate call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of an async vault credential generation operation. + * Returns the current status (InProgress, Completed, Failed) and any associated job details along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String certificateName, String operationId) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vaultName, crossTenantVaultMappingName, + certificateName, operationId, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the status of an async vault credential generation operation. + * Returns the current status (InProgress, Completed, Failed) and any associated job details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param certificateName Name identifier for the certificate. + * @param operationId Operation ID returned in the Azure-AsyncOperation header of the generate call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of an async vault credential generation operation. + * Returns the current status (InProgress, Completed, Failed) and any associated job details on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String certificateName, String operationId) { + return getWithResponseAsync(resourceGroupName, vaultName, crossTenantVaultMappingName, certificateName, + operationId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the status of an async vault credential generation operation. + * Returns the current status (InProgress, Completed, Failed) and any associated job details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param certificateName Name identifier for the certificate. + * @param operationId Operation ID returned in the Azure-AsyncOperation header of the generate call. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of an async vault credential generation operation. + * Returns the current status (InProgress, Completed, Failed) and any associated job details along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String certificateName, String operationId, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, vaultName, crossTenantVaultMappingName, certificateName, operationId, accept, context); + } + + /** + * Gets the status of an async vault credential generation operation. + * Returns the current status (InProgress, Completed, Failed) and any associated job details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param certificateName Name identifier for the certificate. + * @param operationId Operation ID returned in the Azure-AsyncOperation header of the generate call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of an async vault credential generation operation. + * Returns the current status (InProgress, Completed, Failed) and any associated job details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusInner get(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + String certificateName, String operationId) { + return getWithResponse(resourceGroupName, vaultName, crossTenantVaultMappingName, certificateName, operationId, + Context.NONE).getValue(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossTenantVaultCredentialOperationStatusesImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossTenantVaultCredentialOperationStatusesImpl.java new file mode 100644 index 000000000000..4787eb8fbefe --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossTenantVaultCredentialOperationStatusesImpl.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.CrossTenantVaultCredentialOperationStatusesClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationStatusInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.CrossTenantVaultCredentialOperationStatuses; +import com.azure.resourcemanager.recoveryservicesbackup.models.OperationStatus; + +public final class CrossTenantVaultCredentialOperationStatusesImpl + implements CrossTenantVaultCredentialOperationStatuses { + private static final ClientLogger LOGGER = new ClientLogger(CrossTenantVaultCredentialOperationStatusesImpl.class); + + private final CrossTenantVaultCredentialOperationStatusesClient innerClient; + + private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; + + public CrossTenantVaultCredentialOperationStatusesImpl( + CrossTenantVaultCredentialOperationStatusesClient innerClient, + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String certificateName, String operationId, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, vaultName, crossTenantVaultMappingName, certificateName, operationId, + context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new OperationStatusImpl(inner.getValue(), this.manager())); + } + + public OperationStatus get(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + String certificateName, String operationId) { + OperationStatusInner inner = this.serviceClient() + .get(resourceGroupName, vaultName, crossTenantVaultMappingName, certificateName, operationId); + if (inner != null) { + return new OperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + private CrossTenantVaultCredentialOperationStatusesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossTenantVaultCredentialsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossTenantVaultCredentialsClientImpl.java new file mode 100644 index 000000000000..b163ecd8f8e5 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossTenantVaultCredentialsClientImpl.java @@ -0,0 +1,369 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.CrossTenantVaultCredentialsClient; +import com.azure.resourcemanager.recoveryservicesbackup.models.VaultCredentialCertificateRequest; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in CrossTenantVaultCredentialsClient. + */ +public final class CrossTenantVaultCredentialsClientImpl implements CrossTenantVaultCredentialsClient { + /** + * The proxy service used to perform REST calls. + */ + private final CrossTenantVaultCredentialsService service; + + /** + * The service client containing this operation class. + */ + private final RecoveryServicesBackupManagementClientImpl client; + + /** + * Initializes an instance of CrossTenantVaultCredentialsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CrossTenantVaultCredentialsClientImpl(RecoveryServicesBackupManagementClientImpl client) { + this.service = RestProxy.create(CrossTenantVaultCredentialsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupManagementClientCrossTenantVaultCredentials to + * be used by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RecoveryServicesBackupManagementClientCrossTenantVaultCredentials") + public interface CrossTenantVaultCredentialsService { + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupCrossTenantVaultMappings/{crossTenantVaultMappingName}/vaultCredentials/{certificateName}/generate") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> generate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @PathParam("crossTenantVaultMappingName") String crossTenantVaultMappingName, + @PathParam("certificateName") String certificateName, + @BodyParam("application/json") VaultCredentialCertificateRequest body, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupCrossTenantVaultMappings/{crossTenantVaultMappingName}/vaultCredentials/{certificateName}/generate") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response generateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @PathParam("crossTenantVaultMappingName") String crossTenantVaultMappingName, + @PathParam("certificateName") String certificateName, + @BodyParam("application/json") VaultCredentialCertificateRequest body, Context context); + } + + /** + * Generates a vault credential certificate for cross-tenant restore scenarios. + * This is an asynchronous operation. BMS creates a TEE job that calls IDM's certificates + * endpoint for the source vault, generating a self-signed certificate registered with AAD. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param certificateName Name identifier for the certificate. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> generateWithResponseAsync(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String certificateName, VaultCredentialCertificateRequest body) { + return FluxUtil + .withContext(context -> service.generate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vaultName, crossTenantVaultMappingName, + certificateName, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Generates a vault credential certificate for cross-tenant restore scenarios. + * This is an asynchronous operation. BMS creates a TEE job that calls IDM's certificates + * endpoint for the source vault, generating a self-signed certificate registered with AAD. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param certificateName Name identifier for the certificate. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response generateWithResponse(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String certificateName, VaultCredentialCertificateRequest body) { + return service.generateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vaultName, crossTenantVaultMappingName, certificateName, + body, Context.NONE); + } + + /** + * Generates a vault credential certificate for cross-tenant restore scenarios. + * This is an asynchronous operation. BMS creates a TEE job that calls IDM's certificates + * endpoint for the source vault, generating a self-signed certificate registered with AAD. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param certificateName Name identifier for the certificate. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response generateWithResponse(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String certificateName, VaultCredentialCertificateRequest body, + Context context) { + return service.generateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vaultName, crossTenantVaultMappingName, certificateName, + body, context); + } + + /** + * Generates a vault credential certificate for cross-tenant restore scenarios. + * This is an asynchronous operation. BMS creates a TEE job that calls IDM's certificates + * endpoint for the source vault, generating a self-signed certificate registered with AAD. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param certificateName Name identifier for the certificate. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginGenerateAsync(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String certificateName, VaultCredentialCertificateRequest body) { + Mono>> mono = generateWithResponseAsync(resourceGroupName, vaultName, + crossTenantVaultMappingName, certificateName, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Generates a vault credential certificate for cross-tenant restore scenarios. + * This is an asynchronous operation. BMS creates a TEE job that calls IDM's certificates + * endpoint for the source vault, generating a self-signed certificate registered with AAD. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param certificateName Name identifier for the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginGenerateAsync(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String certificateName) { + final VaultCredentialCertificateRequest body = null; + Mono>> mono = generateWithResponseAsync(resourceGroupName, vaultName, + crossTenantVaultMappingName, certificateName, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Generates a vault credential certificate for cross-tenant restore scenarios. + * This is an asynchronous operation. BMS creates a TEE job that calls IDM's certificates + * endpoint for the source vault, generating a self-signed certificate registered with AAD. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param certificateName Name identifier for the certificate. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginGenerate(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String certificateName, VaultCredentialCertificateRequest body) { + Response response + = generateWithResponse(resourceGroupName, vaultName, crossTenantVaultMappingName, certificateName, body); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Generates a vault credential certificate for cross-tenant restore scenarios. + * This is an asynchronous operation. BMS creates a TEE job that calls IDM's certificates + * endpoint for the source vault, generating a self-signed certificate registered with AAD. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param certificateName Name identifier for the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginGenerate(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String certificateName) { + final VaultCredentialCertificateRequest body = null; + Response response + = generateWithResponse(resourceGroupName, vaultName, crossTenantVaultMappingName, certificateName, body); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Generates a vault credential certificate for cross-tenant restore scenarios. + * This is an asynchronous operation. BMS creates a TEE job that calls IDM's certificates + * endpoint for the source vault, generating a self-signed certificate registered with AAD. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param certificateName Name identifier for the certificate. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginGenerate(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String certificateName, VaultCredentialCertificateRequest body, + Context context) { + Response response = generateWithResponse(resourceGroupName, vaultName, crossTenantVaultMappingName, + certificateName, body, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Generates a vault credential certificate for cross-tenant restore scenarios. + * This is an asynchronous operation. BMS creates a TEE job that calls IDM's certificates + * endpoint for the source vault, generating a self-signed certificate registered with AAD. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param certificateName Name identifier for the certificate. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono generateAsync(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + String certificateName, VaultCredentialCertificateRequest body) { + return beginGenerateAsync(resourceGroupName, vaultName, crossTenantVaultMappingName, certificateName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Generates a vault credential certificate for cross-tenant restore scenarios. + * This is an asynchronous operation. BMS creates a TEE job that calls IDM's certificates + * endpoint for the source vault, generating a self-signed certificate registered with AAD. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param certificateName Name identifier for the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono generateAsync(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + String certificateName) { + final VaultCredentialCertificateRequest body = null; + return beginGenerateAsync(resourceGroupName, vaultName, crossTenantVaultMappingName, certificateName, body) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Generates a vault credential certificate for cross-tenant restore scenarios. + * This is an asynchronous operation. BMS creates a TEE job that calls IDM's certificates + * endpoint for the source vault, generating a self-signed certificate registered with AAD. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param certificateName Name identifier for the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void generate(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + String certificateName) { + final VaultCredentialCertificateRequest body = null; + beginGenerate(resourceGroupName, vaultName, crossTenantVaultMappingName, certificateName, body) + .getFinalResult(); + } + + /** + * Generates a vault credential certificate for cross-tenant restore scenarios. + * This is an asynchronous operation. BMS creates a TEE job that calls IDM's certificates + * endpoint for the source vault, generating a self-signed certificate registered with AAD. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param certificateName Name identifier for the certificate. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void generate(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + String certificateName, VaultCredentialCertificateRequest body, Context context) { + beginGenerate(resourceGroupName, vaultName, crossTenantVaultMappingName, certificateName, body, context) + .getFinalResult(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossTenantVaultCredentialsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossTenantVaultCredentialsImpl.java new file mode 100644 index 000000000000..038426995ea5 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossTenantVaultCredentialsImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.CrossTenantVaultCredentialsClient; +import com.azure.resourcemanager.recoveryservicesbackup.models.CrossTenantVaultCredentials; +import com.azure.resourcemanager.recoveryservicesbackup.models.VaultCredentialCertificateRequest; + +public final class CrossTenantVaultCredentialsImpl implements CrossTenantVaultCredentials { + private static final ClientLogger LOGGER = new ClientLogger(CrossTenantVaultCredentialsImpl.class); + + private final CrossTenantVaultCredentialsClient innerClient; + + private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; + + public CrossTenantVaultCredentialsImpl(CrossTenantVaultCredentialsClient innerClient, + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void generate(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + String certificateName) { + this.serviceClient().generate(resourceGroupName, vaultName, crossTenantVaultMappingName, certificateName); + } + + public void generate(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + String certificateName, VaultCredentialCertificateRequest body, Context context) { + this.serviceClient() + .generate(resourceGroupName, vaultName, crossTenantVaultMappingName, certificateName, body, context); + } + + private CrossTenantVaultCredentialsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossTenantVaultMappingImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossTenantVaultMappingImpl.java new file mode 100644 index 000000000000..3c94677f64d2 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossTenantVaultMappingImpl.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.CrossTenantVaultMappingInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.CrossTenantVaultMapping; +import com.azure.resourcemanager.recoveryservicesbackup.models.CrossTenantVaultMappingProperties; +import com.azure.resourcemanager.recoveryservicesbackup.models.RemoveCrossTenantVaultMappingRequest; + +public final class CrossTenantVaultMappingImpl + implements CrossTenantVaultMapping, CrossTenantVaultMapping.Definition, CrossTenantVaultMapping.Update { + private CrossTenantVaultMappingInner innerObject; + + private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public CrossTenantVaultMappingProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public CrossTenantVaultMappingInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String vaultName; + + private String crossTenantVaultMappingName; + + public CrossTenantVaultMappingImpl withExistingVault(String resourceGroupName, String vaultName) { + this.resourceGroupName = resourceGroupName; + this.vaultName = vaultName; + return this; + } + + public CrossTenantVaultMapping create() { + this.innerObject = serviceManager.serviceClient() + .getCrossTenantVaultMappings() + .createOrUpdateWithResponse(resourceGroupName, vaultName, crossTenantVaultMappingName, this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public CrossTenantVaultMapping create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getCrossTenantVaultMappings() + .createOrUpdateWithResponse(resourceGroupName, vaultName, crossTenantVaultMappingName, this.innerModel(), + context) + .getValue(); + return this; + } + + CrossTenantVaultMappingImpl(String name, + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { + this.innerObject = new CrossTenantVaultMappingInner(); + this.serviceManager = serviceManager; + this.crossTenantVaultMappingName = name; + } + + public CrossTenantVaultMappingImpl update() { + return this; + } + + public CrossTenantVaultMapping apply() { + this.innerObject = serviceManager.serviceClient() + .getCrossTenantVaultMappings() + .createOrUpdateWithResponse(resourceGroupName, vaultName, crossTenantVaultMappingName, this.innerModel(), + Context.NONE) + .getValue(); + return this; + } + + public CrossTenantVaultMapping apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getCrossTenantVaultMappings() + .createOrUpdateWithResponse(resourceGroupName, vaultName, crossTenantVaultMappingName, this.innerModel(), + context) + .getValue(); + return this; + } + + CrossTenantVaultMappingImpl(CrossTenantVaultMappingInner innerObject, + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.vaultName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "vaults"); + this.crossTenantVaultMappingName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "backupCrossTenantVaultMappings"); + } + + public CrossTenantVaultMapping refresh() { + this.innerObject = serviceManager.serviceClient() + .getCrossTenantVaultMappings() + .getWithResponse(resourceGroupName, vaultName, crossTenantVaultMappingName, Context.NONE) + .getValue(); + return this; + } + + public CrossTenantVaultMapping refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getCrossTenantVaultMappings() + .getWithResponse(resourceGroupName, vaultName, crossTenantVaultMappingName, context) + .getValue(); + return this; + } + + public void remove(RemoveCrossTenantVaultMappingRequest body) { + serviceManager.crossTenantVaultMappings() + .remove(resourceGroupName, vaultName, crossTenantVaultMappingName, body); + } + + public void remove(RemoveCrossTenantVaultMappingRequest body, Context context) { + serviceManager.crossTenantVaultMappings() + .remove(resourceGroupName, vaultName, crossTenantVaultMappingName, body, context); + } + + public CrossTenantVaultMappingImpl withProperties(CrossTenantVaultMappingProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossTenantVaultMappingStatusClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossTenantVaultMappingStatusClientImpl.java new file mode 100644 index 000000000000..fe3a97fccd9a --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossTenantVaultMappingStatusClientImpl.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.CrossTenantVaultMappingStatusClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.CrossTenantVaultMappingStatusResponseInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in CrossTenantVaultMappingStatusClient. + */ +public final class CrossTenantVaultMappingStatusClientImpl implements CrossTenantVaultMappingStatusClient { + /** + * The proxy service used to perform REST calls. + */ + private final CrossTenantVaultMappingStatusService service; + + /** + * The service client containing this operation class. + */ + private final RecoveryServicesBackupManagementClientImpl client; + + /** + * Initializes an instance of CrossTenantVaultMappingStatusClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CrossTenantVaultMappingStatusClientImpl(RecoveryServicesBackupManagementClientImpl client) { + this.service = RestProxy.create(CrossTenantVaultMappingStatusService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupManagementClientCrossTenantVaultMappingStatus + * to be used by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RecoveryServicesBackupManagementClientCrossTenantVaultMappingStatus") + public interface CrossTenantVaultMappingStatusService { + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupCrossTenantVaultMappingStatus") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> check(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupCrossTenantVaultMappingStatus") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response checkSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets the mapping status of the vault for cross-tenant restore operations. + * Returns the mapping status that indicates whether the vault is properly configured for cross-tenant operations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the mapping status of the vault for cross-tenant restore operations. + * Returns the mapping status that indicates whether the vault is properly configured for cross-tenant operations + * along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkWithResponseAsync(String resourceGroupName, + String vaultName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.check(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vaultName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the mapping status of the vault for cross-tenant restore operations. + * Returns the mapping status that indicates whether the vault is properly configured for cross-tenant operations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the mapping status of the vault for cross-tenant restore operations. + * Returns the mapping status that indicates whether the vault is properly configured for cross-tenant operations on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkAsync(String resourceGroupName, String vaultName) { + return checkWithResponseAsync(resourceGroupName, vaultName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the mapping status of the vault for cross-tenant restore operations. + * Returns the mapping status that indicates whether the vault is properly configured for cross-tenant operations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the mapping status of the vault for cross-tenant restore operations. + * Returns the mapping status that indicates whether the vault is properly configured for cross-tenant operations + * along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkWithResponse(String resourceGroupName, + String vaultName, Context context) { + final String accept = "application/json"; + return service.checkSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vaultName, accept, context); + } + + /** + * Gets the mapping status of the vault for cross-tenant restore operations. + * Returns the mapping status that indicates whether the vault is properly configured for cross-tenant operations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the mapping status of the vault for cross-tenant restore operations. + * Returns the mapping status that indicates whether the vault is properly configured for cross-tenant operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CrossTenantVaultMappingStatusResponseInner check(String resourceGroupName, String vaultName) { + return checkWithResponse(resourceGroupName, vaultName, Context.NONE).getValue(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossTenantVaultMappingStatusImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossTenantVaultMappingStatusImpl.java new file mode 100644 index 000000000000..d11d985d90e7 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossTenantVaultMappingStatusImpl.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.CrossTenantVaultMappingStatusClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.CrossTenantVaultMappingStatusResponseInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.CrossTenantVaultMappingStatus; +import com.azure.resourcemanager.recoveryservicesbackup.models.CrossTenantVaultMappingStatusResponse; + +public final class CrossTenantVaultMappingStatusImpl implements CrossTenantVaultMappingStatus { + private static final ClientLogger LOGGER = new ClientLogger(CrossTenantVaultMappingStatusImpl.class); + + private final CrossTenantVaultMappingStatusClient innerClient; + + private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; + + public CrossTenantVaultMappingStatusImpl(CrossTenantVaultMappingStatusClient innerClient, + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response checkWithResponse(String resourceGroupName, String vaultName, + Context context) { + Response inner + = this.serviceClient().checkWithResponse(resourceGroupName, vaultName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CrossTenantVaultMappingStatusResponseImpl(inner.getValue(), this.manager())); + } + + public CrossTenantVaultMappingStatusResponse check(String resourceGroupName, String vaultName) { + CrossTenantVaultMappingStatusResponseInner inner = this.serviceClient().check(resourceGroupName, vaultName); + if (inner != null) { + return new CrossTenantVaultMappingStatusResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + private CrossTenantVaultMappingStatusClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossTenantVaultMappingStatusResponseImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossTenantVaultMappingStatusResponseImpl.java new file mode 100644 index 000000000000..7ab96e68533f --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossTenantVaultMappingStatusResponseImpl.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.CrossTenantVaultMappingStatusResponseInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.CrossTenantVaultMappingStatusResponse; +import com.azure.resourcemanager.recoveryservicesbackup.models.VaultMappingState; + +public final class CrossTenantVaultMappingStatusResponseImpl implements CrossTenantVaultMappingStatusResponse { + private CrossTenantVaultMappingStatusResponseInner innerObject; + + private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; + + CrossTenantVaultMappingStatusResponseImpl(CrossTenantVaultMappingStatusResponseInner innerObject, + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String mappingName() { + return this.innerModel().mappingName(); + } + + public VaultMappingState mappingState() { + return this.innerModel().mappingState(); + } + + public CrossTenantVaultMappingStatusResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossTenantVaultMappingsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossTenantVaultMappingsClientImpl.java new file mode 100644 index 000000000000..efc952cd4a64 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossTenantVaultMappingsClientImpl.java @@ -0,0 +1,709 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.CrossTenantVaultMappingsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.CrossTenantVaultMappingInner; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.models.CrossTenantVaultMappingListResult; +import com.azure.resourcemanager.recoveryservicesbackup.models.RemoveCrossTenantVaultMappingRequest; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in CrossTenantVaultMappingsClient. + */ +public final class CrossTenantVaultMappingsClientImpl implements CrossTenantVaultMappingsClient { + /** + * The proxy service used to perform REST calls. + */ + private final CrossTenantVaultMappingsService service; + + /** + * The service client containing this operation class. + */ + private final RecoveryServicesBackupManagementClientImpl client; + + /** + * Initializes an instance of CrossTenantVaultMappingsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CrossTenantVaultMappingsClientImpl(RecoveryServicesBackupManagementClientImpl client) { + this.service = RestProxy.create(CrossTenantVaultMappingsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupManagementClientCrossTenantVaultMappings to be + * used by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RecoveryServicesBackupManagementClientCrossTenantVaultMappings") + public interface CrossTenantVaultMappingsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupCrossTenantVaultMappings/{crossTenantVaultMappingName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @PathParam("crossTenantVaultMappingName") String crossTenantVaultMappingName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupCrossTenantVaultMappings/{crossTenantVaultMappingName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @PathParam("crossTenantVaultMappingName") String crossTenantVaultMappingName, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupCrossTenantVaultMappings/{crossTenantVaultMappingName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @PathParam("crossTenantVaultMappingName") String crossTenantVaultMappingName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") CrossTenantVaultMappingInner resource, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupCrossTenantVaultMappings/{crossTenantVaultMappingName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @PathParam("crossTenantVaultMappingName") String crossTenantVaultMappingName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") CrossTenantVaultMappingInner resource, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupCrossTenantVaultMappings") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupCrossTenantVaultMappings") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupCrossTenantVaultMappings/{crossTenantVaultMappingName}/removeCrossTenantVaultMapping") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> remove(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @PathParam("crossTenantVaultMappingName") String crossTenantVaultMappingName, + @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") RemoveCrossTenantVaultMappingRequest body, Context context); + + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupCrossTenantVaultMappings/{crossTenantVaultMappingName}/removeCrossTenantVaultMapping") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response removeSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @PathParam("crossTenantVaultMappingName") String crossTenantVaultMappingName, + @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") RemoveCrossTenantVaultMappingRequest body, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets the cross-tenant vault mapping by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the cross-tenant vault mapping by name along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String vaultName, String crossTenantVaultMappingName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vaultName, crossTenantVaultMappingName, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the cross-tenant vault mapping by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the cross-tenant vault mapping by name on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName) { + return getWithResponseAsync(resourceGroupName, vaultName, crossTenantVaultMappingName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the cross-tenant vault mapping by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the cross-tenant vault mapping by name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, vaultName, crossTenantVaultMappingName, accept, context); + } + + /** + * Gets the cross-tenant vault mapping by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the cross-tenant vault mapping by name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CrossTenantVaultMappingInner get(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName) { + return getWithResponse(resourceGroupName, vaultName, crossTenantVaultMappingName, Context.NONE).getValue(); + } + + /** + * Creates or updates the cross-tenant vault mapping for cross-tenant restore operations. + * This API updates the target vault properties with source vault ID and creates catalog mapping. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param resource Request body for operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cross-tenant vault mapping resource for cross-tenant restore along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String vaultName, String crossTenantVaultMappingName, CrossTenantVaultMappingInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vaultName, crossTenantVaultMappingName, contentType, + accept, resource, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates the cross-tenant vault mapping for cross-tenant restore operations. + * This API updates the target vault properties with source vault ID and creates catalog mapping. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param resource Request body for operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cross-tenant vault mapping resource for cross-tenant restore on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, CrossTenantVaultMappingInner resource) { + return createOrUpdateWithResponseAsync(resourceGroupName, vaultName, crossTenantVaultMappingName, resource) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates or updates the cross-tenant vault mapping for cross-tenant restore operations. + * This API updates the target vault properties with source vault ID and creates catalog mapping. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param resource Request body for operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cross-tenant vault mapping resource for cross-tenant restore along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, CrossTenantVaultMappingInner resource, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vaultName, crossTenantVaultMappingName, contentType, + accept, resource, context); + } + + /** + * Creates or updates the cross-tenant vault mapping for cross-tenant restore operations. + * This API updates the target vault properties with source vault ID and creates catalog mapping. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param resource Request body for operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cross-tenant vault mapping resource for cross-tenant restore. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CrossTenantVaultMappingInner createOrUpdate(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, CrossTenantVaultMappingInner resource) { + return createOrUpdateWithResponse(resourceGroupName, vaultName, crossTenantVaultMappingName, resource, + Context.NONE).getValue(); + } + + /** + * Lists the cross-tenant vault mapping configurations for cross-tenant restore operations. + * Retrieves the current cross-tenant vault mapping details including source vault mappings and mapping state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CrossTenantVaultMapping list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String vaultName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vaultName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the cross-tenant vault mapping configurations for cross-tenant restore operations. + * Retrieves the current cross-tenant vault mapping details including source vault mappings and mapping state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CrossTenantVaultMapping list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String vaultName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, vaultName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists the cross-tenant vault mapping configurations for cross-tenant restore operations. + * Retrieves the current cross-tenant vault mapping details including source vault mappings and mapping state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CrossTenantVaultMapping list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String vaultName) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, vaultName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists the cross-tenant vault mapping configurations for cross-tenant restore operations. + * Retrieves the current cross-tenant vault mapping details including source vault mappings and mapping state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CrossTenantVaultMapping list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String vaultName, + Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, vaultName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists the cross-tenant vault mapping configurations for cross-tenant restore operations. + * Retrieves the current cross-tenant vault mapping details including source vault mappings and mapping state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CrossTenantVaultMapping list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String vaultName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, vaultName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Lists the cross-tenant vault mapping configurations for cross-tenant restore operations. + * Retrieves the current cross-tenant vault mapping details including source vault mappings and mapping state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CrossTenantVaultMapping list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String vaultName, + Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, vaultName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Removes the cross-tenant vault mapping for cross-tenant restore operations. + * This API removes the target vault properties associated with source vault ID and deletes catalog mapping. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param body Request body for operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> removeWithResponseAsync(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, RemoveCrossTenantVaultMappingRequest body) { + final String contentType = "application/json"; + return FluxUtil + .withContext(context -> service.remove(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vaultName, crossTenantVaultMappingName, contentType, + body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Removes the cross-tenant vault mapping for cross-tenant restore operations. + * This API removes the target vault properties associated with source vault ID and deletes catalog mapping. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param body Request body for operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response removeWithResponse(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, RemoveCrossTenantVaultMappingRequest body) { + final String contentType = "application/json"; + return service.removeSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vaultName, crossTenantVaultMappingName, contentType, + body, Context.NONE); + } + + /** + * Removes the cross-tenant vault mapping for cross-tenant restore operations. + * This API removes the target vault properties associated with source vault ID and deletes catalog mapping. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param body Request body for operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response removeWithResponse(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, RemoveCrossTenantVaultMappingRequest body, Context context) { + final String contentType = "application/json"; + return service.removeSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vaultName, crossTenantVaultMappingName, contentType, + body, context); + } + + /** + * Removes the cross-tenant vault mapping for cross-tenant restore operations. + * This API removes the target vault properties associated with source vault ID and deletes catalog mapping. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param body Request body for operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginRemoveAsync(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, RemoveCrossTenantVaultMappingRequest body) { + Mono>> mono + = removeWithResponseAsync(resourceGroupName, vaultName, crossTenantVaultMappingName, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Removes the cross-tenant vault mapping for cross-tenant restore operations. + * This API removes the target vault properties associated with source vault ID and deletes catalog mapping. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param body Request body for operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRemove(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, RemoveCrossTenantVaultMappingRequest body) { + Response response + = removeWithResponse(resourceGroupName, vaultName, crossTenantVaultMappingName, body); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Removes the cross-tenant vault mapping for cross-tenant restore operations. + * This API removes the target vault properties associated with source vault ID and deletes catalog mapping. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param body Request body for operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginRemove(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, RemoveCrossTenantVaultMappingRequest body, Context context) { + Response response + = removeWithResponse(resourceGroupName, vaultName, crossTenantVaultMappingName, body, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Removes the cross-tenant vault mapping for cross-tenant restore operations. + * This API removes the target vault properties associated with source vault ID and deletes catalog mapping. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param body Request body for operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono removeAsync(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + RemoveCrossTenantVaultMappingRequest body) { + return beginRemoveAsync(resourceGroupName, vaultName, crossTenantVaultMappingName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Removes the cross-tenant vault mapping for cross-tenant restore operations. + * This API removes the target vault properties associated with source vault ID and deletes catalog mapping. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param body Request body for operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void remove(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + RemoveCrossTenantVaultMappingRequest body) { + beginRemove(resourceGroupName, vaultName, crossTenantVaultMappingName, body).getFinalResult(); + } + + /** + * Removes the cross-tenant vault mapping for cross-tenant restore operations. + * This API removes the target vault properties associated with source vault ID and deletes catalog mapping. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param body Request body for operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void remove(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + RemoveCrossTenantVaultMappingRequest body, Context context) { + beginRemove(resourceGroupName, vaultName, crossTenantVaultMappingName, body, context).getFinalResult(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CrossTenantVaultMapping list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CrossTenantVaultMapping list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CrossTenantVaultMapping list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossTenantVaultMappingsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossTenantVaultMappingsImpl.java new file mode 100644 index 000000000000..9e7a48e7df6e --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossTenantVaultMappingsImpl.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.CrossTenantVaultMappingsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.CrossTenantVaultMappingInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.CrossTenantVaultMapping; +import com.azure.resourcemanager.recoveryservicesbackup.models.CrossTenantVaultMappings; +import com.azure.resourcemanager.recoveryservicesbackup.models.RemoveCrossTenantVaultMappingRequest; + +public final class CrossTenantVaultMappingsImpl implements CrossTenantVaultMappings { + private static final ClientLogger LOGGER = new ClientLogger(CrossTenantVaultMappingsImpl.class); + + private final CrossTenantVaultMappingsClient innerClient; + + private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; + + public CrossTenantVaultMappingsImpl(CrossTenantVaultMappingsClient innerClient, + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, vaultName, crossTenantVaultMappingName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CrossTenantVaultMappingImpl(inner.getValue(), this.manager())); + } + + public CrossTenantVaultMapping get(String resourceGroupName, String vaultName, String crossTenantVaultMappingName) { + CrossTenantVaultMappingInner inner + = this.serviceClient().get(resourceGroupName, vaultName, crossTenantVaultMappingName); + if (inner != null) { + return new CrossTenantVaultMappingImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String resourceGroupName, String vaultName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, vaultName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CrossTenantVaultMappingImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String vaultName, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, vaultName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CrossTenantVaultMappingImpl(inner1, this.manager())); + } + + public void remove(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + RemoveCrossTenantVaultMappingRequest body) { + this.serviceClient().remove(resourceGroupName, vaultName, crossTenantVaultMappingName, body); + } + + public void remove(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + RemoveCrossTenantVaultMappingRequest body, Context context) { + this.serviceClient().remove(resourceGroupName, vaultName, crossTenantVaultMappingName, body, context); + } + + public CrossTenantVaultMapping getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vaultName = ResourceManagerUtils.getValueFromIdByName(id, "vaults"); + if (vaultName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", id))); + } + String crossTenantVaultMappingName + = ResourceManagerUtils.getValueFromIdByName(id, "backupCrossTenantVaultMappings"); + if (crossTenantVaultMappingName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'backupCrossTenantVaultMappings'.", id))); + } + return this.getWithResponse(resourceGroupName, vaultName, crossTenantVaultMappingName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String vaultName = ResourceManagerUtils.getValueFromIdByName(id, "vaults"); + if (vaultName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'vaults'.", id))); + } + String crossTenantVaultMappingName + = ResourceManagerUtils.getValueFromIdByName(id, "backupCrossTenantVaultMappings"); + if (crossTenantVaultMappingName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format( + "The resource ID '%s' is not valid. Missing path segment 'backupCrossTenantVaultMappings'.", id))); + } + return this.getWithResponse(resourceGroupName, vaultName, crossTenantVaultMappingName, context); + } + + private CrossTenantVaultMappingsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { + return this.serviceManager; + } + + public CrossTenantVaultMappingImpl define(String name) { + return new CrossTenantVaultMappingImpl(name, this.manager()); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossTenantVaultRecoveryPointOperationsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossTenantVaultRecoveryPointOperationsClientImpl.java new file mode 100644 index 000000000000..9ba674dc2420 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossTenantVaultRecoveryPointOperationsClientImpl.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.CrossTenantVaultRecoveryPointOperationsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.RecoveryPointResourceInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * CrossTenantVaultRecoveryPointOperationsClient. + */ +public final class CrossTenantVaultRecoveryPointOperationsClientImpl + implements CrossTenantVaultRecoveryPointOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final CrossTenantVaultRecoveryPointOperationsService service; + + /** + * The service client containing this operation class. + */ + private final RecoveryServicesBackupManagementClientImpl client; + + /** + * Initializes an instance of CrossTenantVaultRecoveryPointOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CrossTenantVaultRecoveryPointOperationsClientImpl(RecoveryServicesBackupManagementClientImpl client) { + this.service = RestProxy.create(CrossTenantVaultRecoveryPointOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for + * RecoveryServicesBackupManagementClientCrossTenantVaultRecoveryPointOperations to be used by the proxy service to + * perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RecoveryServicesBackupManagementClientCrossTenantVaultRecoveryPointOperations") + public interface CrossTenantVaultRecoveryPointOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupCrossTenantVaultMappings/{crossTenantVaultMappingName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @PathParam("crossTenantVaultMappingName") String crossTenantVaultMappingName, + @PathParam("fabricName") String fabricName, @PathParam("containerName") String containerName, + @PathParam("protectedItemName") String protectedItemName, + @PathParam("recoveryPointId") String recoveryPointId, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupCrossTenantVaultMappings/{crossTenantVaultMappingName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @PathParam("crossTenantVaultMappingName") String crossTenantVaultMappingName, + @PathParam("fabricName") String fabricName, @PathParam("containerName") String containerName, + @PathParam("protectedItemName") String protectedItemName, + @PathParam("recoveryPointId") String recoveryPointId, @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Provides the information of the backed up data identified using RecoveryPointID from the source + * vault in a different tenant. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup copies along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String fabricName, String containerName, String protectedItemName, + String recoveryPointId) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vaultName, crossTenantVaultMappingName, fabricName, + containerName, protectedItemName, recoveryPointId, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Provides the information of the backed up data identified using RecoveryPointID from the source + * vault in a different tenant. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup copies on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String fabricName, String containerName, String protectedItemName, + String recoveryPointId) { + return getWithResponseAsync(resourceGroupName, vaultName, crossTenantVaultMappingName, fabricName, + containerName, protectedItemName, recoveryPointId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Provides the information of the backed up data identified using RecoveryPointID from the source + * vault in a different tenant. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup copies along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String fabricName, String containerName, String protectedItemName, + String recoveryPointId, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, vaultName, crossTenantVaultMappingName, fabricName, containerName, protectedItemName, + recoveryPointId, accept, context); + } + + /** + * Provides the information of the backed up data identified using RecoveryPointID from the source + * vault in a different tenant. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup copies. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RecoveryPointResourceInner get(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String fabricName, String containerName, String protectedItemName, + String recoveryPointId) { + return getWithResponse(resourceGroupName, vaultName, crossTenantVaultMappingName, fabricName, containerName, + protectedItemName, recoveryPointId, Context.NONE).getValue(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossTenantVaultRecoveryPointOperationsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossTenantVaultRecoveryPointOperationsImpl.java new file mode 100644 index 000000000000..ba07b0896ef7 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossTenantVaultRecoveryPointOperationsImpl.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.CrossTenantVaultRecoveryPointOperationsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.RecoveryPointResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.CrossTenantVaultRecoveryPointOperations; +import com.azure.resourcemanager.recoveryservicesbackup.models.RecoveryPointResource; + +public final class CrossTenantVaultRecoveryPointOperationsImpl implements CrossTenantVaultRecoveryPointOperations { + private static final ClientLogger LOGGER = new ClientLogger(CrossTenantVaultRecoveryPointOperationsImpl.class); + + private final CrossTenantVaultRecoveryPointOperationsClient innerClient; + + private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; + + public CrossTenantVaultRecoveryPointOperationsImpl(CrossTenantVaultRecoveryPointOperationsClient innerClient, + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String fabricName, String containerName, String protectedItemName, + String recoveryPointId, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, vaultName, crossTenantVaultMappingName, fabricName, containerName, + protectedItemName, recoveryPointId, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new RecoveryPointResourceImpl(inner.getValue(), this.manager())); + } + + public RecoveryPointResource get(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + String fabricName, String containerName, String protectedItemName, String recoveryPointId) { + RecoveryPointResourceInner inner = this.serviceClient() + .get(resourceGroupName, vaultName, crossTenantVaultMappingName, fabricName, containerName, + protectedItemName, recoveryPointId); + if (inner != null) { + return new RecoveryPointResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + private CrossTenantVaultRecoveryPointOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossTenantVaultRecoveryPointsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossTenantVaultRecoveryPointsClientImpl.java new file mode 100644 index 000000000000..54e8dd43f9a3 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossTenantVaultRecoveryPointsClientImpl.java @@ -0,0 +1,340 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.CrossTenantVaultRecoveryPointsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.RecoveryPointResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.models.CrossTenantRecoveryPointResourceList; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in CrossTenantVaultRecoveryPointsClient. + */ +public final class CrossTenantVaultRecoveryPointsClientImpl implements CrossTenantVaultRecoveryPointsClient { + /** + * The proxy service used to perform REST calls. + */ + private final CrossTenantVaultRecoveryPointsService service; + + /** + * The service client containing this operation class. + */ + private final RecoveryServicesBackupManagementClientImpl client; + + /** + * Initializes an instance of CrossTenantVaultRecoveryPointsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CrossTenantVaultRecoveryPointsClientImpl(RecoveryServicesBackupManagementClientImpl client) { + this.service = RestProxy.create(CrossTenantVaultRecoveryPointsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupManagementClientCrossTenantVaultRecoveryPoints + * to be used by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RecoveryServicesBackupManagementClientCrossTenantVaultRecoveryPoints") + public interface CrossTenantVaultRecoveryPointsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupCrossTenantVaultMappings/{crossTenantVaultMappingName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @PathParam("crossTenantVaultMappingName") String crossTenantVaultMappingName, + @PathParam("fabricName") String fabricName, @PathParam("containerName") String containerName, + @PathParam("protectedItemName") String protectedItemName, @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupCrossTenantVaultMappings/{crossTenantVaultMappingName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @PathParam("crossTenantVaultMappingName") String crossTenantVaultMappingName, + @PathParam("fabricName") String fabricName, @PathParam("containerName") String containerName, + @PathParam("protectedItemName") String protectedItemName, @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Lists recovery points from the source vault in a different tenant. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @param filter OData filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of recovery points for cross-tenant restore operations along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String vaultName, String crossTenantVaultMappingName, String fabricName, String containerName, + String protectedItemName, String filter) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vaultName, crossTenantVaultMappingName, fabricName, + containerName, protectedItemName, filter, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists recovery points from the source vault in a different tenant. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @param filter OData filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of recovery points for cross-tenant restore operations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String fabricName, String containerName, String protectedItemName, + String filter) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, vaultName, crossTenantVaultMappingName, + fabricName, containerName, protectedItemName, filter), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists recovery points from the source vault in a different tenant. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of recovery points for cross-tenant restore operations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String fabricName, String containerName, String protectedItemName) { + final String filter = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, vaultName, crossTenantVaultMappingName, + fabricName, containerName, protectedItemName, filter), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists recovery points from the source vault in a different tenant. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @param filter OData filter options. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of recovery points for cross-tenant restore operations along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String fabricName, String containerName, String protectedItemName, + String filter) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, vaultName, + crossTenantVaultMappingName, fabricName, containerName, protectedItemName, filter, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists recovery points from the source vault in a different tenant. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of recovery points for cross-tenant restore operations along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String fabricName, String containerName, String protectedItemName, + String filter, Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, vaultName, + crossTenantVaultMappingName, fabricName, containerName, protectedItemName, filter, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists recovery points from the source vault in a different tenant. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of recovery points for cross-tenant restore operations as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String fabricName, String containerName, String protectedItemName) { + final String filter = null; + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, vaultName, crossTenantVaultMappingName, + fabricName, containerName, protectedItemName, filter), nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Lists recovery points from the source vault in a different tenant. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of recovery points for cross-tenant restore operations as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String fabricName, String containerName, String protectedItemName, + String filter, Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, vaultName, crossTenantVaultMappingName, + fabricName, containerName, protectedItemName, filter, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of recovery points for cross-tenant restore operations along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of recovery points for cross-tenant restore operations along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of recovery points for cross-tenant restore operations along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossTenantVaultRecoveryPointsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossTenantVaultRecoveryPointsImpl.java new file mode 100644 index 000000000000..16ba67a92978 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/CrossTenantVaultRecoveryPointsImpl.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.CrossTenantVaultRecoveryPointsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.RecoveryPointResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.CrossTenantVaultRecoveryPoints; +import com.azure.resourcemanager.recoveryservicesbackup.models.RecoveryPointResource; + +public final class CrossTenantVaultRecoveryPointsImpl implements CrossTenantVaultRecoveryPoints { + private static final ClientLogger LOGGER = new ClientLogger(CrossTenantVaultRecoveryPointsImpl.class); + + private final CrossTenantVaultRecoveryPointsClient innerClient; + + private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; + + public CrossTenantVaultRecoveryPointsImpl(CrossTenantVaultRecoveryPointsClient innerClient, + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String fabricName, String containerName, String protectedItemName) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, vaultName, crossTenantVaultMappingName, fabricName, containerName, + protectedItemName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RecoveryPointResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String fabricName, String containerName, String protectedItemName, + String filter, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceGroupName, vaultName, crossTenantVaultMappingName, fabricName, containerName, + protectedItemName, filter, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new RecoveryPointResourceImpl(inner1, this.manager())); + } + + private CrossTenantVaultRecoveryPointsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobDetailsFromCrossTenantVaultsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobDetailsFromCrossTenantVaultsClientImpl.java new file mode 100644 index 000000000000..03db86a8b0aa --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobDetailsFromCrossTenantVaultsClientImpl.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.JobDetailsFromCrossTenantVaultsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.JobResourceInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in JobDetailsFromCrossTenantVaultsClient. + */ +public final class JobDetailsFromCrossTenantVaultsClientImpl implements JobDetailsFromCrossTenantVaultsClient { + /** + * The proxy service used to perform REST calls. + */ + private final JobDetailsFromCrossTenantVaultsService service; + + /** + * The service client containing this operation class. + */ + private final RecoveryServicesBackupManagementClientImpl client; + + /** + * Initializes an instance of JobDetailsFromCrossTenantVaultsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + JobDetailsFromCrossTenantVaultsClientImpl(RecoveryServicesBackupManagementClientImpl client) { + this.service = RestProxy.create(JobDetailsFromCrossTenantVaultsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupManagementClientJobDetailsFromCrossTenantVaults + * to be used by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RecoveryServicesBackupManagementClientJobDetailsFromCrossTenantVaults") + public interface JobDetailsFromCrossTenantVaultsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupCrossTenantVaultMappings/{crossTenantVaultMappingName}/backupJobs/{jobName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @PathParam("crossTenantVaultMappingName") String crossTenantVaultMappingName, + @PathParam("jobName") String jobName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupCrossTenantVaultMappings/{crossTenantVaultMappingName}/backupJobs/{jobName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @PathParam("crossTenantVaultMappingName") String crossTenantVaultMappingName, + @PathParam("jobName") String jobName, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets extended information associated with a cross-tenant backup job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param jobName Name of the job whose details are to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return extended information associated with a cross-tenant backup job along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String jobName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vaultName, crossTenantVaultMappingName, jobName, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets extended information associated with a cross-tenant backup job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param jobName Name of the job whose details are to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return extended information associated with a cross-tenant backup job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String jobName) { + return getWithResponseAsync(resourceGroupName, vaultName, crossTenantVaultMappingName, jobName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets extended information associated with a cross-tenant backup job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param jobName Name of the job whose details are to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return extended information associated with a cross-tenant backup job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String jobName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, vaultName, crossTenantVaultMappingName, jobName, accept, context); + } + + /** + * Gets extended information associated with a cross-tenant backup job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param jobName Name of the job whose details are to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return extended information associated with a cross-tenant backup job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public JobResourceInner get(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + String jobName) { + return getWithResponse(resourceGroupName, vaultName, crossTenantVaultMappingName, jobName, Context.NONE) + .getValue(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobDetailsFromCrossTenantVaultsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobDetailsFromCrossTenantVaultsImpl.java new file mode 100644 index 000000000000..feb0a345d109 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/JobDetailsFromCrossTenantVaultsImpl.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.JobDetailsFromCrossTenantVaultsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.JobResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.JobDetailsFromCrossTenantVaults; +import com.azure.resourcemanager.recoveryservicesbackup.models.JobResource; + +public final class JobDetailsFromCrossTenantVaultsImpl implements JobDetailsFromCrossTenantVaults { + private static final ClientLogger LOGGER = new ClientLogger(JobDetailsFromCrossTenantVaultsImpl.class); + + private final JobDetailsFromCrossTenantVaultsClient innerClient; + + private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; + + public JobDetailsFromCrossTenantVaultsImpl(JobDetailsFromCrossTenantVaultsClient innerClient, + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String jobName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, vaultName, crossTenantVaultMappingName, jobName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new JobResourceImpl(inner.getValue(), this.manager())); + } + + public JobResource get(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + String jobName) { + JobResourceInner inner + = this.serviceClient().get(resourceGroupName, vaultName, crossTenantVaultMappingName, jobName); + if (inner != null) { + return new JobResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + private JobDetailsFromCrossTenantVaultsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationFromCrossTenantVaultsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationFromCrossTenantVaultsClientImpl.java new file mode 100644 index 000000000000..54f381ee3ab3 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationFromCrossTenantVaultsClientImpl.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.OperationFromCrossTenantVaultsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ValidateOperationsResponseInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperationRequestResource; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in OperationFromCrossTenantVaultsClient. + */ +public final class OperationFromCrossTenantVaultsClientImpl implements OperationFromCrossTenantVaultsClient { + /** + * The proxy service used to perform REST calls. + */ + private final OperationFromCrossTenantVaultsService service; + + /** + * The service client containing this operation class. + */ + private final RecoveryServicesBackupManagementClientImpl client; + + /** + * Initializes an instance of OperationFromCrossTenantVaultsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationFromCrossTenantVaultsClientImpl(RecoveryServicesBackupManagementClientImpl client) { + this.service = RestProxy.create(OperationFromCrossTenantVaultsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupManagementClientOperationFromCrossTenantVaults + * to be used by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RecoveryServicesBackupManagementClientOperationFromCrossTenantVaults") + public interface OperationFromCrossTenantVaultsService { + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupCrossTenantVaultMappings/{crossTenantVaultMappingName}/backupValidateOperation") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> validate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @PathParam("crossTenantVaultMappingName") String crossTenantVaultMappingName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ValidateOperationRequestResource body, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupCrossTenantVaultMappings/{crossTenantVaultMappingName}/backupValidateOperation") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response validateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @PathParam("crossTenantVaultMappingName") String crossTenantVaultMappingName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ValidateOperationRequestResource body, Context context); + } + + /** + * Validates a backup operation for cross-tenant restore scenarios. + * This API performs validation checks before executing a backup operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> validateWithResponseAsync(String resourceGroupName, + String vaultName, String crossTenantVaultMappingName, ValidateOperationRequestResource body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.validate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vaultName, crossTenantVaultMappingName, contentType, + accept, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Validates a backup operation for cross-tenant restore scenarios. + * This API performs validation checks before executing a backup operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono validateAsync(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, ValidateOperationRequestResource body) { + return validateWithResponseAsync(resourceGroupName, vaultName, crossTenantVaultMappingName, body) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Validates a backup operation for cross-tenant restore scenarios. + * This API performs validation checks before executing a backup operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response validateWithResponse(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, ValidateOperationRequestResource body, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.validateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vaultName, crossTenantVaultMappingName, contentType, + accept, body, context); + } + + /** + * Validates a backup operation for cross-tenant restore scenarios. + * This API performs validation checks before executing a backup operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ValidateOperationsResponseInner validate(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, ValidateOperationRequestResource body) { + return validateWithResponse(resourceGroupName, vaultName, crossTenantVaultMappingName, body, Context.NONE) + .getValue(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationFromCrossTenantVaultsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationFromCrossTenantVaultsImpl.java new file mode 100644 index 000000000000..7692b71febb0 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/OperationFromCrossTenantVaultsImpl.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.OperationFromCrossTenantVaultsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ValidateOperationsResponseInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.OperationFromCrossTenantVaults; +import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperationRequestResource; +import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperationsResponse; + +public final class OperationFromCrossTenantVaultsImpl implements OperationFromCrossTenantVaults { + private static final ClientLogger LOGGER = new ClientLogger(OperationFromCrossTenantVaultsImpl.class); + + private final OperationFromCrossTenantVaultsClient innerClient; + + private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; + + public OperationFromCrossTenantVaultsImpl(OperationFromCrossTenantVaultsClient innerClient, + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response validateWithResponse(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, ValidateOperationRequestResource body, Context context) { + Response inner = this.serviceClient() + .validateWithResponse(resourceGroupName, vaultName, crossTenantVaultMappingName, body, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ValidateOperationsResponseImpl(inner.getValue(), this.manager())); + } + + public ValidateOperationsResponse validate(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, ValidateOperationRequestResource body) { + ValidateOperationsResponseInner inner + = this.serviceClient().validate(resourceGroupName, vaultName, crossTenantVaultMappingName, body); + if (inner != null) { + return new ValidateOperationsResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + private OperationFromCrossTenantVaultsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemFromCrossTenantVaultsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemFromCrossTenantVaultsClientImpl.java new file mode 100644 index 000000000000..b5435ce004a8 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemFromCrossTenantVaultsClientImpl.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectedItemFromCrossTenantVaultsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectedItemResourceInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ProtectedItemFromCrossTenantVaultsClient. + */ +public final class ProtectedItemFromCrossTenantVaultsClientImpl implements ProtectedItemFromCrossTenantVaultsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ProtectedItemFromCrossTenantVaultsService service; + + /** + * The service client containing this operation class. + */ + private final RecoveryServicesBackupManagementClientImpl client; + + /** + * Initializes an instance of ProtectedItemFromCrossTenantVaultsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProtectedItemFromCrossTenantVaultsClientImpl(RecoveryServicesBackupManagementClientImpl client) { + this.service = RestProxy.create(ProtectedItemFromCrossTenantVaultsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for + * RecoveryServicesBackupManagementClientProtectedItemFromCrossTenantVaults to be used by the proxy service to + * perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RecoveryServicesBackupManagementClientProtectedItemFromCrossTenantVaults") + public interface ProtectedItemFromCrossTenantVaultsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupCrossTenantVaultMappings/{crossTenantVaultMappingName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @PathParam("crossTenantVaultMappingName") String crossTenantVaultMappingName, + @PathParam("fabricName") String fabricName, @PathParam("containerName") String containerName, + @PathParam("protectedItemName") String protectedItemName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupCrossTenantVaultMappings/{crossTenantVaultMappingName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @PathParam("crossTenantVaultMappingName") String crossTenantVaultMappingName, + @PathParam("fabricName") String fabricName, @PathParam("containerName") String containerName, + @PathParam("protectedItemName") String protectedItemName, @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets the details of a protected item from a cross-tenant vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name whose details are to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a protected item from a cross-tenant vault along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String fabricName, String containerName, String protectedItemName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vaultName, crossTenantVaultMappingName, fabricName, + containerName, protectedItemName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the details of a protected item from a cross-tenant vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name whose details are to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a protected item from a cross-tenant vault on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String fabricName, String containerName, String protectedItemName) { + return getWithResponseAsync(resourceGroupName, vaultName, crossTenantVaultMappingName, fabricName, + containerName, protectedItemName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the details of a protected item from a cross-tenant vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name whose details are to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a protected item from a cross-tenant vault along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String fabricName, String containerName, String protectedItemName, + Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, vaultName, crossTenantVaultMappingName, fabricName, containerName, protectedItemName, + accept, context); + } + + /** + * Gets the details of a protected item from a cross-tenant vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name whose details are to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a protected item from a cross-tenant vault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProtectedItemResourceInner get(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String fabricName, String containerName, String protectedItemName) { + return getWithResponse(resourceGroupName, vaultName, crossTenantVaultMappingName, fabricName, containerName, + protectedItemName, Context.NONE).getValue(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemFromCrossTenantVaultsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemFromCrossTenantVaultsImpl.java new file mode 100644 index 000000000000..6e3111d5e269 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemFromCrossTenantVaultsImpl.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectedItemFromCrossTenantVaultsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectedItemResourceInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectedItemFromCrossTenantVaults; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectedItemResource; + +public final class ProtectedItemFromCrossTenantVaultsImpl implements ProtectedItemFromCrossTenantVaults { + private static final ClientLogger LOGGER = new ClientLogger(ProtectedItemFromCrossTenantVaultsImpl.class); + + private final ProtectedItemFromCrossTenantVaultsClient innerClient; + + private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; + + public ProtectedItemFromCrossTenantVaultsImpl(ProtectedItemFromCrossTenantVaultsClient innerClient, + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String fabricName, String containerName, String protectedItemName, + Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, vaultName, crossTenantVaultMappingName, fabricName, containerName, + protectedItemName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ProtectedItemResourceImpl(inner.getValue(), this.manager())); + } + + public ProtectedItemResource get(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + String fabricName, String containerName, String protectedItemName) { + ProtectedItemResourceInner inner = this.serviceClient() + .get(resourceGroupName, vaultName, crossTenantVaultMappingName, fabricName, containerName, + protectedItemName); + if (inner != null) { + return new ProtectedItemResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + private ProtectedItemFromCrossTenantVaultsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemOperationResultsFromCrossTenantVaultsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemOperationResultsFromCrossTenantVaultsClientImpl.java new file mode 100644 index 000000000000..879fba884835 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemOperationResultsFromCrossTenantVaultsClientImpl.java @@ -0,0 +1,345 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectedItemOperationResultsFromCrossTenantVaultsClient; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * ProtectedItemOperationResultsFromCrossTenantVaultsClient. + */ +public final class ProtectedItemOperationResultsFromCrossTenantVaultsClientImpl + implements ProtectedItemOperationResultsFromCrossTenantVaultsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ProtectedItemOperationResultsFromCrossTenantVaultsService service; + + /** + * The service client containing this operation class. + */ + private final RecoveryServicesBackupManagementClientImpl client; + + /** + * Initializes an instance of ProtectedItemOperationResultsFromCrossTenantVaultsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProtectedItemOperationResultsFromCrossTenantVaultsClientImpl(RecoveryServicesBackupManagementClientImpl client) { + this.service = RestProxy.create(ProtectedItemOperationResultsFromCrossTenantVaultsService.class, + client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for + * RecoveryServicesBackupManagementClientProtectedItemOperationResultsFromCrossTenantVaults to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RecoveryServicesBackupManagementClientProtectedItemOperationResultsFromCrossTenantVaults") + public interface ProtectedItemOperationResultsFromCrossTenantVaultsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupCrossTenantVaultMappings/{crossTenantVaultMappingName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/operationResults/{operationId}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @PathParam("crossTenantVaultMappingName") String crossTenantVaultMappingName, + @PathParam("fabricName") String fabricName, @PathParam("containerName") String containerName, + @PathParam("protectedItemName") String protectedItemName, @PathParam("operationId") String operationId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupCrossTenantVaultMappings/{crossTenantVaultMappingName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/operationResults/{operationId}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @PathParam("crossTenantVaultMappingName") String crossTenantVaultMappingName, + @PathParam("fabricName") String fabricName, @PathParam("containerName") String containerName, + @PathParam("protectedItemName") String protectedItemName, @PathParam("operationId") String operationId, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Fetches the result of any cross-tenant operation on the backup item. + * While the operation is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. When the operation completes it returns + * either 200 OK with the final ProtectedItemResource body, or 204 No Content if there + * is no body to return. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @param operationId OperationID which represents the operation whose result needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup items along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getWithResponseAsync(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String fabricName, String containerName, String protectedItemName, + String operationId) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vaultName, crossTenantVaultMappingName, fabricName, + containerName, protectedItemName, operationId, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Fetches the result of any cross-tenant operation on the backup item. + * While the operation is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. When the operation completes it returns + * either 200 OK with the final ProtectedItemResource body, or 204 No Content if there + * is no body to return. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @param operationId OperationID which represents the operation whose result needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup items along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response getWithResponse(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String fabricName, String containerName, String protectedItemName, + String operationId) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, vaultName, crossTenantVaultMappingName, fabricName, containerName, protectedItemName, + operationId, accept, Context.NONE); + } + + /** + * Fetches the result of any cross-tenant operation on the backup item. + * While the operation is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. When the operation completes it returns + * either 200 OK with the final ProtectedItemResource body, or 204 No Content if there + * is no body to return. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @param operationId OperationID which represents the operation whose result needs to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup items along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response getWithResponse(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String fabricName, String containerName, String protectedItemName, + String operationId, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, vaultName, crossTenantVaultMappingName, fabricName, containerName, protectedItemName, + operationId, accept, context); + } + + /** + * Fetches the result of any cross-tenant operation on the backup item. + * While the operation is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. When the operation completes it returns + * either 200 OK with the final ProtectedItemResource body, or 204 No Content if there + * is no body to return. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @param operationId OperationID which represents the operation whose result needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of base class for backup items. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginGetAsync(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String fabricName, String containerName, String protectedItemName, + String operationId) { + Mono>> mono = getWithResponseAsync(resourceGroupName, vaultName, + crossTenantVaultMappingName, fabricName, containerName, protectedItemName, operationId); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Fetches the result of any cross-tenant operation on the backup item. + * While the operation is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. When the operation completes it returns + * either 200 OK with the final ProtectedItemResource body, or 204 No Content if there + * is no body to return. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @param operationId OperationID which represents the operation whose result needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of base class for backup items. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginGet(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String fabricName, String containerName, String protectedItemName, + String operationId) { + Response response = getWithResponse(resourceGroupName, vaultName, crossTenantVaultMappingName, + fabricName, containerName, protectedItemName, operationId); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Fetches the result of any cross-tenant operation on the backup item. + * While the operation is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. When the operation completes it returns + * either 200 OK with the final ProtectedItemResource body, or 204 No Content if there + * is no body to return. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @param operationId OperationID which represents the operation whose result needs to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of base class for backup items. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginGet(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String fabricName, String containerName, String protectedItemName, + String operationId, Context context) { + Response response = getWithResponse(resourceGroupName, vaultName, crossTenantVaultMappingName, + fabricName, containerName, protectedItemName, operationId, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Fetches the result of any cross-tenant operation on the backup item. + * While the operation is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. When the operation completes it returns + * either 200 OK with the final ProtectedItemResource body, or 204 No Content if there + * is no body to return. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @param operationId OperationID which represents the operation whose result needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup items on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + String fabricName, String containerName, String protectedItemName, String operationId) { + return beginGetAsync(resourceGroupName, vaultName, crossTenantVaultMappingName, fabricName, containerName, + protectedItemName, operationId).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Fetches the result of any cross-tenant operation on the backup item. + * While the operation is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. When the operation completes it returns + * either 200 OK with the final ProtectedItemResource body, or 204 No Content if there + * is no body to return. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @param operationId OperationID which represents the operation whose result needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void get(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, String fabricName, + String containerName, String protectedItemName, String operationId) { + beginGet(resourceGroupName, vaultName, crossTenantVaultMappingName, fabricName, containerName, + protectedItemName, operationId).getFinalResult(); + } + + /** + * Fetches the result of any cross-tenant operation on the backup item. + * While the operation is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. When the operation completes it returns + * either 200 OK with the final ProtectedItemResource body, or 204 No Content if there + * is no body to return. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @param operationId OperationID which represents the operation whose result needs to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void get(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, String fabricName, + String containerName, String protectedItemName, String operationId, Context context) { + beginGet(resourceGroupName, vaultName, crossTenantVaultMappingName, fabricName, containerName, + protectedItemName, operationId, context).getFinalResult(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemOperationResultsFromCrossTenantVaultsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemOperationResultsFromCrossTenantVaultsImpl.java new file mode 100644 index 000000000000..1f5da72ecdf9 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemOperationResultsFromCrossTenantVaultsImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectedItemOperationResultsFromCrossTenantVaultsClient; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectedItemOperationResultsFromCrossTenantVaults; + +public final class ProtectedItemOperationResultsFromCrossTenantVaultsImpl + implements ProtectedItemOperationResultsFromCrossTenantVaults { + private static final ClientLogger LOGGER + = new ClientLogger(ProtectedItemOperationResultsFromCrossTenantVaultsImpl.class); + + private final ProtectedItemOperationResultsFromCrossTenantVaultsClient innerClient; + + private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; + + public ProtectedItemOperationResultsFromCrossTenantVaultsImpl( + ProtectedItemOperationResultsFromCrossTenantVaultsClient innerClient, + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void get(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, String fabricName, + String containerName, String protectedItemName, String operationId) { + this.serviceClient() + .get(resourceGroupName, vaultName, crossTenantVaultMappingName, fabricName, containerName, + protectedItemName, operationId); + } + + public void get(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, String fabricName, + String containerName, String protectedItemName, String operationId, Context context) { + this.serviceClient() + .get(resourceGroupName, vaultName, crossTenantVaultMappingName, fabricName, containerName, + protectedItemName, operationId, context); + } + + private ProtectedItemOperationResultsFromCrossTenantVaultsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemOperationStatusesFromCrossTenantVaultsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemOperationStatusesFromCrossTenantVaultsClientImpl.java new file mode 100644 index 000000000000..7a9b5ef915b1 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemOperationStatusesFromCrossTenantVaultsClientImpl.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectedItemOperationStatusesFromCrossTenantVaultsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationStatusInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * ProtectedItemOperationStatusesFromCrossTenantVaultsClient. + */ +public final class ProtectedItemOperationStatusesFromCrossTenantVaultsClientImpl + implements ProtectedItemOperationStatusesFromCrossTenantVaultsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ProtectedItemOperationStatusesFromCrossTenantVaultsService service; + + /** + * The service client containing this operation class. + */ + private final RecoveryServicesBackupManagementClientImpl client; + + /** + * Initializes an instance of ProtectedItemOperationStatusesFromCrossTenantVaultsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ProtectedItemOperationStatusesFromCrossTenantVaultsClientImpl(RecoveryServicesBackupManagementClientImpl client) { + this.service = RestProxy.create(ProtectedItemOperationStatusesFromCrossTenantVaultsService.class, + client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for + * RecoveryServicesBackupManagementClientProtectedItemOperationStatusesFromCrossTenantVaults to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface( + name = "RecoveryServicesBackupManagementClientProtectedItemOperationStatusesFromCrossTenantVaults") + public interface ProtectedItemOperationStatusesFromCrossTenantVaultsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupCrossTenantVaultMappings/{crossTenantVaultMappingName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/operationsStatus/{operationId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @PathParam("crossTenantVaultMappingName") String crossTenantVaultMappingName, + @PathParam("fabricName") String fabricName, @PathParam("containerName") String containerName, + @PathParam("protectedItemName") String protectedItemName, @PathParam("operationId") String operationId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupCrossTenantVaultMappings/{crossTenantVaultMappingName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/operationsStatus/{operationId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @PathParam("crossTenantVaultMappingName") String crossTenantVaultMappingName, + @PathParam("fabricName") String fabricName, @PathParam("containerName") String containerName, + @PathParam("protectedItemName") String protectedItemName, @PathParam("operationId") String operationId, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Fetches the status of a cross-tenant operation such as triggering a restore. + * The status can be in progress, completed or failed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @param operationId OperationID represents the operation whose status needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String fabricName, String containerName, String protectedItemName, + String operationId) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vaultName, crossTenantVaultMappingName, fabricName, + containerName, protectedItemName, operationId, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Fetches the status of a cross-tenant operation such as triggering a restore. + * The status can be in progress, completed or failed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @param operationId OperationID represents the operation whose status needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String fabricName, String containerName, String protectedItemName, + String operationId) { + return getWithResponseAsync(resourceGroupName, vaultName, crossTenantVaultMappingName, fabricName, + containerName, protectedItemName, operationId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Fetches the status of a cross-tenant operation such as triggering a restore. + * The status can be in progress, completed or failed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @param operationId OperationID represents the operation whose status needs to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String fabricName, String containerName, String protectedItemName, + String operationId, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, vaultName, crossTenantVaultMappingName, fabricName, containerName, protectedItemName, + operationId, accept, context); + } + + /** + * Fetches the status of a cross-tenant operation such as triggering a restore. + * The status can be in progress, completed or failed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @param operationId OperationID represents the operation whose status needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusInner get(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + String fabricName, String containerName, String protectedItemName, String operationId) { + return getWithResponse(resourceGroupName, vaultName, crossTenantVaultMappingName, fabricName, containerName, + protectedItemName, operationId, Context.NONE).getValue(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemOperationStatusesFromCrossTenantVaultsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemOperationStatusesFromCrossTenantVaultsImpl.java new file mode 100644 index 000000000000..c1f6a88f0388 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ProtectedItemOperationStatusesFromCrossTenantVaultsImpl.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectedItemOperationStatusesFromCrossTenantVaultsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationStatusInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.OperationStatus; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectedItemOperationStatusesFromCrossTenantVaults; + +public final class ProtectedItemOperationStatusesFromCrossTenantVaultsImpl + implements ProtectedItemOperationStatusesFromCrossTenantVaults { + private static final ClientLogger LOGGER + = new ClientLogger(ProtectedItemOperationStatusesFromCrossTenantVaultsImpl.class); + + private final ProtectedItemOperationStatusesFromCrossTenantVaultsClient innerClient; + + private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; + + public ProtectedItemOperationStatusesFromCrossTenantVaultsImpl( + ProtectedItemOperationStatusesFromCrossTenantVaultsClient innerClient, + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String fabricName, String containerName, String protectedItemName, + String operationId, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, vaultName, crossTenantVaultMappingName, fabricName, containerName, + protectedItemName, operationId, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new OperationStatusImpl(inner.getValue(), this.manager())); + } + + public OperationStatus get(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + String fabricName, String containerName, String protectedItemName, String operationId) { + OperationStatusInner inner = this.serviceClient() + .get(resourceGroupName, vaultName, crossTenantVaultMappingName, fabricName, containerName, + protectedItemName, operationId); + if (inner != null) { + return new OperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + private ProtectedItemOperationStatusesFromCrossTenantVaultsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryServicesBackupManagementClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryServicesBackupManagementClientImpl.java index c2b837439d50..b1b64f765d8b 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryServicesBackupManagementClientImpl.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RecoveryServicesBackupManagementClientImpl.java @@ -28,11 +28,13 @@ import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupEnginesClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupJobsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupJobsFromCrossTenantVaultsClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupOperationResultsClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupOperationStatusesClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupPoliciesClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupProtectableItemsClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupProtectedItemsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupProtectedItemsFromCrossTenantVaultsClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupProtectionContainersClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupProtectionIntentsClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupResourceEncryptionConfigsClient; @@ -43,6 +45,13 @@ import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupWorkloadItemsClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.BackupsClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.BmsPrepareDataMoveOperationResultsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.CrossTenantVaultCredentialOperationResultsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.CrossTenantVaultCredentialOperationStatusesClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.CrossTenantVaultCredentialsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.CrossTenantVaultMappingStatusClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.CrossTenantVaultMappingsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.CrossTenantVaultRecoveryPointOperationsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.CrossTenantVaultRecoveryPointsClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.DeletedProtectionContainersClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.ExportJobsOperationResultsClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.FeatureSupportsClient; @@ -51,15 +60,20 @@ import com.azure.resourcemanager.recoveryservicesbackup.fluent.ItemLevelRecoveryConnectionsClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.JobCancellationsClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.JobDetailsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.JobDetailsFromCrossTenantVaultsClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.JobOperationResultsClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.JobsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.OperationFromCrossTenantVaultsClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.OperationOperationsClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.OperationsClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.PrivateEndpointConnectionsClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.PrivateEndpointsClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectableContainersClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectedItemFromCrossTenantVaultsClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectedItemOperationResultsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectedItemOperationResultsFromCrossTenantVaultsClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectedItemOperationStatusesClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectedItemOperationStatusesFromCrossTenantVaultsClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectedItemsClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectionContainerOperationResultsClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.ProtectionContainerRefreshOperationResultsClient; @@ -74,9 +88,13 @@ import com.azure.resourcemanager.recoveryservicesbackup.fluent.ResourceGuardProxyOperationsClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.ResourceProvidersClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.RestoresClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.RestoresFromCrossTenantVaultsClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.SecurityPINsClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.TieringCostOperationStatusClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.ValidateOperationFromCrossTenantVaultsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.ValidateOperationResultFromCrossTenantVaultsClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.ValidateOperationResultsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.ValidateOperationStatusFromCrossTenantVaultsClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.ValidateOperationStatusesClient; import com.azure.resourcemanager.recoveryservicesbackup.fluent.ValidateOperationsClient; import java.io.IOException; @@ -555,6 +573,260 @@ public BackupEnginesClient getBackupEngines() { return this.backupEngines; } + /** + * The CrossTenantVaultMappingsClient object to access its operations. + */ + private final CrossTenantVaultMappingsClient crossTenantVaultMappings; + + /** + * Gets the CrossTenantVaultMappingsClient object to access its operations. + * + * @return the CrossTenantVaultMappingsClient object. + */ + public CrossTenantVaultMappingsClient getCrossTenantVaultMappings() { + return this.crossTenantVaultMappings; + } + + /** + * The CrossTenantVaultMappingStatusClient object to access its operations. + */ + private final CrossTenantVaultMappingStatusClient crossTenantVaultMappingStatus; + + /** + * Gets the CrossTenantVaultMappingStatusClient object to access its operations. + * + * @return the CrossTenantVaultMappingStatusClient object. + */ + public CrossTenantVaultMappingStatusClient getCrossTenantVaultMappingStatus() { + return this.crossTenantVaultMappingStatus; + } + + /** + * The BackupProtectedItemsFromCrossTenantVaultsClient object to access its operations. + */ + private final BackupProtectedItemsFromCrossTenantVaultsClient backupProtectedItemsFromCrossTenantVaults; + + /** + * Gets the BackupProtectedItemsFromCrossTenantVaultsClient object to access its operations. + * + * @return the BackupProtectedItemsFromCrossTenantVaultsClient object. + */ + public BackupProtectedItemsFromCrossTenantVaultsClient getBackupProtectedItemsFromCrossTenantVaults() { + return this.backupProtectedItemsFromCrossTenantVaults; + } + + /** + * The ProtectedItemFromCrossTenantVaultsClient object to access its operations. + */ + private final ProtectedItemFromCrossTenantVaultsClient protectedItemFromCrossTenantVaults; + + /** + * Gets the ProtectedItemFromCrossTenantVaultsClient object to access its operations. + * + * @return the ProtectedItemFromCrossTenantVaultsClient object. + */ + public ProtectedItemFromCrossTenantVaultsClient getProtectedItemFromCrossTenantVaults() { + return this.protectedItemFromCrossTenantVaults; + } + + /** + * The CrossTenantVaultRecoveryPointsClient object to access its operations. + */ + private final CrossTenantVaultRecoveryPointsClient crossTenantVaultRecoveryPoints; + + /** + * Gets the CrossTenantVaultRecoveryPointsClient object to access its operations. + * + * @return the CrossTenantVaultRecoveryPointsClient object. + */ + public CrossTenantVaultRecoveryPointsClient getCrossTenantVaultRecoveryPoints() { + return this.crossTenantVaultRecoveryPoints; + } + + /** + * The CrossTenantVaultRecoveryPointOperationsClient object to access its operations. + */ + private final CrossTenantVaultRecoveryPointOperationsClient crossTenantVaultRecoveryPointOperations; + + /** + * Gets the CrossTenantVaultRecoveryPointOperationsClient object to access its operations. + * + * @return the CrossTenantVaultRecoveryPointOperationsClient object. + */ + public CrossTenantVaultRecoveryPointOperationsClient getCrossTenantVaultRecoveryPointOperations() { + return this.crossTenantVaultRecoveryPointOperations; + } + + /** + * The RestoresFromCrossTenantVaultsClient object to access its operations. + */ + private final RestoresFromCrossTenantVaultsClient restoresFromCrossTenantVaults; + + /** + * Gets the RestoresFromCrossTenantVaultsClient object to access its operations. + * + * @return the RestoresFromCrossTenantVaultsClient object. + */ + public RestoresFromCrossTenantVaultsClient getRestoresFromCrossTenantVaults() { + return this.restoresFromCrossTenantVaults; + } + + /** + * The ProtectedItemOperationResultsFromCrossTenantVaultsClient object to access its operations. + */ + private final ProtectedItemOperationResultsFromCrossTenantVaultsClient protectedItemOperationResultsFromCrossTenantVaults; + + /** + * Gets the ProtectedItemOperationResultsFromCrossTenantVaultsClient object to access its operations. + * + * @return the ProtectedItemOperationResultsFromCrossTenantVaultsClient object. + */ + public ProtectedItemOperationResultsFromCrossTenantVaultsClient + getProtectedItemOperationResultsFromCrossTenantVaults() { + return this.protectedItemOperationResultsFromCrossTenantVaults; + } + + /** + * The ProtectedItemOperationStatusesFromCrossTenantVaultsClient object to access its operations. + */ + private final ProtectedItemOperationStatusesFromCrossTenantVaultsClient protectedItemOperationStatusesFromCrossTenantVaults; + + /** + * Gets the ProtectedItemOperationStatusesFromCrossTenantVaultsClient object to access its operations. + * + * @return the ProtectedItemOperationStatusesFromCrossTenantVaultsClient object. + */ + public ProtectedItemOperationStatusesFromCrossTenantVaultsClient + getProtectedItemOperationStatusesFromCrossTenantVaults() { + return this.protectedItemOperationStatusesFromCrossTenantVaults; + } + + /** + * The BackupJobsFromCrossTenantVaultsClient object to access its operations. + */ + private final BackupJobsFromCrossTenantVaultsClient backupJobsFromCrossTenantVaults; + + /** + * Gets the BackupJobsFromCrossTenantVaultsClient object to access its operations. + * + * @return the BackupJobsFromCrossTenantVaultsClient object. + */ + public BackupJobsFromCrossTenantVaultsClient getBackupJobsFromCrossTenantVaults() { + return this.backupJobsFromCrossTenantVaults; + } + + /** + * The JobDetailsFromCrossTenantVaultsClient object to access its operations. + */ + private final JobDetailsFromCrossTenantVaultsClient jobDetailsFromCrossTenantVaults; + + /** + * Gets the JobDetailsFromCrossTenantVaultsClient object to access its operations. + * + * @return the JobDetailsFromCrossTenantVaultsClient object. + */ + public JobDetailsFromCrossTenantVaultsClient getJobDetailsFromCrossTenantVaults() { + return this.jobDetailsFromCrossTenantVaults; + } + + /** + * The OperationFromCrossTenantVaultsClient object to access its operations. + */ + private final OperationFromCrossTenantVaultsClient operationFromCrossTenantVaults; + + /** + * Gets the OperationFromCrossTenantVaultsClient object to access its operations. + * + * @return the OperationFromCrossTenantVaultsClient object. + */ + public OperationFromCrossTenantVaultsClient getOperationFromCrossTenantVaults() { + return this.operationFromCrossTenantVaults; + } + + /** + * The ValidateOperationFromCrossTenantVaultsClient object to access its operations. + */ + private final ValidateOperationFromCrossTenantVaultsClient validateOperationFromCrossTenantVaults; + + /** + * Gets the ValidateOperationFromCrossTenantVaultsClient object to access its operations. + * + * @return the ValidateOperationFromCrossTenantVaultsClient object. + */ + public ValidateOperationFromCrossTenantVaultsClient getValidateOperationFromCrossTenantVaults() { + return this.validateOperationFromCrossTenantVaults; + } + + /** + * The ValidateOperationResultFromCrossTenantVaultsClient object to access its operations. + */ + private final ValidateOperationResultFromCrossTenantVaultsClient validateOperationResultFromCrossTenantVaults; + + /** + * Gets the ValidateOperationResultFromCrossTenantVaultsClient object to access its operations. + * + * @return the ValidateOperationResultFromCrossTenantVaultsClient object. + */ + public ValidateOperationResultFromCrossTenantVaultsClient getValidateOperationResultFromCrossTenantVaults() { + return this.validateOperationResultFromCrossTenantVaults; + } + + /** + * The ValidateOperationStatusFromCrossTenantVaultsClient object to access its operations. + */ + private final ValidateOperationStatusFromCrossTenantVaultsClient validateOperationStatusFromCrossTenantVaults; + + /** + * Gets the ValidateOperationStatusFromCrossTenantVaultsClient object to access its operations. + * + * @return the ValidateOperationStatusFromCrossTenantVaultsClient object. + */ + public ValidateOperationStatusFromCrossTenantVaultsClient getValidateOperationStatusFromCrossTenantVaults() { + return this.validateOperationStatusFromCrossTenantVaults; + } + + /** + * The CrossTenantVaultCredentialsClient object to access its operations. + */ + private final CrossTenantVaultCredentialsClient crossTenantVaultCredentials; + + /** + * Gets the CrossTenantVaultCredentialsClient object to access its operations. + * + * @return the CrossTenantVaultCredentialsClient object. + */ + public CrossTenantVaultCredentialsClient getCrossTenantVaultCredentials() { + return this.crossTenantVaultCredentials; + } + + /** + * The CrossTenantVaultCredentialOperationResultsClient object to access its operations. + */ + private final CrossTenantVaultCredentialOperationResultsClient crossTenantVaultCredentialOperationResults; + + /** + * Gets the CrossTenantVaultCredentialOperationResultsClient object to access its operations. + * + * @return the CrossTenantVaultCredentialOperationResultsClient object. + */ + public CrossTenantVaultCredentialOperationResultsClient getCrossTenantVaultCredentialOperationResults() { + return this.crossTenantVaultCredentialOperationResults; + } + + /** + * The CrossTenantVaultCredentialOperationStatusesClient object to access its operations. + */ + private final CrossTenantVaultCredentialOperationStatusesClient crossTenantVaultCredentialOperationStatuses; + + /** + * Gets the CrossTenantVaultCredentialOperationStatusesClient object to access its operations. + * + * @return the CrossTenantVaultCredentialOperationStatusesClient object. + */ + public CrossTenantVaultCredentialOperationStatusesClient getCrossTenantVaultCredentialOperationStatuses() { + return this.crossTenantVaultCredentialOperationStatuses; + } + /** * The BackupStatusClient object to access its operations. */ @@ -922,7 +1194,7 @@ public OperationOperationsClient getOperationOperations() { this.defaultPollInterval = defaultPollInterval; this.endpoint = endpoint; this.subscriptionId = subscriptionId; - this.apiVersion = "2026-01-31-preview"; + this.apiVersion = "2026-05-31-preview"; this.resourceProviders = new ResourceProvidersClientImpl(this); this.operations = new OperationsClientImpl(this); this.backupResourceStorageConfigsNonCrrs = new BackupResourceStorageConfigsNonCrrsClientImpl(this); @@ -950,6 +1222,30 @@ public OperationOperationsClient getOperationOperations() { this.jobOperationResults = new JobOperationResultsClientImpl(this); this.exportJobsOperationResults = new ExportJobsOperationResultsClientImpl(this); this.backupEngines = new BackupEnginesClientImpl(this); + this.crossTenantVaultMappings = new CrossTenantVaultMappingsClientImpl(this); + this.crossTenantVaultMappingStatus = new CrossTenantVaultMappingStatusClientImpl(this); + this.backupProtectedItemsFromCrossTenantVaults = new BackupProtectedItemsFromCrossTenantVaultsClientImpl(this); + this.protectedItemFromCrossTenantVaults = new ProtectedItemFromCrossTenantVaultsClientImpl(this); + this.crossTenantVaultRecoveryPoints = new CrossTenantVaultRecoveryPointsClientImpl(this); + this.crossTenantVaultRecoveryPointOperations = new CrossTenantVaultRecoveryPointOperationsClientImpl(this); + this.restoresFromCrossTenantVaults = new RestoresFromCrossTenantVaultsClientImpl(this); + this.protectedItemOperationResultsFromCrossTenantVaults + = new ProtectedItemOperationResultsFromCrossTenantVaultsClientImpl(this); + this.protectedItemOperationStatusesFromCrossTenantVaults + = new ProtectedItemOperationStatusesFromCrossTenantVaultsClientImpl(this); + this.backupJobsFromCrossTenantVaults = new BackupJobsFromCrossTenantVaultsClientImpl(this); + this.jobDetailsFromCrossTenantVaults = new JobDetailsFromCrossTenantVaultsClientImpl(this); + this.operationFromCrossTenantVaults = new OperationFromCrossTenantVaultsClientImpl(this); + this.validateOperationFromCrossTenantVaults = new ValidateOperationFromCrossTenantVaultsClientImpl(this); + this.validateOperationResultFromCrossTenantVaults + = new ValidateOperationResultFromCrossTenantVaultsClientImpl(this); + this.validateOperationStatusFromCrossTenantVaults + = new ValidateOperationStatusFromCrossTenantVaultsClientImpl(this); + this.crossTenantVaultCredentials = new CrossTenantVaultCredentialsClientImpl(this); + this.crossTenantVaultCredentialOperationResults + = new CrossTenantVaultCredentialOperationResultsClientImpl(this); + this.crossTenantVaultCredentialOperationStatuses + = new CrossTenantVaultCredentialOperationStatusesClientImpl(this); this.backupStatus = new BackupStatusClientImpl(this); this.featureSupports = new FeatureSupportsClientImpl(this); this.backupProtectionIntents = new BackupProtectionIntentsClientImpl(this); diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RestoresFromCrossTenantVaultsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RestoresFromCrossTenantVaultsClientImpl.java new file mode 100644 index 000000000000..1bdc34ccf995 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RestoresFromCrossTenantVaultsClientImpl.java @@ -0,0 +1,340 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.RestoresFromCrossTenantVaultsClient; +import com.azure.resourcemanager.recoveryservicesbackup.models.RestoreRequestResource; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in RestoresFromCrossTenantVaultsClient. + */ +public final class RestoresFromCrossTenantVaultsClientImpl implements RestoresFromCrossTenantVaultsClient { + /** + * The proxy service used to perform REST calls. + */ + private final RestoresFromCrossTenantVaultsService service; + + /** + * The service client containing this operation class. + */ + private final RecoveryServicesBackupManagementClientImpl client; + + /** + * Initializes an instance of RestoresFromCrossTenantVaultsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RestoresFromCrossTenantVaultsClientImpl(RecoveryServicesBackupManagementClientImpl client) { + this.service = RestProxy.create(RestoresFromCrossTenantVaultsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for RecoveryServicesBackupManagementClientRestoresFromCrossTenantVaults + * to be used by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RecoveryServicesBackupManagementClientRestoresFromCrossTenantVaults") + public interface RestoresFromCrossTenantVaultsService { + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupCrossTenantVaultMappings/{crossTenantVaultMappingName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/restore") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> trigger(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @PathParam("crossTenantVaultMappingName") String crossTenantVaultMappingName, + @PathParam("fabricName") String fabricName, @PathParam("containerName") String containerName, + @PathParam("protectedItemName") String protectedItemName, + @PathParam("recoveryPointId") String recoveryPointId, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") RestoreRequestResource body, Context context); + + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupCrossTenantVaultMappings/{crossTenantVaultMappingName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/restore") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response triggerSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @PathParam("crossTenantVaultMappingName") String crossTenantVaultMappingName, + @PathParam("fabricName") String fabricName, @PathParam("containerName") String containerName, + @PathParam("protectedItemName") String protectedItemName, + @PathParam("recoveryPointId") String recoveryPointId, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") RestoreRequestResource body, Context context); + } + + /** + * Restores the specified backed up data from a source vault in a different tenant. This is an asynchronous + * operation. + * To know the status of this API call, use GetProtectedItemOperationResult API. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> triggerWithResponseAsync(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String fabricName, String containerName, String protectedItemName, + String recoveryPointId, RestoreRequestResource body) { + final String contentType = "application/json"; + return FluxUtil + .withContext(context -> service.trigger(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vaultName, crossTenantVaultMappingName, fabricName, + containerName, protectedItemName, recoveryPointId, contentType, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Restores the specified backed up data from a source vault in a different tenant. This is an asynchronous + * operation. + * To know the status of this API call, use GetProtectedItemOperationResult API. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response triggerWithResponse(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String fabricName, String containerName, String protectedItemName, + String recoveryPointId, RestoreRequestResource body) { + final String contentType = "application/json"; + return service.triggerSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vaultName, crossTenantVaultMappingName, fabricName, + containerName, protectedItemName, recoveryPointId, contentType, body, Context.NONE); + } + + /** + * Restores the specified backed up data from a source vault in a different tenant. This is an asynchronous + * operation. + * To know the status of this API call, use GetProtectedItemOperationResult API. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response triggerWithResponse(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String fabricName, String containerName, String protectedItemName, + String recoveryPointId, RestoreRequestResource body, Context context) { + final String contentType = "application/json"; + return service.triggerSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vaultName, crossTenantVaultMappingName, fabricName, + containerName, protectedItemName, recoveryPointId, contentType, body, context); + } + + /** + * Restores the specified backed up data from a source vault in a different tenant. This is an asynchronous + * operation. + * To know the status of this API call, use GetProtectedItemOperationResult API. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginTriggerAsync(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String fabricName, String containerName, String protectedItemName, + String recoveryPointId, RestoreRequestResource body) { + Mono>> mono = triggerWithResponseAsync(resourceGroupName, vaultName, + crossTenantVaultMappingName, fabricName, containerName, protectedItemName, recoveryPointId, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Restores the specified backed up data from a source vault in a different tenant. This is an asynchronous + * operation. + * To know the status of this API call, use GetProtectedItemOperationResult API. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginTrigger(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String fabricName, String containerName, String protectedItemName, + String recoveryPointId, RestoreRequestResource body) { + Response response = triggerWithResponse(resourceGroupName, vaultName, crossTenantVaultMappingName, + fabricName, containerName, protectedItemName, recoveryPointId, body); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Restores the specified backed up data from a source vault in a different tenant. This is an asynchronous + * operation. + * To know the status of this API call, use GetProtectedItemOperationResult API. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginTrigger(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String fabricName, String containerName, String protectedItemName, + String recoveryPointId, RestoreRequestResource body, Context context) { + Response response = triggerWithResponse(resourceGroupName, vaultName, crossTenantVaultMappingName, + fabricName, containerName, protectedItemName, recoveryPointId, body, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Restores the specified backed up data from a source vault in a different tenant. This is an asynchronous + * operation. + * To know the status of this API call, use GetProtectedItemOperationResult API. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono triggerAsync(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + String fabricName, String containerName, String protectedItemName, String recoveryPointId, + RestoreRequestResource body) { + return beginTriggerAsync(resourceGroupName, vaultName, crossTenantVaultMappingName, fabricName, containerName, + protectedItemName, recoveryPointId, body).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Restores the specified backed up data from a source vault in a different tenant. This is an asynchronous + * operation. + * To know the status of this API call, use GetProtectedItemOperationResult API. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void trigger(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + String fabricName, String containerName, String protectedItemName, String recoveryPointId, + RestoreRequestResource body) { + beginTrigger(resourceGroupName, vaultName, crossTenantVaultMappingName, fabricName, containerName, + protectedItemName, recoveryPointId, body).getFinalResult(); + } + + /** + * Restores the specified backed up data from a source vault in a different tenant. This is an asynchronous + * operation. + * To know the status of this API call, use GetProtectedItemOperationResult API. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void trigger(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + String fabricName, String containerName, String protectedItemName, String recoveryPointId, + RestoreRequestResource body, Context context) { + beginTrigger(resourceGroupName, vaultName, crossTenantVaultMappingName, fabricName, containerName, + protectedItemName, recoveryPointId, body, context).getFinalResult(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RestoresFromCrossTenantVaultsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RestoresFromCrossTenantVaultsImpl.java new file mode 100644 index 000000000000..a8ee9130f251 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/RestoresFromCrossTenantVaultsImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.RestoresFromCrossTenantVaultsClient; +import com.azure.resourcemanager.recoveryservicesbackup.models.RestoreRequestResource; +import com.azure.resourcemanager.recoveryservicesbackup.models.RestoresFromCrossTenantVaults; + +public final class RestoresFromCrossTenantVaultsImpl implements RestoresFromCrossTenantVaults { + private static final ClientLogger LOGGER = new ClientLogger(RestoresFromCrossTenantVaultsImpl.class); + + private final RestoresFromCrossTenantVaultsClient innerClient; + + private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; + + public RestoresFromCrossTenantVaultsImpl(RestoresFromCrossTenantVaultsClient innerClient, + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void trigger(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + String fabricName, String containerName, String protectedItemName, String recoveryPointId, + RestoreRequestResource body) { + this.serviceClient() + .trigger(resourceGroupName, vaultName, crossTenantVaultMappingName, fabricName, containerName, + protectedItemName, recoveryPointId, body); + } + + public void trigger(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + String fabricName, String containerName, String protectedItemName, String recoveryPointId, + RestoreRequestResource body, Context context) { + this.serviceClient() + .trigger(resourceGroupName, vaultName, crossTenantVaultMappingName, fabricName, containerName, + protectedItemName, recoveryPointId, body, context); + } + + private RestoresFromCrossTenantVaultsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ValidateOperationFromCrossTenantVaultsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ValidateOperationFromCrossTenantVaultsClientImpl.java new file mode 100644 index 000000000000..f64ab9e328e3 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ValidateOperationFromCrossTenantVaultsClientImpl.java @@ -0,0 +1,292 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.ValidateOperationFromCrossTenantVaultsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ValidateOperationsResponseInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperationRequestResource; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * ValidateOperationFromCrossTenantVaultsClient. + */ +public final class ValidateOperationFromCrossTenantVaultsClientImpl + implements ValidateOperationFromCrossTenantVaultsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ValidateOperationFromCrossTenantVaultsService service; + + /** + * The service client containing this operation class. + */ + private final RecoveryServicesBackupManagementClientImpl client; + + /** + * Initializes an instance of ValidateOperationFromCrossTenantVaultsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ValidateOperationFromCrossTenantVaultsClientImpl(RecoveryServicesBackupManagementClientImpl client) { + this.service = RestProxy.create(ValidateOperationFromCrossTenantVaultsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for + * RecoveryServicesBackupManagementClientValidateOperationFromCrossTenantVaults to be used by the proxy service to + * perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RecoveryServicesBackupManagementClientValidateOperationFromCrossTenantVaults") + public interface ValidateOperationFromCrossTenantVaultsService { + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupCrossTenantVaultMappings/{crossTenantVaultMappingName}/backupTriggerValidateOperation") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> trigger(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @PathParam("crossTenantVaultMappingName") String crossTenantVaultMappingName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ValidateOperationRequestResource body, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupCrossTenantVaultMappings/{crossTenantVaultMappingName}/backupTriggerValidateOperation") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response triggerSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @PathParam("crossTenantVaultMappingName") String crossTenantVaultMappingName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ValidateOperationRequestResource body, Context context); + } + + /** + * Triggers a validate operation for cross-tenant restore scenarios. + * This is an asynchronous operation that performs validation checks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> triggerWithResponseAsync(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, ValidateOperationRequestResource body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.trigger(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vaultName, crossTenantVaultMappingName, contentType, + accept, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Triggers a validate operation for cross-tenant restore scenarios. + * This is an asynchronous operation that performs validation checks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response triggerWithResponse(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, ValidateOperationRequestResource body) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.triggerSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vaultName, crossTenantVaultMappingName, contentType, + accept, body, Context.NONE); + } + + /** + * Triggers a validate operation for cross-tenant restore scenarios. + * This is an asynchronous operation that performs validation checks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response triggerWithResponse(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, ValidateOperationRequestResource body, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.triggerSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vaultName, crossTenantVaultMappingName, contentType, + accept, body, context); + } + + /** + * Triggers a validate operation for cross-tenant restore scenarios. + * This is an asynchronous operation that performs validation checks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ValidateOperationsResponseInner> beginTriggerAsync( + String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + ValidateOperationRequestResource body) { + Mono>> mono + = triggerWithResponseAsync(resourceGroupName, vaultName, crossTenantVaultMappingName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ValidateOperationsResponseInner.class, ValidateOperationsResponseInner.class, + this.client.getContext()); + } + + /** + * Triggers a validate operation for cross-tenant restore scenarios. + * This is an asynchronous operation that performs validation checks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ValidateOperationsResponseInner> beginTrigger( + String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + ValidateOperationRequestResource body) { + Response response + = triggerWithResponse(resourceGroupName, vaultName, crossTenantVaultMappingName, body); + return this.client.getLroResult(response, + ValidateOperationsResponseInner.class, ValidateOperationsResponseInner.class, Context.NONE); + } + + /** + * Triggers a validate operation for cross-tenant restore scenarios. + * This is an asynchronous operation that performs validation checks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ValidateOperationsResponseInner> beginTrigger( + String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + ValidateOperationRequestResource body, Context context) { + Response response + = triggerWithResponse(resourceGroupName, vaultName, crossTenantVaultMappingName, body, context); + return this.client.getLroResult(response, + ValidateOperationsResponseInner.class, ValidateOperationsResponseInner.class, context); + } + + /** + * Triggers a validate operation for cross-tenant restore scenarios. + * This is an asynchronous operation that performs validation checks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono triggerAsync(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, ValidateOperationRequestResource body) { + return beginTriggerAsync(resourceGroupName, vaultName, crossTenantVaultMappingName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Triggers a validate operation for cross-tenant restore scenarios. + * This is an asynchronous operation that performs validation checks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ValidateOperationsResponseInner trigger(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, ValidateOperationRequestResource body) { + return beginTrigger(resourceGroupName, vaultName, crossTenantVaultMappingName, body).getFinalResult(); + } + + /** + * Triggers a validate operation for cross-tenant restore scenarios. + * This is an asynchronous operation that performs validation checks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ValidateOperationsResponseInner trigger(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, ValidateOperationRequestResource body, Context context) { + return beginTrigger(resourceGroupName, vaultName, crossTenantVaultMappingName, body, context).getFinalResult(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ValidateOperationFromCrossTenantVaultsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ValidateOperationFromCrossTenantVaultsImpl.java new file mode 100644 index 000000000000..1ec8253606f3 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ValidateOperationFromCrossTenantVaultsImpl.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.ValidateOperationFromCrossTenantVaultsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ValidateOperationsResponseInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperationFromCrossTenantVaults; +import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperationRequestResource; +import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperationsResponse; + +public final class ValidateOperationFromCrossTenantVaultsImpl implements ValidateOperationFromCrossTenantVaults { + private static final ClientLogger LOGGER = new ClientLogger(ValidateOperationFromCrossTenantVaultsImpl.class); + + private final ValidateOperationFromCrossTenantVaultsClient innerClient; + + private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; + + public ValidateOperationFromCrossTenantVaultsImpl(ValidateOperationFromCrossTenantVaultsClient innerClient, + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ValidateOperationsResponse trigger(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, ValidateOperationRequestResource body) { + ValidateOperationsResponseInner inner + = this.serviceClient().trigger(resourceGroupName, vaultName, crossTenantVaultMappingName, body); + if (inner != null) { + return new ValidateOperationsResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public ValidateOperationsResponse trigger(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, ValidateOperationRequestResource body, Context context) { + ValidateOperationsResponseInner inner + = this.serviceClient().trigger(resourceGroupName, vaultName, crossTenantVaultMappingName, body, context); + if (inner != null) { + return new ValidateOperationsResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + private ValidateOperationFromCrossTenantVaultsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ValidateOperationResultFromCrossTenantVaultsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ValidateOperationResultFromCrossTenantVaultsClientImpl.java new file mode 100644 index 000000000000..4b90fd110ab3 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ValidateOperationResultFromCrossTenantVaultsClientImpl.java @@ -0,0 +1,321 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.ValidateOperationResultFromCrossTenantVaultsClient; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * ValidateOperationResultFromCrossTenantVaultsClient. + */ +public final class ValidateOperationResultFromCrossTenantVaultsClientImpl + implements ValidateOperationResultFromCrossTenantVaultsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ValidateOperationResultFromCrossTenantVaultsService service; + + /** + * The service client containing this operation class. + */ + private final RecoveryServicesBackupManagementClientImpl client; + + /** + * Initializes an instance of ValidateOperationResultFromCrossTenantVaultsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ValidateOperationResultFromCrossTenantVaultsClientImpl(RecoveryServicesBackupManagementClientImpl client) { + this.service = RestProxy.create(ValidateOperationResultFromCrossTenantVaultsService.class, + client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for + * RecoveryServicesBackupManagementClientValidateOperationResultFromCrossTenantVaults to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RecoveryServicesBackupManagementClientValidateOperationResultFromCrossTenantVaults") + public interface ValidateOperationResultFromCrossTenantVaultsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupCrossTenantVaultMappings/{crossTenantVaultMappingName}/backupValidateOperationResults/{operationId}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @PathParam("crossTenantVaultMappingName") String crossTenantVaultMappingName, + @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupCrossTenantVaultMappings/{crossTenantVaultMappingName}/backupValidateOperationResults/{operationId}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @PathParam("crossTenantVaultMappingName") String crossTenantVaultMappingName, + @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets the result of a specific validate operation for cross-tenant restore scenarios. + * While the operation is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. When the operation completes it returns + * either 200 OK with the final ValidateOperationsResponse body, or 204 No Content if + * there is no body to return. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param operationId OperationID which represents the operation whose result needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a specific validate operation for cross-tenant restore scenarios. + * While the operation is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> getWithResponseAsync(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String operationId) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vaultName, crossTenantVaultMappingName, operationId, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the result of a specific validate operation for cross-tenant restore scenarios. + * While the operation is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. When the operation completes it returns + * either 200 OK with the final ValidateOperationsResponse body, or 204 No Content if + * there is no body to return. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param operationId OperationID which represents the operation whose result needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a specific validate operation for cross-tenant restore scenarios. + * While the operation is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response getWithResponse(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String operationId) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, vaultName, crossTenantVaultMappingName, operationId, accept, Context.NONE); + } + + /** + * Gets the result of a specific validate operation for cross-tenant restore scenarios. + * While the operation is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. When the operation completes it returns + * either 200 OK with the final ValidateOperationsResponse body, or 204 No Content if + * there is no body to return. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param operationId OperationID which represents the operation whose result needs to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a specific validate operation for cross-tenant restore scenarios. + * While the operation is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response getWithResponse(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String operationId, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, vaultName, crossTenantVaultMappingName, operationId, accept, context); + } + + /** + * Gets the result of a specific validate operation for cross-tenant restore scenarios. + * While the operation is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. When the operation completes it returns + * either 200 OK with the final ValidateOperationsResponse body, or 204 No Content if + * there is no body to return. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param operationId OperationID which represents the operation whose result needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the result of a specific validate operation for cross-tenant + * restore scenarios. + * While the operation is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginGetAsync(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String operationId) { + Mono>> mono + = getWithResponseAsync(resourceGroupName, vaultName, crossTenantVaultMappingName, operationId); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Gets the result of a specific validate operation for cross-tenant restore scenarios. + * While the operation is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. When the operation completes it returns + * either 200 OK with the final ValidateOperationsResponse body, or 204 No Content if + * there is no body to return. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param operationId OperationID which represents the operation whose result needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the result of a specific validate operation for cross-tenant + * restore scenarios. + * While the operation is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginGet(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String operationId) { + Response response + = getWithResponse(resourceGroupName, vaultName, crossTenantVaultMappingName, operationId); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Gets the result of a specific validate operation for cross-tenant restore scenarios. + * While the operation is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. When the operation completes it returns + * either 200 OK with the final ValidateOperationsResponse body, or 204 No Content if + * there is no body to return. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param operationId OperationID which represents the operation whose result needs to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the result of a specific validate operation for cross-tenant + * restore scenarios. + * While the operation is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginGet(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String operationId, Context context) { + Response response + = getWithResponse(resourceGroupName, vaultName, crossTenantVaultMappingName, operationId, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Gets the result of a specific validate operation for cross-tenant restore scenarios. + * While the operation is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. When the operation completes it returns + * either 200 OK with the final ValidateOperationsResponse body, or 204 No Content if + * there is no body to return. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param operationId OperationID which represents the operation whose result needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of a specific validate operation for cross-tenant restore scenarios. + * While the operation is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + String operationId) { + return beginGetAsync(resourceGroupName, vaultName, crossTenantVaultMappingName, operationId).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Gets the result of a specific validate operation for cross-tenant restore scenarios. + * While the operation is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. When the operation completes it returns + * either 200 OK with the final ValidateOperationsResponse body, or 204 No Content if + * there is no body to return. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param operationId OperationID which represents the operation whose result needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void get(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + String operationId) { + beginGet(resourceGroupName, vaultName, crossTenantVaultMappingName, operationId).getFinalResult(); + } + + /** + * Gets the result of a specific validate operation for cross-tenant restore scenarios. + * While the operation is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. When the operation completes it returns + * either 200 OK with the final ValidateOperationsResponse body, or 204 No Content if + * there is no body to return. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param operationId OperationID which represents the operation whose result needs to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void get(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, String operationId, + Context context) { + beginGet(resourceGroupName, vaultName, crossTenantVaultMappingName, operationId, context).getFinalResult(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ValidateOperationResultFromCrossTenantVaultsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ValidateOperationResultFromCrossTenantVaultsImpl.java new file mode 100644 index 000000000000..8327a8af27aa --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ValidateOperationResultFromCrossTenantVaultsImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.ValidateOperationResultFromCrossTenantVaultsClient; +import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperationResultFromCrossTenantVaults; + +public final class ValidateOperationResultFromCrossTenantVaultsImpl + implements ValidateOperationResultFromCrossTenantVaults { + private static final ClientLogger LOGGER = new ClientLogger(ValidateOperationResultFromCrossTenantVaultsImpl.class); + + private final ValidateOperationResultFromCrossTenantVaultsClient innerClient; + + private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; + + public ValidateOperationResultFromCrossTenantVaultsImpl( + ValidateOperationResultFromCrossTenantVaultsClient innerClient, + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public void get(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + String operationId) { + this.serviceClient().get(resourceGroupName, vaultName, crossTenantVaultMappingName, operationId); + } + + public void get(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, String operationId, + Context context) { + this.serviceClient().get(resourceGroupName, vaultName, crossTenantVaultMappingName, operationId, context); + } + + private ValidateOperationResultFromCrossTenantVaultsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ValidateOperationStatusFromCrossTenantVaultsClientImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ValidateOperationStatusFromCrossTenantVaultsClientImpl.java new file mode 100644 index 000000000000..65be7e70601d --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ValidateOperationStatusFromCrossTenantVaultsClientImpl.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.ValidateOperationStatusFromCrossTenantVaultsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationStatusInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * ValidateOperationStatusFromCrossTenantVaultsClient. + */ +public final class ValidateOperationStatusFromCrossTenantVaultsClientImpl + implements ValidateOperationStatusFromCrossTenantVaultsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ValidateOperationStatusFromCrossTenantVaultsService service; + + /** + * The service client containing this operation class. + */ + private final RecoveryServicesBackupManagementClientImpl client; + + /** + * Initializes an instance of ValidateOperationStatusFromCrossTenantVaultsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ValidateOperationStatusFromCrossTenantVaultsClientImpl(RecoveryServicesBackupManagementClientImpl client) { + this.service = RestProxy.create(ValidateOperationStatusFromCrossTenantVaultsService.class, + client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for + * RecoveryServicesBackupManagementClientValidateOperationStatusFromCrossTenantVaults to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "RecoveryServicesBackupManagementClientValidateOperationStatusFromCrossTenantVaults") + public interface ValidateOperationStatusFromCrossTenantVaultsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupCrossTenantVaultMappings/{crossTenantVaultMappingName}/backupValidateOperationsStatuses/{operationId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @PathParam("crossTenantVaultMappingName") String crossTenantVaultMappingName, + @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupCrossTenantVaultMappings/{crossTenantVaultMappingName}/backupValidateOperationsStatuses/{operationId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("vaultName") String vaultName, + @PathParam("crossTenantVaultMappingName") String crossTenantVaultMappingName, + @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets the status of a validate operation for cross-tenant restore scenarios. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param operationId OperationID represents the operation whose status needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a validate operation for cross-tenant restore scenarios along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String operationId) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, vaultName, crossTenantVaultMappingName, operationId, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the status of a validate operation for cross-tenant restore scenarios. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param operationId OperationID represents the operation whose status needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a validate operation for cross-tenant restore scenarios on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String operationId) { + return getWithResponseAsync(resourceGroupName, vaultName, crossTenantVaultMappingName, operationId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the status of a validate operation for cross-tenant restore scenarios. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param operationId OperationID represents the operation whose status needs to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a validate operation for cross-tenant restore scenarios along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String operationId, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, vaultName, crossTenantVaultMappingName, operationId, accept, context); + } + + /** + * Gets the status of a validate operation for cross-tenant restore scenarios. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param operationId OperationID represents the operation whose status needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a validate operation for cross-tenant restore scenarios. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusInner get(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + String operationId) { + return getWithResponse(resourceGroupName, vaultName, crossTenantVaultMappingName, operationId, Context.NONE) + .getValue(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ValidateOperationStatusFromCrossTenantVaultsImpl.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ValidateOperationStatusFromCrossTenantVaultsImpl.java new file mode 100644 index 000000000000..86e8d6d1e162 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/ValidateOperationStatusFromCrossTenantVaultsImpl.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.ValidateOperationStatusFromCrossTenantVaultsClient; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.OperationStatusInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.OperationStatus; +import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperationStatusFromCrossTenantVaults; + +public final class ValidateOperationStatusFromCrossTenantVaultsImpl + implements ValidateOperationStatusFromCrossTenantVaults { + private static final ClientLogger LOGGER = new ClientLogger(ValidateOperationStatusFromCrossTenantVaultsImpl.class); + + private final ValidateOperationStatusFromCrossTenantVaultsClient innerClient; + + private final com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager; + + public ValidateOperationStatusFromCrossTenantVaultsImpl( + ValidateOperationStatusFromCrossTenantVaultsClient innerClient, + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String operationId, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, vaultName, crossTenantVaultMappingName, operationId, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new OperationStatusImpl(inner.getValue(), this.manager())); + } + + public OperationStatus get(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + String operationId) { + OperationStatusInner inner + = this.serviceClient().get(resourceGroupName, vaultName, crossTenantVaultMappingName, operationId); + if (inner != null) { + return new OperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + private ValidateOperationStatusFromCrossTenantVaultsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/CrossTenantJobResourceList.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/CrossTenantJobResourceList.java new file mode 100644 index 000000000000..b5c3f1a78772 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/CrossTenantJobResourceList.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.JobResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * List of jobs for cross-tenant restore operations. + */ +@Immutable +public final class CrossTenantJobResourceList implements JsonSerializable { + /* + * List of resources. + */ + private List value; + + /* + * The uri to fetch the next page of resources. + */ + private String nextLink; + + /** + * Creates an instance of CrossTenantJobResourceList class. + */ + private CrossTenantJobResourceList() { + } + + /** + * Get the value property: List of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The uri to fetch the next page of resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CrossTenantJobResourceList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CrossTenantJobResourceList if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CrossTenantJobResourceList. + */ + public static CrossTenantJobResourceList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CrossTenantJobResourceList deserializedCrossTenantJobResourceList = new CrossTenantJobResourceList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> JobResourceInner.fromJson(reader1)); + deserializedCrossTenantJobResourceList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedCrossTenantJobResourceList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCrossTenantJobResourceList; + }); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/CrossTenantProtectedItemResourceList.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/CrossTenantProtectedItemResourceList.java new file mode 100644 index 000000000000..fa25c0f5986c --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/CrossTenantProtectedItemResourceList.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ProtectedItemResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * List of protected items for cross-tenant restore operations. + */ +@Immutable +public final class CrossTenantProtectedItemResourceList + implements JsonSerializable { + /* + * List of resources. + */ + private List value; + + /* + * The uri to fetch the next page of resources. + */ + private String nextLink; + + /** + * Creates an instance of CrossTenantProtectedItemResourceList class. + */ + private CrossTenantProtectedItemResourceList() { + } + + /** + * Get the value property: List of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The uri to fetch the next page of resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CrossTenantProtectedItemResourceList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CrossTenantProtectedItemResourceList if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CrossTenantProtectedItemResourceList. + */ + public static CrossTenantProtectedItemResourceList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CrossTenantProtectedItemResourceList deserializedCrossTenantProtectedItemResourceList + = new CrossTenantProtectedItemResourceList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ProtectedItemResourceInner.fromJson(reader1)); + deserializedCrossTenantProtectedItemResourceList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedCrossTenantProtectedItemResourceList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCrossTenantProtectedItemResourceList; + }); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/CrossTenantRecoveryPointResourceList.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/CrossTenantRecoveryPointResourceList.java new file mode 100644 index 000000000000..ef349affa4c1 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/CrossTenantRecoveryPointResourceList.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.RecoveryPointResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * List of recovery points for cross-tenant restore operations. + */ +@Immutable +public final class CrossTenantRecoveryPointResourceList + implements JsonSerializable { + /* + * List of resources. + */ + private List value; + + /* + * The uri to fetch the next page of resources. + */ + private String nextLink; + + /** + * Creates an instance of CrossTenantRecoveryPointResourceList class. + */ + private CrossTenantRecoveryPointResourceList() { + } + + /** + * Get the value property: List of resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The uri to fetch the next page of resources. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CrossTenantRecoveryPointResourceList from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CrossTenantRecoveryPointResourceList if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CrossTenantRecoveryPointResourceList. + */ + public static CrossTenantRecoveryPointResourceList fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CrossTenantRecoveryPointResourceList deserializedCrossTenantRecoveryPointResourceList + = new CrossTenantRecoveryPointResourceList(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> RecoveryPointResourceInner.fromJson(reader1)); + deserializedCrossTenantRecoveryPointResourceList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedCrossTenantRecoveryPointResourceList.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCrossTenantRecoveryPointResourceList; + }); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/CrossTenantVaultMappingListResult.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/CrossTenantVaultMappingListResult.java new file mode 100644 index 000000000000..8a81baf28520 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/implementation/models/CrossTenantVaultMappingListResult.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.CrossTenantVaultMappingInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a CrossTenantVaultMapping list operation. + */ +@Immutable +public final class CrossTenantVaultMappingListResult implements JsonSerializable { + /* + * The CrossTenantVaultMapping items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of CrossTenantVaultMappingListResult class. + */ + private CrossTenantVaultMappingListResult() { + } + + /** + * Get the value property: The CrossTenantVaultMapping items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CrossTenantVaultMappingListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CrossTenantVaultMappingListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CrossTenantVaultMappingListResult. + */ + public static CrossTenantVaultMappingListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CrossTenantVaultMappingListResult deserializedCrossTenantVaultMappingListResult + = new CrossTenantVaultMappingListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> CrossTenantVaultMappingInner.fromJson(reader1)); + deserializedCrossTenantVaultMappingListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedCrossTenantVaultMappingListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCrossTenantVaultMappingListResult; + }); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AccessType.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AccessType.java new file mode 100644 index 000000000000..59b77a94116f --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AccessType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Whether access to the storage account is key-based or identity-based. + */ +public final class AccessType extends ExpandableStringEnum { + /** + * Access using storage account keys. + */ + public static final AccessType KEY_BASED = fromString("KeyBased"); + + /** + * Access using managed identity. + */ + public static final AccessType IDENTITY_BASED = fromString("IdentityBased"); + + /** + * Creates a new instance of AccessType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AccessType() { + } + + /** + * Creates or finds a AccessType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AccessType. + */ + public static AccessType fromString(String name) { + return fromString(name, AccessType.class); + } + + /** + * Gets known AccessType values. + * + * @return known AccessType values. + */ + public static Collection values() { + return values(AccessType.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareRestoreRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareRestoreRequest.java index 766203f8cea7..cf07ed046e8e 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareRestoreRequest.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureFileShareRestoreRequest.java @@ -52,6 +52,11 @@ public final class AzureFileShareRestoreRequest extends RestoreRequest { */ private TargetAfsRestoreInfo targetDetails; + /* + * Managed identity information required to access the storage account. + */ + private IdentityInfo identityInfo; + /** * Creates an instance of AzureFileShareRestoreRequest class. */ @@ -191,6 +196,26 @@ public AzureFileShareRestoreRequest withTargetDetails(TargetAfsRestoreInfo targe return this; } + /** + * Get the identityInfo property: Managed identity information required to access the storage account. + * + * @return the identityInfo value. + */ + public IdentityInfo identityInfo() { + return this.identityInfo; + } + + /** + * Set the identityInfo property: Managed identity information required to access the storage account. + * + * @param identityInfo the identityInfo value to set. + * @return the AzureFileShareRestoreRequest object itself. + */ + public AzureFileShareRestoreRequest withIdentityInfo(IdentityInfo identityInfo) { + this.identityInfo = identityInfo; + return this; + } + /** * {@inheritDoc} */ @@ -218,6 +243,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeArrayField("restoreFileSpecs", this.restoreFileSpecs, (writer, element) -> writer.writeJson(element)); jsonWriter.writeJsonField("targetDetails", this.targetDetails); + jsonWriter.writeJsonField("identityInfo", this.identityInfo); return jsonWriter.writeEndObject(); } @@ -257,6 +283,8 @@ public static AzureFileShareRestoreRequest fromJson(JsonReader jsonReader) throw deserializedAzureFileShareRestoreRequest.restoreFileSpecs = restoreFileSpecs; } else if ("targetDetails".equals(fieldName)) { deserializedAzureFileShareRestoreRequest.targetDetails = TargetAfsRestoreInfo.fromJson(reader); + } else if ("identityInfo".equals(fieldName)) { + deserializedAzureFileShareRestoreRequest.identityInfo = IdentityInfo.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageContainer.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageContainer.java index 61ee5f04e42a..b7aa8326ac6e 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageContainer.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/AzureStorageContainer.java @@ -54,6 +54,18 @@ public final class AzureStorageContainer extends ProtectionContainer { */ private OperationType operationType; + /* + * Whether access to the storage account is key-based or identity-based. + * When `IdentityBased`, `identityInfo` must be provided to identify the + * managed identity used to access the storage account. + */ + private AccessType accessType; + + /* + * Managed identity information required to access the storage account. + */ + private IdentityInfo identityInfo; + /** * Creates an instance of AzureStorageContainer class. */ @@ -196,6 +208,50 @@ public AzureStorageContainer withOperationType(OperationType operationType) { return this; } + /** + * Get the accessType property: Whether access to the storage account is key-based or identity-based. + * When `IdentityBased`, `identityInfo` must be provided to identify the + * managed identity used to access the storage account. + * + * @return the accessType value. + */ + public AccessType accessType() { + return this.accessType; + } + + /** + * Set the accessType property: Whether access to the storage account is key-based or identity-based. + * When `IdentityBased`, `identityInfo` must be provided to identify the + * managed identity used to access the storage account. + * + * @param accessType the accessType value to set. + * @return the AzureStorageContainer object itself. + */ + public AzureStorageContainer withAccessType(AccessType accessType) { + this.accessType = accessType; + return this; + } + + /** + * Get the identityInfo property: Managed identity information required to access the storage account. + * + * @return the identityInfo value. + */ + public IdentityInfo identityInfo() { + return this.identityInfo; + } + + /** + * Set the identityInfo property: Managed identity information required to access the storage account. + * + * @param identityInfo the identityInfo value to set. + * @return the AzureStorageContainer object itself. + */ + public AzureStorageContainer withIdentityInfo(IdentityInfo identityInfo) { + this.identityInfo = identityInfo; + return this; + } + /** * {@inheritDoc} */ @@ -261,6 +317,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("acquireStorageAccountLock", this.acquireStorageAccountLock == null ? null : this.acquireStorageAccountLock.toString()); jsonWriter.writeStringField("operationType", this.operationType == null ? null : this.operationType.toString()); + jsonWriter.writeStringField("accessType", this.accessType == null ? null : this.accessType.toString()); + jsonWriter.writeJsonField("identityInfo", this.identityInfo); return jsonWriter.writeEndObject(); } @@ -306,6 +364,10 @@ public static AzureStorageContainer fromJson(JsonReader jsonReader) throws IOExc = AcquireStorageAccountLock.fromString(reader.getString()); } else if ("operationType".equals(fieldName)) { deserializedAzureStorageContainer.operationType = OperationType.fromString(reader.getString()); + } else if ("accessType".equals(fieldName)) { + deserializedAzureStorageContainer.accessType = AccessType.fromString(reader.getString()); + } else if ("identityInfo".equals(fieldName)) { + deserializedAzureStorageContainer.identityInfo = IdentityInfo.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupJobsFromCrossTenantVaults.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupJobsFromCrossTenantVaults.java new file mode 100644 index 000000000000..41923e8bafc8 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupJobsFromCrossTenantVaults.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of BackupJobsFromCrossTenantVaults. + */ +public interface BackupJobsFromCrossTenantVaults { + /** + * Provides a pageable list of cross-tenant backup jobs. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of jobs for cross-tenant restore operations as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String vaultName, String crossTenantVaultMappingName); + + /** + * Provides a pageable list of cross-tenant backup jobs. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of jobs for cross-tenant restore operations as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + String filter, String skipToken, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupProtectedItemsFromCrossTenantVaults.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupProtectedItemsFromCrossTenantVaults.java new file mode 100644 index 000000000000..43723ea569e3 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/BackupProtectedItemsFromCrossTenantVaults.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of BackupProtectedItemsFromCrossTenantVaults. + */ +public interface BackupProtectedItemsFromCrossTenantVaults { + /** + * Lists the protected items from the source vault in a different tenant. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of protected items for cross-tenant restore operations as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName); + + /** + * Lists the protected items from the source vault in a different tenant. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param filter OData filter options. + * @param skipToken skipToken Filter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of protected items for cross-tenant restore operations as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String filter, String skipToken, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrossTenantProvisioningState.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrossTenantProvisioningState.java new file mode 100644 index 000000000000..ae97ed4ca798 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrossTenantProvisioningState.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Provisioning state of cross-tenant resources. Wraps the standard + * `ResourceProvisioningState` (Succeeded / Failed / Canceled) and adds the + * non-terminal states emitted by the RP. + */ +public final class CrossTenantProvisioningState extends ExpandableStringEnum { + /** + * Resource has been created. + */ + public static final CrossTenantProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Resource creation failed. + */ + public static final CrossTenantProvisioningState FAILED = fromString("Failed"); + + /** + * Resource creation was canceled. + */ + public static final CrossTenantProvisioningState CANCELED = fromString("Canceled"); + + /** + * Initial provisioning in progress. + */ + public static final CrossTenantProvisioningState PROVISIONING = fromString("Provisioning"); + + /** + * Update in progress. + */ + public static final CrossTenantProvisioningState UPDATING = fromString("Updating"); + + /** + * Deletion in progress. + */ + public static final CrossTenantProvisioningState DELETING = fromString("Deleting"); + + /** + * Request accepted, processing not yet started. + */ + public static final CrossTenantProvisioningState ACCEPTED = fromString("Accepted"); + + /** + * Creates a new instance of CrossTenantProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CrossTenantProvisioningState() { + } + + /** + * Creates or finds a CrossTenantProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding CrossTenantProvisioningState. + */ + public static CrossTenantProvisioningState fromString(String name) { + return fromString(name, CrossTenantProvisioningState.class); + } + + /** + * Gets known CrossTenantProvisioningState values. + * + * @return known CrossTenantProvisioningState values. + */ + public static Collection values() { + return values(CrossTenantProvisioningState.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrossTenantVaultCredentialOperationResults.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrossTenantVaultCredentialOperationResults.java new file mode 100644 index 000000000000..c78ea1425257 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrossTenantVaultCredentialOperationResults.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.util.Context; + +/** + * Resource collection API of CrossTenantVaultCredentialOperationResults. + */ +public interface CrossTenantVaultCredentialOperationResults { + /** + * Gets the result of an async vault credential generation operation. + * While the TEE job is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. When the job completes it returns either + * 200 OK with the generated VaultCredentialCertificateResponse body, or 204 No Content + * if there is no body to return. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param certificateName Name identifier for the certificate. + * @param operationId Operation ID returned in the Location header of the generate call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void get(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, String certificateName, + String operationId); + + /** + * Gets the result of an async vault credential generation operation. + * While the TEE job is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. When the job completes it returns either + * 200 OK with the generated VaultCredentialCertificateResponse body, or 204 No Content + * if there is no body to return. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param certificateName Name identifier for the certificate. + * @param operationId Operation ID returned in the Location header of the generate call. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void get(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, String certificateName, + String operationId, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrossTenantVaultCredentialOperationStatuses.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrossTenantVaultCredentialOperationStatuses.java new file mode 100644 index 000000000000..5de770460db9 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrossTenantVaultCredentialOperationStatuses.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of CrossTenantVaultCredentialOperationStatuses. + */ +public interface CrossTenantVaultCredentialOperationStatuses { + /** + * Gets the status of an async vault credential generation operation. + * Returns the current status (InProgress, Completed, Failed) and any associated job details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param certificateName Name identifier for the certificate. + * @param operationId Operation ID returned in the Azure-AsyncOperation header of the generate call. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of an async vault credential generation operation. + * Returns the current status (InProgress, Completed, Failed) and any associated job details along with + * {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String certificateName, String operationId, Context context); + + /** + * Gets the status of an async vault credential generation operation. + * Returns the current status (InProgress, Completed, Failed) and any associated job details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param certificateName Name identifier for the certificate. + * @param operationId Operation ID returned in the Azure-AsyncOperation header of the generate call. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of an async vault credential generation operation. + * Returns the current status (InProgress, Completed, Failed) and any associated job details. + */ + OperationStatus get(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + String certificateName, String operationId); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrossTenantVaultCredentials.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrossTenantVaultCredentials.java new file mode 100644 index 000000000000..86a242e4ade1 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrossTenantVaultCredentials.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.util.Context; + +/** + * Resource collection API of CrossTenantVaultCredentials. + */ +public interface CrossTenantVaultCredentials { + /** + * Generates a vault credential certificate for cross-tenant restore scenarios. + * This is an asynchronous operation. BMS creates a TEE job that calls IDM's certificates + * endpoint for the source vault, generating a self-signed certificate registered with AAD. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param certificateName Name identifier for the certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void generate(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + String certificateName); + + /** + * Generates a vault credential certificate for cross-tenant restore scenarios. + * This is an asynchronous operation. BMS creates a TEE job that calls IDM's certificates + * endpoint for the source vault, generating a self-signed certificate registered with AAD. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param certificateName Name identifier for the certificate. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void generate(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + String certificateName, VaultCredentialCertificateRequest body, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrossTenantVaultMapping.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrossTenantVaultMapping.java new file mode 100644 index 000000000000..9fb28a3d1b4a --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrossTenantVaultMapping.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.CrossTenantVaultMappingInner; + +/** + * An immutable client-side representation of CrossTenantVaultMapping. + */ +public interface CrossTenantVaultMapping { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: CrossTenantVaultMapping properties. + * + * @return the properties value. + */ + CrossTenantVaultMappingProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.recoveryservicesbackup.fluent.models.CrossTenantVaultMappingInner + * object. + * + * @return the inner object. + */ + CrossTenantVaultMappingInner innerModel(); + + /** + * The entirety of the CrossTenantVaultMapping definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The CrossTenantVaultMapping definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the CrossTenantVaultMapping definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the CrossTenantVaultMapping definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, vaultName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @return the next definition stage. + */ + WithCreate withExistingVault(String resourceGroupName, String vaultName); + } + + /** + * The stage of the CrossTenantVaultMapping definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + CrossTenantVaultMapping create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + CrossTenantVaultMapping create(Context context); + } + + /** + * The stage of the CrossTenantVaultMapping definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: CrossTenantVaultMapping properties. + * + * @param properties CrossTenantVaultMapping properties. + * @return the next definition stage. + */ + WithCreate withProperties(CrossTenantVaultMappingProperties properties); + } + } + + /** + * Begins update for the CrossTenantVaultMapping resource. + * + * @return the stage of resource update. + */ + CrossTenantVaultMapping.Update update(); + + /** + * The template for CrossTenantVaultMapping update. + */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + CrossTenantVaultMapping apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + CrossTenantVaultMapping apply(Context context); + } + + /** + * The CrossTenantVaultMapping update stages. + */ + interface UpdateStages { + /** + * The stage of the CrossTenantVaultMapping update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: CrossTenantVaultMapping properties. + * + * @param properties CrossTenantVaultMapping properties. + * @return the next definition stage. + */ + Update withProperties(CrossTenantVaultMappingProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + CrossTenantVaultMapping refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + CrossTenantVaultMapping refresh(Context context); + + /** + * Removes the cross-tenant vault mapping for cross-tenant restore operations. + * This API removes the target vault properties associated with source vault ID and deletes catalog mapping. + * + * @param body Request body for operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void remove(RemoveCrossTenantVaultMappingRequest body); + + /** + * Removes the cross-tenant vault mapping for cross-tenant restore operations. + * This API removes the target vault properties associated with source vault ID and deletes catalog mapping. + * + * @param body Request body for operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void remove(RemoveCrossTenantVaultMappingRequest body, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrossTenantVaultMappingProperties.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrossTenantVaultMappingProperties.java new file mode 100644 index 000000000000..586115b38afe --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrossTenantVaultMappingProperties.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * Cross-tenant vault mapping properties for cross-tenant restore. + * Represents the configuration linking a source vault to a target vault across tenants. + */ +@Fluent +public final class CrossTenantVaultMappingProperties implements JsonSerializable { + /* + * ARM resource ID of the source vault. + */ + private String sourceVaultId; + + /* + * Tenant ID of the source vault for cross-tenant mapping. + */ + private String sourceTenantId; + + /* + * Name of the mapping. + */ + private String mappingName; + + /* + * Timestamp when the mapping was created. + */ + private OffsetDateTime createdTime; + + /* + * ResourceGuardOperationRequests on which LAC check will be performed. + */ + private List resourceGuardOperationRequests; + + /* + * Provisioning state of the resource. + */ + private CrossTenantProvisioningState provisioningState; + + /** + * Creates an instance of CrossTenantVaultMappingProperties class. + */ + public CrossTenantVaultMappingProperties() { + } + + /** + * Get the sourceVaultId property: ARM resource ID of the source vault. + * + * @return the sourceVaultId value. + */ + public String sourceVaultId() { + return this.sourceVaultId; + } + + /** + * Set the sourceVaultId property: ARM resource ID of the source vault. + * + * @param sourceVaultId the sourceVaultId value to set. + * @return the CrossTenantVaultMappingProperties object itself. + */ + public CrossTenantVaultMappingProperties withSourceVaultId(String sourceVaultId) { + this.sourceVaultId = sourceVaultId; + return this; + } + + /** + * Get the sourceTenantId property: Tenant ID of the source vault for cross-tenant mapping. + * + * @return the sourceTenantId value. + */ + public String sourceTenantId() { + return this.sourceTenantId; + } + + /** + * Get the mappingName property: Name of the mapping. + * + * @return the mappingName value. + */ + public String mappingName() { + return this.mappingName; + } + + /** + * Get the createdTime property: Timestamp when the mapping was created. + * + * @return the createdTime value. + */ + public OffsetDateTime createdTime() { + return this.createdTime; + } + + /** + * Get the resourceGuardOperationRequests property: ResourceGuardOperationRequests on which LAC check will be + * performed. + * + * @return the resourceGuardOperationRequests value. + */ + public List resourceGuardOperationRequests() { + return this.resourceGuardOperationRequests; + } + + /** + * Set the resourceGuardOperationRequests property: ResourceGuardOperationRequests on which LAC check will be + * performed. + * + * @param resourceGuardOperationRequests the resourceGuardOperationRequests value to set. + * @return the CrossTenantVaultMappingProperties object itself. + */ + public CrossTenantVaultMappingProperties + withResourceGuardOperationRequests(List resourceGuardOperationRequests) { + this.resourceGuardOperationRequests = resourceGuardOperationRequests; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + public CrossTenantProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("sourceVaultId", this.sourceVaultId); + jsonWriter.writeArrayField("resourceGuardOperationRequests", this.resourceGuardOperationRequests, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CrossTenantVaultMappingProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CrossTenantVaultMappingProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CrossTenantVaultMappingProperties. + */ + public static CrossTenantVaultMappingProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CrossTenantVaultMappingProperties deserializedCrossTenantVaultMappingProperties + = new CrossTenantVaultMappingProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sourceVaultId".equals(fieldName)) { + deserializedCrossTenantVaultMappingProperties.sourceVaultId = reader.getString(); + } else if ("sourceTenantId".equals(fieldName)) { + deserializedCrossTenantVaultMappingProperties.sourceTenantId = reader.getString(); + } else if ("mappingName".equals(fieldName)) { + deserializedCrossTenantVaultMappingProperties.mappingName = reader.getString(); + } else if ("createdTime".equals(fieldName)) { + deserializedCrossTenantVaultMappingProperties.createdTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("resourceGuardOperationRequests".equals(fieldName)) { + List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString()); + deserializedCrossTenantVaultMappingProperties.resourceGuardOperationRequests + = resourceGuardOperationRequests; + } else if ("provisioningState".equals(fieldName)) { + deserializedCrossTenantVaultMappingProperties.provisioningState + = CrossTenantProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCrossTenantVaultMappingProperties; + }); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrossTenantVaultMappingStatus.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrossTenantVaultMappingStatus.java new file mode 100644 index 000000000000..87d86a5fbb89 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrossTenantVaultMappingStatus.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of CrossTenantVaultMappingStatus. + */ +public interface CrossTenantVaultMappingStatus { + /** + * Gets the mapping status of the vault for cross-tenant restore operations. + * Returns the mapping status that indicates whether the vault is properly configured for cross-tenant operations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the mapping status of the vault for cross-tenant restore operations. + * Returns the mapping status that indicates whether the vault is properly configured for cross-tenant operations + * along with {@link Response}. + */ + Response checkWithResponse(String resourceGroupName, String vaultName, + Context context); + + /** + * Gets the mapping status of the vault for cross-tenant restore operations. + * Returns the mapping status that indicates whether the vault is properly configured for cross-tenant operations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the mapping status of the vault for cross-tenant restore operations. + * Returns the mapping status that indicates whether the vault is properly configured for cross-tenant operations. + */ + CrossTenantVaultMappingStatusResponse check(String resourceGroupName, String vaultName); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrossTenantVaultMappingStatusResponse.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrossTenantVaultMappingStatusResponse.java new file mode 100644 index 000000000000..ac198e2120a5 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrossTenantVaultMappingStatusResponse.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.CrossTenantVaultMappingStatusResponseInner; + +/** + * An immutable client-side representation of CrossTenantVaultMappingStatusResponse. + */ +public interface CrossTenantVaultMappingStatusResponse { + /** + * Gets the mappingName property: Mapping name (if mapped). + * + * @return the mappingName value. + */ + String mappingName(); + + /** + * Gets the mappingState property: Current state of the mapping. + * + * @return the mappingState value. + */ + VaultMappingState mappingState(); + + /** + * Gets the inner + * com.azure.resourcemanager.recoveryservicesbackup.fluent.models.CrossTenantVaultMappingStatusResponseInner object. + * + * @return the inner object. + */ + CrossTenantVaultMappingStatusResponseInner innerModel(); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrossTenantVaultMappings.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrossTenantVaultMappings.java new file mode 100644 index 000000000000..b2dd59a8f956 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrossTenantVaultMappings.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of CrossTenantVaultMappings. + */ +public interface CrossTenantVaultMappings { + /** + * Gets the cross-tenant vault mapping by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the cross-tenant vault mapping by name along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, Context context); + + /** + * Gets the cross-tenant vault mapping by name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the cross-tenant vault mapping by name. + */ + CrossTenantVaultMapping get(String resourceGroupName, String vaultName, String crossTenantVaultMappingName); + + /** + * Lists the cross-tenant vault mapping configurations for cross-tenant restore operations. + * Retrieves the current cross-tenant vault mapping details including source vault mappings and mapping state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CrossTenantVaultMapping list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String vaultName); + + /** + * Lists the cross-tenant vault mapping configurations for cross-tenant restore operations. + * Retrieves the current cross-tenant vault mapping details including source vault mappings and mapping state. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CrossTenantVaultMapping list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String vaultName, Context context); + + /** + * Removes the cross-tenant vault mapping for cross-tenant restore operations. + * This API removes the target vault properties associated with source vault ID and deletes catalog mapping. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param body Request body for operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void remove(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + RemoveCrossTenantVaultMappingRequest body); + + /** + * Removes the cross-tenant vault mapping for cross-tenant restore operations. + * This API removes the target vault properties associated with source vault ID and deletes catalog mapping. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param body Request body for operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void remove(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + RemoveCrossTenantVaultMappingRequest body, Context context); + + /** + * Gets the cross-tenant vault mapping by name. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the cross-tenant vault mapping by name along with {@link Response}. + */ + CrossTenantVaultMapping getById(String id); + + /** + * Gets the cross-tenant vault mapping by name. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the cross-tenant vault mapping by name along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new CrossTenantVaultMapping resource. + * + * @param name resource name. + * @return the first stage of the new CrossTenantVaultMapping definition. + */ + CrossTenantVaultMapping.DefinitionStages.Blank define(String name); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrossTenantVaultRecoveryPointOperations.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrossTenantVaultRecoveryPointOperations.java new file mode 100644 index 000000000000..a0baca9b1965 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrossTenantVaultRecoveryPointOperations.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of CrossTenantVaultRecoveryPointOperations. + */ +public interface CrossTenantVaultRecoveryPointOperations { + /** + * Provides the information of the backed up data identified using RecoveryPointID from the source + * vault in a different tenant. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup copies along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String fabricName, String containerName, String protectedItemName, + String recoveryPointId, Context context); + + /** + * Provides the information of the backed up data identified using RecoveryPointID from the source + * vault in a different tenant. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return base class for backup copies. + */ + RecoveryPointResource get(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + String fabricName, String containerName, String protectedItemName, String recoveryPointId); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrossTenantVaultRecoveryPoints.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrossTenantVaultRecoveryPoints.java new file mode 100644 index 000000000000..87d664019231 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/CrossTenantVaultRecoveryPoints.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of CrossTenantVaultRecoveryPoints. + */ +public interface CrossTenantVaultRecoveryPoints { + /** + * Lists recovery points from the source vault in a different tenant. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of recovery points for cross-tenant restore operations as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String fabricName, String containerName, String protectedItemName); + + /** + * Lists recovery points from the source vault in a different tenant. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @param filter OData filter options. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of recovery points for cross-tenant restore operations as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String fabricName, String containerName, String protectedItemName, + String filter, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/HourlySchedule.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/HourlySchedule.java index 218ad0084760..1c98368f16bf 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/HourlySchedule.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/HourlySchedule.java @@ -20,6 +20,7 @@ @Fluent public final class HourlySchedule implements JsonSerializable { /* + * * Interval at which backup needs to be triggered. For hourly the value * can be 4/6/8/12 */ @@ -42,7 +43,8 @@ public HourlySchedule() { } /** - * Get the interval property: Interval at which backup needs to be triggered. For hourly the value + * Get the interval property: + * Interval at which backup needs to be triggered. For hourly the value * can be 4/6/8/12. * * @return the interval value. @@ -52,7 +54,8 @@ public Integer interval() { } /** - * Set the interval property: Interval at which backup needs to be triggered. For hourly the value + * Set the interval property: + * Interval at which backup needs to be triggered. For hourly the value * can be 4/6/8/12. * * @param interval the interval value to set. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobDetailsFromCrossTenantVaults.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobDetailsFromCrossTenantVaults.java new file mode 100644 index 000000000000..0c83c658fb40 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/JobDetailsFromCrossTenantVaults.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of JobDetailsFromCrossTenantVaults. + */ +public interface JobDetailsFromCrossTenantVaults { + /** + * Gets extended information associated with a cross-tenant backup job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param jobName Name of the job whose details are to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return extended information associated with a cross-tenant backup job along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String jobName, Context context); + + /** + * Gets extended information associated with a cross-tenant backup job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param jobName Name of the job whose details are to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return extended information associated with a cross-tenant backup job. + */ + JobResource get(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, String jobName); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationFromCrossTenantVaults.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationFromCrossTenantVaults.java new file mode 100644 index 000000000000..e06b4adbd3c6 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/OperationFromCrossTenantVaults.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of OperationFromCrossTenantVaults. + */ +public interface OperationFromCrossTenantVaults { + /** + * Validates a backup operation for cross-tenant restore scenarios. + * This API performs validation checks before executing a backup operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + Response validateWithResponse(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, ValidateOperationRequestResource body, Context context); + + /** + * Validates a backup operation for cross-tenant restore scenarios. + * This API performs validation checks before executing a backup operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + ValidateOperationsResponse validate(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + ValidateOperationRequestResource body); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItemFromCrossTenantVaults.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItemFromCrossTenantVaults.java new file mode 100644 index 000000000000..9141ef6b6bb5 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItemFromCrossTenantVaults.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of ProtectedItemFromCrossTenantVaults. + */ +public interface ProtectedItemFromCrossTenantVaults { + /** + * Gets the details of a protected item from a cross-tenant vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name whose details are to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a protected item from a cross-tenant vault along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String fabricName, String containerName, String protectedItemName, + Context context); + + /** + * Gets the details of a protected item from a cross-tenant vault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name whose details are to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the details of a protected item from a cross-tenant vault. + */ + ProtectedItemResource get(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + String fabricName, String containerName, String protectedItemName); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItemOperationResultsFromCrossTenantVaults.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItemOperationResultsFromCrossTenantVaults.java new file mode 100644 index 000000000000..e2b36e61c51b --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItemOperationResultsFromCrossTenantVaults.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.util.Context; + +/** + * Resource collection API of ProtectedItemOperationResultsFromCrossTenantVaults. + */ +public interface ProtectedItemOperationResultsFromCrossTenantVaults { + /** + * Fetches the result of any cross-tenant operation on the backup item. + * While the operation is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. When the operation completes it returns + * either 200 OK with the final ProtectedItemResource body, or 204 No Content if there + * is no body to return. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @param operationId OperationID which represents the operation whose result needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void get(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, String fabricName, + String containerName, String protectedItemName, String operationId); + + /** + * Fetches the result of any cross-tenant operation on the backup item. + * While the operation is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. When the operation completes it returns + * either 200 OK with the final ProtectedItemResource body, or 204 No Content if there + * is no body to return. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @param operationId OperationID which represents the operation whose result needs to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void get(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, String fabricName, + String containerName, String protectedItemName, String operationId, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItemOperationStatusesFromCrossTenantVaults.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItemOperationStatusesFromCrossTenantVaults.java new file mode 100644 index 000000000000..7e41d69776a2 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ProtectedItemOperationStatusesFromCrossTenantVaults.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of ProtectedItemOperationStatusesFromCrossTenantVaults. + */ +public interface ProtectedItemOperationStatusesFromCrossTenantVaults { + /** + * Fetches the status of a cross-tenant operation such as triggering a restore. + * The status can be in progress, completed or failed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @param operationId OperationID represents the operation whose status needs to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String fabricName, String containerName, String protectedItemName, + String operationId, Context context); + + /** + * Fetches the status of a cross-tenant operation such as triggering a restore. + * The status can be in progress, completed or failed. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @param operationId OperationID represents the operation whose status needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return operation status. + */ + OperationStatus get(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + String fabricName, String containerName, String protectedItemName, String operationId); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointImmutabilityProperties.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointImmutabilityProperties.java new file mode 100644 index 000000000000..29306934cf03 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointImmutabilityProperties.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * Immutability properties of a recovery point. + */ +@Immutable +public final class RecoveryPointImmutabilityProperties + implements JsonSerializable { + /* + * Whether the recovery point is immutable. + */ + private boolean isImmutable; + + /* + * Expiry time of immutability in UTC. Omitted when immutability is as per policy. + */ + private OffsetDateTime expiryTime; + + /** + * Creates an instance of RecoveryPointImmutabilityProperties class. + */ + private RecoveryPointImmutabilityProperties() { + } + + /** + * Get the isImmutable property: Whether the recovery point is immutable. + * + * @return the isImmutable value. + */ + public boolean isImmutable() { + return this.isImmutable; + } + + /** + * Get the expiryTime property: Expiry time of immutability in UTC. Omitted when immutability is as per policy. + * + * @return the expiryTime value. + */ + public OffsetDateTime expiryTime() { + return this.expiryTime; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("isImmutable", this.isImmutable); + jsonWriter.writeStringField("expiryTime", + this.expiryTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expiryTime)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RecoveryPointImmutabilityProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RecoveryPointImmutabilityProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RecoveryPointImmutabilityProperties. + */ + public static RecoveryPointImmutabilityProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RecoveryPointImmutabilityProperties deserializedRecoveryPointImmutabilityProperties + = new RecoveryPointImmutabilityProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("isImmutable".equals(fieldName)) { + deserializedRecoveryPointImmutabilityProperties.isImmutable = reader.getBoolean(); + } else if ("expiryTime".equals(fieldName)) { + deserializedRecoveryPointImmutabilityProperties.expiryTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedRecoveryPointImmutabilityProperties; + }); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointProperties.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointProperties.java index 7692c678bc33..b05a6b500ee2 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointProperties.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RecoveryPointProperties.java @@ -31,6 +31,11 @@ public final class RecoveryPointProperties implements JsonSerializable { /* + * * How long the rehydrated RP should be kept * Should be ISO8601 Duration format e.g. "P7D" */ @@ -34,7 +35,8 @@ public RecoveryPointRehydrationInfo() { } /** - * Get the rehydrationRetentionDuration property: How long the rehydrated RP should be kept + * Get the rehydrationRetentionDuration property: + * How long the rehydrated RP should be kept * Should be ISO8601 Duration format e.g. "P7D". * * @return the rehydrationRetentionDuration value. @@ -44,7 +46,8 @@ public String rehydrationRetentionDuration() { } /** - * Set the rehydrationRetentionDuration property: How long the rehydrated RP should be kept + * Set the rehydrationRetentionDuration property: + * How long the rehydrated RP should be kept * Should be ISO8601 Duration format e.g. "P7D". * * @param rehydrationRetentionDuration the rehydrationRetentionDuration value to set. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RemoveCrossTenantVaultMappingRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RemoveCrossTenantVaultMappingRequest.java new file mode 100644 index 000000000000..c23666327300 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RemoveCrossTenantVaultMappingRequest.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Request to remove a cross-tenant vault mapping for cross-tenant restore. + */ +@Fluent +public final class RemoveCrossTenantVaultMappingRequest + implements JsonSerializable { + /* + * ResourceGuardOperationRequests on which LAC check will be performed. + */ + private List resourceGuardOperationRequests; + + /** + * Creates an instance of RemoveCrossTenantVaultMappingRequest class. + */ + public RemoveCrossTenantVaultMappingRequest() { + } + + /** + * Get the resourceGuardOperationRequests property: ResourceGuardOperationRequests on which LAC check will be + * performed. + * + * @return the resourceGuardOperationRequests value. + */ + public List resourceGuardOperationRequests() { + return this.resourceGuardOperationRequests; + } + + /** + * Set the resourceGuardOperationRequests property: ResourceGuardOperationRequests on which LAC check will be + * performed. + * + * @param resourceGuardOperationRequests the resourceGuardOperationRequests value to set. + * @return the RemoveCrossTenantVaultMappingRequest object itself. + */ + public RemoveCrossTenantVaultMappingRequest + withResourceGuardOperationRequests(List resourceGuardOperationRequests) { + this.resourceGuardOperationRequests = resourceGuardOperationRequests; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("resourceGuardOperationRequests", this.resourceGuardOperationRequests, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RemoveCrossTenantVaultMappingRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RemoveCrossTenantVaultMappingRequest if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the RemoveCrossTenantVaultMappingRequest. + */ + public static RemoveCrossTenantVaultMappingRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RemoveCrossTenantVaultMappingRequest deserializedRemoveCrossTenantVaultMappingRequest + = new RemoveCrossTenantVaultMappingRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceGuardOperationRequests".equals(fieldName)) { + List resourceGuardOperationRequests = reader.readArray(reader1 -> reader1.getString()); + deserializedRemoveCrossTenantVaultMappingRequest.resourceGuardOperationRequests + = resourceGuardOperationRequests; + } else { + reader.skipChildren(); + } + } + + return deserializedRemoveCrossTenantVaultMappingRequest; + }); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RestoresFromCrossTenantVaults.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RestoresFromCrossTenantVaults.java new file mode 100644 index 000000000000..c5bd05741243 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/RestoresFromCrossTenantVaults.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.util.Context; + +/** + * Resource collection API of RestoresFromCrossTenantVaults. + */ +public interface RestoresFromCrossTenantVaults { + /** + * Restores the specified backed up data from a source vault in a different tenant. This is an asynchronous + * operation. + * To know the status of this API call, use GetProtectedItemOperationResult API. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void trigger(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, String fabricName, + String containerName, String protectedItemName, String recoveryPointId, RestoreRequestResource body); + + /** + * Restores the specified backed up data from a source vault in a different tenant. This is an asynchronous + * operation. + * To know the status of this API call, use GetProtectedItemOperationResult API. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param fabricName Fabric name associated with the backed up items. + * @param containerName Container name associated with the backed up items. + * @param protectedItemName Backed up item name. + * @param recoveryPointId RecoveryPointID represents the backed up data to be fetched. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void trigger(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, String fabricName, + String containerName, String protectedItemName, String recoveryPointId, RestoreRequestResource body, + Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TieringPolicy.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TieringPolicy.java index 02e471a03d44..7ea0c7961083 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TieringPolicy.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/TieringPolicy.java @@ -19,6 +19,7 @@ @Fluent public final class TieringPolicy implements JsonSerializable { /* + * * Tiering Mode to control automatic tiering of recovery points. Supported values are: * 1. TierRecommended: Tier all recovery points recommended to be tiered * 2. TierAfter: Tier all recovery points after a fixed period, as specified in duration + durationType below. @@ -45,7 +46,8 @@ public TieringPolicy() { } /** - * Get the tieringMode property: Tiering Mode to control automatic tiering of recovery points. Supported values are: + * Get the tieringMode property: + * Tiering Mode to control automatic tiering of recovery points. Supported values are: * 1. TierRecommended: Tier all recovery points recommended to be tiered * 2. TierAfter: Tier all recovery points after a fixed period, as specified in duration + durationType below. * 3. DoNotTier: Do not tier any recovery points. @@ -57,7 +59,8 @@ public TieringMode tieringMode() { } /** - * Set the tieringMode property: Tiering Mode to control automatic tiering of recovery points. Supported values are: + * Set the tieringMode property: + * Tiering Mode to control automatic tiering of recovery points. Supported values are: * 1. TierRecommended: Tier all recovery points recommended to be tiered * 2. TierAfter: Tier all recovery points after a fixed period, as specified in duration + durationType below. * 3. DoNotTier: Do not tier any recovery points. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateOperationFromCrossTenantVaults.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateOperationFromCrossTenantVaults.java new file mode 100644 index 000000000000..73262aa5cee3 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateOperationFromCrossTenantVaults.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.util.Context; + +/** + * Resource collection API of ValidateOperationFromCrossTenantVaults. + */ +public interface ValidateOperationFromCrossTenantVaults { + /** + * Triggers a validate operation for cross-tenant restore scenarios. + * This is an asynchronous operation that performs validation checks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + ValidateOperationsResponse trigger(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + ValidateOperationRequestResource body); + + /** + * Triggers a validate operation for cross-tenant restore scenarios. + * This is an asynchronous operation that performs validation checks. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the VaultResource. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + ValidateOperationsResponse trigger(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + ValidateOperationRequestResource body, Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateOperationResultFromCrossTenantVaults.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateOperationResultFromCrossTenantVaults.java new file mode 100644 index 000000000000..63aef05ee24e --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateOperationResultFromCrossTenantVaults.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.util.Context; + +/** + * Resource collection API of ValidateOperationResultFromCrossTenantVaults. + */ +public interface ValidateOperationResultFromCrossTenantVaults { + /** + * Gets the result of a specific validate operation for cross-tenant restore scenarios. + * While the operation is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. When the operation completes it returns + * either 200 OK with the final ValidateOperationsResponse body, or 204 No Content if + * there is no body to return. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param operationId OperationID which represents the operation whose result needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void get(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, String operationId); + + /** + * Gets the result of a specific validate operation for cross-tenant restore scenarios. + * While the operation is in progress this returns 202 Accepted with Location/Retry-After + * headers pointing back at this same poll URL. When the operation completes it returns + * either 200 OK with the final ValidateOperationsResponse body, or 204 No Content if + * there is no body to return. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param operationId OperationID which represents the operation whose result needs to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void get(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, String operationId, + Context context); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateOperationStatusFromCrossTenantVaults.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateOperationStatusFromCrossTenantVaults.java new file mode 100644 index 000000000000..7deea292b7e3 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/ValidateOperationStatusFromCrossTenantVaults.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of ValidateOperationStatusFromCrossTenantVaults. + */ +public interface ValidateOperationStatusFromCrossTenantVaults { + /** + * Gets the status of a validate operation for cross-tenant restore scenarios. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param operationId OperationID represents the operation whose status needs to be fetched. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a validate operation for cross-tenant restore scenarios along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String vaultName, + String crossTenantVaultMappingName, String operationId, Context context); + + /** + * Gets the status of a validate operation for cross-tenant restore scenarios. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param vaultName The name of the recovery services vault. + * @param crossTenantVaultMappingName Cross-tenant vault mapping name. + * @param operationId OperationID represents the operation whose status needs to be fetched. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of a validate operation for cross-tenant restore scenarios. + */ + OperationStatus get(String resourceGroupName, String vaultName, String crossTenantVaultMappingName, + String operationId); +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/VaultCredentialCertificateCreateOptions.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/VaultCredentialCertificateCreateOptions.java new file mode 100644 index 000000000000..92c5905a9eba --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/VaultCredentialCertificateCreateOptions.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Options for self-signed certificate generation. + */ +@Fluent +public final class VaultCredentialCertificateCreateOptions + implements JsonSerializable { + /* + * Validity period of the generated certificate in hours. + */ + private Integer validityInHours; + + /** + * Creates an instance of VaultCredentialCertificateCreateOptions class. + */ + public VaultCredentialCertificateCreateOptions() { + } + + /** + * Get the validityInHours property: Validity period of the generated certificate in hours. + * + * @return the validityInHours value. + */ + public Integer validityInHours() { + return this.validityInHours; + } + + /** + * Set the validityInHours property: Validity period of the generated certificate in hours. + * + * @param validityInHours the validityInHours value to set. + * @return the VaultCredentialCertificateCreateOptions object itself. + */ + public VaultCredentialCertificateCreateOptions withValidityInHours(Integer validityInHours) { + this.validityInHours = validityInHours; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("validityInHours", this.validityInHours); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VaultCredentialCertificateCreateOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VaultCredentialCertificateCreateOptions if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VaultCredentialCertificateCreateOptions. + */ + public static VaultCredentialCertificateCreateOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VaultCredentialCertificateCreateOptions deserializedVaultCredentialCertificateCreateOptions + = new VaultCredentialCertificateCreateOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("validityInHours".equals(fieldName)) { + deserializedVaultCredentialCertificateCreateOptions.validityInHours + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedVaultCredentialCertificateCreateOptions; + }); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/VaultCredentialCertificateRequest.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/VaultCredentialCertificateRequest.java new file mode 100644 index 000000000000..a1e6215fc449 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/VaultCredentialCertificateRequest.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Request to generate a vault credential certificate for cross-tenant restore. + */ +@Fluent +public final class VaultCredentialCertificateRequest implements JsonSerializable { + /* + * Options for certificate generation. + */ + private VaultCredentialCertificateCreateOptions certificateCreateOptions; + + /** + * Creates an instance of VaultCredentialCertificateRequest class. + */ + public VaultCredentialCertificateRequest() { + } + + /** + * Get the certificateCreateOptions property: Options for certificate generation. + * + * @return the certificateCreateOptions value. + */ + public VaultCredentialCertificateCreateOptions certificateCreateOptions() { + return this.certificateCreateOptions; + } + + /** + * Set the certificateCreateOptions property: Options for certificate generation. + * + * @param certificateCreateOptions the certificateCreateOptions value to set. + * @return the VaultCredentialCertificateRequest object itself. + */ + public VaultCredentialCertificateRequest + withCertificateCreateOptions(VaultCredentialCertificateCreateOptions certificateCreateOptions) { + this.certificateCreateOptions = certificateCreateOptions; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("certificateCreateOptions", this.certificateCreateOptions); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of VaultCredentialCertificateRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of VaultCredentialCertificateRequest if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the VaultCredentialCertificateRequest. + */ + public static VaultCredentialCertificateRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + VaultCredentialCertificateRequest deserializedVaultCredentialCertificateRequest + = new VaultCredentialCertificateRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("certificateCreateOptions".equals(fieldName)) { + deserializedVaultCredentialCertificateRequest.certificateCreateOptions + = VaultCredentialCertificateCreateOptions.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedVaultCredentialCertificateRequest; + }); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/VaultMappingState.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/VaultMappingState.java new file mode 100644 index 000000000000..b21599904cb6 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/models/VaultMappingState.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * State of a vault mapping. + */ +public final class VaultMappingState extends ExpandableStringEnum { + /** + * The mapping is active. + */ + public static final VaultMappingState ACTIVE = fromString("Active"); + + /** + * The mapping is inactive. + */ + public static final VaultMappingState INACTIVE = fromString("Inactive"); + + /** + * Creates a new instance of VaultMappingState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public VaultMappingState() { + } + + /** + * Creates or finds a VaultMappingState from its string representation. + * + * @param name a name to look for. + * @return the corresponding VaultMappingState. + */ + public static VaultMappingState fromString(String name) { + return fromString(name, VaultMappingState.class); + } + + /** + * Gets known VaultMappingState values. + * + * @return known VaultMappingState values. + */ + public static Collection values() { + return values(VaultMappingState.class); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-recoveryservicesbackup/proxy-config.json b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-recoveryservicesbackup/proxy-config.json index 6a4769af2fc1..972da243161b 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-recoveryservicesbackup/proxy-config.json +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-recoveryservicesbackup/proxy-config.json @@ -1 +1 @@ -[["com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupEnginesClientImpl$BackupEnginesService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupJobsClientImpl$BackupJobsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupOperationResultsClientImpl$BackupOperationResultsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupOperationStatusesClientImpl$BackupOperationStatusesService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupPoliciesClientImpl$BackupPoliciesService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupProtectableItemsClientImpl$BackupProtectableItemsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupProtectedItemsClientImpl$BackupProtectedItemsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupProtectionContainersClientImpl$BackupProtectionContainersService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupProtectionIntentsClientImpl$BackupProtectionIntentsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupResourceEncryptionConfigsClientImpl$BackupResourceEncryptionConfigsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupResourceStorageConfigsNonCrrsClientImpl$BackupResourceStorageConfigsNonCrrsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupResourceVaultConfigsClientImpl$BackupResourceVaultConfigsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupStatusClientImpl$BackupStatusService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupUsageSummariesClientImpl$BackupUsageSummariesService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupWorkloadItemsClientImpl$BackupWorkloadItemsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupsClientImpl$BackupsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.BmsPrepareDataMoveOperationResultsClientImpl$BmsPrepareDataMoveOperationResultsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.DeletedProtectionContainersClientImpl$DeletedProtectionContainersService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ExportJobsOperationResultsClientImpl$ExportJobsOperationResultsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.FeatureSupportsClientImpl$FeatureSupportsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.FetchTieringCostsClientImpl$FetchTieringCostsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.GetTieringCostOperationResultsClientImpl$GetTieringCostOperationResultsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ItemLevelRecoveryConnectionsClientImpl$ItemLevelRecoveryConnectionsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.JobCancellationsClientImpl$JobCancellationsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.JobDetailsClientImpl$JobDetailsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.JobOperationResultsClientImpl$JobOperationResultsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.JobsClientImpl$JobsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.OperationOperationsClientImpl$OperationOperationsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.PrivateEndpointConnectionsClientImpl$PrivateEndpointConnectionsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.PrivateEndpointsClientImpl$PrivateEndpointsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectableContainersClientImpl$ProtectableContainersService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectedItemOperationResultsClientImpl$ProtectedItemOperationResultsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectedItemOperationStatusesClientImpl$ProtectedItemOperationStatusesService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectedItemsClientImpl$ProtectedItemsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectionContainerOperationResultsClientImpl$ProtectionContainerOperationResultsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectionContainerRefreshOperationResultsClientImpl$ProtectionContainerRefreshOperationResultsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectionContainersClientImpl$ProtectionContainersService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectionIntentsClientImpl$ProtectionIntentsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectionPoliciesClientImpl$ProtectionPoliciesService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectionPolicyOperationResultsClientImpl$ProtectionPolicyOperationResultsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectionPolicyOperationStatusesClientImpl$ProtectionPolicyOperationStatusesService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.RecoveryPointsClientImpl$RecoveryPointsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.RecoveryPointsRecommendedForMovesClientImpl$RecoveryPointsRecommendedForMovesService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ResourceGuardProxyOperationsClientImpl$ResourceGuardProxyOperationsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ResourceProvidersClientImpl$ResourceProvidersService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.RestoresClientImpl$RestoresService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.SecurityPINsClientImpl$SecurityPINsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.TieringCostOperationStatusClientImpl$TieringCostOperationStatusService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ValidateOperationResultsClientImpl$ValidateOperationResultsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ValidateOperationStatusesClientImpl$ValidateOperationStatusesService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ValidateOperationsClientImpl$ValidateOperationsService"]] \ No newline at end of file +[["com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupEnginesClientImpl$BackupEnginesService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupJobsClientImpl$BackupJobsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupJobsFromCrossTenantVaultsClientImpl$BackupJobsFromCrossTenantVaultsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupOperationResultsClientImpl$BackupOperationResultsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupOperationStatusesClientImpl$BackupOperationStatusesService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupPoliciesClientImpl$BackupPoliciesService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupProtectableItemsClientImpl$BackupProtectableItemsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupProtectedItemsClientImpl$BackupProtectedItemsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupProtectedItemsFromCrossTenantVaultsClientImpl$BackupProtectedItemsFromCrossTenantVaultsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupProtectionContainersClientImpl$BackupProtectionContainersService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupProtectionIntentsClientImpl$BackupProtectionIntentsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupResourceEncryptionConfigsClientImpl$BackupResourceEncryptionConfigsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupResourceStorageConfigsNonCrrsClientImpl$BackupResourceStorageConfigsNonCrrsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupResourceVaultConfigsClientImpl$BackupResourceVaultConfigsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupStatusClientImpl$BackupStatusService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupUsageSummariesClientImpl$BackupUsageSummariesService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupWorkloadItemsClientImpl$BackupWorkloadItemsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.BackupsClientImpl$BackupsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.BmsPrepareDataMoveOperationResultsClientImpl$BmsPrepareDataMoveOperationResultsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.CrossTenantVaultCredentialOperationResultsClientImpl$CrossTenantVaultCredentialOperationResultsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.CrossTenantVaultCredentialOperationStatusesClientImpl$CrossTenantVaultCredentialOperationStatusesService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.CrossTenantVaultCredentialsClientImpl$CrossTenantVaultCredentialsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.CrossTenantVaultMappingStatusClientImpl$CrossTenantVaultMappingStatusService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.CrossTenantVaultMappingsClientImpl$CrossTenantVaultMappingsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.CrossTenantVaultRecoveryPointOperationsClientImpl$CrossTenantVaultRecoveryPointOperationsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.CrossTenantVaultRecoveryPointsClientImpl$CrossTenantVaultRecoveryPointsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.DeletedProtectionContainersClientImpl$DeletedProtectionContainersService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ExportJobsOperationResultsClientImpl$ExportJobsOperationResultsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.FeatureSupportsClientImpl$FeatureSupportsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.FetchTieringCostsClientImpl$FetchTieringCostsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.GetTieringCostOperationResultsClientImpl$GetTieringCostOperationResultsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ItemLevelRecoveryConnectionsClientImpl$ItemLevelRecoveryConnectionsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.JobCancellationsClientImpl$JobCancellationsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.JobDetailsClientImpl$JobDetailsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.JobDetailsFromCrossTenantVaultsClientImpl$JobDetailsFromCrossTenantVaultsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.JobOperationResultsClientImpl$JobOperationResultsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.JobsClientImpl$JobsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.OperationFromCrossTenantVaultsClientImpl$OperationFromCrossTenantVaultsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.OperationOperationsClientImpl$OperationOperationsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.PrivateEndpointConnectionsClientImpl$PrivateEndpointConnectionsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.PrivateEndpointsClientImpl$PrivateEndpointsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectableContainersClientImpl$ProtectableContainersService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectedItemFromCrossTenantVaultsClientImpl$ProtectedItemFromCrossTenantVaultsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectedItemOperationResultsClientImpl$ProtectedItemOperationResultsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectedItemOperationResultsFromCrossTenantVaultsClientImpl$ProtectedItemOperationResultsFromCrossTenantVaultsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectedItemOperationStatusesClientImpl$ProtectedItemOperationStatusesService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectedItemOperationStatusesFromCrossTenantVaultsClientImpl$ProtectedItemOperationStatusesFromCrossTenantVaultsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectedItemsClientImpl$ProtectedItemsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectionContainerOperationResultsClientImpl$ProtectionContainerOperationResultsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectionContainerRefreshOperationResultsClientImpl$ProtectionContainerRefreshOperationResultsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectionContainersClientImpl$ProtectionContainersService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectionIntentsClientImpl$ProtectionIntentsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectionPoliciesClientImpl$ProtectionPoliciesService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectionPolicyOperationResultsClientImpl$ProtectionPolicyOperationResultsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ProtectionPolicyOperationStatusesClientImpl$ProtectionPolicyOperationStatusesService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.RecoveryPointsClientImpl$RecoveryPointsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.RecoveryPointsRecommendedForMovesClientImpl$RecoveryPointsRecommendedForMovesService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ResourceGuardProxyOperationsClientImpl$ResourceGuardProxyOperationsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ResourceProvidersClientImpl$ResourceProvidersService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.RestoresClientImpl$RestoresService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.RestoresFromCrossTenantVaultsClientImpl$RestoresFromCrossTenantVaultsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.SecurityPINsClientImpl$SecurityPINsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.TieringCostOperationStatusClientImpl$TieringCostOperationStatusService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ValidateOperationFromCrossTenantVaultsClientImpl$ValidateOperationFromCrossTenantVaultsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ValidateOperationResultFromCrossTenantVaultsClientImpl$ValidateOperationResultFromCrossTenantVaultsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ValidateOperationResultsClientImpl$ValidateOperationResultsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ValidateOperationStatusFromCrossTenantVaultsClientImpl$ValidateOperationStatusFromCrossTenantVaultsService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ValidateOperationStatusesClientImpl$ValidateOperationStatusesService"],["com.azure.resourcemanager.recoveryservicesbackup.implementation.ValidateOperationsClientImpl$ValidateOperationsService"]] \ No newline at end of file diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupEnginesGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupEnginesGetSamples.java index 8fbc45fda843..d5b8a7146f63 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupEnginesGetSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupEnginesGetSamples.java @@ -9,7 +9,7 @@ */ public final class BackupEnginesGetSamples { /* - * x-ms-original-file: 2026-01-31-preview/Dpm/BackupEngines_Get.json + * x-ms-original-file: 2026-05-31-preview/Dpm/BackupEngines_Get.json */ /** * Sample code: Get Dpm/AzureBackupServer/Lajolla Backup Engine Details. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupEnginesListSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupEnginesListSamples.java index 3346d5295dfa..0263a85a4d29 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupEnginesListSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupEnginesListSamples.java @@ -9,7 +9,7 @@ */ public final class BackupEnginesListSamples { /* - * x-ms-original-file: 2026-01-31-preview/Dpm/BackupEngines_List.json + * x-ms-original-file: 2026-05-31-preview/Dpm/BackupEngines_List.json */ /** * Sample code: List Dpm/AzureBackupServer/Lajolla Backup Engines. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupJobsFromCrossTenantVaultListSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupJobsFromCrossTenantVaultListSamples.java new file mode 100644 index 000000000000..92789a714d41 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupJobsFromCrossTenantVaultListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +/** + * Samples for BackupJobsFromCrossTenantVault List. + */ +public final class BackupJobsFromCrossTenantVaultListSamples { + /* + * x-ms-original-file: 2026-05-31-preview/CrossTenantVaultMappingOperations/ListCrossTenantJobs.json + */ + /** + * Sample code: List Cross-Tenant Jobs. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void + listCrossTenantJobs(com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager.backupJobsFromCrossTenantVaults() + .list("SwaggerTestRg", "NetSDKTestRsVault", "crossTenantVaultMapping1", null, null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupJobsListSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupJobsListSamples.java index 979706355ad5..60fe2b2423e3 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupJobsListSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupJobsListSamples.java @@ -9,7 +9,7 @@ */ public final class BackupJobsListSamples { /* - * x-ms-original-file: 2026-01-31-preview/Common/ListJobs.json + * x-ms-original-file: 2026-05-31-preview/Common/ListJobs.json */ /** * Sample code: List All Jobs. @@ -22,7 +22,7 @@ public final class BackupJobsListSamples { } /* - * x-ms-original-file: 2026-01-31-preview/Common/ListJobsWithAllSupportedFilters.json + * x-ms-original-file: 2026-05-31-preview/Common/ListJobsWithAllSupportedFilters.json */ /** * Sample code: List Jobs With Filters. @@ -38,7 +38,7 @@ public final class BackupJobsListSamples { } /* - * x-ms-original-file: 2026-01-31-preview/Common/ListJobsWithStartTimeAndEndTimeFilters.json + * x-ms-original-file: 2026-05-31-preview/Common/ListJobsWithStartTimeAndEndTimeFilters.json */ /** * Sample code: List Jobs With Time Filter. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupOperationResultsGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupOperationResultsGetSamples.java index df6de6307f58..17c8bbe5e358 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupOperationResultsGetSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupOperationResultsGetSamples.java @@ -9,7 +9,7 @@ */ public final class BackupOperationResultsGetSamples { /* - * x-ms-original-file: 2026-01-31-preview/Common/ProtectedItem_Delete_OperationResult.json + * x-ms-original-file: 2026-05-31-preview/Common/ProtectedItem_Delete_OperationResult.json */ /** * Sample code: Get Result for Protected Item Delete Operation. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupOperationStatusesGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupOperationStatusesGetSamples.java index a8bba42050d1..978909a314e3 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupOperationStatusesGetSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupOperationStatusesGetSamples.java @@ -9,7 +9,7 @@ */ public final class BackupOperationStatusesGetSamples { /* - * x-ms-original-file: 2026-01-31-preview/Common/ProtectedItem_Delete_OperationStatus.json + * x-ms-original-file: 2026-05-31-preview/Common/ProtectedItem_Delete_OperationStatus.json */ /** * Sample code: Get Protected Item Delete Operation Status. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupPoliciesListSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupPoliciesListSamples.java index b3f590562f04..b7fc14e247ee 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupPoliciesListSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupPoliciesListSamples.java @@ -9,7 +9,7 @@ */ public final class BackupPoliciesListSamples { /* - * x-ms-original-file: 2026-01-31-preview/AzureWorkload/BackupPolicies_List.json + * x-ms-original-file: 2026-05-31-preview/AzureWorkload/BackupPolicies_List.json */ /** * Sample code: List protection policies with backupManagementType filter as AzureWorkload. @@ -24,7 +24,7 @@ public static void listProtectionPoliciesWithBackupManagementTypeFilterAsAzureWo } /* - * x-ms-original-file: 2026-01-31-preview/AzureIaasVm/V2Policy/v2-List-Policies.json + * x-ms-original-file: 2026-05-31-preview/AzureIaasVm/V2Policy/v2-List-Policies.json */ /** * Sample code: List protection policies with backupManagementType filter as AzureIaasVm with both V1 and V2 @@ -40,7 +40,7 @@ public static void listProtectionPoliciesWithBackupManagementTypeFilterAsAzureIa } /* - * x-ms-original-file: 2026-01-31-preview/AzureIaasVm/BackupPolicies_List.json + * x-ms-original-file: 2026-05-31-preview/AzureIaasVm/BackupPolicies_List.json */ /** * Sample code: List protection policies with backupManagementType filter as AzureIaasVm. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupProtectableItemsListSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupProtectableItemsListSamples.java index d832a5764dec..460d415309d1 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupProtectableItemsListSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupProtectableItemsListSamples.java @@ -9,7 +9,7 @@ */ public final class BackupProtectableItemsListSamples { /* - * x-ms-original-file: 2026-01-31-preview/AzureIaasVm/BackupProtectableItems_List.json + * x-ms-original-file: 2026-05-31-preview/AzureIaasVm/BackupProtectableItems_List.json */ /** * Sample code: List protectable items with backupManagementType filter as AzureIaasVm. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupProtectedItemsFromCrossTenantVaultListSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupProtectedItemsFromCrossTenantVaultListSamples.java new file mode 100644 index 000000000000..f931006cbb2b --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupProtectedItemsFromCrossTenantVaultListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +/** + * Samples for BackupProtectedItemsFromCrossTenantVault List. + */ +public final class BackupProtectedItemsFromCrossTenantVaultListSamples { + /* + * x-ms-original-file: 2026-05-31-preview/CrossTenantVaultMappingOperations/ListCrossTenantProtectedItems.json + */ + /** + * Sample code: List Protected Items From Cross-Tenant Vault. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void listProtectedItemsFromCrossTenantVault( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager.backupProtectedItemsFromCrossTenantVaults() + .list("SwaggerTestRg", "NetSDKTestRsVault", "crossTenantVaultMapping1", null, null, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupProtectedItemsListSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupProtectedItemsListSamples.java index cb5c4480a2e6..3e2316df74c8 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupProtectedItemsListSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupProtectedItemsListSamples.java @@ -9,7 +9,7 @@ */ public final class BackupProtectedItemsListSamples { /* - * x-ms-original-file: 2026-01-31-preview/AzureIaasVm/BackupProtectedItems_List.json + * x-ms-original-file: 2026-05-31-preview/AzureIaasVm/BackupProtectedItems_List.json */ /** * Sample code: List protected items with backupManagementType filter as AzureIaasVm. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupProtectionContainersListSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupProtectionContainersListSamples.java index 49ed8570d8c7..68115599220a 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupProtectionContainersListSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupProtectionContainersListSamples.java @@ -9,7 +9,7 @@ */ public final class BackupProtectionContainersListSamples { /* - * x-ms-original-file: 2026-01-31-preview/AzureStorage/ProtectionContainers_List.json + * x-ms-original-file: 2026-05-31-preview/AzureStorage/ProtectionContainers_List.json */ /** * Sample code: List Backup Protection Containers. @@ -21,4 +21,19 @@ public static void listBackupProtectionContainers( manager.backupProtectionContainers() .list("testVault", "testRg", "backupManagementType eq 'AzureWorkload'", com.azure.core.util.Context.NONE); } + + /* + * x-ms-original-file: 2026-05-31-preview/AzureStorage/ProtectionContainers_List_WithAccessType.json + */ + /** + * Sample code: List Backup Protection Containers with Access Type. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void listBackupProtectionContainersWithAccessType( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager.backupProtectionContainers() + .list("swaggertestvault", "SwaggerTestRg", "backupManagementType eq 'AzureStorage'", + com.azure.core.util.Context.NONE); + } } diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupProtectionIntentListSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupProtectionIntentListSamples.java index 46b2fcb14c55..74e2a7d844fe 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupProtectionIntentListSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupProtectionIntentListSamples.java @@ -9,7 +9,7 @@ */ public final class BackupProtectionIntentListSamples { /* - * x-ms-original-file: 2026-01-31-preview/AzureWorkload/BackupProtectionIntent_List.json + * x-ms-original-file: 2026-05-31-preview/AzureWorkload/BackupProtectionIntent_List.json */ /** * Sample code: List protection intent with backupManagementType filter. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceEncryptionConfigsGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceEncryptionConfigsGetSamples.java index 4bea6ce45bb0..f270965af297 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceEncryptionConfigsGetSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceEncryptionConfigsGetSamples.java @@ -9,7 +9,7 @@ */ public final class BackupResourceEncryptionConfigsGetSamples { /* - * x-ms-original-file: 2026-01-31-preview/BackupResourceEncryptionConfig_Get.json + * x-ms-original-file: 2026-05-31-preview/BackupResourceEncryptionConfig_Get.json */ /** * Sample code: Get Vault Encryption Configuration. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceEncryptionConfigsUpdateSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceEncryptionConfigsUpdateSamples.java index 9c6810ef8ba1..c2db5bff45de 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceEncryptionConfigsUpdateSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceEncryptionConfigsUpdateSamples.java @@ -14,7 +14,7 @@ */ public final class BackupResourceEncryptionConfigsUpdateSamples { /* - * x-ms-original-file: 2026-01-31-preview/BackupResourceEncryptionConfig_Put.json + * x-ms-original-file: 2026-05-31-preview/BackupResourceEncryptionConfig_Put.json */ /** * Sample code: Update Vault Encryption Configuration. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceStorageConfigsNonCrrGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceStorageConfigsNonCrrGetSamples.java index 3e16e1092b90..301a349bc9e1 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceStorageConfigsNonCrrGetSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceStorageConfigsNonCrrGetSamples.java @@ -9,7 +9,7 @@ */ public final class BackupResourceStorageConfigsNonCrrGetSamples { /* - * x-ms-original-file: 2026-01-31-preview/Common/BackupStorageConfig_Get.json + * x-ms-original-file: 2026-05-31-preview/Common/BackupStorageConfig_Get.json */ /** * Sample code: Get Vault Storage Configuration. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceStorageConfigsNonCrrPatchSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceStorageConfigsNonCrrPatchSamples.java index 9848eb22c24c..687bc39fc0c1 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceStorageConfigsNonCrrPatchSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceStorageConfigsNonCrrPatchSamples.java @@ -14,7 +14,7 @@ */ public final class BackupResourceStorageConfigsNonCrrPatchSamples { /* - * x-ms-original-file: 2026-01-31-preview/Common/BackupStorageConfig_Patch.json + * x-ms-original-file: 2026-05-31-preview/Common/BackupStorageConfig_Patch.json */ /** * Sample code: Update Vault Storage Configuration. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceStorageConfigsNonCrrUpdateSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceStorageConfigsNonCrrUpdateSamples.java index 64e99ab07557..c92a285426ca 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceStorageConfigsNonCrrUpdateSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceStorageConfigsNonCrrUpdateSamples.java @@ -14,7 +14,7 @@ */ public final class BackupResourceStorageConfigsNonCrrUpdateSamples { /* - * x-ms-original-file: 2026-01-31-preview/Common/BackupStorageConfig_Put.json + * x-ms-original-file: 2026-05-31-preview/Common/BackupStorageConfig_Put.json */ /** * Sample code: Update Vault Storage Configuration. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceVaultConfigsGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceVaultConfigsGetSamples.java index 4f1f5121ad39..18dd30e40973 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceVaultConfigsGetSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceVaultConfigsGetSamples.java @@ -9,7 +9,7 @@ */ public final class BackupResourceVaultConfigsGetSamples { /* - * x-ms-original-file: 2026-01-31-preview/Common/BackupResourceVaultConfigs_Get.json + * x-ms-original-file: 2026-05-31-preview/Common/BackupResourceVaultConfigs_Get.json */ /** * Sample code: Get Vault Security Config. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceVaultConfigsPutSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceVaultConfigsPutSamples.java index 654557098df0..83236c6381f6 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceVaultConfigsPutSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceVaultConfigsPutSamples.java @@ -14,7 +14,7 @@ */ public final class BackupResourceVaultConfigsPutSamples { /* - * x-ms-original-file: 2026-01-31-preview/Common/BackupResourceVaultConfigs_Put.json + * x-ms-original-file: 2026-05-31-preview/Common/BackupResourceVaultConfigs_Put.json */ /** * Sample code: Update Vault Security Config. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceVaultConfigsUpdateSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceVaultConfigsUpdateSamples.java index 82754ed22208..c0a9588e1fb7 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceVaultConfigsUpdateSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupResourceVaultConfigsUpdateSamples.java @@ -13,7 +13,7 @@ */ public final class BackupResourceVaultConfigsUpdateSamples { /* - * x-ms-original-file: 2026-01-31-preview/Common/BackupResourceVaultConfigs_Patch.json + * x-ms-original-file: 2026-05-31-preview/Common/BackupResourceVaultConfigs_Patch.json */ /** * Sample code: Update Vault Security Config. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupStatusGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupStatusGetSamples.java index 21e01820f653..9e9ba8705170 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupStatusGetSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupStatusGetSamples.java @@ -12,7 +12,7 @@ */ public final class BackupStatusGetSamples { /* - * x-ms-original-file: 2026-01-31-preview/AzureIaasVm/GetBackupStatus.json + * x-ms-original-file: 2026-05-31-preview/AzureIaasVm/GetBackupStatus.json */ /** * Sample code: Get Azure Virtual Machine Backup Status. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupUsageSummariesListSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupUsageSummariesListSamples.java index d63f97c7421d..a9ddaf07c97c 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupUsageSummariesListSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupUsageSummariesListSamples.java @@ -9,7 +9,7 @@ */ public final class BackupUsageSummariesListSamples { /* - * x-ms-original-file: 2026-01-31-preview/Common/BackupProtectedItem_UsageSummary_Get.json + * x-ms-original-file: 2026-05-31-preview/Common/BackupProtectedItem_UsageSummary_Get.json */ /** * Sample code: Get Protected Items Usages Summary. @@ -24,7 +24,7 @@ public static void getProtectedItemsUsagesSummary( } /* - * x-ms-original-file: 2026-01-31-preview/Common/BackupProtectionContainers_UsageSummary_Get.json + * x-ms-original-file: 2026-05-31-preview/Common/BackupProtectionContainers_UsageSummary_Get.json */ /** * Sample code: Get Protected Containers Usages Summary. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupWorkloadItemsListSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupWorkloadItemsListSamples.java index acf5eeb8e71f..0995b7a48ecf 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupWorkloadItemsListSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupWorkloadItemsListSamples.java @@ -9,7 +9,7 @@ */ public final class BackupWorkloadItemsListSamples { /* - * x-ms-original-file: 2026-01-31-preview/AzureWorkload/BackupWorkloadItems_List.json + * x-ms-original-file: 2026-05-31-preview/AzureWorkload/BackupWorkloadItems_List.json */ /** * Sample code: List Workload Items in Container. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupsTriggerSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupsTriggerSamples.java index 5b8685f75415..762a4b04bdea 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupsTriggerSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupsTriggerSamples.java @@ -12,7 +12,7 @@ */ public final class BackupsTriggerSamples { /* - * x-ms-original-file: 2026-01-31-preview/Common/TriggerBackup_Post.json + * x-ms-original-file: 2026-05-31-preview/Common/TriggerBackup_Post.json */ /** * Sample code: Trigger Backup. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BmsPrepareDataMoveOperationResultGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BmsPrepareDataMoveOperationResultGetSamples.java index 15f17ed355c4..2bc6f26aa11e 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BmsPrepareDataMoveOperationResultGetSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BmsPrepareDataMoveOperationResultGetSamples.java @@ -9,7 +9,7 @@ */ public final class BmsPrepareDataMoveOperationResultGetSamples { /* - * x-ms-original-file: 2026-01-31-preview/BackupDataMove/PrepareDataMoveOperationResult_Get.json + * x-ms-original-file: 2026-05-31-preview/BackupDataMove/PrepareDataMoveOperationResult_Get.json */ /** * Sample code: Get operation result for PrepareDataMove. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultCredentialGenerateSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultCredentialGenerateSamples.java new file mode 100644 index 000000000000..b928aab1c164 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultCredentialGenerateSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.resourcemanager.recoveryservicesbackup.models.VaultCredentialCertificateCreateOptions; +import com.azure.resourcemanager.recoveryservicesbackup.models.VaultCredentialCertificateRequest; + +/** + * Samples for CrossTenantVaultCredential Generate. + */ +public final class CrossTenantVaultCredentialGenerateSamples { + /* + * x-ms-original-file: 2026-05-31-preview/CrossTenantVaultMappingOperations/GenerateCrossTenantVaultCredential.json + */ + /** + * Sample code: Generate Cross-Tenant Vault Credential. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void generateCrossTenantVaultCredential( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager.crossTenantVaultCredentials() + .generate("SwaggerTestRg", "NetSDKTestRsVault", "crossTenantVaultMapping1", "cert1", + new VaultCredentialCertificateRequest().withCertificateCreateOptions( + new VaultCredentialCertificateCreateOptions().withValidityInHours(48)), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultCredentialOperationResultsGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultCredentialOperationResultsGetSamples.java new file mode 100644 index 000000000000..4336a4d1ce59 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultCredentialOperationResultsGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +/** + * Samples for CrossTenantVaultCredentialOperationResults Get. + */ +public final class CrossTenantVaultCredentialOperationResultsGetSamples { + /* + * x-ms-original-file: 2026-05-31-preview/CrossTenantVaultMappingOperations/GetVaultCredentialOperationResult.json + */ + /** + * Sample code: Get Vault Credential Operation Result. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getVaultCredentialOperationResult( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager.crossTenantVaultCredentialOperationResults() + .get("SwaggerTestRg", "NetSDKTestRsVault", "crossTenantVaultMapping1", "cert1", + "00000000-0000-0000-0000-000000000000", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultCredentialOperationStatusesGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultCredentialOperationStatusesGetSamples.java new file mode 100644 index 000000000000..7880e8ae65b3 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultCredentialOperationStatusesGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +/** + * Samples for CrossTenantVaultCredentialOperationStatuses Get. + */ +public final class CrossTenantVaultCredentialOperationStatusesGetSamples { + /* + * x-ms-original-file: 2026-05-31-preview/CrossTenantVaultMappingOperations/GetVaultCredentialOperationStatus.json + */ + /** + * Sample code: Get Vault Credential Operation Status. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getVaultCredentialOperationStatus( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager.crossTenantVaultCredentialOperationStatuses() + .getWithResponse("SwaggerTestRg", "NetSDKTestRsVault", "crossTenantVaultMapping1", "cert1", + "00000000-0000-0000-0000-000000000000", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultMappingStatusCheckSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultMappingStatusCheckSamples.java new file mode 100644 index 000000000000..bedfaf0672f4 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultMappingStatusCheckSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +/** + * Samples for CrossTenantVaultMappingStatus Check. + */ +public final class CrossTenantVaultMappingStatusCheckSamples { + /* + * x-ms-original-file: 2026-05-31-preview/CrossTenantVaultMappingOperations/CheckVaultMappingStatus.json + */ + /** + * Sample code: Check Vault Mapping Status. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void checkVaultMappingStatus( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager.crossTenantVaultMappingStatus() + .checkWithResponse("SwaggerTestRg", "NetSDKTestRsVault", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultMappingsCreateOrUpdateSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultMappingsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..ec3100b0982c --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultMappingsCreateOrUpdateSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.resourcemanager.recoveryservicesbackup.models.CrossTenantVaultMappingProperties; + +/** + * Samples for CrossTenantVaultMappings CreateOrUpdate. + */ +public final class CrossTenantVaultMappingsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-05-31-preview/CrossTenantVaultMappingOperations/CreateCrossTenantVaultMapping.json + */ + /** + * Sample code: Create Cross Tenant Vault Mapping. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void createCrossTenantVaultMapping( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager.crossTenantVaultMappings() + .define("crossTenantVaultMapping1") + .withExistingVault("SwaggerTestRg", "NetSDKTestRsVault") + .withProperties(new CrossTenantVaultMappingProperties().withSourceVaultId( + "/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/SourceRG/providers/Microsoft.RecoveryServices/vaults/SourceVault")) + .create(); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultMappingsGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultMappingsGetSamples.java new file mode 100644 index 000000000000..d05d104ef27c --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultMappingsGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +/** + * Samples for CrossTenantVaultMappings Get. + */ +public final class CrossTenantVaultMappingsGetSamples { + /* + * x-ms-original-file: 2026-05-31-preview/CrossTenantVaultMappingOperations/GetCrossTenantVaultMapping.json + */ + /** + * Sample code: Get Cross Tenant Vault Mapping. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getCrossTenantVaultMapping( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager.crossTenantVaultMappings() + .getWithResponse("SwaggerTestRg", "NetSDKTestRsVault", "crossTenantVaultMapping1", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultMappingsListSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultMappingsListSamples.java new file mode 100644 index 000000000000..e471e44a66a8 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultMappingsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +/** + * Samples for CrossTenantVaultMappings List. + */ +public final class CrossTenantVaultMappingsListSamples { + /* + * x-ms-original-file: 2026-05-31-preview/CrossTenantVaultMappingOperations/ListCrossTenantVaultMappings.json + */ + /** + * Sample code: List Cross Tenant Vault Mappings. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void listCrossTenantVaultMappings( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager.crossTenantVaultMappings().list("SwaggerTestRg", "NetSDKTestRsVault", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultMappingsRemoveSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultMappingsRemoveSamples.java new file mode 100644 index 000000000000..f28c13e845ac --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultMappingsRemoveSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.resourcemanager.recoveryservicesbackup.models.RemoveCrossTenantVaultMappingRequest; +import java.util.Arrays; + +/** + * Samples for CrossTenantVaultMappings Remove. + */ +public final class CrossTenantVaultMappingsRemoveSamples { + /* + * x-ms-original-file: 2026-05-31-preview/CrossTenantVaultMappingOperations/RemoveCrossTenantVaultMapping.json + */ + /** + * Sample code: Remove Cross Tenant Vault Mapping. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void removeCrossTenantVaultMapping( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager.crossTenantVaultMappings() + .remove("SwaggerTestRg", "NetSDKTestRsVault", "crossTenantVaultMapping1", + new RemoveCrossTenantVaultMappingRequest().withResourceGuardOperationRequests(Arrays.asList()), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultRecoveryPointOperationGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultRecoveryPointOperationGetSamples.java new file mode 100644 index 000000000000..7c6cc26dd2a0 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultRecoveryPointOperationGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +/** + * Samples for CrossTenantVaultRecoveryPointOperation Get. + */ +public final class CrossTenantVaultRecoveryPointOperationGetSamples { + /* + * x-ms-original-file: + * 2026-05-31-preview/CrossTenantVaultMappingOperations/GetRecoveryPointFromCrossTenantVault.json + */ + /** + * Sample code: Get Recovery Point From Cross-Tenant Vault. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getRecoveryPointFromCrossTenantVault( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager.crossTenantVaultRecoveryPointOperations() + .getWithResponse("SwaggerTestRg", "NetSDKTestRsVault", "crossTenantVaultMapping1", "Azure", + "IaasVMContainer;iaasvmcontainerv2;SwaggerTestRg;testVM", "VM;iaasvmcontainerv2;SwaggerTestRg;testVM", + "348916168024334", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultRecoveryPointsListSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultRecoveryPointsListSamples.java new file mode 100644 index 000000000000..20fea84ae387 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultRecoveryPointsListSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +/** + * Samples for CrossTenantVaultRecoveryPoints List. + */ +public final class CrossTenantVaultRecoveryPointsListSamples { + /* + * x-ms-original-file: 2026-05-31-preview/CrossTenantVaultMappingOperations/GetCrossTenantRecoveryPoints.json + */ + /** + * Sample code: List Recovery Points From Cross-Tenant Vault. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void listRecoveryPointsFromCrossTenantVault( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager.crossTenantVaultRecoveryPoints() + .list("SwaggerTestRg", "NetSDKTestRsVault", "crossTenantVaultMapping1", "Azure", + "IaasVMContainer;iaasvmcontainerv2;SwaggerTestRg;testVM", "VM;iaasvmcontainerv2;SwaggerTestRg;testVM", + null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/DeletedProtectionContainersListSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/DeletedProtectionContainersListSamples.java index 126ebcf7cdcb..c25db7997eb9 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/DeletedProtectionContainersListSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/DeletedProtectionContainersListSamples.java @@ -9,7 +9,7 @@ */ public final class DeletedProtectionContainersListSamples { /* - * x-ms-original-file: 2026-01-31-preview/AzureStorage/SoftDeletedContainers_List.json + * x-ms-original-file: 2026-05-31-preview/AzureStorage/SoftDeletedContainers_List.json */ /** * Sample code: List Backup Protection Containers. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ExportJobsOperationResultsGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ExportJobsOperationResultsGetSamples.java index db4ad36f3953..d6b29c2fd251 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ExportJobsOperationResultsGetSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ExportJobsOperationResultsGetSamples.java @@ -9,7 +9,7 @@ */ public final class ExportJobsOperationResultsGetSamples { /* - * x-ms-original-file: 2026-01-31-preview/Common/ExportJobsOperationResult.json + * x-ms-original-file: 2026-05-31-preview/Common/ExportJobsOperationResult.json */ /** * Sample code: Export Jobs Operation Results. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/FeatureSupportValidateSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/FeatureSupportValidateSamples.java index ea7aa441790f..761eb148d320 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/FeatureSupportValidateSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/FeatureSupportValidateSamples.java @@ -11,7 +11,7 @@ */ public final class FeatureSupportValidateSamples { /* - * x-ms-original-file: 2026-01-31-preview/AzureIaasVm/BackupFeature_Validate.json + * x-ms-original-file: 2026-05-31-preview/AzureIaasVm/BackupFeature_Validate.json */ /** * Sample code: Check Azure Vm Backup Feature Support. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/FetchTieringCostPostSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/FetchTieringCostPostSamples.java index 3fd8a655944a..d6f1c25ec9df 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/FetchTieringCostPostSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/FetchTieringCostPostSamples.java @@ -16,7 +16,7 @@ */ public final class FetchTieringCostPostSamples { /* - * x-ms-original-file: 2026-01-31-preview/TieringCost/FetchTieringCostForRehydrate.json + * x-ms-original-file: 2026-05-31-preview/TieringCost/FetchTieringCostForRehydrate.json */ /** * Sample code: Get the rehydration cost for recovery point. @@ -37,7 +37,7 @@ public static void getTheRehydrationCostForRecoveryPoint( } /* - * x-ms-original-file: 2026-01-31-preview/TieringCost/FetchTieringCostForProtectedItem.json + * x-ms-original-file: 2026-05-31-preview/TieringCost/FetchTieringCostForProtectedItem.json */ /** * Sample code: Get the tiering savings cost info for protected item. @@ -57,7 +57,7 @@ public static void getTheTieringSavingsCostInfoForProtectedItem( } /* - * x-ms-original-file: 2026-01-31-preview/TieringCost/FetchTieringCostForPolicy.json + * x-ms-original-file: 2026-05-31-preview/TieringCost/FetchTieringCostForPolicy.json */ /** * Sample code: Get the tiering savings cost info for policy. @@ -75,7 +75,7 @@ public static void getTheTieringSavingsCostInfoForPolicy( } /* - * x-ms-original-file: 2026-01-31-preview/TieringCost/FetchTieringCostForVault.json + * x-ms-original-file: 2026-05-31-preview/TieringCost/FetchTieringCostForVault.json */ /** * Sample code: Get the tiering savings cost info for vault. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/GetTieringCostOperationResultGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/GetTieringCostOperationResultGetSamples.java index 9657bb634eb4..901ec116acd0 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/GetTieringCostOperationResultGetSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/GetTieringCostOperationResultGetSamples.java @@ -9,7 +9,7 @@ */ public final class GetTieringCostOperationResultGetSamples { /* - * x-ms-original-file: 2026-01-31-preview/TieringCost/GetTieringCostOperationResult.json + * x-ms-original-file: 2026-05-31-preview/TieringCost/GetTieringCostOperationResult.json */ /** * Sample code: Fetch Tiering Cost Operation Result. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ItemLevelRecoveryConnectionsProvisionSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ItemLevelRecoveryConnectionsProvisionSamples.java index a00dc85334a4..b7d27798aaf2 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ItemLevelRecoveryConnectionsProvisionSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ItemLevelRecoveryConnectionsProvisionSamples.java @@ -12,7 +12,7 @@ */ public final class ItemLevelRecoveryConnectionsProvisionSamples { /* - * x-ms-original-file: 2026-01-31-preview/AzureIaasVm/Provision_Ilr.json + * x-ms-original-file: 2026-05-31-preview/AzureIaasVm/Provision_Ilr.json */ /** * Sample code: Provision Instant Item Level Recovery for Azure Vm. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ItemLevelRecoveryConnectionsRevokeSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ItemLevelRecoveryConnectionsRevokeSamples.java index a69586ad7c67..888f5c475d6d 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ItemLevelRecoveryConnectionsRevokeSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ItemLevelRecoveryConnectionsRevokeSamples.java @@ -9,7 +9,7 @@ */ public final class ItemLevelRecoveryConnectionsRevokeSamples { /* - * x-ms-original-file: 2026-01-31-preview/AzureIaasVm/Revoke_Ilr.json + * x-ms-original-file: 2026-05-31-preview/AzureIaasVm/Revoke_Ilr.json */ /** * Sample code: Revoke Instant Item Level Recovery for Azure Vm. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/JobCancellationsTriggerSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/JobCancellationsTriggerSamples.java index 65d59793c60e..3139a93e3b69 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/JobCancellationsTriggerSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/JobCancellationsTriggerSamples.java @@ -9,7 +9,7 @@ */ public final class JobCancellationsTriggerSamples { /* - * x-ms-original-file: 2026-01-31-preview/Common/TriggerCancelJob.json + * x-ms-original-file: 2026-05-31-preview/Common/TriggerCancelJob.json */ /** * Sample code: Cancel Job. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/JobDetailsFromCrossTenantVaultGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/JobDetailsFromCrossTenantVaultGetSamples.java new file mode 100644 index 000000000000..2746621999b0 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/JobDetailsFromCrossTenantVaultGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +/** + * Samples for JobDetailsFromCrossTenantVault Get. + */ +public final class JobDetailsFromCrossTenantVaultGetSamples { + /* + * x-ms-original-file: 2026-05-31-preview/CrossTenantVaultMappingOperations/GetCrossTenantJobDetails.json + */ + /** + * Sample code: Get Cross-Tenant Job Details. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getCrossTenantJobDetails( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager.jobDetailsFromCrossTenantVaults() + .getWithResponse("SwaggerTestRg", "NetSDKTestRsVault", "crossTenantVaultMapping1", + "00000000-0000-0000-0000-000000000000", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/JobDetailsGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/JobDetailsGetSamples.java index 299d0ed6b077..922807205929 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/JobDetailsGetSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/JobDetailsGetSamples.java @@ -9,7 +9,7 @@ */ public final class JobDetailsGetSamples { /* - * x-ms-original-file: 2026-01-31-preview/Common/GetJobDetails.json + * x-ms-original-file: 2026-05-31-preview/Common/GetJobDetails.json */ /** * Sample code: Get Job Details. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/JobOperationResultsGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/JobOperationResultsGetSamples.java index e253d8847e16..ada950b31118 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/JobOperationResultsGetSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/JobOperationResultsGetSamples.java @@ -9,7 +9,7 @@ */ public final class JobOperationResultsGetSamples { /* - * x-ms-original-file: 2026-01-31-preview/Common/CancelJobOperationResult.json + * x-ms-original-file: 2026-05-31-preview/Common/CancelJobOperationResult.json */ /** * Sample code: Cancel Job Operation Result. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/JobsExportSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/JobsExportSamples.java index 7fc28fcdf499..488cba4b154f 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/JobsExportSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/JobsExportSamples.java @@ -9,7 +9,7 @@ */ public final class JobsExportSamples { /* - * x-ms-original-file: 2026-01-31-preview/Common/TriggerExportJobs.json + * x-ms-original-file: 2026-05-31-preview/Common/TriggerExportJobs.json */ /** * Sample code: Export Jobs. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/OperationFromCrossTenantVaultValidateSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/OperationFromCrossTenantVaultValidateSamples.java new file mode 100644 index 000000000000..c7d4e6a08205 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/OperationFromCrossTenantVaultValidateSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.resourcemanager.recoveryservicesbackup.models.IaasVMRestoreRequest; +import com.azure.resourcemanager.recoveryservicesbackup.models.RecoveryType; +import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateIaasVMRestoreOperationRequest; +import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperationRequestResource; + +/** + * Samples for OperationFromCrossTenantVault Validate. + */ +public final class OperationFromCrossTenantVaultValidateSamples { + /* + * x-ms-original-file: 2026-05-31-preview/CrossTenantVaultMappingOperations/ValidateOperation.json + */ + /** + * Sample code: Validate Cross-Tenant Backup Operation. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void validateCrossTenantBackupOperation( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager.operationFromCrossTenantVaults() + .validateWithResponse("SwaggerTestRg", "NetSDKTestRsVault", "crossTenantVaultMapping1", + new ValidateOperationRequestResource().withId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupCrossTenantVaultMappings/crossTenantVaultMapping1") + .withProperties(new ValidateIaasVMRestoreOperationRequest() + .withRestoreRequest(new IaasVMRestoreRequest().withRecoveryPointId("348916168024334") + .withRecoveryType(RecoveryType.RESTORE_DISKS) + .withSourceResourceId( + "/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/SourceRG/providers/Microsoft.Compute/virtualMachines/testVM") + .withStorageAccountId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.Storage/storageAccounts/swaggertestaccount") + .withRegion("westus"))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/OperationOperationValidateSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/OperationOperationValidateSamples.java index 1fec83edb606..cb193e70fb64 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/OperationOperationValidateSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/OperationOperationValidateSamples.java @@ -17,7 +17,7 @@ */ public final class OperationOperationValidateSamples { /* - * x-ms-original-file: 2026-01-31-preview/AzureIaasVm/ValidateOperation_RestoreDisk.json + * x-ms-original-file: 2026-05-31-preview/AzureIaasVm/ValidateOperation_RestoreDisk.json */ /** * Sample code: Validate Operation. @@ -47,7 +47,7 @@ public final class OperationOperationValidateSamples { } /* - * x-ms-original-file: 2026-01-31-preview/AzureIaasVm/ValidateOperation_RestoreDisk_IdentityBasedRestoreDetails.json + * x-ms-original-file: 2026-05-31-preview/AzureIaasVm/ValidateOperation_RestoreDisk_IdentityBasedRestoreDetails.json */ /** * Sample code: Validate Operation with identityBasedRestoreDetails. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/OperationsListSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/OperationsListSamples.java index c29ad2ea5baa..519bd00254a8 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/OperationsListSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/OperationsListSamples.java @@ -9,7 +9,7 @@ */ public final class OperationsListSamples { /* - * x-ms-original-file: 2026-01-31-preview/ListOperations.json + * x-ms-original-file: 2026-05-31-preview/ListOperations.json */ /** * Sample code: ListOperations. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/PrivateEndpointConnectionDeleteSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/PrivateEndpointConnectionDeleteSamples.java index e62d65b3fc4c..51439382c246 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/PrivateEndpointConnectionDeleteSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/PrivateEndpointConnectionDeleteSamples.java @@ -9,7 +9,7 @@ */ public final class PrivateEndpointConnectionDeleteSamples { /* - * x-ms-original-file: 2026-01-31-preview/PrivateEndpointConnection/DeletePrivateEndpointConnection.json + * x-ms-original-file: 2026-05-31-preview/PrivateEndpointConnection/DeletePrivateEndpointConnection.json */ /** * Sample code: Delete PrivateEndpointConnection. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/PrivateEndpointConnectionGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/PrivateEndpointConnectionGetSamples.java index a587b94505c1..3dce9537ddbb 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/PrivateEndpointConnectionGetSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/PrivateEndpointConnectionGetSamples.java @@ -9,7 +9,7 @@ */ public final class PrivateEndpointConnectionGetSamples { /* - * x-ms-original-file: 2026-01-31-preview/PrivateEndpointConnection/GetPrivateEndpointConnection.json + * x-ms-original-file: 2026-05-31-preview/PrivateEndpointConnection/GetPrivateEndpointConnection.json */ /** * Sample code: Get PrivateEndpointConnection. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/PrivateEndpointConnectionPutSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/PrivateEndpointConnectionPutSamples.java index 9b7d250a7470..effff5e35acc 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/PrivateEndpointConnectionPutSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/PrivateEndpointConnectionPutSamples.java @@ -18,7 +18,7 @@ */ public final class PrivateEndpointConnectionPutSamples { /* - * x-ms-original-file: 2026-01-31-preview/PrivateEndpointConnection/PutPrivateEndpointConnection.json + * x-ms-original-file: 2026-05-31-preview/PrivateEndpointConnection/PutPrivateEndpointConnection.json */ /** * Sample code: Update PrivateEndpointConnection. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/PrivateEndpointGetOperationStatusSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/PrivateEndpointGetOperationStatusSamples.java index 142b4131469c..195f36571687 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/PrivateEndpointGetOperationStatusSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/PrivateEndpointGetOperationStatusSamples.java @@ -9,7 +9,7 @@ */ public final class PrivateEndpointGetOperationStatusSamples { /* - * x-ms-original-file: 2026-01-31-preview/PrivateEndpointConnection/GetPrivateEndpointConnectionOperationStatus.json + * x-ms-original-file: 2026-05-31-preview/PrivateEndpointConnection/GetPrivateEndpointConnectionOperationStatus.json */ /** * Sample code: Get OperationStatus. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectableContainersListSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectableContainersListSamples.java index 765d7224e05f..e7db04bd5162 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectableContainersListSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectableContainersListSamples.java @@ -9,7 +9,7 @@ */ public final class ProtectableContainersListSamples { /* - * x-ms-original-file: 2026-01-31-preview/AzureStorage/ProtectableContainers_List.json + * x-ms-original-file: 2026-05-31-preview/AzureStorage/ProtectableContainers_List.json */ /** * Sample code: List protectable items with backupManagementType filter as AzureStorage. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectedItemFromCrossTenantVaultGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectedItemFromCrossTenantVaultGetSamples.java new file mode 100644 index 000000000000..8035188311b4 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectedItemFromCrossTenantVaultGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +/** + * Samples for ProtectedItemFromCrossTenantVault Get. + */ +public final class ProtectedItemFromCrossTenantVaultGetSamples { + /* + * x-ms-original-file: + * 2026-05-31-preview/CrossTenantVaultMappingOperations/GetProtectedItemFromCrossTenantVault.json + */ + /** + * Sample code: Get Protected Item From Cross-Tenant Vault. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getProtectedItemFromCrossTenantVault( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager.protectedItemFromCrossTenantVaults() + .getWithResponse("SwaggerTestRg", "NetSDKTestRsVault", "crossTenantVaultMapping1", "Azure", + "IaasVMContainer;iaasvmcontainerv2;SwaggerTestRg;testVM", "VM;iaasvmcontainerv2;SwaggerTestRg;testVM", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectedItemOperationResultsFromCrossTenantVaultGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectedItemOperationResultsFromCrossTenantVaultGetSamples.java new file mode 100644 index 000000000000..b72770c81e28 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectedItemOperationResultsFromCrossTenantVaultGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +/** + * Samples for ProtectedItemOperationResultsFromCrossTenantVault Get. + */ +public final class ProtectedItemOperationResultsFromCrossTenantVaultGetSamples { + /* + * x-ms-original-file: 2026-05-31-preview/CrossTenantVaultMappingOperations/GetCrossTenantOperationResult.json + */ + /** + * Sample code: Get Cross-Tenant Operation Result. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getCrossTenantOperationResult( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager.protectedItemOperationResultsFromCrossTenantVaults() + .get("SwaggerTestRg", "NetSDKTestRsVault", "crossTenantVaultMapping1", "Azure", + "IaasVMContainer;iaasvmcontainerv2;SwaggerTestRg;testVM", "VM;iaasvmcontainerv2;SwaggerTestRg;testVM", + "00000000-0000-0000-0000-000000000000", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectedItemOperationResultsGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectedItemOperationResultsGetSamples.java index 2e58ec275362..5ef6eeda33da 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectedItemOperationResultsGetSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectedItemOperationResultsGetSamples.java @@ -9,7 +9,7 @@ */ public final class ProtectedItemOperationResultsGetSamples { /* - * x-ms-original-file: 2026-01-31-preview/AzureIaasVm/ProtectedItemOperationResults.json + * x-ms-original-file: 2026-05-31-preview/AzureIaasVm/ProtectedItemOperationResults.json */ /** * Sample code: Get Operation Results of Protected Vm. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectedItemOperationStatusesFromCrossTenantVaultGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectedItemOperationStatusesFromCrossTenantVaultGetSamples.java new file mode 100644 index 000000000000..416d054d4d5b --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectedItemOperationStatusesFromCrossTenantVaultGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +/** + * Samples for ProtectedItemOperationStatusesFromCrossTenantVault Get. + */ +public final class ProtectedItemOperationStatusesFromCrossTenantVaultGetSamples { + /* + * x-ms-original-file: 2026-05-31-preview/CrossTenantVaultMappingOperations/GetCrossTenantOperationStatus.json + */ + /** + * Sample code: Get Cross-Tenant Operation Status. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getCrossTenantOperationStatus( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager.protectedItemOperationStatusesFromCrossTenantVaults() + .getWithResponse("SwaggerTestRg", "NetSDKTestRsVault", "crossTenantVaultMapping1", "Azure", + "IaasVMContainer;iaasvmcontainerv2;SwaggerTestRg;testVM", "VM;iaasvmcontainerv2;SwaggerTestRg;testVM", + "00000000-0000-0000-0000-000000000000", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectedItemOperationStatusesGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectedItemOperationStatusesGetSamples.java index dfaa08dd4acc..ee66619da6b0 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectedItemOperationStatusesGetSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectedItemOperationStatusesGetSamples.java @@ -9,7 +9,7 @@ */ public final class ProtectedItemOperationStatusesGetSamples { /* - * x-ms-original-file: 2026-01-31-preview/AzureIaasVm/ProtectedItemOperationStatus.json + * x-ms-original-file: 2026-05-31-preview/AzureIaasVm/ProtectedItemOperationStatus.json */ /** * Sample code: Get Operation Status of Protected Vm. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectedItemsCreateOrUpdateSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectedItemsCreateOrUpdateSamples.java index 405eab430fea..e9b610229830 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectedItemsCreateOrUpdateSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectedItemsCreateOrUpdateSamples.java @@ -12,7 +12,7 @@ */ public final class ProtectedItemsCreateOrUpdateSamples { /* - * x-ms-original-file: 2026-01-31-preview/AzureIaasVm/StopProtection.json + * x-ms-original-file: 2026-05-31-preview/AzureIaasVm/StopProtection.json */ /** * Sample code: Stop Protection with retain data on Azure IaasVm. @@ -32,7 +32,7 @@ public static void stopProtectionWithRetainDataOnAzureIaasVm( } /* - * x-ms-original-file: 2026-01-31-preview/AzureIaasVm/ConfigureProtection.json + * x-ms-original-file: 2026-05-31-preview/AzureIaasVm/ConfigureProtection.json */ /** * Sample code: Enable Protection on Azure IaasVm. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectedItemsDeleteSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectedItemsDeleteSamples.java index baed0f417868..10df6eb0d104 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectedItemsDeleteSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectedItemsDeleteSamples.java @@ -9,7 +9,7 @@ */ public final class ProtectedItemsDeleteSamples { /* - * x-ms-original-file: 2026-01-31-preview/Common/ProtectedItem_Delete.json + * x-ms-original-file: 2026-05-31-preview/Common/ProtectedItem_Delete.json */ /** * Sample code: Delete Protection from Azure Virtual Machine. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectedItemsGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectedItemsGetSamples.java index 66bd5779d029..ef50496bfc13 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectedItemsGetSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectedItemsGetSamples.java @@ -9,7 +9,7 @@ */ public final class ProtectedItemsGetSamples { /* - * x-ms-original-file: 2026-01-31-preview/AzureIaasVm/ClassicCompute_ProtectedItem_Get.json + * x-ms-original-file: 2026-05-31-preview/AzureIaasVm/ClassicCompute_ProtectedItem_Get.json */ /** * Sample code: Get Protected Classic Virtual Machine Details. @@ -25,7 +25,7 @@ public static void getProtectedClassicVirtualMachineDetails( } /* - * x-ms-original-file: 2026-01-31-preview/AzureIaasVm/Compute_ProtectedItem_Get.json + * x-ms-original-file: 2026-05-31-preview/AzureIaasVm/Compute_ProtectedItem_Get.json */ /** * Sample code: Get Protected Virtual Machine Details. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainerOperationResultsGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainerOperationResultsGetSamples.java index 7ed49c81ed3c..39759a1cfe3b 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainerOperationResultsGetSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainerOperationResultsGetSamples.java @@ -9,7 +9,7 @@ */ public final class ProtectionContainerOperationResultsGetSamples { /* - * x-ms-original-file: 2026-01-31-preview/AzureStorage/ProtectionContainers_Inquire_Result.json + * x-ms-original-file: 2026-05-31-preview/AzureStorage/ProtectionContainers_Inquire_Result.json */ /** * Sample code: Get Azure Storage Protection Container Operation Result. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainerRefreshOperationResultsGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainerRefreshOperationResultsGetSamples.java index 3addaa26f30c..3319eb5c6f18 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainerRefreshOperationResultsGetSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainerRefreshOperationResultsGetSamples.java @@ -9,7 +9,7 @@ */ public final class ProtectionContainerRefreshOperationResultsGetSamples { /* - * x-ms-original-file: 2026-01-31-preview/Common/RefreshContainers_OperationResults.json + * x-ms-original-file: 2026-05-31-preview/Common/RefreshContainers_OperationResults.json */ /** * Sample code: Azure Vm Discovery Operation Result. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainersGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainersGetSamples.java index eabc946d86af..31166a44532d 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainersGetSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainersGetSamples.java @@ -9,7 +9,7 @@ */ public final class ProtectionContainersGetSamples { /* - * x-ms-original-file: 2026-01-31-preview/AzureWorkload/ProtectionContainers_Get.json + * x-ms-original-file: 2026-05-31-preview/AzureWorkload/ProtectionContainers_Get.json */ /** * Sample code: Get Protection Container Details. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainersInquireSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainersInquireSamples.java index 48bdbaa55db3..db9e4ff1ae80 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainersInquireSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainersInquireSamples.java @@ -9,7 +9,7 @@ */ public final class ProtectionContainersInquireSamples { /* - * x-ms-original-file: 2026-01-31-preview/AzureStorage/ProtectionContainers_Inquire.json + * x-ms-original-file: 2026-05-31-preview/AzureStorage/ProtectionContainers_Inquire.json */ /** * Sample code: Inquire Azure Storage Protection Containers. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainersRefreshSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainersRefreshSamples.java index 69e6017025f3..bd3e04393844 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainersRefreshSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainersRefreshSamples.java @@ -9,7 +9,7 @@ */ public final class ProtectionContainersRefreshSamples { /* - * x-ms-original-file: 2026-01-31-preview/Common/RefreshContainers.json + * x-ms-original-file: 2026-05-31-preview/Common/RefreshContainers.json */ /** * Sample code: Trigger Azure Vm Discovery. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainersRegisterSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainersRegisterSamples.java index b6aae9ce89f6..4018abbcf435 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainersRegisterSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainersRegisterSamples.java @@ -4,16 +4,45 @@ package com.azure.resourcemanager.recoveryservicesbackup.generated; +import com.azure.resourcemanager.recoveryservicesbackup.models.AccessType; import com.azure.resourcemanager.recoveryservicesbackup.models.AcquireStorageAccountLock; import com.azure.resourcemanager.recoveryservicesbackup.models.AzureStorageContainer; import com.azure.resourcemanager.recoveryservicesbackup.models.BackupManagementType; +import com.azure.resourcemanager.recoveryservicesbackup.models.IdentityInfo; +import com.azure.resourcemanager.recoveryservicesbackup.models.OperationType; /** * Samples for ProtectionContainers Register. */ public final class ProtectionContainersRegisterSamples { /* - * x-ms-original-file: 2026-01-31-preview/AzureStorage/ProtectionContainers_Register.json + * x-ms-original-file: 2026-05-31-preview/AzureStorage/ProtectionContainers_ReRegister_SwitchToUAMI.json + */ + /** + * Sample code: Re-register Azure Storage ProtectionContainers switching to User Assigned Managed Identity. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void reRegisterAzureStorageProtectionContainersSwitchingToUserAssignedManagedIdentity( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager.protectionContainers() + .define("StorageContainer;Storage;SwaggerTestRg;swaggertestsa") + .withExistingBackupFabric("swaggertestvault", "SwaggerTestRg", "Azure") + .withProperties(new AzureStorageContainer().withFriendlyName("swaggertestsa") + .withBackupManagementType(BackupManagementType.AZURE_STORAGE) + .withSourceResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/SwaggerTestRg/providers/Microsoft.Storage/storageAccounts/swaggertestsa") + .withAcquireStorageAccountLock(AcquireStorageAccountLock.ACQUIRE) + .withOperationType(OperationType.REREGISTER) + .withAccessType(AccessType.IDENTITY_BASED) + .withIdentityInfo(new IdentityInfo().withIsSystemAssignedIdentity(false) + .withManagedIdentityResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/SwaggerTestRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/swaggertestuami"))) + .create(); + } + + /* + * x-ms-original-file: 2026-05-31-preview/AzureStorage/ProtectionContainers_Register.json */ /** * Sample code: RegisterAzure Storage ProtectionContainers. @@ -32,4 +61,76 @@ public static void registerAzureStorageProtectionContainers( .withAcquireStorageAccountLock(AcquireStorageAccountLock.ACQUIRE)) .create(); } + + /* + * x-ms-original-file: 2026-05-31-preview/AzureStorage/ProtectionContainers_ReRegister_SwitchToSAMI.json + */ + /** + * Sample code: Re-register Azure Storage ProtectionContainers switching to System Assigned Managed Identity. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void reRegisterAzureStorageProtectionContainersSwitchingToSystemAssignedManagedIdentity( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager.protectionContainers() + .define("StorageContainer;Storage;SwaggerTestRg;swaggertestsa") + .withExistingBackupFabric("swaggertestvault", "SwaggerTestRg", "Azure") + .withProperties(new AzureStorageContainer().withFriendlyName("swaggertestsa") + .withBackupManagementType(BackupManagementType.AZURE_STORAGE) + .withSourceResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/SwaggerTestRg/providers/Microsoft.Storage/storageAccounts/swaggertestsa") + .withAcquireStorageAccountLock(AcquireStorageAccountLock.ACQUIRE) + .withOperationType(OperationType.REREGISTER) + .withAccessType(AccessType.IDENTITY_BASED) + .withIdentityInfo(new IdentityInfo().withIsSystemAssignedIdentity(true))) + .create(); + } + + /* + * x-ms-original-file: 2026-05-31-preview/AzureStorage/ProtectionContainers_Register_WithSAMI.json + */ + /** + * Sample code: Register Azure Storage ProtectionContainers with System Assigned Managed Identity. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void registerAzureStorageProtectionContainersWithSystemAssignedManagedIdentity( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager.protectionContainers() + .define("StorageContainer;Storage;SwaggerTestRg;swaggertestsa") + .withExistingBackupFabric("swaggertestvault", "SwaggerTestRg", "Azure") + .withProperties(new AzureStorageContainer().withFriendlyName("swaggertestsa") + .withBackupManagementType(BackupManagementType.AZURE_STORAGE) + .withSourceResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/SwaggerTestRg/providers/Microsoft.Storage/storageAccounts/swaggertestsa") + .withAcquireStorageAccountLock(AcquireStorageAccountLock.ACQUIRE) + .withAccessType(AccessType.IDENTITY_BASED) + .withIdentityInfo(new IdentityInfo().withIsSystemAssignedIdentity(true))) + .create(); + } + + /* + * x-ms-original-file: 2026-05-31-preview/AzureStorage/ProtectionContainers_Register_WithUAMI.json + */ + /** + * Sample code: Register Azure Storage ProtectionContainers with User Assigned Managed Identity. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void registerAzureStorageProtectionContainersWithUserAssignedManagedIdentity( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager.protectionContainers() + .define("StorageContainer;Storage;SwaggerTestRg;swaggertestsa") + .withExistingBackupFabric("swaggertestvault", "SwaggerTestRg", "Azure") + .withProperties(new AzureStorageContainer().withFriendlyName("swaggertestsa") + .withBackupManagementType(BackupManagementType.AZURE_STORAGE) + .withSourceResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/SwaggerTestRg/providers/Microsoft.Storage/storageAccounts/swaggertestsa") + .withAcquireStorageAccountLock(AcquireStorageAccountLock.ACQUIRE) + .withAccessType(AccessType.IDENTITY_BASED) + .withIdentityInfo(new IdentityInfo().withIsSystemAssignedIdentity(false) + .withManagedIdentityResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/SwaggerTestRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/swaggertestuami"))) + .create(); + } } diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainersUnregisterSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainersUnregisterSamples.java index 50c58bd99a69..9edafb182c32 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainersUnregisterSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionContainersUnregisterSamples.java @@ -9,7 +9,7 @@ */ public final class ProtectionContainersUnregisterSamples { /* - * x-ms-original-file: 2026-01-31-preview/AzureWorkload/ProtectionContainers_Unregister.json + * x-ms-original-file: 2026-05-31-preview/AzureWorkload/ProtectionContainers_Unregister.json */ /** * Sample code: Unregister Protection Container. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionIntentCreateOrUpdateSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionIntentCreateOrUpdateSamples.java index 6b750473eb3c..81b3bb7b78b3 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionIntentCreateOrUpdateSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionIntentCreateOrUpdateSamples.java @@ -11,7 +11,7 @@ */ public final class ProtectionIntentCreateOrUpdateSamples { /* - * x-ms-original-file: 2026-01-31-preview/AzureIaasVm/ProtectionIntent_CreateOrUpdate.json + * x-ms-original-file: 2026-05-31-preview/AzureIaasVm/ProtectionIntent_CreateOrUpdate.json */ /** * Sample code: Create or Update Azure Vm Protection Intent. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionIntentDeleteSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionIntentDeleteSamples.java index e093d6b7881b..d55f00f58e44 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionIntentDeleteSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionIntentDeleteSamples.java @@ -9,7 +9,7 @@ */ public final class ProtectionIntentDeleteSamples { /* - * x-ms-original-file: 2026-01-31-preview/AzureWorkload/BackupProtectionIntent_Delete.json + * x-ms-original-file: 2026-05-31-preview/AzureWorkload/BackupProtectionIntent_Delete.json */ /** * Sample code: Delete Protection intent from item. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionIntentGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionIntentGetSamples.java index fccaccc11551..7e445928cd11 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionIntentGetSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionIntentGetSamples.java @@ -9,7 +9,7 @@ */ public final class ProtectionIntentGetSamples { /* - * x-ms-original-file: 2026-01-31-preview/AzureWorkload/BackupProtectionIntent_Get.json + * x-ms-original-file: 2026-05-31-preview/AzureWorkload/BackupProtectionIntent_Get.json */ /** * Sample code: Get ProtectionIntent for an item. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionIntentValidateSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionIntentValidateSamples.java index 9bb37ff84853..38c264deb90b 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionIntentValidateSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionIntentValidateSamples.java @@ -12,7 +12,7 @@ */ public final class ProtectionIntentValidateSamples { /* - * x-ms-original-file: 2026-01-31-preview/AzureIaasVm/ProtectionIntent_Validate.json + * x-ms-original-file: 2026-05-31-preview/AzureIaasVm/ProtectionIntent_Validate.json */ /** * Sample code: Validate Enable Protection on Azure Vm. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionPoliciesCreateOrUpdateSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionPoliciesCreateOrUpdateSamples.java index 751605e2f4d9..f0d3c0355b3f 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionPoliciesCreateOrUpdateSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionPoliciesCreateOrUpdateSamples.java @@ -30,7 +30,6 @@ import com.azure.resourcemanager.recoveryservicesbackup.models.SubProtectionPolicy; import com.azure.resourcemanager.recoveryservicesbackup.models.UserAssignedIdentityProperties; import com.azure.resourcemanager.recoveryservicesbackup.models.UserAssignedManagedIdentityDetails; -import com.azure.resourcemanager.recoveryservicesbackup.models.VMWorkloadPolicyType; import com.azure.resourcemanager.recoveryservicesbackup.models.VaultRetentionPolicy; import com.azure.resourcemanager.recoveryservicesbackup.models.WeekOfMonth; import com.azure.resourcemanager.recoveryservicesbackup.models.WeeklyRetentionFormat; @@ -45,7 +44,7 @@ */ public final class ProtectionPoliciesCreateOrUpdateSamples { /* - * x-ms-original-file: 2026-01-31-preview/AzureIaasVm/ProtectionPolicies_CreateOrUpdate_Simple.json + * x-ms-original-file: 2026-05-31-preview/AzureIaasVm/ProtectionPolicies_CreateOrUpdate_Simple.json */ /** * Sample code: Create or Update Simple Azure Vm Protection Policy. @@ -69,7 +68,7 @@ public static void createOrUpdateSimpleAzureVmProtectionPolicy( } /* - * x-ms-original-file: 2026-01-31-preview/AzureWorkload/ProtectionPolicies_CreateOrUpdate_Complex.json + * x-ms-original-file: 2026-05-31-preview/AzureWorkload/ProtectionPolicies_CreateOrUpdate_Complex.json */ /** * Sample code: Create or Update Full Azure Workload Protection Policy. @@ -132,7 +131,7 @@ public static void createOrUpdateFullAzureWorkloadProtectionPolicy( } /* - * x-ms-original-file: 2026-01-31-preview/AzureStorage/ProtectionPolicies_CreateOrUpdate_Daily.json + * x-ms-original-file: 2026-05-31-preview/AzureStorage/ProtectionPolicies_CreateOrUpdate_Daily.json */ /** * Sample code: Create or Update Daily Azure Storage Protection Policy. @@ -182,7 +181,7 @@ public static void createOrUpdateDailyAzureStorageProtectionPolicy( } /* - * x-ms-original-file: 2026-01-31-preview/AzureStorage/ProtectionPolicies_CreateOrUpdate_Hardened.json + * x-ms-original-file: 2026-05-31-preview/AzureStorage/ProtectionPolicies_CreateOrUpdate_Hardened.json */ /** * Sample code: Create or Update Azure Storage Vault Standard Protection Policy. @@ -237,7 +236,7 @@ public static void createOrUpdateAzureStorageVaultStandardProtectionPolicy( } /* - * x-ms-original-file: 2026-01-31-preview/AzureStorage/ProtectionPolicies_CreateOrUpdate_Hourly.json + * x-ms-original-file: 2026-05-31-preview/AzureStorage/ProtectionPolicies_CreateOrUpdate_Hourly.json */ /** * Sample code: Create or Update Hourly Azure Storage Protection Policy. @@ -282,7 +281,7 @@ public static void createOrUpdateHourlyAzureStorageProtectionPolicy( } /* - * x-ms-original-file: 2026-01-31-preview/AzureIaasVm/ProtectionPolicies_CreateOrUpdate_Complex.json + * x-ms-original-file: 2026-05-31-preview/AzureIaasVm/ProtectionPolicies_CreateOrUpdate_Complex.json */ /** * Sample code: Create or Update Full Azure Vm Protection Policy. @@ -332,7 +331,7 @@ public static void createOrUpdateFullAzureVmProtectionPolicy( } /* - * x-ms-original-file: 2026-01-31-preview/AzureIaasVm/V2Policy/IaaS_v2_hourly.json + * x-ms-original-file: 2026-05-31-preview/AzureIaasVm/V2Policy/IaaS_v2_hourly.json */ /** * Sample code: Create or Update Enhanced Azure Vm Protection Policy with Hourly backup. @@ -386,7 +385,7 @@ public static void createOrUpdateEnhancedAzureVmProtectionPolicyWithHourlyBackup } /* - * x-ms-original-file: 2026-01-31-preview/AzureIaasVm/V2Policy/IaaS_v2_daily.json + * x-ms-original-file: 2026-05-31-preview/AzureIaasVm/V2Policy/IaaS_v2_daily.json */ /** * Sample code: Create or Update Enhanced Azure Vm Protection Policy with daily backup. @@ -439,7 +438,7 @@ public static void createOrUpdateEnhancedAzureVmProtectionPolicyWithDailyBackup( } /* - * x-ms-original-file: 2026-01-31-preview/AzureWorkload/ProtectionPolicies_CreateOrUpdate_SapHanaDBInstance.json + * x-ms-original-file: 2026-05-31-preview/AzureWorkload/ProtectionPolicies_CreateOrUpdate_SapHanaDBInstance.json */ /** * Sample code: Create or Update Sap Hana DB Instance Workload Protection Policy. @@ -453,7 +452,6 @@ public static void createOrUpdateSapHanaDBInstanceWorkloadProtectionPolicy( .withExistingVault("HanaTestRsVault", "SwaggerTestRg") .withProperties(new AzureVmWorkloadProtectionPolicy().withProtectedItemsCount(0) .withWorkLoadType(WorkloadType.SAPHANA_DBINSTANCE) - .withVmWorkloadPolicyType(VMWorkloadPolicyType.SNAPSHOT_V2) .withSettings(new Settings().withTimeZone("UTC").withIssqlcompression(false).withIsCompression(false)) .withSubProtectionPolicy( Arrays.asList(new SubProtectionPolicy().withPolicyType(PolicyType.SNAPSHOT_FULL) diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionPoliciesDeleteSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionPoliciesDeleteSamples.java index a376e78c90de..6c84cb836a91 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionPoliciesDeleteSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionPoliciesDeleteSamples.java @@ -9,7 +9,7 @@ */ public final class ProtectionPoliciesDeleteSamples { /* - * x-ms-original-file: 2026-01-31-preview/AzureIaasVm/ProtectionPolicies_Delete.json + * x-ms-original-file: 2026-05-31-preview/AzureIaasVm/ProtectionPolicies_Delete.json */ /** * Sample code: Delete Azure Vm Protection Policy. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionPoliciesGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionPoliciesGetSamples.java index b40b11e0bac8..3b5cf5321342 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionPoliciesGetSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionPoliciesGetSamples.java @@ -9,7 +9,7 @@ */ public final class ProtectionPoliciesGetSamples { /* - * x-ms-original-file: 2026-01-31-preview/AzureIaasVm/ProtectionPolicies_Get.json + * x-ms-original-file: 2026-05-31-preview/AzureIaasVm/ProtectionPolicies_Get.json */ /** * Sample code: Get Azure IaasVm Protection Policy Details. @@ -23,7 +23,7 @@ public static void getAzureIaasVmProtectionPolicyDetails( } /* - * x-ms-original-file: 2026-01-31-preview/AzureIaasVm/V2Policy/v2-Get-Policy.json + * x-ms-original-file: 2026-05-31-preview/AzureIaasVm/V2Policy/v2-Get-Policy.json */ /** * Sample code: Get Azure IaasVm Enhanced Protection Policy Details. @@ -37,7 +37,7 @@ public static void getAzureIaasVmEnhancedProtectionPolicyDetails( } /* - * x-ms-original-file: 2026-01-31-preview/AzureWorkload/ProtectionPolicies_Get_SapHanaDBInstance.json + * x-ms-original-file: 2026-05-31-preview/AzureWorkload/ProtectionPolicies_Get_SapHanaDBInstance.json */ /** * Sample code: Get Sap Hana DB Instance Workload Protection Policy Details. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionPolicyOperationResultsGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionPolicyOperationResultsGetSamples.java index 50fdb1884058..2e33ce076da8 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionPolicyOperationResultsGetSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionPolicyOperationResultsGetSamples.java @@ -9,7 +9,7 @@ */ public final class ProtectionPolicyOperationResultsGetSamples { /* - * x-ms-original-file: 2026-01-31-preview/AzureIaasVm/ProtectionPolicyOperationResults_Get.json + * x-ms-original-file: 2026-05-31-preview/AzureIaasVm/ProtectionPolicyOperationResults_Get.json */ /** * Sample code: Get Protection Policy Operation Results. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionPolicyOperationStatusesGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionPolicyOperationStatusesGetSamples.java index 5ef4ec1bed01..1f1632c8cf5d 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionPolicyOperationStatusesGetSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectionPolicyOperationStatusesGetSamples.java @@ -9,7 +9,7 @@ */ public final class ProtectionPolicyOperationStatusesGetSamples { /* - * x-ms-original-file: 2026-01-31-preview/AzureIaasVm/ProtectionPolicyOperationStatuses_Get.json + * x-ms-original-file: 2026-05-31-preview/AzureIaasVm/ProtectionPolicyOperationStatuses_Get.json */ /** * Sample code: Get Protection Policy Operation Status. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/RecoveryPointsGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/RecoveryPointsGetSamples.java index ca18d4965925..cfa2f377775f 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/RecoveryPointsGetSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/RecoveryPointsGetSamples.java @@ -9,7 +9,7 @@ */ public final class RecoveryPointsGetSamples { /* - * x-ms-original-file: 2026-01-31-preview/AzureIaasVm/RecoveryPoints_Get.json + * x-ms-original-file: 2026-05-31-preview/AzureIaasVm/RecoveryPoints_Get.json */ /** * Sample code: Get Azure Vm Recovery Point Details. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/RecoveryPointsListSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/RecoveryPointsListSamples.java index 7e736fa0a2bd..0d7616ee9cad 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/RecoveryPointsListSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/RecoveryPointsListSamples.java @@ -9,7 +9,7 @@ */ public final class RecoveryPointsListSamples { /* - * x-ms-original-file: 2026-01-31-preview/AzureIaasVm/RecoveryPoints_List.json + * x-ms-original-file: 2026-05-31-preview/AzureIaasVm/RecoveryPoints_List.json */ /** * Sample code: Get Protected Azure Vm Recovery Points. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/RecoveryPointsRecommendedForMoveListSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/RecoveryPointsRecommendedForMoveListSamples.java index 4c0a239243fd..f590e7d98501 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/RecoveryPointsRecommendedForMoveListSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/RecoveryPointsRecommendedForMoveListSamples.java @@ -12,7 +12,7 @@ */ public final class RecoveryPointsRecommendedForMoveListSamples { /* - * x-ms-original-file: 2026-01-31-preview/AzureIaasVm/RecoveryPointsRecommendedForMove_List.json + * x-ms-original-file: 2026-05-31-preview/AzureIaasVm/RecoveryPointsRecommendedForMove_List.json */ /** * Sample code: Get Protected Azure Vm Recovery Points Recommended for Move. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/RecoveryPointsUpdateSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/RecoveryPointsUpdateSamples.java index 311d6be53fed..54235e21acfb 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/RecoveryPointsUpdateSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/RecoveryPointsUpdateSamples.java @@ -14,7 +14,7 @@ */ public final class RecoveryPointsUpdateSamples { /* - * x-ms-original-file: 2026-01-31-preview/Common/RecoveryPoints_Update.json + * x-ms-original-file: 2026-05-31-preview/Common/RecoveryPoints_Update.json */ /** * Sample code: Update Azure Vm Recovery Point Details. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceGuardProxyOperationDeleteSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceGuardProxyOperationDeleteSamples.java index 41c5814a99e6..11230f853940 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceGuardProxyOperationDeleteSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceGuardProxyOperationDeleteSamples.java @@ -9,7 +9,7 @@ */ public final class ResourceGuardProxyOperationDeleteSamples { /* - * x-ms-original-file: 2026-01-31-preview/ResourceGuardProxyCRUD/DeleteResourceGuardProxy.json + * x-ms-original-file: 2026-05-31-preview/ResourceGuardProxyCRUD/DeleteResourceGuardProxy.json */ /** * Sample code: Delete ResourceGuardProxy. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceGuardProxyOperationGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceGuardProxyOperationGetSamples.java index ef82acd813ef..7948847d1d0c 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceGuardProxyOperationGetSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceGuardProxyOperationGetSamples.java @@ -9,7 +9,7 @@ */ public final class ResourceGuardProxyOperationGetSamples { /* - * x-ms-original-file: 2026-01-31-preview/ResourceGuardProxyCRUD/GetResourceGuardProxy.json + * x-ms-original-file: 2026-05-31-preview/ResourceGuardProxyCRUD/GetResourceGuardProxy.json */ /** * Sample code: Get ResourceGuardProxy. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceGuardProxyOperationListSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceGuardProxyOperationListSamples.java index fd1d9d9577ba..689455b765e9 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceGuardProxyOperationListSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceGuardProxyOperationListSamples.java @@ -9,7 +9,7 @@ */ public final class ResourceGuardProxyOperationListSamples { /* - * x-ms-original-file: 2026-01-31-preview/ResourceGuardProxyCRUD/ListResourceGuardProxy.json + * x-ms-original-file: 2026-05-31-preview/ResourceGuardProxyCRUD/ListResourceGuardProxy.json */ /** * Sample code: Get VaultGuardProxies. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceGuardProxyOperationPutSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceGuardProxyOperationPutSamples.java index 350142a1202d..582800cb6306 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceGuardProxyOperationPutSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceGuardProxyOperationPutSamples.java @@ -11,7 +11,7 @@ */ public final class ResourceGuardProxyOperationPutSamples { /* - * x-ms-original-file: 2026-01-31-preview/ResourceGuardProxyCRUD/PutResourceGuardProxy.json + * x-ms-original-file: 2026-05-31-preview/ResourceGuardProxyCRUD/PutResourceGuardProxy.json */ /** * Sample code: Create ResourceGuardProxy. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceGuardProxyOperationUnlockDeleteSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceGuardProxyOperationUnlockDeleteSamples.java index 8068bce987c0..37cecf73767e 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceGuardProxyOperationUnlockDeleteSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceGuardProxyOperationUnlockDeleteSamples.java @@ -12,7 +12,7 @@ */ public final class ResourceGuardProxyOperationUnlockDeleteSamples { /* - * x-ms-original-file: 2026-01-31-preview/ResourceGuardProxyCRUD/UnlockDeleteResourceGuardProxy.json + * x-ms-original-file: 2026-05-31-preview/ResourceGuardProxyCRUD/UnlockDeleteResourceGuardProxy.json */ /** * Sample code: UnlockDelete ResourceGuardProxy. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceProviderBmsPrepareDataMoveSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceProviderBmsPrepareDataMoveSamples.java index 6c28284bf18c..a6f2b2a5c03a 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceProviderBmsPrepareDataMoveSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceProviderBmsPrepareDataMoveSamples.java @@ -12,7 +12,7 @@ */ public final class ResourceProviderBmsPrepareDataMoveSamples { /* - * x-ms-original-file: 2026-01-31-preview/BackupDataMove/PrepareDataMove_Post.json + * x-ms-original-file: 2026-05-31-preview/BackupDataMove/PrepareDataMove_Post.json */ /** * Sample code: Prepare Data Move. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceProviderBmsTriggerDataMoveSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceProviderBmsTriggerDataMoveSamples.java index d8339a6f1f58..a5af1749f6c1 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceProviderBmsTriggerDataMoveSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceProviderBmsTriggerDataMoveSamples.java @@ -12,7 +12,7 @@ */ public final class ResourceProviderBmsTriggerDataMoveSamples { /* - * x-ms-original-file: 2026-01-31-preview/BackupDataMove/TriggerDataMove_Post.json + * x-ms-original-file: 2026-05-31-preview/BackupDataMove/TriggerDataMove_Post.json */ /** * Sample code: Trigger Data Move. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceProviderGetOperationStatusSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceProviderGetOperationStatusSamples.java index 797519a68788..367f8d20663c 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceProviderGetOperationStatusSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceProviderGetOperationStatusSamples.java @@ -9,7 +9,7 @@ */ public final class ResourceProviderGetOperationStatusSamples { /* - * x-ms-original-file: 2026-01-31-preview/BackupDataMove/BackupDataMoveOperationStatus_Get.json + * x-ms-original-file: 2026-05-31-preview/BackupDataMove/BackupDataMoveOperationStatus_Get.json */ /** * Sample code: Get OperationStatus. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceProviderMoveRecoveryPointSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceProviderMoveRecoveryPointSamples.java index 48f79f5af652..663178577940 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceProviderMoveRecoveryPointSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ResourceProviderMoveRecoveryPointSamples.java @@ -12,7 +12,7 @@ */ public final class ResourceProviderMoveRecoveryPointSamples { /* - * x-ms-original-file: 2026-01-31-preview/TriggerRecoveryPointMove_Post.json + * x-ms-original-file: 2026-05-31-preview/TriggerRecoveryPointMove_Post.json */ /** * Sample code: Trigger RP Move Operation. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/RestoresFromCrossTenantVaultTriggerSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/RestoresFromCrossTenantVaultTriggerSamples.java new file mode 100644 index 000000000000..496374d28ce3 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/RestoresFromCrossTenantVaultTriggerSamples.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.resourcemanager.recoveryservicesbackup.models.IaasVMRestoreRequest; +import com.azure.resourcemanager.recoveryservicesbackup.models.RecoveryType; +import com.azure.resourcemanager.recoveryservicesbackup.models.RestoreRequestResource; + +/** + * Samples for RestoresFromCrossTenantVault Trigger. + */ +public final class RestoresFromCrossTenantVaultTriggerSamples { + /* + * x-ms-original-file: 2026-05-31-preview/CrossTenantVaultMappingOperations/TriggerCrossTenantRestore.json + */ + /** + * Sample code: Trigger Cross-Tenant Restore. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void triggerCrossTenantRestore( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager.restoresFromCrossTenantVaults() + .trigger("SwaggerTestRg", "NetSDKTestRsVault", "crossTenantVaultMapping1", "Azure", + "IaasVMContainer;iaasvmcontainerv2;SwaggerTestRg;testVM", "VM;iaasvmcontainerv2;SwaggerTestRg;testVM", + "348916168024334", + new RestoreRequestResource().withProperties(new IaasVMRestoreRequest() + .withRecoveryPointId("348916168024334") + .withRecoveryType(RecoveryType.RESTORE_DISKS) + .withSourceResourceId( + "/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/SourceRG/providers/Microsoft.Compute/virtualMachines/testVM") + .withStorageAccountId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.Storage/storageAccounts/swaggertestaccount") + .withRegion("westus")), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/RestoresTriggerSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/RestoresTriggerSamples.java index c6faeb24a31b..373d66e971d2 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/RestoresTriggerSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/RestoresTriggerSamples.java @@ -4,6 +4,8 @@ package com.azure.resourcemanager.recoveryservicesbackup.generated; +import com.azure.resourcemanager.recoveryservicesbackup.models.AzureFileShareRestoreRequest; +import com.azure.resourcemanager.recoveryservicesbackup.models.CopyOptions; import com.azure.resourcemanager.recoveryservicesbackup.models.EncryptionDetails; import com.azure.resourcemanager.recoveryservicesbackup.models.IaasVMRestoreRequest; import com.azure.resourcemanager.recoveryservicesbackup.models.IaasVMRestoreWithRehydrationRequest; @@ -13,6 +15,7 @@ import com.azure.resourcemanager.recoveryservicesbackup.models.RecoveryType; import com.azure.resourcemanager.recoveryservicesbackup.models.RehydrationPriority; import com.azure.resourcemanager.recoveryservicesbackup.models.RestoreRequestResource; +import com.azure.resourcemanager.recoveryservicesbackup.models.RestoreRequestType; import com.azure.resourcemanager.recoveryservicesbackup.models.TargetDiskNetworkAccessOption; import com.azure.resourcemanager.recoveryservicesbackup.models.TargetDiskNetworkAccessSettings; import java.util.Arrays; @@ -22,7 +25,7 @@ */ public final class RestoresTriggerSamples { /* - * x-ms-original-file: 2026-01-31-preview/AzureIaasVm/TriggerRestore_ALR_IaasVMRestoreWithRehydrationRequest.json + * x-ms-original-file: 2026-05-31-preview/AzureIaasVm/TriggerRestore_ALR_IaasVMRestoreWithRehydrationRequest.json */ /** * Sample code: Restore to New Azure IaasVm with IaasVMRestoreWithRehydrationRequest. @@ -61,7 +64,33 @@ public static void restoreToNewAzureIaasVmWithIaasVMRestoreWithRehydrationReques } /* - * x-ms-original-file: 2026-01-31-preview/AzureIaasVm/TriggerRestore_ALR_IaasVMRestoreRequest.json + * x-ms-original-file: 2026-05-31-preview/AzureStorage/TriggerRestore_AzureFileShare_WithUAMI.json + */ + /** + * Sample code: Restore Azure File Share to Original Location with User Assigned Managed Identity. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void restoreAzureFileShareToOriginalLocationWithUserAssignedManagedIdentity( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager.restores() + .trigger("swaggertestvault", "SwaggerTestRg", "Azure", + "StorageContainer;Storage;SwaggerTestRg;swaggertestsa", "AzureFileShare;testshare", + "932886657837421071", + new RestoreRequestResource().withProperties(new AzureFileShareRestoreRequest() + .withRecoveryType(RecoveryType.ORIGINAL_LOCATION) + .withSourceResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/SwaggerTestRg/providers/Microsoft.Storage/storageAccounts/swaggertestsa") + .withCopyOptions(CopyOptions.OVERWRITE) + .withRestoreRequestType(RestoreRequestType.FULL_SHARE_RESTORE) + .withIdentityInfo(new IdentityInfo().withIsSystemAssignedIdentity(false) + .withManagedIdentityResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/SwaggerTestRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/swaggertestuami"))), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-05-31-preview/AzureIaasVm/TriggerRestore_ALR_IaasVMRestoreRequest.json */ /** * Sample code: Restore to New Azure IaasVm with IaasVMRestoreRequest. @@ -97,9 +126,33 @@ public static void restoreToNewAzureIaasVmWithIaasVMRestoreRequest( com.azure.core.util.Context.NONE); } + /* + * x-ms-original-file: 2026-05-31-preview/AzureStorage/TriggerRestore_AzureFileShare_WithSAMI.json + */ + /** + * Sample code: Restore Azure File Share to Original Location with Managed Identity. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void restoreAzureFileShareToOriginalLocationWithManagedIdentity( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager.restores() + .trigger("swaggertestvault", "SwaggerTestRg", "Azure", + "StorageContainer;Storage;SwaggerTestRg;swaggertestsa", "AzureFileShare;testshare", + "932886657837421071", + new RestoreRequestResource().withProperties(new AzureFileShareRestoreRequest() + .withRecoveryType(RecoveryType.ORIGINAL_LOCATION) + .withSourceResourceId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/SwaggerTestRg/providers/Microsoft.Storage/storageAccounts/swaggertestsa") + .withCopyOptions(CopyOptions.OVERWRITE) + .withRestoreRequestType(RestoreRequestType.FULL_SHARE_RESTORE) + .withIdentityInfo(new IdentityInfo().withIsSystemAssignedIdentity(true))), + com.azure.core.util.Context.NONE); + } + /* * x-ms-original-file: - * 2026-01-31-preview/AzureIaasVm/TriggerRestore_RestoreDisks_IaasVMRestoreWithRehydrationRequest.json + * 2026-05-31-preview/AzureIaasVm/TriggerRestore_RestoreDisks_IaasVMRestoreWithRehydrationRequest.json */ /** * Sample code: Restore Disks with IaasVMRestoreWithRehydrationRequest. @@ -131,7 +184,7 @@ public static void restoreDisksWithIaasVMRestoreWithRehydrationRequest( /* * x-ms-original-file: - * 2026-01-31-preview/AzureIaasVm/TriggerRestore_ALR_IaasVMRestoreRequest_IdentityBasedRestoreDetails.json + * 2026-05-31-preview/AzureIaasVm/TriggerRestore_ALR_IaasVMRestoreRequest_IdentityBasedRestoreDetails.json */ /** * Sample code: Restore to New Azure IaasVm with IaasVMRestoreRequest with identityBasedRestoreDetails. @@ -168,7 +221,7 @@ public static void restoreToNewAzureIaasVmWithIaasVMRestoreRequestWithIdentityBa } /* - * x-ms-original-file: 2026-01-31-preview/AzureIaasVm/TriggerRestore_RestoreDisks_IaasVMRestoreRequest.json + * x-ms-original-file: 2026-05-31-preview/AzureIaasVm/TriggerRestore_RestoreDisks_IaasVMRestoreRequest.json */ /** * Sample code: Restore Disks with IaasVMRestoreRequest. @@ -205,7 +258,7 @@ public static void restoreDisksWithIaasVMRestoreRequest( /* * x-ms-original-file: - * 2026-01-31-preview/AzureIaasVm/TriggerRestore_RestoreDisks_IaasVMRestoreRequest_IdentityBasedRestoreDetails.json + * 2026-05-31-preview/AzureIaasVm/TriggerRestore_RestoreDisks_IaasVMRestoreRequest_IdentityBasedRestoreDetails.json */ /** * Sample code: Restore Disks with IaasVMRestoreRequest with IdentityBasedRestoreDetails. @@ -236,7 +289,7 @@ public static void restoreDisksWithIaasVMRestoreRequestWithIdentityBasedRestoreD } /* - * x-ms-original-file: 2026-01-31-preview/AzureIaasVm/TriggerRestore_ResourceGuardEnabled.json + * x-ms-original-file: 2026-05-31-preview/AzureIaasVm/TriggerRestore_ResourceGuardEnabled.json */ /** * Sample code: Restore with Resource Guard Enabled. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/SecurityPINsGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/SecurityPINsGetSamples.java index 03afc5a6be8f..f802dd8802c1 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/SecurityPINsGetSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/SecurityPINsGetSamples.java @@ -9,7 +9,7 @@ */ public final class SecurityPINsGetSamples { /* - * x-ms-original-file: 2026-01-31-preview/Common/BackupSecurityPin_Get.json + * x-ms-original-file: 2026-05-31-preview/Common/BackupSecurityPin_Get.json */ /** * Sample code: Get Vault Security Pin. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/TieringCostOperationStatusGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/TieringCostOperationStatusGetSamples.java index 3ca66a01db52..11553012b080 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/TieringCostOperationStatusGetSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/TieringCostOperationStatusGetSamples.java @@ -9,7 +9,7 @@ */ public final class TieringCostOperationStatusGetSamples { /* - * x-ms-original-file: 2026-01-31-preview/TieringCost/GetTieringCostOperationStatus.json + * x-ms-original-file: 2026-05-31-preview/TieringCost/GetTieringCostOperationStatus.json */ /** * Sample code: Fetch Tiering Cost Operation Status. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ValidateOperationFromCrossTenantVaultTriggerSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ValidateOperationFromCrossTenantVaultTriggerSamples.java new file mode 100644 index 000000000000..26a10308aec7 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ValidateOperationFromCrossTenantVaultTriggerSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.resourcemanager.recoveryservicesbackup.models.IaasVMRestoreRequest; +import com.azure.resourcemanager.recoveryservicesbackup.models.RecoveryType; +import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateIaasVMRestoreOperationRequest; +import com.azure.resourcemanager.recoveryservicesbackup.models.ValidateOperationRequestResource; + +/** + * Samples for ValidateOperationFromCrossTenantVault Trigger. + */ +public final class ValidateOperationFromCrossTenantVaultTriggerSamples { + /* + * x-ms-original-file: 2026-05-31-preview/CrossTenantVaultMappingOperations/TriggerValidateOperation.json + */ + /** + * Sample code: Trigger Cross-Tenant Validate Operation. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void triggerCrossTenantValidateOperation( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager.validateOperationFromCrossTenantVaults() + .trigger("SwaggerTestRg", "NetSDKTestRsVault", "crossTenantVaultMapping1", + new ValidateOperationRequestResource().withId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupCrossTenantVaultMappings/crossTenantVaultMapping1") + .withProperties(new ValidateIaasVMRestoreOperationRequest() + .withRestoreRequest(new IaasVMRestoreRequest().withRecoveryPointId("348916168024334") + .withRecoveryType(RecoveryType.RESTORE_DISKS) + .withSourceResourceId( + "/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/SourceRG/providers/Microsoft.Compute/virtualMachines/testVM") + .withStorageAccountId( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.Storage/storageAccounts/swaggertestaccount") + .withRegion("westus"))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ValidateOperationResultFromCrossTenantVaultGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ValidateOperationResultFromCrossTenantVaultGetSamples.java new file mode 100644 index 000000000000..f02f150143c5 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ValidateOperationResultFromCrossTenantVaultGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +/** + * Samples for ValidateOperationResultFromCrossTenantVault Get. + */ +public final class ValidateOperationResultFromCrossTenantVaultGetSamples { + /* + * x-ms-original-file: 2026-05-31-preview/CrossTenantVaultMappingOperations/GetValidateOperationResult.json + */ + /** + * Sample code: Get Cross-Tenant Validate Operation Result. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getCrossTenantValidateOperationResult( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager.validateOperationResultFromCrossTenantVaults() + .get("SwaggerTestRg", "NetSDKTestRsVault", "crossTenantVaultMapping1", + "00000000-0000-0000-0000-000000000000", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ValidateOperationResultsGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ValidateOperationResultsGetSamples.java index cb88a6a3c2d0..f41418e60b34 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ValidateOperationResultsGetSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ValidateOperationResultsGetSamples.java @@ -9,7 +9,7 @@ */ public final class ValidateOperationResultsGetSamples { /* - * x-ms-original-file: 2026-01-31-preview/AzureIaasVm/ValidateOperationResults.json + * x-ms-original-file: 2026-05-31-preview/AzureIaasVm/ValidateOperationResults.json */ /** * Sample code: Get Operation Results of Validate Operation. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ValidateOperationStatusFromCrossTenantVaultGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ValidateOperationStatusFromCrossTenantVaultGetSamples.java new file mode 100644 index 000000000000..d66a36fa5285 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ValidateOperationStatusFromCrossTenantVaultGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +/** + * Samples for ValidateOperationStatusFromCrossTenantVault Get. + */ +public final class ValidateOperationStatusFromCrossTenantVaultGetSamples { + /* + * x-ms-original-file: 2026-05-31-preview/CrossTenantVaultMappingOperations/GetValidateOperationStatus.json + */ + /** + * Sample code: Get Cross-Tenant Validate Operation Status. + * + * @param manager Entry point to RecoveryServicesBackupManager. + */ + public static void getCrossTenantValidateOperationStatus( + com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) { + manager.validateOperationStatusFromCrossTenantVaults() + .getWithResponse("SwaggerTestRg", "NetSDKTestRsVault", "crossTenantVaultMapping1", + "00000000-0000-0000-0000-000000000000", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ValidateOperationStatusesGetSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ValidateOperationStatusesGetSamples.java index aad0c8b222a9..e63e19a4f5b1 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ValidateOperationStatusesGetSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ValidateOperationStatusesGetSamples.java @@ -9,7 +9,7 @@ */ public final class ValidateOperationStatusesGetSamples { /* - * x-ms-original-file: 2026-01-31-preview/AzureIaasVm/ValidateOperationStatus.json + * x-ms-original-file: 2026-05-31-preview/AzureIaasVm/ValidateOperationStatus.json */ /** * Sample code: Get Operation Status of Validate Operation. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ValidateOperationTriggerSamples.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ValidateOperationTriggerSamples.java index ec1640df3632..cd5a15355fea 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ValidateOperationTriggerSamples.java +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/samples/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ValidateOperationTriggerSamples.java @@ -16,7 +16,7 @@ */ public final class ValidateOperationTriggerSamples { /* - * x-ms-original-file: 2026-01-31-preview/AzureIaasVm/TriggerValidateOperation_RestoreDisk.json + * x-ms-original-file: 2026-05-31-preview/AzureIaasVm/TriggerValidateOperation_RestoreDisk.json */ /** * Sample code: Trigger Validate Operation. diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupJobsFromCrossTenantVaultsListMockTests.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupJobsFromCrossTenantVaultsListMockTests.java new file mode 100644 index 000000000000..acfbc8bec1de --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupJobsFromCrossTenantVaultsListMockTests.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupManagementType; +import com.azure.resourcemanager.recoveryservicesbackup.models.JobResource; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class BackupJobsFromCrossTenantVaultsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"jobType\":\"Job\",\"entityFriendlyName\":\"cxiqq\",\"backupManagementType\":\"AzureBackupServer\",\"operation\":\"xdupnamg\",\"status\":\"ouigdmfivjqte\",\"startTime\":\"2021-08-17T20:40:57Z\",\"endTime\":\"2021-09-27T22:27:32Z\",\"activityId\":\"dydkghpcvrwqir\"},\"tags\":{\"odmkrrwepgqv\":\"tyhhmvfxlapja\",\"bwlyvxc\":\"okqlujqgir\",\"stvzuzhasupml\":\"pqvctsfaeuhwwsk\"},\"location\":\"dpgzvzqazv\",\"eTag\":\"arkptgongruatsyi\",\"id\":\"jqhenigb\",\"name\":\"qnguba\",\"type\":\"yjdeayscseyd\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + RecoveryServicesBackupManager manager = RecoveryServicesBackupManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.backupJobsFromCrossTenantVaults() + .list("jey", "qxded", "cfiwhagxsurejq", "shzz", "g", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("cxiqq", response.iterator().next().properties().entityFriendlyName()); + Assertions.assertEquals(BackupManagementType.AZURE_BACKUP_SERVER, + response.iterator().next().properties().backupManagementType()); + Assertions.assertEquals("xdupnamg", response.iterator().next().properties().operation()); + Assertions.assertEquals("ouigdmfivjqte", response.iterator().next().properties().status()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-17T20:40:57Z"), + response.iterator().next().properties().startTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-27T22:27:32Z"), + response.iterator().next().properties().endTime()); + Assertions.assertEquals("dydkghpcvrwqir", response.iterator().next().properties().activityId()); + Assertions.assertEquals("tyhhmvfxlapja", response.iterator().next().tags().get("odmkrrwepgqv")); + Assertions.assertEquals("dpgzvzqazv", response.iterator().next().location()); + Assertions.assertEquals("arkptgongruatsyi", response.iterator().next().etag()); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupProtectedItemsFromCrossTenantVaultsListMockTests.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupProtectedItemsFromCrossTenantVaultsListMockTests.java new file mode 100644 index 000000000000..e055514989d4 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/BackupProtectedItemsFromCrossTenantVaultsListMockTests.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.models.CreateMode; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectedItemResource; +import com.azure.resourcemanager.recoveryservicesbackup.models.SourceSideScanStatus; +import com.azure.resourcemanager.recoveryservicesbackup.models.SourceSideScanSummary; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class BackupProtectedItemsFromCrossTenantVaultsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"protectedItemType\":\"ProtectedItem\",\"backupManagementType\":\"Invalid\",\"workloadType\":\"SystemState\",\"containerName\":\"suaawj\",\"sourceResourceId\":\"xwjnfcz\",\"policyId\":\"nii\",\"lastRecoveryPoint\":\"2021-10-02T09:37:10Z\",\"backupSetName\":\"qban\",\"createMode\":\"Default\",\"deferredDeleteTimeInUTC\":\"2021-12-10T21:13:23Z\",\"isScheduledForDeferredDelete\":false,\"deferredDeleteTimeRemaining\":\"bgmgm\",\"isDeferredDeleteScheduleUpcoming\":true,\"isRehydrate\":false,\"resourceGuardOperationRequests\":[\"nltwmpftmfoeajog\"],\"isArchiveEnabled\":false,\"policyName\":\"etamfddrvlkpzwb\",\"softDeleteRetentionPeriodInDays\":680048255,\"vaultId\":\"cc\",\"sourceSideScanInfo\":{\"sourceSideScanStatus\":\"Configured\",\"sourceSideScanSummary\":\"NotApplicable\"}},\"tags\":{\"jpjbweunxcqr\":\"kahmjedbiucvkhhw\",\"iybxvgnzuzpb\":\"ihufoihp\",\"dimjuktirzkau\":\"kzcscpiuzvkun\",\"plw\":\"pucdocf\"},\"location\":\"f\",\"eTag\":\"xwr\",\"id\":\"vzklkvbgikyjtka\",\"name\":\"vlbishjvpzapt\",\"type\":\"oskaoizji\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + RecoveryServicesBackupManager manager = RecoveryServicesBackupManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.backupProtectedItemsFromCrossTenantVaults() + .list("q", "zpdgonjhxshthmgp", "zqulptkbv", "pxtzhigqqbtimpk", "blornsih", + com.azure.core.util.Context.NONE); + + Assertions.assertEquals("suaawj", response.iterator().next().properties().containerName()); + Assertions.assertEquals("xwjnfcz", response.iterator().next().properties().sourceResourceId()); + Assertions.assertEquals("nii", response.iterator().next().properties().policyId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-02T09:37:10Z"), + response.iterator().next().properties().lastRecoveryPoint()); + Assertions.assertEquals("qban", response.iterator().next().properties().backupSetName()); + Assertions.assertEquals(CreateMode.DEFAULT, response.iterator().next().properties().createMode()); + Assertions.assertEquals(OffsetDateTime.parse("2021-12-10T21:13:23Z"), + response.iterator().next().properties().deferredDeleteTimeInUtc()); + Assertions.assertFalse(response.iterator().next().properties().isScheduledForDeferredDelete()); + Assertions.assertEquals("bgmgm", response.iterator().next().properties().deferredDeleteTimeRemaining()); + Assertions.assertTrue(response.iterator().next().properties().isDeferredDeleteScheduleUpcoming()); + Assertions.assertFalse(response.iterator().next().properties().isRehydrate()); + Assertions.assertEquals("nltwmpftmfoeajog", + response.iterator().next().properties().resourceGuardOperationRequests().get(0)); + Assertions.assertFalse(response.iterator().next().properties().isArchiveEnabled()); + Assertions.assertEquals("etamfddrvlkpzwb", response.iterator().next().properties().policyName()); + Assertions.assertEquals(680048255, response.iterator().next().properties().softDeleteRetentionPeriodInDays()); + Assertions.assertEquals(SourceSideScanStatus.CONFIGURED, + response.iterator().next().properties().sourceSideScanInfo().sourceSideScanStatus()); + Assertions.assertEquals(SourceSideScanSummary.NOT_APPLICABLE, + response.iterator().next().properties().sourceSideScanInfo().sourceSideScanSummary()); + Assertions.assertEquals("kahmjedbiucvkhhw", response.iterator().next().tags().get("jpjbweunxcqr")); + Assertions.assertEquals("f", response.iterator().next().location()); + Assertions.assertEquals("xwr", response.iterator().next().etag()); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantJobResourceListTests.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantJobResourceListTests.java new file mode 100644 index 000000000000..1d1fb10d00b9 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantJobResourceListTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.models.CrossTenantJobResourceList; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupManagementType; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class CrossTenantJobResourceListTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CrossTenantJobResourceList model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"jobType\":\"Job\",\"entityFriendlyName\":\"wbormcqmi\",\"backupManagementType\":\"DefaultBackup\",\"operation\":\"qpkzfbojxjmcsmy\",\"status\":\"ixvcpwnkwywzwo\",\"startTime\":\"2021-01-12T07:27:26Z\",\"endTime\":\"2021-07-17T08:13:14Z\",\"activityId\":\"duoiqt\"},\"tags\":{\"xrwzawnvsbcf\":\"yvsk\"},\"location\":\"agxnvhycvdimw\",\"eTag\":\"regzgyufutrwpwer\",\"id\":\"kzkdhmeott\",\"name\":\"w\",\"type\":\"yos\"},{\"properties\":{\"jobType\":\"Job\",\"entityFriendlyName\":\"hnhjtfvpndpmi\",\"backupManagementType\":\"AzureBackupServer\",\"operation\":\"wyn\",\"status\":\"qllzsauzpjlxeehu\",\"startTime\":\"2021-10-08T01:10:56Z\",\"endTime\":\"2021-08-23T22:08:25Z\",\"activityId\":\"raymezx\"},\"tags\":{\"yyshtuwgmevua\":\"ihmxrfdsajredn\",\"rkgwltxeqip\":\"pwzyi\",\"avkjog\":\"gzdyimsfayorp\",\"bnsmjkwynqxaek\":\"sl\"},\"location\":\"ykvwjtqpkevmyltj\",\"eTag\":\"spxklu\",\"id\":\"clf\",\"name\":\"xa\",\"type\":\"n\"},{\"properties\":{\"jobType\":\"Job\",\"entityFriendlyName\":\"t\",\"backupManagementType\":\"MAB\",\"operation\":\"ewxigpxvk\",\"status\":\"aupxvpi\",\"startTime\":\"2021-08-13T08:54:07Z\",\"endTime\":\"2021-10-06T15:52:18Z\",\"activityId\":\"yzyzeyuu\"},\"tags\":{\"l\":\"ds\",\"gvdihoynkrxwetwk\":\"ytoithgygvfl\"},\"location\":\"cy\",\"eTag\":\"cpcunnuzdqum\",\"id\":\"nod\",\"name\":\"aienhqhsknd\",\"type\":\"elqkaadlkn\"}],\"nextLink\":\"oanniyopetxi\"}") + .toObject(CrossTenantJobResourceList.class); + Assertions.assertEquals("wbormcqmi", model.value().get(0).properties().entityFriendlyName()); + Assertions.assertEquals(BackupManagementType.DEFAULT_BACKUP, + model.value().get(0).properties().backupManagementType()); + Assertions.assertEquals("qpkzfbojxjmcsmy", model.value().get(0).properties().operation()); + Assertions.assertEquals("ixvcpwnkwywzwo", model.value().get(0).properties().status()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-12T07:27:26Z"), + model.value().get(0).properties().startTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-17T08:13:14Z"), + model.value().get(0).properties().endTime()); + Assertions.assertEquals("duoiqt", model.value().get(0).properties().activityId()); + Assertions.assertEquals("yvsk", model.value().get(0).tags().get("xrwzawnvsbcf")); + Assertions.assertEquals("agxnvhycvdimw", model.value().get(0).location()); + Assertions.assertEquals("regzgyufutrwpwer", model.value().get(0).etag()); + Assertions.assertEquals("oanniyopetxi", model.nextLink()); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantProtectedItemResourceListTests.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantProtectedItemResourceListTests.java new file mode 100644 index 000000000000..e5de1191d12b --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantProtectedItemResourceListTests.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.models.CrossTenantProtectedItemResourceList; +import com.azure.resourcemanager.recoveryservicesbackup.models.CreateMode; +import com.azure.resourcemanager.recoveryservicesbackup.models.SourceSideScanStatus; +import com.azure.resourcemanager.recoveryservicesbackup.models.SourceSideScanSummary; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class CrossTenantProtectedItemResourceListTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CrossTenantProtectedItemResourceList model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"protectedItemType\":\"ProtectedItem\",\"backupManagementType\":\"DPM\",\"workloadType\":\"Client\",\"containerName\":\"hlkks\",\"sourceResourceId\":\"gzv\",\"policyId\":\"ij\",\"lastRecoveryPoint\":\"2021-04-23T21:14:10Z\",\"backupSetName\":\"qnwsithuqolyah\",\"createMode\":\"Recover\",\"deferredDeleteTimeInUTC\":\"2021-11-06T10:28:40Z\",\"isScheduledForDeferredDelete\":false,\"deferredDeleteTimeRemaining\":\"utrjbhxyk\",\"isDeferredDeleteScheduleUpcoming\":false,\"isRehydrate\":false,\"resourceGuardOperationRequests\":[\"qqug\",\"rftb\",\"ve\"],\"isArchiveEnabled\":false,\"policyName\":\"quowtljvfwhrea\",\"softDeleteRetentionPeriodInDays\":1687085732,\"vaultId\":\"xv\",\"sourceSideScanInfo\":{\"sourceSideScanStatus\":\"Configured\",\"sourceSideScanSummary\":\"Suspicious\"}},\"tags\":{\"pjpfseykgs\":\"ulmdgglm\",\"lkvec\":\"ngpszngafpg\"},\"location\":\"jcngoadyed\",\"eTag\":\"rgjfoknubnoi\",\"id\":\"kpztrgd\",\"name\":\"x\",\"type\":\"coqra\"},{\"properties\":{\"protectedItemType\":\"ProtectedItem\",\"backupManagementType\":\"DefaultBackup\",\"workloadType\":\"AzureFileShare\",\"containerName\":\"qi\",\"sourceResourceId\":\"eialwvskb\",\"policyId\":\"z\",\"lastRecoveryPoint\":\"2021-04-05T12:51:26Z\",\"backupSetName\":\"ty\",\"createMode\":\"Recover\",\"deferredDeleteTimeInUTC\":\"2021-11-08T08:38:48Z\",\"isScheduledForDeferredDelete\":true,\"deferredDeleteTimeRemaining\":\"pdsxzakuejkm\",\"isDeferredDeleteScheduleUpcoming\":false,\"isRehydrate\":false,\"resourceGuardOperationRequests\":[\"fqcvovj\",\"f\",\"csjml\",\"e\"],\"isArchiveEnabled\":false,\"policyName\":\"iriuxegthortu\",\"softDeleteRetentionPeriodInDays\":1182103548,\"vaultId\":\"pjfe\",\"sourceSideScanInfo\":{\"sourceSideScanStatus\":\"Configured\",\"sourceSideScanSummary\":\"Suspicious\"}},\"tags\":{\"nhii\":\"bgqnz\",\"gckbb\":\"ialwc\",\"fa\":\"ccgzpraoxnyu\"},\"location\":\"gftipwc\",\"eTag\":\"yubhiqdx\",\"id\":\"rnpnuhzafccnuh\",\"name\":\"i\",\"type\":\"byl\"}],\"nextLink\":\"igvxvatvcrk\"}") + .toObject(CrossTenantProtectedItemResourceList.class); + Assertions.assertEquals("hlkks", model.value().get(0).properties().containerName()); + Assertions.assertEquals("gzv", model.value().get(0).properties().sourceResourceId()); + Assertions.assertEquals("ij", model.value().get(0).properties().policyId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-23T21:14:10Z"), + model.value().get(0).properties().lastRecoveryPoint()); + Assertions.assertEquals("qnwsithuqolyah", model.value().get(0).properties().backupSetName()); + Assertions.assertEquals(CreateMode.RECOVER, model.value().get(0).properties().createMode()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-06T10:28:40Z"), + model.value().get(0).properties().deferredDeleteTimeInUtc()); + Assertions.assertFalse(model.value().get(0).properties().isScheduledForDeferredDelete()); + Assertions.assertEquals("utrjbhxyk", model.value().get(0).properties().deferredDeleteTimeRemaining()); + Assertions.assertFalse(model.value().get(0).properties().isDeferredDeleteScheduleUpcoming()); + Assertions.assertFalse(model.value().get(0).properties().isRehydrate()); + Assertions.assertEquals("qqug", model.value().get(0).properties().resourceGuardOperationRequests().get(0)); + Assertions.assertFalse(model.value().get(0).properties().isArchiveEnabled()); + Assertions.assertEquals("quowtljvfwhrea", model.value().get(0).properties().policyName()); + Assertions.assertEquals(1687085732, model.value().get(0).properties().softDeleteRetentionPeriodInDays()); + Assertions.assertEquals(SourceSideScanStatus.CONFIGURED, + model.value().get(0).properties().sourceSideScanInfo().sourceSideScanStatus()); + Assertions.assertEquals(SourceSideScanSummary.SUSPICIOUS, + model.value().get(0).properties().sourceSideScanInfo().sourceSideScanSummary()); + Assertions.assertEquals("ulmdgglm", model.value().get(0).tags().get("pjpfseykgs")); + Assertions.assertEquals("jcngoadyed", model.value().get(0).location()); + Assertions.assertEquals("rgjfoknubnoi", model.value().get(0).etag()); + Assertions.assertEquals("igvxvatvcrk", model.nextLink()); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantRecoveryPointResourceListTests.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantRecoveryPointResourceListTests.java new file mode 100644 index 000000000000..94e38ef0165e --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantRecoveryPointResourceListTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.models.CrossTenantRecoveryPointResourceList; +import com.azure.resourcemanager.recoveryservicesbackup.models.ThreatSeverity; +import com.azure.resourcemanager.recoveryservicesbackup.models.ThreatState; +import com.azure.resourcemanager.recoveryservicesbackup.models.ThreatStatus; +import org.junit.jupiter.api.Assertions; + +public final class CrossTenantRecoveryPointResourceListTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CrossTenantRecoveryPointResourceList model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"objectType\":\"RecoveryPoint\",\"threatStatus\":\"Healthy\",\"threatInfo\":[{\"threatTitle\":\"csyhzlwxaeaov\",\"threatDescription\":\"exdnd\",\"lastUpdatedTime\":\"2021-03-24T09:38:27Z\",\"threatState\":\"Active\",\"threatStartTime\":\"2021-11-23T07:57:26Z\",\"threatEndTime\":\"2021-04-10T02:14:18Z\",\"threatURI\":\"mwntopagttmvmma\",\"threatSeverity\":\"Warning\"}]},\"tags\":{\"mxitpfinzcpd\":\"lkjztjiuazjc\",\"vcqguefzh\":\"tkrlgjmtbd\",\"lyujlfyoump\":\"mpheqdur\",\"brzmqxucycijoclx\":\"kyeclcdigpta\"},\"location\":\"tgjcy\",\"eTag\":\"zjd\",\"id\":\"qjbtxjeaoqaqbzgy\",\"name\":\"fwwvuatbwbqam\",\"type\":\"e\"}],\"nextLink\":\"iyslpkcvmwfaux\"}") + .toObject(CrossTenantRecoveryPointResourceList.class); + Assertions.assertEquals(ThreatStatus.HEALTHY, model.value().get(0).properties().threatStatus()); + Assertions.assertEquals(ThreatState.ACTIVE, + model.value().get(0).properties().threatInfo().get(0).threatState()); + Assertions.assertEquals(ThreatSeverity.WARNING, + model.value().get(0).properties().threatInfo().get(0).threatSeverity()); + Assertions.assertEquals("lkjztjiuazjc", model.value().get(0).tags().get("mxitpfinzcpd")); + Assertions.assertEquals("tgjcy", model.value().get(0).location()); + Assertions.assertEquals("zjd", model.value().get(0).etag()); + Assertions.assertEquals("iyslpkcvmwfaux", model.nextLink()); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultMappingInnerTests.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultMappingInnerTests.java new file mode 100644 index 000000000000..01afae9421c0 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultMappingInnerTests.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.CrossTenantVaultMappingInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.CrossTenantVaultMappingProperties; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class CrossTenantVaultMappingInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CrossTenantVaultMappingInner model = BinaryData.fromString( + "{\"properties\":{\"sourceVaultId\":\"etpozycyqiq\",\"sourceTenantId\":\"gfsetzlexbsfled\",\"mappingName\":\"ojpziuwfb\",\"createdTime\":\"2021-04-01T20:47:50Z\",\"resourceGuardOperationRequests\":[\"nhqs\",\"cljse\"],\"provisioningState\":\"Succeeded\"},\"id\":\"bafvafhlbylcc\",\"name\":\"evxrhyz\",\"type\":\"fwrsofpltdbmair\"}") + .toObject(CrossTenantVaultMappingInner.class); + Assertions.assertEquals("etpozycyqiq", model.properties().sourceVaultId()); + Assertions.assertEquals("nhqs", model.properties().resourceGuardOperationRequests().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CrossTenantVaultMappingInner model = new CrossTenantVaultMappingInner() + .withProperties(new CrossTenantVaultMappingProperties().withSourceVaultId("etpozycyqiq") + .withResourceGuardOperationRequests(Arrays.asList("nhqs", "cljse"))); + model = BinaryData.fromObject(model).toObject(CrossTenantVaultMappingInner.class); + Assertions.assertEquals("etpozycyqiq", model.properties().sourceVaultId()); + Assertions.assertEquals("nhqs", model.properties().resourceGuardOperationRequests().get(0)); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultMappingListResultTests.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultMappingListResultTests.java new file mode 100644 index 000000000000..111732786454 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultMappingListResultTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackup.implementation.models.CrossTenantVaultMappingListResult; +import org.junit.jupiter.api.Assertions; + +public final class CrossTenantVaultMappingListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CrossTenantVaultMappingListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"sourceVaultId\":\"noakiz\",\"sourceTenantId\":\"aikn\",\"mappingName\":\"lnuwiguy\",\"createdTime\":\"2021-04-22T01:24:55Z\",\"resourceGuardOperationRequests\":[\"phvxz\",\"wxh\"],\"provisioningState\":\"Failed\"},\"id\":\"tl\",\"name\":\"exaonwivkcq\",\"type\":\"rxhxkn\"}],\"nextLink\":\"crmmkyupijuby\"}") + .toObject(CrossTenantVaultMappingListResult.class); + Assertions.assertEquals("noakiz", model.value().get(0).properties().sourceVaultId()); + Assertions.assertEquals("phvxz", model.value().get(0).properties().resourceGuardOperationRequests().get(0)); + Assertions.assertEquals("crmmkyupijuby", model.nextLink()); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultMappingPropertiesTests.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultMappingPropertiesTests.java new file mode 100644 index 000000000000..7e62d48ee3e3 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultMappingPropertiesTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackup.models.CrossTenantVaultMappingProperties; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class CrossTenantVaultMappingPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CrossTenantVaultMappingProperties model = BinaryData.fromString( + "{\"sourceVaultId\":\"hvhfnracw\",\"sourceTenantId\":\"qigtuujwouhdaws\",\"mappingName\":\"rb\",\"createdTime\":\"2021-07-09T10:35:13Z\",\"resourceGuardOperationRequests\":[\"ybvitvqkjyaznumt\",\"gmuwdchozfnkf\"],\"provisioningState\":\"Succeeded\"}") + .toObject(CrossTenantVaultMappingProperties.class); + Assertions.assertEquals("hvhfnracw", model.sourceVaultId()); + Assertions.assertEquals("ybvitvqkjyaznumt", model.resourceGuardOperationRequests().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CrossTenantVaultMappingProperties model = new CrossTenantVaultMappingProperties().withSourceVaultId("hvhfnracw") + .withResourceGuardOperationRequests(Arrays.asList("ybvitvqkjyaznumt", "gmuwdchozfnkf")); + model = BinaryData.fromObject(model).toObject(CrossTenantVaultMappingProperties.class); + Assertions.assertEquals("hvhfnracw", model.sourceVaultId()); + Assertions.assertEquals("ybvitvqkjyaznumt", model.resourceGuardOperationRequests().get(0)); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultMappingStatusCheckWithResponseMockTests.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultMappingStatusCheckWithResponseMockTests.java new file mode 100644 index 000000000000..eb08bf07d8f4 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultMappingStatusCheckWithResponseMockTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.models.CrossTenantVaultMappingStatusResponse; +import com.azure.resourcemanager.recoveryservicesbackup.models.VaultMappingState; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class CrossTenantVaultMappingStatusCheckWithResponseMockTests { + @Test + public void testCheckWithResponse() throws Exception { + String responseStr = "{\"mappingName\":\"taq\",\"mappingState\":\"Inactive\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + RecoveryServicesBackupManager manager = RecoveryServicesBackupManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + CrossTenantVaultMappingStatusResponse response = manager.crossTenantVaultMappingStatus() + .checkWithResponse("rbypi", "dbkp", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("taq", response.mappingName()); + Assertions.assertEquals(VaultMappingState.INACTIVE, response.mappingState()); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultMappingStatusResponseInnerTests.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultMappingStatusResponseInnerTests.java new file mode 100644 index 000000000000..0226115d6f65 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultMappingStatusResponseInnerTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.CrossTenantVaultMappingStatusResponseInner; +import com.azure.resourcemanager.recoveryservicesbackup.models.VaultMappingState; +import org.junit.jupiter.api.Assertions; + +public final class CrossTenantVaultMappingStatusResponseInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CrossTenantVaultMappingStatusResponseInner model + = BinaryData.fromString("{\"mappingName\":\"myildudxjasc\",\"mappingState\":\"Inactive\"}") + .toObject(CrossTenantVaultMappingStatusResponseInner.class); + Assertions.assertEquals("myildudxjasc", model.mappingName()); + Assertions.assertEquals(VaultMappingState.INACTIVE, model.mappingState()); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultMappingsCreateOrUpdateWithResponseMockTests.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultMappingsCreateOrUpdateWithResponseMockTests.java new file mode 100644 index 000000000000..386cc473bfa1 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultMappingsCreateOrUpdateWithResponseMockTests.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.models.CrossTenantVaultMapping; +import com.azure.resourcemanager.recoveryservicesbackup.models.CrossTenantVaultMappingProperties; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class CrossTenantVaultMappingsCreateOrUpdateWithResponseMockTests { + @Test + public void testCreateOrUpdateWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"sourceVaultId\":\"ojxrjnbsconxavi\",\"sourceTenantId\":\"eychbji\",\"mappingName\":\"fsgnw\",\"createdTime\":\"2021-01-06T05:21:57Z\",\"resourceGuardOperationRequests\":[\"p\"],\"provisioningState\":\"Succeeded\"},\"id\":\"borx\",\"name\":\"p\",\"type\":\"lnfyzav\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + RecoveryServicesBackupManager manager = RecoveryServicesBackupManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + CrossTenantVaultMapping response = manager.crossTenantVaultMappings() + .define("gpterdiu") + .withExistingVault("myrqsdbpokszan", "h") + .withProperties(new CrossTenantVaultMappingProperties().withSourceVaultId("i") + .withResourceGuardOperationRequests(Arrays.asList("dgzyybzoxlvoc", "tvdxxhe"))) + .create(); + + Assertions.assertEquals("ojxrjnbsconxavi", response.properties().sourceVaultId()); + Assertions.assertEquals("p", response.properties().resourceGuardOperationRequests().get(0)); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultMappingsGetWithResponseMockTests.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultMappingsGetWithResponseMockTests.java new file mode 100644 index 000000000000..41c4f2eb82ff --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultMappingsGetWithResponseMockTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.models.CrossTenantVaultMapping; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class CrossTenantVaultMappingsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"sourceVaultId\":\"mnc\",\"sourceTenantId\":\"fzuscstun\",\"mappingName\":\"hxdfbkl\",\"createdTime\":\"2021-03-01T00:37:06Z\",\"resourceGuardOperationRequests\":[\"gjsysmvxodgwxfkz\",\"ifc\",\"vbdujgcwxvecbb\"],\"provisioningState\":\"Updating\"},\"id\":\"dxrizagb\",\"name\":\"giarksykpgdqxw\",\"type\":\"b\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + RecoveryServicesBackupManager manager = RecoveryServicesBackupManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + CrossTenantVaultMapping response = manager.crossTenantVaultMappings() + .getWithResponse("jkrukizyhgsqtnqs", "txqfpjbq", "gweeiwd", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("mnc", response.properties().sourceVaultId()); + Assertions.assertEquals("gjsysmvxodgwxfkz", response.properties().resourceGuardOperationRequests().get(0)); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultMappingsListMockTests.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultMappingsListMockTests.java new file mode 100644 index 000000000000..3a7dac72f3cc --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultMappingsListMockTests.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.models.CrossTenantVaultMapping; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class CrossTenantVaultMappingsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"sourceVaultId\":\"fmmainwhedxkpbq\",\"sourceTenantId\":\"ntobu\",\"mappingName\":\"azz\",\"createdTime\":\"2021-03-10T16:16:19Z\",\"resourceGuardOperationRequests\":[\"ydjufbnklbl\",\"xpegj\",\"dabalfdxaglzfytl\"],\"provisioningState\":\"Canceled\"},\"id\":\"h\",\"name\":\"pxouvmr\",\"type\":\"iflikyypzkgxfx\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + RecoveryServicesBackupManager manager = RecoveryServicesBackupManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.crossTenantVaultMappings().list("rwiqrxhacl", "dosqkptjqg", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("fmmainwhedxkpbq", response.iterator().next().properties().sourceVaultId()); + Assertions.assertEquals("ydjufbnklbl", + response.iterator().next().properties().resourceGuardOperationRequests().get(0)); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultRecoveryPointOperationsGetWithResponseMockTests.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultRecoveryPointOperationsGetWithResponseMockTests.java new file mode 100644 index 000000000000..ffa32fc84883 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultRecoveryPointOperationsGetWithResponseMockTests.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.models.RecoveryPointResource; +import com.azure.resourcemanager.recoveryservicesbackup.models.ThreatSeverity; +import com.azure.resourcemanager.recoveryservicesbackup.models.ThreatState; +import com.azure.resourcemanager.recoveryservicesbackup.models.ThreatStatus; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class CrossTenantVaultRecoveryPointOperationsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"objectType\":\"RecoveryPoint\",\"threatStatus\":\"Unknown\",\"threatInfo\":[{\"threatTitle\":\"jmlreesrfwsszvlc\",\"threatDescription\":\"isolntfxxcrqmip\",\"lastUpdatedTime\":\"2021-03-10T14:18:25Z\",\"threatState\":\"InProgress\",\"threatStartTime\":\"2021-11-17T11:45:48Z\",\"threatEndTime\":\"2021-08-12T06:09:54Z\",\"threatURI\":\"s\",\"threatSeverity\":\"High\"},{\"threatTitle\":\"aizabu\",\"threatDescription\":\"vgs\",\"lastUpdatedTime\":\"2021-02-19T18:14:33Z\",\"threatState\":\"InProgress\",\"threatStartTime\":\"2021-02-27T13:05:55Z\",\"threatEndTime\":\"2021-05-16T09:27:41Z\",\"threatURI\":\"jznvhxqqmq\",\"threatSeverity\":\"High\"}]},\"tags\":{\"tfshksnyzm\":\"hfnzocx\",\"bnl\":\"pamwbw\",\"kvi\":\"lcefiqdktw\",\"uuzhw\":\"lpfliwoyn\"},\"location\":\"adpcmhjhausy\",\"eTag\":\"ekymffztsilscvqs\",\"id\":\"iihfymkoui\",\"name\":\"yese\",\"type\":\"ugc\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + RecoveryServicesBackupManager manager = RecoveryServicesBackupManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + RecoveryPointResource response = manager.crossTenantVaultRecoveryPointOperations() + .getWithResponse("nlwglihezomucmq", "isnionetbzdrdpue", "xkgtlzlmtrlxcznn", "zkbnbmxl", "mwt", "g", + "qzusitoq", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals(ThreatStatus.UNKNOWN, response.properties().threatStatus()); + Assertions.assertEquals(ThreatState.IN_PROGRESS, response.properties().threatInfo().get(0).threatState()); + Assertions.assertEquals(ThreatSeverity.HIGH, response.properties().threatInfo().get(0).threatSeverity()); + Assertions.assertEquals("hfnzocx", response.tags().get("tfshksnyzm")); + Assertions.assertEquals("adpcmhjhausy", response.location()); + Assertions.assertEquals("ekymffztsilscvqs", response.etag()); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultRecoveryPointsListMockTests.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultRecoveryPointsListMockTests.java new file mode 100644 index 000000000000..7d8de079cf32 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/CrossTenantVaultRecoveryPointsListMockTests.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.models.RecoveryPointResource; +import com.azure.resourcemanager.recoveryservicesbackup.models.ThreatSeverity; +import com.azure.resourcemanager.recoveryservicesbackup.models.ThreatState; +import com.azure.resourcemanager.recoveryservicesbackup.models.ThreatStatus; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class CrossTenantVaultRecoveryPointsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"objectType\":\"RecoveryPoint\",\"threatStatus\":\"UnHealthy\",\"threatInfo\":[{\"threatTitle\":\"rfizr\",\"threatDescription\":\"wlp\",\"lastUpdatedTime\":\"2021-09-11T03:33:36Z\",\"threatState\":\"Resolved\",\"threatStartTime\":\"2021-06-23T08:52:09Z\",\"threatEndTime\":\"2021-05-31T06:57:04Z\",\"threatURI\":\"k\",\"threatSeverity\":\"Informational\"},{\"threatTitle\":\"u\",\"threatDescription\":\"ixcnpcf\",\"lastUpdatedTime\":\"2021-12-03T10:30:32Z\",\"threatState\":\"Resolved\",\"threatStartTime\":\"2021-06-05T11:09:10Z\",\"threatEndTime\":\"2021-05-11T15:07:33Z\",\"threatURI\":\"mpjprdpw\",\"threatSeverity\":\"Warning\"},{\"threatTitle\":\"pcf\",\"threatDescription\":\"wzlgzawkgy\",\"lastUpdatedTime\":\"2021-08-26T09:37:23Z\",\"threatState\":\"InProgress\",\"threatStartTime\":\"2021-06-14T04:26:34Z\",\"threatEndTime\":\"2021-08-30T00:14:44Z\",\"threatURI\":\"diawpzxkzr\",\"threatSeverity\":\"High\"}]},\"tags\":{\"gwqpsqazih\":\"tdhuo\",\"ztibniyntsxjmfm\":\"odvqgcnbhcbmj\",\"hskb\":\"ftvhkmoogj\"},\"location\":\"mjgrulcfog\",\"eTag\":\"cxn\",\"id\":\"tpfdzxcouzfwofwa\",\"name\":\"ukz\",\"type\":\"dtzxsoe\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + RecoveryServicesBackupManager manager = RecoveryServicesBackupManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.crossTenantVaultRecoveryPoints() + .list("qlf", "olqownki", "ajewna", "w", "xjjmztnlmsoodtm", "ecdh", "yswcrptveajczx", + com.azure.core.util.Context.NONE); + + Assertions.assertEquals(ThreatStatus.UN_HEALTHY, response.iterator().next().properties().threatStatus()); + Assertions.assertEquals(ThreatState.RESOLVED, + response.iterator().next().properties().threatInfo().get(0).threatState()); + Assertions.assertEquals(ThreatSeverity.INFORMATIONAL, + response.iterator().next().properties().threatInfo().get(0).threatSeverity()); + Assertions.assertEquals("tdhuo", response.iterator().next().tags().get("gwqpsqazih")); + Assertions.assertEquals("mjgrulcfog", response.iterator().next().location()); + Assertions.assertEquals("cxn", response.iterator().next().etag()); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/JobDetailsFromCrossTenantVaultsGetWithResponseMockTests.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/JobDetailsFromCrossTenantVaultsGetWithResponseMockTests.java new file mode 100644 index 000000000000..af6fa46ed13f --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/JobDetailsFromCrossTenantVaultsGetWithResponseMockTests.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.models.BackupManagementType; +import com.azure.resourcemanager.recoveryservicesbackup.models.JobResource; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class JobDetailsFromCrossTenantVaultsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"jobType\":\"Job\",\"entityFriendlyName\":\"jzmhkdclacroczfm\",\"backupManagementType\":\"AzureStorage\",\"operation\":\"keluxz\",\"status\":\"xzezbzuzudlevzs\",\"startTime\":\"2021-04-24T02:43:20Z\",\"endTime\":\"2021-02-01T06:23:14Z\",\"activityId\":\"fsgqkstyecupyuij\"},\"tags\":{\"qwuzvcmcokx\":\"davsjcfmazpz\",\"frjwucaon\":\"zeku\",\"ckzidgzwdydami\":\"vajbvbnkrdemdid\",\"pjfojiunrls\":\"vpztdivykpxkqej\"},\"location\":\"uknsykdtoi\",\"eTag\":\"ancdrc\",\"id\":\"nvxuldxonckb\",\"name\":\"lblfxlupibaqzizx\",\"type\":\"pzweghlwwbo\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + RecoveryServicesBackupManager manager = RecoveryServicesBackupManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + JobResource response = manager.jobDetailsFromCrossTenantVaults() + .getWithResponse("jemexmnv", "vmuw", "xlniwmcpm", "rdlhvdvmiphbe", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("jzmhkdclacroczfm", response.properties().entityFriendlyName()); + Assertions.assertEquals(BackupManagementType.AZURE_STORAGE, response.properties().backupManagementType()); + Assertions.assertEquals("keluxz", response.properties().operation()); + Assertions.assertEquals("xzezbzuzudlevzs", response.properties().status()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-24T02:43:20Z"), response.properties().startTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-01T06:23:14Z"), response.properties().endTime()); + Assertions.assertEquals("fsgqkstyecupyuij", response.properties().activityId()); + Assertions.assertEquals("davsjcfmazpz", response.tags().get("qwuzvcmcokx")); + Assertions.assertEquals("uknsykdtoi", response.location()); + Assertions.assertEquals("ancdrc", response.etag()); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectedItemFromCrossTenantVaultsGetWithResponseMockTests.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectedItemFromCrossTenantVaultsGetWithResponseMockTests.java new file mode 100644 index 000000000000..1f74c5ff5855 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/ProtectedItemFromCrossTenantVaultsGetWithResponseMockTests.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager; +import com.azure.resourcemanager.recoveryservicesbackup.models.CreateMode; +import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectedItemResource; +import com.azure.resourcemanager.recoveryservicesbackup.models.SourceSideScanStatus; +import com.azure.resourcemanager.recoveryservicesbackup.models.SourceSideScanSummary; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ProtectedItemFromCrossTenantVaultsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"protectedItemType\":\"ProtectedItem\",\"backupManagementType\":\"AzureIaasVM\",\"workloadType\":\"AzureSqlDb\",\"containerName\":\"khkrc\",\"sourceResourceId\":\"gcbv\",\"policyId\":\"rmqcbpok\",\"lastRecoveryPoint\":\"2021-09-24T10:56:37Z\",\"backupSetName\":\"nvago\",\"createMode\":\"Recover\",\"deferredDeleteTimeInUTC\":\"2021-02-09T23:13:57Z\",\"isScheduledForDeferredDelete\":true,\"deferredDeleteTimeRemaining\":\"rdvcehqwhit\",\"isDeferredDeleteScheduleUpcoming\":true,\"isRehydrate\":false,\"resourceGuardOperationRequests\":[\"guzbuw\",\"orbalkj\",\"bkbdhlltqstqkqs\"],\"isArchiveEnabled\":true,\"policyName\":\"yneco\",\"softDeleteRetentionPeriodInDays\":437792552,\"vaultId\":\"kheubanlx\",\"sourceSideScanInfo\":{\"sourceSideScanStatus\":\"NotApplicable\",\"sourceSideScanSummary\":\"Suspicious\"}},\"tags\":{\"zuxlrarwpewsau\":\"iawzlzklaslgac\",\"sx\":\"oejtig\"},\"location\":\"ytnkqb\",\"eTag\":\"ahovuuw\",\"id\":\"mehjnhjioti\",\"name\":\"fbbcngkegxcypxbb\",\"type\":\"etwilyrzoxpd\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + RecoveryServicesBackupManager manager = RecoveryServicesBackupManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + ProtectedItemResource response = manager.protectedItemFromCrossTenantVaults() + .getWithResponse("wfgcdiykkcxwn", "jvqynvavitmdm", "qohhihra", "quddrwjclj", "rhlhpvzadbwenni", + "afhxrzfrmvztiuc", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("khkrc", response.properties().containerName()); + Assertions.assertEquals("gcbv", response.properties().sourceResourceId()); + Assertions.assertEquals("rmqcbpok", response.properties().policyId()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-24T10:56:37Z"), + response.properties().lastRecoveryPoint()); + Assertions.assertEquals("nvago", response.properties().backupSetName()); + Assertions.assertEquals(CreateMode.RECOVER, response.properties().createMode()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-09T23:13:57Z"), + response.properties().deferredDeleteTimeInUtc()); + Assertions.assertTrue(response.properties().isScheduledForDeferredDelete()); + Assertions.assertEquals("rdvcehqwhit", response.properties().deferredDeleteTimeRemaining()); + Assertions.assertTrue(response.properties().isDeferredDeleteScheduleUpcoming()); + Assertions.assertFalse(response.properties().isRehydrate()); + Assertions.assertEquals("guzbuw", response.properties().resourceGuardOperationRequests().get(0)); + Assertions.assertTrue(response.properties().isArchiveEnabled()); + Assertions.assertEquals("yneco", response.properties().policyName()); + Assertions.assertEquals(437792552, response.properties().softDeleteRetentionPeriodInDays()); + Assertions.assertEquals(SourceSideScanStatus.NOT_APPLICABLE, + response.properties().sourceSideScanInfo().sourceSideScanStatus()); + Assertions.assertEquals(SourceSideScanSummary.SUSPICIOUS, + response.properties().sourceSideScanInfo().sourceSideScanSummary()); + Assertions.assertEquals("iawzlzklaslgac", response.tags().get("zuxlrarwpewsau")); + Assertions.assertEquals("ytnkqb", response.location()); + Assertions.assertEquals("ahovuuw", response.etag()); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/RecoveryPointImmutabilityPropertiesTests.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/RecoveryPointImmutabilityPropertiesTests.java new file mode 100644 index 000000000000..5bc2bffd6a3c --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/RecoveryPointImmutabilityPropertiesTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackup.models.RecoveryPointImmutabilityProperties; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class RecoveryPointImmutabilityPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RecoveryPointImmutabilityProperties model + = BinaryData.fromString("{\"isImmutable\":true,\"expiryTime\":\"2020-12-27T23:29:08Z\"}") + .toObject(RecoveryPointImmutabilityProperties.class); + Assertions.assertTrue(model.isImmutable()); + Assertions.assertEquals(OffsetDateTime.parse("2020-12-27T23:29:08Z"), model.expiryTime()); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/RemoveCrossTenantVaultMappingRequestTests.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/RemoveCrossTenantVaultMappingRequestTests.java new file mode 100644 index 000000000000..c1272a744e36 --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/RemoveCrossTenantVaultMappingRequestTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackup.models.RemoveCrossTenantVaultMappingRequest; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class RemoveCrossTenantVaultMappingRequestTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RemoveCrossTenantVaultMappingRequest model + = BinaryData.fromString("{\"resourceGuardOperationRequests\":[\"kakfqfr\"]}") + .toObject(RemoveCrossTenantVaultMappingRequest.class); + Assertions.assertEquals("kakfqfr", model.resourceGuardOperationRequests().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RemoveCrossTenantVaultMappingRequest model + = new RemoveCrossTenantVaultMappingRequest().withResourceGuardOperationRequests(Arrays.asList("kakfqfr")); + model = BinaryData.fromObject(model).toObject(RemoveCrossTenantVaultMappingRequest.class); + Assertions.assertEquals("kakfqfr", model.resourceGuardOperationRequests().get(0)); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/VaultCredentialCertificateCreateOptionsTests.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/VaultCredentialCertificateCreateOptionsTests.java new file mode 100644 index 000000000000..4b9b9fd2a35e --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/VaultCredentialCertificateCreateOptionsTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackup.models.VaultCredentialCertificateCreateOptions; +import org.junit.jupiter.api.Assertions; + +public final class VaultCredentialCertificateCreateOptionsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + VaultCredentialCertificateCreateOptions model = BinaryData.fromString("{\"validityInHours\":375301967}") + .toObject(VaultCredentialCertificateCreateOptions.class); + Assertions.assertEquals(375301967, model.validityInHours()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + VaultCredentialCertificateCreateOptions model + = new VaultCredentialCertificateCreateOptions().withValidityInHours(375301967); + model = BinaryData.fromObject(model).toObject(VaultCredentialCertificateCreateOptions.class); + Assertions.assertEquals(375301967, model.validityInHours()); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/VaultCredentialCertificateRequestTests.java b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/VaultCredentialCertificateRequestTests.java new file mode 100644 index 000000000000..47a712d92d8d --- /dev/null +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/test/java/com/azure/resourcemanager/recoveryservicesbackup/generated/VaultCredentialCertificateRequestTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.recoveryservicesbackup.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.recoveryservicesbackup.models.VaultCredentialCertificateCreateOptions; +import com.azure.resourcemanager.recoveryservicesbackup.models.VaultCredentialCertificateRequest; +import org.junit.jupiter.api.Assertions; + +public final class VaultCredentialCertificateRequestTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + VaultCredentialCertificateRequest model + = BinaryData.fromString("{\"certificateCreateOptions\":{\"validityInHours\":1984773114}}") + .toObject(VaultCredentialCertificateRequest.class); + Assertions.assertEquals(1984773114, model.certificateCreateOptions().validityInHours()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + VaultCredentialCertificateRequest model = new VaultCredentialCertificateRequest().withCertificateCreateOptions( + new VaultCredentialCertificateCreateOptions().withValidityInHours(1984773114)); + model = BinaryData.fromObject(model).toObject(VaultCredentialCertificateRequest.class); + Assertions.assertEquals(1984773114, model.certificateCreateOptions().validityInHours()); + } +} diff --git a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/tsp-location.yaml b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/tsp-location.yaml index 7337392aa473..a953e1045c9b 100644 --- a/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/tsp-location.yaml +++ b/sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/RecoveryServicesBackup -commit: 042bda0af13d410e9b8a41789e22e1c9feb4bf6f +commit: 39bf1b80fd8bc55b091192d51d67433c84930639 repo: Azure/azure-rest-api-specs additionalDirectories: diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/SecurityManager.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/SecurityManager.java index ed3f01dc243e..bb1058fc9a83 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/SecurityManager.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/SecurityManager.java @@ -99,6 +99,7 @@ import com.azure.resourcemanager.security.implementation.SubAssessmentsImpl; import com.azure.resourcemanager.security.implementation.TasksImpl; import com.azure.resourcemanager.security.implementation.TopologiesImpl; +import com.azure.resourcemanager.security.implementation.TopologyResourcesImpl; import com.azure.resourcemanager.security.implementation.WorkspaceSettingsImpl; import com.azure.resourcemanager.security.models.AdvancedThreatProtections; import com.azure.resourcemanager.security.models.Alerts; @@ -173,6 +174,7 @@ import com.azure.resourcemanager.security.models.SubAssessments; import com.azure.resourcemanager.security.models.Tasks; import com.azure.resourcemanager.security.models.Topologies; +import com.azure.resourcemanager.security.models.TopologyResources; import com.azure.resourcemanager.security.models.WorkspaceSettings; import java.time.Duration; import java.time.temporal.ChronoUnit; @@ -259,6 +261,8 @@ public final class SecurityManager { private SecuritySolutions securitySolutions; + private TopologyResources topologyResources; + private SecurityStandards securityStandards; private StandardAssignments standardAssignments; @@ -323,10 +327,10 @@ public final class SecurityManager { private ServerVulnerabilityAssessments serverVulnerabilityAssessments; - private Topologies topologies; - private SecuritySolutionsReferenceDatas securitySolutionsReferenceDatas; + private Topologies topologies; + private SensitivitySettings sensitivitySettings; private SqlVulnerabilityAssessmentSettingsOperations sqlVulnerabilityAssessmentSettingsOperations; @@ -992,6 +996,18 @@ public SecuritySolutions securitySolutions() { return securitySolutions; } + /** + * Gets the resource collection API of TopologyResources. + * + * @return Resource collection API of TopologyResources. + */ + public TopologyResources topologyResources() { + if (this.topologyResources == null) { + this.topologyResources = new TopologyResourcesImpl(clientObject.getTopologyResources(), this); + } + return topologyResources; + } + /** * Gets the resource collection API of SecurityStandards. It manages SecurityStandard. * @@ -1387,18 +1403,6 @@ public ServerVulnerabilityAssessments serverVulnerabilityAssessments() { return serverVulnerabilityAssessments; } - /** - * Gets the resource collection API of Topologies. - * - * @return Resource collection API of Topologies. - */ - public Topologies topologies() { - if (this.topologies == null) { - this.topologies = new TopologiesImpl(clientObject.getTopologies(), this); - } - return topologies; - } - /** * Gets the resource collection API of SecuritySolutionsReferenceDatas. * @@ -1412,6 +1416,18 @@ public SecuritySolutionsReferenceDatas securitySolutionsReferenceDatas() { return securitySolutionsReferenceDatas; } + /** + * Gets the resource collection API of Topologies. + * + * @return Resource collection API of Topologies. + */ + public Topologies topologies() { + if (this.topologies == null) { + this.topologies = new TopologiesImpl(clientObject.getTopologies(), this); + } + return topologies; + } + /** * Gets the resource collection API of SensitivitySettings. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AlertsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AlertsClient.java index a5cb3bfc0457..e3695428e3d5 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AlertsClient.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AlertsClient.java @@ -226,23 +226,23 @@ Response getResourceGroupLevelWithResponse(String resourceGroupName, /** * List all the alerts that are associated with the resource group that are stored in a specific location. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get * locations. - * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of security alerts as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listResourceGroupLevelByRegion(String ascLocation, String resourceGroupName); + PagedIterable listResourceGroupLevelByRegion(String resourceGroupName, String ascLocation); /** * List all the alerts that are associated with the resource group that are stored in a specific location. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get * locations. - * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -250,7 +250,7 @@ Response getResourceGroupLevelWithResponse(String resourceGroupName, * @return list of security alerts as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listResourceGroupLevelByRegion(String ascLocation, String resourceGroupName, + PagedIterable listResourceGroupLevelByRegion(String resourceGroupName, String ascLocation, Context context); /** diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityCenter.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityCenter.java index cf6094bb591f..b11cecb9e5b0 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityCenter.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityCenter.java @@ -291,6 +291,13 @@ public interface SecurityCenter { */ SecuritySolutionsClient getSecuritySolutions(); + /** + * Gets the TopologyResourcesClient object to access its operations. + * + * @return the TopologyResourcesClient object. + */ + TopologyResourcesClient getTopologyResources(); + /** * Gets the SecurityStandardsClient object to access its operations. * @@ -516,18 +523,18 @@ public interface SecurityCenter { ServerVulnerabilityAssessmentsClient getServerVulnerabilityAssessments(); /** - * Gets the TopologiesClient object to access its operations. + * Gets the SecuritySolutionsReferenceDatasClient object to access its operations. * - * @return the TopologiesClient object. + * @return the SecuritySolutionsReferenceDatasClient object. */ - TopologiesClient getTopologies(); + SecuritySolutionsReferenceDatasClient getSecuritySolutionsReferenceDatas(); /** - * Gets the SecuritySolutionsReferenceDatasClient object to access its operations. + * Gets the TopologiesClient object to access its operations. * - * @return the SecuritySolutionsReferenceDatasClient object. + * @return the TopologiesClient object. */ - SecuritySolutionsReferenceDatasClient getSecuritySolutionsReferenceDatas(); + TopologiesClient getTopologies(); /** * Gets the SensitivitySettingsClient object to access its operations. diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/TopologiesClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/TopologiesClient.java index 581f9d902f74..d4b63aa9f94d 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/TopologiesClient.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/TopologiesClient.java @@ -7,7 +7,6 @@ import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; import com.azure.core.util.Context; import com.azure.resourcemanager.security.fluent.models.TopologyResourceInner; @@ -15,67 +14,6 @@ * An instance of this class provides access to all the operations defined in TopologiesClient. */ public interface TopologiesClient { - /** - * Gets a specific topology component. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param topologyResourceName Name of a topology resources collection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific topology component along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String ascLocation, - String topologyResourceName, Context context); - - /** - * Gets a specific topology component. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param topologyResourceName Name of a topology resources collection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific topology component. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - TopologyResourceInner get(String resourceGroupName, String ascLocation, String topologyResourceName); - - /** - * Gets a list that allows to build a topology view of a subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list that allows to build a topology view of a subscription and location as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByHomeRegion(String ascLocation); - - /** - * Gets a list that allows to build a topology view of a subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list that allows to build a topology view of a subscription and location as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByHomeRegion(String ascLocation, Context context); - /** * Gets a list that allows to build a topology view of a subscription. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/TopologyResourcesClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/TopologyResourcesClient.java new file mode 100644 index 000000000000..5ae53e57a92c --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/TopologyResourcesClient.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.security.fluent.models.TopologyResourceInner; + +/** + * An instance of this class provides access to all the operations defined in TopologyResourcesClient. + */ +public interface TopologyResourcesClient { + /** + * Gets a specific topology component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get + * locations. + * @param topologyResourceName Name of a topology resources collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a specific topology component along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String ascLocation, + String topologyResourceName, Context context); + + /** + * Gets a specific topology component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get + * locations. + * @param topologyResourceName Name of a topology resources collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a specific topology component. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TopologyResourceInner get(String resourceGroupName, String ascLocation, String topologyResourceName); + + /** + * Gets a list that allows to build a topology view of a subscription and location. + * + * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get + * locations. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list that allows to build a topology view of a subscription and location as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByHomeRegion(String ascLocation); + + /** + * Gets a list that allows to build a topology view of a subscription and location. + * + * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get + * locations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list that allows to build a topology view of a subscription and location as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByHomeRegion(String ascLocation, Context context); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ServerVulnerabilityAssessmentsSettingInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ServerVulnerabilityAssessmentsSettingInner.java index 74f728bed194..e9c912feebfb 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ServerVulnerabilityAssessmentsSettingInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ServerVulnerabilityAssessmentsSettingInner.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.security.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.json.JsonReader; @@ -12,13 +12,12 @@ import com.azure.json.JsonWriter; import com.azure.resourcemanager.security.models.AzureServersSetting; import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsSettingKind; -import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsSettingProperties; import java.io.IOException; /** * A base vulnerability assessments setting on servers in the defined scope. */ -@Fluent +@Immutable public class ServerVulnerabilityAssessmentsSettingInner extends ProxyResource { /* * The kind of the server vulnerability assessments setting. @@ -26,11 +25,6 @@ public class ServerVulnerabilityAssessmentsSettingInner extends ProxyResource { private ServerVulnerabilityAssessmentsSettingKind kind = ServerVulnerabilityAssessmentsSettingKind.fromString("ServerVulnerabilityAssessmentsSetting"); - /* - * The resource-specific properties for this resource. - */ - private ServerVulnerabilityAssessmentsSettingProperties properties; - /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @@ -66,27 +60,6 @@ public ServerVulnerabilityAssessmentsSettingKind kind() { return this.kind; } - /** - * Get the properties property: The resource-specific properties for this resource. - * - * @return the properties value. - */ - public ServerVulnerabilityAssessmentsSettingProperties properties() { - return this.properties; - } - - /** - * Set the properties property: The resource-specific properties for this resource. - * - * @param properties the properties value to set. - * @return the ServerVulnerabilityAssessmentsSettingInner object itself. - */ - public ServerVulnerabilityAssessmentsSettingInner - withProperties(ServerVulnerabilityAssessmentsSettingProperties properties) { - this.properties = properties; - return this; - } - /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * @@ -143,9 +116,6 @@ public String id() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (properties() != null) { - properties().validate(); - } } /** @@ -155,7 +125,6 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); - jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -211,9 +180,6 @@ static ServerVulnerabilityAssessmentsSettingInner fromJsonKnownDiscriminator(Jso } else if ("kind".equals(fieldName)) { deserializedServerVulnerabilityAssessmentsSettingInner.kind = ServerVulnerabilityAssessmentsSettingKind.fromString(reader.getString()); - } else if ("properties".equals(fieldName)) { - deserializedServerVulnerabilityAssessmentsSettingInner.properties - = ServerVulnerabilityAssessmentsSettingProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedServerVulnerabilityAssessmentsSettingInner.systemData = SystemData.fromJson(reader); } else { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SettingInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SettingInner.java index 6d50e843daf3..bed3f2af12a6 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SettingInner.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SettingInner.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.security.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.json.JsonReader; @@ -13,24 +13,18 @@ import com.azure.resourcemanager.security.models.AlertSyncSettings; import com.azure.resourcemanager.security.models.DataExportSettings; import com.azure.resourcemanager.security.models.SettingKind; -import com.azure.resourcemanager.security.models.SettingProperties; import java.io.IOException; /** * The kind of the security setting. */ -@Fluent +@Immutable public class SettingInner extends ProxyResource { /* * the kind of the settings string */ private SettingKind kind = SettingKind.fromString("Setting"); - /* - * The resource-specific properties for this resource. - */ - private SettingProperties properties; - /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ @@ -66,26 +60,6 @@ public SettingKind kind() { return this.kind; } - /** - * Get the properties property: The resource-specific properties for this resource. - * - * @return the properties value. - */ - public SettingProperties properties() { - return this.properties; - } - - /** - * Set the properties property: The resource-specific properties for this resource. - * - * @param properties the properties value to set. - * @return the SettingInner object itself. - */ - public SettingInner withProperties(SettingProperties properties) { - this.properties = properties; - return this; - } - /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * @@ -142,9 +116,6 @@ public String id() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (properties() != null) { - properties().validate(); - } } /** @@ -154,7 +125,6 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); - jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -209,8 +179,6 @@ static SettingInner fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOE deserializedSettingInner.type = reader.getString(); } else if ("kind".equals(fieldName)) { deserializedSettingInner.kind = SettingKind.fromString(reader.getString()); - } else if ("properties".equals(fieldName)) { - deserializedSettingInner.properties = SettingProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedSettingInner.systemData = SystemData.fromJson(reader); } else { diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsClientImpl.java index f10b89b0bd9c..d4512837e850 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsClientImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsClientImpl.java @@ -1110,24 +1110,24 @@ public AlertInner getResourceGroupLevel(String resourceGroupName, String ascLoca /** * List all the alerts that are associated with the resource group that are stored in a specific location. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get * locations. - * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of security alerts along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listResourceGroupLevelByRegionSinglePageAsync(String ascLocation, - String resourceGroupName) { - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } + private Mono> listResourceGroupLevelByRegionSinglePageAsync(String resourceGroupName, + String ascLocation) { if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } + if (ascLocation == null) { + return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); + } final String apiVersion = "2022-01-01"; final String accept = "application/json"; return FluxUtil @@ -1141,9 +1141,9 @@ private Mono> listResourceGroupLevelByRegionSinglePage /** * List all the alerts that are associated with the resource group that are stored in a specific location. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get * locations. - * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1151,15 +1151,15 @@ private Mono> listResourceGroupLevelByRegionSinglePage * @return list of security alerts along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listResourceGroupLevelByRegionSinglePageAsync(String ascLocation, - String resourceGroupName, Context context) { - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } + private Mono> listResourceGroupLevelByRegionSinglePageAsync(String resourceGroupName, + String ascLocation, Context context) { if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } + if (ascLocation == null) { + return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); + } final String apiVersion = "2022-01-01"; final String accept = "application/json"; context = this.client.mergeContext(context); @@ -1173,26 +1173,26 @@ private Mono> listResourceGroupLevelByRegionSinglePage /** * List all the alerts that are associated with the resource group that are stored in a specific location. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get * locations. - * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of security alerts as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listResourceGroupLevelByRegionAsync(String ascLocation, String resourceGroupName) { - return new PagedFlux<>(() -> listResourceGroupLevelByRegionSinglePageAsync(ascLocation, resourceGroupName), + private PagedFlux listResourceGroupLevelByRegionAsync(String resourceGroupName, String ascLocation) { + return new PagedFlux<>(() -> listResourceGroupLevelByRegionSinglePageAsync(resourceGroupName, ascLocation), nextLink -> listResourceGroupLevelByRegionNextSinglePageAsync(nextLink)); } /** * List all the alerts that are associated with the resource group that are stored in a specific location. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get * locations. - * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1200,35 +1200,35 @@ private PagedFlux listResourceGroupLevelByRegionAsync(String ascLoca * @return list of security alerts as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listResourceGroupLevelByRegionAsync(String ascLocation, String resourceGroupName, + private PagedFlux listResourceGroupLevelByRegionAsync(String resourceGroupName, String ascLocation, Context context) { return new PagedFlux<>( - () -> listResourceGroupLevelByRegionSinglePageAsync(ascLocation, resourceGroupName, context), + () -> listResourceGroupLevelByRegionSinglePageAsync(resourceGroupName, ascLocation, context), nextLink -> listResourceGroupLevelByRegionNextSinglePageAsync(nextLink, context)); } /** * List all the alerts that are associated with the resource group that are stored in a specific location. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get * locations. - * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of security alerts as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listResourceGroupLevelByRegion(String ascLocation, String resourceGroupName) { - return new PagedIterable<>(listResourceGroupLevelByRegionAsync(ascLocation, resourceGroupName)); + public PagedIterable listResourceGroupLevelByRegion(String resourceGroupName, String ascLocation) { + return new PagedIterable<>(listResourceGroupLevelByRegionAsync(resourceGroupName, ascLocation)); } /** * List all the alerts that are associated with the resource group that are stored in a specific location. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get * locations. - * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1236,9 +1236,9 @@ public PagedIterable listResourceGroupLevelByRegion(String ascLocati * @return list of security alerts as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listResourceGroupLevelByRegion(String ascLocation, String resourceGroupName, + public PagedIterable listResourceGroupLevelByRegion(String resourceGroupName, String ascLocation, Context context) { - return new PagedIterable<>(listResourceGroupLevelByRegionAsync(ascLocation, resourceGroupName, context)); + return new PagedIterable<>(listResourceGroupLevelByRegionAsync(resourceGroupName, ascLocation, context)); } /** diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsImpl.java index 92a3393b9eeb..62acf9eb9d72 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsImpl.java @@ -107,16 +107,16 @@ public Alert getResourceGroupLevel(String resourceGroupName, String ascLocation, } } - public PagedIterable listResourceGroupLevelByRegion(String ascLocation, String resourceGroupName) { + public PagedIterable listResourceGroupLevelByRegion(String resourceGroupName, String ascLocation) { PagedIterable inner - = this.serviceClient().listResourceGroupLevelByRegion(ascLocation, resourceGroupName); + = this.serviceClient().listResourceGroupLevelByRegion(resourceGroupName, ascLocation); return ResourceManagerUtils.mapPage(inner, inner1 -> new AlertImpl(inner1, this.manager())); } - public PagedIterable listResourceGroupLevelByRegion(String ascLocation, String resourceGroupName, + public PagedIterable listResourceGroupLevelByRegion(String resourceGroupName, String ascLocation, Context context) { PagedIterable inner - = this.serviceClient().listResourceGroupLevelByRegion(ascLocation, resourceGroupName, context); + = this.serviceClient().listResourceGroupLevelByRegion(resourceGroupName, ascLocation, context); return ResourceManagerUtils.mapPage(inner, inner1 -> new AlertImpl(inner1, this.manager())); } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityCenterImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityCenterImpl.java index 2328e982e761..81bc976e4980 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityCenterImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityCenterImpl.java @@ -97,6 +97,7 @@ import com.azure.resourcemanager.security.fluent.SubAssessmentsClient; import com.azure.resourcemanager.security.fluent.TasksClient; import com.azure.resourcemanager.security.fluent.TopologiesClient; +import com.azure.resourcemanager.security.fluent.TopologyResourcesClient; import com.azure.resourcemanager.security.fluent.WorkspaceSettingsClient; import java.io.IOException; import java.lang.reflect.Type; @@ -686,6 +687,20 @@ public SecuritySolutionsClient getSecuritySolutions() { return this.securitySolutions; } + /** + * The TopologyResourcesClient object to access its operations. + */ + private final TopologyResourcesClient topologyResources; + + /** + * Gets the TopologyResourcesClient object to access its operations. + * + * @return the TopologyResourcesClient object. + */ + public TopologyResourcesClient getTopologyResources() { + return this.topologyResources; + } + /** * The SecurityStandardsClient object to access its operations. */ @@ -1135,31 +1150,31 @@ public ServerVulnerabilityAssessmentsClient getServerVulnerabilityAssessments() } /** - * The TopologiesClient object to access its operations. + * The SecuritySolutionsReferenceDatasClient object to access its operations. */ - private final TopologiesClient topologies; + private final SecuritySolutionsReferenceDatasClient securitySolutionsReferenceDatas; /** - * Gets the TopologiesClient object to access its operations. + * Gets the SecuritySolutionsReferenceDatasClient object to access its operations. * - * @return the TopologiesClient object. + * @return the SecuritySolutionsReferenceDatasClient object. */ - public TopologiesClient getTopologies() { - return this.topologies; + public SecuritySolutionsReferenceDatasClient getSecuritySolutionsReferenceDatas() { + return this.securitySolutionsReferenceDatas; } /** - * The SecuritySolutionsReferenceDatasClient object to access its operations. + * The TopologiesClient object to access its operations. */ - private final SecuritySolutionsReferenceDatasClient securitySolutionsReferenceDatas; + private final TopologiesClient topologies; /** - * Gets the SecuritySolutionsReferenceDatasClient object to access its operations. + * Gets the TopologiesClient object to access its operations. * - * @return the SecuritySolutionsReferenceDatasClient object. + * @return the TopologiesClient object. */ - public SecuritySolutionsReferenceDatasClient getSecuritySolutionsReferenceDatas() { - return this.securitySolutionsReferenceDatas; + public TopologiesClient getTopologies() { + return this.topologies; } /** @@ -1271,6 +1286,7 @@ public SubAssessmentsClient getSubAssessments() { this.externalSecuritySolutions = new ExternalSecuritySolutionsClientImpl(this); this.jitNetworkAccessPolicies = new JitNetworkAccessPoliciesClientImpl(this); this.securitySolutions = new SecuritySolutionsClientImpl(this); + this.topologyResources = new TopologyResourcesClientImpl(this); this.securityStandards = new SecurityStandardsClientImpl(this); this.standardAssignments = new StandardAssignmentsClientImpl(this); this.customRecommendations = new CustomRecommendationsClientImpl(this); @@ -1305,8 +1321,8 @@ public SubAssessmentsClient getSubAssessments() { this.gitHubIssues = new GitHubIssuesClientImpl(this); this.allowedConnections = new AllowedConnectionsClientImpl(this); this.serverVulnerabilityAssessments = new ServerVulnerabilityAssessmentsClientImpl(this); - this.topologies = new TopologiesClientImpl(this); this.securitySolutionsReferenceDatas = new SecuritySolutionsReferenceDatasClientImpl(this); + this.topologies = new TopologiesClientImpl(this); this.sensitivitySettings = new SensitivitySettingsClientImpl(this); this.sqlVulnerabilityAssessmentSettingsOperations = new SqlVulnerabilityAssessmentSettingsOperationsClientImpl(this); diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsSettingImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsSettingImpl.java index ed7b886876d0..cc5d019a3cd4 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsSettingImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsSettingImpl.java @@ -8,7 +8,6 @@ import com.azure.resourcemanager.security.fluent.models.ServerVulnerabilityAssessmentsSettingInner; import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsSetting; import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsSettingKind; -import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsSettingProperties; public final class ServerVulnerabilityAssessmentsSettingImpl implements ServerVulnerabilityAssessmentsSetting { private ServerVulnerabilityAssessmentsSettingInner innerObject; @@ -37,10 +36,6 @@ public ServerVulnerabilityAssessmentsSettingKind kind() { return this.innerModel().kind(); } - public ServerVulnerabilityAssessmentsSettingProperties properties() { - return this.innerModel().properties(); - } - public SystemData systemData() { return this.innerModel().systemData(); } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SettingImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SettingImpl.java index 0a3e814cb301..3f7cdf638ed8 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SettingImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SettingImpl.java @@ -8,7 +8,6 @@ import com.azure.resourcemanager.security.fluent.models.SettingInner; import com.azure.resourcemanager.security.models.Setting; import com.azure.resourcemanager.security.models.SettingKind; -import com.azure.resourcemanager.security.models.SettingProperties; public final class SettingImpl implements Setting { private SettingInner innerObject; @@ -36,10 +35,6 @@ public SettingKind kind() { return this.innerModel().kind(); } - public SettingProperties properties() { - return this.innerModel().properties(); - } - public SystemData systemData() { return this.innerModel().systemData(); } diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TopologiesClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TopologiesClientImpl.java index dc0df91a3fc4..2f1322ca9d50 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TopologiesClientImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TopologiesClientImpl.java @@ -62,24 +62,6 @@ public final class TopologiesClientImpl implements TopologiesClient { @Host("{endpoint}") @ServiceInterface(name = "SecurityCenterTopologies") public interface TopologiesService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/topologies/{topologyResourceName}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("ascLocation") String ascLocation, - @PathParam("topologyResourceName") String topologyResourceName, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/topologies") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByHomeRegion(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/topologies") @ExpectedResponses({ 200 }) @@ -88,14 +70,6 @@ Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByHomeRegionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -104,283 +78,6 @@ Mono> listNext(@PathParam(value = "nextLink", encoded = t @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } - /** - * Gets a specific topology component. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param topologyResourceName Name of a topology resources collection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific topology component along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String ascLocation, - String topologyResourceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (topologyResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter topologyResourceName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, ascLocation, topologyResourceName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a specific topology component. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param topologyResourceName Name of a topology resources collection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific topology component along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String ascLocation, - String topologyResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (topologyResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter topologyResourceName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - ascLocation, topologyResourceName, accept, context); - } - - /** - * Gets a specific topology component. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param topologyResourceName Name of a topology resources collection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific topology component on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String ascLocation, - String topologyResourceName) { - return getWithResponseAsync(resourceGroupName, ascLocation, topologyResourceName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets a specific topology component. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param topologyResourceName Name of a topology resources collection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific topology component along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String ascLocation, - String topologyResourceName, Context context) { - return getWithResponseAsync(resourceGroupName, ascLocation, topologyResourceName, context).block(); - } - - /** - * Gets a specific topology component. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param topologyResourceName Name of a topology resources collection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific topology component. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public TopologyResourceInner get(String resourceGroupName, String ascLocation, String topologyResourceName) { - return getWithResponse(resourceGroupName, ascLocation, topologyResourceName, Context.NONE).getValue(); - } - - /** - * Gets a list that allows to build a topology view of a subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list that allows to build a topology view of a subscription and location along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionSinglePageAsync(String ascLocation) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByHomeRegion(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), ascLocation, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list that allows to build a topology view of a subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list that allows to build a topology view of a subscription and location along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionSinglePageAsync(String ascLocation, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByHomeRegion(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), ascLocation, - accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Gets a list that allows to build a topology view of a subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list that allows to build a topology view of a subscription and location as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByHomeRegionAsync(String ascLocation) { - return new PagedFlux<>(() -> listByHomeRegionSinglePageAsync(ascLocation), - nextLink -> listByHomeRegionNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list that allows to build a topology view of a subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list that allows to build a topology view of a subscription and location as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByHomeRegionAsync(String ascLocation, Context context) { - return new PagedFlux<>(() -> listByHomeRegionSinglePageAsync(ascLocation, context), - nextLink -> listByHomeRegionNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets a list that allows to build a topology view of a subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list that allows to build a topology view of a subscription and location as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByHomeRegion(String ascLocation) { - return new PagedIterable<>(listByHomeRegionAsync(ascLocation)); - } - - /** - * Gets a list that allows to build a topology view of a subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list that allows to build a topology view of a subscription and location as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByHomeRegion(String ascLocation, Context context) { - return new PagedIterable<>(listByHomeRegionAsync(ascLocation, context)); - } - /** * Gets a list that allows to build a topology view of a subscription. * @@ -494,61 +191,6 @@ public PagedIterable list(Context context) { return new PagedIterable<>(listAsync(context)); } - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list that allows to build a topology view of a subscription and location along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByHomeRegionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list that allows to build a topology view of a subscription and location along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByHomeRegionNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - /** * Get the next page of items. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TopologiesImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TopologiesImpl.java index 2f1714b9b58f..cf1932bb5a34 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TopologiesImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TopologiesImpl.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.security.implementation; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.security.fluent.TopologiesClient; @@ -27,33 +25,6 @@ public TopologiesImpl(TopologiesClient innerClient, this.serviceManager = serviceManager; } - public Response getWithResponse(String resourceGroupName, String ascLocation, - String topologyResourceName, Context context) { - Response inner - = this.serviceClient().getWithResponse(resourceGroupName, ascLocation, topologyResourceName, context); - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new TopologyResourceImpl(inner.getValue(), this.manager())); - } - - public TopologyResource get(String resourceGroupName, String ascLocation, String topologyResourceName) { - TopologyResourceInner inner = this.serviceClient().get(resourceGroupName, ascLocation, topologyResourceName); - if (inner != null) { - return new TopologyResourceImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable listByHomeRegion(String ascLocation) { - PagedIterable inner = this.serviceClient().listByHomeRegion(ascLocation); - return ResourceManagerUtils.mapPage(inner, inner1 -> new TopologyResourceImpl(inner1, this.manager())); - } - - public PagedIterable listByHomeRegion(String ascLocation, Context context) { - PagedIterable inner = this.serviceClient().listByHomeRegion(ascLocation, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new TopologyResourceImpl(inner1, this.manager())); - } - public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); return ResourceManagerUtils.mapPage(inner, inner1 -> new TopologyResourceImpl(inner1, this.manager())); diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TopologyResourcesClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TopologyResourcesClientImpl.java new file mode 100644 index 000000000000..976b8a81ca64 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TopologyResourcesClientImpl.java @@ -0,0 +1,423 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.security.fluent.TopologyResourcesClient; +import com.azure.resourcemanager.security.fluent.models.TopologyResourceInner; +import com.azure.resourcemanager.security.implementation.models.TopologyList; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in TopologyResourcesClient. + */ +public final class TopologyResourcesClientImpl implements TopologyResourcesClient { + /** + * The proxy service used to perform REST calls. + */ + private final TopologyResourcesService service; + + /** + * The service client containing this operation class. + */ + private final SecurityCenterImpl client; + + /** + * Initializes an instance of TopologyResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + TopologyResourcesClientImpl(SecurityCenterImpl client) { + this.service + = RestProxy.create(TopologyResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityCenterTopologyResources to be used by the proxy service to + * perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "SecurityCenterTopologyResources") + public interface TopologyResourcesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/topologies/{topologyResourceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("ascLocation") String ascLocation, + @PathParam("topologyResourceName") String topologyResourceName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/topologies") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByHomeRegion(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("ascLocation") String ascLocation, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByHomeRegionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets a specific topology component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get + * locations. + * @param topologyResourceName Name of a topology resources collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a specific topology component along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String ascLocation, + String topologyResourceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (ascLocation == null) { + return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); + } + if (topologyResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter topologyResourceName is required and cannot be null.")); + } + final String apiVersion = "2020-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), + resourceGroupName, ascLocation, topologyResourceName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a specific topology component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get + * locations. + * @param topologyResourceName Name of a topology resources collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a specific topology component along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String ascLocation, + String topologyResourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (ascLocation == null) { + return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); + } + if (topologyResourceName == null) { + return Mono + .error(new IllegalArgumentException("Parameter topologyResourceName is required and cannot be null.")); + } + final String apiVersion = "2020-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, + ascLocation, topologyResourceName, accept, context); + } + + /** + * Gets a specific topology component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get + * locations. + * @param topologyResourceName Name of a topology resources collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a specific topology component on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String ascLocation, + String topologyResourceName) { + return getWithResponseAsync(resourceGroupName, ascLocation, topologyResourceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a specific topology component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get + * locations. + * @param topologyResourceName Name of a topology resources collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a specific topology component along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String ascLocation, + String topologyResourceName, Context context) { + return getWithResponseAsync(resourceGroupName, ascLocation, topologyResourceName, context).block(); + } + + /** + * Gets a specific topology component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get + * locations. + * @param topologyResourceName Name of a topology resources collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a specific topology component. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TopologyResourceInner get(String resourceGroupName, String ascLocation, String topologyResourceName) { + return getWithResponse(resourceGroupName, ascLocation, topologyResourceName, Context.NONE).getValue(); + } + + /** + * Gets a list that allows to build a topology view of a subscription and location. + * + * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get + * locations. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list that allows to build a topology view of a subscription and location along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByHomeRegionSinglePageAsync(String ascLocation) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (ascLocation == null) { + return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); + } + final String apiVersion = "2020-01-01"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByHomeRegion(this.client.getEndpoint(), apiVersion, + this.client.getSubscriptionId(), ascLocation, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list that allows to build a topology view of a subscription and location. + * + * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get + * locations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list that allows to build a topology view of a subscription and location along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByHomeRegionSinglePageAsync(String ascLocation, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (ascLocation == null) { + return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); + } + final String apiVersion = "2020-01-01"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByHomeRegion(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), ascLocation, + accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Gets a list that allows to build a topology view of a subscription and location. + * + * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get + * locations. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list that allows to build a topology view of a subscription and location as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByHomeRegionAsync(String ascLocation) { + return new PagedFlux<>(() -> listByHomeRegionSinglePageAsync(ascLocation), + nextLink -> listByHomeRegionNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list that allows to build a topology view of a subscription and location. + * + * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get + * locations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list that allows to build a topology view of a subscription and location as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByHomeRegionAsync(String ascLocation, Context context) { + return new PagedFlux<>(() -> listByHomeRegionSinglePageAsync(ascLocation, context), + nextLink -> listByHomeRegionNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets a list that allows to build a topology view of a subscription and location. + * + * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get + * locations. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list that allows to build a topology view of a subscription and location as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByHomeRegion(String ascLocation) { + return new PagedIterable<>(listByHomeRegionAsync(ascLocation)); + } + + /** + * Gets a list that allows to build a topology view of a subscription and location. + * + * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get + * locations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list that allows to build a topology view of a subscription and location as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByHomeRegion(String ascLocation, Context context) { + return new PagedIterable<>(listByHomeRegionAsync(ascLocation, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list that allows to build a topology view of a subscription and location along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByHomeRegionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByHomeRegionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list that allows to build a topology view of a subscription and location along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByHomeRegionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByHomeRegionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TopologyResourcesImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TopologyResourcesImpl.java new file mode 100644 index 000000000000..72d5a25174f7 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TopologyResourcesImpl.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.security.fluent.TopologyResourcesClient; +import com.azure.resourcemanager.security.fluent.models.TopologyResourceInner; +import com.azure.resourcemanager.security.models.TopologyResource; +import com.azure.resourcemanager.security.models.TopologyResources; + +public final class TopologyResourcesImpl implements TopologyResources { + private static final ClientLogger LOGGER = new ClientLogger(TopologyResourcesImpl.class); + + private final TopologyResourcesClient innerClient; + + private final com.azure.resourcemanager.security.SecurityManager serviceManager; + + public TopologyResourcesImpl(TopologyResourcesClient innerClient, + com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String ascLocation, + String topologyResourceName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, ascLocation, topologyResourceName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new TopologyResourceImpl(inner.getValue(), this.manager())); + } + + public TopologyResource get(String resourceGroupName, String ascLocation, String topologyResourceName) { + TopologyResourceInner inner = this.serviceClient().get(resourceGroupName, ascLocation, topologyResourceName); + if (inner != null) { + return new TopologyResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listByHomeRegion(String ascLocation) { + PagedIterable inner = this.serviceClient().listByHomeRegion(ascLocation); + return ResourceManagerUtils.mapPage(inner, inner1 -> new TopologyResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByHomeRegion(String ascLocation, Context context) { + PagedIterable inner = this.serviceClient().listByHomeRegion(ascLocation, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new TopologyResourceImpl(inner1, this.manager())); + } + + private TopologyResourcesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.security.SecurityManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertSyncSettings.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertSyncSettings.java index 833907821069..4a889ceac449 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertSyncSettings.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertSyncSettings.java @@ -113,15 +113,6 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public AlertSyncSettings withProperties(SettingProperties properties) { - super.withProperties(properties); - return this; - } - /** * Get the enabled property: Is the alert sync setting enabled. * @@ -155,9 +146,6 @@ public void validate() { if (innerProperties() != null) { innerProperties().validate(); } - if (properties() != null) { - properties().validate(); - } } /** diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Alerts.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Alerts.java index 92cc9f92d941..05648aecbb91 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Alerts.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Alerts.java @@ -206,29 +206,29 @@ Response getResourceGroupLevelWithResponse(String resourceGroupName, Stri /** * List all the alerts that are associated with the resource group that are stored in a specific location. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get * locations. - * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of security alerts as paginated response with {@link PagedIterable}. */ - PagedIterable listResourceGroupLevelByRegion(String ascLocation, String resourceGroupName); + PagedIterable listResourceGroupLevelByRegion(String resourceGroupName, String ascLocation); /** * List all the alerts that are associated with the resource group that are stored in a specific location. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get * locations. - * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return list of security alerts as paginated response with {@link PagedIterable}. */ - PagedIterable listResourceGroupLevelByRegion(String ascLocation, String resourceGroupName, Context context); + PagedIterable listResourceGroupLevelByRegion(String resourceGroupName, String ascLocation, Context context); /** * Update the alert's state. diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureServersSetting.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureServersSetting.java index 3d5dcd031bb0..1b0d720ec310 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureServersSetting.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureServersSetting.java @@ -115,15 +115,6 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public AzureServersSetting withProperties(ServerVulnerabilityAssessmentsSettingProperties properties) { - super.withProperties(properties); - return this; - } - /** * Get the selectedProvider property: The selected vulnerability assessments provider on Azure servers in the * defined scope. @@ -160,9 +151,6 @@ public void validate() { if (innerProperties() != null) { innerProperties().validate(); } - if (properties() != null) { - properties().validate(); - } } /** diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DataExportSettings.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DataExportSettings.java index adab15b29852..468b9a519fbc 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DataExportSettings.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DataExportSettings.java @@ -113,15 +113,6 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public DataExportSettings withProperties(SettingProperties properties) { - super.withProperties(properties); - return this; - } - /** * Get the enabled property: Is the data export setting enabled. * @@ -155,9 +146,6 @@ public void validate() { if (innerProperties() != null) { innerProperties().validate(); } - if (properties() != null) { - properties().validate(); - } } /** diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ResourceIdentityType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ResourceIdentityType.java index 766d2ac91d9c..52a7ebd9e938 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ResourceIdentityType.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ResourceIdentityType.java @@ -5,7 +5,7 @@ package com.azure.resourcemanager.security.models; /** - * Defines values for ResourceIdentityType. + * Resource Identity Type. */ public enum ResourceIdentityType { /** diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessmentsSetting.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessmentsSetting.java index f06b011695f8..893e32ceed72 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessmentsSetting.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessmentsSetting.java @@ -39,13 +39,6 @@ public interface ServerVulnerabilityAssessmentsSetting { */ ServerVulnerabilityAssessmentsSettingKind kind(); - /** - * Gets the properties property: The resource-specific properties for this resource. - * - * @return the properties value. - */ - ServerVulnerabilityAssessmentsSettingProperties properties(); - /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessmentsSettingProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessmentsSettingProperties.java deleted file mode 100644 index 3e472eda9cfe..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessmentsSettingProperties.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The ServerVulnerabilityAssessmentsSettingProperties model. - */ -@Immutable -public final class ServerVulnerabilityAssessmentsSettingProperties - implements JsonSerializable { - /** - * Creates an instance of ServerVulnerabilityAssessmentsSettingProperties class. - */ - public ServerVulnerabilityAssessmentsSettingProperties() { - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ServerVulnerabilityAssessmentsSettingProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ServerVulnerabilityAssessmentsSettingProperties if the JsonReader was pointing to an - * instance of it, or null if it was pointing to JSON null. - * @throws IOException If an error occurs while reading the ServerVulnerabilityAssessmentsSettingProperties. - */ - public static ServerVulnerabilityAssessmentsSettingProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ServerVulnerabilityAssessmentsSettingProperties deserializedServerVulnerabilityAssessmentsSettingProperties - = new ServerVulnerabilityAssessmentsSettingProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - reader.skipChildren(); - } - - return deserializedServerVulnerabilityAssessmentsSettingProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Setting.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Setting.java index 895f17c5562f..1ba6d9531d85 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Setting.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Setting.java @@ -39,13 +39,6 @@ public interface Setting { */ SettingKind kind(); - /** - * Gets the properties property: The resource-specific properties for this resource. - * - * @return the properties value. - */ - SettingProperties properties(); - /** * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SettingProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SettingProperties.java deleted file mode 100644 index ee3bdbe6f61d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SettingProperties.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The SettingProperties model. - */ -@Immutable -public final class SettingProperties implements JsonSerializable { - /** - * Creates an instance of SettingProperties class. - */ - public SettingProperties() { - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SettingProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SettingProperties if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the SettingProperties. - */ - public static SettingProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SettingProperties deserializedSettingProperties = new SettingProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - reader.skipChildren(); - } - - return deserializedSettingProperties; - }); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Topologies.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Topologies.java index 21bb5cd3715a..aa7a7c8e0920 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Topologies.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Topologies.java @@ -5,70 +5,12 @@ package com.azure.resourcemanager.security.models; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; import com.azure.core.util.Context; /** * Resource collection API of Topologies. */ public interface Topologies { - /** - * Gets a specific topology component. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param topologyResourceName Name of a topology resources collection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific topology component along with {@link Response}. - */ - Response getWithResponse(String resourceGroupName, String ascLocation, - String topologyResourceName, Context context); - - /** - * Gets a specific topology component. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param topologyResourceName Name of a topology resources collection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific topology component. - */ - TopologyResource get(String resourceGroupName, String ascLocation, String topologyResourceName); - - /** - * Gets a list that allows to build a topology view of a subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list that allows to build a topology view of a subscription and location as paginated response with - * {@link PagedIterable}. - */ - PagedIterable listByHomeRegion(String ascLocation); - - /** - * Gets a list that allows to build a topology view of a subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list that allows to build a topology view of a subscription and location as paginated response with - * {@link PagedIterable}. - */ - PagedIterable listByHomeRegion(String ascLocation, Context context); - /** * Gets a list that allows to build a topology view of a subscription. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TopologyResources.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TopologyResources.java new file mode 100644 index 000000000000..30d43510c95b --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TopologyResources.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of TopologyResources. + */ +public interface TopologyResources { + /** + * Gets a specific topology component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get + * locations. + * @param topologyResourceName Name of a topology resources collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a specific topology component along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String ascLocation, + String topologyResourceName, Context context); + + /** + * Gets a specific topology component. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get + * locations. + * @param topologyResourceName Name of a topology resources collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a specific topology component. + */ + TopologyResource get(String resourceGroupName, String ascLocation, String topologyResourceName); + + /** + * Gets a list that allows to build a topology view of a subscription and location. + * + * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get + * locations. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list that allows to build a topology view of a subscription and location as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByHomeRegion(String ascLocation); + + /** + * Gets a list that allows to build a topology view of a subscription and location. + * + * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get + * locations. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list that allows to build a topology view of a subscription and location as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByHomeRegion(String ascLocation, Context context); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-security/proxy-config.json b/sdk/security/azure-resourcemanager-security/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-security/proxy-config.json index 9cf513028e3d..9fccf94f53ad 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-security/proxy-config.json +++ b/sdk/security/azure-resourcemanager-security/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-security/proxy-config.json @@ -1 +1 @@ -[["com.azure.resourcemanager.security.implementation.AdvancedThreatProtectionsClientImpl$AdvancedThreatProtectionsService"],["com.azure.resourcemanager.security.implementation.AlertsClientImpl$AlertsService"],["com.azure.resourcemanager.security.implementation.AlertsSuppressionRulesClientImpl$AlertsSuppressionRulesService"],["com.azure.resourcemanager.security.implementation.AllowedConnectionsClientImpl$AllowedConnectionsService"],["com.azure.resourcemanager.security.implementation.ApiCollectionsClientImpl$ApiCollectionsService"],["com.azure.resourcemanager.security.implementation.ApplicationsClientImpl$ApplicationsService"],["com.azure.resourcemanager.security.implementation.AssessmentsClientImpl$AssessmentsService"],["com.azure.resourcemanager.security.implementation.AssessmentsMetadatasClientImpl$AssessmentsMetadatasService"],["com.azure.resourcemanager.security.implementation.AssignmentsClientImpl$AssignmentsService"],["com.azure.resourcemanager.security.implementation.AutoProvisioningSettingsClientImpl$AutoProvisioningSettingsService"],["com.azure.resourcemanager.security.implementation.AutomationsClientImpl$AutomationsService"],["com.azure.resourcemanager.security.implementation.AzureDevOpsOrgsClientImpl$AzureDevOpsOrgsService"],["com.azure.resourcemanager.security.implementation.AzureDevOpsProjectsClientImpl$AzureDevOpsProjectsService"],["com.azure.resourcemanager.security.implementation.AzureDevOpsReposClientImpl$AzureDevOpsReposService"],["com.azure.resourcemanager.security.implementation.ComplianceResultsClientImpl$ComplianceResultsService"],["com.azure.resourcemanager.security.implementation.CompliancesClientImpl$CompliancesService"],["com.azure.resourcemanager.security.implementation.CustomRecommendationsClientImpl$CustomRecommendationsService"],["com.azure.resourcemanager.security.implementation.DefenderForStoragesClientImpl$DefenderForStoragesService"],["com.azure.resourcemanager.security.implementation.DevOpsConfigurationsClientImpl$DevOpsConfigurationsService"],["com.azure.resourcemanager.security.implementation.DevOpsOperationResultsClientImpl$DevOpsOperationResultsService"],["com.azure.resourcemanager.security.implementation.DeviceSecurityGroupsClientImpl$DeviceSecurityGroupsService"],["com.azure.resourcemanager.security.implementation.DiscoveredSecuritySolutionsClientImpl$DiscoveredSecuritySolutionsService"],["com.azure.resourcemanager.security.implementation.ExternalSecuritySolutionsClientImpl$ExternalSecuritySolutionsService"],["com.azure.resourcemanager.security.implementation.GitHubIssuesClientImpl$GitHubIssuesService"],["com.azure.resourcemanager.security.implementation.GitHubOwnersClientImpl$GitHubOwnersService"],["com.azure.resourcemanager.security.implementation.GitHubReposClientImpl$GitHubReposService"],["com.azure.resourcemanager.security.implementation.GitLabGroupsClientImpl$GitLabGroupsService"],["com.azure.resourcemanager.security.implementation.GitLabProjectsClientImpl$GitLabProjectsService"],["com.azure.resourcemanager.security.implementation.GitLabSubgroupsClientImpl$GitLabSubgroupsService"],["com.azure.resourcemanager.security.implementation.GovernanceAssignmentsClientImpl$GovernanceAssignmentsService"],["com.azure.resourcemanager.security.implementation.GovernanceRulesClientImpl$GovernanceRulesService"],["com.azure.resourcemanager.security.implementation.HealthReportsClientImpl$HealthReportsService"],["com.azure.resourcemanager.security.implementation.InformationProtectionPoliciesClientImpl$InformationProtectionPoliciesService"],["com.azure.resourcemanager.security.implementation.IotSecuritySolutionAnalyticsClientImpl$IotSecuritySolutionAnalyticsService"],["com.azure.resourcemanager.security.implementation.IotSecuritySolutionsAnalyticsAggregatedAlertsClientImpl$IotSecuritySolutionsAnalyticsAggregatedAlertsService"],["com.azure.resourcemanager.security.implementation.IotSecuritySolutionsAnalyticsRecommendationsClientImpl$IotSecuritySolutionsAnalyticsRecommendationsService"],["com.azure.resourcemanager.security.implementation.IotSecuritySolutionsClientImpl$IotSecuritySolutionsService"],["com.azure.resourcemanager.security.implementation.JitNetworkAccessPoliciesClientImpl$JitNetworkAccessPoliciesService"],["com.azure.resourcemanager.security.implementation.LocationsClientImpl$LocationsService"],["com.azure.resourcemanager.security.implementation.MdeOnboardingsClientImpl$MdeOnboardingsService"],["com.azure.resourcemanager.security.implementation.OperationResultsClientImpl$OperationResultsService"],["com.azure.resourcemanager.security.implementation.OperationStatusesClientImpl$OperationStatusesService"],["com.azure.resourcemanager.security.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.security.implementation.PricingsClientImpl$PricingsService"],["com.azure.resourcemanager.security.implementation.PrivateEndpointConnectionsClientImpl$PrivateEndpointConnectionsService"],["com.azure.resourcemanager.security.implementation.PrivateLinkResourcesClientImpl$PrivateLinkResourcesService"],["com.azure.resourcemanager.security.implementation.PrivateLinksClientImpl$PrivateLinksService"],["com.azure.resourcemanager.security.implementation.RegulatoryComplianceAssessmentsClientImpl$RegulatoryComplianceAssessmentsService"],["com.azure.resourcemanager.security.implementation.RegulatoryComplianceControlsClientImpl$RegulatoryComplianceControlsService"],["com.azure.resourcemanager.security.implementation.RegulatoryComplianceStandardsClientImpl$RegulatoryComplianceStandardsService"],["com.azure.resourcemanager.security.implementation.SecureScoreControlDefinitionsClientImpl$SecureScoreControlDefinitionsService"],["com.azure.resourcemanager.security.implementation.SecureScoreControlsClientImpl$SecureScoreControlsService"],["com.azure.resourcemanager.security.implementation.SecureScoresClientImpl$SecureScoresService"],["com.azure.resourcemanager.security.implementation.SecurityConnectorApplicationsClientImpl$SecurityConnectorApplicationsService"],["com.azure.resourcemanager.security.implementation.SecurityConnectorsClientImpl$SecurityConnectorsService"],["com.azure.resourcemanager.security.implementation.SecurityContactsClientImpl$SecurityContactsService"],["com.azure.resourcemanager.security.implementation.SecurityOperatorsClientImpl$SecurityOperatorsService"],["com.azure.resourcemanager.security.implementation.SecuritySolutionsClientImpl$SecuritySolutionsService"],["com.azure.resourcemanager.security.implementation.SecuritySolutionsReferenceDatasClientImpl$SecuritySolutionsReferenceDatasService"],["com.azure.resourcemanager.security.implementation.SecurityStandardsClientImpl$SecurityStandardsService"],["com.azure.resourcemanager.security.implementation.SensitivitySettingsClientImpl$SensitivitySettingsService"],["com.azure.resourcemanager.security.implementation.ServerVulnerabilityAssessmentsClientImpl$ServerVulnerabilityAssessmentsService"],["com.azure.resourcemanager.security.implementation.ServerVulnerabilityAssessmentsSettingsClientImpl$ServerVulnerabilityAssessmentsSettingsService"],["com.azure.resourcemanager.security.implementation.SettingsClientImpl$SettingsService"],["com.azure.resourcemanager.security.implementation.SqlVulnerabilityAssessmentBaselineRulesClientImpl$SqlVulnerabilityAssessmentBaselineRulesService"],["com.azure.resourcemanager.security.implementation.SqlVulnerabilityAssessmentScanResultsClientImpl$SqlVulnerabilityAssessmentScanResultsService"],["com.azure.resourcemanager.security.implementation.SqlVulnerabilityAssessmentScansClientImpl$SqlVulnerabilityAssessmentScansService"],["com.azure.resourcemanager.security.implementation.SqlVulnerabilityAssessmentSettingsOperationsClientImpl$SqlVulnerabilityAssessmentSettingsOperationsService"],["com.azure.resourcemanager.security.implementation.StandardAssignmentsClientImpl$StandardAssignmentsService"],["com.azure.resourcemanager.security.implementation.StandardsClientImpl$StandardsService"],["com.azure.resourcemanager.security.implementation.SubAssessmentsClientImpl$SubAssessmentsService"],["com.azure.resourcemanager.security.implementation.TasksClientImpl$TasksService"],["com.azure.resourcemanager.security.implementation.TopologiesClientImpl$TopologiesService"],["com.azure.resourcemanager.security.implementation.WorkspaceSettingsClientImpl$WorkspaceSettingsService"]] \ No newline at end of file +[["com.azure.resourcemanager.security.implementation.AdvancedThreatProtectionsClientImpl$AdvancedThreatProtectionsService"],["com.azure.resourcemanager.security.implementation.AlertsClientImpl$AlertsService"],["com.azure.resourcemanager.security.implementation.AlertsSuppressionRulesClientImpl$AlertsSuppressionRulesService"],["com.azure.resourcemanager.security.implementation.AllowedConnectionsClientImpl$AllowedConnectionsService"],["com.azure.resourcemanager.security.implementation.ApiCollectionsClientImpl$ApiCollectionsService"],["com.azure.resourcemanager.security.implementation.ApplicationsClientImpl$ApplicationsService"],["com.azure.resourcemanager.security.implementation.AssessmentsClientImpl$AssessmentsService"],["com.azure.resourcemanager.security.implementation.AssessmentsMetadatasClientImpl$AssessmentsMetadatasService"],["com.azure.resourcemanager.security.implementation.AssignmentsClientImpl$AssignmentsService"],["com.azure.resourcemanager.security.implementation.AutoProvisioningSettingsClientImpl$AutoProvisioningSettingsService"],["com.azure.resourcemanager.security.implementation.AutomationsClientImpl$AutomationsService"],["com.azure.resourcemanager.security.implementation.AzureDevOpsOrgsClientImpl$AzureDevOpsOrgsService"],["com.azure.resourcemanager.security.implementation.AzureDevOpsProjectsClientImpl$AzureDevOpsProjectsService"],["com.azure.resourcemanager.security.implementation.AzureDevOpsReposClientImpl$AzureDevOpsReposService"],["com.azure.resourcemanager.security.implementation.ComplianceResultsClientImpl$ComplianceResultsService"],["com.azure.resourcemanager.security.implementation.CompliancesClientImpl$CompliancesService"],["com.azure.resourcemanager.security.implementation.CustomRecommendationsClientImpl$CustomRecommendationsService"],["com.azure.resourcemanager.security.implementation.DefenderForStoragesClientImpl$DefenderForStoragesService"],["com.azure.resourcemanager.security.implementation.DevOpsConfigurationsClientImpl$DevOpsConfigurationsService"],["com.azure.resourcemanager.security.implementation.DevOpsOperationResultsClientImpl$DevOpsOperationResultsService"],["com.azure.resourcemanager.security.implementation.DeviceSecurityGroupsClientImpl$DeviceSecurityGroupsService"],["com.azure.resourcemanager.security.implementation.DiscoveredSecuritySolutionsClientImpl$DiscoveredSecuritySolutionsService"],["com.azure.resourcemanager.security.implementation.ExternalSecuritySolutionsClientImpl$ExternalSecuritySolutionsService"],["com.azure.resourcemanager.security.implementation.GitHubIssuesClientImpl$GitHubIssuesService"],["com.azure.resourcemanager.security.implementation.GitHubOwnersClientImpl$GitHubOwnersService"],["com.azure.resourcemanager.security.implementation.GitHubReposClientImpl$GitHubReposService"],["com.azure.resourcemanager.security.implementation.GitLabGroupsClientImpl$GitLabGroupsService"],["com.azure.resourcemanager.security.implementation.GitLabProjectsClientImpl$GitLabProjectsService"],["com.azure.resourcemanager.security.implementation.GitLabSubgroupsClientImpl$GitLabSubgroupsService"],["com.azure.resourcemanager.security.implementation.GovernanceAssignmentsClientImpl$GovernanceAssignmentsService"],["com.azure.resourcemanager.security.implementation.GovernanceRulesClientImpl$GovernanceRulesService"],["com.azure.resourcemanager.security.implementation.HealthReportsClientImpl$HealthReportsService"],["com.azure.resourcemanager.security.implementation.InformationProtectionPoliciesClientImpl$InformationProtectionPoliciesService"],["com.azure.resourcemanager.security.implementation.IotSecuritySolutionAnalyticsClientImpl$IotSecuritySolutionAnalyticsService"],["com.azure.resourcemanager.security.implementation.IotSecuritySolutionsAnalyticsAggregatedAlertsClientImpl$IotSecuritySolutionsAnalyticsAggregatedAlertsService"],["com.azure.resourcemanager.security.implementation.IotSecuritySolutionsAnalyticsRecommendationsClientImpl$IotSecuritySolutionsAnalyticsRecommendationsService"],["com.azure.resourcemanager.security.implementation.IotSecuritySolutionsClientImpl$IotSecuritySolutionsService"],["com.azure.resourcemanager.security.implementation.JitNetworkAccessPoliciesClientImpl$JitNetworkAccessPoliciesService"],["com.azure.resourcemanager.security.implementation.LocationsClientImpl$LocationsService"],["com.azure.resourcemanager.security.implementation.MdeOnboardingsClientImpl$MdeOnboardingsService"],["com.azure.resourcemanager.security.implementation.OperationResultsClientImpl$OperationResultsService"],["com.azure.resourcemanager.security.implementation.OperationStatusesClientImpl$OperationStatusesService"],["com.azure.resourcemanager.security.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.security.implementation.PricingsClientImpl$PricingsService"],["com.azure.resourcemanager.security.implementation.PrivateEndpointConnectionsClientImpl$PrivateEndpointConnectionsService"],["com.azure.resourcemanager.security.implementation.PrivateLinkResourcesClientImpl$PrivateLinkResourcesService"],["com.azure.resourcemanager.security.implementation.PrivateLinksClientImpl$PrivateLinksService"],["com.azure.resourcemanager.security.implementation.RegulatoryComplianceAssessmentsClientImpl$RegulatoryComplianceAssessmentsService"],["com.azure.resourcemanager.security.implementation.RegulatoryComplianceControlsClientImpl$RegulatoryComplianceControlsService"],["com.azure.resourcemanager.security.implementation.RegulatoryComplianceStandardsClientImpl$RegulatoryComplianceStandardsService"],["com.azure.resourcemanager.security.implementation.SecureScoreControlDefinitionsClientImpl$SecureScoreControlDefinitionsService"],["com.azure.resourcemanager.security.implementation.SecureScoreControlsClientImpl$SecureScoreControlsService"],["com.azure.resourcemanager.security.implementation.SecureScoresClientImpl$SecureScoresService"],["com.azure.resourcemanager.security.implementation.SecurityConnectorApplicationsClientImpl$SecurityConnectorApplicationsService"],["com.azure.resourcemanager.security.implementation.SecurityConnectorsClientImpl$SecurityConnectorsService"],["com.azure.resourcemanager.security.implementation.SecurityContactsClientImpl$SecurityContactsService"],["com.azure.resourcemanager.security.implementation.SecurityOperatorsClientImpl$SecurityOperatorsService"],["com.azure.resourcemanager.security.implementation.SecuritySolutionsClientImpl$SecuritySolutionsService"],["com.azure.resourcemanager.security.implementation.SecuritySolutionsReferenceDatasClientImpl$SecuritySolutionsReferenceDatasService"],["com.azure.resourcemanager.security.implementation.SecurityStandardsClientImpl$SecurityStandardsService"],["com.azure.resourcemanager.security.implementation.SensitivitySettingsClientImpl$SensitivitySettingsService"],["com.azure.resourcemanager.security.implementation.ServerVulnerabilityAssessmentsClientImpl$ServerVulnerabilityAssessmentsService"],["com.azure.resourcemanager.security.implementation.ServerVulnerabilityAssessmentsSettingsClientImpl$ServerVulnerabilityAssessmentsSettingsService"],["com.azure.resourcemanager.security.implementation.SettingsClientImpl$SettingsService"],["com.azure.resourcemanager.security.implementation.SqlVulnerabilityAssessmentBaselineRulesClientImpl$SqlVulnerabilityAssessmentBaselineRulesService"],["com.azure.resourcemanager.security.implementation.SqlVulnerabilityAssessmentScanResultsClientImpl$SqlVulnerabilityAssessmentScanResultsService"],["com.azure.resourcemanager.security.implementation.SqlVulnerabilityAssessmentScansClientImpl$SqlVulnerabilityAssessmentScansService"],["com.azure.resourcemanager.security.implementation.SqlVulnerabilityAssessmentSettingsOperationsClientImpl$SqlVulnerabilityAssessmentSettingsOperationsService"],["com.azure.resourcemanager.security.implementation.StandardAssignmentsClientImpl$StandardAssignmentsService"],["com.azure.resourcemanager.security.implementation.StandardsClientImpl$StandardsService"],["com.azure.resourcemanager.security.implementation.SubAssessmentsClientImpl$SubAssessmentsService"],["com.azure.resourcemanager.security.implementation.TasksClientImpl$TasksService"],["com.azure.resourcemanager.security.implementation.TopologiesClientImpl$TopologiesService"],["com.azure.resourcemanager.security.implementation.TopologyResourcesClientImpl$TopologyResourcesService"],["com.azure.resourcemanager.security.implementation.WorkspaceSettingsClientImpl$WorkspaceSettingsService"]] \ No newline at end of file diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdvancedThreatProtectionCreateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdvancedThreatProtectionCreateSamples.java new file mode 100644 index 000000000000..bb1df1387fae --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdvancedThreatProtectionCreateSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for AdvancedThreatProtection Create. + */ +public final class AdvancedThreatProtectionCreateSamples { + /* + * x-ms-original-file: 2019-01-01/AdvancedThreatProtection/PutAdvancedThreatProtectionSettings_example.json + */ + /** + * Sample code: Creates or updates the Advanced Threat Protection settings on a specified resource. + * + * @param manager Entry point to SecurityManager. + */ + public static void createsOrUpdatesTheAdvancedThreatProtectionSettingsOnASpecifiedResource( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.advancedThreatProtections() + .define() + .withExistingResourceId( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount") + .withIsEnabled(true) + .create(); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdvancedThreatProtectionGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdvancedThreatProtectionGetSamples.java new file mode 100644 index 000000000000..2b4fe5ecc348 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdvancedThreatProtectionGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for AdvancedThreatProtection Get. + */ +public final class AdvancedThreatProtectionGetSamples { + /* + * x-ms-original-file: 2019-01-01/AdvancedThreatProtection/GetAdvancedThreatProtectionSettings_example.json + */ + /** + * Sample code: Gets the Advanced Threat Protection settings for the specified resource. + * + * @param manager Entry point to SecurityManager. + */ + public static void getsTheAdvancedThreatProtectionSettingsForTheSpecifiedResource( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.advancedThreatProtections() + .getWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsGetResourceGroupLevelSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsGetResourceGroupLevelSamples.java new file mode 100644 index 000000000000..9948735873b2 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsGetResourceGroupLevelSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for Alerts GetResourceGroupLevel. + */ +public final class AlertsGetResourceGroupLevelSamples { + /* + * x-ms-original-file: 2022-01-01/Alerts/GetAlertResourceGroupLocation_example.json + */ + /** + * Sample code: Get security alert on a resource group from a security data location. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityAlertOnAResourceGroupFromASecurityDataLocation( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.alerts() + .getResourceGroupLevelWithResponse("myRg1", "westeurope", + "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsGetSubscriptionLevelSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsGetSubscriptionLevelSamples.java new file mode 100644 index 000000000000..1c1aa25077fb --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsGetSubscriptionLevelSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for Alerts GetSubscriptionLevel. + */ +public final class AlertsGetSubscriptionLevelSamples { + /* + * x-ms-original-file: 2022-01-01/Alerts/GetAlertSubscriptionLocation_example.json + */ + /** + * Sample code: Get security alert on a subscription from a security data location. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityAlertOnASubscriptionFromASecurityDataLocation( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.alerts() + .getSubscriptionLevelWithResponse("westeurope", "2518770965529163669_F144EE95-A3E5-42DA-A279-967D115809AA", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsListByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsListByResourceGroupSamples.java new file mode 100644 index 000000000000..e96744490dc5 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsListByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for Alerts ListByResourceGroup. + */ +public final class AlertsListByResourceGroupSamples { + /* + * x-ms-original-file: 2022-01-01/Alerts/GetAlertsResourceGroup_example.json + */ + /** + * Sample code: Get security alerts on a resource group. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityAlertsOnAResourceGroup(com.azure.resourcemanager.security.SecurityManager manager) { + manager.alerts().listByResourceGroup("myRg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsListResourceGroupLevelByRegionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsListResourceGroupLevelByRegionSamples.java new file mode 100644 index 000000000000..24443494d3e0 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsListResourceGroupLevelByRegionSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for Alerts ListResourceGroupLevelByRegion. + */ +public final class AlertsListResourceGroupLevelByRegionSamples { + /* + * x-ms-original-file: 2022-01-01/Alerts/GetAlertsResourceGroupLocation_example.json + */ + /** + * Sample code: Get security alerts on a resource group from a security data location. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityAlertsOnAResourceGroupFromASecurityDataLocation( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.alerts().listResourceGroupLevelByRegion("myRg1", "westeurope", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsListSamples.java new file mode 100644 index 000000000000..05271124c814 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for Alerts List. + */ +public final class AlertsListSamples { + /* + * x-ms-original-file: 2022-01-01/Alerts/GetAlertsSubscription_example.json + */ + /** + * Sample code: Get security alerts on a subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityAlertsOnASubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.alerts().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsListSubscriptionLevelByRegionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsListSubscriptionLevelByRegionSamples.java new file mode 100644 index 000000000000..91282efa5aef --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsListSubscriptionLevelByRegionSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for Alerts ListSubscriptionLevelByRegion. + */ +public final class AlertsListSubscriptionLevelByRegionSamples { + /* + * x-ms-original-file: 2022-01-01/Alerts/GetAlertsSubscriptionsLocation_example.json + */ + /** + * Sample code: Get security alerts on a subscription from a security data location. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityAlertsOnASubscriptionFromASecurityDataLocation( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.alerts().listSubscriptionLevelByRegion("westeurope", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSimulateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSimulateSamples.java new file mode 100644 index 000000000000..6c970787d241 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSimulateSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.AlertSimulatorBundlesRequestProperties; +import com.azure.resourcemanager.security.models.AlertSimulatorRequestBody; +import com.azure.resourcemanager.security.models.BundleType; +import java.util.Arrays; + +/** + * Samples for Alerts Simulate. + */ +public final class AlertsSimulateSamples { + /* + * x-ms-original-file: 2022-01-01/Alerts/SimulateAlerts_example.json + */ + /** + * Sample code: Simulate security alerts on a subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void + simulateSecurityAlertsOnASubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.alerts() + .simulate("centralus", + new AlertSimulatorRequestBody().withProperties(new AlertSimulatorBundlesRequestProperties() + .withBundles(Arrays.asList(BundleType.APP_SERVICES, BundleType.DNS, BundleType.KEY_VAULTS, + BundleType.KUBERNETES_SERVICE, BundleType.RESOURCE_MANAGER, BundleType.SQL_SERVERS, + BundleType.STORAGE_ACCOUNTS, BundleType.VIRTUAL_MACHINES, BundleType.COSMOS_DBS))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesDeleteSamples.java new file mode 100644 index 000000000000..ecb22aad24da --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for AlertsSuppressionRules Delete. + */ +public final class AlertsSuppressionRulesDeleteSamples { + /* + * x-ms-original-file: 2019-01-01-preview/AlertsSuppressionRules/DeleteAlertsSuppressionRule_example.json + */ + /** + * Sample code: Delete suppression rule data for a subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void + deleteSuppressionRuleDataForASubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.alertsSuppressionRules().deleteWithResponse("dismissIpAnomalyAlerts", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesGetSamples.java new file mode 100644 index 000000000000..ec9e0d410da1 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for AlertsSuppressionRules Get. + */ +public final class AlertsSuppressionRulesGetSamples { + /* + * x-ms-original-file: 2019-01-01-preview/AlertsSuppressionRules/GetAlertsSuppressionRule_example.json + */ + /** + * Sample code: Get suppression alert rule for subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void + getSuppressionAlertRuleForSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.alertsSuppressionRules().getWithResponse("dismissIpAnomalyAlerts", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesListSamples.java new file mode 100644 index 000000000000..43d1992de896 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesListSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for AlertsSuppressionRules List. + */ +public final class AlertsSuppressionRulesListSamples { + /* + * x-ms-original-file: 2019-01-01-preview/AlertsSuppressionRules/GetAlertsSuppressionRules_example.json + */ + /** + * Sample code: Get suppression rules for subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSuppressionRulesForSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.alertsSuppressionRules().list(null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2019-01-01-preview/AlertsSuppressionRules/GetAlertsSuppressionRulesWithAlertType_example.json + */ + /** + * Sample code: Get suppression alert rule for subscription, filtered by AlertType. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSuppressionAlertRuleForSubscriptionFilteredByAlertType( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.alertsSuppressionRules().list("IpAnomaly", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesUpdateSamples.java new file mode 100644 index 000000000000..240b97feab2b --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesUpdateSamples.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.security.fluent.models.AlertsSuppressionRuleInner; +import com.azure.resourcemanager.security.models.RuleState; +import com.azure.resourcemanager.security.models.ScopeElement; +import com.azure.resourcemanager.security.models.SuppressionAlertsScope; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for AlertsSuppressionRules Update. + */ +public final class AlertsSuppressionRulesUpdateSamples { + /* + * x-ms-original-file: 2019-01-01-preview/AlertsSuppressionRules/PutAlertsSuppressionRule_example.json + */ + /** + * Sample code: Update or create suppression rule for subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void updateOrCreateSuppressionRuleForSubscription( + com.azure.resourcemanager.security.SecurityManager manager) throws IOException { + manager.alertsSuppressionRules() + .updateWithResponse("dismissIpAnomalyAlerts", new AlertsSuppressionRuleInner().withAlertType("IpAnomaly") + .withExpirationDateUtc(OffsetDateTime.parse("2019-12-01T19:50:47.083633Z")) + .withReason("FalsePositive") + .withState(RuleState.ENABLED) + .withComment("Test VM") + .withSuppressionAlertsScope(new SuppressionAlertsScope().withAllOf(Arrays.asList(new ScopeElement() + .withField("entities.ip.address") + .withAdditionalProperties(mapOf("in", SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("[\"104.215.95.187\",\"52.164.206.56\"]", Object.class, SerializerEncoding.JSON))), + new ScopeElement().withField("entities.process.commandline") + .withAdditionalProperties(mapOf("contains", "POWERSHELL.EXE"))))), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToActivateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToActivateSamples.java new file mode 100644 index 000000000000..ddfcba05c2f3 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToActivateSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for Alerts UpdateResourceGroupLevelStateToActivate. + */ +public final class AlertsUpdateResourceGroupLevelStateToActivateSamples { + /* + * x-ms-original-file: 2022-01-01/Alerts/UpdateAlertResourceGroupLocation_activate_example.json + */ + /** + * Sample code: Update security alert state on a resource group from a security data location. + * + * @param manager Entry point to SecurityManager. + */ + public static void updateSecurityAlertStateOnAResourceGroupFromASecurityDataLocation( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.alerts() + .updateResourceGroupLevelStateToActivateWithResponse("myRg2", "westeurope", + "2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToDismissSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToDismissSamples.java new file mode 100644 index 000000000000..feb2c2993e15 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToDismissSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for Alerts UpdateResourceGroupLevelStateToDismiss. + */ +public final class AlertsUpdateResourceGroupLevelStateToDismissSamples { + /* + * x-ms-original-file: 2022-01-01/Alerts/UpdateAlertResourceGroupLocation_dismiss_example.json + */ + /** + * Sample code: Update security alert state on a resource group from a security data location. + * + * @param manager Entry point to SecurityManager. + */ + public static void updateSecurityAlertStateOnAResourceGroupFromASecurityDataLocation( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.alerts() + .updateResourceGroupLevelStateToDismissWithResponse("myRg2", "westeurope", + "2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToInProgressSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToInProgressSamples.java new file mode 100644 index 000000000000..b781e123e186 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToInProgressSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for Alerts UpdateResourceGroupLevelStateToInProgress. + */ +public final class AlertsUpdateResourceGroupLevelStateToInProgressSamples { + /* + * x-ms-original-file: 2022-01-01/Alerts/UpdateAlertResourceGroupLocation_inProgress_example.json + */ + /** + * Sample code: Update security alert state on a resource group from a security data location. + * + * @param manager Entry point to SecurityManager. + */ + public static void updateSecurityAlertStateOnAResourceGroupFromASecurityDataLocation( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.alerts() + .updateResourceGroupLevelStateToInProgressWithResponse("myRg2", "westeurope", + "2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToResolveSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToResolveSamples.java new file mode 100644 index 000000000000..5eeeeb53d254 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToResolveSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for Alerts UpdateResourceGroupLevelStateToResolve. + */ +public final class AlertsUpdateResourceGroupLevelStateToResolveSamples { + /* + * x-ms-original-file: 2022-01-01/Alerts/UpdateAlertResourceGroupLocation_resolve_example.json + */ + /** + * Sample code: Update security alert state on a resource group from a security data location. + * + * @param manager Entry point to SecurityManager. + */ + public static void updateSecurityAlertStateOnAResourceGroupFromASecurityDataLocation( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.alerts() + .updateResourceGroupLevelStateToResolveWithResponse("myRg2", "westeurope", + "2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToActivateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToActivateSamples.java new file mode 100644 index 000000000000..7050026bea10 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToActivateSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for Alerts UpdateSubscriptionLevelStateToActivate. + */ +public final class AlertsUpdateSubscriptionLevelStateToActivateSamples { + /* + * x-ms-original-file: 2022-01-01/Alerts/UpdateAlertSubscriptionLocation_activate_example.json + */ + /** + * Sample code: Update security alert state on a subscription from a security data location. + * + * @param manager Entry point to SecurityManager. + */ + public static void updateSecurityAlertStateOnASubscriptionFromASecurityDataLocation( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.alerts() + .updateSubscriptionLevelStateToActivateWithResponse("westeurope", + "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToDismissSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToDismissSamples.java new file mode 100644 index 000000000000..2287e3b76aec --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToDismissSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for Alerts UpdateSubscriptionLevelStateToDismiss. + */ +public final class AlertsUpdateSubscriptionLevelStateToDismissSamples { + /* + * x-ms-original-file: 2022-01-01/Alerts/UpdateAlertSubscriptionLocation_dismiss_example.json + */ + /** + * Sample code: Update security alert state on a subscription from a security data location. + * + * @param manager Entry point to SecurityManager. + */ + public static void updateSecurityAlertStateOnASubscriptionFromASecurityDataLocation( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.alerts() + .updateSubscriptionLevelStateToDismissWithResponse("westeurope", + "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToInProgressSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToInProgressSamples.java new file mode 100644 index 000000000000..722e6d6f31ec --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToInProgressSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for Alerts UpdateSubscriptionLevelStateToInProgress. + */ +public final class AlertsUpdateSubscriptionLevelStateToInProgressSamples { + /* + * x-ms-original-file: 2022-01-01/Alerts/UpdateAlertSubscriptionLocation_inProgress_example.json + */ + /** + * Sample code: Update security alert state on a subscription from a security data location. + * + * @param manager Entry point to SecurityManager. + */ + public static void updateSecurityAlertStateOnASubscriptionFromASecurityDataLocation( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.alerts() + .updateSubscriptionLevelStateToInProgressWithResponse("westeurope", + "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToResolveSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToResolveSamples.java new file mode 100644 index 000000000000..80aa24be2d00 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToResolveSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for Alerts UpdateSubscriptionLevelStateToResolve. + */ +public final class AlertsUpdateSubscriptionLevelStateToResolveSamples { + /* + * x-ms-original-file: 2022-01-01/Alerts/UpdateAlertSubscriptionLocation_resolve_example.json + */ + /** + * Sample code: Update security alert state on a subscription from a security data location. + * + * @param manager Entry point to SecurityManager. + */ + public static void updateSecurityAlertStateOnASubscriptionFromASecurityDataLocation( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.alerts() + .updateSubscriptionLevelStateToResolveWithResponse("westeurope", + "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AllowedConnectionsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AllowedConnectionsGetSamples.java new file mode 100644 index 000000000000..89990d122b9f --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AllowedConnectionsGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.ConnectionType; + +/** + * Samples for AllowedConnections Get. + */ +public final class AllowedConnectionsGetSamples { + /* + * x-ms-original-file: 2020-01-01/AllowedConnections/GetAllowedConnections_example.json + */ + /** + * Sample code: Get allowed connections. + * + * @param manager Entry point to SecurityManager. + */ + public static void getAllowedConnections(com.azure.resourcemanager.security.SecurityManager manager) { + manager.allowedConnections() + .getWithResponse("myResourceGroup", "centralus", ConnectionType.INTERNAL, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AllowedConnectionsListByHomeRegionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AllowedConnectionsListByHomeRegionSamples.java new file mode 100644 index 000000000000..7e04b1502ae7 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AllowedConnectionsListByHomeRegionSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for AllowedConnections ListByHomeRegion. + */ +public final class AllowedConnectionsListByHomeRegionSamples { + /* + * x-ms-original-file: 2020-01-01/AllowedConnections/GetAllowedConnectionsSubscriptionLocation_example.json + */ + /** + * Sample code: Get allowed connections on a subscription from security data location. + * + * @param manager Entry point to SecurityManager. + */ + public static void getAllowedConnectionsOnASubscriptionFromSecurityDataLocation( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.allowedConnections().listByHomeRegion("centralus", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AllowedConnectionsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AllowedConnectionsListSamples.java new file mode 100644 index 000000000000..3db12c645951 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AllowedConnectionsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for AllowedConnections List. + */ +public final class AllowedConnectionsListSamples { + /* + * x-ms-original-file: 2020-01-01/AllowedConnections/GetAllowedConnectionsSubscription_example.json + */ + /** + * Sample code: Get allowed connections on a subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void + getAllowedConnectionsOnASubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.allowedConnections().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionsGetByAzureApiManagementServiceSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionsGetByAzureApiManagementServiceSamples.java new file mode 100644 index 000000000000..ba506d0cee07 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionsGetByAzureApiManagementServiceSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for ApiCollections GetByAzureApiManagementService. + */ +public final class ApiCollectionsGetByAzureApiManagementServiceSamples { + /* + * x-ms-original-file: 2023-11-15/ApiCollections/APICollections_GetByAzureApiManagementService_example.json + */ + /** + * Sample code: Gets an Azure API Management API if it has been onboarded to Microsoft Defender for APIs. + * + * @param manager Entry point to SecurityManager. + */ + public static void getsAnAzureAPIManagementAPIIfItHasBeenOnboardedToMicrosoftDefenderForAPIs( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.apiCollections() + .getByAzureApiManagementServiceWithResponse("rg1", "apimService1", "echo-api", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionsListByAzureApiManagementServiceSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionsListByAzureApiManagementServiceSamples.java new file mode 100644 index 000000000000..d24bb4e639d2 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionsListByAzureApiManagementServiceSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for ApiCollections ListByAzureApiManagementService. + */ +public final class ApiCollectionsListByAzureApiManagementServiceSamples { + /* + * x-ms-original-file: 2023-11-15/ApiCollections/APICollections_ListByAzureApiManagementService_example.json + */ + /** + * Sample code: Gets a list of Azure API Management APIs that have been onboarded to Microsoft Defender for APIs. + * + * @param manager Entry point to SecurityManager. + */ + public static void getsAListOfAzureAPIManagementAPIsThatHaveBeenOnboardedToMicrosoftDefenderForAPIs( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.apiCollections() + .listByAzureApiManagementService("rg1", "apimService1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionsListByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionsListByResourceGroupSamples.java new file mode 100644 index 000000000000..6d2eba95a76f --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionsListByResourceGroupSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for ApiCollections ListByResourceGroup. + */ +public final class ApiCollectionsListByResourceGroupSamples { + /* + * x-ms-original-file: 2023-11-15/ApiCollections/APICollections_ListByResourceGroup_example.json + */ + /** + * Sample code: Gets a list of API collections within a resource group that have been onboarded to Microsoft + * Defender for APIs. + * + * @param manager Entry point to SecurityManager. + */ + public static void getsAListOfAPICollectionsWithinAResourceGroupThatHaveBeenOnboardedToMicrosoftDefenderForAPIs( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.apiCollections().listByResourceGroup("rg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionsListSamples.java new file mode 100644 index 000000000000..6c4e285f77a2 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionsListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for ApiCollections List. + */ +public final class ApiCollectionsListSamples { + /* + * x-ms-original-file: 2023-11-15/ApiCollections/APICollections_ListBySubscription_example.json + */ + /** + * Sample code: Gets a list of API collections within a subscription that have been onboarded to Microsoft Defender + * for APIs. + * + * @param manager Entry point to SecurityManager. + */ + public static void getsAListOfAPICollectionsWithinASubscriptionThatHaveBeenOnboardedToMicrosoftDefenderForAPIs( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.apiCollections().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionsOffboardAzureApiManagementApiSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionsOffboardAzureApiManagementApiSamples.java new file mode 100644 index 000000000000..cc987c9857c4 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionsOffboardAzureApiManagementApiSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for ApiCollections OffboardAzureApiManagementApi. + */ +public final class ApiCollectionsOffboardAzureApiManagementApiSamples { + /* + * x-ms-original-file: 2023-11-15/ApiCollections/APICollections_OffboardAzureApiManagementApi_example.json + */ + /** + * Sample code: Offboard an Azure API Management API from Microsoft Defender for APIs. + * + * @param manager Entry point to SecurityManager. + */ + public static void offboardAnAzureAPIManagementAPIFromMicrosoftDefenderForAPIs( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.apiCollections() + .offboardAzureApiManagementApiWithResponse("rg1", "apimService1", "echo-api", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionsOnboardAzureApiManagementApiSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionsOnboardAzureApiManagementApiSamples.java new file mode 100644 index 000000000000..8dcc658607ed --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionsOnboardAzureApiManagementApiSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for ApiCollections OnboardAzureApiManagementApi. + */ +public final class ApiCollectionsOnboardAzureApiManagementApiSamples { + /* + * x-ms-original-file: 2023-11-15/ApiCollections/APICollections_OnboardAzureApiManagementApi_example.json + */ + /** + * Sample code: Onboard an Azure API Management API to Microsoft Defender for APIs. + * + * @param manager Entry point to SecurityManager. + */ + public static void onboardAnAzureAPIManagementAPIToMicrosoftDefenderForAPIs( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.apiCollections() + .onboardAzureApiManagementApi("rg1", "apimService1", "echo-api", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApplicationsCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApplicationsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..67b750212492 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApplicationsCreateOrUpdateSamples.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.security.models.ApplicationSourceResourceType; +import java.io.IOException; +import java.util.Arrays; + +/** + * Samples for Applications CreateOrUpdate. + */ +public final class ApplicationsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2022-07-01-preview/Applications/PutApplication_example.json + */ + /** + * Sample code: Create application. + * + * @param manager Entry point to SecurityManager. + */ + public static void createApplication(com.azure.resourcemanager.security.SecurityManager manager) + throws IOException { + manager.applications() + .define("ad9a8e26-29d9-4829-bb30-e597a58cdbb8") + .withDisplayName("Admin's application") + .withDescription("An application on critical recommendations") + .withSourceResourceType(ApplicationSourceResourceType.ASSESSMENTS) + .withConditionSets(Arrays.asList(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{\"conditions\":[{\"operator\":\"contains\",\"property\":\"$.Id\",\"value\":\"-bil-\"}]}", + Object.class, SerializerEncoding.JSON))) + .create(); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApplicationsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApplicationsDeleteSamples.java new file mode 100644 index 000000000000..d50e9e956f4b --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApplicationsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for Applications Delete. + */ +public final class ApplicationsDeleteSamples { + /* + * x-ms-original-file: 2022-07-01-preview/Applications/DeleteApplication_example.json + */ + /** + * Sample code: Delete security Application. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteSecurityApplication(com.azure.resourcemanager.security.SecurityManager manager) { + manager.applications() + .deleteWithResponse("ad9a8e26-29d9-4829-bb30-e597a58cdbb8", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApplicationsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApplicationsGetSamples.java new file mode 100644 index 000000000000..d41db7a55d71 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApplicationsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for Applications Get. + */ +public final class ApplicationsGetSamples { + /* + * x-ms-original-file: 2022-07-01-preview/Applications/GetApplication_example.json + */ + /** + * Sample code: Get security application by specific applicationId. + * + * @param manager Entry point to SecurityManager. + */ + public static void + getSecurityApplicationBySpecificApplicationId(com.azure.resourcemanager.security.SecurityManager manager) { + manager.applications() + .getWithResponse("ad9a8e26-29d9-4829-bb30-e597a58cdbb8", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApplicationsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApplicationsListSamples.java new file mode 100644 index 000000000000..b83fafde8e21 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApplicationsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for Applications List. + */ +public final class ApplicationsListSamples { + /* + * x-ms-original-file: 2022-07-01-preview/Applications/ListBySubscriptionApplications_example.json + */ + /** + * Sample code: List applications security by subscription level scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void + listApplicationsSecurityBySubscriptionLevelScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.applications().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..fcec91826c5b --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsCreateOrUpdateSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.AssessmentStatus; +import com.azure.resourcemanager.security.models.AssessmentStatusCode; +import com.azure.resourcemanager.security.models.AzureResourceDetails; + +/** + * Samples for Assessments CreateOrUpdate. + */ +public final class AssessmentsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2025-05-04/Assessments/PutAssessment_example.json + */ + /** + * Sample code: Create security recommendation task on a resource. + * + * @param manager Entry point to SecurityManager. + */ + public static void + createSecurityRecommendationTaskOnAResource(com.azure.resourcemanager.security.SecurityManager manager) { + manager.assessments() + .define("8bb8be0a-6010-4789-812f-e4d661c4ed0e") + .withExistingResourceId( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2") + .withStatus(new AssessmentStatus().withCode(AssessmentStatusCode.HEALTHY)) + .withResourceDetails(new AzureResourceDetails()) + .create(); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsDeleteSamples.java new file mode 100644 index 000000000000..5399a8e3267b --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsDeleteSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for Assessments Delete. + */ +public final class AssessmentsDeleteSamples { + /* + * x-ms-original-file: 2025-05-04/Assessments/DeleteAssessment_example.json + */ + /** + * Sample code: Delete a security recommendation task on a resource. + * + * @param manager Entry point to SecurityManager. + */ + public static void + deleteASecurityRecommendationTaskOnAResource(com.azure.resourcemanager.security.SecurityManager manager) { + manager.assessments() + .deleteByResourceGroupWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2", + "8bb8be0a-6010-4789-812f-e4d661c4ed0e", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsGetSamples.java new file mode 100644 index 000000000000..71009a68afd6 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsGetSamples.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.ExpandEnum; + +/** + * Samples for Assessments Get. + */ +public final class AssessmentsGetSamples { + /* + * x-ms-original-file: 2025-05-04/Assessments/GetAssessmentWithExpand_example.json + */ + /** + * Sample code: Get security recommendation task from security data location with expand parameter. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityRecommendationTaskFromSecurityDataLocationWithExpandParameter( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.assessments() + .getWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2", + "21300918-b2e3-0346-785f-c77ff57d243b", ExpandEnum.LINKS, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-05-04/Assessments/GetAssessment_example.json + */ + /** + * Sample code: Get security recommendation task from security data location. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityRecommendationTaskFromSecurityDataLocation( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.assessments() + .getWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2", + "21300918-b2e3-0346-785f-c77ff57d243b", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsListSamples.java new file mode 100644 index 000000000000..5dbbecbffc53 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for Assessments List. + */ +public final class AssessmentsListSamples { + /* + * x-ms-original-file: 2025-05-04/Assessments/ListAssessments_example.json + */ + /** + * Sample code: List security assessments. + * + * @param manager Entry point to SecurityManager. + */ + public static void listSecurityAssessments(com.azure.resourcemanager.security.SecurityManager manager) { + manager.assessments() + .list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataCreateInSubscriptionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataCreateInSubscriptionSamples.java new file mode 100644 index 000000000000..3fa0b2fa28c1 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataCreateInSubscriptionSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.AssessmentType; +import com.azure.resourcemanager.security.models.Categories; +import com.azure.resourcemanager.security.models.Severity; +import com.azure.resourcemanager.security.models.Threats; +import java.util.Arrays; + +/** + * Samples for AssessmentsMetadata CreateInSubscription. + */ +public final class AssessmentsMetadataCreateInSubscriptionSamples { + /* + * x-ms-original-file: 2025-05-04/AssessmentsMetadata/CreateAssessmentsMetadata_subscription_example.json + */ + /** + * Sample code: Create security assessment metadata for subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void + createSecurityAssessmentMetadataForSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.assessmentsMetadatas() + .define("ca039e75-a276-4175-aebc-bcd41e4b14b7") + .withDisplayName("Install endpoint protection solution on virtual machine scale sets") + .withDescription( + "Install an endpoint protection solution on your virtual machines scale sets, to protect them from threats and vulnerabilities.") + .withRemediationDescription( + "To install an endpoint protection solution: 1. Follow the instructions in How do I turn on antimalware in my virtual machine scale set") + .withCategories(Arrays.asList(Categories.COMPUTE)) + .withSeverity(Severity.MEDIUM) + .withThreats(Arrays.asList(Threats.DATA_EXFILTRATION, Threats.DATA_SPILLAGE, Threats.MALICIOUS_INSIDER)) + .withAssessmentType(AssessmentType.CUSTOMER_MANAGED) + .create(); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataDeleteInSubscriptionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataDeleteInSubscriptionSamples.java new file mode 100644 index 000000000000..b334e53b2bcd --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataDeleteInSubscriptionSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for AssessmentsMetadata DeleteInSubscription. + */ +public final class AssessmentsMetadataDeleteInSubscriptionSamples { + /* + * x-ms-original-file: 2025-05-04/AssessmentsMetadata/DeleteAssessmentsMetadata_subscription_example.json + */ + /** + * Sample code: Delete a security assessment metadata for subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void + deleteASecurityAssessmentMetadataForSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.assessmentsMetadatas() + .deleteInSubscriptionWithResponse("ca039e75-a276-4175-aebc-bcd41e4b14b7", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataGetInSubscriptionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataGetInSubscriptionSamples.java new file mode 100644 index 000000000000..bf79dc8befd2 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataGetInSubscriptionSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for AssessmentsMetadata GetInSubscription. + */ +public final class AssessmentsMetadataGetInSubscriptionSamples { + /* + * x-ms-original-file: 2025-05-04/AssessmentsMetadata/GetAssessmentsMetadata_subscription_example.json + */ + /** + * Sample code: Get security assessment metadata for subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void + getSecurityAssessmentMetadataForSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.assessmentsMetadatas() + .getInSubscriptionWithResponse("21300918-b2e3-0346-785f-c77ff57d243b", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataGetSamples.java new file mode 100644 index 000000000000..ac4d6075d75d --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for AssessmentsMetadata Get. + */ +public final class AssessmentsMetadataGetSamples { + /* + * x-ms-original-file: 2025-05-04/AssessmentsMetadata/GetAssessmentsMetadata_example.json + */ + /** + * Sample code: Get security assessment metadata. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityAssessmentMetadata(com.azure.resourcemanager.security.SecurityManager manager) { + manager.assessmentsMetadatas() + .getWithResponse("21300918-b2e3-0346-785f-c77ff57d243b", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataListBySubscriptionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataListBySubscriptionSamples.java new file mode 100644 index 000000000000..b7d7694837f3 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataListBySubscriptionSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for AssessmentsMetadata ListBySubscription. + */ +public final class AssessmentsMetadataListBySubscriptionSamples { + /* + * x-ms-original-file: 2025-05-04/AssessmentsMetadata/ListAssessmentsMetadata_subscription_example.json + */ + /** + * Sample code: List security assessment metadata for subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void + listSecurityAssessmentMetadataForSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.assessmentsMetadatas().listBySubscription(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataListSamples.java new file mode 100644 index 000000000000..732371017e70 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for AssessmentsMetadata List. + */ +public final class AssessmentsMetadataListSamples { + /* + * x-ms-original-file: 2025-05-04/AssessmentsMetadata/ListAssessmentsMetadata_example.json + */ + /** + * Sample code: List security assessment metadata. + * + * @param manager Entry point to SecurityManager. + */ + public static void listSecurityAssessmentMetadata(com.azure.resourcemanager.security.SecurityManager manager) { + manager.assessmentsMetadatas().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssignmentsCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssignmentsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..a20481e16aad --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssignmentsCreateOrUpdateSamples.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.security.models.AssignedComponentItem; +import com.azure.resourcemanager.security.models.AssignedStandardItem; +import com.azure.resourcemanager.security.models.AssignmentPropertiesAdditionalData; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * Samples for Assignments CreateOrUpdate. + */ +public final class AssignmentsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2021-08-01-preview/Assignments/PutDefaultAssignment_example.json + */ + /** + * Sample code: Define a default standard assignment. + * + * @param manager Entry point to SecurityManager. + */ + public static void defineADefaultStandardAssignment(com.azure.resourcemanager.security.SecurityManager manager) { + manager.assignments() + .define("1f3afdf9-d0c9-4c3d-847f-89da613e70a8") + .withExistingResourceGroup("myResourceGroup") + .withDisplayName("ASC Default") + .withDescription("Set of policies monitored by Azure Security Center for cross cloud") + .withAssignedStandard(new AssignedStandardItem() + .withId("/providers/Microsoft.Security/Standards/1f3afdf9-d0c9-4c3d-847f-89da613e70a8")) + .withScope("/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/ResourceGroup/rg") + .withEffect("audit") + .create(); + } + + /* + * x-ms-original-file: 2021-08-01-preview/Assignments/PutAssignment_example.json + */ + /** + * Sample code: Exempt Recommendation From standard and resource. + * + * @param manager Entry point to SecurityManager. + */ + public static void exemptRecommendationFromStandardAndResource( + com.azure.resourcemanager.security.SecurityManager manager) throws IOException { + manager.assignments() + .define("1f3afdf9-d0c9-4c3d-847f-89da613e70a8") + .withExistingResourceGroup("myResourceGroup") + .withDisplayName("ASC Default") + .withDescription("Set of policies monitored by Azure Security Center for cross cloud") + .withAssignedStandard(new AssignedStandardItem() + .withId("/providers/Microsoft.Security/Standards/1f3afdf9-d0c9-4c3d-847f-89da613e70a8")) + .withAssignedComponent(new AssignedComponentItem().withKey("fakeTokenPlaceholder")) + .withScope("/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/ResourceGroup/rg") + .withEffect("Exempt") + .withExpiresOn(OffsetDateTime.parse("2022-05-01T19:50:47.083633Z")) + .withAdditionalData(new AssignmentPropertiesAdditionalData().withExemptionCategory("waiver")) + .withMetadata(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("{\"ticketId\":12345}", Object.class, SerializerEncoding.JSON)) + .create(); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssignmentsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssignmentsDeleteSamples.java new file mode 100644 index 000000000000..a28b7fc408f5 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssignmentsDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for Assignments Delete. + */ +public final class AssignmentsDeleteSamples { + /* + * x-ms-original-file: 2021-08-01-preview/Assignments/DeleteAssignment_example.json + */ + /** + * Sample code: Delete security assignment. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteSecurityAssignment(com.azure.resourcemanager.security.SecurityManager manager) { + manager.assignments() + .deleteByResourceGroupWithResponse("myResourceGroup", "8bb8be0a-6010-4789-812f-e4d661c4ed0e", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssignmentsGetByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssignmentsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..a667c2ff529e --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssignmentsGetByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for Assignments GetByResourceGroup. + */ +public final class AssignmentsGetByResourceGroupSamples { + /* + * x-ms-original-file: 2021-08-01-preview/Assignments/GetAssignment_example.json + */ + /** + * Sample code: Get security standardAssignments by by specific standardAssignmentId. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityStandardAssignmentsByBySpecificStandardAssignmentId( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.assignments() + .getByResourceGroupWithResponse("myResourceGroup", "1f3afdf9-d0c9-4c3d-847f-89da613e70a8", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssignmentsListByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssignmentsListByResourceGroupSamples.java new file mode 100644 index 000000000000..f9f3f01f933c --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssignmentsListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for Assignments ListByResourceGroup. + */ +public final class AssignmentsListByResourceGroupSamples { + /* + * x-ms-original-file: 2021-08-01-preview/Assignments/ListAssignments_example.json + */ + /** + * Sample code: List security standardAssignments by subscriptionId and resourceGroup scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void listSecurityStandardAssignmentsBySubscriptionIdAndResourceGroupScope( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.assignments().listByResourceGroup("myResourceGroup", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssignmentsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssignmentsListSamples.java new file mode 100644 index 000000000000..9a839f1673d0 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssignmentsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for Assignments List. + */ +public final class AssignmentsListSamples { + /* + * x-ms-original-file: 2021-08-01-preview/Assignments/ListBySubscriptionAssignments_example.json + */ + /** + * Sample code: List security standardAssignments by subscription level scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void listSecurityStandardAssignmentsBySubscriptionLevelScope( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.assignments().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsCreateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsCreateSamples.java new file mode 100644 index 000000000000..ae260a519454 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsCreateSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.AutoProvision; + +/** + * Samples for AutoProvisioningSettings Create. + */ +public final class AutoProvisioningSettingsCreateSamples { + /* + * x-ms-original-file: + * 2017-08-01-preview/AutoProvisioningSettings/CreateAutoProvisioningSettingsSubscription_example.json + */ + /** + * Sample code: Create auto provisioning settings for subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void + createAutoProvisioningSettingsForSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.autoProvisioningSettings().define("default").withAutoProvision(AutoProvision.ON).create(); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsGetSamples.java new file mode 100644 index 000000000000..413380972f80 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for AutoProvisioningSettings Get. + */ +public final class AutoProvisioningSettingsGetSamples { + /* + * x-ms-original-file: + * 2017-08-01-preview/AutoProvisioningSettings/GetAutoProvisioningSettingSubscription_example.json + */ + /** + * Sample code: Get an auto provisioning setting for subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void + getAnAutoProvisioningSettingForSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.autoProvisioningSettings().getWithResponse("default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsListSamples.java new file mode 100644 index 000000000000..3868e56a8034 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for AutoProvisioningSettings List. + */ +public final class AutoProvisioningSettingsListSamples { + /* + * x-ms-original-file: + * 2017-08-01-preview/AutoProvisioningSettings/GetAutoProvisioningSettingsSubscription_example.json + */ + /** + * Sample code: Get auto provisioning settings for subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void + getAutoProvisioningSettingsForSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.autoProvisioningSettings().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..77223636fb2e --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsCreateOrUpdateSamples.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.AutomationActionLogicApp; +import com.azure.resourcemanager.security.models.AutomationRuleSet; +import com.azure.resourcemanager.security.models.AutomationScope; +import com.azure.resourcemanager.security.models.AutomationSource; +import com.azure.resourcemanager.security.models.AutomationTriggeringRule; +import com.azure.resourcemanager.security.models.EventSource; +import com.azure.resourcemanager.security.models.Operator; +import com.azure.resourcemanager.security.models.PropertyType; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Automations CreateOrUpdate. + */ +public final class AutomationsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2023-12-01-preview/Automations/PutAutomationAllAssessments_example.json + */ + /** + * Sample code: Create or update a security automation for all assessments (including all severities). + * + * @param manager Entry point to SecurityManager. + */ + public static void createOrUpdateASecurityAutomationForAllAssessmentsIncludingAllSeverities( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.automations() + .define("exampleAutomation") + .withExistingResourceGroup("exampleResourceGroup") + .withRegion("Central US") + .withTags(mapOf()) + .withEtag("etag value (must be supplied for update)") + .withDescription( + "An example of a security automation that triggers one LogicApp resource (myTest1) on any security assessment") + .withIsEnabled(true) + .withScopes(Arrays.asList(new AutomationScope().withDescription( + "A description that helps to identify this scope - for example: security assessments that relate to the resource group myResourceGroup within the subscription a5caac9c-5c04-49af-b3d0-e204f40345d5") + .withScopePath("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"))) + .withSources(Arrays.asList(new AutomationSource().withEventSource(EventSource.ASSESSMENTS))) + .withActions(Arrays.asList(new AutomationActionLogicApp().withLogicAppResourceId( + "/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1") + .withUri("https://exampleTriggerUri1.com"))) + .create(); + } + + /* + * x-ms-original-file: 2023-12-01-preview/Automations/PutDisableAutomation_example.json + */ + /** + * Sample code: Disable or enable a security automation. + * + * @param manager Entry point to SecurityManager. + */ + public static void disableOrEnableASecurityAutomation(com.azure.resourcemanager.security.SecurityManager manager) { + manager.automations() + .define("exampleAutomation") + .withExistingResourceGroup("exampleResourceGroup") + .withRegion("Central US") + .withTags(mapOf()) + .withEtag("etag value (must be supplied for update)") + .withDescription( + "An example of a security automation that triggers one LogicApp resource (myTest1) on any security assessment of type customAssessment") + .withIsEnabled(false) + .withScopes(Arrays.asList(new AutomationScope().withDescription( + "A description that helps to identify this scope - for example: security assessments that relate to the resource group myResourceGroup within the subscription a5caac9c-5c04-49af-b3d0-e204f40345d5") + .withScopePath("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"))) + .withSources(Arrays.asList(new AutomationSource().withEventSource(EventSource.ASSESSMENTS) + .withRuleSets(Arrays.asList(new AutomationRuleSet() + .withRules(Arrays.asList(new AutomationTriggeringRule().withPropertyJPath("$.Entity.AssessmentType") + .withPropertyType(PropertyType.STRING) + .withExpectedValue("customAssessment") + .withOperator(Operator.EQUALS))))))) + .withActions(Arrays.asList(new AutomationActionLogicApp().withLogicAppResourceId( + "/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1") + .withUri("https://exampleTriggerUri1.com"))) + .create(); + } + + /* + * x-ms-original-file: 2023-12-01-preview/Automations/PutAutomationHighSeverityAssessments_example.json + */ + /** + * Sample code: Create or update a security automation for all high severity assessments. + * + * @param manager Entry point to SecurityManager. + */ + public static void createOrUpdateASecurityAutomationForAllHighSeverityAssessments( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.automations() + .define("exampleAutomation") + .withExistingResourceGroup("exampleResourceGroup") + .withRegion("Central US") + .withTags(mapOf()) + .withEtag("etag value (must be supplied for update)") + .withDescription( + "An example of a security automation that triggers one LogicApp resource (myTest1) on any high severity security assessment") + .withIsEnabled(true) + .withScopes(Arrays.asList(new AutomationScope().withDescription( + "A description that helps to identify this scope - for example: security assessments that relate to the resource group myResourceGroup within the subscription a5caac9c-5c04-49af-b3d0-e204f40345d5") + .withScopePath("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"))) + .withSources(Arrays.asList(new AutomationSource().withEventSource(EventSource.ASSESSMENTS) + .withRuleSets(Arrays.asList(new AutomationRuleSet().withRules( + Arrays.asList(new AutomationTriggeringRule().withPropertyJPath("properties.metadata.severity") + .withPropertyType(PropertyType.STRING) + .withExpectedValue("High") + .withOperator(Operator.EQUALS))))))) + .withActions(Arrays.asList(new AutomationActionLogicApp().withLogicAppResourceId( + "/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1") + .withUri("https://exampleTriggerUri1.com"))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsDeleteSamples.java new file mode 100644 index 000000000000..e848049735da --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for Automations Delete. + */ +public final class AutomationsDeleteSamples { + /* + * x-ms-original-file: 2023-12-01-preview/Automations/DeleteAutomation_example.json + */ + /** + * Sample code: Delete a security automation. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteASecurityAutomation(com.azure.resourcemanager.security.SecurityManager manager) { + manager.automations() + .deleteByResourceGroupWithResponse("myRg", "myAutomationName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsGetByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..8acecad14c7e --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsGetByResourceGroupSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for Automations GetByResourceGroup. + */ +public final class AutomationsGetByResourceGroupSamples { + /* + * x-ms-original-file: 2023-12-01-preview/Automations/GetAutomationResourceGroup_example.json + */ + /** + * Sample code: Retrieve a security automation. + * + * @param manager Entry point to SecurityManager. + */ + public static void retrieveASecurityAutomation(com.azure.resourcemanager.security.SecurityManager manager) { + manager.automations() + .getByResourceGroupWithResponse("exampleResourceGroup", "exampleAutomation", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsListByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsListByResourceGroupSamples.java new file mode 100644 index 000000000000..3504a40ba8fc --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for Automations ListByResourceGroup. + */ +public final class AutomationsListByResourceGroupSamples { + /* + * x-ms-original-file: 2023-12-01-preview/Automations/GetAutomationsResourceGroup_example.json + */ + /** + * Sample code: List all security automations of a specified resource group. + * + * @param manager Entry point to SecurityManager. + */ + public static void listAllSecurityAutomationsOfASpecifiedResourceGroup( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.automations().listByResourceGroup("exampleResourceGroup", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsListSamples.java new file mode 100644 index 000000000000..a388bd50f4ec --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for Automations List. + */ +public final class AutomationsListSamples { + /* + * x-ms-original-file: 2023-12-01-preview/Automations/GetAutomationsSubscription_example.json + */ + /** + * Sample code: List all security automations of a specified subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void + listAllSecurityAutomationsOfASpecifiedSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.automations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsUpdateSamples.java new file mode 100644 index 000000000000..747e06eadc4c --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsUpdateSamples.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.Automation; +import com.azure.resourcemanager.security.models.AutomationActionLogicApp; +import com.azure.resourcemanager.security.models.AutomationScope; +import com.azure.resourcemanager.security.models.AutomationSource; +import com.azure.resourcemanager.security.models.EventSource; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Automations Update. + */ +public final class AutomationsUpdateSamples { + /* + * x-ms-original-file: 2023-12-01-preview/Automations/PatchAutomation_example.json + */ + /** + * Sample code: Update a security automation. + * + * @param manager Entry point to SecurityManager. + */ + public static void updateASecurityAutomation(com.azure.resourcemanager.security.SecurityManager manager) { + Automation resource = manager.automations() + .getByResourceGroupWithResponse("exampleResourceGroup", "exampleAutomation", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("Example", "exampleTag")) + .withDescription( + "An example of a security automation that triggers one LogicApp resource (myTest1) on any security assessment") + .withScopes(Arrays.asList(new AutomationScope().withDescription( + "A description that helps to identify this scope - for example: security assessments that relate to the resource group myResourceGroup within the subscription a5caac9c-5c04-49af-b3d0-e204f40345d5") + .withScopePath("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"))) + .withSources(Arrays.asList(new AutomationSource().withEventSource(EventSource.ASSESSMENTS))) + .withActions(Arrays.asList(new AutomationActionLogicApp().withLogicAppResourceId( + "/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1") + .withUri("https://exampleTriggerUri1.com"))) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsValidateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsValidateSamples.java new file mode 100644 index 000000000000..1e2943694667 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsValidateSamples.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.fluent.models.AutomationInner; +import com.azure.resourcemanager.security.models.AutomationActionLogicApp; +import com.azure.resourcemanager.security.models.AutomationRuleSet; +import com.azure.resourcemanager.security.models.AutomationScope; +import com.azure.resourcemanager.security.models.AutomationSource; +import com.azure.resourcemanager.security.models.AutomationTriggeringRule; +import com.azure.resourcemanager.security.models.EventSource; +import com.azure.resourcemanager.security.models.Operator; +import com.azure.resourcemanager.security.models.PropertyType; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Automations Validate. + */ +public final class AutomationsValidateSamples { + /* + * x-ms-original-file: 2023-12-01-preview/Automations/ValidateAutomation_example.json + */ + /** + * Sample code: Validate the security automation model before create or update. + * + * @param manager Entry point to SecurityManager. + */ + public static void validateTheSecurityAutomationModelBeforeCreateOrUpdate( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.automations() + .validateWithResponse("exampleResourceGroup", "exampleAutomation", new AutomationInner().withTags(mapOf()) + .withLocation("Central US") + .withDescription( + "An example of a security automation that triggers one LogicApp resource (myTest1) on any security assessment of type customAssessment") + .withIsEnabled(true) + .withScopes(Arrays.asList(new AutomationScope().withDescription( + "A description that helps to identify this scope - for example: security assessments that relate to the resource group myResourceGroup within the subscription a5caac9c-5c04-49af-b3d0-e204f40345d5") + .withScopePath( + "/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"))) + .withSources(Arrays.asList(new AutomationSource().withEventSource(EventSource.ASSESSMENTS) + .withRuleSets(Arrays.asList(new AutomationRuleSet().withRules( + Arrays.asList(new AutomationTriggeringRule().withPropertyJPath("$.Entity.AssessmentType") + .withPropertyType(PropertyType.STRING) + .withExpectedValue("customAssessment") + .withOperator(Operator.EQUALS))))))) + .withActions(Arrays.asList(new AutomationActionLogicApp().withLogicAppResourceId( + "/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1") + .withUri("https://exampleTriggerUri1.com"))), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsOrgsCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsOrgsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..f1a06a3449e3 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsOrgsCreateOrUpdateSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.ActionableRemediation; +import com.azure.resourcemanager.security.models.ActionableRemediationState; +import com.azure.resourcemanager.security.models.AzureDevOpsOrgProperties; +import com.azure.resourcemanager.security.models.OnboardingState; + +/** + * Samples for AzureDevOpsOrgs CreateOrUpdate. + */ +public final class AzureDevOpsOrgsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2025-11-01-preview/SecurityConnectorsDevOps/CreateOrUpdateAzureDevOpsOrgs_example.json + */ + /** + * Sample code: CreateOrUpdate_AzureDevOpsOrgs. + * + * @param manager Entry point to SecurityManager. + */ + public static void createOrUpdateAzureDevOpsOrgs(com.azure.resourcemanager.security.SecurityManager manager) { + manager.azureDevOpsOrgs() + .define("myAzDevOpsOrg") + .withExistingSecurityConnector("myRg", "mySecurityConnectorName") + .withProperties(new AzureDevOpsOrgProperties().withOnboardingState(OnboardingState.NOT_APPLICABLE) + .withActionableRemediation(new ActionableRemediation().withState(ActionableRemediationState.ENABLED))) + .create(); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsOrgsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsOrgsGetSamples.java new file mode 100644 index 000000000000..a1ec51ad7e41 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsOrgsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for AzureDevOpsOrgs Get. + */ +public final class AzureDevOpsOrgsGetSamples { + /* + * x-ms-original-file: 2025-11-01-preview/SecurityConnectorsDevOps/GetAzureDevOpsOrgs_example.json + */ + /** + * Sample code: Get_AzureDevOpsOrgs. + * + * @param manager Entry point to SecurityManager. + */ + public static void getAzureDevOpsOrgs(com.azure.resourcemanager.security.SecurityManager manager) { + manager.azureDevOpsOrgs() + .getWithResponse("myRg", "mySecurityConnectorName", "myAzDevOpsOrg", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsOrgsListAvailableSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsOrgsListAvailableSamples.java new file mode 100644 index 000000000000..d05507604212 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsOrgsListAvailableSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for AzureDevOpsOrgs ListAvailable. + */ +public final class AzureDevOpsOrgsListAvailableSamples { + /* + * x-ms-original-file: 2025-11-01-preview/SecurityConnectorsDevOps/ListAvailableAzureDevOpsOrgs_example.json + */ + /** + * Sample code: ListAvailable_AzureDevOpsOrgs. + * + * @param manager Entry point to SecurityManager. + */ + public static void listAvailableAzureDevOpsOrgs(com.azure.resourcemanager.security.SecurityManager manager) { + manager.azureDevOpsOrgs() + .listAvailableWithResponse("myRg", "mySecurityConnectorName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsOrgsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsOrgsListSamples.java new file mode 100644 index 000000000000..3d3f27b81227 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsOrgsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for AzureDevOpsOrgs List. + */ +public final class AzureDevOpsOrgsListSamples { + /* + * x-ms-original-file: 2025-11-01-preview/SecurityConnectorsDevOps/ListAzureDevOpsOrgs_example.json + */ + /** + * Sample code: List_AzureDevOpsOrgs. + * + * @param manager Entry point to SecurityManager. + */ + public static void listAzureDevOpsOrgs(com.azure.resourcemanager.security.SecurityManager manager) { + manager.azureDevOpsOrgs().list("myRg", "mySecurityConnectorName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsOrgsUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsOrgsUpdateSamples.java new file mode 100644 index 000000000000..7f4d1333ee8a --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsOrgsUpdateSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.ActionableRemediation; +import com.azure.resourcemanager.security.models.ActionableRemediationState; +import com.azure.resourcemanager.security.models.AzureDevOpsOrg; +import com.azure.resourcemanager.security.models.AzureDevOpsOrgProperties; +import com.azure.resourcemanager.security.models.OnboardingState; + +/** + * Samples for AzureDevOpsOrgs Update. + */ +public final class AzureDevOpsOrgsUpdateSamples { + /* + * x-ms-original-file: 2025-11-01-preview/SecurityConnectorsDevOps/UpdateAzureDevOpsOrgs_example.json + */ + /** + * Sample code: Update_AzureDevOpsOrgs. + * + * @param manager Entry point to SecurityManager. + */ + public static void updateAzureDevOpsOrgs(com.azure.resourcemanager.security.SecurityManager manager) { + AzureDevOpsOrg resource = manager.azureDevOpsOrgs() + .getWithResponse("myRg", "mySecurityConnectorName", "myAzDevOpsOrg", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties(new AzureDevOpsOrgProperties().withOnboardingState(OnboardingState.NOT_APPLICABLE) + .withActionableRemediation(new ActionableRemediation().withState(ActionableRemediationState.ENABLED))) + .apply(); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsProjectsCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsProjectsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..6048bebe8878 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsProjectsCreateOrUpdateSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.ActionableRemediation; +import com.azure.resourcemanager.security.models.ActionableRemediationState; +import com.azure.resourcemanager.security.models.AzureDevOpsProjectProperties; +import com.azure.resourcemanager.security.models.OnboardingState; + +/** + * Samples for AzureDevOpsProjects CreateOrUpdate. + */ +public final class AzureDevOpsProjectsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2025-11-01-preview/SecurityConnectorsDevOps/CreateOrUpdateAzureDevOpsProjects_example.json + */ + /** + * Sample code: CreateOrUpdate_AzureDevOpsProjects. + * + * @param manager Entry point to SecurityManager. + */ + public static void createOrUpdateAzureDevOpsProjects(com.azure.resourcemanager.security.SecurityManager manager) { + manager.azureDevOpsProjects() + .define("myAzDevOpsProject") + .withExistingAzureDevOpsOrg("myRg", "mySecurityConnectorName", "myAzDevOpsOrg") + .withProperties(new AzureDevOpsProjectProperties().withOnboardingState(OnboardingState.NOT_APPLICABLE) + .withActionableRemediation(new ActionableRemediation().withState(ActionableRemediationState.ENABLED))) + .create(); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsProjectsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsProjectsGetSamples.java new file mode 100644 index 000000000000..7307b70860ec --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsProjectsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for AzureDevOpsProjects Get. + */ +public final class AzureDevOpsProjectsGetSamples { + /* + * x-ms-original-file: 2025-11-01-preview/SecurityConnectorsDevOps/GetAzureDevOpsProjects_example.json + */ + /** + * Sample code: Get_AzureDevOpsProjects. + * + * @param manager Entry point to SecurityManager. + */ + public static void getAzureDevOpsProjects(com.azure.resourcemanager.security.SecurityManager manager) { + manager.azureDevOpsProjects() + .getWithResponse("myRg", "mySecurityConnectorName", "myAzDevOpsOrg", "myAzDevOpsProject", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsProjectsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsProjectsListSamples.java new file mode 100644 index 000000000000..d13941bb7f5a --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsProjectsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for AzureDevOpsProjects List. + */ +public final class AzureDevOpsProjectsListSamples { + /* + * x-ms-original-file: 2025-11-01-preview/SecurityConnectorsDevOps/ListAzureDevOpsProjects_example.json + */ + /** + * Sample code: List_AzureDevOpsProjects. + * + * @param manager Entry point to SecurityManager. + */ + public static void listAzureDevOpsProjects(com.azure.resourcemanager.security.SecurityManager manager) { + manager.azureDevOpsProjects() + .list("myRg", "mySecurityConnectorName", "myAzDevOpsOrg", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsProjectsUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsProjectsUpdateSamples.java new file mode 100644 index 000000000000..55100c4b4e9c --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsProjectsUpdateSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.ActionableRemediation; +import com.azure.resourcemanager.security.models.ActionableRemediationState; +import com.azure.resourcemanager.security.models.AzureDevOpsProject; +import com.azure.resourcemanager.security.models.AzureDevOpsProjectProperties; +import com.azure.resourcemanager.security.models.OnboardingState; + +/** + * Samples for AzureDevOpsProjects Update. + */ +public final class AzureDevOpsProjectsUpdateSamples { + /* + * x-ms-original-file: 2025-11-01-preview/SecurityConnectorsDevOps/UpdateAzureDevOpsProjects_example.json + */ + /** + * Sample code: Update_AzureDevOpsProjects. + * + * @param manager Entry point to SecurityManager. + */ + public static void updateAzureDevOpsProjects(com.azure.resourcemanager.security.SecurityManager manager) { + AzureDevOpsProject resource = manager.azureDevOpsProjects() + .getWithResponse("myRg", "mySecurityConnectorName", "myAzDevOpsOrg", "myAzDevOpsProject", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties(new AzureDevOpsProjectProperties().withOnboardingState(OnboardingState.NOT_APPLICABLE) + .withActionableRemediation(new ActionableRemediation().withState(ActionableRemediationState.ENABLED))) + .apply(); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsReposCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsReposCreateOrUpdateSamples.java new file mode 100644 index 000000000000..b6935b84a34e --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsReposCreateOrUpdateSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.ActionableRemediation; +import com.azure.resourcemanager.security.models.ActionableRemediationState; +import com.azure.resourcemanager.security.models.AzureDevOpsRepositoryProperties; +import com.azure.resourcemanager.security.models.OnboardingState; + +/** + * Samples for AzureDevOpsRepos CreateOrUpdate. + */ +public final class AzureDevOpsReposCreateOrUpdateSamples { + /* + * x-ms-original-file: 2025-11-01-preview/SecurityConnectorsDevOps/CreateOrUpdateAzureDevOpsRepos_example.json + */ + /** + * Sample code: CreateOrUpdate_AzureDevOpsRepos. + * + * @param manager Entry point to SecurityManager. + */ + public static void createOrUpdateAzureDevOpsRepos(com.azure.resourcemanager.security.SecurityManager manager) { + manager.azureDevOpsRepos() + .define("myAzDevOpsRepo") + .withExistingProject("myRg", "mySecurityConnectorName", "myAzDevOpsOrg", "myAzDevOpsProject") + .withProperties(new AzureDevOpsRepositoryProperties().withOnboardingState(OnboardingState.NOT_APPLICABLE) + .withActionableRemediation(new ActionableRemediation().withState(ActionableRemediationState.ENABLED))) + .create(); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsReposGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsReposGetSamples.java new file mode 100644 index 000000000000..34b80ca06b92 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsReposGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for AzureDevOpsRepos Get. + */ +public final class AzureDevOpsReposGetSamples { + /* + * x-ms-original-file: 2025-11-01-preview/SecurityConnectorsDevOps/GetAzureDevOpsRepos_example.json + */ + /** + * Sample code: Get_AzureDevOpsRepos. + * + * @param manager Entry point to SecurityManager. + */ + public static void getAzureDevOpsRepos(com.azure.resourcemanager.security.SecurityManager manager) { + manager.azureDevOpsRepos() + .getWithResponse("myRg", "mySecurityConnectorName", "myAzDevOpsOrg", "myAzDevOpsProject", "myAzDevOpsRepo", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsReposListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsReposListSamples.java new file mode 100644 index 000000000000..ad9a443e5a54 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsReposListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for AzureDevOpsRepos List. + */ +public final class AzureDevOpsReposListSamples { + /* + * x-ms-original-file: 2025-11-01-preview/SecurityConnectorsDevOps/ListAzureDevOpsRepos_example.json + */ + /** + * Sample code: List_AzureDevOpsRepos. + * + * @param manager Entry point to SecurityManager. + */ + public static void listAzureDevOpsRepos(com.azure.resourcemanager.security.SecurityManager manager) { + manager.azureDevOpsRepos() + .list("myRg", "mySecurityConnectorName", "myAzDevOpsOrg", "myAzDevOpsProject", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsReposUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsReposUpdateSamples.java new file mode 100644 index 000000000000..31709d4a5cb1 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AzureDevOpsReposUpdateSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.ActionableRemediation; +import com.azure.resourcemanager.security.models.ActionableRemediationState; +import com.azure.resourcemanager.security.models.AzureDevOpsRepository; +import com.azure.resourcemanager.security.models.AzureDevOpsRepositoryProperties; +import com.azure.resourcemanager.security.models.OnboardingState; + +/** + * Samples for AzureDevOpsRepos Update. + */ +public final class AzureDevOpsReposUpdateSamples { + /* + * x-ms-original-file: 2025-11-01-preview/SecurityConnectorsDevOps/UpdateAzureDevOpsRepos_example.json + */ + /** + * Sample code: Update_AzureDevOpsRepos. + * + * @param manager Entry point to SecurityManager. + */ + public static void updateAzureDevOpsRepos(com.azure.resourcemanager.security.SecurityManager manager) { + AzureDevOpsRepository resource = manager.azureDevOpsRepos() + .getWithResponse("myRg", "mySecurityConnectorName", "myAzDevOpsOrg", "myAzDevOpsProject", "myAzDevOpsRepo", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties(new AzureDevOpsRepositoryProperties().withOnboardingState(OnboardingState.NOT_APPLICABLE) + .withActionableRemediation(new ActionableRemediation().withState(ActionableRemediationState.ENABLED))) + .apply(); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ComplianceResultsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ComplianceResultsGetSamples.java new file mode 100644 index 000000000000..7e2c20a61c84 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ComplianceResultsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for ComplianceResults Get. + */ +public final class ComplianceResultsGetSamples { + /* + * x-ms-original-file: 2017-08-01/ComplianceResults/GetComplianceResults_example.json + */ + /** + * Sample code: Get compliance results on subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void getComplianceResultsOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.complianceResults() + .getWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "DesignateMoreThanOneOwner", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ComplianceResultsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ComplianceResultsListSamples.java new file mode 100644 index 000000000000..b3cc3cd3c3d2 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ComplianceResultsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for ComplianceResults List. + */ +public final class ComplianceResultsListSamples { + /* + * x-ms-original-file: 2017-08-01/ComplianceResults/ListComplianceResults_example.json + */ + /** + * Sample code: Get compliance results on subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void getComplianceResultsOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.complianceResults() + .list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CompliancesGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CompliancesGetSamples.java new file mode 100644 index 000000000000..2098bdf4eaa6 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CompliancesGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for Compliances Get. + */ +public final class CompliancesGetSamples { + /* + * x-ms-original-file: 2017-08-01-preview/Compliances/GetCompliance_example.json + */ + /** + * Sample code: Get security compliance data for a day. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityComplianceDataForADay(com.azure.resourcemanager.security.SecurityManager manager) { + manager.compliances() + .getWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "2018-01-01Z", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CompliancesListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CompliancesListSamples.java new file mode 100644 index 000000000000..373aff4a3708 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CompliancesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for Compliances List. + */ +public final class CompliancesListSamples { + /* + * x-ms-original-file: 2017-08-01-preview/Compliances/GetCompliances_example.json + */ + /** + * Sample code: Get security compliance data over time. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityComplianceDataOverTime(com.azure.resourcemanager.security.SecurityManager manager) { + manager.compliances() + .list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomRecommendationsCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomRecommendationsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..eb7b3dfb8689 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomRecommendationsCreateOrUpdateSamples.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.RecommendationSupportedClouds; +import com.azure.resourcemanager.security.models.SecurityIssue; +import com.azure.resourcemanager.security.models.SeverityEnum; +import java.util.Arrays; + +/** + * Samples for CustomRecommendations CreateOrUpdate. + */ +public final class CustomRecommendationsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2024-08-01/CustomRecommendations/PutBySecurityConnectorCustomRecommendation_example.json + */ + /** + * Sample code: Create or update custom recommendation over security connector scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void createOrUpdateCustomRecommendationOverSecurityConnectorScope( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.customRecommendations() + .define("33e7cc6e-a139-4723-a0e5-76993aee0771") + .withExistingScope( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector") + .withQuery( + "RawEntityMetadata | where Environment == 'GCP' and Identifiers.Type == 'compute.firewalls' | extend IslogConfigEnabled = tobool(Record.logConfig.enable) | extend HealthStatus = iff(IslogConfigEnabled, 'HEALTHY', 'UNHEALTHY')") + .withCloudProviders(Arrays.asList(RecommendationSupportedClouds.AWS)) + .withSeverity(SeverityEnum.MEDIUM) + .withSecurityIssue(SecurityIssue.VULNERABILITY) + .withDisplayName("Password Policy") + .withDescription("organization passwords policy") + .withRemediationDescription("Change password policy to...") + .create(); + } + + /* + * x-ms-original-file: 2024-08-01/CustomRecommendations/PutBySubscriptionCustomRecommendation_example.json + */ + /** + * Sample code: Create or update custom recommendation over subscription scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void createOrUpdateCustomRecommendationOverSubscriptionScope( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.customRecommendations() + .define("33e7cc6e-a139-4723-a0e5-76993aee0771") + .withExistingScope("subscriptions/e5d1b86c-3051-44d5-8802-aa65d45a279b") + .withQuery( + "RawEntityMetadata | where Environment == 'GCP' and Identifiers.Type == 'compute.firewalls' | extend IslogConfigEnabled = tobool(Record.logConfig.enable) | extend HealthStatus = iff(IslogConfigEnabled, 'HEALTHY', 'UNHEALTHY')") + .withCloudProviders(Arrays.asList(RecommendationSupportedClouds.AWS)) + .withSeverity(SeverityEnum.MEDIUM) + .withSecurityIssue(SecurityIssue.VULNERABILITY) + .withDisplayName("Password Policy") + .withDescription("organization passwords policy") + .withRemediationDescription("Change password policy to...") + .create(); + } + + /* + * x-ms-original-file: 2024-08-01/CustomRecommendations/PutByManagementGroupCustomRecommendation_example.json + */ + /** + * Sample code: Create or update custom recommendation over management group scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void createOrUpdateCustomRecommendationOverManagementGroupScope( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.customRecommendations() + .define("33e7cc6e-a139-4723-a0e5-76993aee0771") + .withExistingScope("providers/Microsoft.Management/managementGroups/contoso") + .withQuery( + "RawEntityMetadata | where Environment == 'GCP' and Identifiers.Type == 'compute.firewalls' | extend IslogConfigEnabled = tobool(Record.logConfig.enable) | extend HealthStatus = iff(IslogConfigEnabled, 'HEALTHY', 'UNHEALTHY')") + .withCloudProviders(Arrays.asList(RecommendationSupportedClouds.AWS)) + .withSeverity(SeverityEnum.MEDIUM) + .withSecurityIssue(SecurityIssue.VULNERABILITY) + .withDisplayName("Password Policy") + .withDescription("organization passwords policy") + .withRemediationDescription("Change password policy to...") + .create(); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomRecommendationsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomRecommendationsDeleteSamples.java new file mode 100644 index 000000000000..f940a1ee618c --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomRecommendationsDeleteSamples.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for CustomRecommendations Delete. + */ +public final class CustomRecommendationsDeleteSamples { + /* + * x-ms-original-file: 2024-08-01/CustomRecommendations/DeleteBySecurityConnectorCustomRecommendation_example.json + */ + /** + * Sample code: Delete a custom recommendation over security connector scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteACustomRecommendationOverSecurityConnectorScope( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.customRecommendations() + .deleteByResourceGroupWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2024-08-01/CustomRecommendations/DeleteBySubscriptionCustomRecommendation_example.json + */ + /** + * Sample code: Delete a custom recommendation over subscription scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void + deleteACustomRecommendationOverSubscriptionScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.customRecommendations() + .deleteByResourceGroupWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", + "1f3afdf9-d0c9-4c3d-847f-89da613e70a8", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2024-08-01/CustomRecommendations/DeleteByManagementGroupCustomRecommendation_example.json + */ + /** + * Sample code: Delete a custom recommendation over management group scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteACustomRecommendationOverManagementGroupScope( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.customRecommendations() + .deleteByResourceGroupWithResponse("providers/Microsoft.Management/managementGroups/contoso", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomRecommendationsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomRecommendationsGetSamples.java new file mode 100644 index 000000000000..b44bb2918665 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomRecommendationsGetSamples.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for CustomRecommendations Get. + */ +public final class CustomRecommendationsGetSamples { + /* + * x-ms-original-file: 2024-08-01/CustomRecommendations/GetByManagementGroupCustomRecommendation_example.json + */ + /** + * Sample code: Get a custom recommendation over management group scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void + getACustomRecommendationOverManagementGroupScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.customRecommendations() + .getWithResponse("providers/Microsoft.Management/managementGroups/contoso", + "1f3afdf9-d0c9-4c3d-847f-89da613e70a8", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2024-08-01/CustomRecommendations/GetBySecurityConnectorCustomRecommendation_example.json + */ + /** + * Sample code: Get a custom recommendation over security connector scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void + getACustomRecommendationOverSecurityConnectorScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.customRecommendations() + .getWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", + "1f3afdf9-d0c9-4c3d-847f-89da613e70a8", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2024-08-01/CustomRecommendations/GetBySubscriptionCustomRecommendation_example.json + */ + /** + * Sample code: Get a custom recommendation over subscription scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void + getACustomRecommendationOverSubscriptionScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.customRecommendations() + .getWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", + "1f3afdf9-d0c9-4c3d-847f-89da613e70a8", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomRecommendationsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomRecommendationsListSamples.java new file mode 100644 index 000000000000..99e1b5f0d470 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomRecommendationsListSamples.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for CustomRecommendations List. + */ +public final class CustomRecommendationsListSamples { + /* + * x-ms-original-file: 2024-08-01/CustomRecommendations/ListByManagementGroupCustomRecommendations_example.json + */ + /** + * Sample code: List custom recommendations by management group scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void + listCustomRecommendationsByManagementGroupScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.customRecommendations() + .list("providers/Microsoft.Management/managementGroups/contoso", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2024-08-01/CustomRecommendations/ListBySubscriptionCustomRecommendations_example.json + */ + /** + * Sample code: List custom recommendations by subscription scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void + listCustomRecommendationsBySubscriptionScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.customRecommendations() + .list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2024-08-01/CustomRecommendations/ListBySecurityConnectorCustomRecommendations_example.json + */ + /** + * Sample code: List custom recommendations by security connector scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void + listCustomRecommendationsBySecurityConnectorScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.customRecommendations() + .list( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DefenderForStorageCancelMalwareScanSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DefenderForStorageCancelMalwareScanSamples.java new file mode 100644 index 000000000000..03311051de25 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DefenderForStorageCancelMalwareScanSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.SettingName; + +/** + * Samples for DefenderForStorage CancelMalwareScan. + */ +public final class DefenderForStorageCancelMalwareScanSamples { + /* + * x-ms-original-file: 2025-09-01-preview/DefenderForStorage/CancelMalwareScan_example.json + */ + /** + * Sample code: Cancel a Defender for Storage malware scan for the specified storage resource. + * + * @param manager Entry point to SecurityManager. + */ + public static void cancelADefenderForStorageMalwareScanForTheSpecifiedStorageResource( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.defenderForStorages() + .cancelMalwareScanWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount", + SettingName.CURRENT, "latest", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DefenderForStorageCreateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DefenderForStorageCreateSamples.java new file mode 100644 index 000000000000..ef1421ec6fe0 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DefenderForStorageCreateSamples.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.AutomatedResponseType; +import com.azure.resourcemanager.security.models.BlobScanResultsOptions; +import com.azure.resourcemanager.security.models.DefenderForStorageSettingProperties; +import com.azure.resourcemanager.security.models.MalwareScanningProperties; +import com.azure.resourcemanager.security.models.OnUploadFilters; +import com.azure.resourcemanager.security.models.OnUploadProperties; +import com.azure.resourcemanager.security.models.SensitiveDataDiscoveryProperties; +import com.azure.resourcemanager.security.models.SettingName; +import java.util.Arrays; + +/** + * Samples for DefenderForStorage Create. + */ +public final class DefenderForStorageCreateSamples { + /* + * x-ms-original-file: 2025-09-01-preview/DefenderForStorage/PutDefenderForStorageSettings_example.json + */ + /** + * Sample code: Creates or updates the Defender for Storage settings on a specified resource. + * + * @param manager Entry point to SecurityManager. + */ + public static void createsOrUpdatesTheDefenderForStorageSettingsOnASpecifiedResource( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.defenderForStorages() + .define(SettingName.CURRENT) + .withExistingResourceId( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount") + .withProperties( + new DefenderForStorageSettingProperties().withIsEnabled(true) + .withMalwareScanning(new MalwareScanningProperties() + .withOnUpload(new OnUploadProperties().withIsEnabled(true) + .withCapGBPerMonth(10000) + .withFilters( + new OnUploadFilters() + .withExcludeBlobsWithPrefix(Arrays.asList("unscanned-container", + "sample-container/logs")) + .withExcludeBlobsWithSuffix(Arrays.asList(".log", ".jpg")) + .withExcludeBlobsLargerThan(1024))) + .withScanResultsEventGridTopicResourceId( + "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.EventGrid/topics/sampletopic") + .withBlobScanResultsOptions(BlobScanResultsOptions.BLOB_INDEX_TAGS) + .withAutomatedResponse(AutomatedResponseType.BLOB_SOFT_DELETE)) + .withSensitiveDataDiscovery(new SensitiveDataDiscoveryProperties().withIsEnabled(true)) + .withOverrideSubscriptionLevelSettings(true)) + .create(); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DefenderForStorageGetMalwareScanSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DefenderForStorageGetMalwareScanSamples.java new file mode 100644 index 000000000000..b7995353af73 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DefenderForStorageGetMalwareScanSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.SettingName; + +/** + * Samples for DefenderForStorage GetMalwareScan. + */ +public final class DefenderForStorageGetMalwareScanSamples { + /* + * x-ms-original-file: 2025-09-01-preview/DefenderForStorage/GetMalwareScan_example.json + */ + /** + * Sample code: Gets the Defender for Storage malware scan for the specified storage resource. + * + * @param manager Entry point to SecurityManager. + */ + public static void getsTheDefenderForStorageMalwareScanForTheSpecifiedStorageResource( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.defenderForStorages() + .getMalwareScanWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount", + SettingName.CURRENT, "latest", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DefenderForStorageGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DefenderForStorageGetSamples.java new file mode 100644 index 000000000000..3207b82ec7d7 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DefenderForStorageGetSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.SettingName; + +/** + * Samples for DefenderForStorage Get. + */ +public final class DefenderForStorageGetSamples { + /* + * x-ms-original-file: 2025-09-01-preview/DefenderForStorage/GetDefenderForStorageSettings_example.json + */ + /** + * Sample code: Gets the Defender for Storage settings for the specified resource. + * + * @param manager Entry point to SecurityManager. + */ + public static void getsTheDefenderForStorageSettingsForTheSpecifiedResource( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.defenderForStorages() + .getWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount", + SettingName.CURRENT, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DefenderForStorageListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DefenderForStorageListSamples.java new file mode 100644 index 000000000000..8bc76594da14 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DefenderForStorageListSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for DefenderForStorage List. + */ +public final class DefenderForStorageListSamples { + /* + * x-ms-original-file: 2025-09-01-preview/DefenderForStorage/ListDefenderForStorageSettings_example.json + */ + /** + * Sample code: Lists the Defender for Storage settings for the specified storage account. + * + * @param manager Entry point to SecurityManager. + */ + public static void listsTheDefenderForStorageSettingsForTheSpecifiedStorageAccount( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.defenderForStorages() + .list( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DefenderForStorageStartMalwareScanSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DefenderForStorageStartMalwareScanSamples.java new file mode 100644 index 000000000000..7ddc41ce3a88 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DefenderForStorageStartMalwareScanSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.SettingName; + +/** + * Samples for DefenderForStorage StartMalwareScan. + */ +public final class DefenderForStorageStartMalwareScanSamples { + /* + * x-ms-original-file: 2025-09-01-preview/DefenderForStorage/StartMalwareScan_example.json + */ + /** + * Sample code: Initiate a Defender for Storage malware scan for the specified storage account. + * + * @param manager Entry point to SecurityManager. + */ + public static void initiateADefenderForStorageMalwareScanForTheSpecifiedStorageAccount( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.defenderForStorages() + .startMalwareScanWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount", + SettingName.CURRENT, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DevOpsConfigurationsCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DevOpsConfigurationsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..2862028c9458 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DevOpsConfigurationsCreateOrUpdateSamples.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.fluent.models.DevOpsConfigurationInner; +import com.azure.resourcemanager.security.models.AgentlessConfiguration; +import com.azure.resourcemanager.security.models.AgentlessEnablement; +import com.azure.resourcemanager.security.models.Authorization; +import com.azure.resourcemanager.security.models.AutoDiscovery; +import com.azure.resourcemanager.security.models.DevOpsConfigurationProperties; +import com.azure.resourcemanager.security.models.InventoryKind; +import com.azure.resourcemanager.security.models.InventoryList; +import com.azure.resourcemanager.security.models.InventoryListKind; +import java.util.Arrays; + +/** + * Samples for DevOpsConfigurations CreateOrUpdate. + */ +public final class DevOpsConfigurationsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * 2025-11-01-preview/SecurityConnectorsDevOps/CreateOrUpdateDevOpsConfigurationsOnboardCurrentAndFuture_example. + * json + */ + /** + * Sample code: CreateOrUpdate_DevOpsConfigurations_OnboardCurrentAndFuture. + * + * @param manager Entry point to SecurityManager. + */ + public static void createOrUpdateDevOpsConfigurationsOnboardCurrentAndFuture( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.devOpsConfigurations() + .createOrUpdate("myRg", "mySecurityConnectorName", + new DevOpsConfigurationInner().withProperties(new DevOpsConfigurationProperties() + .withAuthorization(new Authorization().withCode("fakeTokenPlaceholder")) + .withAutoDiscovery(AutoDiscovery.ENABLED)), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2025-11-01-preview/SecurityConnectorsDevOps/CreateOrUpdateDevOpsConfigurationsWithAgentlessConfigurations_example + * .json + */ + /** + * Sample code: CreateOrUpdate_DevOpsConfigurations_WithAgentlessConfigurations. + * + * @param manager Entry point to SecurityManager. + */ + public static void createOrUpdateDevOpsConfigurationsWithAgentlessConfigurations( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.devOpsConfigurations() + .createOrUpdate("myRg", "mySecurityConnectorName", + new DevOpsConfigurationInner().withProperties(new DevOpsConfigurationProperties() + .withAuthorization(new Authorization().withCode("fakeTokenPlaceholder")) + .withAutoDiscovery(AutoDiscovery.ENABLED) + .withAgentlessConfiguration( + new AgentlessConfiguration().withAgentlessEnabled(AgentlessEnablement.ENABLED) + .withAgentlessAutoDiscovery(AutoDiscovery.DISABLED) + .withScanners(Arrays.asList("scanner1", "scanner2")) + .withInventoryListType(InventoryListKind.INCLUSION) + .withInventoryList(Arrays + .asList(new InventoryList().withInventoryKind(InventoryKind.AZURE_DEV_OPS_ORGANIZATION) + .withValue("org1"))))), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2025-11-01-preview/SecurityConnectorsDevOps/CreateOrUpdateDevOpsConfigurationsOnboardCurrentOnly_example.json + */ + /** + * Sample code: CreateOrUpdate_DevOpsConfigurations_OnboardCurrentOnly. + * + * @param manager Entry point to SecurityManager. + */ + public static void createOrUpdateDevOpsConfigurationsOnboardCurrentOnly( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.devOpsConfigurations() + .createOrUpdate("myRg", "mySecurityConnectorName", + new DevOpsConfigurationInner().withProperties(new DevOpsConfigurationProperties() + .withAuthorization(new Authorization().withCode("fakeTokenPlaceholder")) + .withAutoDiscovery(AutoDiscovery.DISABLED)), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2025-11-01-preview/SecurityConnectorsDevOps/CreateOrUpdateDevOpsConfigurationsOnboardSelected_example.json + */ + /** + * Sample code: CreateOrUpdate_DevOpsConfigurations_OnboardSelected. + * + * @param manager Entry point to SecurityManager. + */ + public static void + createOrUpdateDevOpsConfigurationsOnboardSelected(com.azure.resourcemanager.security.SecurityManager manager) { + manager.devOpsConfigurations() + .createOrUpdate("myRg", "mySecurityConnectorName", + new DevOpsConfigurationInner().withProperties(new DevOpsConfigurationProperties() + .withAuthorization(new Authorization().withCode("fakeTokenPlaceholder")) + .withAutoDiscovery(AutoDiscovery.DISABLED) + .withTopLevelInventoryList(Arrays.asList("org1", "org2"))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DevOpsConfigurationsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DevOpsConfigurationsDeleteSamples.java new file mode 100644 index 000000000000..6fe29582fe42 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DevOpsConfigurationsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for DevOpsConfigurations Delete. + */ +public final class DevOpsConfigurationsDeleteSamples { + /* + * x-ms-original-file: 2025-11-01-preview/SecurityConnectorsDevOps/DeleteDevOpsConfigurations_example.json + */ + /** + * Sample code: Delete_DevOpsConfigurations. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteDevOpsConfigurations(com.azure.resourcemanager.security.SecurityManager manager) { + manager.devOpsConfigurations().delete("myRg", "mySecurityConnectorName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DevOpsConfigurationsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DevOpsConfigurationsGetSamples.java new file mode 100644 index 000000000000..6bd4158fe4ca --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DevOpsConfigurationsGetSamples.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for DevOpsConfigurations Get. + */ +public final class DevOpsConfigurationsGetSamples { + /* + * x-ms-original-file: + * 2025-11-01-preview/SecurityConnectorsDevOps/GetDevOpsConfigurationsWithAgentlessConfigurations_example.json + */ + /** + * Sample code: Get_DevOpsConfigurations_WithAgentlessConfigurations. + * + * @param manager Entry point to SecurityManager. + */ + public static void + getDevOpsConfigurationsWithAgentlessConfigurations(com.azure.resourcemanager.security.SecurityManager manager) { + manager.devOpsConfigurations() + .getWithResponse("myRg", "mySecurityConnectorName", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2025-11-01-preview/SecurityConnectorsDevOps/GetDevOpsConfigurationsWithCapabilities_example.json + */ + /** + * Sample code: Get_DevOpsConfigurations_WithCapabilities. + * + * @param manager Entry point to SecurityManager. + */ + public static void + getDevOpsConfigurationsWithCapabilities(com.azure.resourcemanager.security.SecurityManager manager) { + manager.devOpsConfigurations() + .getWithResponse("myRg", "mySecurityConnectorName", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-11-01-preview/SecurityConnectorsDevOps/GetDevOpsConfigurations_example.json + */ + /** + * Sample code: Get_DevOpsConfigurations. + * + * @param manager Entry point to SecurityManager. + */ + public static void getDevOpsConfigurations(com.azure.resourcemanager.security.SecurityManager manager) { + manager.devOpsConfigurations() + .getWithResponse("myRg", "mySecurityConnectorName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DevOpsConfigurationsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DevOpsConfigurationsListSamples.java new file mode 100644 index 000000000000..93cdcdab4be7 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DevOpsConfigurationsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for DevOpsConfigurations List. + */ +public final class DevOpsConfigurationsListSamples { + /* + * x-ms-original-file: 2025-11-01-preview/SecurityConnectorsDevOps/ListDevOpsConfigurations_example.json + */ + /** + * Sample code: List_DevOpsConfigurations. + * + * @param manager Entry point to SecurityManager. + */ + public static void listDevOpsConfigurations(com.azure.resourcemanager.security.SecurityManager manager) { + manager.devOpsConfigurations().list("myRg", "mySecurityConnectorName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DevOpsConfigurationsUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DevOpsConfigurationsUpdateSamples.java new file mode 100644 index 000000000000..8c7f4f468aae --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DevOpsConfigurationsUpdateSamples.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.fluent.models.DevOpsConfigurationInner; +import com.azure.resourcemanager.security.models.AgentlessConfiguration; +import com.azure.resourcemanager.security.models.AgentlessEnablement; +import com.azure.resourcemanager.security.models.AutoDiscovery; +import com.azure.resourcemanager.security.models.DevOpsConfigurationProperties; +import com.azure.resourcemanager.security.models.InventoryKind; +import com.azure.resourcemanager.security.models.InventoryList; +import com.azure.resourcemanager.security.models.InventoryListKind; +import java.util.Arrays; + +/** + * Samples for DevOpsConfigurations Update. + */ +public final class DevOpsConfigurationsUpdateSamples { + /* + * x-ms-original-file: 2025-11-01-preview/SecurityConnectorsDevOps/UpdateDevOpsConfigurations_example.json + */ + /** + * Sample code: Update_DevOpsConfigurations. + * + * @param manager Entry point to SecurityManager. + */ + public static void updateDevOpsConfigurations(com.azure.resourcemanager.security.SecurityManager manager) { + manager.devOpsConfigurations() + .update("myRg", "mySecurityConnectorName", + new DevOpsConfigurationInner() + .withProperties(new DevOpsConfigurationProperties().withAutoDiscovery(AutoDiscovery.ENABLED) + .withAgentlessConfiguration( + new AgentlessConfiguration().withAgentlessEnabled(AgentlessEnablement.ENABLED) + .withAgentlessAutoDiscovery(AutoDiscovery.DISABLED) + .withScanners(Arrays.asList("scanner1", "scanner2")) + .withInventoryListType(InventoryListKind.INCLUSION) + .withInventoryList(Arrays.asList( + new InventoryList().withInventoryKind(InventoryKind.AZURE_DEV_OPS_ORGANIZATION) + .withValue("org1"))))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DevOpsOperationResultsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DevOpsOperationResultsGetSamples.java new file mode 100644 index 000000000000..5182d0a80919 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DevOpsOperationResultsGetSamples.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for DevOpsOperationResults Get. + */ +public final class DevOpsOperationResultsGetSamples { + /* + * x-ms-original-file: 2025-11-01-preview/SecurityConnectorsDevOps/GetDevOpsOperationResultsFailed_example.json + */ + /** + * Sample code: Get_DevOpsOperationResults_Failed. + * + * @param manager Entry point to SecurityManager. + */ + public static void getDevOpsOperationResultsFailed(com.azure.resourcemanager.security.SecurityManager manager) { + manager.devOpsOperationResults() + .getWithResponse("myRg", "mySecurityConnectorName", "8d4caace-e7b3-4b3e-af99-73f76829ebcf", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2025-11-01-preview/SecurityConnectorsDevOps/GetDevOpsOperationResultsSucceeded_example.json + */ + /** + * Sample code: Get_DevOpsOperationResults_Succeeded. + * + * @param manager Entry point to SecurityManager. + */ + public static void getDevOpsOperationResultsSucceeded(com.azure.resourcemanager.security.SecurityManager manager) { + manager.devOpsOperationResults() + .getWithResponse("myRg", "mySecurityConnectorName", "4e826cf1-5c36-4808-a7d2-fb4f5170978b", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..d7d17d778b4b --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsCreateOrUpdateSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.TimeWindowCustomAlertRule; +import java.time.Duration; +import java.util.Arrays; + +/** + * Samples for DeviceSecurityGroups CreateOrUpdate. + */ +public final class DeviceSecurityGroupsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2019-08-01/DeviceSecurityGroups/PutDeviceSecurityGroups_example.json + */ + /** + * Sample code: Create or update a device security group for the specified IoT hub resource. + * + * @param manager Entry point to SecurityManager. + */ + public static void createOrUpdateADeviceSecurityGroupForTheSpecifiedIoTHubResource( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.deviceSecurityGroups() + .define("samplesecuritygroup") + .withExistingResourceId( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub") + .withTimeWindowRules(Arrays.asList(new TimeWindowCustomAlertRule().withIsEnabled(true) + .withMinThreshold(0) + .withMaxThreshold(30) + .withTimeWindowSize(Duration.parse("PT05M")))) + .create(); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsDeleteSamples.java new file mode 100644 index 000000000000..322db3e59a70 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsDeleteSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for DeviceSecurityGroups Delete. + */ +public final class DeviceSecurityGroupsDeleteSamples { + /* + * x-ms-original-file: 2019-08-01/DeviceSecurityGroups/DeleteDeviceSecurityGroups_example.json + */ + /** + * Sample code: Delete a device security group for the specified IoT Hub resource. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteADeviceSecurityGroupForTheSpecifiedIoTHubResource( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.deviceSecurityGroups() + .deleteByResourceGroupWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub", + "samplesecuritygroup", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsGetSamples.java new file mode 100644 index 000000000000..64e98786c919 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for DeviceSecurityGroups Get. + */ +public final class DeviceSecurityGroupsGetSamples { + /* + * x-ms-original-file: 2019-08-01/DeviceSecurityGroups/GetDeviceSecurityGroups_example.json + */ + /** + * Sample code: Get a device security group for the specified IoT Hub resource. + * + * @param manager Entry point to SecurityManager. + */ + public static void getADeviceSecurityGroupForTheSpecifiedIoTHubResource( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.deviceSecurityGroups() + .getWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub", + "samplesecuritygroup", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsListSamples.java new file mode 100644 index 000000000000..dc1d2f14edae --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsListSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for DeviceSecurityGroups List. + */ +public final class DeviceSecurityGroupsListSamples { + /* + * x-ms-original-file: 2019-08-01/DeviceSecurityGroups/ListDeviceSecurityGroups_example.json + */ + /** + * Sample code: List all device security groups for the specified IoT Hub resource. + * + * @param manager Entry point to SecurityManager. + */ + public static void listAllDeviceSecurityGroupsForTheSpecifiedIoTHubResource( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.deviceSecurityGroups() + .list( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsGetSamples.java new file mode 100644 index 000000000000..a3b9216098ff --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for DiscoveredSecuritySolutions Get. + */ +public final class DiscoveredSecuritySolutionsGetSamples { + /* + * x-ms-original-file: + * 2020-01-01/DiscoveredSecuritySolutions/GetDiscoveredSecuritySolutionResourceGroupLocation_example.json + */ + /** + * Sample code: Get discovered security solution from a security data location. + * + * @param manager Entry point to SecurityManager. + */ + public static void getDiscoveredSecuritySolutionFromASecurityDataLocation( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.discoveredSecuritySolutions() + .getWithResponse("myRg2", "centralus", "paloalto7", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsListByHomeRegionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsListByHomeRegionSamples.java new file mode 100644 index 000000000000..0092da2eef31 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsListByHomeRegionSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for DiscoveredSecuritySolutions ListByHomeRegion. + */ +public final class DiscoveredSecuritySolutionsListByHomeRegionSamples { + /* + * x-ms-original-file: + * 2020-01-01/DiscoveredSecuritySolutions/GetDiscoveredSecuritySolutionsSubscriptionLocation_example.json + */ + /** + * Sample code: Get discovered security solutions from a security data location. + * + * @param manager Entry point to SecurityManager. + */ + public static void getDiscoveredSecuritySolutionsFromASecurityDataLocation( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.discoveredSecuritySolutions().listByHomeRegion("centralus", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsListSamples.java new file mode 100644 index 000000000000..cfabb891f8fd --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for DiscoveredSecuritySolutions List. + */ +public final class DiscoveredSecuritySolutionsListSamples { + /* + * x-ms-original-file: + * 2020-01-01/DiscoveredSecuritySolutions/GetDiscoveredSecuritySolutionsSubscription_example.json + */ + /** + * Sample code: Get discovered security solutions. + * + * @param manager Entry point to SecurityManager. + */ + public static void getDiscoveredSecuritySolutions(com.azure.resourcemanager.security.SecurityManager manager) { + manager.discoveredSecuritySolutions().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsGetSamples.java new file mode 100644 index 000000000000..884ca7fa7b15 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for ExternalSecuritySolutions Get. + */ +public final class ExternalSecuritySolutionsGetSamples { + /* + * x-ms-original-file: 2020-01-01/ExternalSecuritySolutions/GetExternalSecuritySolution_example.json + */ + /** + * Sample code: Get external security solution. + * + * @param manager Entry point to SecurityManager. + */ + public static void getExternalSecuritySolution(com.azure.resourcemanager.security.SecurityManager manager) { + manager.externalSecuritySolutions() + .getWithResponse("defaultresourcegroup-eus", "centralus", + "aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-eus", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsListByHomeRegionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsListByHomeRegionSamples.java new file mode 100644 index 000000000000..c73c507b5157 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsListByHomeRegionSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for ExternalSecuritySolutions ListByHomeRegion. + */ +public final class ExternalSecuritySolutionsListByHomeRegionSamples { + /* + * x-ms-original-file: + * 2020-01-01/ExternalSecuritySolutions/GetExternalSecuritySolutionsSubscriptionLocation_example.json + */ + /** + * Sample code: Get external security solutions on a subscription from security data location. + * + * @param manager Entry point to SecurityManager. + */ + public static void getExternalSecuritySolutionsOnASubscriptionFromSecurityDataLocation( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.externalSecuritySolutions().listByHomeRegion("centralus", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsListSamples.java new file mode 100644 index 000000000000..778d314e4f61 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for ExternalSecuritySolutions List. + */ +public final class ExternalSecuritySolutionsListSamples { + /* + * x-ms-original-file: 2020-01-01/ExternalSecuritySolutions/GetExternalSecuritySolutionsSubscription_example.json + */ + /** + * Sample code: Get external security solutions on a subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void + getExternalSecuritySolutionsOnASubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.externalSecuritySolutions().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitHubIssuesCreateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitHubIssuesCreateSamples.java new file mode 100644 index 000000000000..b62ad8a134c4 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitHubIssuesCreateSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.IssueCreationRequest; + +/** + * Samples for GitHubIssues Create. + */ +public final class GitHubIssuesCreateSamples { + /* + * x-ms-original-file: 2025-11-01-preview/SecurityConnectorsDevOps/CreateGitHubIssues_example.json + */ + /** + * Sample code: Create_GitHubIssues. + * + * @param manager Entry point to SecurityManager. + */ + public static void createGitHubIssues(com.azure.resourcemanager.security.SecurityManager manager) { + manager.gitHubIssues() + .create("myRg", "mySecurityConnectorName", "myGitHubOwner", "myGitHubRepo", + new IssueCreationRequest().withSecurityAssessmentResourceId( + "/subscriptions/0806e1cd-cfda-4ff8-b99c-2b0af42cffd3/resourceGroups/myRg/providers/Microsoft.Security/assessments/assessment-12345"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitHubOwnersGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitHubOwnersGetSamples.java new file mode 100644 index 000000000000..46ed74c8408f --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitHubOwnersGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for GitHubOwners Get. + */ +public final class GitHubOwnersGetSamples { + /* + * x-ms-original-file: 2025-11-01-preview/SecurityConnectorsDevOps/GetGitHubOwners_example.json + */ + /** + * Sample code: Get_GitHubOwners. + * + * @param manager Entry point to SecurityManager. + */ + public static void getGitHubOwners(com.azure.resourcemanager.security.SecurityManager manager) { + manager.gitHubOwners() + .getWithResponse("myRg", "mySecurityConnectorName", "myGitHubOwner", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitHubOwnersListAvailableSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitHubOwnersListAvailableSamples.java new file mode 100644 index 000000000000..a589a871b77b --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitHubOwnersListAvailableSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for GitHubOwners ListAvailable. + */ +public final class GitHubOwnersListAvailableSamples { + /* + * x-ms-original-file: 2025-11-01-preview/SecurityConnectorsDevOps/ListAvailableGitHubOwners_example.json + */ + /** + * Sample code: ListAvailable_GitHubOwners. + * + * @param manager Entry point to SecurityManager. + */ + public static void listAvailableGitHubOwners(com.azure.resourcemanager.security.SecurityManager manager) { + manager.gitHubOwners() + .listAvailableWithResponse("myRg", "mySecurityConnectorName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitHubOwnersListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitHubOwnersListSamples.java new file mode 100644 index 000000000000..564abbdb83b7 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitHubOwnersListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for GitHubOwners List. + */ +public final class GitHubOwnersListSamples { + /* + * x-ms-original-file: 2025-11-01-preview/SecurityConnectorsDevOps/ListGitHubOwners_example.json + */ + /** + * Sample code: List_GitHubOwners. + * + * @param manager Entry point to SecurityManager. + */ + public static void listGitHubOwners(com.azure.resourcemanager.security.SecurityManager manager) { + manager.gitHubOwners().list("myRg", "mySecurityConnectorName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitHubReposGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitHubReposGetSamples.java new file mode 100644 index 000000000000..9a9dc6927b91 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitHubReposGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for GitHubRepos Get. + */ +public final class GitHubReposGetSamples { + /* + * x-ms-original-file: 2025-11-01-preview/SecurityConnectorsDevOps/GetGitHubRepos_example.json + */ + /** + * Sample code: Get_GitHubRepos. + * + * @param manager Entry point to SecurityManager. + */ + public static void getGitHubRepos(com.azure.resourcemanager.security.SecurityManager manager) { + manager.gitHubRepos() + .getWithResponse("myRg", "mySecurityConnectorName", "myGitHubOwner", "myGitHubRepo", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitHubReposListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitHubReposListSamples.java new file mode 100644 index 000000000000..a0326be4f995 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitHubReposListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for GitHubRepos List. + */ +public final class GitHubReposListSamples { + /* + * x-ms-original-file: 2025-11-01-preview/SecurityConnectorsDevOps/ListGitHubRepos_example.json + */ + /** + * Sample code: List_GitHubRepos. + * + * @param manager Entry point to SecurityManager. + */ + public static void listGitHubRepos(com.azure.resourcemanager.security.SecurityManager manager) { + manager.gitHubRepos() + .list("myRg", "mySecurityConnectorName", "myGitHubOwner", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitLabGroupsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitLabGroupsGetSamples.java new file mode 100644 index 000000000000..d98629983b3d --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitLabGroupsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for GitLabGroups Get. + */ +public final class GitLabGroupsGetSamples { + /* + * x-ms-original-file: 2025-11-01-preview/SecurityConnectorsDevOps/GetGitLabGroups_example.json + */ + /** + * Sample code: Get_GitLabGroups. + * + * @param manager Entry point to SecurityManager. + */ + public static void getGitLabGroups(com.azure.resourcemanager.security.SecurityManager manager) { + manager.gitLabGroups() + .getWithResponse("myRg", "mySecurityConnectorName", "myGitLabGroup$mySubGroup", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitLabGroupsListAvailableSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitLabGroupsListAvailableSamples.java new file mode 100644 index 000000000000..84fe3bcf3efc --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitLabGroupsListAvailableSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for GitLabGroups ListAvailable. + */ +public final class GitLabGroupsListAvailableSamples { + /* + * x-ms-original-file: 2025-11-01-preview/SecurityConnectorsDevOps/ListAvailableGitLabGroups_example.json + */ + /** + * Sample code: ListAvailable_GitLabGroups. + * + * @param manager Entry point to SecurityManager. + */ + public static void listAvailableGitLabGroups(com.azure.resourcemanager.security.SecurityManager manager) { + manager.gitLabGroups() + .listAvailableWithResponse("myRg", "mySecurityConnectorName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitLabGroupsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitLabGroupsListSamples.java new file mode 100644 index 000000000000..d9df2f4eea67 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitLabGroupsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for GitLabGroups List. + */ +public final class GitLabGroupsListSamples { + /* + * x-ms-original-file: 2025-11-01-preview/SecurityConnectorsDevOps/ListGitLabGroups_example.json + */ + /** + * Sample code: List_GitLabGroups. + * + * @param manager Entry point to SecurityManager. + */ + public static void listGitLabGroups(com.azure.resourcemanager.security.SecurityManager manager) { + manager.gitLabGroups().list("myRg", "mySecurityConnectorName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitLabProjectsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitLabProjectsGetSamples.java new file mode 100644 index 000000000000..fecf721e1241 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitLabProjectsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for GitLabProjects Get. + */ +public final class GitLabProjectsGetSamples { + /* + * x-ms-original-file: 2025-11-01-preview/SecurityConnectorsDevOps/GetGitLabProjects_example.json + */ + /** + * Sample code: Get_GitLabProjects. + * + * @param manager Entry point to SecurityManager. + */ + public static void getGitLabProjects(com.azure.resourcemanager.security.SecurityManager manager) { + manager.gitLabProjects() + .getWithResponse("myRg", "mySecurityConnectorName", "myGitLabGroup$mySubGroup", "myGitLabProject", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitLabProjectsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitLabProjectsListSamples.java new file mode 100644 index 000000000000..ee9393862030 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitLabProjectsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for GitLabProjects List. + */ +public final class GitLabProjectsListSamples { + /* + * x-ms-original-file: 2025-11-01-preview/SecurityConnectorsDevOps/ListGitLabProjects_example.json + */ + /** + * Sample code: List_GitLabProjects. + * + * @param manager Entry point to SecurityManager. + */ + public static void listGitLabProjects(com.azure.resourcemanager.security.SecurityManager manager) { + manager.gitLabProjects() + .list("myRg", "mySecurityConnectorName", "myGitLabGroup$mySubGroup", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitLabSubgroupsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitLabSubgroupsListSamples.java new file mode 100644 index 000000000000..fb9fa04d35b4 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GitLabSubgroupsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for GitLabSubgroups List. + */ +public final class GitLabSubgroupsListSamples { + /* + * x-ms-original-file: 2025-11-01-preview/SecurityConnectorsDevOps/ListGitLabSubgroups_example.json + */ + /** + * Sample code: List_GitLabSubgroups. + * + * @param manager Entry point to SecurityManager. + */ + public static void listGitLabSubgroups(com.azure.resourcemanager.security.SecurityManager manager) { + manager.gitLabSubgroups() + .listWithResponse("myRg", "mySecurityConnectorName", "myGitLabGroup", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..cf317c747801 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsCreateOrUpdateSamples.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.GovernanceAssignmentAdditionalData; +import com.azure.resourcemanager.security.models.GovernanceEmailNotification; +import com.azure.resourcemanager.security.models.RemediationEta; +import java.time.OffsetDateTime; + +/** + * Samples for GovernanceAssignments CreateOrUpdate. + */ +public final class GovernanceAssignmentsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2022-01-01-preview/GovernanceAssignments/PutGovernanceAssignment_example.json + */ + /** + * Sample code: Create Governance assignment. + * + * @param manager Entry point to SecurityManager. + */ + public static void createGovernanceAssignment(com.azure.resourcemanager.security.SecurityManager manager) { + manager.governanceAssignments() + .define("6634ff9f-127b-4bf2-8e6e-b1737f5e789c") + .withExistingAssessment( + "subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd/resourceGroups/compute_servers/providers/Microsoft.Compute/virtualMachines/win2012", + "6b9421dd-5555-2251-9b3d-2be58e2f82cd") + .withOwner("user@contoso.com") + .withRemediationDueDate(OffsetDateTime.parse("2022-01-07T13:00:00.0000000Z")) + .withRemediationEta(new RemediationEta().withEta(OffsetDateTime.parse("2022-01-08T13:00:00.0000000Z")) + .withJustification("Justification of ETA")) + .withIsGracePeriod(true) + .withGovernanceEmailNotification( + new GovernanceEmailNotification().withDisableManagerEmailNotification(false) + .withDisableOwnerEmailNotification(false)) + .withAdditionalData(new GovernanceAssignmentAdditionalData().withTicketNumber(123123) + .withTicketLink("https://snow.com") + .withTicketStatus("Active")) + .create(); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsDeleteSamples.java new file mode 100644 index 000000000000..64c3b109a0bd --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsDeleteSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for GovernanceAssignments Delete. + */ +public final class GovernanceAssignmentsDeleteSamples { + /* + * x-ms-original-file: 2022-01-01-preview/GovernanceAssignments/DeleteGovernanceAssignment_example.json + */ + /** + * Sample code: Delete security assignment. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteSecurityAssignment(com.azure.resourcemanager.security.SecurityManager manager) { + manager.governanceAssignments() + .deleteWithResponse( + "subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd/resourceGroups/compute_servers/providers/Microsoft.Compute/virtualMachines/win2012", + "6b9421dd-5555-2251-9b3d-2be58e2f82cd", "6634ff9f-127b-4bf2-8e6e-b1737f5e789c", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsGetSamples.java new file mode 100644 index 000000000000..7d21b9808852 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for GovernanceAssignments Get. + */ +public final class GovernanceAssignmentsGetSamples { + /* + * x-ms-original-file: 2022-01-01-preview/GovernanceAssignments/GetGovernanceAssignment_example.json + */ + /** + * Sample code: Get governanceAssignment by specific governanceAssignmentKey. + * + * @param manager Entry point to SecurityManager. + */ + public static void getGovernanceAssignmentBySpecificGovernanceAssignmentKey( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.governanceAssignments() + .getWithResponse( + "subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd/resourceGroups/compute_servers/providers/Microsoft.Compute/virtualMachines/win2012", + "6b9421dd-5555-2251-9b3d-2be58e2f82cd", "6634ff9f-127b-4bf2-8e6e-b1737f5e789c", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsListSamples.java new file mode 100644 index 000000000000..9ddb273f9645 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for GovernanceAssignments List. + */ +public final class GovernanceAssignmentsListSamples { + /* + * x-ms-original-file: 2022-01-01-preview/GovernanceAssignments/ListGovernanceAssignments_example.json + */ + /** + * Sample code: List governance assignments. + * + * @param manager Entry point to SecurityManager. + */ + public static void listGovernanceAssignments(com.azure.resourcemanager.security.SecurityManager manager) { + manager.governanceAssignments() + .list("subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd", "6b9421dd-5555-2251-9b3d-2be58e2f82cd", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..d0d5695f0c3d --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesCreateOrUpdateSamples.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.security.models.GovernanceRuleEmailNotification; +import com.azure.resourcemanager.security.models.GovernanceRuleOwnerSource; +import com.azure.resourcemanager.security.models.GovernanceRuleOwnerSourceType; +import com.azure.resourcemanager.security.models.GovernanceRuleSourceResourceType; +import com.azure.resourcemanager.security.models.GovernanceRuleType; +import java.io.IOException; +import java.util.Arrays; + +/** + * Samples for GovernanceRules CreateOrUpdate. + */ +public final class GovernanceRulesCreateOrUpdateSamples { + /* + * x-ms-original-file: 2022-01-01-preview/GovernanceRules/PutManagementGroupGovernanceRule_example.json + */ + /** + * Sample code: Create or update governance rule over management group scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void createOrUpdateGovernanceRuleOverManagementGroupScope( + com.azure.resourcemanager.security.SecurityManager manager) throws IOException { + manager.governanceRules() + .define("ad9a8e26-29d9-4829-bb30-e597a58cdbb8") + .withExistingScope("providers/Microsoft.Management/managementGroups/contoso") + .withDisplayName("Management group rule") + .withDescription("A rule for a management group") + .withRemediationTimeframe("7.00:00:00") + .withIsGracePeriod(true) + .withRulePriority(200) + .withIsDisabled(false) + .withRuleType(GovernanceRuleType.INTEGRATED) + .withSourceResourceType(GovernanceRuleSourceResourceType.ASSESSMENTS) + .withExcludedScopes(Arrays.asList("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23")) + .withConditionSets(Arrays.asList(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize( + "{\"conditions\":[{\"operator\":\"In\",\"property\":\"$.AssessmentKey\",\"value\":\"[\\\"b1cd27e0-4ecc-4246-939f-49c426d9d72f\\\", \\\"fe83f80b-073d-4ccf-93d9-6797eb870201\\\"]\"}]}", + Object.class, SerializerEncoding.JSON))) + .withOwnerSource(new GovernanceRuleOwnerSource().withType(GovernanceRuleOwnerSourceType.MANUALLY) + .withValue("user@contoso.com")) + .withGovernanceEmailNotification( + new GovernanceRuleEmailNotification().withDisableManagerEmailNotification(true) + .withDisableOwnerEmailNotification(false)) + .create(); + } + + /* + * x-ms-original-file: 2022-01-01-preview/GovernanceRules/PutGovernanceRule_example.json + */ + /** + * Sample code: Create or update governance rule over subscription scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void createOrUpdateGovernanceRuleOverSubscriptionScope( + com.azure.resourcemanager.security.SecurityManager manager) throws IOException { + manager.governanceRules() + .define("ad9a8e26-29d9-4829-bb30-e597a58cdbb8") + .withExistingScope("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23") + .withDisplayName("Admin's rule") + .withDescription("A rule for critical recommendations") + .withRemediationTimeframe("7.00:00:00") + .withIsGracePeriod(true) + .withRulePriority(200) + .withIsDisabled(false) + .withRuleType(GovernanceRuleType.INTEGRATED) + .withSourceResourceType(GovernanceRuleSourceResourceType.ASSESSMENTS) + .withConditionSets(Arrays.asList(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize( + "{\"conditions\":[{\"operator\":\"In\",\"property\":\"$.AssessmentKey\",\"value\":\"[\\\"b1cd27e0-4ecc-4246-939f-49c426d9d72f\\\", \\\"fe83f80b-073d-4ccf-93d9-6797eb870201\\\"]\"}]}", + Object.class, SerializerEncoding.JSON))) + .withOwnerSource(new GovernanceRuleOwnerSource().withType(GovernanceRuleOwnerSourceType.MANUALLY) + .withValue("user@contoso.com")) + .withGovernanceEmailNotification( + new GovernanceRuleEmailNotification().withDisableManagerEmailNotification(false) + .withDisableOwnerEmailNotification(false)) + .create(); + } + + /* + * x-ms-original-file: 2022-01-01-preview/GovernanceRules/PutSecurityConnectorGovernanceRule_example.json + */ + /** + * Sample code: Create or update governance rule over security connector scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void createOrUpdateGovernanceRuleOverSecurityConnectorScope( + com.azure.resourcemanager.security.SecurityManager manager) throws IOException { + manager.governanceRules() + .define("ad9a8e26-29d9-4829-bb30-e597a58cdbb8") + .withExistingScope( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector") + .withDisplayName("GCP Admin's rule") + .withDescription("A rule on critical GCP recommendations") + .withRemediationTimeframe("7.00:00:00") + .withIsGracePeriod(true) + .withRulePriority(200) + .withIsDisabled(false) + .withRuleType(GovernanceRuleType.INTEGRATED) + .withSourceResourceType(GovernanceRuleSourceResourceType.ASSESSMENTS) + .withConditionSets(Arrays.asList(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize( + "{\"conditions\":[{\"operator\":\"In\",\"property\":\"$.AssessmentKey\",\"value\":\"[\\\"b1cd27e0-4ecc-4246-939f-49c426d9d72f\\\", \\\"fe83f80b-073d-4ccf-93d9-6797eb870201\\\"]\"}]}", + Object.class, SerializerEncoding.JSON))) + .withOwnerSource(new GovernanceRuleOwnerSource().withType(GovernanceRuleOwnerSourceType.MANUALLY) + .withValue("user@contoso.com")) + .withGovernanceEmailNotification( + new GovernanceRuleEmailNotification().withDisableManagerEmailNotification(true) + .withDisableOwnerEmailNotification(false)) + .create(); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesDeleteSamples.java new file mode 100644 index 000000000000..42e502ef2c17 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesDeleteSamples.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for GovernanceRules Delete. + */ +public final class GovernanceRulesDeleteSamples { + /* + * x-ms-original-file: 2022-01-01-preview/GovernanceRules/DeleteGovernanceRule_example.json + */ + /** + * Sample code: Delete a Governance rule over subscription scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void + deleteAGovernanceRuleOverSubscriptionScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.governanceRules() + .delete("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2022-01-01-preview/GovernanceRules/DeleteManagementGroupGovernanceRule_example.json + */ + /** + * Sample code: Delete a Governance rule over management group scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void + deleteAGovernanceRuleOverManagementGroupScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.governanceRules() + .delete("providers/Microsoft.Management/managementGroups/contoso", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2022-01-01-preview/GovernanceRules/DeleteSecurityConnectorGovernanceRule_example.json + */ + /** + * Sample code: Delete a Governance rule over security connector scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void + deleteAGovernanceRuleOverSecurityConnectorScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.governanceRules() + .delete( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesExecuteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesExecuteSamples.java new file mode 100644 index 000000000000..6aa34302c98b --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesExecuteSamples.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for GovernanceRules Execute. + */ +public final class GovernanceRulesExecuteSamples { + /* + * x-ms-original-file: 2022-01-01-preview/GovernanceRules/PostSecurityConnectorGovernanceRule_example.json + */ + /** + * Sample code: Execute governance rule over security connector scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void + executeGovernanceRuleOverSecurityConnectorScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.governanceRules() + .execute( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2022-01-01-preview/GovernanceRules/PostGovernanceRule_example.json + */ + /** + * Sample code: Execute Governance rule over subscription scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void + executeGovernanceRuleOverSubscriptionScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.governanceRules() + .execute("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2022-01-01-preview/GovernanceRules/PostManagementGroupGovernanceRule_example.json + */ + /** + * Sample code: Execute governance rule over management group scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void + executeGovernanceRuleOverManagementGroupScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.governanceRules() + .execute("providers/Microsoft.Management/managementGroups/contoso", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", + null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesGetSamples.java new file mode 100644 index 000000000000..be664ebffacd --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesGetSamples.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for GovernanceRules Get. + */ +public final class GovernanceRulesGetSamples { + /* + * x-ms-original-file: 2022-01-01-preview/GovernanceRules/GetManagementGroupGovernanceRule_example.json + */ + /** + * Sample code: Get a governance rule over management group scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void + getAGovernanceRuleOverManagementGroupScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.governanceRules() + .getWithResponse("providers/Microsoft.Management/managementGroups/contoso", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2022-01-01-preview/GovernanceRules/GetGovernanceRule_example.json + */ + /** + * Sample code: Get a governance rule over subscription scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void + getAGovernanceRuleOverSubscriptionScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.governanceRules() + .getWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2022-01-01-preview/GovernanceRules/GetSecurityConnectorGovernanceRule_example.json + */ + /** + * Sample code: Get a governance rule over security connector scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void + getAGovernanceRuleOverSecurityConnectorScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.governanceRules() + .getWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesListSamples.java new file mode 100644 index 000000000000..6dd60796e8e6 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesListSamples.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for GovernanceRules List. + */ +public final class GovernanceRulesListSamples { + /* + * x-ms-original-file: 2022-01-01-preview/GovernanceRules/ListBySubscriptionGovernanceRules_example.json + */ + /** + * Sample code: List governance rules by subscription scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void + listGovernanceRulesBySubscriptionScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.governanceRules() + .list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2022-01-01-preview/GovernanceRules/ListBySecurityConnectorGovernanceRules_example.json + */ + /** + * Sample code: List governance rules by security connector scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void + listGovernanceRulesBySecurityConnectorScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.governanceRules() + .list( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2022-01-01-preview/GovernanceRules/ListByManagementGroupGovernanceRules_example.json + */ + /** + * Sample code: List governance rules by management group scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void + listGovernanceRulesByManagementGroupScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.governanceRules() + .list("providers/Microsoft.Management/managementGroups/contoso", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesOperationResultsSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesOperationResultsSamples.java new file mode 100644 index 000000000000..7387435251f0 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesOperationResultsSamples.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for GovernanceRules OperationResults. + */ +public final class GovernanceRulesOperationResultsSamples { + /* + * x-ms-original-file: 2022-01-01-preview/GovernanceRules/GetManagementGroupGovernanceRuleExecuteStatus_example.json + */ + /** + * Sample code: Get governance rules long run operation result over management group. + * + * @param manager Entry point to SecurityManager. + */ + public static void getGovernanceRulesLongRunOperationResultOverManagementGroup( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.governanceRules() + .operationResultsWithResponse("providers/Microsoft.Management/managementGroups/contoso", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", "58b33f4f-c8c7-4b01-99cc-d437db4d40dd", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2022-01-01-preview/GovernanceRules/GetGovernanceRuleExecuteStatus_example.json + */ + /** + * Sample code: Get governance rules long run operation result over subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void getGovernanceRulesLongRunOperationResultOverSubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.governanceRules() + .operationResultsWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", "58b33f4f-c8c7-4b01-99cc-d437db4d40dd", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2022-01-01-preview/GovernanceRules/GetSecurityConnectorGovernanceRuleExecuteStatus_example.json + */ + /** + * Sample code: Get governance rules long run operation result over security connector. + * + * @param manager Entry point to SecurityManager. + */ + public static void getGovernanceRulesLongRunOperationResultOverSecurityConnector( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.governanceRules() + .operationResultsWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", "58b33f4f-c8c7-4b01-99cc-d437db4d40dd", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/HealthReportsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/HealthReportsGetSamples.java new file mode 100644 index 000000000000..67d001daee24 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/HealthReportsGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for HealthReports Get. + */ +public final class HealthReportsGetSamples { + /* + * x-ms-original-file: 2023-05-01-preview/HealthReports/GetHealthReports_example.json + */ + /** + * Sample code: Get health report of resource. + * + * @param manager Entry point to SecurityManager. + */ + public static void getHealthReportOfResource(com.azure.resourcemanager.security.SecurityManager manager) { + manager.healthReports() + .getWithResponse( + "subscriptions/a1efb6ca-fbc5-4782-9aaa-5c7daded1ce2/resourcegroups/E2E-IBB0WX/providers/Microsoft.Security/securityconnectors/AwsConnectorAllOfferings", + "909c629a-bf39-4521-8e4f-10b443a0bc02", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/HealthReportsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/HealthReportsListSamples.java new file mode 100644 index 000000000000..6f5e107155a8 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/HealthReportsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for HealthReports List. + */ +public final class HealthReportsListSamples { + /* + * x-ms-original-file: 2023-05-01-preview/HealthReports/ListHealthReports_example.json + */ + /** + * Sample code: List health reports. + * + * @param manager Entry point to SecurityManager. + */ + public static void listHealthReports(com.azure.resourcemanager.security.SecurityManager manager) { + manager.healthReports() + .list("subscriptions/a1efb6ca-fbc5-4782-9aaa-5c7daded1ce2", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..4e92fe9821ef --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesCreateOrUpdateSamples.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.InformationProtectionKeyword; +import com.azure.resourcemanager.security.models.InformationProtectionPolicyName; +import com.azure.resourcemanager.security.models.InformationType; +import com.azure.resourcemanager.security.models.SensitivityLabel; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for InformationProtectionPolicies CreateOrUpdate. + */ +public final class InformationProtectionPoliciesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * 2017-08-01-preview/InformationProtectionPolicies/CreateOrUpdateInformationProtectionPolicy_example.json + */ + /** + * Sample code: Create or update an information protection policy for a management group. + * + * @param manager Entry point to SecurityManager. + */ + public static void createOrUpdateAnInformationProtectionPolicyForAManagementGroup( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.informationProtectionPolicies() + .define(InformationProtectionPolicyName.CUSTOM) + .withExistingScope("providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e") + .withLabels(mapOf("1345da73-bc5a-4a8f-b7dd-3820eb713da8", + new SensitivityLabel().withDisplayName("Public").withOrder(100).withEnabled(true), + "575739d2-3d53-4df0-9042-4c7772d5c7b1", + new SensitivityLabel().withDisplayName("Confidential").withOrder(300).withEnabled(true), + "7aa516c7-5a53-4857-bc6e-6808c6acd542", + new SensitivityLabel().withDisplayName("General").withOrder(200).withEnabled(true))) + .withInformationTypes(mapOf("3bf35491-99b8-41f2-86d5-c1200a7df658", + new InformationType().withDisplayName("Custom") + .withOrder(1400) + .withRecommendedLabelId("7aa516c7-5a53-4857-bc6e-6808c6acd542") + .withEnabled(true) + .withCustom(true) + .withKeywords(Arrays.asList(new InformationProtectionKeyword().withPattern("%custom%") + .withCustom(true) + .withCanBeNumeric(true))), + "7fb9419d-2473-4ad8-8e11-b25cc8cf6a07", + new InformationType().withDisplayName("Networking") + .withOrder(100) + .withRecommendedLabelId("575739d2-3d53-4df0-9042-4c7772d5c7b1") + .withEnabled(true) + .withCustom(false) + .withKeywords(Arrays.asList(new InformationProtectionKeyword().withPattern("%networking%") + .withCustom(true) + .withCanBeNumeric(false))))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesGetSamples.java new file mode 100644 index 000000000000..848be902595f --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesGetSamples.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.InformationProtectionPolicyName; + +/** + * Samples for InformationProtectionPolicies Get. + */ +public final class InformationProtectionPoliciesGetSamples { + /* + * x-ms-original-file: + * 2017-08-01-preview/InformationProtectionPolicies/GetCustomInformationProtectionPolicy_example.json + */ + /** + * Sample code: Get the customized information protection policy for a management group. + * + * @param manager Entry point to SecurityManager. + */ + public static void getTheCustomizedInformationProtectionPolicyForAManagementGroup( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.informationProtectionPolicies() + .getWithResponse("providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e", + InformationProtectionPolicyName.CUSTOM, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2017-08-01-preview/InformationProtectionPolicies/GetEffectiveInformationProtectionPolicy_example.json + */ + /** + * Sample code: Get the effective information protection policy for a management group. + * + * @param manager Entry point to SecurityManager. + */ + public static void getTheEffectiveInformationProtectionPolicyForAManagementGroup( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.informationProtectionPolicies() + .getWithResponse("providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e", + InformationProtectionPolicyName.EFFECTIVE, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesListSamples.java new file mode 100644 index 000000000000..f9ed2df63eb1 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for InformationProtectionPolicies List. + */ +public final class InformationProtectionPoliciesListSamples { + /* + * x-ms-original-file: + * 2017-08-01-preview/InformationProtectionPolicies/ListInformationProtectionPolicies_example.json + */ + /** + * Sample code: Get information protection policies. + * + * @param manager Entry point to SecurityManager. + */ + public static void getInformationProtectionPolicies(com.azure.resourcemanager.security.SecurityManager manager) { + manager.informationProtectionPolicies() + .list("providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionAnalyticsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionAnalyticsGetSamples.java new file mode 100644 index 000000000000..9f8db8b7d555 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionAnalyticsGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for IotSecuritySolutionAnalytics Get. + */ +public final class IotSecuritySolutionAnalyticsGetSamples { + /* + * x-ms-original-file: 2019-08-01/IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityAnalytics.json + */ + /** + * Sample code: Get Security Solution Analytics. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecuritySolutionAnalytics(com.azure.resourcemanager.security.SecurityManager manager) { + manager.iotSecuritySolutionAnalytics().getWithResponse("MyGroup", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionAnalyticsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionAnalyticsListSamples.java new file mode 100644 index 000000000000..039d6a16cd17 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionAnalyticsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for IotSecuritySolutionAnalytics List. + */ +public final class IotSecuritySolutionAnalyticsListSamples { + /* + * x-ms-original-file: 2019-08-01/IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityAnalyticsList.json + */ + /** + * Sample code: Get Security Solution Analytics. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecuritySolutionAnalytics(com.azure.resourcemanager.security.SecurityManager manager) { + manager.iotSecuritySolutionAnalytics().listWithResponse("MyGroup", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionCreateOrUpdateSamples.java new file mode 100644 index 000000000000..1a0dbc0320e7 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionCreateOrUpdateSamples.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.RecommendationConfigStatus; +import com.azure.resourcemanager.security.models.RecommendationConfigurationProperties; +import com.azure.resourcemanager.security.models.RecommendationType; +import com.azure.resourcemanager.security.models.SecuritySolutionStatus; +import com.azure.resourcemanager.security.models.UnmaskedIpLoggingStatus; +import com.azure.resourcemanager.security.models.UserDefinedResourcesProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for IotSecuritySolution CreateOrUpdate. + */ +public final class IotSecuritySolutionCreateOrUpdateSamples { + /* + * x-ms-original-file: 2019-08-01/IoTSecuritySolutions/CreateIoTSecuritySolution.json + */ + /** + * Sample code: Create or update a IoT security solution. + * + * @param manager Entry point to SecurityManager. + */ + public static void createOrUpdateAIoTSecuritySolution(com.azure.resourcemanager.security.SecurityManager manager) { + manager.iotSecuritySolutions() + .define("default") + .withExistingResourceGroup("MyGroup") + .withRegion("East Us") + .withTags(mapOf()) + .withWorkspace( + "/subscriptions/c4930e90-cd72-4aa5-93e9-2d081d129569/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace1") + .withDisplayName("Solution Default") + .withStatus(SecuritySolutionStatus.ENABLED) + .withExport(Arrays.asList()) + .withDisabledDataSources(Arrays.asList()) + .withIotHubs(Arrays.asList( + "/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub")) + .withUserDefinedResources(new UserDefinedResourcesProperties() + .withQuery("where type != \"microsoft.devices/iothubs\" | where name contains \"iot\"") + .withQuerySubscriptions(Arrays.asList("075423e9-7d33-4166-8bdf-3920b04e3735"))) + .withRecommendationsConfiguration(Arrays.asList( + new RecommendationConfigurationProperties().withRecommendationType(RecommendationType.IO_T_OPEN_PORTS) + .withStatus(RecommendationConfigStatus.DISABLED), + new RecommendationConfigurationProperties() + .withRecommendationType(RecommendationType.IO_T_SHARED_CREDENTIALS) + .withStatus(RecommendationConfigStatus.DISABLED))) + .withUnmaskedIpLoggingStatus(UnmaskedIpLoggingStatus.ENABLED) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionDeleteSamples.java new file mode 100644 index 000000000000..2c4d717e9e78 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for IotSecuritySolution Delete. + */ +public final class IotSecuritySolutionDeleteSamples { + /* + * x-ms-original-file: 2019-08-01/IoTSecuritySolutions/DeleteIoTSecuritySolution.json + */ + /** + * Sample code: Delete an IoT security solution. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteAnIoTSecuritySolution(com.azure.resourcemanager.security.SecurityManager manager) { + manager.iotSecuritySolutions() + .deleteByResourceGroupWithResponse("MyGroup", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionGetByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionGetByResourceGroupSamples.java new file mode 100644 index 000000000000..5454ceaab009 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionGetByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for IotSecuritySolution GetByResourceGroup. + */ +public final class IotSecuritySolutionGetByResourceGroupSamples { + /* + * x-ms-original-file: 2019-08-01/IoTSecuritySolutions/GetIoTSecuritySolution.json + */ + /** + * Sample code: Get a IoT security solution. + * + * @param manager Entry point to SecurityManager. + */ + public static void getAIoTSecuritySolution(com.azure.resourcemanager.security.SecurityManager manager) { + manager.iotSecuritySolutions() + .getByResourceGroupWithResponse("MyGroup", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionListByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionListByResourceGroupSamples.java new file mode 100644 index 000000000000..d916cadb5f72 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionListByResourceGroupSamples.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for IotSecuritySolution ListByResourceGroup. + */ +public final class IotSecuritySolutionListByResourceGroupSamples { + /* + * x-ms-original-file: 2019-08-01/IoTSecuritySolutions/GetIoTSecuritySolutionsListByIotHubAndRg.json + */ + /** + * Sample code: List IoT Security solutions by resource group and IoT Hub. + * + * @param manager Entry point to SecurityManager. + */ + public static void + listIoTSecuritySolutionsByResourceGroupAndIoTHub(com.azure.resourcemanager.security.SecurityManager manager) { + manager.iotSecuritySolutions() + .listByResourceGroup("MyRg", + "properties.iotHubs/any(i eq \"/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub\")", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2019-08-01/IoTSecuritySolutions/GetIoTSecuritySolutionsListByRg.json + */ + /** + * Sample code: List IoT Security solutions by resource group. + * + * @param manager Entry point to SecurityManager. + */ + public static void + listIoTSecuritySolutionsByResourceGroup(com.azure.resourcemanager.security.SecurityManager manager) { + manager.iotSecuritySolutions().listByResourceGroup("MyGroup", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionListSamples.java new file mode 100644 index 000000000000..c888e510a58d --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionListSamples.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for IotSecuritySolution List. + */ +public final class IotSecuritySolutionListSamples { + /* + * x-ms-original-file: 2019-08-01/IoTSecuritySolutions/GetIoTSecuritySolutionsList.json + */ + /** + * Sample code: List IoT Security solutions by subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void + listIoTSecuritySolutionsBySubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.iotSecuritySolutions().list(null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2019-08-01/IoTSecuritySolutions/GetIoTSecuritySolutionsListByIotHub.json + */ + /** + * Sample code: List IoT Security solutions by IoT Hub. + * + * @param manager Entry point to SecurityManager. + */ + public static void listIoTSecuritySolutionsByIoTHub(com.azure.resourcemanager.security.SecurityManager manager) { + manager.iotSecuritySolutions() + .list( + "properties.iotHubs/any(i eq \"/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub\")", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionUpdateSamples.java new file mode 100644 index 000000000000..a07d33b10b9d --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionUpdateSamples.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.IoTSecuritySolutionModel; +import com.azure.resourcemanager.security.models.RecommendationConfigStatus; +import com.azure.resourcemanager.security.models.RecommendationConfigurationProperties; +import com.azure.resourcemanager.security.models.RecommendationType; +import com.azure.resourcemanager.security.models.UserDefinedResourcesProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for IotSecuritySolution Update. + */ +public final class IotSecuritySolutionUpdateSamples { + /* + * x-ms-original-file: 2019-08-01/IoTSecuritySolutions/UpdateIoTSecuritySolution.json + */ + /** + * Sample code: Use this method to update existing IoT Security solution. + * + * @param manager Entry point to SecurityManager. + */ + public static void + useThisMethodToUpdateExistingIoTSecuritySolution(com.azure.resourcemanager.security.SecurityManager manager) { + IoTSecuritySolutionModel resource = manager.iotSecuritySolutions() + .getByResourceGroupWithResponse("myRg", "default", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("foo", "bar")) + .withUserDefinedResources(new UserDefinedResourcesProperties() + .withQuery("where type != \"microsoft.devices/iothubs\" | where name contains \"v2\"") + .withQuerySubscriptions(Arrays.asList("075423e9-7d33-4166-8bdf-3920b04e3735"))) + .withRecommendationsConfiguration(Arrays.asList( + new RecommendationConfigurationProperties().withRecommendationType(RecommendationType.IO_T_OPEN_PORTS) + .withStatus(RecommendationConfigStatus.DISABLED), + new RecommendationConfigurationProperties() + .withRecommendationType(RecommendationType.IO_T_SHARED_CREDENTIALS) + .withStatus(RecommendationConfigStatus.DISABLED))) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertDismissSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertDismissSamples.java new file mode 100644 index 000000000000..12f1d690128f --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertDismissSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for IotSecuritySolutionsAnalyticsAggregatedAlert Dismiss. + */ +public final class IotSecuritySolutionsAnalyticsAggregatedAlertDismissSamples { + /* + * x-ms-original-file: + * 2019-08-01/IoTSecuritySolutionsAnalytics/PostIoTSecuritySolutionsSecurityAggregatedAlertDismiss.json + */ + /** + * Sample code: Dismiss an aggregated IoT Security Solution Alert. + * + * @param manager Entry point to SecurityManager. + */ + public static void + dismissAnAggregatedIoTSecuritySolutionAlert(com.azure.resourcemanager.security.SecurityManager manager) { + manager.iotSecuritySolutionsAnalyticsAggregatedAlerts() + .dismissWithResponse("IoTEdgeResources", "default", "IoT_Bruteforce_Fail/2019-02-02/dismiss", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertGetSamples.java new file mode 100644 index 000000000000..470c01e60706 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for IotSecuritySolutionsAnalyticsAggregatedAlert Get. + */ +public final class IotSecuritySolutionsAnalyticsAggregatedAlertGetSamples { + /* + * x-ms-original-file: 2019-08-01/IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityAggregatedAlert.json + */ + /** + * Sample code: Get the aggregated security analytics alert of yours IoT Security solution. This aggregation is + * performed by alert name. + * + * @param manager Entry point to SecurityManager. + */ + public static void + getTheAggregatedSecurityAnalyticsAlertOfYoursIoTSecuritySolutionThisAggregationIsPerformedByAlertName( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.iotSecuritySolutionsAnalyticsAggregatedAlerts() + .getWithResponse("MyGroup", "default", "IoT_Bruteforce_Fail/2019-02-02", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertListSamples.java new file mode 100644 index 000000000000..7ee795995251 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for IotSecuritySolutionsAnalyticsAggregatedAlert List. + */ +public final class IotSecuritySolutionsAnalyticsAggregatedAlertListSamples { + /* + * x-ms-original-file: + * 2019-08-01/IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityAggregatedAlertList.json + */ + /** + * Sample code: Get the aggregated alert list of yours IoT Security solution. + * + * @param manager Entry point to SecurityManager. + */ + public static void getTheAggregatedAlertListOfYoursIoTSecuritySolution( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.iotSecuritySolutionsAnalyticsAggregatedAlerts() + .list("MyGroup", "default", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsRecommendationGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsRecommendationGetSamples.java new file mode 100644 index 000000000000..501e547f094a --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsRecommendationGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for IotSecuritySolutionsAnalyticsRecommendation Get. + */ +public final class IotSecuritySolutionsAnalyticsRecommendationGetSamples { + /* + * x-ms-original-file: 2019-08-01/IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityRecommendation.json + */ + /** + * Sample code: Get the aggregated security analytics recommendation of yours IoT Security solution. + * + * @param manager Entry point to SecurityManager. + */ + public static void getTheAggregatedSecurityAnalyticsRecommendationOfYoursIoTSecuritySolution( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.iotSecuritySolutionsAnalyticsRecommendations() + .getWithResponse("IoTEdgeResources", "default", "OpenPortsOnDevice", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsRecommendationListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsRecommendationListSamples.java new file mode 100644 index 000000000000..c703a0a9e880 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsRecommendationListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for IotSecuritySolutionsAnalyticsRecommendation List. + */ +public final class IotSecuritySolutionsAnalyticsRecommendationListSamples { + /* + * x-ms-original-file: + * 2019-08-01/IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityRecommendationList.json + */ + /** + * Sample code: Get the list of aggregated security analytics recommendations of yours IoT Security solution. + * + * @param manager Entry point to SecurityManager. + */ + public static void getTheListOfAggregatedSecurityAnalyticsRecommendationsOfYoursIoTSecuritySolution( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.iotSecuritySolutionsAnalyticsRecommendations() + .list("IoTEdgeResources", "default", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..98315c69d5b0 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesCreateOrUpdateSamples.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.fluent.models.JitNetworkAccessRequestInner; +import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyVirtualMachine; +import com.azure.resourcemanager.security.models.JitNetworkAccessPortRule; +import com.azure.resourcemanager.security.models.JitNetworkAccessRequestPort; +import com.azure.resourcemanager.security.models.JitNetworkAccessRequestVirtualMachine; +import com.azure.resourcemanager.security.models.Protocol; +import com.azure.resourcemanager.security.models.Status; +import com.azure.resourcemanager.security.models.StatusReason; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** + * Samples for JitNetworkAccessPolicies CreateOrUpdate. + */ +public final class JitNetworkAccessPoliciesCreateOrUpdateSamples { + /* + * x-ms-original-file: 2020-01-01/JitNetworkAccessPolicies/CreateJitNetworkAccessPolicy_example.json + */ + /** + * Sample code: Create JIT network access policy. + * + * @param manager Entry point to SecurityManager. + */ + public static void createJITNetworkAccessPolicy(com.azure.resourcemanager.security.SecurityManager manager) { + manager.jitNetworkAccessPolicies() + .define("default") + .withExistingLocation("myRg1", "westeurope") + .withVirtualMachines(Arrays.asList(new JitNetworkAccessPolicyVirtualMachine().withId( + "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1") + .withPorts(Arrays.asList( + new JitNetworkAccessPortRule().withNumber(22) + .withProtocol(Protocol.ALL) + .withAllowedSourceAddressPrefix("*") + .withMaxRequestAccessDuration("PT3H"), + new JitNetworkAccessPortRule().withNumber(3389) + .withProtocol(Protocol.ALL) + .withAllowedSourceAddressPrefix("*") + .withMaxRequestAccessDuration("PT3H"))))) + .withKind("Basic") + .withRequests(Arrays.asList(new JitNetworkAccessRequestInner() + .withVirtualMachines(Arrays.asList(new JitNetworkAccessRequestVirtualMachine().withId( + "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1") + .withPorts(Arrays.asList(new JitNetworkAccessRequestPort().withNumber(3389) + .withAllowedSourceAddressPrefix("192.127.0.2") + .withEndTimeUtc(OffsetDateTime.parse("2018-05-17T09:06:45.5691611Z")) + .withStatus(Status.INITIATED) + .withStatusReason(StatusReason.USER_REQUESTED))))) + .withStartTimeUtc(OffsetDateTime.parse("2018-05-17T08:06:45.5691611Z")) + .withRequestor("barbara@contoso.com"))) + .create(); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesDeleteSamples.java new file mode 100644 index 000000000000..90bbabbec6ec --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for JitNetworkAccessPolicies Delete. + */ +public final class JitNetworkAccessPoliciesDeleteSamples { + /* + * x-ms-original-file: 2020-01-01/JitNetworkAccessPolicies/DeleteJitNetworkAccessPolicy_example.json + */ + /** + * Sample code: Delete a JIT network access policy. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteAJITNetworkAccessPolicy(com.azure.resourcemanager.security.SecurityManager manager) { + manager.jitNetworkAccessPolicies() + .deleteWithResponse("myRg1", "westeurope", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesGetSamples.java new file mode 100644 index 000000000000..3becd5b09a07 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for JitNetworkAccessPolicies Get. + */ +public final class JitNetworkAccessPoliciesGetSamples { + /* + * x-ms-original-file: 2020-01-01/JitNetworkAccessPolicies/GetJitNetworkAccessPolicy_example.json + */ + /** + * Sample code: Get JIT network access policy. + * + * @param manager Entry point to SecurityManager. + */ + public static void getJITNetworkAccessPolicy(com.azure.resourcemanager.security.SecurityManager manager) { + manager.jitNetworkAccessPolicies() + .getWithResponse("myRg1", "westeurope", "default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesInitiateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesInitiateSamples.java new file mode 100644 index 000000000000..cf6810c8f37c --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesInitiateSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyInitiatePort; +import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyInitiateRequest; +import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyInitiateVirtualMachine; +import java.util.Arrays; + +/** + * Samples for JitNetworkAccessPolicies Initiate. + */ +public final class JitNetworkAccessPoliciesInitiateSamples { + /* + * x-ms-original-file: 2020-01-01/JitNetworkAccessPolicies/InitiateJitNetworkAccessPolicy_example.json + */ + /** + * Sample code: Initiate an action on a JIT network access policy. + * + * @param manager Entry point to SecurityManager. + */ + public static void + initiateAnActionOnAJITNetworkAccessPolicy(com.azure.resourcemanager.security.SecurityManager manager) { + manager.jitNetworkAccessPolicies() + .initiateWithResponse("myRg1", "westeurope", "default", new JitNetworkAccessPolicyInitiateRequest() + .withVirtualMachines(Arrays.asList(new JitNetworkAccessPolicyInitiateVirtualMachine().withId( + "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1") + .withPorts(Arrays.asList(new JitNetworkAccessPolicyInitiatePort().withNumber(3389) + .withAllowedSourceAddressPrefix("192.127.0.2"))))) + .withJustification("testing a new version of the product"), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByRegionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByRegionSamples.java new file mode 100644 index 000000000000..c498e8fabe2e --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByRegionSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for JitNetworkAccessPolicies ListByRegion. + */ +public final class JitNetworkAccessPoliciesListByRegionSamples { + /* + * x-ms-original-file: + * 2020-01-01/JitNetworkAccessPolicies/GetJitNetworkAccessPoliciesSubscriptionLocation_example.json + */ + /** + * Sample code: Get JIT network access policies on a subscription from a security data location. + * + * @param manager Entry point to SecurityManager. + */ + public static void getJITNetworkAccessPoliciesOnASubscriptionFromASecurityDataLocation( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.jitNetworkAccessPolicies().listByRegion("westeurope", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByResourceGroupAndRegionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByResourceGroupAndRegionSamples.java new file mode 100644 index 000000000000..9a66f51d69c0 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByResourceGroupAndRegionSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for JitNetworkAccessPolicies ListByResourceGroupAndRegion. + */ +public final class JitNetworkAccessPoliciesListByResourceGroupAndRegionSamples { + /* + * x-ms-original-file: + * 2020-01-01/JitNetworkAccessPolicies/GetJitNetworkAccessPoliciesResourceGroupLocation_example.json + */ + /** + * Sample code: Get JIT network access policies on a resource group from a security data location. + * + * @param manager Entry point to SecurityManager. + */ + public static void getJITNetworkAccessPoliciesOnAResourceGroupFromASecurityDataLocation( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.jitNetworkAccessPolicies() + .listByResourceGroupAndRegion("myRg1", "westeurope", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByResourceGroupSamples.java new file mode 100644 index 000000000000..0de0e40f125e --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for JitNetworkAccessPolicies ListByResourceGroup. + */ +public final class JitNetworkAccessPoliciesListByResourceGroupSamples { + /* + * x-ms-original-file: 2020-01-01/JitNetworkAccessPolicies/GetJitNetworkAccessPoliciesResourceGroup_example.json + */ + /** + * Sample code: Get JIT network access policies on a resource group. + * + * @param manager Entry point to SecurityManager. + */ + public static void + getJITNetworkAccessPoliciesOnAResourceGroup(com.azure.resourcemanager.security.SecurityManager manager) { + manager.jitNetworkAccessPolicies().listByResourceGroup("myRg1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListSamples.java new file mode 100644 index 000000000000..e00985f52e11 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for JitNetworkAccessPolicies List. + */ +public final class JitNetworkAccessPoliciesListSamples { + /* + * x-ms-original-file: 2020-01-01/JitNetworkAccessPolicies/GetJitNetworkAccessPoliciesSubscription_example.json + */ + /** + * Sample code: Get JIT network access policies on a subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void + getJITNetworkAccessPoliciesOnASubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.jitNetworkAccessPolicies().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/LocationsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/LocationsGetSamples.java new file mode 100644 index 000000000000..5c0c7958e8c8 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/LocationsGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for Locations Get. + */ +public final class LocationsGetSamples { + /* + * x-ms-original-file: 2015-06-01-preview/Locations/GetLocation_example.json + */ + /** + * Sample code: Get security data location. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityDataLocation(com.azure.resourcemanager.security.SecurityManager manager) { + manager.locations().getWithResponse("centralus", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/LocationsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/LocationsListSamples.java new file mode 100644 index 000000000000..c2676acdb773 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/LocationsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for Locations List. + */ +public final class LocationsListSamples { + /* + * x-ms-original-file: 2015-06-01-preview/Locations/GetLocations_example.json + */ + /** + * Sample code: Get security data locations. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityDataLocations(com.azure.resourcemanager.security.SecurityManager manager) { + manager.locations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/MdeOnboardingsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/MdeOnboardingsGetSamples.java new file mode 100644 index 000000000000..21768ecdc148 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/MdeOnboardingsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for MdeOnboardings Get. + */ +public final class MdeOnboardingsGetSamples { + /* + * x-ms-original-file: 2021-10-01-preview/MdeOnboardings/GetMdeOnboardings_example.json + */ + /** + * Sample code: The default configuration or data needed to onboard the machine to MDE. + * + * @param manager Entry point to SecurityManager. + */ + public static void theDefaultConfigurationOrDataNeededToOnboardTheMachineToMDE( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.mdeOnboardings().getWithResponse(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/MdeOnboardingsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/MdeOnboardingsListSamples.java new file mode 100644 index 000000000000..63cc8aef71a9 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/MdeOnboardingsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for MdeOnboardings List. + */ +public final class MdeOnboardingsListSamples { + /* + * x-ms-original-file: 2021-10-01-preview/MdeOnboardings/ListMdeOnboardings_example.json + */ + /** + * Sample code: The configuration or data needed to onboard the machine to MDE. + * + * @param manager Entry point to SecurityManager. + */ + public static void theConfigurationOrDataNeededToOnboardTheMachineToMDE( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.mdeOnboardings().listWithResponse(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/OperationResultsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/OperationResultsGetSamples.java new file mode 100644 index 000000000000..cd002cb4675f --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/OperationResultsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for OperationResults Get. + */ +public final class OperationResultsGetSamples { + /* + * x-ms-original-file: 2025-10-01-preview/OperationResults/GetOperationResult.json + */ + /** + * Sample code: Get operation result. + * + * @param manager Entry point to SecurityManager. + */ + public static void getOperationResult(com.azure.resourcemanager.security.SecurityManager manager) { + manager.operationResults() + .getWithResponse("eastus", "00000000-0000-0000-0000-000000000000", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/OperationStatusesGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/OperationStatusesGetSamples.java new file mode 100644 index 000000000000..c71e2c63034c --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/OperationStatusesGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for OperationStatuses Get. + */ +public final class OperationStatusesGetSamples { + /* + * x-ms-original-file: 2025-10-01-preview/OperationStatuses/GetOperationStatus.json + */ + /** + * Sample code: Get operation status. + * + * @param manager Entry point to SecurityManager. + */ + public static void getOperationStatus(com.azure.resourcemanager.security.SecurityManager manager) { + manager.operationStatuses() + .getWithResponse("eastus", "00000000-0000-0000-0000-000000000000", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/OperationsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/OperationsListSamples.java new file mode 100644 index 000000000000..6d5e93165cf4 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/OperationsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: 2025-10-01-preview/Operations/ListOperations_example.json + */ + /** + * Sample code: List the operations for the Microsoft.Security (Microsoft Defender for Cloud) resource provider. + * + * @param manager Entry point to SecurityManager. + */ + public static void listTheOperationsForTheMicrosoftSecurityMicrosoftDefenderForCloudResourceProvider( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PricingsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PricingsDeleteSamples.java new file mode 100644 index 000000000000..dc6ee35bbef9 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PricingsDeleteSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for Pricings Delete. + */ +public final class PricingsDeleteSamples { + /* + * x-ms-original-file: 2024-01-01/Pricings/DeleteResourcePricing_example.json + */ + /** + * Sample code: Delete a pricing on resource. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteAPricingOnResource(com.azure.resourcemanager.security.SecurityManager manager) { + manager.pricings() + .deleteByResourceGroupWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/DEMO/providers/Microsoft.Compute/virtualMachines/VM-1", + "VirtualMachines", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2024-01-01/Pricings/DeleteResourcePricingByNameContainers_example.json + */ + /** + * Sample code: Delete a pricing on resource (example for Containers plan). + * + * @param manager Entry point to SecurityManager. + */ + public static void + deleteAPricingOnResourceExampleForContainersPlan(com.azure.resourcemanager.security.SecurityManager manager) { + manager.pricings() + .deleteByResourceGroupWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/demo-containers-rg/providers/Microsoft.ContainerService/managedClusters/demo-aks-cluster", + "Containers", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PricingsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PricingsGetSamples.java new file mode 100644 index 000000000000..6030621822ec --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PricingsGetSamples.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for Pricings Get. + */ +public final class PricingsGetSamples { + /* + * x-ms-original-file: 2024-01-01/Pricings/GetPricingByNameCloudPosture_example.json + */ + /** + * Sample code: Get pricings on subscription - CloudPosture plan. + * + * @param manager Entry point to SecurityManager. + */ + public static void + getPricingsOnSubscriptionCloudPosturePlan(com.azure.resourcemanager.security.SecurityManager manager) { + manager.pricings() + .getWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "CloudPosture", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2024-01-01/Pricings/GetResourcePricingByNameVirtualMachines_example.json + */ + /** + * Sample code: Get pricings on resource - VirtualMachines plan. + * + * @param manager Entry point to SecurityManager. + */ + public static void + getPricingsOnResourceVirtualMachinesPlan(com.azure.resourcemanager.security.SecurityManager manager) { + manager.pricings() + .getWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/DEMO/providers/Microsoft.Compute/virtualMachines/VM-1", + "VirtualMachines", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2024-01-01/Pricings/GetPricingByNameDns_example.json + */ + /** + * Sample code: Get pricings on subscription - Dns plan. + * + * @param manager Entry point to SecurityManager. + */ + public static void getPricingsOnSubscriptionDnsPlan(com.azure.resourcemanager.security.SecurityManager manager) { + manager.pricings() + .getWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "Dns", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2024-01-01/Pricings/GetPricingByNameContainers_example.json + */ + /** + * Sample code: Get pricings on subscription - Containers plan. + * + * @param manager Entry point to SecurityManager. + */ + public static void + getPricingsOnSubscriptionContainersPlan(com.azure.resourcemanager.security.SecurityManager manager) { + manager.pricings() + .getWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "Containers", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2024-01-01/Pricings/GetResourcePricingByNameContainers_example.json + */ + /** + * Sample code: Get pricings on resource - Containers plan. + * + * @param manager Entry point to SecurityManager. + */ + public static void getPricingsOnResourceContainersPlan(com.azure.resourcemanager.security.SecurityManager manager) { + manager.pricings() + .getWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/demo-containers-rg/providers/Microsoft.ContainerService/managedClusters/demo-aks-cluster", + "Containers", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2024-01-01/Pricings/GetPricingByNameStorageAccounts_example.json + */ + /** + * Sample code: Get pricings on subscription - StorageAccounts plan. + * + * @param manager Entry point to SecurityManager. + */ + public static void + getPricingsOnSubscriptionStorageAccountsPlan(com.azure.resourcemanager.security.SecurityManager manager) { + manager.pricings() + .getWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "StorageAccounts", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2024-01-01/Pricings/GetPricingByNameVirtualMachines_example.json + */ + /** + * Sample code: Get pricings on subscription - VirtualMachines plan. + * + * @param manager Entry point to SecurityManager. + */ + public static void + getPricingsOnSubscriptionVirtualMachinesPlan(com.azure.resourcemanager.security.SecurityManager manager) { + manager.pricings() + .getWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "VirtualMachines", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PricingsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PricingsListSamples.java new file mode 100644 index 000000000000..c1865121f6db --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PricingsListSamples.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for Pricings List. + */ +public final class PricingsListSamples { + /* + * x-ms-original-file: 2024-01-01/Pricings/ListPricingsWithPlanFilter_example.json + */ + /** + * Sample code: Get pricings on subscription with plans filter. + * + * @param manager Entry point to SecurityManager. + */ + public static void + getPricingsOnSubscriptionWithPlansFilter(com.azure.resourcemanager.security.SecurityManager manager) { + manager.pricings() + .listWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", + "name in (VirtualMachines,KeyVaults)", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2024-01-01/Pricings/ListPricings_example.json + */ + /** + * Sample code: Get pricings on subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void getPricingsOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.pricings() + .listWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", null, + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2024-01-01/Pricings/ListResourcePricings_example.json + */ + /** + * Sample code: Get pricings on resource. + * + * @param manager Entry point to SecurityManager. + */ + public static void getPricingsOnResource(com.azure.resourcemanager.security.SecurityManager manager) { + manager.pricings() + .listWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/DEMO/providers/Microsoft.Compute/virtualMachines/VM-1", + null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PricingsUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PricingsUpdateSamples.java new file mode 100644 index 000000000000..8c736223e5d1 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PricingsUpdateSamples.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.fluent.models.PricingInner; +import com.azure.resourcemanager.security.models.Enforce; +import com.azure.resourcemanager.security.models.Extension; +import com.azure.resourcemanager.security.models.IsEnabled; +import com.azure.resourcemanager.security.models.PricingTier; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Pricings Update. + */ +public final class PricingsUpdateSamples { + /* + * x-ms-original-file: 2024-01-01/Pricings/PutPricingByNamePartialSuccess_example.json + */ + /** + * Sample code: Update pricing on subscription (example for CloudPosture plan) - partial success. + * + * @param manager Entry point to SecurityManager. + */ + public static void updatePricingOnSubscriptionExampleForCloudPosturePlanPartialSuccess( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.pricings() + .updateWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "CloudPosture", + new PricingInner().withPricingTier(PricingTier.STANDARD), com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2024-01-01/Pricings/PutPricingByName_example.json + */ + /** + * Sample code: Update pricing on subscription (example for CloudPosture plan). + * + * @param manager Entry point to SecurityManager. + */ + public static void updatePricingOnSubscriptionExampleForCloudPosturePlan( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.pricings() + .updateWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "CloudPosture", + new PricingInner().withPricingTier(PricingTier.STANDARD), com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2024-01-01/Pricings/PutResourcePricingByNameContainers_example.json + */ + /** + * Sample code: Update pricing on resource (example for Containers plan). + * + * @param manager Entry point to SecurityManager. + */ + public static void + updatePricingOnResourceExampleForContainersPlan(com.azure.resourcemanager.security.SecurityManager manager) { + manager.pricings() + .updateWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/demo-containers-rg/providers/Microsoft.ContainerService/managedClusters/demo-aks-cluster", + "Containers", + new PricingInner().withPricingTier(PricingTier.STANDARD) + .withExtensions(Arrays.asList( + new Extension().withName("ContainerRegistriesVulnerabilityAssessments") + .withIsEnabled(IsEnabled.TRUE), + new Extension().withName("ContainerSensor").withIsEnabled(IsEnabled.TRUE), + new Extension().withName("AgentlessDiscoveryForKubernetes").withIsEnabled(IsEnabled.TRUE), + new Extension().withName("AgentlessVmScanning") + .withIsEnabled(IsEnabled.TRUE) + .withAdditionalExtensionProperties(mapOf("ExclusionTags", "[]")), + new Extension().withName("ContainerIntegrityContribution").withIsEnabled(IsEnabled.TRUE))), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2024-01-01/Pricings/PutResourcePricingByNameContainersACR_example.json + */ + /** + * Sample code: Update pricing on resource (Container Registry ACR). + * + * @param manager Entry point to SecurityManager. + */ + public static void + updatePricingOnResourceContainerRegistryACR(com.azure.resourcemanager.security.SecurityManager manager) { + manager.pricings() + .updateWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myContainerRegistry", + "Containers", + new PricingInner().withPricingTier(PricingTier.STANDARD) + .withExtensions(Arrays.asList( + new Extension().withName("ContainerRegistriesVulnerabilityAssessments") + .withIsEnabled(IsEnabled.TRUE), + new Extension().withName("ContainerIntegrityContribution").withIsEnabled(IsEnabled.TRUE))), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2024-01-01/Pricings/PutPricingVMsByName_example.json + */ + /** + * Sample code: Update pricing on subscription (example for VirtualMachines plan). + * + * @param manager Entry point to SecurityManager. + */ + public static void updatePricingOnSubscriptionExampleForVirtualMachinesPlan( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.pricings() + .updateWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "VirtualMachines", + new PricingInner().withPricingTier(PricingTier.STANDARD).withSubPlan("P2").withEnforce(Enforce.TRUE), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2024-01-01/Pricings/PutResourcePricingByNameVirtualMachines_example.json + */ + /** + * Sample code: Update pricing on resource (example for VirtualMachines plan). + * + * @param manager Entry point to SecurityManager. + */ + public static void updatePricingOnResourceExampleForVirtualMachinesPlan( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.pricings() + .updateWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/DEMO/providers/Microsoft.Compute/virtualMachines/VM-1", + "virtualMachines", new PricingInner().withPricingTier(PricingTier.STANDARD).withSubPlan("P1"), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..51ffcd57c693 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PrivateEndpointConnectionsCreateOrUpdateSamples.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.security.models.PrivateLinkServiceConnectionState; + +/** + * Samples for PrivateEndpointConnections CreateOrUpdate. + */ +public final class PrivateEndpointConnectionsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-01-01/PrivateEndpointConnections/PrivateEndpointConnections_CreateOrUpdate.json + */ + /** + * Sample code: Create or update private endpoint connection. + * + * @param manager Entry point to SecurityManager. + */ + public static void + createOrUpdatePrivateEndpointConnection(com.azure.resourcemanager.security.SecurityManager manager) { + manager.privateEndpointConnections() + .define("pe") + .withExistingPrivateLink("rg", "pls") + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState().withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("Approved by administrator") + .withActionsRequired("None")) + .create(); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PrivateEndpointConnectionsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PrivateEndpointConnectionsDeleteSamples.java new file mode 100644 index 000000000000..e6ce2df59f0c --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PrivateEndpointConnectionsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for PrivateEndpointConnections Delete. + */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: 2026-01-01/PrivateEndpointConnections/PrivateEndpointConnections_Delete.json + */ + /** + * Sample code: Delete private endpoint connection. + * + * @param manager Entry point to SecurityManager. + */ + public static void deletePrivateEndpointConnection(com.azure.resourcemanager.security.SecurityManager manager) { + manager.privateEndpointConnections().delete("rg", "pls", "pe", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PrivateEndpointConnectionsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PrivateEndpointConnectionsGetSamples.java new file mode 100644 index 000000000000..eb9f4f79907c --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PrivateEndpointConnectionsGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for PrivateEndpointConnections Get. + */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: 2026-01-01/PrivateEndpointConnections/PrivateEndpointConnections_Get.json + */ + /** + * Sample code: Get private endpoint connection. + * + * @param manager Entry point to SecurityManager. + */ + public static void getPrivateEndpointConnection(com.azure.resourcemanager.security.SecurityManager manager) { + manager.privateEndpointConnections().getWithResponse("rg", "pls", "pe", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PrivateEndpointConnectionsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PrivateEndpointConnectionsListSamples.java new file mode 100644 index 000000000000..6b5b05a32db5 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PrivateEndpointConnectionsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for PrivateEndpointConnections List. + */ +public final class PrivateEndpointConnectionsListSamples { + /* + * x-ms-original-file: 2026-01-01/PrivateEndpointConnections/PrivateEndpointConnections_List.json + */ + /** + * Sample code: List private endpoint connections. + * + * @param manager Entry point to SecurityManager. + */ + public static void listPrivateEndpointConnections(com.azure.resourcemanager.security.SecurityManager manager) { + manager.privateEndpointConnections().list("rg", "pls", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PrivateLinkResourcesGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PrivateLinkResourcesGetSamples.java new file mode 100644 index 000000000000..0a58906bae0e --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PrivateLinkResourcesGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for PrivateLinkResources Get. + */ +public final class PrivateLinkResourcesGetSamples { + /* + * x-ms-original-file: 2026-01-01/PrivateLinkResources/PrivateLinkResources_Get.json + */ + /** + * Sample code: Get private link resource. + * + * @param manager Entry point to SecurityManager. + */ + public static void getPrivateLinkResource(com.azure.resourcemanager.security.SecurityManager manager) { + manager.privateLinkResources().getWithResponse("rg", "pls", "containers", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PrivateLinkResourcesListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PrivateLinkResourcesListSamples.java new file mode 100644 index 000000000000..c0a3df1eee01 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PrivateLinkResourcesListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for PrivateLinkResources List. + */ +public final class PrivateLinkResourcesListSamples { + /* + * x-ms-original-file: 2026-01-01/PrivateLinkResources/PrivateLinkResources_ListByPrivateLink.json + */ + /** + * Sample code: List private link resources. + * + * @param manager Entry point to SecurityManager. + */ + public static void listPrivateLinkResources(com.azure.resourcemanager.security.SecurityManager manager) { + manager.privateLinkResources().list("rg", "pls", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PrivateLinksCreateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PrivateLinksCreateSamples.java new file mode 100644 index 000000000000..c83bcb3ea060 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PrivateLinksCreateSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for PrivateLinks Create. + */ +public final class PrivateLinksCreateSamples { + /* + * x-ms-original-file: 2026-01-01/PrivateLinks/PrivateLinks_Create.json + */ + /** + * Sample code: Create private link. + * + * @param manager Entry point to SecurityManager. + */ + public static void createPrivateLink(com.azure.resourcemanager.security.SecurityManager manager) { + manager.privateLinks() + .define("spl") + .withRegion("eastus") + .withExistingResourceGroup("rg") + .withTags(mapOf("environment", "production", "owner", "security-team", "project", "private-links")) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PrivateLinksDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PrivateLinksDeleteSamples.java new file mode 100644 index 000000000000..97a9498e76f5 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PrivateLinksDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for PrivateLinks Delete. + */ +public final class PrivateLinksDeleteSamples { + /* + * x-ms-original-file: 2026-01-01/PrivateLinks/PrivateLinks_Delete.json + */ + /** + * Sample code: Delete private link. + * + * @param manager Entry point to SecurityManager. + */ + public static void deletePrivateLink(com.azure.resourcemanager.security.SecurityManager manager) { + manager.privateLinks().delete("rg", "spl", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PrivateLinksGetByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PrivateLinksGetByResourceGroupSamples.java new file mode 100644 index 000000000000..283faf513010 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PrivateLinksGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for PrivateLinks GetByResourceGroup. + */ +public final class PrivateLinksGetByResourceGroupSamples { + /* + * x-ms-original-file: 2026-01-01/PrivateLinks/PrivateLinks_Get.json + */ + /** + * Sample code: Get private link. + * + * @param manager Entry point to SecurityManager. + */ + public static void getPrivateLink(com.azure.resourcemanager.security.SecurityManager manager) { + manager.privateLinks().getByResourceGroupWithResponse("rg", "spl", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PrivateLinksHeadSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PrivateLinksHeadSamples.java new file mode 100644 index 000000000000..0ea5128132fd --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PrivateLinksHeadSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for PrivateLinks Head. + */ +public final class PrivateLinksHeadSamples { + /* + * x-ms-original-file: 2026-01-01/PrivateLinks/PrivateLinks_Head.json + */ + /** + * Sample code: Checks whether private link exists. + * + * @param manager Entry point to SecurityManager. + */ + public static void checksWhetherPrivateLinkExists(com.azure.resourcemanager.security.SecurityManager manager) { + manager.privateLinks().headWithResponse("rg", "spl", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PrivateLinksListByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PrivateLinksListByResourceGroupSamples.java new file mode 100644 index 000000000000..b6462299b46c --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PrivateLinksListByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for PrivateLinks ListByResourceGroup. + */ +public final class PrivateLinksListByResourceGroupSamples { + /* + * x-ms-original-file: 2026-01-01/PrivateLinks/PrivateLinks_List.json + */ + /** + * Sample code: List private links. + * + * @param manager Entry point to SecurityManager. + */ + public static void listPrivateLinks(com.azure.resourcemanager.security.SecurityManager manager) { + manager.privateLinks().listByResourceGroup("rg", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PrivateLinksListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PrivateLinksListSamples.java new file mode 100644 index 000000000000..bd7784a058a5 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PrivateLinksListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for PrivateLinks List. + */ +public final class PrivateLinksListSamples { + /* + * x-ms-original-file: 2026-01-01/PrivateLinks/PrivateLinks_ListBySubscription.json + */ + /** + * Sample code: List private links by subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void listPrivateLinksBySubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.privateLinks().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PrivateLinksUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PrivateLinksUpdateSamples.java new file mode 100644 index 000000000000..6a320c1db438 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PrivateLinksUpdateSamples.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.PrivateLinkResource; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for PrivateLinks Update. + */ +public final class PrivateLinksUpdateSamples { + /* + * x-ms-original-file: 2026-01-01/PrivateLinks/PrivateLinks_Update.json + */ + /** + * Sample code: Update private link. + * + * @param manager Entry point to SecurityManager. + */ + public static void updatePrivateLink(com.azure.resourcemanager.security.SecurityManager manager) { + PrivateLinkResource resource = manager.privateLinks() + .getByResourceGroupWithResponse("rg", "spl", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("environment", "development", "owner", "security-team-updated", "project", "private-links")) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentsGetSamples.java new file mode 100644 index 000000000000..84fd66de6e10 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentsGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for RegulatoryComplianceAssessments Get. + */ +public final class RegulatoryComplianceAssessmentsGetSamples { + /* + * x-ms-original-file: 2019-01-01-preview/RegulatoryCompliance/getRegulatoryComplianceAssessment_example.json + */ + /** + * Sample code: Get selected regulatory compliance assessment details and state. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSelectedRegulatoryComplianceAssessmentDetailsAndState( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.regulatoryComplianceAssessments() + .getWithResponse("PCI-DSS-3.2", "1.1", "968548cb-02b3-8cd2-11f8-0cf64ab1a347", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentsListSamples.java new file mode 100644 index 000000000000..dc609fb72160 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for RegulatoryComplianceAssessments List. + */ +public final class RegulatoryComplianceAssessmentsListSamples { + /* + * x-ms-original-file: 2019-01-01-preview/RegulatoryCompliance/getRegulatoryComplianceAssessmentList_example.json + */ + /** + * Sample code: Get all assessments mapped to selected regulatory compliance control. + * + * @param manager Entry point to SecurityManager. + */ + public static void getAllAssessmentsMappedToSelectedRegulatoryComplianceControl( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.regulatoryComplianceAssessments().list("PCI-DSS-3.2", "1.1", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlsGetSamples.java new file mode 100644 index 000000000000..1aa6a34b4a60 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for RegulatoryComplianceControls Get. + */ +public final class RegulatoryComplianceControlsGetSamples { + /* + * x-ms-original-file: 2019-01-01-preview/RegulatoryCompliance/getRegulatoryComplianceControl_example.json + */ + /** + * Sample code: Get selected regulatory compliance control details and state. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSelectedRegulatoryComplianceControlDetailsAndState( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.regulatoryComplianceControls().getWithResponse("PCI-DSS-3.2", "1.1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlsListSamples.java new file mode 100644 index 000000000000..326e12568493 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for RegulatoryComplianceControls List. + */ +public final class RegulatoryComplianceControlsListSamples { + /* + * x-ms-original-file: 2019-01-01-preview/RegulatoryCompliance/getRegulatoryComplianceControlList_example.json + */ + /** + * Sample code: Get all regulatory compliance controls details and state for selected standard. + * + * @param manager Entry point to SecurityManager. + */ + public static void getAllRegulatoryComplianceControlsDetailsAndStateForSelectedStandard( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.regulatoryComplianceControls().list("PCI-DSS-3.2", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardsGetSamples.java new file mode 100644 index 000000000000..9dd9785ebd42 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for RegulatoryComplianceStandards Get. + */ +public final class RegulatoryComplianceStandardsGetSamples { + /* + * x-ms-original-file: 2019-01-01-preview/RegulatoryCompliance/getRegulatoryComplianceStandard_example.json + */ + /** + * Sample code: Get selected regulatory compliance standard details and state. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSelectedRegulatoryComplianceStandardDetailsAndState( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.regulatoryComplianceStandards().getWithResponse("PCI-DSS-3.2", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardsListSamples.java new file mode 100644 index 000000000000..1eac022b59ec --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for RegulatoryComplianceStandards List. + */ +public final class RegulatoryComplianceStandardsListSamples { + /* + * x-ms-original-file: 2019-01-01-preview/RegulatoryCompliance/getRegulatoryComplianceStandardList_example.json + */ + /** + * Sample code: Get all supported regulatory compliance standards details and state. + * + * @param manager Entry point to SecurityManager. + */ + public static void getAllSupportedRegulatoryComplianceStandardsDetailsAndState( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.regulatoryComplianceStandards().list(null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionsListBySubscriptionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionsListBySubscriptionSamples.java new file mode 100644 index 000000000000..e4fcc138eb59 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionsListBySubscriptionSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for SecureScoreControlDefinitions ListBySubscription. + */ +public final class SecureScoreControlDefinitionsListBySubscriptionSamples { + /* + * x-ms-original-file: + * 2020-01-01/secureScoreControlDefinitions/ListSecureScoreControlDefinitions_subscription_example.json + */ + /** + * Sample code: List security controls definition by subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void + listSecurityControlsDefinitionBySubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.secureScoreControlDefinitions().listBySubscription(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionsListSamples.java new file mode 100644 index 000000000000..8f936ddd8797 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for SecureScoreControlDefinitions List. + */ +public final class SecureScoreControlDefinitionsListSamples { + /* + * x-ms-original-file: 2020-01-01/secureScoreControlDefinitions/ListSecureScoreControlDefinitions_example.json + */ + /** + * Sample code: List security controls definition. + * + * @param manager Entry point to SecurityManager. + */ + public static void listSecurityControlsDefinition(com.azure.resourcemanager.security.SecurityManager manager) { + manager.secureScoreControlDefinitions().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoreControlsListBySecureScoreSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoreControlsListBySecureScoreSamples.java new file mode 100644 index 000000000000..b06ceb122e7a --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoreControlsListBySecureScoreSamples.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.ExpandControlsEnum; + +/** + * Samples for SecureScoreControls ListBySecureScore. + */ +public final class SecureScoreControlsListBySecureScoreSamples { + /* + * x-ms-original-file: 2020-01-01/secureScores/ListSecureScoreControlsForNameWithExpand_builtin_example.json + */ + /** + * Sample code: Get security controls and their current score for the specified initiative with the expand + * parameter. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityControlsAndTheirCurrentScoreForTheSpecifiedInitiativeWithTheExpandParameter( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.secureScoreControls() + .listBySecureScore("ascScore", ExpandControlsEnum.DEFINITION, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2020-01-01/secureScores/ListSecureScoreControlsForName_builtin_example.json + */ + /** + * Sample code: Get security controls and their current score for the specified initiative. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityControlsAndTheirCurrentScoreForTheSpecifiedInitiative( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.secureScoreControls().listBySecureScore("ascScore", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoreControlsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoreControlsListSamples.java new file mode 100644 index 000000000000..4fde9f6ee4f2 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoreControlsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for SecureScoreControls List. + */ +public final class SecureScoreControlsListSamples { + /* + * x-ms-original-file: 2020-01-01/secureScores/ListSecureScoreControls_example.json + */ + /** + * Sample code: List all secure scores controls. + * + * @param manager Entry point to SecurityManager. + */ + public static void listAllSecureScoresControls(com.azure.resourcemanager.security.SecurityManager manager) { + manager.secureScoreControls().list(null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoresGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoresGetSamples.java new file mode 100644 index 000000000000..1b7f33b8cb65 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoresGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for SecureScores Get. + */ +public final class SecureScoresGetSamples { + /* + * x-ms-original-file: 2020-01-01/secureScores/GetSecureScoresSingle_example.json + */ + /** + * Sample code: Get single secure score. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSingleSecureScore(com.azure.resourcemanager.security.SecurityManager manager) { + manager.secureScores().getWithResponse("ascScore", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoresListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoresListSamples.java new file mode 100644 index 000000000000..4c08abb7825b --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoresListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for SecureScores List. + */ +public final class SecureScoresListSamples { + /* + * x-ms-original-file: 2020-01-01/secureScores/ListSecureScores_example.json + */ + /** + * Sample code: List secure scores. + * + * @param manager Entry point to SecurityManager. + */ + public static void listSecureScores(com.azure.resourcemanager.security.SecurityManager manager) { + manager.secureScores().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationsCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..87ee0c262aba --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationsCreateOrUpdateSamples.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.security.fluent.models.ApplicationInner; +import com.azure.resourcemanager.security.models.ApplicationSourceResourceType; +import java.io.IOException; +import java.util.Arrays; + +/** + * Samples for SecurityConnectorApplications CreateOrUpdate. + */ +public final class SecurityConnectorApplicationsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2022-07-01-preview/Applications/PutSecurityConnectorApplication_example.json + */ + /** + * Sample code: Create Application. + * + * @param manager Entry point to SecurityManager. + */ + public static void createApplication(com.azure.resourcemanager.security.SecurityManager manager) + throws IOException { + manager.securityConnectorApplications() + .createOrUpdateWithResponse("gcpResourceGroup", "gcpconnector", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", + new ApplicationInner().withDisplayName("GCP Admin's application") + .withDescription("An application on critical GCP recommendations") + .withSourceResourceType(ApplicationSourceResourceType.ASSESSMENTS) + .withConditionSets(Arrays.asList(SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize( + "{\"conditions\":[{\"operator\":\"contains\",\"property\":\"$.Id\",\"value\":\"-prod-\"}]}", + Object.class, SerializerEncoding.JSON))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationsDeleteSamples.java new file mode 100644 index 000000000000..b8ca8f8fd235 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationsDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for SecurityConnectorApplications Delete. + */ +public final class SecurityConnectorApplicationsDeleteSamples { + /* + * x-ms-original-file: 2022-07-01-preview/Applications/DeleteSecurityConnectorApplication_example.json + */ + /** + * Sample code: Delete security Application. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteSecurityApplication(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityConnectorApplications() + .deleteWithResponse("gcpResourceGroup", "gcpconnector", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationsGetSamples.java new file mode 100644 index 000000000000..f7a31becf5df --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationsGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for SecurityConnectorApplications Get. + */ +public final class SecurityConnectorApplicationsGetSamples { + /* + * x-ms-original-file: 2022-07-01-preview/Applications/GetSecurityConnectorApplication_example.json + */ + /** + * Sample code: Get security applications by specific applicationId. + * + * @param manager Entry point to SecurityManager. + */ + public static void + getSecurityApplicationsBySpecificApplicationId(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityConnectorApplications() + .getWithResponse("gcpResourceGroup", "gcpconnector", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationsListSamples.java new file mode 100644 index 000000000000..56362b7b2e01 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationsListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for SecurityConnectorApplications List. + */ +public final class SecurityConnectorApplicationsListSamples { + /* + * x-ms-original-file: 2022-07-01-preview/Applications/ListBySecurityConnectorApplications_example.json + */ + /** + * Sample code: List security applications by security connector level scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void listSecurityApplicationsBySecurityConnectorLevelScope( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityConnectorApplications() + .list("gcpResourceGroup", "gcpconnector", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..a50109675834 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsCreateOrUpdateSamples.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.AwsEnvironmentData; +import com.azure.resourcemanager.security.models.CloudName; +import com.azure.resourcemanager.security.models.CspmMonitorAwsOffering; +import com.azure.resourcemanager.security.models.CspmMonitorAwsOfferingNativeCloudConnection; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SecurityConnectors CreateOrUpdate. + */ +public final class SecurityConnectorsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2024-08-01-preview/SecurityConnectors/PutSecurityConnector_example.json + */ + /** + * Sample code: Create or update a security connector. + * + * @param manager Entry point to SecurityManager. + */ + public static void createOrUpdateASecurityConnector(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityConnectors() + .define("exampleSecurityConnectorName") + .withExistingResourceGroup("exampleResourceGroup") + .withRegion("Central US") + .withTags(mapOf()) + .withEtag("etag value (must be supplied for update)") + .withHierarchyIdentifier("exampleHierarchyId") + .withEnvironmentName(CloudName.AWS) + .withOfferings(Arrays.asList( + new CspmMonitorAwsOffering().withNativeCloudConnection(new CspmMonitorAwsOfferingNativeCloudConnection() + .withCloudRoleArn("arn:aws:iam::00000000:role/ASCMonitor")))) + .withEnvironmentData(new AwsEnvironmentData().withScanInterval(4L)) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsDeleteSamples.java new file mode 100644 index 000000000000..a6ef72a2f2d6 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for SecurityConnectors Delete. + */ +public final class SecurityConnectorsDeleteSamples { + /* + * x-ms-original-file: 2024-08-01-preview/SecurityConnectors/DeleteSecurityConnector_example.json + */ + /** + * Sample code: Delete a security connector. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteASecurityConnector(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityConnectors() + .deleteByResourceGroupWithResponse("myRg", "mySecurityConnectorName", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsGetByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..78af11773809 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsGetByResourceGroupSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for SecurityConnectors GetByResourceGroup. + */ +public final class SecurityConnectorsGetByResourceGroupSamples { + /* + * x-ms-original-file: 2024-08-01-preview/SecurityConnectors/GetSecurityConnectorSingleResource_example.json + */ + /** + * Sample code: Retrieve a security connector. + * + * @param manager Entry point to SecurityManager. + */ + public static void retrieveASecurityConnector(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityConnectors() + .getByResourceGroupWithResponse("exampleResourceGroup", "exampleSecurityConnectorName", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsListByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsListByResourceGroupSamples.java new file mode 100644 index 000000000000..e968e891e88b --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for SecurityConnectors ListByResourceGroup. + */ +public final class SecurityConnectorsListByResourceGroupSamples { + /* + * x-ms-original-file: 2024-08-01-preview/SecurityConnectors/GetSecurityConnectorsResourceGroup_example.json + */ + /** + * Sample code: List all security connectors of a specified resource group. + * + * @param manager Entry point to SecurityManager. + */ + public static void + listAllSecurityConnectorsOfASpecifiedResourceGroup(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityConnectors().listByResourceGroup("exampleResourceGroup", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsListSamples.java new file mode 100644 index 000000000000..df07990380d6 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for SecurityConnectors List. + */ +public final class SecurityConnectorsListSamples { + /* + * x-ms-original-file: 2024-08-01-preview/SecurityConnectors/GetSecurityConnectorsSubscription_example.json + */ + /** + * Sample code: List all security connectors of a specified subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void + listAllSecurityConnectorsOfASpecifiedSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityConnectors().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsUpdateSamples.java new file mode 100644 index 000000000000..94bd3c2570d1 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsUpdateSamples.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.AwsEnvironmentData; +import com.azure.resourcemanager.security.models.CloudName; +import com.azure.resourcemanager.security.models.CspmMonitorAwsOffering; +import com.azure.resourcemanager.security.models.CspmMonitorAwsOfferingNativeCloudConnection; +import com.azure.resourcemanager.security.models.SecurityConnector; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SecurityConnectors Update. + */ +public final class SecurityConnectorsUpdateSamples { + /* + * x-ms-original-file: 2024-08-01-preview/SecurityConnectors/PatchSecurityConnector_example.json + */ + /** + * Sample code: Update a security connector. + * + * @param manager Entry point to SecurityManager. + */ + public static void updateASecurityConnector(com.azure.resourcemanager.security.SecurityManager manager) { + SecurityConnector resource = manager.securityConnectors() + .getByResourceGroupWithResponse("exampleResourceGroup", "exampleSecurityConnectorName", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf()) + .withEtag("etag value (must be supplied for update)") + .withHierarchyIdentifier("exampleHierarchyId") + .withEnvironmentName(CloudName.AWS) + .withOfferings(Arrays.asList( + new CspmMonitorAwsOffering().withNativeCloudConnection(new CspmMonitorAwsOfferingNativeCloudConnection() + .withCloudRoleArn("arn:aws:iam::00000000:role/ASCMonitor")))) + .withEnvironmentData(new AwsEnvironmentData()) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityContactsCreateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityContactsCreateSamples.java new file mode 100644 index 000000000000..177d932119d9 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityContactsCreateSamples.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.MinimalRiskLevel; +import com.azure.resourcemanager.security.models.MinimalSeverity; +import com.azure.resourcemanager.security.models.NotificationsSourceAlert; +import com.azure.resourcemanager.security.models.NotificationsSourceAttackPath; +import com.azure.resourcemanager.security.models.SecurityContactName; +import com.azure.resourcemanager.security.models.SecurityContactPropertiesNotificationsByRole; +import com.azure.resourcemanager.security.models.SecurityContactRole; +import com.azure.resourcemanager.security.models.State; +import java.util.Arrays; + +/** + * Samples for SecurityContacts Create. + */ +public final class SecurityContactsCreateSamples { + /* + * x-ms-original-file: 2023-12-01-preview/SecurityContacts/CreateSecurityContact_example.json + */ + /** + * Sample code: Create security contact data. + * + * @param manager Entry point to SecurityManager. + */ + public static void createSecurityContactData(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityContacts() + .define(SecurityContactName.DEFAULT) + .withEmails("john@contoso.com;jane@contoso.com") + .withPhone("(214)275-4038") + .withIsEnabled(true) + .withNotificationsSources( + Arrays.asList(new NotificationsSourceAttackPath().withMinimalRiskLevel(MinimalRiskLevel.CRITICAL), + new NotificationsSourceAlert().withMinimalSeverity(MinimalSeverity.MEDIUM))) + .withNotificationsByRole(new SecurityContactPropertiesNotificationsByRole().withState(State.ON) + .withRoles(Arrays.asList(SecurityContactRole.OWNER))) + .create(); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityContactsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityContactsDeleteSamples.java new file mode 100644 index 000000000000..8bab294affc6 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityContactsDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.SecurityContactName; + +/** + * Samples for SecurityContacts Delete. + */ +public final class SecurityContactsDeleteSamples { + /* + * x-ms-original-file: 2023-12-01-preview/SecurityContacts/DeleteSecurityContact_example.json + */ + /** + * Sample code: Deletes a security contact data. + * + * @param manager Entry point to SecurityManager. + */ + public static void deletesASecurityContactData(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityContacts().deleteWithResponse(SecurityContactName.DEFAULT, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityContactsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityContactsGetSamples.java new file mode 100644 index 000000000000..1aaf714bc112 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityContactsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.SecurityContactName; + +/** + * Samples for SecurityContacts Get. + */ +public final class SecurityContactsGetSamples { + /* + * x-ms-original-file: 2023-12-01-preview/SecurityContacts/GetSecurityContact_example.json + */ + /** + * Sample code: Get a security contact. + * + * @param manager Entry point to SecurityManager. + */ + public static void getASecurityContact(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityContacts().getWithResponse(SecurityContactName.DEFAULT, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityContactsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityContactsListSamples.java new file mode 100644 index 000000000000..77fb535510a7 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityContactsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for SecurityContacts List. + */ +public final class SecurityContactsListSamples { + /* + * x-ms-original-file: 2023-12-01-preview/SecurityContacts/GetSecurityContactsSubscription_example.json + */ + /** + * Sample code: List security contact data. + * + * @param manager Entry point to SecurityManager. + */ + public static void listSecurityContactData(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityContacts().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityOperatorsCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityOperatorsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..827818c7da7f --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityOperatorsCreateOrUpdateSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for SecurityOperators CreateOrUpdate. + */ +public final class SecurityOperatorsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2023-01-01-preview/SecurityOperators/PutSecurityOperatorByName_example.json + */ + /** + * Sample code: Create a security operator on the given scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void + createASecurityOperatorOnTheGivenScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityOperators() + .createOrUpdateWithResponse("CloudPosture", "DefenderCSPMSecurityOperator", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityOperatorsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityOperatorsDeleteSamples.java new file mode 100644 index 000000000000..6e1f95c41ba6 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityOperatorsDeleteSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for SecurityOperators Delete. + */ +public final class SecurityOperatorsDeleteSamples { + /* + * x-ms-original-file: 2023-01-01-preview/SecurityOperators/DeleteSecurityOperatorByName_example.json + */ + /** + * Sample code: Delete SecurityOperator on subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void + deleteSecurityOperatorOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityOperators() + .deleteByResourceGroupWithResponse("CloudPosture", "DefenderCSPMSecurityOperator", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityOperatorsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityOperatorsGetSamples.java new file mode 100644 index 000000000000..5b9e4bcb4030 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityOperatorsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for SecurityOperators Get. + */ +public final class SecurityOperatorsGetSamples { + /* + * x-ms-original-file: 2023-01-01-preview/SecurityOperators/GetSecurityOperatorByName_example.json + */ + /** + * Sample code: Get a specific security operator by scope and securityOperatorName. + * + * @param manager Entry point to SecurityManager. + */ + public static void getASpecificSecurityOperatorByScopeAndSecurityOperatorName( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityOperators() + .getWithResponse("CloudPosture", "DefenderCSPMSecurityOperator", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityOperatorsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityOperatorsListSamples.java new file mode 100644 index 000000000000..492917b9a6b0 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityOperatorsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for SecurityOperators List. + */ +public final class SecurityOperatorsListSamples { + /* + * x-ms-original-file: 2023-01-01-preview/SecurityOperators/ListSecurityOperators_example.json + */ + /** + * Sample code: List SecurityOperators. + * + * @param manager Entry point to SecurityManager. + */ + public static void listSecurityOperators(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityOperators().list("CloudPosture", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecuritySolutionsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecuritySolutionsGetSamples.java new file mode 100644 index 000000000000..041b95f09a44 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecuritySolutionsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for SecuritySolutions Get. + */ +public final class SecuritySolutionsGetSamples { + /* + * x-ms-original-file: 2020-01-01/SecuritySolutions/GetSecuritySolutionsResourceGroupLocation_example.json + */ + /** + * Sample code: Get a security solution from a security data location. + * + * @param manager Entry point to SecurityManager. + */ + public static void + getASecuritySolutionFromASecurityDataLocation(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securitySolutions() + .getWithResponse("myRg2", "centralus", "paloalto7", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecuritySolutionsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecuritySolutionsListSamples.java new file mode 100644 index 000000000000..d8b975d410fa --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecuritySolutionsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for SecuritySolutions List. + */ +public final class SecuritySolutionsListSamples { + /* + * x-ms-original-file: 2020-01-01/SecuritySolutions/GetSecuritySolutionsSubscription_example.json + */ + /** + * Sample code: Get security solutions. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecuritySolutions(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securitySolutions().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDataListByHomeRegionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDataListByHomeRegionSamples.java new file mode 100644 index 000000000000..ae94710a3cf9 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDataListByHomeRegionSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for SecuritySolutionsReferenceData ListByHomeRegion. + */ +public final class SecuritySolutionsReferenceDataListByHomeRegionSamples { + /* + * x-ms-original-file: + * 2020-01-01/SecuritySolutionsReferenceData/GetSecuritySolutionsReferenceDataSubscriptionLocation_example.json + */ + /** + * Sample code: Get security solutions from a security data location. + * + * @param manager Entry point to SecurityManager. + */ + public static void + getSecuritySolutionsFromASecurityDataLocation(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securitySolutionsReferenceDatas() + .listByHomeRegionWithResponse("westcentralus", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDataListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDataListSamples.java new file mode 100644 index 000000000000..31105900cb9f --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDataListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for SecuritySolutionsReferenceData List. + */ +public final class SecuritySolutionsReferenceDataListSamples { + /* + * x-ms-original-file: + * 2020-01-01/SecuritySolutionsReferenceData/GetSecuritySolutionsReferenceDataSubscription_example.json + */ + /** + * Sample code: Get security solutions. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecuritySolutions(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securitySolutionsReferenceDatas().listWithResponse(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityStandardsCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityStandardsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..14e453b007e6 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityStandardsCreateOrUpdateSamples.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.PartialAssessmentProperties; +import com.azure.resourcemanager.security.models.StandardSupportedCloud; +import java.util.Arrays; + +/** + * Samples for SecurityStandards CreateOrUpdate. + */ +public final class SecurityStandardsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2024-08-01/SecurityStandards/PutBySubscriptionSecurityStandard_example.json + */ + /** + * Sample code: Create or update security standard over subscription scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void createOrUpdateSecurityStandardOverSubscriptionScope( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityStandards() + .define("8bb8be0a-6010-4789-812f-e4d661c4ed0e") + .withExistingScope("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23") + .withDisplayName("Azure Test Security Standard 1") + .withDescription("description of Azure Test Security Standard 1") + .withAssessments(Arrays.asList(new PartialAssessmentProperties().withAssessmentKey("fakeTokenPlaceholder"), + new PartialAssessmentProperties().withAssessmentKey("fakeTokenPlaceholder"))) + .withCloudProviders(Arrays.asList(StandardSupportedCloud.GCP)) + .withPolicySetDefinitionId( + "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Authorization/policySetDefinitions/patchorchestration-applicationversions") + .create(); + } + + /* + * x-ms-original-file: 2024-08-01/SecurityStandards/PutBySecurityConnectorSecurityStandard_example.json + */ + /** + * Sample code: Create or update security standard over security connector scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void createOrUpdateSecurityStandardOverSecurityConnectorScope( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityStandards() + .define("8bb8be0a-6010-4789-812f-e4d661c4ed0e") + .withExistingScope( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector") + .withDisplayName("Azure Test Security Standard 1") + .withDescription("description of Azure Test Security Standard 1") + .withAssessments(Arrays.asList(new PartialAssessmentProperties().withAssessmentKey("fakeTokenPlaceholder"), + new PartialAssessmentProperties().withAssessmentKey("fakeTokenPlaceholder"))) + .withCloudProviders(Arrays.asList(StandardSupportedCloud.GCP)) + .create(); + } + + /* + * x-ms-original-file: 2024-08-01/SecurityStandards/PutByManagementGroupSecurityStandard_example.json + */ + /** + * Sample code: Create or update security standard over management group scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void createOrUpdateSecurityStandardOverManagementGroupScope( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityStandards() + .define("8bb8be0a-6010-4789-812f-e4d661c4ed0e") + .withExistingScope("providers/Microsoft.Management/managementGroups/contoso") + .withDisplayName("Azure Test Security Standard 1") + .withDescription("description of Azure Test Security Standard 1") + .withAssessments(Arrays.asList(new PartialAssessmentProperties().withAssessmentKey("fakeTokenPlaceholder"), + new PartialAssessmentProperties().withAssessmentKey("fakeTokenPlaceholder"))) + .withCloudProviders(Arrays.asList(StandardSupportedCloud.GCP)) + .withPolicySetDefinitionId( + "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Authorization/policySetDefinitions/patchorchestration-applicationversions") + .create(); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityStandardsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityStandardsDeleteSamples.java new file mode 100644 index 000000000000..dd16ae40ca8c --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityStandardsDeleteSamples.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for SecurityStandards Delete. + */ +public final class SecurityStandardsDeleteSamples { + /* + * x-ms-original-file: 2024-08-01/SecurityStandards/DeleteBySecurityConnectorSecurityStandard_example.json + */ + /** + * Sample code: Delete a security standard over security connector scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void + deleteASecurityStandardOverSecurityConnectorScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityStandards() + .deleteByResourceGroupWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2024-08-01/SecurityStandards/DeleteByManagementGroupSecurityStandard_example.json + */ + /** + * Sample code: Delete a security standard over management group scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void + deleteASecurityStandardOverManagementGroupScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityStandards() + .deleteByResourceGroupWithResponse("providers/Microsoft.Management/managementGroups/contoso", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2024-08-01/SecurityStandards/DeleteBySubscriptionSecurityStandard_example.json + */ + /** + * Sample code: Delete a security standard over subscription scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void + deleteASecurityStandardOverSubscriptionScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityStandards() + .deleteByResourceGroupWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityStandardsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityStandardsGetSamples.java new file mode 100644 index 000000000000..b3b433d9ec8f --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityStandardsGetSamples.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for SecurityStandards Get. + */ +public final class SecurityStandardsGetSamples { + /* + * x-ms-original-file: 2024-08-01/SecurityStandards/GetBySecurityConnectorSecurityStandard_example.json + */ + /** + * Sample code: Get a security standard over security connector scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void + getASecurityStandardOverSecurityConnectorScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityStandards() + .getWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", + "1f3afdf9-d0c9-4c3d-847f-89da613e70a8", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2024-08-01/SecurityStandards/GetByManagementGroupSecurityStandard_example.json + */ + /** + * Sample code: Get a security standard over management group scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void + getASecurityStandardOverManagementGroupScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityStandards() + .getWithResponse("providers/Microsoft.Management/managementGroups/contoso", + "1f3afdf9-d0c9-4c3d-847f-89da613e70a8", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2024-08-01/SecurityStandards/GetBySubscriptionSecurityStandard_example.json + */ + /** + * Sample code: Get a security standard over subscription scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void + getASecurityStandardOverSubscriptionScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityStandards() + .getWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", + "1f3afdf9-d0c9-4c3d-847f-89da613e70a8", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityStandardsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityStandardsListSamples.java new file mode 100644 index 000000000000..cf8cb72e0172 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityStandardsListSamples.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for SecurityStandards List. + */ +public final class SecurityStandardsListSamples { + /* + * x-ms-original-file: 2024-08-01/SecurityStandards/ListByManagementGroupSecurityStandards_example.json + */ + /** + * Sample code: List security standards by management group scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void + listSecurityStandardsByManagementGroupScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityStandards() + .list("providers/Microsoft.Management/managementGroups/contoso", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2024-08-01/SecurityStandards/ListBySubscriptionSecurityStandards_example.json + */ + /** + * Sample code: List security standards by subscription scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void + listSecurityStandardsBySubscriptionScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityStandards() + .list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2024-08-01/SecurityStandards/ListBySecurityConnectorSecurityStandards_example.json + */ + /** + * Sample code: List security standards by security connector scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void + listSecurityStandardsBySecurityConnectorScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.securityStandards() + .list( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SensitivitySettingsCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SensitivitySettingsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..e0a313c3cab5 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SensitivitySettingsCreateOrUpdateSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.UpdateSensitivitySettingsRequest; +import java.util.Arrays; + +/** + * Samples for SensitivitySettings CreateOrUpdate. + */ +public final class SensitivitySettingsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2023-02-15-preview/SensitivitySettings/PutSensitivitySettings_example.json + */ + /** + * Sample code: Update sensitivity settings. + * + * @param manager Entry point to SecurityManager. + */ + public static void updateSensitivitySettings(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sensitivitySettings() + .createOrUpdateWithResponse( + new UpdateSensitivitySettingsRequest() + .withSensitiveInfoTypesIds(Arrays.asList("f2f8a7a1-28c0-404b-9ab4-30a0a7af18cb", + "b452f22b-f87d-4f48-8490-ecf0873325b5", "d59ee8b6-2618-404b-a5e7-aa377cd67543")) + .withSensitivityThresholdLabelOrder(2.0F) + .withSensitivityThresholdLabelId("f2f8a7a1-28c0-404b-9ab4-30a0a7af18cb"), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SensitivitySettingsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SensitivitySettingsGetSamples.java new file mode 100644 index 000000000000..e671093033d5 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SensitivitySettingsGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for SensitivitySettings Get. + */ +public final class SensitivitySettingsGetSamples { + /* + * x-ms-original-file: 2023-02-15-preview/SensitivitySettings/GetSensitivitySettings_example.json + */ + /** + * Sample code: Get sensitivity settings. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSensitivitySettings(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sensitivitySettings().getWithResponse(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SensitivitySettingsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SensitivitySettingsListSamples.java new file mode 100644 index 000000000000..750494d93a82 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SensitivitySettingsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for SensitivitySettings List. + */ +public final class SensitivitySettingsListSamples { + /* + * x-ms-original-file: 2023-02-15-preview/SensitivitySettings/GetSensitivitySettingsList_example.json + */ + /** + * Sample code: Get sensitivity settings list. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSensitivitySettingsList(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sensitivitySettings().listWithResponse(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentCreateOrUpdateSamples.java new file mode 100644 index 000000000000..d4d46cfd5256 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentCreateOrUpdateSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for ServerVulnerabilityAssessment CreateOrUpdate. + */ +public final class ServerVulnerabilityAssessmentCreateOrUpdateSamples { + /* + * x-ms-original-file: 2020-01-01/ServerVulnerabilityAssessments/CreateServerVulnerabilityAssessments_example.json + */ + /** + * Sample code: Create a server vulnerability assessments on a resource. Only 'default' resource is supported. Once + * creating the resource, the server will be onboarded to vulnerability assessment by Microsoft.Security. + * + * @param manager Entry point to SecurityManager. + */ + public static void + createAServerVulnerabilityAssessmentsOnAResourceOnlyDefaultResourceIsSupportedOnceCreatingTheResourceTheServerWillBeOnboardedToVulnerabilityAssessmentByMicrosoftSecurity( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.serverVulnerabilityAssessments() + .createOrUpdateWithResponse("rg1", "Microsoft.Compute", "virtualMachines", "vm1", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentDeleteSamples.java new file mode 100644 index 000000000000..96abde2b6c3a --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentDeleteSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for ServerVulnerabilityAssessment Delete. + */ +public final class ServerVulnerabilityAssessmentDeleteSamples { + /* + * x-ms-original-file: 2020-01-01/ServerVulnerabilityAssessments/DeleteServerVulnerabilityAssessments_example.json + */ + /** + * Sample code: Delete a server vulnerability assessments on a resource. Only 'default' resource is supported. Once + * deleting, Microsoft.Security will not provide vulnerability assessment findings on the resource. + * + * @param manager Entry point to SecurityManager. + */ + public static void + deleteAServerVulnerabilityAssessmentsOnAResourceOnlyDefaultResourceIsSupportedOnceDeletingMicrosoftSecurityWillNotProvideVulnerabilityAssessmentFindingsOnTheResource( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.serverVulnerabilityAssessments() + .delete("rg1", "Microsoft.Compute", "virtualMachines", "vm1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentGetSamples.java new file mode 100644 index 000000000000..61637ae3a52b --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentGetSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for ServerVulnerabilityAssessment Get. + */ +public final class ServerVulnerabilityAssessmentGetSamples { + /* + * x-ms-original-file: 2020-01-01/ServerVulnerabilityAssessments/GetServerVulnerabilityAssessments_example.json + */ + /** + * Sample code: Get a server vulnerability assessments onboarding status on a resource. Currently Microsoft.Security + * only supports the single 'default' resource. + * + * @param manager Entry point to SecurityManager. + */ + public static void + getAServerVulnerabilityAssessmentsOnboardingStatusOnAResourceCurrentlyMicrosoftSecurityOnlySupportsTheSingleDefaultResource( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.serverVulnerabilityAssessments() + .getWithResponse("rg1", "Microsoft.Compute", "virtualMachines", "vm1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentListByExtendedResourceSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentListByExtendedResourceSamples.java new file mode 100644 index 000000000000..4db4fb40a989 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentListByExtendedResourceSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for ServerVulnerabilityAssessment ListByExtendedResource. + */ +public final class ServerVulnerabilityAssessmentListByExtendedResourceSamples { + /* + * x-ms-original-file: + * 2020-01-01/ServerVulnerabilityAssessments/ListByExtendedResourceServerVulnerabilityAssessments_example.json + */ + /** + * Sample code: Get a list of server vulnerability assessments on a resource. Though this API returns a list, + * Currently Microsoft.Security only supports a single default type of server vulnerability assessment. + * + * @param manager Entry point to SecurityManager. + */ + public static void + getAListOfServerVulnerabilityAssessmentsOnAResourceThoughThisAPIReturnsAListCurrentlyMicrosoftSecurityOnlySupportsASingleDefaultTypeOfServerVulnerabilityAssessment( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.serverVulnerabilityAssessments() + .listByExtendedResourceWithResponse("rg1", "Microsoft.Compute", "virtualMachines", "vm1", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsSettingsCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsSettingsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..ff0d4b5f3ca2 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsSettingsCreateOrUpdateSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.AzureServersSetting; +import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsAzureSettingSelectedProvider; +import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsSettingKindName; + +/** + * Samples for ServerVulnerabilityAssessmentsSettings CreateOrUpdate. + */ +public final class ServerVulnerabilityAssessmentsSettingsCreateOrUpdateSamples { + /* + * x-ms-original-file: + * 2023-05-01/ServerVulnerabilityAssessmentsSettings/PutServerVulnerabilityAssessmentsSetting_example.json + */ + /** + * Sample code: Set a server vulnerability assessments setting of the kind settingKind on the subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void setAServerVulnerabilityAssessmentsSettingOfTheKindSettingKindOnTheSubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.serverVulnerabilityAssessmentsSettings() + .createOrUpdateWithResponse(ServerVulnerabilityAssessmentsSettingKindName.AZURE_SERVERS_SETTING, + new AzureServersSetting() + .withSelectedProvider(ServerVulnerabilityAssessmentsAzureSettingSelectedProvider.MDE_TVM), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsSettingsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsSettingsDeleteSamples.java new file mode 100644 index 000000000000..309a50e9b29a --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsSettingsDeleteSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsSettingKindName; + +/** + * Samples for ServerVulnerabilityAssessmentsSettings Delete. + */ +public final class ServerVulnerabilityAssessmentsSettingsDeleteSamples { + /* + * x-ms-original-file: + * 2023-05-01/ServerVulnerabilityAssessmentsSettings/DeleteServerVulnerabilityAssessmentsSetting_example.json + */ + /** + * Sample code: Delete the server vulnerability assessments setting of the kind settingKind from the subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteTheServerVulnerabilityAssessmentsSettingOfTheKindSettingKindFromTheSubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.serverVulnerabilityAssessmentsSettings() + .deleteWithResponse(ServerVulnerabilityAssessmentsSettingKindName.AZURE_SERVERS_SETTING, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsSettingsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsSettingsGetSamples.java new file mode 100644 index 000000000000..0b5584f5db97 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsSettingsGetSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsSettingKindName; + +/** + * Samples for ServerVulnerabilityAssessmentsSettings Get. + */ +public final class ServerVulnerabilityAssessmentsSettingsGetSamples { + /* + * x-ms-original-file: + * 2023-05-01/ServerVulnerabilityAssessmentsSettings/GetServerVulnerabilityAssessmentsSetting_example.json + */ + /** + * Sample code: Get the server vulnerability assessments setting of the kind settingKind that is set on the + * subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void getTheServerVulnerabilityAssessmentsSettingOfTheKindSettingKindThatIsSetOnTheSubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.serverVulnerabilityAssessmentsSettings() + .getWithResponse(ServerVulnerabilityAssessmentsSettingKindName.AZURE_SERVERS_SETTING, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsSettingsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsSettingsListSamples.java new file mode 100644 index 000000000000..4881f170a588 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsSettingsListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for ServerVulnerabilityAssessmentsSettings List. + */ +public final class ServerVulnerabilityAssessmentsSettingsListSamples { + /* + * x-ms-original-file: + * 2023-05-01/ServerVulnerabilityAssessmentsSettings/ListServerVulnerabilityAssessmentsSettings_example.json + */ + /** + * Sample code: List the server vulnerability assessments settings set on the subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void listTheServerVulnerabilityAssessmentsSettingsSetOnTheSubscription( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.serverVulnerabilityAssessmentsSettings().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SettingsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SettingsGetSamples.java new file mode 100644 index 000000000000..0c169c9b4dcf --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SettingsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.SettingName; + +/** + * Samples for Settings Get. + */ +public final class SettingsGetSamples { + /* + * x-ms-original-file: 2022-05-01/Settings/GetSetting_example.json + */ + /** + * Sample code: Get a setting on subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void getASettingOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.settings().getWithResponse(SettingName.WDATP, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SettingsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SettingsListSamples.java new file mode 100644 index 000000000000..259eda37b432 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SettingsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for Settings List. + */ +public final class SettingsListSamples { + /* + * x-ms-original-file: 2022-05-01/Settings/GetSettings_example.json + */ + /** + * Sample code: Get settings of subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSettingsOfSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.settings().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SettingsUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SettingsUpdateSamples.java new file mode 100644 index 000000000000..7728af96f928 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SettingsUpdateSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.DataExportSettings; +import com.azure.resourcemanager.security.models.SettingName; + +/** + * Samples for Settings Update. + */ +public final class SettingsUpdateSamples { + /* + * x-ms-original-file: 2022-05-01/Settings/UpdateSetting_example.json + */ + /** + * Sample code: Update a setting for subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void updateASettingForSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.settings() + .updateWithResponse(SettingName.WDATP, new DataExportSettings().withEnabled(true), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesAddSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesAddSamples.java new file mode 100644 index 000000000000..e102d471b8c8 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesAddSamples.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.RulesResultsInput; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SqlVulnerabilityAssessmentBaselineRules Add. + */ +public final class SqlVulnerabilityAssessmentBaselineRulesAddSamples { + /* + * x-ms-original-file: 2026-04-01-preview/sqlVulnerabilityAssessmentsBaselineRuleOperations/ + * ServerLevel_SqlManagedInstanceBaselineRules_Add.json + */ + /** + * Sample code: Set baseline rules on a resource (using databaseName parameter) - Sql Managed Instance. + * + * @param manager Entry point to SecurityManager. + */ + public static void setBaselineRulesOnAResourceUsingDatabaseNameParameterSqlManagedInstance( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentBaselineRules() + .addWithResponse( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Sql/managedInstances/myManagedInstance", + "master", new RulesResultsInput().withLatestScan(true).withResults(mapOf()), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsBaselineRuleOperations/SqlManagedInstanceBaselineRules_Add.json + */ + /** + * Sample code: Set baseline rules on a resource - Sql Managed Instance. + * + * @param manager Entry point to SecurityManager. + */ + public static void + setBaselineRulesOnAResourceSqlManagedInstance(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentBaselineRules() + .addWithResponse( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Sql/managedInstances/myManagedInstance/databases/db", + null, new RulesResultsInput().withLatestScan(true).withResults(mapOf()), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsBaselineRuleOperations/ServerLevel_SqlServerBaselineRules_Add.json + */ + /** + * Sample code: Set baseline rules on a resource (using databaseName parameter) - Sql Server. + * + * @param manager Entry point to SecurityManager. + */ + public static void setBaselineRulesOnAResourceUsingDatabaseNameParameterSqlServer( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentBaselineRules() + .addWithResponse( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Sql/servers/myServer", + "master", new RulesResultsInput().withLatestScan(true).withResults(mapOf()), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsBaselineRuleOperations/VirtualMachineBaselineRules_Add.json + */ + /** + * Sample code: Set baseline rules on a resource - Virtual Machine. + * + * @param manager Entry point to SecurityManager. + */ + public static void + setBaselineRulesOnAResourceVirtualMachine(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentBaselineRules() + .addWithResponse( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Compute/virtualMachines/myVm/sqlServers/server1/databases/master", + null, new RulesResultsInput().withLatestScan(true).withResults(mapOf()), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsBaselineRuleOperations/ServerLevel_SynapseBaselineRules_Add.json + */ + /** + * Sample code: Set baseline rules on a resource (using databaseName parameter) - Synapse. + * + * @param manager Entry point to SecurityManager. + */ + public static void setBaselineRulesOnAResourceUsingDatabaseNameParameterSynapse( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentBaselineRules() + .addWithResponse( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Synapse/workspaces/myWorkspace", + "master", new RulesResultsInput().withLatestScan(true).withResults(mapOf()), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsBaselineRuleOperations/SqlServerBaselineRules_Add.json + */ + /** + * Sample code: Set baseline rules on a resource - Sql Server. + * + * @param manager Entry point to SecurityManager. + */ + public static void + setBaselineRulesOnAResourceSqlServer(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentBaselineRules() + .addWithResponse( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Sql/servers/myServer/databases/db", + null, new RulesResultsInput().withLatestScan(true).withResults(mapOf()), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsBaselineRuleOperations/SynapseBaselineRules_Add.json + */ + /** + * Sample code: Set baseline rules on a resource - Synapse. + * + * @param manager Entry point to SecurityManager. + */ + public static void setBaselineRulesOnAResourceSynapse(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentBaselineRules() + .addWithResponse( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Synapse/workspaces/myWorkspace/sqlPools/myPool", + null, new RulesResultsInput().withLatestScan(true).withResults(mapOf()), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Add.json + */ + /** + * Sample code: Set baseline rules on a resource - Arc Machine. + * + * @param manager Entry point to SecurityManager. + */ + public static void + setBaselineRulesOnAResourceArcMachine(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentBaselineRules() + .addWithResponse( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", + null, new RulesResultsInput().withLatestScan(true).withResults(mapOf()), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesCreateOrUpdateSamples.java new file mode 100644 index 000000000000..3e3a9834711d --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesCreateOrUpdateSamples.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import java.util.Arrays; + +/** + * Samples for SqlVulnerabilityAssessmentBaselineRules CreateOrUpdate. + */ +public final class SqlVulnerabilityAssessmentBaselineRulesCreateOrUpdateSamples { + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsBaselineRuleOperations/SqlServerBaselineRules_Put.json + */ + /** + * Sample code: Create a baseline for a rule on a resource - Sql Server. + * + * @param manager Entry point to SecurityManager. + */ + public static void + createABaselineForARuleOnAResourceSqlServer(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentBaselineRules() + .define("VA1234") + .withExistingResourceId( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Sql/servers/myServer/databases/db") + .withLatestScan(false) + .withResults(Arrays.asList(Arrays.asList("userA", "SELECT"), Arrays.asList("userB", "SELECT"))) + .create(); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Put.json + */ + /** + * Sample code: Create a baseline for a rule on a resource - Arc Machine. + * + * @param manager Entry point to SecurityManager. + */ + public static void + createABaselineForARuleOnAResourceArcMachine(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentBaselineRules() + .define("VA1234") + .withExistingResourceId( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master") + .withLatestScan(false) + .withResults(Arrays.asList(Arrays.asList("userA", "SELECT"), Arrays.asList("userB", "SELECT"))) + .create(); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsBaselineRuleOperations/SqlManagedInstanceBaselineRules_Put.json + */ + /** + * Sample code: Create a baseline for a rule on a resource - Sql Managed Instance. + * + * @param manager Entry point to SecurityManager. + */ + public static void createABaselineForARuleOnAResourceSqlManagedInstance( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentBaselineRules() + .define("VA1234") + .withExistingResourceId( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Sql/managedInstances/myManagedInstance/databases/db") + .withLatestScan(false) + .withResults(Arrays.asList(Arrays.asList("userA", "SELECT"), Arrays.asList("userB", "SELECT"))) + .create(); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsBaselineRuleOperations/ServerLevel_SynapseBaselineRules_Put.json + */ + /** + * Sample code: Create a baseline for a rule on a resource (using databaseName parameter) - Synapse. + * + * @param manager Entry point to SecurityManager. + */ + public static void createABaselineForARuleOnAResourceUsingDatabaseNameParameterSynapse( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentBaselineRules() + .define("VA1234") + .withExistingResourceId( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Synapse/workspaces/myWorkspace") + .withLatestScan(false) + .withResults(Arrays.asList(Arrays.asList("userA", "SELECT"), Arrays.asList("userB", "SELECT"))) + .withDatabaseName("master") + .create(); + } + + /* + * x-ms-original-file: 2026-04-01-preview/sqlVulnerabilityAssessmentsBaselineRuleOperations/ + * ServerLevel_SqlManagedInstanceBaselineRules_Put.json + */ + /** + * Sample code: Create a baseline for a rule on a resource (using databaseName parameter) - Sql Managed Instance. + * + * @param manager Entry point to SecurityManager. + */ + public static void createABaselineForARuleOnAResourceUsingDatabaseNameParameterSqlManagedInstance( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentBaselineRules() + .define("VA1234") + .withExistingResourceId( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Sql/managedInstances/myManagedInstance") + .withLatestScan(false) + .withResults(Arrays.asList(Arrays.asList("userA", "SELECT"), Arrays.asList("userB", "SELECT"))) + .withDatabaseName("master") + .create(); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsBaselineRuleOperations/ServerLevel_SqlServerBaselineRules_Put.json + */ + /** + * Sample code: Create a baseline for a rule on a resource (using databaseName parameter) - Sql Server. + * + * @param manager Entry point to SecurityManager. + */ + public static void createABaselineForARuleOnAResourceUsingDatabaseNameParameterSqlServer( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentBaselineRules() + .define("VA1234") + .withExistingResourceId( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Sql/servers/myServer") + .withLatestScan(false) + .withResults(Arrays.asList(Arrays.asList("userA", "SELECT"), Arrays.asList("userB", "SELECT"))) + .withDatabaseName("master") + .create(); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsBaselineRuleOperations/SynapseBaselineRules_Put.json + */ + /** + * Sample code: Create a baseline for a rule on a resource - Synapse. + * + * @param manager Entry point to SecurityManager. + */ + public static void + createABaselineForARuleOnAResourceSynapse(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentBaselineRules() + .define("VA1234") + .withExistingResourceId( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Synapse/workspaces/myWorkspace/sqlPools/myPool") + .withLatestScan(false) + .withResults(Arrays.asList(Arrays.asList("userA", "SELECT"), Arrays.asList("userB", "SELECT"))) + .create(); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsBaselineRuleOperations/VirtualMachineBaselineRules_Put.json + */ + /** + * Sample code: Create a baseline for a rule on a resource - Virtual Machine. + * + * @param manager Entry point to SecurityManager. + */ + public static void + createABaselineForARuleOnAResourceVirtualMachine(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentBaselineRules() + .define("VA1234") + .withExistingResourceId( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Compute/virtualMachines/myVm/sqlServers/server1/databases/master") + .withLatestScan(false) + .withResults(Arrays.asList(Arrays.asList("userA", "SELECT"), Arrays.asList("userB", "SELECT"))) + .create(); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesDeleteSamples.java new file mode 100644 index 000000000000..4cad05cd2fa1 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesDeleteSamples.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for SqlVulnerabilityAssessmentBaselineRules Delete. + */ +public final class SqlVulnerabilityAssessmentBaselineRulesDeleteSamples { + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsBaselineRuleOperations/ServerLevel_SqlServerBaselineRules_Delete. + * json + */ + /** + * Sample code: Delete a baseline rule on a resource (using databaseName parameter) - Sql Server. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteABaselineRuleOnAResourceUsingDatabaseNameParameterSqlServer( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentBaselineRules() + .deleteWithResponse( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Sql/servers/myServer", + "VA1234", "master", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsBaselineRuleOperations/SynapseBaselineRules_Delete.json + */ + /** + * Sample code: Delete a baseline rule on a resource - Synapse. + * + * @param manager Entry point to SecurityManager. + */ + public static void + deleteABaselineRuleOnAResourceSynapse(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentBaselineRules() + .deleteWithResponse( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Synapse/workspaces/myWorkspace/sqlPools/myPool", + "VA1234", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsBaselineRuleOperations/VirtualMachineBaselineRules_Delete.json + */ + /** + * Sample code: Delete a baseline rule on a resource - Virtual Machine. + * + * @param manager Entry point to SecurityManager. + */ + public static void + deleteABaselineRuleOnAResourceVirtualMachine(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentBaselineRules() + .deleteWithResponse( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Compute/virtualMachines/myVm/sqlServers/server1/databases/master", + "VA1234", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-04-01-preview/sqlVulnerabilityAssessmentsBaselineRuleOperations/ + * ServerLevel_SqlManagedInstanceBaselineRules_Delete.json + */ + /** + * Sample code: Delete a baseline rule on a resource (using databaseName parameter) - Sql Managed Instance. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteABaselineRuleOnAResourceUsingDatabaseNameParameterSqlManagedInstance( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentBaselineRules() + .deleteWithResponse( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Sql/managedInstances/myManagedInstance", + "VA1234", "master", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsBaselineRuleOperations/ServerLevel_SynapseBaselineRules_Delete.json + */ + /** + * Sample code: Delete a baseline rule on a resource (using databaseName parameter) - Synapse. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteABaselineRuleOnAResourceUsingDatabaseNameParameterSynapse( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentBaselineRules() + .deleteWithResponse( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Synapse/workspaces/myWorkspace", + "VA1234", "master", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Delete.json + */ + /** + * Sample code: Delete a baseline rule on a resource - Arc Machine. + * + * @param manager Entry point to SecurityManager. + */ + public static void + deleteABaselineRuleOnAResourceArcMachine(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentBaselineRules() + .deleteWithResponse( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", + "VA1234", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsBaselineRuleOperations/SqlManagedInstanceBaselineRules_Delete.json + */ + /** + * Sample code: Delete a baseline rule on a resource - Sql Managed Instance. + * + * @param manager Entry point to SecurityManager. + */ + public static void + deleteABaselineRuleOnAResourceSqlManagedInstance(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentBaselineRules() + .deleteWithResponse( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Sql/managedInstances/myManagedInstance/databases/db", + "VA1234", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsBaselineRuleOperations/SqlServerBaselineRules_Delete.json + */ + /** + * Sample code: Delete a baseline rule on a resource - Sql Server. + * + * @param manager Entry point to SecurityManager. + */ + public static void + deleteABaselineRuleOnAResourceSqlServer(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentBaselineRules() + .deleteWithResponse( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Sql/servers/myServer/databases/db", + "VA1234", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesGetSamples.java new file mode 100644 index 000000000000..ac4828951a25 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesGetSamples.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for SqlVulnerabilityAssessmentBaselineRules Get. + */ +public final class SqlVulnerabilityAssessmentBaselineRulesGetSamples { + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Get.json + */ + /** + * Sample code: Get a baseline rule on a resource - Arc Machine. + * + * @param manager Entry point to SecurityManager. + */ + public static void + getABaselineRuleOnAResourceArcMachine(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentBaselineRules() + .getWithResponse( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", + "VA1234", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsBaselineRuleOperations/SqlServerBaselineRules_Get.json + */ + /** + * Sample code: Get a baseline rule on a resource - Sql Server. + * + * @param manager Entry point to SecurityManager. + */ + public static void + getABaselineRuleOnAResourceSqlServer(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentBaselineRules() + .getWithResponse( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Sql/servers/myServer/databases/db", + "VA1234", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsBaselineRuleOperations/VirtualMachineBaselineRules_Get.json + */ + /** + * Sample code: Get a baseline rule on a resource - Virtual Machine. + * + * @param manager Entry point to SecurityManager. + */ + public static void + getABaselineRuleOnAResourceVirtualMachine(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentBaselineRules() + .getWithResponse( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Compute/virtualMachines/myVm/sqlServers/server1/databases/master", + "VA1234", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsBaselineRuleOperations/SynapseBaselineRules_Get.json + */ + /** + * Sample code: Get a baseline rule on a resource - Synapse. + * + * @param manager Entry point to SecurityManager. + */ + public static void getABaselineRuleOnAResourceSynapse(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentBaselineRules() + .getWithResponse( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Synapse/workspaces/myWorkspace/sqlPools/myPool", + "VA1234", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsBaselineRuleOperations/ServerLevel_SynapseBaselineRules_Get.json + */ + /** + * Sample code: Get a baseline rule on a resource (ServerLevel_SynapseBaselineRules_Get) - Synapse. + * + * @param manager Entry point to SecurityManager. + */ + public static void getABaselineRuleOnAResourceServerLevelSynapseBaselineRulesGetSynapse( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentBaselineRules() + .getWithResponse( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Synapse/workspaces/myWorkspace", + "VA1234", "master", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsBaselineRuleOperations/SqlManagedInstanceBaselineRules_Get.json + */ + /** + * Sample code: Get a baseline rule on a resource - Sql Managed Instance. + * + * @param manager Entry point to SecurityManager. + */ + public static void + getABaselineRuleOnAResourceSqlManagedInstance(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentBaselineRules() + .getWithResponse( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Sql/managedInstances/myManagedInstance/databases/db", + "VA1234", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-04-01-preview/sqlVulnerabilityAssessmentsBaselineRuleOperations/ + * ServerLevel_SqlManagedInstanceBaselineRules_Get.json + */ + /** + * Sample code: Get a baseline rule on a resource (using databaseName parameter) - Sql Managed Instance. + * + * @param manager Entry point to SecurityManager. + */ + public static void getABaselineRuleOnAResourceUsingDatabaseNameParameterSqlManagedInstance( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentBaselineRules() + .getWithResponse( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Sql/managedInstances/myManagedInstance", + "VA1234", "master", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsBaselineRuleOperations/ServerLevel_SqlServerBaselineRules_Get.json + */ + /** + * Sample code: Get a baseline rule on a resource (using databaseName parameter) - Sql Server. + * + * @param manager Entry point to SecurityManager. + */ + public static void getABaselineRuleOnAResourceUsingDatabaseNameParameterSqlServer( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentBaselineRules() + .getWithResponse( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Sql/servers/myServer", + "VA1234", "master", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesListSamples.java new file mode 100644 index 000000000000..da516c2b19e4 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesListSamples.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for SqlVulnerabilityAssessmentBaselineRules List. + */ +public final class SqlVulnerabilityAssessmentBaselineRulesListSamples { + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsBaselineRuleOperations/ServerLevel_SqlServerBaselineRules_List.json + */ + /** + * Sample code: List baseline rules on a resource (using databaseName parameter) - Sql Server. + * + * @param manager Entry point to SecurityManager. + */ + public static void listBaselineRulesOnAResourceUsingDatabaseNameParameterSqlServer( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentBaselineRules() + .list( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Sql/servers/myServer", + "master", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsBaselineRuleOperations/SqlServerBaselineRules_List.json + */ + /** + * Sample code: List baseline rules on a resource - Sql Server. + * + * @param manager Entry point to SecurityManager. + */ + public static void + listBaselineRulesOnAResourceSqlServer(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentBaselineRules() + .list( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Sql/servers/myServer/databases/db", + null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsBaselineRuleOperations/SynapseBaselineRules_List.json + */ + /** + * Sample code: List baseline rules on a resource - Synapse. + * + * @param manager Entry point to SecurityManager. + */ + public static void listBaselineRulesOnAResourceSynapse(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentBaselineRules() + .list( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Synapse/workspaces/myWorkspace/sqlPools/myPool", + null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_List.json + */ + /** + * Sample code: List baseline rules on a resource - Arc Machine. + * + * @param manager Entry point to SecurityManager. + */ + public static void + listBaselineRulesOnAResourceArcMachine(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentBaselineRules() + .list( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", + null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-04-01-preview/sqlVulnerabilityAssessmentsBaselineRuleOperations/ + * ServerLevel_SqlManagedInstanceBaselineRules_List.json + */ + /** + * Sample code: List baseline rules on a resource (ServerLevel_SqlManagedInstanceBaselineRules_List) - Sql Managed + * Instance. + * + * @param manager Entry point to SecurityManager. + */ + public static void listBaselineRulesOnAResourceServerLevelSqlManagedInstanceBaselineRulesListSqlManagedInstance( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentBaselineRules() + .list( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Sql/managedInstances/myManagedInstance", + "master", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsBaselineRuleOperations/SqlManagedInstanceBaselineRules_List.json + */ + /** + * Sample code: List baseline rules on a resource - Sql Managed Instance. + * + * @param manager Entry point to SecurityManager. + */ + public static void + listBaselineRulesOnAResourceSqlManagedInstance(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentBaselineRules() + .list( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Sql/managedInstances/myManagedInstance/databases/db", + null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsBaselineRuleOperations/ServerLevel_SynapseBaselineRules_List.json + */ + /** + * Sample code: List baseline rules on a resource (using databaseName parameter) - Synapse. + * + * @param manager Entry point to SecurityManager. + */ + public static void listBaselineRulesOnAResourceUsingDatabaseNameParameterSynapse( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentBaselineRules() + .list( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Synapse/workspaces/myWorkspace", + "master", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsBaselineRuleOperations/VirtualMachineBaselineRules_List.json + */ + /** + * Sample code: List baseline rules on a resource - Virtual Machine. + * + * @param manager Entry point to SecurityManager. + */ + public static void + listBaselineRulesOnAResourceVirtualMachine(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentBaselineRules() + .list( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Compute/virtualMachines/myVm/sqlServers/server1/databases/master", + null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScanResultsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScanResultsGetSamples.java new file mode 100644 index 000000000000..9d9761b87605 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScanResultsGetSamples.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for SqlVulnerabilityAssessmentScanResults Get. + */ +public final class SqlVulnerabilityAssessmentScanResultsGetSamples { + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsScanResultsOperations/SqlManagedInstanceScanResults_Get.json + */ + /** + * Sample code: Get scan result on a resource - Sql Managed Instance. + * + * @param manager Entry point to SecurityManager. + */ + public static void + getScanResultOnAResourceSqlManagedInstance(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentScanResults() + .getWithResponse("Scheduled-20200623", "VA1234", + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Sql/managedInstances/myManagedInstance/databases/db", + null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsScanResultsOperations/ServerLevel_SqlServerScanResults_Get.json + */ + /** + * Sample code: Get scan result on a resource (using databaseName parameter) - Sql Server. + * + * @param manager Entry point to SecurityManager. + */ + public static void getScanResultOnAResourceUsingDatabaseNameParameterSqlServer( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentScanResults() + .getWithResponse("Scheduled-20200623", "VA1234", + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Sql/servers/myServer", + "master", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsScanResultsOperations/SqlServerScanResults_Get.json + */ + /** + * Sample code: Get scan result on a resource - Sql Server. + * + * @param manager Entry point to SecurityManager. + */ + public static void getScanResultOnAResourceSqlServer(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentScanResults() + .getWithResponse("Scheduled-20200623", "VA1234", + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Sql/servers/myServer/databases/db", + null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsScanResultsOperations/SynapseScanResults_Get.json + */ + /** + * Sample code: Get scan result on a resource - Synapse. + * + * @param manager Entry point to SecurityManager. + */ + public static void getScanResultOnAResourceSynapse(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentScanResults() + .getWithResponse("Scheduled-20200623", "VA1234", + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Synapse/workspaces/myWorkspace/sqlPools/myPool", + null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsScanResultsOperations/VirtualMachineScanResults_Get.json + */ + /** + * Sample code: Get scan result on a resource - Virtual Machine. + * + * @param manager Entry point to SecurityManager. + */ + public static void + getScanResultOnAResourceVirtualMachine(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentScanResults() + .getWithResponse("Scheduled-20200623", "VA1234", + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Compute/virtualMachines/myVm/sqlServers/server1/databases/master", + null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsScanResultsOperations/ArcMachineScanResults_Get.json + */ + /** + * Sample code: Get scan result on a resource - Arc Machine. + * + * @param manager Entry point to SecurityManager. + */ + public static void getScanResultOnAResourceArcMachine(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentScanResults() + .getWithResponse("Scheduled-20200623", "VA1234", + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", + null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsScanResultsOperations/ServerLevel_SynapseScanResults_Get.json + */ + /** + * Sample code: Get scan result on a resource (using databaseName parameter) - Synapse. + * + * @param manager Entry point to SecurityManager. + */ + public static void getScanResultOnAResourceUsingDatabaseNameParameterSynapse( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentScanResults() + .getWithResponse("Scheduled-20200623", "VA1234", + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Synapse/workspaces/myWorkspace", + "master", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsScanResultsOperations/ServerLevel_SqlManagedInstanceScanResults_Get + * .json + */ + /** + * Sample code: Get scan result on a resource (using databaseName parameter) - Sql Managed Instance. + * + * @param manager Entry point to SecurityManager. + */ + public static void getScanResultOnAResourceUsingDatabaseNameParameterSqlManagedInstance( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentScanResults() + .getWithResponse("Scheduled-20200623", "VA1234", + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Sql/managedInstances/myManagedInstance", + "master", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScanResultsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScanResultsListSamples.java new file mode 100644 index 000000000000..1b9d02dfd225 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScanResultsListSamples.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for SqlVulnerabilityAssessmentScanResults List. + */ +public final class SqlVulnerabilityAssessmentScanResultsListSamples { + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsScanResultsOperations/ArcMachineScanResults_List.json + */ + /** + * Sample code: List scan results on a resource - Arc Machine. + * + * @param manager Entry point to SecurityManager. + */ + public static void + listScanResultsOnAResourceArcMachine(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentScanResults() + .list("Scheduled-20200623", + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", + null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsScanResultsOperations/VirtualMachineScanResults_List.json + */ + /** + * Sample code: List scan results on a resource - Virtual Machine. + * + * @param manager Entry point to SecurityManager. + */ + public static void + listScanResultsOnAResourceVirtualMachine(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentScanResults() + .list("Scheduled-20200623", + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Compute/virtualMachines/myVm/sqlServers/server1/databases/master", + null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsScanResultsOperations/ServerLevel_SqlServerScanResults_List.json + */ + /** + * Sample code: List scan results on a resource (using databaseName parameter) - Sql Server. + * + * @param manager Entry point to SecurityManager. + */ + public static void listScanResultsOnAResourceUsingDatabaseNameParameterSqlServer( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentScanResults() + .list("Scheduled-20200623", + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Sql/servers/myServer", + "master", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsScanResultsOperations/SqlServerScanResults_List.json + */ + /** + * Sample code: List scan results on a resource - Sql Server. + * + * @param manager Entry point to SecurityManager. + */ + public static void listScanResultsOnAResourceSqlServer(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentScanResults() + .list("Scheduled-20200623", + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Sql/servers/myServer/databases/db", + null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-04-01-preview/sqlVulnerabilityAssessmentsScanResultsOperations/ + * ServerLevel_SqlManagedInstanceScanResults_List.json + */ + /** + * Sample code: List scan results on a resource (using databaseName parameter) - Sql Managed Instance. + * + * @param manager Entry point to SecurityManager. + */ + public static void listScanResultsOnAResourceUsingDatabaseNameParameterSqlManagedInstance( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentScanResults() + .list("Scheduled-20200623", + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Sql/managedInstances/myManagedInstance", + "master", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsScanResultsOperations/ServerLevel_SynapseScanResults_List.json + */ + /** + * Sample code: List scan results on a resource (using databaseName parameter) - Synapse. + * + * @param manager Entry point to SecurityManager. + */ + public static void listScanResultsOnAResourceUsingDatabaseNameParameterSynapse( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentScanResults() + .list("Scheduled-20200623", + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Synapse/workspaces/myWorkspace", + "master", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsScanResultsOperations/SynapseScanResults_List.json + */ + /** + * Sample code: List scan results on a resource - Synapse. + * + * @param manager Entry point to SecurityManager. + */ + public static void listScanResultsOnAResourceSynapse(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentScanResults() + .list("Scheduled-20200623", + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Synapse/workspaces/myWorkspace/sqlPools/myPool", + null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsScanResultsOperations/SqlManagedInstanceScanResults_List.json + */ + /** + * Sample code: List scan results on a resource - Sql Managed Instance. + * + * @param manager Entry point to SecurityManager. + */ + public static void + listScanResultsOnAResourceSqlManagedInstance(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentScanResults() + .list("Scheduled-20200623", + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Sql/managedInstances/myManagedInstance/databases/db", + null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScansGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScansGetSamples.java new file mode 100644 index 000000000000..a6f04c48e6c6 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScansGetSamples.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for SqlVulnerabilityAssessmentScans Get. + */ +public final class SqlVulnerabilityAssessmentScansGetSamples { + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsScanOperations/ServerLevel_SqlServerScans_Get.json + */ + /** + * Sample code: Get scan on a resource (using databaseName parameter) - Sql Server. + * + * @param manager Entry point to SecurityManager. + */ + public static void getScanOnAResourceUsingDatabaseNameParameterSqlServer( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentScans() + .getWithResponse("Scheduled-20200623", + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Sql/servers/myServer", + "master", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-04-01-preview/sqlVulnerabilityAssessmentsScanOperations/ArcMachineScans_Get.json + */ + /** + * Sample code: Get scan on a resource - Arc Machine. + * + * @param manager Entry point to SecurityManager. + */ + public static void getScanOnAResourceArcMachine(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentScans() + .getWithResponse("Scheduled-20200623", + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", + null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-04-01-preview/sqlVulnerabilityAssessmentsScanOperations/SqlServerScans_Get.json + */ + /** + * Sample code: Get scan on a resource - Sql Server. + * + * @param manager Entry point to SecurityManager. + */ + public static void getScanOnAResourceSqlServer(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentScans() + .getWithResponse("Scheduled-20200623", + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Sql/servers/myServer/databases/db", + null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-04-01-preview/sqlVulnerabilityAssessmentsScanOperations/SqlManagedInstanceScans_Get.json + */ + /** + * Sample code: Get scan on a resource - Sql Managed Instance. + * + * @param manager Entry point to SecurityManager. + */ + public static void + getScanOnAResourceSqlManagedInstance(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentScans() + .getWithResponse("Scheduled-20200623", + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Sql/managedInstances/myManagedInstance/databases/db", + null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-04-01-preview/sqlVulnerabilityAssessmentsScanOperations/SynapseScans_Get.json + */ + /** + * Sample code: Get scan on a resource - Synapse. + * + * @param manager Entry point to SecurityManager. + */ + public static void getScanOnAResourceSynapse(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentScans() + .getWithResponse("Scheduled-20200623", + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Synapse/workspaces/myWorkspace/sqlPools/myPool", + null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-04-01-preview/sqlVulnerabilityAssessmentsScanOperations/VirtualMachineScans_Get.json + */ + /** + * Sample code: Get scan on a resource - Virtual Machine. + * + * @param manager Entry point to SecurityManager. + */ + public static void getScanOnAResourceVirtualMachine(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentScans() + .getWithResponse("Scheduled-20200623", + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Compute/virtualMachines/myVm/sqlServers/server1/databases/master", + null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsScanOperations/ServerLevel_SqlManagedInstanceScans_Get.json + */ + /** + * Sample code: Get scan on a resource (using databaseName parameter) - Sql Managed Instance. + * + * @param manager Entry point to SecurityManager. + */ + public static void getScanOnAResourceUsingDatabaseNameParameterSqlManagedInstance( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentScans() + .getWithResponse("Scheduled-20200623", + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Sql/managedInstances/myManagedInstance", + "master", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsScanOperations/ServerLevel_SynapseScans_Get.json + */ + /** + * Sample code: Get scan on a resource (using databaseName parameter) - Synapse. + * + * @param manager Entry point to SecurityManager. + */ + public static void getScanOnAResourceUsingDatabaseNameParameterSynapse( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentScans() + .getWithResponse("Scheduled-20200623", + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Synapse/workspaces/myWorkspace", + "master", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScansGetScanOperationResultSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScansGetScanOperationResultSamples.java new file mode 100644 index 000000000000..d313d3a1d1ee --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScansGetScanOperationResultSamples.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for SqlVulnerabilityAssessmentScans GetScanOperationResult. + */ +public final class SqlVulnerabilityAssessmentScansGetScanOperationResultSamples { + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsScanOperations/SqlServerScans_GetScanOperationResult.json + */ + /** + * Sample code: Get scan operation result on a resource - Sql Server. + * + * @param manager Entry point to SecurityManager. + */ + public static void + getScanOperationResultOnAResourceSqlServer(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentScans() + .getScanOperationResultWithResponse( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Sql/servers/myServer/databases/db", + "11111111-2222-3333-4444-555555555555", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsScanOperations/ServerLevel_SqlServerScans_GetScanOperationResult. + * json + */ + /** + * Sample code: Get scan operation result on a resource (using databaseName parameter) - Sql Server. + * + * @param manager Entry point to SecurityManager. + */ + public static void getScanOperationResultOnAResourceUsingDatabaseNameParameterSqlServer( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentScans() + .getScanOperationResultWithResponse( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Sql/servers/myServer", + "11111111-2222-3333-4444-555555555555", "master", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsScanOperations/SqlManagedInstanceScans_GetScanOperationResult.json + */ + /** + * Sample code: Get scan operation result on a resource - Sql Managed Instance. + * + * @param manager Entry point to SecurityManager. + */ + public static void getScanOperationResultOnAResourceSqlManagedInstance( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentScans() + .getScanOperationResultWithResponse( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Sql/managedInstances/myManagedInstance/databases/db", + "11111111-2222-3333-4444-555555555555", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsScanOperations/ServerLevel_SynapseScans_GetScanOperationResult.json + */ + /** + * Sample code: Get scan operation result on a resource (using databaseName parameter) - Synapse. + * + * @param manager Entry point to SecurityManager. + */ + public static void getScanOperationResultOnAResourceUsingDatabaseNameParameterSynapse( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentScans() + .getScanOperationResultWithResponse( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Synapse/workspaces/myWorkspace", + "11111111-2222-3333-4444-555555555555", "master", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsScanOperations/SynapseScans_GetScanOperationResult.json + */ + /** + * Sample code: Get scan operation result on a resource - Synapse. + * + * @param manager Entry point to SecurityManager. + */ + public static void + getScanOperationResultOnAResourceSynapse(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentScans() + .getScanOperationResultWithResponse( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Synapse/workspaces/myWorkspace/sqlPools/mySqlPool", + "11111111-2222-3333-4444-555555555555", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-04-01-preview/sqlVulnerabilityAssessmentsScanOperations/ + * ServerLevel_SqlManagedInstanceScans_GetScanOperationResult.json + */ + /** + * Sample code: Get scan operation result on a resource (using databaseName parameter) - Sql Managed Instance. + * + * @param manager Entry point to SecurityManager. + */ + public static void getScanOperationResultOnAResourceUsingDatabaseNameParameterSqlManagedInstance( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentScans() + .getScanOperationResultWithResponse( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Sql/managedInstances/myManagedInstance", + "11111111-2222-3333-4444-555555555555", "master", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScansInitiateScanSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScansInitiateScanSamples.java new file mode 100644 index 000000000000..778bbca62de5 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScansInitiateScanSamples.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for SqlVulnerabilityAssessmentScans InitiateScan. + */ +public final class SqlVulnerabilityAssessmentScansInitiateScanSamples { + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsScanOperations/ServerLevel_SqlManagedInstanceScans_InitiateScan. + * json + */ + /** + * Sample code: Initiate scan on a resource (server-level) - Sql Managed Instance. + * + * @param manager Entry point to SecurityManager. + */ + public static void initiateScanOnAResourceServerLevelSqlManagedInstance( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentScans() + .initiateScan( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Sql/managedInstances/myManagedInstance", + "master", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-04-01-preview/sqlVulnerabilityAssessmentsScanOperations/SynapseScans_InitiateScan.json + */ + /** + * Sample code: Initiate scan on a resource - Synapse. + * + * @param manager Entry point to SecurityManager. + */ + public static void initiateScanOnAResourceSynapse(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentScans() + .initiateScan( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Synapse/workspaces/myWorkspace/sqlPools/myPool", + null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-04-01-preview/sqlVulnerabilityAssessmentsScanOperations/SqlServerScans_InitiateScan.json + */ + /** + * Sample code: Initiate scan on a resource - Sql Server. + * + * @param manager Entry point to SecurityManager. + */ + public static void initiateScanOnAResourceSqlServer(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentScans() + .initiateScan( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Sql/servers/myServer/databases/db", + null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsScanOperations/ServerLevel_SqlServerScans_InitiateScan.json + */ + /** + * Sample code: Initiate scan on a resource (server-level) - Sql Server. + * + * @param manager Entry point to SecurityManager. + */ + public static void + initiateScanOnAResourceServerLevelSqlServer(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentScans() + .initiateScan( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Sql/servers/myServer", + "master", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsScanOperations/ServerLevel_SynapseScans_InitiateScan.json + */ + /** + * Sample code: Initiate scan on a resource (server-level) - Synapse. + * + * @param manager Entry point to SecurityManager. + */ + public static void + initiateScanOnAResourceServerLevelSynapse(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentScans() + .initiateScan( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Synapse/workspaces/myWorkspace", + "master", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsScanOperations/SqlManagedInstanceScans_InitiateScan.json + */ + /** + * Sample code: Initiate scan on a resource - Sql Managed Instance. + * + * @param manager Entry point to SecurityManager. + */ + public static void + initiateScanOnAResourceSqlManagedInstance(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentScans() + .initiateScan( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Sql/managedInstances/myManagedInstance/databases/db", + null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScansListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScansListSamples.java new file mode 100644 index 000000000000..bf9958088234 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScansListSamples.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for SqlVulnerabilityAssessmentScans List. + */ +public final class SqlVulnerabilityAssessmentScansListSamples { + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsScanOperations/SqlManagedInstanceScans_List.json + */ + /** + * Sample code: List scans on a resource - Sql Managed Instance. + * + * @param manager Entry point to SecurityManager. + */ + public static void + listScansOnAResourceSqlManagedInstance(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentScans() + .list( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Sql/managedInstances/myManagedInstance/databases/db", + null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsScanOperations/ServerLevel_SynapseScans_List.json + */ + /** + * Sample code: List scans on a resource (using databaseName parameter) - Synapse. + * + * @param manager Entry point to SecurityManager. + */ + public static void listScansOnAResourceUsingDatabaseNameParameterSynapse( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentScans() + .list( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Synapse/workspaces/myWorkspace", + "master", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-04-01-preview/sqlVulnerabilityAssessmentsScanOperations/ArcMachineScans_List.json + */ + /** + * Sample code: List scans on a resource - Arc Machine. + * + * @param manager Entry point to SecurityManager. + */ + public static void listScansOnAResourceArcMachine(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentScans() + .list( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", + null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-04-01-preview/sqlVulnerabilityAssessmentsScanOperations/SqlServerScans_List.json + */ + /** + * Sample code: List scans on a resource - Sql Server. + * + * @param manager Entry point to SecurityManager. + */ + public static void listScansOnAResourceSqlServer(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentScans() + .list( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Sql/servers/myServer/databases/db", + null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-04-01-preview/sqlVulnerabilityAssessmentsScanOperations/SynapseScans_List.json + */ + /** + * Sample code: List scans on a resource - Synapse. + * + * @param manager Entry point to SecurityManager. + */ + public static void listScansOnAResourceSynapse(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentScans() + .list( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Synapse/workspaces/myWorkspace/sqlPools/myPool", + null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-04-01-preview/sqlVulnerabilityAssessmentsScanOperations/VirtualMachineScans_List.json + */ + /** + * Sample code: List scans on a resource - Virtual Machine. + * + * @param manager Entry point to SecurityManager. + */ + public static void listScansOnAResourceVirtualMachine(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentScans() + .list( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Compute/virtualMachines/myVm/sqlServers/server1/databases/master", + null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsScanOperations/ServerLevel_SqlManagedInstanceScans_List.json + */ + /** + * Sample code: List scans on a resource (using databaseName parameter) - Sql Managed Instance. + * + * @param manager Entry point to SecurityManager. + */ + public static void listScansOnAResourceUsingDatabaseNameParameterSqlManagedInstance( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentScans() + .list( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Sql/managedInstances/myManagedInstance", + "master", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsScanOperations/ServerLevel_SqlServerScans_List.json + */ + /** + * Sample code: List scans on a resource (using databaseName parameter) - Sql Server. + * + * @param manager Entry point to SecurityManager. + */ + public static void listScansOnAResourceUsingDatabaseNameParameterSqlServer( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentScans() + .list( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Sql/servers/myServer", + "master", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentSettingsOperationCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentSettingsOperationCreateOrUpdateSamples.java new file mode 100644 index 000000000000..849201287c9f --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentSettingsOperationCreateOrUpdateSamples.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.fluent.models.SqlVulnerabilityAssessmentSettingsInner; +import com.azure.resourcemanager.security.models.SqlVulnerabilityAssessmentSettingsProperties; +import com.azure.resourcemanager.security.models.SqlVulnerabilityAssessmentState; + +/** + * Samples for SqlVulnerabilityAssessmentSettingsOperation CreateOrUpdate. + */ +public final class SqlVulnerabilityAssessmentSettingsOperationCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-04-01-preview/sqlVulnerabilityAssessmentsSettingsOperations/SqlServerSettings_Put.json + */ + /** + * Sample code: Create or update SQL Vulnerability Assessment settings on a resource - Sql Server. + * + * @param manager Entry point to SecurityManager. + */ + public static void createOrUpdateSQLVulnerabilityAssessmentSettingsOnAResourceSqlServer( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentSettingsOperations() + .createOrUpdateWithResponse( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Sql/servers/myServer", + new SqlVulnerabilityAssessmentSettingsInner() + .withProperties(new SqlVulnerabilityAssessmentSettingsProperties() + .withState(SqlVulnerabilityAssessmentState.ENABLED)), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-04-01-preview/sqlVulnerabilityAssessmentsSettingsOperations/SynapseSettings_Put.json + */ + /** + * Sample code: Create or update SQL Vulnerability Assessment settings on a resource - Synapse. + * + * @param manager Entry point to SecurityManager. + */ + public static void createOrUpdateSQLVulnerabilityAssessmentSettingsOnAResourceSynapse( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentSettingsOperations() + .createOrUpdateWithResponse( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Synapse/workspaces/myWorkspace", + new SqlVulnerabilityAssessmentSettingsInner() + .withProperties(new SqlVulnerabilityAssessmentSettingsProperties() + .withState(SqlVulnerabilityAssessmentState.ENABLED)), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsSettingsOperations/SqlManagedInstanceSettings_Put.json + */ + /** + * Sample code: Create or update SQL Vulnerability Assessment settings on a resource - Sql Managed Instance. + * + * @param manager Entry point to SecurityManager. + */ + public static void createOrUpdateSQLVulnerabilityAssessmentSettingsOnAResourceSqlManagedInstance( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentSettingsOperations() + .createOrUpdateWithResponse( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Sql/managedInstances/myManagedInstance", + new SqlVulnerabilityAssessmentSettingsInner() + .withProperties(new SqlVulnerabilityAssessmentSettingsProperties() + .withState(SqlVulnerabilityAssessmentState.ENABLED)), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentSettingsOperationDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentSettingsOperationDeleteSamples.java new file mode 100644 index 000000000000..f30a8b0f8642 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentSettingsOperationDeleteSamples.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for SqlVulnerabilityAssessmentSettingsOperation Delete. + */ +public final class SqlVulnerabilityAssessmentSettingsOperationDeleteSamples { + /* + * x-ms-original-file: 2026-04-01-preview/sqlVulnerabilityAssessmentsSettingsOperations/SynapseSettings_Delete.json + */ + /** + * Sample code: Delete SQL Vulnerability Assessment settings on a resource - Synapse. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteSQLVulnerabilityAssessmentSettingsOnAResourceSynapse( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentSettingsOperations() + .deleteWithResponse( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Synapse/workspaces/myWorkspace", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsSettingsOperations/SqlManagedInstanceSettings_Delete.json + */ + /** + * Sample code: Delete SQL Vulnerability Assessment settings on a resource - Sql Managed Instance. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteSQLVulnerabilityAssessmentSettingsOnAResourceSqlManagedInstance( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentSettingsOperations() + .deleteWithResponse( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Sql/managedInstances/myManagedInstance", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsSettingsOperations/SqlServerSettings_Delete.json + */ + /** + * Sample code: Delete SQL Vulnerability Assessment settings on a resource - Sql Server. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteSQLVulnerabilityAssessmentSettingsOnAResourceSqlServer( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentSettingsOperations() + .deleteWithResponse( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Sql/servers/myServer", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentSettingsOperationGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentSettingsOperationGetSamples.java new file mode 100644 index 000000000000..836610ecaaae --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentSettingsOperationGetSamples.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for SqlVulnerabilityAssessmentSettingsOperation Get. + */ +public final class SqlVulnerabilityAssessmentSettingsOperationGetSamples { + /* + * x-ms-original-file: 2026-04-01-preview/sqlVulnerabilityAssessmentsSettingsOperations/SynapseSettings_Get.json + */ + /** + * Sample code: Get SQL Vulnerability Assessment settings on a resource - Synapse. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSQLVulnerabilityAssessmentSettingsOnAResourceSynapse( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentSettingsOperations() + .getWithResponse( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Synapse/workspaces/myWorkspace", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: + * 2026-04-01-preview/sqlVulnerabilityAssessmentsSettingsOperations/SqlManagedInstanceSettings_Get.json + */ + /** + * Sample code: Get SQL Vulnerability Assessment settings on a resource - Sql Managed Instance. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSQLVulnerabilityAssessmentSettingsOnAResourceSqlManagedInstance( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentSettingsOperations() + .getWithResponse( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Sql/managedInstances/myManagedInstance", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-04-01-preview/sqlVulnerabilityAssessmentsSettingsOperations/SqlServerSettings_Get.json + */ + /** + * Sample code: Get SQL Vulnerability Assessment settings on a resource - Sql Server. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSQLVulnerabilityAssessmentSettingsOnAResourceSqlServer( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.sqlVulnerabilityAssessmentSettingsOperations() + .getWithResponse( + "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.Sql/servers/myServer", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/StandardAssignmentsCreateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/StandardAssignmentsCreateSamples.java new file mode 100644 index 000000000000..4ba97ff3c1eb --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/StandardAssignmentsCreateSamples.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.AssignedAssessmentItem; +import com.azure.resourcemanager.security.models.AssignedStandardItem; +import com.azure.resourcemanager.security.models.Effect; +import com.azure.resourcemanager.security.models.ExemptionCategory; +import com.azure.resourcemanager.security.models.StandardAssignmentPropertiesExemptionData; +import java.time.OffsetDateTime; +import java.util.Arrays; + +/** + * Samples for StandardAssignments Create. + */ +public final class StandardAssignmentsCreateSamples { + /* + * x-ms-original-file: 2024-08-01/StandardAssignments/PutExemptionStandardAssignment.json + */ + /** + * Sample code: Put exemption standard assignment. + * + * @param manager Entry point to SecurityManager. + */ + public static void putExemptionStandardAssignment(com.azure.resourcemanager.security.SecurityManager manager) { + manager.standardAssignments() + .define("1f3afdf9-d0c9-4c3d-847f-89da613e70a8") + .withExistingResourceId( + "subscriptions/212f9889-769e-45ae-ab43-6da33674bd26/resourceGroups/ANAT_TEST_RG/providers/Microsoft.Compute/virtualMachines/anatTestE2LA") + .withDisplayName("Test exemption") + .withDescription("Exemption description") + .withAssignedStandard(new AssignedStandardItem() + .withId("/providers/Microsoft.Security/securityStandards/1f3afdf9-d0c9-4c3d-847f-89da613e70a8")) + .withEffect(Effect.EXEMPT) + .withExpiresOn(OffsetDateTime.parse("2022-05-01T19:50:47.083633Z")) + .withExemptionData( + new StandardAssignmentPropertiesExemptionData().withExemptionCategory(ExemptionCategory.WAIVER) + .withAssignedAssessment(new AssignedAssessmentItem().withAssessmentKey("fakeTokenPlaceholder"))) + .create(); + } + + /* + * x-ms-original-file: 2024-08-01/StandardAssignments/PutStandardAssignment.json + */ + /** + * Sample code: Put an audit standard assignment. + * + * @param manager Entry point to SecurityManager. + */ + public static void putAnAuditStandardAssignment(com.azure.resourcemanager.security.SecurityManager manager) { + manager.standardAssignments() + .define("1f3afdf9-d0c9-4c3d-847f-89da613e70a8") + .withExistingResourceId("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23") + .withDisplayName("ASC Default") + .withDescription("Set of policies monitored by Azure Security Center for cross cloud") + .withAssignedStandard(new AssignedStandardItem() + .withId("/providers/Microsoft.Security/securityStandards/1f3afdf9-d0c9-4c3d-847f-89da613e70a8")) + .withEffect(Effect.AUDIT) + .withExcludedScopes(Arrays.asList()) + .create(); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/StandardAssignmentsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/StandardAssignmentsDeleteSamples.java new file mode 100644 index 000000000000..49bb5771ab4f --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/StandardAssignmentsDeleteSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for StandardAssignments Delete. + */ +public final class StandardAssignmentsDeleteSamples { + /* + * x-ms-original-file: 2024-08-01/StandardAssignments/DeleteStandardAssignment.json + */ + /** + * Sample code: Delete a standard assignment. + * + * @param manager Entry point to SecurityManager. + */ + public static void deleteAStandardAssignment(com.azure.resourcemanager.security.SecurityManager manager) { + manager.standardAssignments() + .deleteByResourceGroupWithResponse( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", + "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/StandardAssignmentsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/StandardAssignmentsGetSamples.java new file mode 100644 index 000000000000..9110b245cf93 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/StandardAssignmentsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for StandardAssignments Get. + */ +public final class StandardAssignmentsGetSamples { + /* + * x-ms-original-file: 2024-08-01/StandardAssignments/GetStandardAssignment.json + */ + /** + * Sample code: Retrieve a standard assignment. + * + * @param manager Entry point to SecurityManager. + */ + public static void retrieveAStandardAssignment(com.azure.resourcemanager.security.SecurityManager manager) { + manager.standardAssignments() + .getWithResponse("providers/Microsoft.Management/managementGroups/contoso", + "1f3afdf9-d0c9-4c3d-847f-89da613e70a8", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/StandardAssignmentsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/StandardAssignmentsListSamples.java new file mode 100644 index 000000000000..b9e01462562f --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/StandardAssignmentsListSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for StandardAssignments List. + */ +public final class StandardAssignmentsListSamples { + /* + * x-ms-original-file: 2024-08-01/StandardAssignments/ListStandardAssignments.json + */ + /** + * Sample code: List standard assignments. + * + * @param manager Entry point to SecurityManager. + */ + public static void listStandardAssignments(com.azure.resourcemanager.security.SecurityManager manager) { + manager.standardAssignments() + .list( + "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/StandardsCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/StandardsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..ff2ae4d29790 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/StandardsCreateOrUpdateSamples.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.StandardComponentProperties; +import com.azure.resourcemanager.security.models.StandardSupportedClouds; +import java.util.Arrays; + +/** + * Samples for Standards CreateOrUpdate. + */ +public final class StandardsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2021-08-01-preview/Standards/PutStandard_example.json + */ + /** + * Sample code: Create a security standard on a specified scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void + createASecurityStandardOnASpecifiedScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.standards() + .define("8bb8be0a-6010-4789-812f-e4d661c4ed0e") + .withExistingResourceGroup("myResourceGroup") + .withDisplayName("Azure Test Security Standard 1") + .withDescription("description of Azure Test Security Standard 1") + .withCategory("SecurityCenter") + .withComponents(Arrays.asList(new StandardComponentProperties().withKey("fakeTokenPlaceholder"), + new StandardComponentProperties().withKey("fakeTokenPlaceholder"))) + .withSupportedClouds(Arrays.asList(StandardSupportedClouds.GCP)) + .create(); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/StandardsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/StandardsDeleteSamples.java new file mode 100644 index 000000000000..f98d55d26361 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/StandardsDeleteSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for Standards Delete. + */ +public final class StandardsDeleteSamples { + /* + * x-ms-original-file: 2021-08-01-preview/Standards/DeleteStandard_example.json + */ + /** + * Sample code: Delete a security standard over the specified scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void + deleteASecurityStandardOverTheSpecifiedScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.standards() + .deleteByResourceGroupWithResponse("myResourceGroup", "8bb8be0a-6010-4789-812f-e4d661c4ed0e", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/StandardsGetByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/StandardsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..4ecd8d920ec9 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/StandardsGetByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for Standards GetByResourceGroup. + */ +public final class StandardsGetByResourceGroupSamples { + /* + * x-ms-original-file: 2021-08-01-preview/Standards/GetStandard_example.json + */ + /** + * Sample code: Get a specific security standard by scope and standardId. + * + * @param manager Entry point to SecurityManager. + */ + public static void + getASpecificSecurityStandardByScopeAndStandardId(com.azure.resourcemanager.security.SecurityManager manager) { + manager.standards() + .getByResourceGroupWithResponse("myResourceGroup", "21300918-b2e3-0346-785f-c77ff57d243b", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/StandardsListByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/StandardsListByResourceGroupSamples.java new file mode 100644 index 000000000000..440ff0e5b8d8 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/StandardsListByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for Standards ListByResourceGroup. + */ +public final class StandardsListByResourceGroupSamples { + /* + * x-ms-original-file: 2021-08-01-preview/Standards/ListStandards_example.json + */ + /** + * Sample code: List security standards. + * + * @param manager Entry point to SecurityManager. + */ + public static void listSecurityStandards(com.azure.resourcemanager.security.SecurityManager manager) { + manager.standards().listByResourceGroup("myResourceGroup", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/StandardsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/StandardsListSamples.java new file mode 100644 index 000000000000..79bd520755c4 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/StandardsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for Standards List. + */ +public final class StandardsListSamples { + /* + * x-ms-original-file: 2021-08-01-preview/Standards/ListBySubscriptionStandards_example.json + */ + /** + * Sample code: List security standards by subscription level scope. + * + * @param manager Entry point to SecurityManager. + */ + public static void + listSecurityStandardsBySubscriptionLevelScope(com.azure.resourcemanager.security.SecurityManager manager) { + manager.standards().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SubAssessmentsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SubAssessmentsGetSamples.java new file mode 100644 index 000000000000..7da0847b31ca --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SubAssessmentsGetSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for SubAssessments Get. + */ +public final class SubAssessmentsGetSamples { + /* + * x-ms-original-file: 2019-01-01-preview/SubAssessments/GetSubAssessment_example.json + */ + /** + * Sample code: Get security recommendation task from security data location. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityRecommendationTaskFromSecurityDataLocation( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.subAssessments() + .getWithResponse( + "subscriptions/212f9889-769e-45ae-ab43-6da33674bd26/resourceGroups/DEMORG/providers/Microsoft.Compute/virtualMachines/vm2", + "1195afff-c881-495e-9bc5-1486211ae03f", "95f7da9c-a2a4-1322-0758-fcd24ef09b85", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SubAssessmentsListAllSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SubAssessmentsListAllSamples.java new file mode 100644 index 000000000000..ca0e0b199914 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SubAssessmentsListAllSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for SubAssessments ListAll. + */ +public final class SubAssessmentsListAllSamples { + /* + * x-ms-original-file: 2019-01-01-preview/SubAssessments/ListSubscriptionSubAssessments_example.json + */ + /** + * Sample code: List security sub-assessments. + * + * @param manager Entry point to SecurityManager. + */ + public static void listSecuritySubAssessments(com.azure.resourcemanager.security.SecurityManager manager) { + manager.subAssessments() + .listAll("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SubAssessmentsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SubAssessmentsListSamples.java new file mode 100644 index 000000000000..3ca0206e1b5a --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SubAssessmentsListSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for SubAssessments List. + */ +public final class SubAssessmentsListSamples { + /* + * x-ms-original-file: 2019-01-01-preview/SubAssessments/ListSubAssessments_example.json + */ + /** + * Sample code: List security sub-assessments. + * + * @param manager Entry point to SecurityManager. + */ + public static void listSecuritySubAssessments(com.azure.resourcemanager.security.SecurityManager manager) { + manager.subAssessments() + .list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "82e20e14-edc5-4373-bfc4-f13121257c37", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksGetResourceGroupLevelTaskSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksGetResourceGroupLevelTaskSamples.java new file mode 100644 index 000000000000..01f8132f61f9 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksGetResourceGroupLevelTaskSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for Tasks GetResourceGroupLevelTask. + */ +public final class TasksGetResourceGroupLevelTaskSamples { + /* + * x-ms-original-file: 2015-06-01-preview/Tasks/GetTaskResourceGroupLocation_example.json + */ + /** + * Sample code: Get security recommendation task in a resource group. + * + * @param manager Entry point to SecurityManager. + */ + public static void + getSecurityRecommendationTaskInAResourceGroup(com.azure.resourcemanager.security.SecurityManager manager) { + manager.tasks() + .getResourceGroupLevelTaskWithResponse("myRg", "westeurope", "d55b4dc0-779c-c66c-33e5-d7bce24c4222", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksGetSubscriptionLevelTaskSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksGetSubscriptionLevelTaskSamples.java new file mode 100644 index 000000000000..aa565627eee5 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksGetSubscriptionLevelTaskSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for Tasks GetSubscriptionLevelTask. + */ +public final class TasksGetSubscriptionLevelTaskSamples { + /* + * x-ms-original-file: 2015-06-01-preview/Tasks/GetTaskSubscriptionLocation_example.json + */ + /** + * Sample code: Get security recommendation task from security data location. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityRecommendationTaskFromSecurityDataLocation( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.tasks() + .getSubscriptionLevelTaskWithResponse("westeurope", "62609ee7-d0a5-8616-9fe4-1df5cca7758d", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksListByHomeRegionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksListByHomeRegionSamples.java new file mode 100644 index 000000000000..f4ab675612c9 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksListByHomeRegionSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for Tasks ListByHomeRegion. + */ +public final class TasksListByHomeRegionSamples { + /* + * x-ms-original-file: 2015-06-01-preview/Tasks/GetTasksSubscriptionLocation_example.json + */ + /** + * Sample code: Get security recommendations tasks from security data location. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityRecommendationsTasksFromSecurityDataLocation( + com.azure.resourcemanager.security.SecurityManager manager) { + manager.tasks().listByHomeRegion("westeurope", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksListByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksListByResourceGroupSamples.java new file mode 100644 index 000000000000..09697c676800 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for Tasks ListByResourceGroup. + */ +public final class TasksListByResourceGroupSamples { + /* + * x-ms-original-file: 2015-06-01-preview/Tasks/GetTasksResourceGroupLocation_example.json + */ + /** + * Sample code: Get security recommendation tasks in a resource group. + * + * @param manager Entry point to SecurityManager. + */ + public static void + getSecurityRecommendationTasksInAResourceGroup(com.azure.resourcemanager.security.SecurityManager manager) { + manager.tasks().listByResourceGroup("myRg", "westeurope", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksListSamples.java new file mode 100644 index 000000000000..d4af66acad10 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for Tasks List. + */ +public final class TasksListSamples { + /* + * x-ms-original-file: 2015-06-01-preview/Tasks/GetTasksSubscription_example.json + */ + /** + * Sample code: Get security recommendations tasks. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSecurityRecommendationsTasks(com.azure.resourcemanager.security.SecurityManager manager) { + manager.tasks().list(null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksUpdateResourceGroupLevelTaskStateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksUpdateResourceGroupLevelTaskStateSamples.java new file mode 100644 index 000000000000..92891447f423 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksUpdateResourceGroupLevelTaskStateSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.TaskUpdateActionType; + +/** + * Samples for Tasks UpdateResourceGroupLevelTaskState. + */ +public final class TasksUpdateResourceGroupLevelTaskStateSamples { + /* + * x-ms-original-file: 2015-06-01-preview/Tasks/UpdateTaskResourceGroupLocation_example.json + */ + /** + * Sample code: Change security recommendation task state. + * + * @param manager Entry point to SecurityManager. + */ + public static void + changeSecurityRecommendationTaskState(com.azure.resourcemanager.security.SecurityManager manager) { + manager.tasks() + .updateResourceGroupLevelTaskStateWithResponse("myRg", "westeurope", "d55b4dc0-779c-c66c-33e5-d7bce24c4222", + TaskUpdateActionType.DISMISS, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksUpdateSubscriptionLevelTaskStateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksUpdateSubscriptionLevelTaskStateSamples.java new file mode 100644 index 000000000000..e670ab73b6dc --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksUpdateSubscriptionLevelTaskStateSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.TaskUpdateActionType; + +/** + * Samples for Tasks UpdateSubscriptionLevelTaskState. + */ +public final class TasksUpdateSubscriptionLevelTaskStateSamples { + /* + * x-ms-original-file: 2015-06-01-preview/Tasks/UpdateTaskSubscriptionLocation_example.json + */ + /** + * Sample code: Change security recommendation task state. + * + * @param manager Entry point to SecurityManager. + */ + public static void + changeSecurityRecommendationTaskState(com.azure.resourcemanager.security.SecurityManager manager) { + manager.tasks() + .updateSubscriptionLevelTaskStateWithResponse("westeurope", "62609ee7-d0a5-8616-9fe4-1df5cca7758d", + TaskUpdateActionType.DISMISS, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TopologyListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TopologyListSamples.java new file mode 100644 index 000000000000..18d3fc0500db --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TopologyListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for Topology List. + */ +public final class TopologyListSamples { + /* + * x-ms-original-file: 2020-01-01/Topology/GetTopologySubscription_example.json + */ + /** + * Sample code: Get topology on a subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void getTopologyOnASubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.topologies().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TopologyResourcesGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TopologyResourcesGetSamples.java new file mode 100644 index 000000000000..f1718be30b2a --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TopologyResourcesGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for TopologyResources Get. + */ +public final class TopologyResourcesGetSamples { + /* + * x-ms-original-file: 2020-01-01/Topology/GetTopology_example.json + */ + /** + * Sample code: Get topology. + * + * @param manager Entry point to SecurityManager. + */ + public static void getTopology(com.azure.resourcemanager.security.SecurityManager manager) { + manager.topologyResources() + .getWithResponse("myservers", "centralus", "vnets", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TopologyResourcesListByHomeRegionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TopologyResourcesListByHomeRegionSamples.java new file mode 100644 index 000000000000..046ec90f6373 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TopologyResourcesListByHomeRegionSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for TopologyResources ListByHomeRegion. + */ +public final class TopologyResourcesListByHomeRegionSamples { + /* + * x-ms-original-file: 2020-01-01/Topology/GetTopologySubscriptionLocation_example.json + */ + /** + * Sample code: Get topology on a subscription from security data location. + * + * @param manager Entry point to SecurityManager. + */ + public static void + getTopologyOnASubscriptionFromSecurityDataLocation(com.azure.resourcemanager.security.SecurityManager manager) { + manager.topologyResources().listByHomeRegion("centralus", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsCreateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsCreateSamples.java new file mode 100644 index 000000000000..a9b548177082 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsCreateSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for WorkspaceSettings Create. + */ +public final class WorkspaceSettingsCreateSamples { + /* + * x-ms-original-file: 2017-08-01-preview/WorkspaceSettings/CreateWorkspaceSetting_example.json + */ + /** + * Sample code: Create a workspace setting data for subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void + createAWorkspaceSettingDataForSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.workspaceSettings() + .define("default") + .withWorkspaceId( + "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace") + .withScope("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23") + .create(); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsDeleteSamples.java new file mode 100644 index 000000000000..90881798eaa2 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for WorkspaceSettings Delete. + */ +public final class WorkspaceSettingsDeleteSamples { + /* + * x-ms-original-file: 2017-08-01-preview/WorkspaceSettings/DeleteWorkspaceSetting_example.json + */ + /** + * Sample code: Delete a workspace setting data for resource group. + * + * @param manager Entry point to SecurityManager. + */ + public static void + deleteAWorkspaceSettingDataForResourceGroup(com.azure.resourcemanager.security.SecurityManager manager) { + manager.workspaceSettings().deleteWithResponse("default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsGetSamples.java new file mode 100644 index 000000000000..a7681b745e60 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsGetSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for WorkspaceSettings Get. + */ +public final class WorkspaceSettingsGetSamples { + /* + * x-ms-original-file: 2017-08-01-preview/WorkspaceSettings/GetWorkspaceSetting_example.json + */ + /** + * Sample code: Get a workspace setting on subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void getAWorkspaceSettingOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.workspaceSettings().getWithResponse("default", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsListSamples.java new file mode 100644 index 000000000000..0932b3dfeb0c --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +/** + * Samples for WorkspaceSettings List. + */ +public final class WorkspaceSettingsListSamples { + /* + * x-ms-original-file: 2017-08-01-preview/WorkspaceSettings/GetWorkspaceSettings_example.json + */ + /** + * Sample code: Get workspace settings on subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void getWorkspaceSettingsOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + manager.workspaceSettings().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsUpdateSamples.java new file mode 100644 index 000000000000..a524fc3a2253 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsUpdateSamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.security.generated; + +import com.azure.resourcemanager.security.models.WorkspaceSetting; + +/** + * Samples for WorkspaceSettings Update. + */ +public final class WorkspaceSettingsUpdateSamples { + /* + * x-ms-original-file: 2017-08-01-preview/WorkspaceSettings/UpdateWorkspaceSetting_example.json + */ + /** + * Sample code: Update a workspace setting data for subscription. + * + * @param manager Entry point to SecurityManager. + */ + public static void + updateAWorkspaceSettingDataForSubscription(com.azure.resourcemanager.security.SecurityManager manager) { + WorkspaceSetting resource + = manager.workspaceSettings().getWithResponse("default", com.azure.core.util.Context.NONE).getValue(); + resource.update() + .withWorkspaceId( + "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace") + .withScope("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23") + .apply(); + } +} diff --git a/sdk/security/azure-resourcemanager-security/tsp-location.yaml b/sdk/security/azure-resourcemanager-security/tsp-location.yaml index 1c948721d7c8..8416bb7b0d21 100644 --- a/sdk/security/azure-resourcemanager-security/tsp-location.yaml +++ b/sdk/security/azure-resourcemanager-security/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/security/resource-manager/Microsoft.Security/Security -commit: 41784cfad64229e05cb37b1532a686a0cc3a60a9 +commit: 39bf1b80fd8bc55b091192d51d67433c84930639 repo: Azure/azure-rest-api-specs additionalDirectories: diff --git a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ArmApplicationHealthPolicy.java b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ArmApplicationHealthPolicy.java index e5e155720eca..f9f17aaa0afe 100644 --- a/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ArmApplicationHealthPolicy.java +++ b/sdk/servicefabric/azure-resourcemanager-servicefabric/src/main/java/com/azure/resourcemanager/servicefabric/models/ArmApplicationHealthPolicy.java @@ -23,6 +23,7 @@ public final class ArmApplicationHealthPolicy implements JsonSerializable listByApplications(String resourceGroupName, String applicationName, Context context); /** - * A long-running resource action. + * The restartReplica operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. @@ -277,7 +277,7 @@ SyncPoller, Void> beginRestartReplica(String resourceGroupName, String applicationName, String serviceName, RestartReplicaRequest parameters); /** - * A long-running resource action. + * The restartReplica operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. @@ -295,7 +295,7 @@ SyncPoller, Void> beginRestartReplica(String resourceGroupName, String applicationName, String serviceName, RestartReplicaRequest parameters, Context context); /** - * A long-running resource action. + * The restartReplica operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. @@ -311,7 +311,7 @@ void restartReplica(String resourceGroupName, String clusterName, String applica RestartReplicaRequest parameters); /** - * A long-running resource action. + * The restartReplica operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. diff --git a/sdk/servicefabricmanagedclusters/azure-resourcemanager-servicefabricmanagedclusters/src/main/java/com/azure/resourcemanager/servicefabricmanagedclusters/implementation/ServicesClientImpl.java b/sdk/servicefabricmanagedclusters/azure-resourcemanager-servicefabricmanagedclusters/src/main/java/com/azure/resourcemanager/servicefabricmanagedclusters/implementation/ServicesClientImpl.java index b9d79cd49ac1..b4fa8458a3c7 100644 --- a/sdk/servicefabricmanagedclusters/azure-resourcemanager-servicefabricmanagedclusters/src/main/java/com/azure/resourcemanager/servicefabricmanagedclusters/implementation/ServicesClientImpl.java +++ b/sdk/servicefabricmanagedclusters/azure-resourcemanager-servicefabricmanagedclusters/src/main/java/com/azure/resourcemanager/servicefabricmanagedclusters/implementation/ServicesClientImpl.java @@ -907,7 +907,7 @@ public PagedIterable listByApplications(String resourceGro } /** - * A long-running resource action. + * The restartReplica operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. @@ -931,7 +931,7 @@ private Mono>> restartReplicaWithResponseAsync(String } /** - * A long-running resource action. + * The restartReplica operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. @@ -953,7 +953,7 @@ private Response restartReplicaWithResponse(String resourceGroupName } /** - * A long-running resource action. + * The restartReplica operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. @@ -976,7 +976,7 @@ private Response restartReplicaWithResponse(String resourceGroupName } /** - * A long-running resource action. + * The restartReplica operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. @@ -998,7 +998,7 @@ private PollerFlux, Void> beginRestartReplicaAsync(String resou } /** - * A long-running resource action. + * The restartReplica operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. @@ -1019,7 +1019,7 @@ public SyncPoller, Void> beginRestartReplica(String resourceGro } /** - * A long-running resource action. + * The restartReplica operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. @@ -1041,7 +1041,7 @@ public SyncPoller, Void> beginRestartReplica(String resourceGro } /** - * A long-running resource action. + * The restartReplica operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. @@ -1061,7 +1061,7 @@ private Mono restartReplicaAsync(String resourceGroupName, String clusterN } /** - * A long-running resource action. + * The restartReplica operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. @@ -1079,7 +1079,7 @@ public void restartReplica(String resourceGroupName, String clusterName, String } /** - * A long-running resource action. + * The restartReplica operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. diff --git a/sdk/servicefabricmanagedclusters/azure-resourcemanager-servicefabricmanagedclusters/src/main/java/com/azure/resourcemanager/servicefabricmanagedclusters/models/ServiceResource.java b/sdk/servicefabricmanagedclusters/azure-resourcemanager-servicefabricmanagedclusters/src/main/java/com/azure/resourcemanager/servicefabricmanagedclusters/models/ServiceResource.java index 5d04d7f0d797..80bab44b0155 100644 --- a/sdk/servicefabricmanagedclusters/azure-resourcemanager-servicefabricmanagedclusters/src/main/java/com/azure/resourcemanager/servicefabricmanagedclusters/models/ServiceResource.java +++ b/sdk/servicefabricmanagedclusters/azure-resourcemanager-servicefabricmanagedclusters/src/main/java/com/azure/resourcemanager/servicefabricmanagedclusters/models/ServiceResource.java @@ -254,7 +254,7 @@ interface WithTags { ServiceResource refresh(Context context); /** - * A long-running resource action. + * The restartReplica operation. * * @param parameters The parameters for restarting replicas. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -264,7 +264,7 @@ interface WithTags { void restartReplica(RestartReplicaRequest parameters); /** - * A long-running resource action. + * The restartReplica operation. * * @param parameters The parameters for restarting replicas. * @param context The context to associate with this operation. diff --git a/sdk/servicefabricmanagedclusters/azure-resourcemanager-servicefabricmanagedclusters/src/main/java/com/azure/resourcemanager/servicefabricmanagedclusters/models/Services.java b/sdk/servicefabricmanagedclusters/azure-resourcemanager-servicefabricmanagedclusters/src/main/java/com/azure/resourcemanager/servicefabricmanagedclusters/models/Services.java index 306723c06fed..e2611a148248 100644 --- a/sdk/servicefabricmanagedclusters/azure-resourcemanager-servicefabricmanagedclusters/src/main/java/com/azure/resourcemanager/servicefabricmanagedclusters/models/Services.java +++ b/sdk/servicefabricmanagedclusters/azure-resourcemanager-servicefabricmanagedclusters/src/main/java/com/azure/resourcemanager/servicefabricmanagedclusters/models/Services.java @@ -108,7 +108,7 @@ PagedIterable listByApplications(String resourceGroupName, Stri String applicationName, Context context); /** - * A long-running resource action. + * The restartReplica operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. @@ -123,7 +123,7 @@ void restartReplica(String resourceGroupName, String clusterName, String applica RestartReplicaRequest parameters); /** - * A long-running resource action. + * The restartReplica operation. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the cluster resource. diff --git a/sdk/storage/azure-resourcemanager-storage/tsp-location.yaml b/sdk/storage/azure-resourcemanager-storage/tsp-location.yaml index c9a6fc1b4cb6..9f8ce6c77783 100644 --- a/sdk/storage/azure-resourcemanager-storage/tsp-location.yaml +++ b/sdk/storage/azure-resourcemanager-storage/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/storage/Storage.Management -commit: 9b62943d6689ed4c35d02a05786cc561786e31d7 +commit: 39bf1b80fd8bc55b091192d51d67433c84930639 repo: Azure/azure-rest-api-specs additionalDirectories: diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesPausePrimingJobSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesPausePrimingJobSamples.java index 4f07e2e63ec3..95d0bc1c7148 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesPausePrimingJobSamples.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesPausePrimingJobSamples.java @@ -20,7 +20,7 @@ public final class CachesPausePrimingJobSamples { */ public static void pausePrimingJob(com.azure.resourcemanager.storagecache.StorageCacheManager manager) { manager.caches() - .pausePrimingJob("scgroup", "sc1", new PrimingJobIdParameter().withPrimingJobId("0"), + .pausePrimingJob("scgroup", "sc1", new PrimingJobIdParameter().withPrimingJobId("00000000000_0000000000"), com.azure.core.util.Context.NONE); } } diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesResumePrimingJobSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesResumePrimingJobSamples.java index 9e0ac6407964..ae5b6a8a2a6f 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesResumePrimingJobSamples.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesResumePrimingJobSamples.java @@ -20,7 +20,7 @@ public final class CachesResumePrimingJobSamples { */ public static void resumePrimingJob(com.azure.resourcemanager.storagecache.StorageCacheManager manager) { manager.caches() - .resumePrimingJob("scgroup", "sc1", new PrimingJobIdParameter().withPrimingJobId("0"), + .resumePrimingJob("scgroup", "sc1", new PrimingJobIdParameter().withPrimingJobId("00000000000_0000000000"), com.azure.core.util.Context.NONE); } } diff --git a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesStopPrimingJobSamples.java b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesStopPrimingJobSamples.java index 4a753d19b94a..69ac2aec2727 100644 --- a/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesStopPrimingJobSamples.java +++ b/sdk/storagecache/azure-resourcemanager-storagecache/src/samples/java/com/azure/resourcemanager/storagecache/generated/CachesStopPrimingJobSamples.java @@ -20,7 +20,7 @@ public final class CachesStopPrimingJobSamples { */ public static void stopPrimingJob(com.azure.resourcemanager.storagecache.StorageCacheManager manager) { manager.caches() - .stopPrimingJob("scgroup", "sc1", new PrimingJobIdParameter().withPrimingJobId("0"), + .stopPrimingJob("scgroup", "sc1", new PrimingJobIdParameter().withPrimingJobId("00000000000_0000000000"), com.azure.core.util.Context.NONE); } } diff --git a/sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/implementation/DocumentTranslationClientImpl.java b/sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/implementation/DocumentTranslationClientImpl.java index cefc7bff3134..7012809ecc63 100644 --- a/sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/implementation/DocumentTranslationClientImpl.java +++ b/sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/implementation/DocumentTranslationClientImpl.java @@ -886,6 +886,7 @@ public SyncPoller beginTranslation(BinaryData body, Requ * responses that contain a different page size or contain a continuation token. * * + * * When both top and skip are included, the server should first apply * skip and then top on the collection. * Note: If the server can't honor top @@ -1044,6 +1045,7 @@ private Mono> listTranslationStatusesSinglePageAsync(R * responses that contain a different page size or contain a continuation token. * * + * * When both top and skip are included, the server should first apply * skip and then top on the collection. * Note: If the server can't honor top @@ -1220,6 +1222,7 @@ public PagedFlux listTranslationStatusesAsync(RequestOptions request * responses that contain a different page size or contain a continuation token. * * + * * When both top and skip are included, the server should first apply * skip and then top on the collection. * Note: If the server can't honor top @@ -1376,6 +1379,7 @@ private PagedResponse listTranslationStatusesSinglePage(RequestOptio * responses that contain a different page size or contain a continuation token. * * + * * When both top and skip are included, the server should first apply * skip and then top on the collection. * Note: If the server can't honor top @@ -1842,6 +1846,7 @@ public Response cancelTranslationWithResponse(String translationId, * Returns the status for all documents in a batch document translation request. * * + * * If the number of documents in the response exceeds our paging limit, * server-side paging is used. * Paginated responses indicate a partial result and @@ -1863,6 +1868,7 @@ public Response cancelTranslationWithResponse(String translationId, * more items to be returned), @nextLink will contain the link to the next page. * * + * * orderby query parameter can be used to sort the returned list (ex * "orderby=createdDateTimeUtc asc" or "orderby=createdDateTimeUtc * desc"). @@ -1991,6 +1997,7 @@ private Mono> listDocumentStatusesSinglePageAsync(Stri * Returns the status for all documents in a batch document translation request. * * + * * If the number of documents in the response exceeds our paging limit, * server-side paging is used. * Paginated responses indicate a partial result and @@ -2012,6 +2019,7 @@ private Mono> listDocumentStatusesSinglePageAsync(Stri * more items to be returned), @nextLink will contain the link to the next page. * * + * * orderby query parameter can be used to sort the returned list (ex * "orderby=createdDateTimeUtc asc" or "orderby=createdDateTimeUtc * desc"). @@ -2158,6 +2166,7 @@ public PagedFlux listDocumentStatusesAsync(String translationId, Req * Returns the status for all documents in a batch document translation request. * * + * * If the number of documents in the response exceeds our paging limit, * server-side paging is used. * Paginated responses indicate a partial result and @@ -2179,6 +2188,7 @@ public PagedFlux listDocumentStatusesAsync(String translationId, Req * more items to be returned), @nextLink will contain the link to the next page. * * + * * orderby query parameter can be used to sort the returned list (ex * "orderby=createdDateTimeUtc asc" or "orderby=createdDateTimeUtc * desc"). @@ -2306,6 +2316,7 @@ private PagedResponse listDocumentStatusesSinglePage(String translat * Returns the status for all documents in a batch document translation request. * * + * * If the number of documents in the response exceeds our paging limit, * server-side paging is used. * Paginated responses indicate a partial result and @@ -2327,6 +2338,7 @@ private PagedResponse listDocumentStatusesSinglePage(String translat * more items to be returned), @nextLink will contain the link to the next page. * * + * * orderby query parameter can be used to sort the returned list (ex * "orderby=createdDateTimeUtc asc" or "orderby=createdDateTimeUtc * desc").